.classpath | 16 dev/null |binary etc/cli-scripts/reset_apache_props.js | 102 + etc/cli-scripts/reset_conn_props.js | 240 -- etc/cli-scripts/reset_jboss_agent_props.js | 110 + etc/dev-utils/jdk.sh | 26 etc/samples/provisioning/sample-bundle/pom.xml | 92 + etc/samples/provisioning/sample-bundle/src/main/bundle/deploy.xml | 57 etc/samples/provisioning/sample-bundle/src/main/bundle/jbossas-init-config | 69 etc/samples/provisioning/sample-bundle/src/main/bundle/jbossas-init-script | 328 +++ etc/samples/provisioning/sample-bundle/src/main/petstore/petstore-db.changelog.xml | 187 ++ etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore-ds.xml | 42 etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/META-INF/application.xml | 19 etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore-ejb.jar/META-INF/persistence.xml | 21 etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore-ejb.jar/com/sun/javaee/blueprints/petstore/model/Address.class |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore-ejb.jar/com/sun/javaee/blueprints/petstore/model/Category.class |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore-ejb.jar/com/sun/javaee/blueprints/petstore/model/Item.class |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore-ejb.jar/com/sun/javaee/blueprints/petstore/model/Product.class |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore-ejb.jar/com/sun/javaee/blueprints/petstore/model/SellerContactInfo.class |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore-ejb.jar/com/sun/javaee/blueprints/petstore/model/Tag.class |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore-ejb.jar/com/sun/javaee/blueprints/petstore/model/ZipLocation.class |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/META-INF/MANIFEST.MF | 4 etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/captcha/BlueFilter.class |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/captcha/CaptchaSingleton.class |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/captcha/RandomString.class |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/captcha/SimpleCaptcha.class |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/AddressBean.class |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/AutocompleteBean.class |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/CaptchaValidateFilter.class |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/ControllerAction.class |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/ControllerServlet.class |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/EntryFilter.class |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/FileUploadBean.class |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/actions/CaptchaAction.class |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/actions/CatalogXmlAction.class |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/actions/DefaultControllerAction.class |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/actions/ImageAction.class |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/actions/TagXmlAction.class |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/mapviewer/MapBean.class |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/model/CatalogFacade.class |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/model/FileUploadResponse.class |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/model/PayPalBean.class |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/model/RatingBean.class |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/proxy/GeoCoder.class |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/proxy/GeoPoint.class |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/search/HTMLParser$CallbackHandler.class |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/search/HTMLParser.class |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/search/IndexDocument.class |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/search/Indexer.class |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/search/SQLParser.class |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/search/SearchBean.class |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/search/SearchIndex.class |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/search/UpdateIndex.class |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/util/ImageScaler.class |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/util/LogStrings.properties | 10 etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/util/MessageStrings.properties | 10 etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/util/PetstoreConstants.class |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/util/PetstoreUtil.class |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/faces-config.xml | 94 + etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/jboss-web.xml | 10 etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/bp-ui-5.jar |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/commons-fileupload-1.1.1.jar |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/commons-io-1.2.jar |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/commons-logging-1.1.jar |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/jdom.jar |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/lucene-core-2.0.0.jar |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/rome-0.8.jar |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/rome-fetcher-0.7.jar |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/shale-remoting.jar |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/sun-web.xml | 14 etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/web.xml | 126 + etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/accordion.css | 1 etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/accordion.js | 249 ++ etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/banner.jsp | 80 etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/bp_petstorelist.css | 48 etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/bp_petstorelist.js | 269 +++ etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/bp_petstorelist_dom.js | 136 + etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/bp_petstorelist_one_div.js | 159 + etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/captchaerror.jsp | 23 etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/catalog.js | 329 +++ etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/catalog.jsp | 95 + etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/catalog.jsp-old | 95 + etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/common.js | 77 etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/download.jsp | 22 etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/downloadAd.js | 54 etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/downloadAd.json | 7 etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/downloadAd.txt | 1 etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/engine.js | 241 ++ etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/fileupload.jsp | 266 +++ etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/fileuploadstatus.jsp | 134 + etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/footer.jsp | 15 etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9081-s.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9081.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9083-s.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9083.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9084-s.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9084.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9086-s.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9086.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9088-s.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9088.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9099-s.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9099.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9100-s.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9100.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9101-s.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9101.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9102-s.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9102.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9103-s.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9103.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9104-s.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9104.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9107-s.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9107.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9109-s.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9109.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9113-s.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9113.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9115-s.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9115.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9117-s.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9117.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9118-s.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9118.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9122-s.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9122.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9123-s.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9123.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9125-s.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9125.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9127-s.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9127.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9129-s.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9129.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9134-s.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9134.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9138-s.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9138.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9142-s.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9142.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9149-s.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9149.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9154-s.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9154.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9155-s.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9155.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9156-s.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9156.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9157-s.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9157.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9158-s.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9158.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9159-s.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9159.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9162-s.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9162.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9165-s.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9165.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/ad-jre.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/ad-netbeans.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/ad-sdk.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/african-spurred-tortoise-thumb.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/african-spurred-tortoise.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/african-spurred-tortoise2-thumb.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/african-spurred-tortoise2.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/anthony-s.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/anthony.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bailey-s.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bailey.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/banner_logo.gif |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bird1.gif |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bird2.gif |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bird3.gif |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bird4.gif |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bird5.gif |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bird6.gif |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/birds_icon.gif |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/biscuit-s.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/biscuit.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bob-s.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bob.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/box-turtle-thumb.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/box-turtle.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/box-turtle2-thumb.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/box-turtle2.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/box-turtle3-thumb.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/box-turtle3.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/california-desert-tortoise-thumb.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/california-desert-tortoise.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/carp-car-med.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/carp-car-thumb.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat1.gif |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat10.gif |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat11.gif |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat12.gif |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat2.gif |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat3.gif |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat4.gif |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat5.gif |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat6.gif |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat7.gif |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat8.gif |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat9.gif |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/catalog-thumb-g.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/catalog-thumb.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cats_icon.gif |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cbutton.gif |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/chantelle-s.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/chantelle.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/charlie-s.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/charlie.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/check_all.gif |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cuttlefish-med.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cuttlefish-thumb.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dog1.gif |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dog2.gif |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dog3.gif |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dog4.gif |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dog5.gif |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dog6.gif |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dogs_icon.gif |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dragon-iron-med.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dragon-iron-thumb.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/eagle-stone-med.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/eagle-stone-thumb.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/eclectus-female-med.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/eclectus-female-thumb.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/elkie-s.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/elkie.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/faith-s.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/faith.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/fish2.gif |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/fish3.gif |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/fish4.gif |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/fish_icon.gif |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/florida-king-snake-thumb.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/florida-king-snake.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/frog1.gif |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/gaetano-s.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/gaetano.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/galah-parrot-med.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/galah-parrot-thumb.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/glassfish-colored-med.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/glassfish-colored-thumb.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/guinea-pig-thumb.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/guinea-pig.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/harmony-s.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/harmony.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/harrison-s.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/harrison.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/hawaiian-lizard-med.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/hawaiian-lizard-thumb.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/honey-s.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/honey.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/hunter-s.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/hunter.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/index-thumb-g.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/index-thumb.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/indicator-black.gif |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/ja_flag.gif |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/jack-s.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/jack.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/katzen-s.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/katzen.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/koi-med.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/koi-thumb.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/kookaburra-med.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/kookaburra-thumb.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/lady-s.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/lady.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/left.gif |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/left_2.gif |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/leopard-gecko-thumb.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/leopard-gecko-thumb2.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/leopard-gecko.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/leopard-gecko2.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/lizard1.gif |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/lizard2.gif |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/lizard3.gif |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/lovebird-med.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/lovebird-thumb.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/macaw-thumb.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/macaw.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/maggie-s.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/maggie.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/marianna-s.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/marianna.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/mario-s.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/mario.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/maximize.gif |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/mexican-redkneed-tarantula-thumb.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/mexican-redkneed-tarantula.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/mimi-s.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/mimi.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/minimize.gif |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/monique-s.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/monique.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/moon-jelly-med.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/moon-jelly-thumb.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/octopus-red-med.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/octopus-red-thumb.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/octopus-white-med.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/octopus-white-thumb.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/olie-s.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/olie.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/paris-s.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/paris.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/parrot-popcorn-s.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/parrot-popcorn.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/peacock-blue-med.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/peacock-blue-thumb.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/peacock-med.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/peacock-thumb.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/peacock-white-thumb.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/peakcock-white-med.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/prehensile-tailed-skink-thumb.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/prehensile-tailed-skink.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/prehensile-tailed-skink2-thumb.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/prehensile-tailed-skink2.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/princess-s.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/princess.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/puppup-s.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/puppup.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/purple-jellyfish-med.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/purple-jellyfish-thumb.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/rainbow-lorikeet-med.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/rainbow-lorikeet-thumb.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/reptiles_icon.gif |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/right.gif |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/rita-s.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/rita.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/rockfish-med.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/rockfish-thumb.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/sabrina-s.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/sabrina.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/sea-anemone-med.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/sea-anemone-thumb.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/sea-nettle-jellyfish-med.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/sea-nettle-jellyfish-thumb.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/seller-thumb-g.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/seller-thumb.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/simba-s.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/simba.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/splash.gif |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/spotted-jellyfish-med.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/spotted-jellyfish-thumb.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/thaicat-s.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/thaicat.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/thaidog-s.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/thaidog.jpg |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/uncheck_all.gif |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/us_flag.gif |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/zh_flag.gif |binary etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/index-ajax.jsp | 239 ++ etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/index.html | 117 + etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/index.jsp | 164 + etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/index_a.jsp | 194 ++ etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/jsonTest.jsp | 53 etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/lookup.jsp | 36 etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/main.htmf | 36 etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/main.js | 21 etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/map.jsp | 143 + etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/mapAll.jsp | 65 etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/news.js | 190 ++ etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/news.jsp | 51 etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/petstoreListTest.jsp | 21 etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/rss.js | 110 + etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/rss.jsp | 33 etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/rssbar.jsp | 20 etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/rteToolBar.html | 60 etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/scroller.css | 1 etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/scroller.js | 643 +++++++ etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/search.jsp | 290 +++ etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/styles.css | 130 + etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/systemerror.jsp | 28 etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/tag.css | 47 etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/tag.jsp | 158 + etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/tagItemLookup.jsp | 45 etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/testis.jsp | 36 etc/samples/provisioning/sample-bundle/src/main/scripts/assembly.xml | 41 etc/samples/provisioning/sample-bundle/src/main/scripts/build.xml | 63 etc/samples/provisioning/sample-cli/resources/sample-bundle-v1.zip |binary etc/samples/provisioning/sample-cli/resources/sample-bundle-v2.zip |binary etc/samples/provisioning/sample-cli/scripts/cli-1-createBundle.js | 59 etc/samples/provisioning/sample-cli/scripts/cli-2-deployBundle.js | 102 + etc/samples/provisioning/sample-cli/scripts/cli-3-upgradeBundle.js | 83 etc/samples/provisioning/sample-cli/scripts/cli-4-revertBundle.js | 61 etc/samples/sample-bundle/pom.xml | 92 - etc/samples/sample-bundle/src/main/bundle/deploy.xml | 57 etc/samples/sample-bundle/src/main/bundle/jbossas-init-config | 69 etc/samples/sample-bundle/src/main/bundle/jbossas-init-script | 328 --- etc/samples/sample-bundle/src/main/petstore/petstore-db.changelog.xml | 187 -- etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore-ds.xml | 42 etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/META-INF/application.xml | 19 etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore-ejb.jar/META-INF/persistence.xml | 21 etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/META-INF/MANIFEST.MF | 4 etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/util/LogStrings.properties | 10 etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/util/MessageStrings.properties | 10 etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/faces-config.xml | 94 - etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/jboss-web.xml | 10 etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/sun-web.xml | 14 etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/web.xml | 126 - etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/accordion.css | 1 etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/accordion.js | 249 -- etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/banner.jsp | 80 etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/bp_petstorelist.css | 48 etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/bp_petstorelist.js | 269 --- etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/bp_petstorelist_dom.js | 136 - etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/bp_petstorelist_one_div.js | 159 - etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/captchaerror.jsp | 23 etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/catalog.js | 329 --- etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/catalog.jsp | 95 - etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/catalog.jsp-old | 95 - etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/common.js | 77 etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/download.jsp | 22 etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/downloadAd.js | 54 etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/downloadAd.json | 7 etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/downloadAd.txt | 1 etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/engine.js | 241 -- etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/fileupload.jsp | 266 --- etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/fileuploadstatus.jsp | 134 - etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/footer.jsp | 15 etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/index-ajax.jsp | 239 -- etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/index.html | 117 - etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/index.jsp | 164 - etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/index_a.jsp | 194 -- etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/jsonTest.jsp | 53 etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/lookup.jsp | 36 etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/main.htmf | 36 etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/main.js | 21 etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/map.jsp | 143 - etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/mapAll.jsp | 65 etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/news.js | 190 -- etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/news.jsp | 51 etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/petstoreListTest.jsp | 21 etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/rss.js | 110 - etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/rss.jsp | 33 etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/rssbar.jsp | 20 etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/rteToolBar.html | 60 etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/scroller.css | 1 etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/scroller.js | 643 ------- etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/search.jsp | 290 --- etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/styles.css | 130 - etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/systemerror.jsp | 28 etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/tag.css | 47 etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/tag.jsp | 158 - etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/tagItemLookup.jsp | 45 etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/testis.jsp | 36 etc/samples/sample-bundle/src/main/scripts/assembly.xml | 41 etc/samples/sample-bundle/src/main/scripts/build.xml | 63 etc/standalone-pc/standalone.sh | 2 modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/AntLauncher.java | 8 modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/AntMain.java | 10 modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/BundleAntProject.java | 16 modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/task/BundleTask.java | 15 modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/type/InputPropertyType.java | 78 modules/core/client-api/src/main/java/org/rhq/core/clientapi/agent/measurement/MeasurementAgentService.java | 50 modules/core/dbutils/pom.xml | 18 modules/core/dbutils/src/main/java/org/rhq/core/db/DatabaseTypeFactory.java | 2 modules/core/dbutils/src/main/java/org/rhq/core/db/H2v12DatabaseType.java | 42 modules/core/dbutils/src/main/java/org/rhq/core/db/ant/dbupgrade/SchemaSpec.java | 29 modules/core/dbutils/src/main/java/org/rhq/core/db/ant/dbupgrade/SchemaSpecTask.java | 17 modules/core/dbutils/src/main/java/org/rhq/core/db/upgrade/CustomAlertSenderUpgradeTask.java | 258 ++- modules/core/dbutils/src/main/scripts/dbsetup/alert-schema.xml | 7 modules/core/dbutils/src/main/scripts/dbsetup/cluster-schema.xml | 2 modules/core/dbutils/src/main/scripts/dbsetup/content-schema.xml | 20 modules/core/dbutils/src/main/scripts/dbsetup/inventory-schema.xml | 13 modules/core/dbutils/src/main/scripts/dbsetup/measurement-schema.xml | 10 modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml | 341 ++-- modules/core/domain/pom.xml | 100 - modules/core/domain/src/main/java/org/rhq/core/domain/alert/Alert.java | 15 modules/core/domain/src/main/java/org/rhq/core/domain/alert/AlertDefinition.java | 45 modules/core/domain/src/main/java/org/rhq/core/domain/alert/BooleanExpression.java | 46 modules/core/domain/src/main/java/org/rhq/core/domain/alert/notification/AlertNotification.java | 3 modules/core/domain/src/main/java/org/rhq/core/domain/alert/notification/AlertNotificationLog.java | 96 - modules/core/domain/src/main/java/org/rhq/core/domain/alert/notification/ResultState.java | 14 modules/core/domain/src/main/java/org/rhq/core/domain/alert/notification/SenderResult.java | 156 + modules/core/domain/src/main/java/org/rhq/core/domain/auth/Subject.java | 14 modules/core/domain/src/main/java/org/rhq/core/domain/authz/Permission.java | 12 modules/core/domain/src/main/java/org/rhq/core/domain/bundle/Bundle.java | 2 modules/core/domain/src/main/java/org/rhq/core/domain/common/ProductInfo.java | 121 + modules/core/domain/src/main/java/org/rhq/core/domain/configuration/PropertyList.java | 3 modules/core/domain/src/main/java/org/rhq/core/domain/configuration/ResourceConfigurationUpdate.java | 4 modules/core/domain/src/main/java/org/rhq/core/domain/content/AdvisoryBuglist.java | 2 modules/core/domain/src/main/java/org/rhq/core/domain/content/AdvisoryCVE.java | 7 modules/core/domain/src/main/java/org/rhq/core/domain/content/AdvisoryPackage.java | 4 modules/core/domain/src/main/java/org/rhq/core/domain/content/DistributionFile.java | 2 modules/core/domain/src/main/java/org/rhq/core/domain/content/PackageBits.java | 70 modules/core/domain/src/main/java/org/rhq/core/domain/content/PackageBitsBlob.java | 107 + modules/core/domain/src/main/java/org/rhq/core/domain/content/PackageVersion.java | 12 modules/core/domain/src/main/java/org/rhq/core/domain/content/PackageVersionContentSource.java | 4 modules/core/domain/src/main/java/org/rhq/core/domain/content/ProductVersionPackageVersion.java | 4 modules/core/domain/src/main/java/org/rhq/core/domain/content/RepoAdvisory.java | 4 modules/core/domain/src/main/java/org/rhq/core/domain/content/RepoContentSource.java | 4 modules/core/domain/src/main/java/org/rhq/core/domain/content/RepoDistribution.java | 4 modules/core/domain/src/main/java/org/rhq/core/domain/content/RepoPackageVersion.java | 4 modules/core/domain/src/main/java/org/rhq/core/domain/content/RepoRepoGroup.java | 4 modules/core/domain/src/main/java/org/rhq/core/domain/content/RepoRepoRelationship.java | 4 modules/core/domain/src/main/java/org/rhq/core/domain/content/ResourceRepo.java | 4 modules/core/domain/src/main/java/org/rhq/core/domain/criteria/AlertDefinitionCriteria.java | 21 modules/core/domain/src/main/java/org/rhq/core/domain/criteria/BundleResourceDeploymentCriteria.java | 6 modules/core/domain/src/main/java/org/rhq/core/domain/criteria/CallTimeDataCriteria.java | 219 ++ modules/core/domain/src/main/java/org/rhq/core/domain/criteria/Criteria.java | 10 modules/core/domain/src/main/java/org/rhq/core/domain/criteria/EventCriteria.java | 6 modules/core/domain/src/main/java/org/rhq/core/domain/criteria/MeasurementScheduleCriteria.java | 34 modules/core/domain/src/main/java/org/rhq/core/domain/criteria/ResourceConfigurationUpdateCriteria.java | 162 + modules/core/domain/src/main/java/org/rhq/core/domain/criteria/ResourceCriteria.java | 41 modules/core/domain/src/main/java/org/rhq/core/domain/criteria/ResourceGroupCriteria.java | 25 modules/core/domain/src/main/java/org/rhq/core/domain/install/remote/AgentInstallInfo.java | 34 modules/core/domain/src/main/java/org/rhq/core/domain/install/remote/AgentInstallStep.java | 46 modules/core/domain/src/main/java/org/rhq/core/domain/install/remote/RemoteAccessInfo.java | 25 modules/core/domain/src/main/java/org/rhq/core/domain/measurement/composite/MeasurementOOBComposite.java | 3 modules/core/domain/src/main/java/org/rhq/core/domain/resource/Resource.java | 51 modules/core/domain/src/main/java/org/rhq/core/domain/resource/ResourceSubCategory.java | 9 modules/core/domain/src/main/java/org/rhq/core/domain/resource/ResourceType.java | 165 - modules/core/domain/src/main/java/org/rhq/core/domain/resource/composite/ResourceComposite.java | 22 modules/core/domain/src/main/java/org/rhq/core/domain/resource/composite/ResourceFacets.java | 38 modules/core/domain/src/main/java/org/rhq/core/domain/resource/composite/ResourceNamesDisambiguationResult.java | 58 modules/core/domain/src/main/java/org/rhq/core/domain/resource/composite/ResourcePermission.java | 91 - modules/core/domain/src/main/java/org/rhq/core/domain/resource/group/ClusterKey.java | 237 ++ modules/core/domain/src/main/java/org/rhq/core/domain/resource/group/Group.java | 65 modules/core/domain/src/main/java/org/rhq/core/domain/resource/group/GroupDefinition.java | 58 modules/core/domain/src/main/java/org/rhq/core/domain/resource/group/ResourceGroup.java | 4 modules/core/domain/src/main/java/org/rhq/core/domain/resource/group/composite/ClusterFlyweight.java | 99 + modules/core/domain/src/main/java/org/rhq/core/domain/resource/group/composite/ClusterKeyFlyweight.java | 62 modules/core/domain/src/main/java/org/rhq/core/domain/resource/group/composite/ResourceGroupComposite.java | 18 modules/core/domain/src/main/java/org/rhq/core/domain/search/SavedSearch.java | 2 modules/core/domain/src/main/java/org/rhq/core/domain/search/SearchSuggestion.java | 14 modules/core/domain/src/test/java/org/rhq/core/domain/configuration/test/DataSourceExample.java | 2 modules/core/domain/src/test/java/org/rhq/core/domain/content/test/PackageVersionContentSourceTest.java | 30 modules/core/domain/src/test/java/org/rhq/core/domain/test/QueriesTest.java | 8 modules/core/gui/src/main/java/org/rhq/core/gui/configuration/propset/ConfigurationSet.java | 17 modules/core/native-system/ant-run.xml | 2 modules/core/plugin-api/src/main/java/org/rhq/core/pluginapi/configuration/ConfigurationFacet.java | 47 modules/core/plugin-container/src/main/java/org/rhq/core/pc/PluginContainer.java | 22 modules/core/plugin-container/src/main/java/org/rhq/core/pc/content/ContentManager.java | 2 modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/AvailabilityExecutor.java | 170 -- modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/InventoryManager.java | 26 modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/ResourceContainer.java | 2 modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/RuntimeDiscoveryExecutor.java | 2 modules/core/plugin-container/src/main/java/org/rhq/core/pc/measurement/MeasurementManager.java | 18 modules/core/plugin-container/src/main/java/org/rhq/core/pc/plugin/CanonicalResourceKey.java | 170 +- modules/core/plugin-container/src/test/java/org/rhq/core/pc/plugin/CanonicalResourceKeyTest.java | 155 + modules/core/plugin-validator/pom.xml | 18 modules/core/util/pom.xml | 7 modules/core/util/src/main/java/org/rhq/core/util/exception/ThrowableUtil.java | 52 modules/core/util/src/main/java/org/rhq/core/util/updater/Deployer.java | 4 modules/enterprise/agent/ant-run.xml | 2 modules/enterprise/agent/pom.xml | 5 modules/enterprise/agent/src/etc/rhq-agent-wrapper.sh | 24 modules/enterprise/agent/src/etc/rhq-agent.sh | 14 modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/AgentMain.java | 95 - modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/i18n/AgentI18NResourceKeys.java | 44 modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/promptcmd/InventoryPromptCommand.java | 65 modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/promptcmd/SchedulesPromptCommand.java | 80 modules/enterprise/comm/pom.xml | 5 modules/enterprise/gui/base-perspective-jar/pom.xml | 2 modules/enterprise/gui/coregui/pom.xml | 48 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml | 7 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/Breadcrumb.java | 29 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/BreadcrumbTrailPane.java | 30 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java | 132 + modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/Footer.java | 17 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LinkManager.java | 80 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LoginView.java | 17 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/SearchGUI.java | 36 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/ViewPath.java | 10 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/AdministrationView.java | 71 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/agent/install/RemoteAgentInstallView.java | 377 +++- modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/PermissionEditorView.java | 5 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/RoleEditView.java | 93 - modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/RoleSubjectSelector.java | 83 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/RolesDataSource.java | 3 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/RolesView.java | 22 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/users/SubjectRoleSelector.java | 86 + modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/users/SubjectRolesEditorItem.java | 2 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/users/UserEditView.java | 155 + modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/users/UsersDataSource.java | 26 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/users/UsersView.java | 18 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertDataSource.java | 17 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertsView.java | 27 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/AbstractAlertDefinitionsDataSource.java | 125 + modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/AbstractAlertDefinitionsView.java | 160 + modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/AlertDefinitionsDataSource.java | 194 -- modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/AlertDefinitionsView.java | 69 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/ConditionsAlertDefinitionForm.java | 135 + modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/DampeningAlertDefinitionForm.java | 112 + modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/EditAlertDefinitionForm.java | 21 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/GeneralPropertiesAlertDefinitionForm.java | 244 ++ modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/GroupAlertDefinitionsDataSource.java | 57 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/GroupAlertDefinitionsView.java | 108 + modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/NotificationsAlertDefinitionForm.java | 112 + modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/RecoveryAlertDefinitionForm.java | 126 + modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/ResourceAlertDefinitionsDataSource.java | 116 + modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/ResourceAlertDefinitionsView.java | 117 + modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/SingleAlertDefinitionView.java | 176 ++ modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/TemplateAlertDefinitionsDataSource.java | 57 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/TemplateAlertDefinitionsView.java | 108 + modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/AbstractBundleWizard.java | 87 - modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/BundleSelector.java | 21 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/BundleTopView.java | 8 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/AbstractBundleCreateWizard.java | 4 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleSummaryStep.java | 6 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDataStep.java | 49 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDistroFileStep.java | 38 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadRecipeStep.java | 4 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/AbstractBundleDeployWizard.java | 4 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/DeployStep.java | 4 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDeploymentConfigStep.java | 4 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDeploymentInfoStep.java | 4 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDeploymentOptionsStep.java | 4 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDestinationStep.java | 10 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/SelectBundleStep.java | 6 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/SelectBundleVersionStep.java | 4 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundlesListView.java | 27 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundlesWithLatestVersionDataSource.java | 12 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/revert/AbstractBundleRevertWizard.java | 4 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/revert/ConfirmationStep.java | 36 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/revert/GetRevertInfoStep.java | 4 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/revert/RevertStep.java | 4 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/tree/BundleTreeView.java | 4 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/AboutModalWindow.java | 28 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/FullHTMLPane.java | 7 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/SubTabLayout.java | 101 - modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/configuration/ConfigurationEditor.java | 3 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/form/EnhancedDynamicForm.java | 177 ++ modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/form/RadioGroupWithComponentsItem.java | 15 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/form/TogglableTextItem.java | 62 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/form/ValueUpdatedHandler.java | 8 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/selector/AbstractSelector.java | 286 +++ modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/tab/SubTabLayout.java | 73 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/tab/TwoLevelTab.java | 14 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/tab/TwoLevelTabSet.java | 18 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/BooleanCellFormatter.java | 22 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/Table.java | 74 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/TableWidget.java | 10 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/upload/BundleDistributionFileUploadForm.java | 77 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/upload/BundleFileUploadForm.java | 85 - modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/wizard/AbstractWizard.java | 82 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/wizard/AbstractWizardStep.java | 36 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/wizard/WizardStep.java | 2 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/wizard/WizardView.java | 52 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardsView.java | 20 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/PortletWindow.java | 12 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/inventory/resource/FavoriteResourcesPortlet.java | 15 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/inventory/resource/graph/GraphPortlet.java | 39 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/platform/PlatformPortletView.java | 18 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/alerts/RecentAlertsPortlet.java | 3 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ClusterGWTService.java | 68 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ConfigurationGWTService.java | 8 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/GWTServiceLookup.java | 8 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/MeasurementDataGWTService.java | 23 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/RemoteInstallGWTService.java | 18 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ResourceGWTService.java | 4 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ResourceGroupGWTService.java | 15 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/RoleGWTService.java | 2 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/SearchGWTService.java | 3 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/SystemGWTService.java | 29 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMeasurementScheduleDataSource.java | 217 ++ modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMeasurementScheduleListView.java | 144 + modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/UpdateCollectionIntervalWidget.java | 92 + modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/ResourceGroupListView.java | 82 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/ResourceGroupsDataSource.java | 20 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java | 275 +-- modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupTopView.java | 106 - modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupTreeView.java | 111 + modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/schedules/SchedulesDataSource.java | 113 + modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/schedules/SchedulesView.java | 24 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/summary/OverviewView.java | 241 ++ modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/wizard/GroupCreateStep.java | 49 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/wizard/GroupCreateWizard.java | 56 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/wizard/GroupMembersStep.java | 16 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/InventoryView.java | 190 +- modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceDataSourceField.java | 63 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceDatasource.java | 134 - modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceSearchView.java | 88 - modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceSelectListener.java | 11 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/NewResourceTreeDataSource.java | 360 ++++ modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/NewResourceTreeView.java | 514 ++++++ modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java | 276 +-- modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTopView.java | 160 + modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTreeDatasource.java | 5 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTreeView.java | 355 +++- modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceView.java | 149 - modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/alert/AlertEditView.java | 145 + modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/alert/ResourceAlertHistoryView.java | 6 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/configuration/ConfigurationHistoryDataSource.java | 68 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/configuration/ConfigurationHistoryDetailView.java | 15 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/configuration/ConfigurationHistoryView.java | 138 + modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/event/EventDatasource.java | 2 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/event/EventDetailsView.java | 99 + modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/event/EventHistoryView.java | 28 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/GraphListView.java | 20 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/SmallGraphView.java | 32 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/schedules/SchedulesDataSource.java | 113 + modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/schedules/SchedulesView.java | 24 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/OperationHistoryDataSource.java | 21 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/OperationHistoryView.java | 111 - modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/create/OperationCreateWizard.java | 11 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/create/OperationParametersStep.java | 4 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/create/OperationSchedulingStep.java | 4 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/overview/ResourceOverviewView.java | 55 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/overview/ResourceSummaryView.java | 190 -- modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/summary/DashboardView.java | 52 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/summary/OverviewView.java | 302 +++ modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/factory/ConfigurationStep.java | 4 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/factory/ConfigurationTemplateStep.java | 4 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/factory/ResourceFactoryCreateWizard.java | 85 - modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/selection/AbstractSelector.java | 283 --- modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/selection/ResourceGroupSelector.java | 22 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/selection/ResourceSelector.java | 82 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/type/PluginTypeTreeView.java | 115 + modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/type/ResourceTypePluginTreeDataSource.java | 79 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/menu/DropDownMenuBarView.java | 247 ++ modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/menu/MenuBarView.java | 278 --- modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/menu/SearchBarPane.java | 19 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/ReportTopView.java | 383 ++++ modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/measurement/MeasurementOOBDataSource.java | 154 + modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/measurement/MeasurementOOBView.java | 61 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/tag/TagCloudView.java | 2 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/SearchBar.java | 104 - modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/SearchLogger.java | 4 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/favorites/SavedSearchGrid.java | 20 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/favorites/SavedSearchManager.java | 13 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestResultsListBox.java | 158 - modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestTextBox.java | 301 --- modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestTextBox_v2.java | 166 - modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestTextBox_v3.java | 196 +- modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/ErrorHandler.java | 5 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/RPCDataSource.java | 53 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/message/MessageCenter.java | 5 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/rpc/RPCManager.java | 2 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/AlertGWTServiceImpl.java | 3 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ClusterGWTServiceImpl.java | 69 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ConfigurationGWTServiceImpl.java | 21 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/FileUploadServlet.java | 9 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/MeasurementDataGWTServiceImpl.java | 54 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/RemoteInstallGWTServiceImpl.java | 71 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ResourceGWTServiceImpl.java | 28 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ResourceGroupGWTServiceImpl.java | 21 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/RoleGWTServiceImpl.java | 6 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/SearchGWTServiceImpl.java | 7 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/SystemGWTServiceImpl.java | 35 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/util/SerialUtility.java | 11 modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties | 19 modules/enterprise/gui/coregui/src/main/webapp/CoreGUI.css | 14 modules/enterprise/gui/coregui/src/main/webapp/WEB-INF/web.xml | 16 modules/enterprise/gui/coregui/src/main/webapp/images/global/Agent_16.png |binary modules/enterprise/gui/coregui/src/main/webapp/images/global/Agent_24.png |binary modules/enterprise/gui/coregui/src/main/webapp/images/global/Cloud_16.png |binary modules/enterprise/gui/coregui/src/main/webapp/images/global/Cloud_24.png |binary modules/enterprise/gui/coregui/src/main/webapp/images/global/Locked_16.png |binary modules/enterprise/gui/coregui/src/main/webapp/images/global/Locked_24.png |binary modules/enterprise/gui/coregui/src/main/webapp/images/global/Plugin_16.png |binary modules/enterprise/gui/coregui/src/main/webapp/images/global/Plugin_24.png |binary modules/enterprise/gui/coregui/src/main/webapp/images/global/Recent_16.png |binary modules/enterprise/gui/coregui/src/main/webapp/images/global/Recent_24.png |binary modules/enterprise/gui/coregui/src/main/webapp/images/global/Role_16.png |binary modules/enterprise/gui/coregui/src/main/webapp/images/global/Unlocked_16.png |binary modules/enterprise/gui/coregui/src/main/webapp/images/global/Unlocked_32.png |binary modules/enterprise/gui/coregui/src/main/webapp/images/global/User_16.png |binary modules/enterprise/gui/coregui/src/main/webapp/images/global/User_24.png |binary modules/enterprise/gui/coregui/src/main/webapp/images/global/cloud_24.png |binary modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/event/WARN_16.png |binary modules/enterprise/gui/coregui/src/main/webapp/images/types/Server_down_16.png |binary modules/enterprise/gui/coregui/src/main/webapp/images/types/Server_up_16.png |binary modules/enterprise/gui/coregui/src/main/webapp/images/types/Service_down_16.png |binary modules/enterprise/gui/coregui/src/main/webapp/images/types/Service_down_24.png |binary modules/enterprise/gui/coregui/src/main/webapp/images/types/Service_up_16.png |binary modules/enterprise/gui/coregui/src/main/webapp/images/types/Service_up_24.png |binary modules/enterprise/gui/installer-war/pom.xml | 6 modules/enterprise/gui/portal-war/pom.xml | 14 modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/admin/DownloadsUIBean.java | 54 modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/admin/config/SystemConfigForm.java | 23 modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/alert/common/AlertNotificationsUIBean.java | 2 modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/alert/common/CustomContentUIBean.java | 2 modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/authentication/AuthenticateUserAction.java | 2 modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/authorization/GlobalPermissionsUIBean.java | 17 modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/common/framework/FaceletRedirectionViewHandler.java | 3 modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/common/framework/FacesMessagePropogationPhaseListener.java | 9 modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/common/framework/ServerInfoUIBean.java | 21 modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/common/framework/UserPreferencesUIBean.java | 4 modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/common/paging/PagedListDataModel.java | 37 modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/common/paging/ResourceNameDisambiguatingPagedListDataModel.java | 7 modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/common/sorting/SortableColumnHeaderRenderer.java | 69 modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/common/tag/FunctionTagLibrary.java | 10 modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/configuration/group/AbstractGroupResourceConfigurationUIBean.java | 3 modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/configuration/group/EditGroupResourceConfigurationUIBean.java | 21 modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/configuration/group/GroupResourceConfigurationHistoryDetailsUIBean.java | 7 modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/configuration/group/GroupResourceConfigurationHistoryUIBean.java | 2 modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/configuration/group/ViewGroupResourceConfigurationUIBean.java | 22 modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/configuration/resource/ResourceConfigurationViewer.java | 103 - modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/definition/group/GroupDefinitionUIBean.java | 26 modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/discovery/AutoDiscoveryQueueUIBean.java | 4 modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/browse/BrowseGroupsUIBean.java | 31 modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/browse/BrowseResourcesUIBean.java | 35 modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/group/AbstractGroupPluginConfigurationUIBean.java | 3 modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/group/EditGroupPluginConfigurationUIBean.java | 3 modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/group/ResourceGroupUIBean.java | 2 modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/resource/DisambiguatedResourceLineageRenderer.java | 2 modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/resource/ResourceLineageRenderer.java | 2 modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/resource/ResourceUIBean.java | 10 modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/GroupController.java | 2 modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/common/monitor/alerts/AlertDefUtil.java | 14 modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/common/monitor/alerts/ViewAlertAction.java | 10 modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/common/monitor/alerts/config/DefinitionFormPrepareAction.java | 3 modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/common/monitor/alerts/config/EditDefinitionControlActionAction.java | 2 modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/common/monitor/alerts/config/EditDefinitionControlActionFormPrepareAction.java | 2 modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/common/monitor/alerts/config/ViewDefinitionAction.java | 4 modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/group/inventory/AddGroupResourcesFormPrepareAction.java | 42 modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/portlet/autodiscovery/ViewAction.java | 4 modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/portlet/recentlyApproved/ViewAction.java | 4 modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/portlet/resourcehealth/RSSAction.java | 1 modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/portlet/resourcehealth/ViewAction.java | 1 modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/taglib/InventoryHierarchyTag.java | 2 modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/taglib/display/DisambiguatedResourceNameTag.java | 2 modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/util/DisambiguatedResourceListUtil.java | 7 modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/measurement/calltime/CallTimeUIBean.java | 42 modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/navigation/group/ResourceGroupTreeContextMenuUIBean.java | 4 modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/navigation/group/ResourceGroupTreeModelUIBean.java | 2 modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/navigation/group/ResourceGroupTreeNode.java | 2 modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/navigation/group/ResourceGroupTreeStateAdvisor.java | 5 modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/navigation/resource/ResourceSelectUIBean.java | 2 modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/startup/StartupServlet.java | 11 modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/subsystem/SubsystemAlertHistoryUIBean.java | 10 modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/subsystem/SubsystemConfigurationUpdateUIBean.java | 1 modules/enterprise/gui/portal-war/src/main/webapp-filtered/WEB-INF/classes/ApplicationResources.properties | 11 modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation-auto-group/measurement-navigation.xml | 20 modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation-resource-group/alert-plain-navigation.xml | 60 modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation-resource-group/configuration-plain-navigation.xml | 45 modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation-resource-group/events-plain-navigation.xml | 26 modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation-resource-group/inventory-navigation.xml | 15 modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation-resource-group/measurement-navigation.xml | 35 modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation-resource-group/measurement-plain-navigation.xml | 88 + modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation-resource-group/operation-plain-navigation.xml | 119 + modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation/admin-navigation-plain.xml | 106 + modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation/alert-plain-navigation.xml | 183 ++ modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation/cluster-plain-navigation.xml | 211 ++ modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation/content-plain-navigation.xml | 491 +++++ modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation/events-plain-navigation.xml | 26 modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation/measurement-plain-navigation.xml | 73 modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation/operation-plain-navigation.xml | 89 + modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/struts-config.xml | 33 modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/web.xml | 16 modules/enterprise/gui/portal-war/src/main/webapp/admin/config/ChangeResourceTemplate.jsp | 26 modules/enterprise/gui/portal-war/src/main/webapp/admin/config/EditServerConfig.jsp | 3 modules/enterprise/gui/portal-war/src/main/webapp/admin/config/GeneralPropertiesConfigForm.jsp | 208 +- modules/enterprise/gui/portal-war/src/main/webapp/admin/license/License.jsp | 2 modules/enterprise/gui/portal-war/src/main/webapp/admin/license/LicenseEdit.jsp | 28 modules/enterprise/gui/portal-war/src/main/webapp/admin/role/RolePermissionsForm.jsp | 90 - modules/enterprise/gui/portal-war/src/main/webapp/admin/test/control.jsp | 15 modules/enterprise/gui/portal-war/src/main/webapp/common/Login.jsp | 4 modules/enterprise/gui/portal-war/src/main/webapp/css/win.css | 1 modules/enterprise/gui/portal-war/src/main/webapp/images/icons/Server_down_16.png |binary modules/enterprise/gui/portal-war/src/main/webapp/images/icons/Server_unknown_16.png |binary modules/enterprise/gui/portal-war/src/main/webapp/images/icons/Server_up_16.png |binary modules/enterprise/gui/portal-war/src/main/webapp/images/icons/Service_down_16.png |binary modules/enterprise/gui/portal-war/src/main/webapp/images/icons/Service_down_24.png |binary modules/enterprise/gui/portal-war/src/main/webapp/images/icons/Service_unknown_16.png |binary modules/enterprise/gui/portal-war/src/main/webapp/images/icons/Service_unknown_24.png |binary modules/enterprise/gui/portal-war/src/main/webapp/images/icons/Service_up_16.png |binary modules/enterprise/gui/portal-war/src/main/webapp/images/icons/Service_up_24.png |binary modules/enterprise/gui/portal-war/src/main/webapp/index.html | 9 modules/enterprise/gui/portal-war/src/main/webapp/js/adminEditRole_checkAll.js | 25 modules/enterprise/gui/portal-war/src/main/webapp/js/rhq.js | 2 modules/enterprise/gui/portal-war/src/main/webapp/portlet/controlactions/View.jsp | 4 modules/enterprise/gui/portal-war/src/main/webapp/portlet/problemResources/View.jsp | 2 modules/enterprise/gui/portal-war/src/main/webapp/portlet/resourceHealth/View.jsp | 2 modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/alerts/ViewAlertNotifications.jsp | 20 modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/config/ConfigMetrics.jsp | 15 modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/config/EditConfigMetricsVisibility.jsp | 3 modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/config/ShowOneResourceType.jsp | 13 modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventsView.jsp | 2 modules/enterprise/gui/portal-war/src/main/webapp/rhq/admin/downloads.xhtml | 21 modules/enterprise/gui/portal-war/src/main/webapp/rhq/admin/plugin/plugin-config-plain.xhtml | 108 + modules/enterprise/gui/portal-war/src/main/webapp/rhq/admin/plugin/plugin-details-plain.xhtml | 155 + modules/enterprise/gui/portal-war/src/main/webapp/rhq/admin/plugin/plugin-edit-add-map-plain.xhtml | 28 modules/enterprise/gui/portal-war/src/main/webapp/rhq/admin/plugin/plugin-edit-map-plain.xhtml | 21 modules/enterprise/gui/portal-war/src/main/webapp/rhq/admin/plugin/plugin-edit-plain.xhtml | 41 modules/enterprise/gui/portal-war/src/main/webapp/rhq/admin/plugin/plugin-edit-update-map-plain.xhtml | 29 modules/enterprise/gui/portal-war/src/main/webapp/rhq/admin/plugin/plugin-edit-view-map-plain.xhtml | 22 modules/enterprise/gui/portal-war/src/main/webapp/rhq/admin/plugin/plugin-list-plain.xhtml | 268 +++ modules/enterprise/gui/portal-war/src/main/webapp/rhq/autogroup/layout/main.xhtml | 144 - modules/enterprise/gui/portal-war/src/main/webapp/rhq/autogroup/monitor/response.xhtml | 21 modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/alert/notification/details.xhtml | 6 modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/events/history-plain.xhtml | 23 modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/events/history.xhtml | 8 modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/menu/menu.xhtml | 22 modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/monitor/graphs.xhtml | 26 modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/monitor/response-plain.xhtml | 158 + modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/monitor/response.xhtml | 53 modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/monitor/tables-plain.xhtml | 46 modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/searchInterface.xhtml | 3 modules/enterprise/gui/portal-war/src/main/webapp/rhq/content/repo.xhtml | 2 modules/enterprise/gui/portal-war/src/main/webapp/rhq/definition/group/view.xhtml | 8 modules/enterprise/gui/portal-war/src/main/webapp/rhq/entity/layout/main-plain.xhtml | 39 modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/alert/listGroupAlertDefinitions-plain.xhtml | 126 + modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/alert/listGroupAlertHistory-plain.xhtml | 177 ++ modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/configuration/addSimple-plain.xhtml | 45 modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/configuration/editCurrent-plain.xhtml | 69 modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/configuration/editCurrent.xhtml | 18 modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/configuration/history-plain.xhtml | 281 +++ modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/configuration/history.xhtml | 10 modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/configuration/viewCurrent-plain.xhtml | 55 modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/configuration/viewCurrent.xhtml | 19 modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/events/history-plain.xhtml | 19 modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/inventory/view-connection.xhtml | 4 modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/inventory/view.xhtml | 66 modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/layout/main-plain.xhtml | 64 modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/layout/main.xhtml | 3 modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/monitor/graphs-plain.xhtml | 19 modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/monitor/response-plain.xhtml | 15 modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/monitor/response.xhtml | 21 modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/monitor/schedules-plain.xhtml | 153 + modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/monitor/tables-plain.xhtml | 128 + modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/operation/groupOperationHistory-plain.xhtml | 293 +++ modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/operation/groupOperationHistoryDetails-plain.xhtml | 232 ++ modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/operation/groupOperationScheduleDetails-plain.xhtml | 118 + modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/operation/groupOperationScheduleNew-plain.xhtml | 173 ++ modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/operation/groupOperationSchedules-plain.xhtml | 106 + modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/operation/view-results-map-plain.xhtml | 41 modules/enterprise/gui/portal-war/src/main/webapp/rhq/ha/affinityGroupAgents-plain.xhtml | 288 +++ modules/enterprise/gui/portal-war/src/main/webapp/rhq/ha/affinityGroupServers-plain.xhtml | 290 +++ modules/enterprise/gui/portal-war/src/main/webapp/rhq/ha/listAffinityGroups-plain.xhtml | 113 + modules/enterprise/gui/portal-war/src/main/webapp/rhq/ha/listAgents-plain.xhtml | 138 + modules/enterprise/gui/portal-war/src/main/webapp/rhq/ha/listPartitionEvents-plain.xhtml | 162 + modules/enterprise/gui/portal-war/src/main/webapp/rhq/ha/listServers-plain.xhtml | 168 + modules/enterprise/gui/portal-war/src/main/webapp/rhq/ha/viewAffinityGroup-plain.xhtml | 291 +++ modules/enterprise/gui/portal-war/src/main/webapp/rhq/ha/viewAgent-plain.xhtml | 203 ++ modules/enterprise/gui/portal-war/src/main/webapp/rhq/ha/viewPartitionEvent-plain.xhtml | 130 + modules/enterprise/gui/portal-war/src/main/webapp/rhq/ha/viewServer-plain.xhtml | 206 ++ modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseGroups.xhtml | 64 modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseResources.xhtml | 84 modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/layout/main.xhtml | 26 modules/enterprise/gui/portal-war/src/main/webapp/rhq/layout/main-plain-layout.xhtml | 310 +++ modules/enterprise/gui/portal-war/src/main/webapp/rhq/layout/main.xhtml | 2 modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/alert/listAlertDefinitions-plain.xhtml | 161 + modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/alert/listAlertHistory-plain.xhtml | 210 ++ modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/configuration/edit.xhtml | 120 - modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/configuration/history.xhtml | 18 modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/configuration/raw.xhtml | 2 modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/configuration/structured.xhtml | 2 modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/configuration/view.xhtml | 81 modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/content/deploy-plain.xhtml | 27 modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/content/history-plain.xhtml | 23 modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/content/installed_package_details-plain.xhtml | 27 modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/content/subscription-plain.xhtml | 33 modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/content/view-plain.xhtml | 37 modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/events/history-plain.xhtml | 20 modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/include/pagination-plain.xhtml | 112 + modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/layout/main-plain.xhtml | 17 modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/monitor/availabilityHistory-plain.xhtml | 31 modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/monitor/response-plain.xhtml | 14 modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/monitor/schedules-plain.xhtml | 38 modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/monitor/tables-plain.xhtml | 19 modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/monitor/traits-plain.xhtml | 27 modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/operation/resourceOperationHistory-plain.xhtml | 270 +++ modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/operation/resourceOperationHistoryDetails-plain.xhtml | 122 + modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/operation/resourceOperationScheduleDetails-plain.xhtml | 73 modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/operation/resourceOperationSchedules-plain.xhtml | 104 + modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/summary/overview.xhtml | 14 modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/summary/timeline.xhtml | 2 modules/enterprise/remoting/ant-run.xml | 2 modules/enterprise/remoting/cli/pom.xml | 6 modules/enterprise/remoting/cli/src/etc/build.xml | 8 modules/enterprise/remoting/client-api/pom.xml | 1 modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/WsConfigurationManagerTest.java | 15 modules/enterprise/server/container/src/main/bin-resources/bin/generate-db-password.sh | 5 modules/enterprise/server/container/src/main/bin-resources/bin/rhq-server.sh | 12 modules/enterprise/server/container/src/main/scripts/rhq-container.build.xml | 11 modules/enterprise/server/jar/pom.xml | 12 modules/enterprise/server/jar/src/main/antlr3/org/rhq/enterprise/server/search/RHQL.g | 9 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/RHQConstants.java | 6 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/AlertDefinitionManagerBean.java | 7 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/AlertDefinitionManagerLocal.java | 12 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/AlertDefinitionManagerRemote.java | 15 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/AlertManagerBean.java | 157 - modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/AlertManagerLocal.java | 3 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/GroupAlertDefinitionManagerBean.java | 34 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/engine/internal/AbstractConditionCache.java | 4 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/engine/jms/CachedConditionProducerBean.java | 3 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/engine/jms/CachedConditionProducerLocal.java | 2 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/auth/SubjectException.java | 4 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/auth/SubjectManagerBean.java | 3 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/authz/AuthorizationManagerBean.java | 25 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/authz/AuthorizationManagerLocal.java | 14 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/authz/RoleManagerBean.java | 78 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/authz/RoleManagerLocal.java | 3 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/authz/RoleManagerRemote.java | 9 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerBean.java | 44 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationManagerBean.java | 111 + modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationManagerLocal.java | 26 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationManagerRemote.java | 5 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationServerServiceImpl.java | 7 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationUpdateStillInProgressException.java | 4 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/job/AbstractGroupConfigurationUpdateJob.java | 18 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerBean.java | 408 ++++ modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerLocal.java | 14 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerRemote.java | 7 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentSourceManagerBean.java | 177 +- modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/RepoException.java | 1 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/RepoManagerBean.java | 9 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/CoreServer.java | 34 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/CoreServerMBean.java | 8 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/CustomJaasDeploymentService.java | 16 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/jaas/JDBCPrincipalCheckLoginModule.java | 150 + modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/discovery/DiscoveryBossBean.java | 49 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/discovery/DiscoveryServerServiceImpl.java | 7 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/event/EventManagerBean.java | 28 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/exception/ScheduleException.java | 4 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/exception/UnscheduleException.java | 4 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/install/remote/RemoteInstallManagerBean.java | 84 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/install/remote/RemoteInstallManagerLocal.java | 22 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/install/remote/RemoteInstallManagerRemote.java | 127 + modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/install/remote/SSHInstallUtility.java | 366 ++-- modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/CallTimeDataManagerBean.java | 196 +- modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/CallTimeDataManagerLocal.java | 10 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementChartsManagerBean.java | 8 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementDefinitionManagerBean.java | 3 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementScheduleManagerBean.java | 419 ++-- modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementScheduleManagerLocal.java | 7 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/instrumentation/MeasurementMonitor.java | 20 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/instrumentation/MeasurementMonitorMBean.java | 8 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/operation/OperationManagerBean.java | 9 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/perspective/PerspectiveTarget.java | 2 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/perspective/activator/context/GroupActivationContext.java | 2 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/perspective/activator/context/ResourceActivationContext.java | 2 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/plugin/pc/alert/AlertSender.java | 9 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/plugin/pc/alert/CustomAlertSenderBackingBean.java | 14 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerBean.java | 128 + modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerLocal.java | 16 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerRemote.java | 16 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceNotFoundException.java | 6 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceTypeManagerBean.java | 13 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/cluster/ClusterKey.java | 275 --- modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/cluster/ClusterManagerBean.java | 79 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/cluster/ClusterManagerLocal.java | 28 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/cluster/ClusterManagerRemote.java | 79 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/disambiguation/DefaultDisambiguationUpdateStrategies.java | 103 - modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/disambiguation/DisambiguationPolicy.java | 104 - modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/disambiguation/DisambiguationUpdateStrategy.java | 15 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/disambiguation/Disambiguator.java | 68 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/disambiguation/ReportPartitions.java | 112 - modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerBean.java | 199 +- modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerLocal.java | 8 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerRemote.java | 9 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupNotFoundException.java | 4 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/definition/GroupDefinitionManagerBean.java | 194 -- modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/definition/GroupDefinitionManagerLocal.java | 12 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/metadata/ResourceMetadataManagerBean.java | 141 + modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/metadata/ResourceMetadataManagerLocal.java | 54 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/scheduler/jobs/AsyncResourceDeleteJob.java | 74 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/scheduler/jobs/SavedSearchResultCountRecalculationJob.java | 40 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/SavedSearchManagerBean.java | 10 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/SearchExpressionException.java | 47 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/AbstractSearchAssistant.java | 45 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/GroupSearchAssistant.java | 37 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/ResourceSearchAssistant.java | 127 + modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/SearchAssistantFactory.java | 17 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/TabAwareSearchAssistant.java | 18 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/common/SearchQueryGenerationUtility.java | 90 + modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java | 125 + modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchTranslationManager.java | 21 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/AbstractSearchTranslator.java | 81 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/GroupSearchTranslator.java | 15 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/ResourceSearchTranslator.java | 49 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/SearchTranslatorFactory.java | 7 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/ServerVersion.java | 2 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/SystemManagerBean.java | 30 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/SystemManagerLocal.java | 7 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/SystemManagerRemote.java | 5 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/tagging/TagManagerBean.java | 14 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/DiscoveryTestBean.java | 6 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/MeasurementTestBean.java | 114 + modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/MeasurementTestLocal.java | 6 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/CriteriaQueryGenerator.java | 229 ++ modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/CriteriaQueryRunner.java | 14 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/QueryUtility.java | 9 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/webservices/WebservicesManagerBean.java | 33 modules/enterprise/server/jar/src/main/resources/org/rhq/enterprise/server/core/ProductInfo.properties | 9 modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/alert/test/AlertManagerBeanTest.java | 3 modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/authz/test/AuthorizationManagerBeanTest.java | 38 modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/configuration/ConfigurationManagerBeanUnitTest.java | 32 modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/content/test/ContentUIManagerBeanTest.java | 148 + modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/resource/cluster/ClusterManagerBeanTest.java | 1 modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/resource/metadata/test/UpdateSubsytemTestBase.java | 15 modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/scheduler/jobs/DataPurgeJobTest.java | 3 modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/search/GenericSearchAssistTest.java | 2 modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/search/TestAutoCompletionManager.java | 12 modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/test/TestAgentClient.java | 7 modules/enterprise/server/jar/src/test/resources/binary-blob-sample.jar |binary modules/enterprise/server/plugins/alert-email/src/main/java/org/rhq/enterprise/server/plugins/alertEmail/EmailSender.java | 33 modules/enterprise/server/plugins/alert-irc/src/main/java/org/rhq/enterprise/server/plugins/alertIrc/IrcSender.java | 14 modules/enterprise/server/plugins/alert-microblog/src/main/java/org/rhq/enterprise/server/plugins/alertMicroblog/MicroblogSender.java | 4 modules/enterprise/server/plugins/alert-mobicents/src/main/java/org/rhq/enterprise/server/plugins/alertMobicents/MobicentsSender.java | 144 - modules/enterprise/server/plugins/alert-operations/src/main/java/org/rhq/enterprise/server/plugins/alertOperations/AlertTokenReplacer.java | 4 modules/enterprise/server/plugins/alert-operations/src/main/java/org/rhq/enterprise/server/plugins/alertOperations/OperationInfo.java | 4 modules/enterprise/server/plugins/alert-operations/src/main/java/org/rhq/enterprise/server/plugins/alertOperations/OperationsBackingBean.java | 3 modules/enterprise/server/plugins/alert-operations/src/main/java/org/rhq/enterprise/server/plugins/alertOperations/OperationsSender.java | 18 modules/enterprise/server/plugins/alert-operations/src/main/resources/operations.xhtml | 2 modules/enterprise/server/plugins/alert-roles/src/main/java/org/rhq/enterprise/server/plugins/alertRoles/RolesSender.java | 31 modules/enterprise/server/plugins/alert-roles/src/main/resources/roles.xhtml | 2 modules/enterprise/server/plugins/alert-snmp/src/main/java/org/rhq/enterprise/server/plugins/alertSnmp/SnmpInfo.java | 2 modules/enterprise/server/plugins/alert-snmp/src/main/java/org/rhq/enterprise/server/plugins/alertSnmp/SnmpSender.java | 34 modules/enterprise/server/plugins/alert-snmp/src/main/java/org/rhq/enterprise/server/plugins/alertSnmp/SnmpTrapSender.java | 2 modules/enterprise/server/plugins/alert-snmp/src/main/resources/META-INF/rhq-serverplugin.xml | 2 modules/enterprise/server/plugins/alert-subject/src/main/java/org/rhq/enterprise/server/plugins/alertSubject/SubjectsSender.java | 31 modules/enterprise/server/plugins/alert-subject/src/main/resources/subjects.xhtml | 2 modules/enterprise/server/plugins/ant-bundle/src/main/java/org/rhq/enterprise/server/plugins/ant/AntBundleServerPluginComponent.java | 3 modules/enterprise/server/plugins/jboss-software/src/main/java/org/rhq/enterprise/server/plugins/jboss/software/JBossSoftwareContentSourceAdapter.java | 21 modules/enterprise/server/plugins/perspectives/core/perspective/src/main/resources/META-INF/rhq-serverplugin.xml | 4 modules/enterprise/server/plugins/perspectives/policy/perspective/pom.xml | 27 modules/enterprise/server/plugins/rhnhosted/pom.xml | 2 modules/helpers/bundleGen/pom.xml | 79 modules/helpers/bundleGen/src/main/java/org/rhq/helpers/bundleGen/BundleGen.java | 167 + modules/helpers/bundleGen/src/main/java/org/rhq/helpers/bundleGen/Props.java | 97 + modules/helpers/bundleGen/src/main/java/org/rhq/helpers/bundleGen/XmlQuestionsReader.java | 273 +++ modules/helpers/bundleGen/src/main/resources/bundleGen.properties | 5 modules/helpers/bundleGen/src/main/resources/bundleGen_de.properties | 5 modules/helpers/bundleGen/src/main/resources/bundleGen_fr.properties | 2 modules/helpers/bundleGen/src/main/resources/bundleQuestions.xml | 35 modules/helpers/bundleGen/src/main/resources/deployMain.ftl | 60 modules/helpers/bundleGen/src/main/resources/questions.dtd | 50 modules/helpers/pluginGen/pom.xml | 2 modules/helpers/pluginGen/src/main/resources/pom.ftl | 2 modules/helpers/pom.xml | 1 modules/jopr/tools/jbas5-plugin-descriptor-gen/src/main/java/org/jboss/jopr/tool/jbas5/PluginDescriptorGenerator.java | 6 modules/plugins/ant-bundle/src/main/java/org/rhq/plugins/ant/AntBundlePluginDiscoveryComponent.java | 4 modules/plugins/ant-bundle/src/main/resources/META-INF/rhq-plugin.xml | 15 modules/plugins/ant-bundle/src/test/java/org/rhq/plugins/ant/AntBundlePluginComponentTest.java | 249 +- modules/plugins/ant-bundle/src/test/resources/test-bundle.xml | 7 modules/plugins/apache/pom.xml | 29 modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheServerComponent.java | 14 modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheServerDiscoveryComponent.java | 14 modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheVirtualHostServiceComponent.java | 191 +- modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheVirtualHostServiceDiscoveryComponent.java | 145 + modules/plugins/apache/src/main/java/org/rhq/plugins/apache/augeas/AugeasConfigurationApache.java | 37 modules/plugins/apache/src/main/java/org/rhq/plugins/apache/augeas/AugeasTreeBuilderApache.java | 10 modules/plugins/apache/src/main/java/org/rhq/plugins/apache/mapping/ApacheAugeasMapping.java | 2 modules/plugins/apache/src/main/java/org/rhq/plugins/apache/parser/ApacheParserImpl.java | 16 modules/plugins/apache/src/main/java/org/rhq/plugins/apache/util/HttpdAddressUtility.java | 307 ++- modules/plugins/apache/src/main/resources/META-INF/rhq-plugin.xml | 2 modules/plugins/apache/src/test/java/org/rhq/plugins/apache/ApacheAugeasTest.java | 134 + modules/plugins/apache/src/test/java/org/rhq/plugins/apache/ApacheAugeasUtil.java | 172 ++ modules/plugins/apache/src/test/java/org/rhq/plugins/apache/ApachePluginTest.java | 16 modules/plugins/apache/src/test/java/org/rhq/plugins/apache/ApacheTestConstants.java | 47 modules/plugins/apache/src/test/java/org/rhq/plugins/apache/Components.java | 125 + modules/plugins/apache/src/test/java/org/rhq/plugins/apache/UnitTestException.java | 21 modules/plugins/apache/src/test/java/org/rhq/plugins/apache/helper/LensFilter.java | 23 modules/plugins/apache/src/test/java/org/rhq/plugins/apache/helper/LensHelper.java | 109 + modules/plugins/apache/src/test/java/org/rhq/plugins/apache/util/ApacheConfigurationUtil.java | 228 ++ modules/plugins/apache/src/test/java/org/rhq/plugins/apache/util/StandAloneContainer.java | 75 modules/plugins/apache/src/test/resources/httpd.aug | 58 modules/plugins/apache/src/test/resources/httpd.conf | 41 modules/plugins/apache/src/test/resources/included.conf | 13 modules/plugins/apache/src/test/resources/loadconfig/Apache | 2 modules/plugins/apache/src/test/resources/loadconfig/Directory0 | 2 modules/plugins/apache/src/test/resources/loadconfig/Directory1 | 2 modules/plugins/apache/src/test/resources/loadconfig/Directory2 | 2 modules/plugins/apache/src/test/resources/loadconfig/IfModule | 2 modules/plugins/apache/src/test/resources/loadconfig/IfModule0 | 2 modules/plugins/apache/src/test/resources/loadconfig/IfModule1 | 2 modules/plugins/apache/src/test/resources/nested.conf | 12 modules/plugins/apache/src/test/resources/updateconfig/httpd.aug | 58 modules/plugins/apache/src/test/resources/updateconfig/httpd.conf | 10 modules/plugins/apache/src/test/resources/updateconfig/included.conf | 4 modules/plugins/apache/src/test/resources/updateconfig/nested.conf | 3 modules/plugins/augeas/pom.xml | 19 modules/plugins/augeas/src/main/java/org/rhq/augeas/util/Glob.java | 19 modules/plugins/augeas/src/main/java/org/rhq/plugins/augeas/AugeasConfigurationDiscoveryComponent.java | 16 modules/plugins/augeas/src/main/java/org/rhq/rhqtransform/impl/PluginDescriptorBasedAugeasConfiguration.java | 2 modules/plugins/cron/src/main/java/org/rhq/plugins/cron/CronComponent.java | 2 modules/plugins/database/src/main/java/org/rhq/plugins/database/CustomTableComponent.java | 4 modules/plugins/database/src/main/java/org/rhq/plugins/database/CustomTableDiscoveryComponent.java | 39 modules/plugins/database/src/main/java/org/rhq/plugins/database/CustomTableRowDiscoveryComponent.java | 11 modules/plugins/filetemplate-bundle/src/main/java/org/rhq/plugins/filetemplate/FileTemplateBundlePluginDiscoveryComponent.java | 4 modules/plugins/filetemplate-bundle/src/main/resources/META-INF/rhq-plugin.xml | 14 modules/plugins/hadoop/pom.xml | 35 modules/plugins/hadoop/src/main/java/org/rhq/plugins/hadoop/HadoopServiceComponent.java | 3 modules/plugins/hibernate/src/main/resources/META-INF/rhq-plugin.xml | 2 modules/plugins/irc/pom.xml | 12 modules/plugins/irc/src/main/java/org/rhq/plugins/irc/IRCChannelComponent.java | 134 + modules/plugins/irc/src/main/java/org/rhq/plugins/irc/IRCChannelDiscoveryComponent.java | 53 modules/plugins/irc/src/main/java/org/rhq/plugins/irc/IRCRepoComponent.java | 134 - modules/plugins/irc/src/main/java/org/rhq/plugins/irc/IRCRepoDiscoveryComponent.java | 53 modules/plugins/irc/src/main/java/org/rhq/plugins/irc/IRCServerComponent.java | 80 modules/plugins/irc/src/main/resources/META-INF/rhq-plugin.xml | 20 modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/AbstractManagedDeploymentComponent.java | 105 - modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ApplicationServerComponent.java | 113 - modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ApplicationServerDiscoveryComponent.java | 87 - modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ManagedComponentComponent.java | 844 +++++----- modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/serviceBinding/SetComponent.java | 2 modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/util/ManagedComponentUtils.java | 14 modules/plugins/jboss-as-5/src/main/resources/META-INF/rhq-plugin.xml | 2 modules/plugins/jboss-as/src/main/java/org/rhq/plugins/jbossas/JBossASDiscoveryComponent.java | 8 modules/plugins/jboss-as/src/main/java/org/rhq/plugins/jbossas/JBossASServerComponent.java | 14 modules/plugins/jboss-as/src/main/java/org/rhq/plugins/jbossas/JBossASTomcatConnectorComponent.java | 17 modules/plugins/jboss-cache/src/main/java/org/rhq/plugins/jbosscache/JGroupsChannelComponent.java | 64 modules/plugins/jboss-cache/src/main/java/org/rhq/plugins/jbosscache/JGroupsChannelDiscovery.java | 143 + modules/plugins/jboss-cache/src/main/java/org/rhq/plugins/jbosscache/JGroupsRepoComponent.java | 64 modules/plugins/jboss-cache/src/main/java/org/rhq/plugins/jbosscache/JGroupsRepoDiscovery.java | 143 - modules/plugins/jboss-cache/src/main/resources/META-INF/rhq-plugin.xml | 106 - modules/plugins/jmx/src/main/java/org/rhq/plugins/jmx/JMXPluginLifecycleListener.java | 52 modules/plugins/jmx/src/main/java/org/rhq/plugins/jmx/JavaUtilLoggingResourceComponent.java | 12 modules/plugins/jmx/src/main/java/org/rhq/plugins/jmx/MBeanResourceComponent.java | 12 modules/plugins/jmx/src/main/resources/META-INF/rhq-plugin.xml | 1 modules/plugins/mysql/src/main/java/org/rhq/plugins/mysql/MySqlDiscoveryComponent.java | 2 modules/plugins/netservices/pom.xml | 2 modules/plugins/nss/pom.xml | 102 - modules/plugins/nss/src/main/resources/META-INF/rhq-plugin.xml | 4 modules/plugins/perftest/src/main/resources/META-INF/rhq-plugin.xml | 13 modules/plugins/platform/src/main/java/org/rhq/plugins/platform/LinuxPlatformComponent.java | 90 - modules/plugins/platform/src/main/java/org/rhq/plugins/platform/PlatformDiscoveryComponent.java | 12 modules/plugins/platform/src/main/java/org/rhq/plugins/platform/PosixPlatformComponent.java | 146 + modules/plugins/platform/src/main/resources/META-INF/rhq-plugin.xml | 94 - modules/plugins/pom.xml | 4 modules/plugins/postgres/src/main/java/org/rhq/plugins/postgres/PostgresDiscoveryComponent.java | 44 modules/plugins/postgres/src/main/java/org/rhq/plugins/postgres/util/PostgresqlConfFile.java | 22 modules/plugins/postgres/src/main/resources/META-INF/rhq-plugin.xml | 22 modules/plugins/rhq-server/src/main/resources/META-INF/rhq-plugin.xml | 33 modules/plugins/samba/src/main/java/org/rhq/plugins/samba/SambaShareDiscoveryComponent.java | 5 modules/plugins/services/pom.xml | 23 modules/plugins/snmptrapd/pom.xml | 28 modules/plugins/tomcat/src/main/java/org/jboss/on/plugins/tomcat/TomcatConnectorComponent.java | 24 modules/plugins/tomcat/src/main/java/org/jboss/on/plugins/tomcat/TomcatDiscoveryComponent.java | 39 modules/plugins/twitter/pom.xml | 2 modules/pom.xml | 16 pom.xml | 197 +- release.sh | 149 + 1230 files changed, 38466 insertions(+), 16964 deletions(-)
New commits: commit eba1bf42a9d57a1b2193b5d4b7afba03e6dcf586 Merge: a4aeccc... e376a60... Author: Alexander Kiefer alexander.kiefer@dillinger.biz Date: Tue Aug 17 21:09:50 2010 +0200
Merge branch 'nagios' of ssh://git.fedorahosted.org/git/rhq/rhq into nagios
Conflicts: modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/AgentMain.java modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/metadata/ResourceMetadataManagerBean.java modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/metadata/ResourceMetadataManagerLocal.java modules/plugins/hadoop/pom.xml modules/plugins/pom.xml
Done merging
diff --cc modules/core/plugin-validator/pom.xml index 5adfabf,903c24a..00fe339 --- a/modules/core/plugin-validator/pom.xml +++ b/modules/core/plugin-validator/pom.xml @@@ -5,11 -5,11 +5,11 @@@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>4.0.0-SNAPSHOT</version> + <version>3.0.0.B04</version> </parent> - + <groupId>org.rhq</groupId> - <artifactId>rhq-plugin-validator</artifactId> + <artifactId>rhq-plugin-validator</artifactId> <packaging>maven-plugin</packaging> <name>RHQ Plugin Validator Maven 2 Plugin</name>
diff --cc modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/AgentMain.java index d1894cb,c3b8e9b..ceee698 --- a/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/AgentMain.java +++ b/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/AgentMain.java @@@ -3030,7 -2961,7 +3031,8 @@@ public class AgentMain new LogPromptCommand(), new TimerPromptCommand(), new PingPromptCommand(), new DownloadPromptCommand(), new DumpSpoolPromptCommand(), new SenderPromptCommand(), new FailoverPromptCommand(), new UpdatePromptCommand(), new DebugPromptCommand(), new SleepPromptCommand(), new GCPromptCommand(), - new SchedulesPromptCommand() }; - new AddResourceTypePromptCommand() }; ++ new SchedulesPromptCommand()}; ++ //new AddResourceTypePromptCommand() };
// hold the conflicts StringBuilder conflicts = new StringBuilder(); diff --cc modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/metadata/ResourceMetadataManagerBean.java index a136561,bef85bf..2a6e565 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/metadata/ResourceMetadataManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/metadata/ResourceMetadataManagerBean.java @@@ -530,8 -512,7 +531,9 @@@ public class ResourceMetadataManagerBea } }
- private void removeResourceTypes(Subject overlord, Set<ResourceType> candidateTypes, ++<<<<<<< HEAD + // NO TRANSACTION SHOULD BE ACTIVE ON ENTRY + private void removeResourceTypes(Subject subject, Set<ResourceType> candidateTypes, Set<ResourceType> typesToBeRemoved) throws Exception { for (ResourceType candidateType : candidateTypes) { // Remove obsolete descendant types first. @@@ -552,14 -532,20 +554,23 @@@ } }
+ // NO TRANSACTION SHOULD BE ACTIVE ON ENTRY - private void removeResourceType(Subject subject, ResourceType existingType) { + private void removeResourceType(Subject overlord, ResourceType existingType) { log.info("Removing ResourceType [" + toConciseString(existingType) + "]...");
+ if (entityManager.contains(existingType)) { + entityManager.refresh(existingType); + } + + // Completely remove the type from the type hierarchy. + removeFromParents(existingType); + removeFromChildren(existingType); + entityManager.merge(existingType); + // Remove all Resources that are of the type. - List<Resource> resources = existingType.getResources(); + ResourceCriteria c = new ResourceCriteria(); + c.addFilterResourceTypeId(existingType.getId()); + List<Resource> resources = resourceManager.findResourcesByCriteria(subject, c); if (resources != null) { Iterator<Resource> resIter = resources.iterator(); while (resIter.hasNext()) { @@@ -787,51 -759,61 +798,59 @@@ }
private void updateParentResourceTypes(ResourceType newType, ResourceType existingType) { - if (log.isDebugEnabled()) { - if (existingType != null) { - log.debug("Setting parent types on existing type: " + existingType + " to [" - + newType.getParentResourceTypes() + "] - current parent types are [" - + existingType.getParentResourceTypes() + "]..."); - } else { - log.debug("Setting parent types on new type: " + newType + " to [" + newType.getParentResourceTypes() - + "]..."); + //if (log.isDebugEnabled()) { + if (existingType != null) { + log.info("Setting parent types on existing type: " + existingType + " to [" + + newType.getParentResourceTypes() + "] - current parent types are [" + + existingType.getParentResourceTypes() + "]..."); + } else { + log.info("Setting parent types on new type: " + newType + " to [" + newType.getParentResourceTypes() + + "]..."); + //} + if (log.isDebugEnabled()) { + if (existingType != null) { + log.debug("Setting parent types on existing type: " + existingType + " to [" + + newType.getParentResourceTypes() + "] - current parent types are [" + + existingType.getParentResourceTypes() + "]..."); + } else { + log.debug("Setting parent types on new type: " + newType + " to [" + + newType.getParentResourceTypes() + "]..."); + } } - }
- Set<ResourceType> newParentTypes = newType.getParentResourceTypes(); - newType.setParentResourceTypes(new HashSet<ResourceType>()); - Set<ResourceType> originalExistingParentTypes = new HashSet<ResourceType>(); - if (existingType != null) { - originalExistingParentTypes.addAll(existingType.getParentResourceTypes()); - } - for (ResourceType newParentType : newParentTypes) { - try { - boolean isExistingParent = originalExistingParentTypes.remove(newParentType); - if (existingType == null || !isExistingParent) { - ResourceType realParentType = (ResourceType) entityManager.createNamedQuery( - ResourceType.QUERY_FIND_BY_NAME_AND_PLUGIN).setParameter("name", newParentType.getName()) - .setParameter("plugin", newParentType.getPlugin()).getSingleResult(); - ResourceType type = (existingType != null) ? existingType : newType; - if (existingType != null) { - log.info("Adding ResourceType [" + toConciseString(type) + "] as child of ResourceType [" - + toConciseString(realParentType) + "]..."); + Set<ResourceType> newParentTypes = newType.getParentResourceTypes(); + newType.setParentResourceTypes(new HashSet<ResourceType>()); + Set<ResourceType> originalExistingParentTypes = new HashSet<ResourceType>(); + if (existingType != null) { + originalExistingParentTypes.addAll(existingType.getParentResourceTypes()); + } + for (ResourceType newParentType : newParentTypes) { + try { + boolean isExistingParent = originalExistingParentTypes.remove(newParentType); + if (existingType == null || !isExistingParent) { + ResourceType realParentType = (ResourceType) entityManager.createNamedQuery( + ResourceType.QUERY_FIND_BY_NAME_AND_PLUGIN).setParameter("name", newParentType.getName()) + .setParameter("plugin", newParentType.getPlugin()).getSingleResult(); + ResourceType type = (existingType != null) ? existingType : newType; + if (existingType != null) { + log.info("Adding ResourceType [" + toConciseString(type) + "] as child of ResourceType [" + + toConciseString(realParentType) + "]..."); + } + realParentType.addChildResourceType(type); } - realParentType.addChildResourceType(type); + } catch (NoResultException nre) { + throw new RuntimeException("Couldn't persist type [" + newType + "] because parent [" + + newParentType + "] wasn't already persisted."); } - } catch (NoResultException nre) { - throw new RuntimeException("Couldn't persist type [" + newType + "] because parent [" + newParentType - + "] wasn't already persisted."); - } - + for (ResourceType obsoleteParentType : originalExistingParentTypes) { + log.info("Removing type [" + toConciseString(existingType) + "] from parent type [" + + toConciseString(obsoleteParentType) + "]..."); + obsoleteParentType.removeChildResourceType(existingType); + moveResourcesToNewParent(existingType, obsoleteParentType, newParentTypes); } - }
- for (ResourceType obsoleteParentType : originalExistingParentTypes) { - log.info("Removing type [" + toConciseString(existingType) + "] from parent type [" - + toConciseString(obsoleteParentType) + "]..."); - obsoleteParentType.removeChildResourceType(existingType); - moveResourcesToNewParent(existingType, obsoleteParentType, newParentTypes); + entityManager.flush(); } - - entityManager.flush(); }
private static String toConciseString(ResourceType type) { diff --cc modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/metadata/ResourceMetadataManagerLocal.java index d25f4cf,fc5d639..b3b782c --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/metadata/ResourceMetadataManagerLocal.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/metadata/ResourceMetadataManagerLocal.java @@@ -65,36 -84,16 +65,45 @@@ public interface ResourceMetadataManage */ Plugin getPlugin(String name);
- /** Exists only to have code execute within its own transaction. Not for general consumption. */ - boolean registerPluginInNewTransaction(Subject whoami, Plugin plugin, PluginDescriptor pluginDescriptor, - File pluginFile, boolean forceUpdate) throws Exception; + /** + * For server-side registration of plugin archives. At server startup or as new plugins are runtime deployed the jar + * will have its descriptor read and parsed and the metadata for the plugin will be updated in the db. + * If you provide a non-null <code>pluginFile</code>, and the plugin is deemed to be new or updated, the content + * of the file will be streamed to the database. Note that if you provide a non-null file, you must ensure + * its MD5 matches that of the file (i.e. this method will not attempt to recompute the file's MD5, it will assume + * the caller has already done that and provided the proper MD5 in <code>plugin</code>). + * <br/><br/> + * NOTE ** This call will register the plugin in a new transaction. + * + * @param plugin The plugin object being deployed + * @param metadata The plugin descriptor file + * @param pluginFile the actual plugin file whose content will be stored in the database (will be ignored if null) + * @param forceUpdate if <code>true</code>, the plugin's types will be updated, even if the plugin hasn't changed since + * the last time it was registered + */ + void registerPlugin(Subject subject, Plugin plugin, PluginDescriptor metadata, File pluginFile, boolean forceUpdate) + throws Exception; + + /** Exists only to for transactional boundary reasons. Not for general consumption. */ + boolean registerPluginTypes(Subject subject, Plugin plugin, PluginDescriptor pluginDescriptor, File pluginFile, + boolean forceUpdate) throws Exception; + + /** Exists only to for transactional boundary reasons. Not for general consumption. */ + void removeObsoleteSubCategories(Subject subject, ResourceType newType, ResourceType existingType); + + /** Exists only to for transactional boundary reasons. Not for general consumption. */ + void getPluginTypes(Subject subject, String pluginName, Set<ResourceType> legitTypes, + Set<ResourceType> obsoleteTypes);
+ /** Exists only to for transactional boundary reasons. Not for general consumption. */ + void completeRemoveResourceType(Subject subject, ResourceType existingType); - } ++ + /** Exists only to have code execute within its own transaction. Not for general consumption. */ + void removeObsoleteTypesInNewTransaction(String pluginName); + + /** Method to create a resourceType by given String parameters and persist it in server DB */ + void addNewResourceTypeByNames(String newResourceTypeName, String metricName); + + /** Method to add new ResourceType objects to server DB */ + void addNewResourceType(Set<ResourceType> resourceTypes); + } diff --cc modules/plugins/irc/pom.xml index ab18766,9dad959..380d1fb --- a/modules/plugins/irc/pom.xml +++ b/modules/plugins/irc/pom.xml @@@ -9,9 -9,9 +9,9 @@@ <parent> <artifactId>rhq-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>4.0.0-SNAPSHOT</version> + <version>3.0.0.B04</version> </parent> - + <groupId>org.rhq</groupId> <artifactId>rhq-irc-plugin</artifactId> <packaging>jar</packaging> diff --cc modules/plugins/pom.xml index 880254c,84dfda0..d6cb61f --- a/modules/plugins/pom.xml +++ b/modules/plugins/pom.xml @@@ -164,8 -165,7 +165,7 @@@
<modules> <module>byteman</module> - + <module>irc</module> - <module>iis</module> <module>database</module> <module>postgres</module> diff --cc modules/plugins/snmptrapd/pom.xml index 93bb45a,8f103fe..3c56a97 --- a/modules/plugins/snmptrapd/pom.xml +++ b/modules/plugins/snmptrapd/pom.xml @@@ -2,11 -2,11 +2,11 @@@ <parent> <artifactId>rhq-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>4.0.0-SNAPSHOT</version> + <version>3.0.0.B04</version> </parent> - + <modelVersion>4.0.0</modelVersion> - + <groupId>org.rhq</groupId> <artifactId>rhq-snmptrapd-plugin</artifactId> <name>RHQ SnmpTrapd Plugin</name>
commit a4aeccc47dbe35f45160de17dc2b8c5205ac7fa6 Author: Greg Hinkle ghinkle@redhat.com Date: Tue Aug 17 13:47:13 2010 -0400
Moving this off my shelf, a plugin oriented tree view for the plugin config, template metric and alert settings pages
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/type/PluginTypeTreeView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/type/PluginTypeTreeView.java new file mode 100644 index 0000000..5970507 --- /dev/null +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/type/PluginTypeTreeView.java @@ -0,0 +1,115 @@ +/* + * RHQ Management Platform + * Copyright (C) 2005-2010 Red Hat, Inc. + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ +package org.rhq.enterprise.gui.coregui.client.inventory.resource.type; + +import com.google.gwt.user.client.rpc.AsyncCallback; +import com.smartgwt.client.data.Record; +import com.smartgwt.client.widgets.layout.VLayout; +import com.smartgwt.client.widgets.tree.TreeGrid; +import com.smartgwt.client.widgets.tree.TreeGridField; +import com.smartgwt.client.widgets.tree.TreeNode; + +import org.rhq.core.domain.criteria.ResourceTypeCriteria; +import org.rhq.core.domain.resource.ResourceType; +import org.rhq.core.domain.util.PageControl; +import org.rhq.core.domain.util.PageList; +import org.rhq.enterprise.gui.coregui.client.CoreGUI; +import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup; +import org.rhq.enterprise.gui.coregui.client.gwt.ResourceTypeGWTServiceAsync; + +/** + * @author Greg Hinkle + */ +public class PluginTypeTreeView extends VLayout { + + private ResourceTypeGWTServiceAsync resourceTypeService = GWTServiceLookup.getResourceTypeGWTService(); + + public PluginTypeTreeView() { + setWidth100(); + setHeight100(); + } + + @Override + protected void onDraw() { + super.onDraw(); + + + final TreeGrid treeGrid = new CustomResourceTypeTreeGrid(); + + treeGrid.setHeight100(); + + treeGrid.setTitle("Resource Types"); + treeGrid.setAnimateFolders(false); + treeGrid.setResizeFieldsInRealTime(true); + + + final TreeGridField name, plugin, category; + name = new TreeGridField("name"); + plugin = new TreeGridField("plugin"); + category = new TreeGridField("category"); + + treeGrid.setFields(name, plugin, category); + + addMember(treeGrid); + + ResourceTypeCriteria criteria = new ResourceTypeCriteria(); + criteria.fetchParentResourceTypes(true); + criteria.setPageControl(PageControl.getUnlimitedInstance()); + + resourceTypeService.findResourceTypesByCriteria(criteria, + new AsyncCallback<PageList<ResourceType>>() { + public void onFailure(Throwable caught) { + CoreGUI.getErrorHandler().handleError("Failed to load inventory discovery queue", caught); + } + + public void onSuccess(PageList<ResourceType> result) { + + treeGrid.getTree().linkNodes(ResourceTypePluginTreeDataSource.buildNodes(result)); + + } + }); + } + + + public static class CustomResourceTypeTreeGrid extends TreeGrid { + @Override + protected String getIcon(Record record, boolean defaultState) { + + if (record instanceof TreeNode) { + boolean open = getTree().isOpen((TreeNode) record); + + if (record instanceof ResourceTypePluginTreeDataSource.ResourceTypeTreeNode) { + ResourceType resourceType = ((ResourceTypePluginTreeDataSource.ResourceTypeTreeNode) record).getResourceType(); + + switch (resourceType.getCategory()) { + case PLATFORM: + return "types/Platform_up_16.png"; + case SERVER: + return "types/Server_up_16.png"; + case SERVICE: + return "types/Service_up_16.png"; + } + } else if (record instanceof ResourceTypePluginTreeDataSource.PluginTreeNode) { + return "types/plugin_16.png"; + } + } + return null; + } + } +}
commit 528c6e5fb51b0f5c6fdc5dc10adb5c58c1279305 Author: Greg Hinkle ghinkle@redhat.com Date: Tue Aug 17 13:44:28 2010 -0400
dead code removal
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/SmallGraphView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/SmallGraphView.java index 49e3974..c1dd21b 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/SmallGraphView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/SmallGraphView.java @@ -18,7 +18,6 @@ */ package org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.monitoring;
-import java.util.ArrayList; import java.util.Date; import java.util.EnumSet; import java.util.List; @@ -42,9 +41,7 @@ import ca.nanometrics.gflot.client.options.TickFormatter; import com.google.gwt.i18n.client.DateTimeFormat; import com.google.gwt.user.client.rpc.AsyncCallback; import com.smartgwt.client.types.AnimationEffect; -import com.smartgwt.client.widgets.Canvas; import com.smartgwt.client.widgets.HTMLFlow; -import com.smartgwt.client.widgets.HTMLPane; import com.smartgwt.client.widgets.Img; import com.smartgwt.client.widgets.Label; import com.smartgwt.client.widgets.WidgetCanvas; @@ -57,8 +54,6 @@ import com.smartgwt.client.widgets.layout.HLayout; import com.smartgwt.client.widgets.layout.VLayout;
import org.rhq.core.domain.criteria.ResourceCriteria; -import org.rhq.core.domain.measurement.DataType; -import org.rhq.core.domain.measurement.DisplayType; import org.rhq.core.domain.measurement.MeasurementConverterClient; import org.rhq.core.domain.measurement.MeasurementDefinition; import org.rhq.core.domain.measurement.composite.MeasurementDataNumericHighLowComposite; @@ -132,7 +127,7 @@ public class SmallGraphView extends VLayout {
public void setDefinitionId(int definitionId) { this.definitionId = definitionId; - this.definition = null; + this.definition = null; }
@Override @@ -260,8 +255,6 @@ public class SmallGraphView extends VLayout { // create a series if (definition != null && data != null) { loadData(model, plotOptions); - } else { - loadFakeData(model, plotOptions); }
// create the plot @@ -362,29 +355,6 @@ public class SmallGraphView extends VLayout {
}
- private void loadFakeData(PlotModel model, PlotOptions plotOptions) { - SeriesHandler handler = model.addSeries("Ottawa's Month Temperatures", "#007f00"); - - // add data - handler.add(new DataPoint(1, -10.5)); - handler.add(new DataPoint(2, -8.6)); - handler.add(new DataPoint(3, -2.4)); - handler.add(new DataPoint(4, 6)); - handler.add(new DataPoint(5, 13.6)); - handler.add(new DataPoint(6, 18.4)); - handler.add(new DataPoint(7, 21)); - handler.add(new DataPoint(8, 19.7)); - handler.add(new DataPoint(9, 14.7)); - handler.add(new DataPoint(10, 8.2)); - handler.add(new DataPoint(11, 1.5)); - handler.add(new DataPoint(12, -6.6)); - - plotOptions.setXAxisOptions(new AxisOptions().setTicks(12).setTickFormatter(new TickFormatter() { - public String formatTickValue(double tickValue, Axis axis) { - return MONTH_NAMES[(int) (tickValue - 1)]; - } - })); - }
private void displayAsDialog() { SmallGraphView graph = new SmallGraphView(resourceId, definition, data);
commit 7470277296582f98c47457509dbeb827e126e0a8 Author: Greg Hinkle ghinkle@redhat.com Date: Tue Aug 17 13:41:39 2010 -0400
ResourceTree preloading, preopening, lazy fixes Resource breadcrumb fixes
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTopView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTopView.java index efed5ff..535cdca 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTopView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTopView.java @@ -18,6 +18,8 @@ */ package org.rhq.enterprise.gui.coregui.client.inventory.resource.detail;
+import java.util.EnumSet; + import com.google.gwt.user.client.rpc.AsyncCallback; import com.smartgwt.client.widgets.Canvas; import com.smartgwt.client.widgets.layout.HLayout; @@ -37,8 +39,6 @@ import org.rhq.enterprise.gui.coregui.client.inventory.resource.InventoryView; import org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTypeRepository; import org.rhq.enterprise.gui.coregui.client.util.message.Message;
-import java.util.EnumSet; - /** * @author Greg Hinkle */ @@ -125,7 +125,6 @@ public class ResourceTopView extends HLayout implements BookmarkableView {
private void completeSetSelectedResource(ResourceComposite resourceComposite, ViewPath viewPath) { this.currentResource = resourceComposite; - this.treeView.setSelectedResource(resourceComposite.getResource(), viewPath.getCurrent()); this.detailView.onResourceSelected(resourceComposite); }
@@ -152,8 +151,9 @@ public class ResourceTopView extends HLayout implements BookmarkableView { setSelectedResource(resourceId, viewPath); }
- viewPath.next(); this.treeView.renderView(viewPath); + + viewPath.next(); this.detailView.renderView(viewPath); }
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTreeDatasource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTreeDatasource.java index 67417dd..1adee12 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTreeDatasource.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTreeDatasource.java @@ -23,13 +23,11 @@ import java.util.EnumSet; import java.util.HashMap; import java.util.List;
-import com.google.gwt.user.client.Window; import com.google.gwt.user.client.rpc.AsyncCallback; import com.smartgwt.client.data.DSRequest; import com.smartgwt.client.data.DSResponse; import com.smartgwt.client.data.DataSource; import com.smartgwt.client.data.DataSourceField; -import com.smartgwt.client.data.Record; import com.smartgwt.client.data.fields.DataSourceImageField; import com.smartgwt.client.data.fields.DataSourceTextField; import com.smartgwt.client.rpc.RPCResponse; @@ -142,6 +140,7 @@ public class ResourceTreeDatasource extends DataSource { // criteria.addFilterId(rootId);
processIncomingData(initialData, response, requestId); + response.setStatus(DSResponse.STATUS_SUCCESS); return;
} else { @@ -174,7 +173,7 @@ public class ResourceTreeDatasource extends DataSource { public void onResourceTypeLoaded(List<Resource> result) { response.setData(build(result)); processResponse(requestId, response); - + response.setStatus(DSResponse.STATUS_SUCCESS); } }); } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTreeView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTreeView.java index 02570b6..f01e0e6 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTreeView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTreeView.java @@ -18,7 +18,36 @@ */ package org.rhq.enterprise.gui.coregui.client.inventory.resource.detail;
+import java.util.ArrayList; +import java.util.EnumSet; +import java.util.List; + +import com.google.gwt.user.client.History; +import com.google.gwt.user.client.rpc.AsyncCallback; +import com.smartgwt.client.data.DSCallback; +import com.smartgwt.client.data.DSRequest; +import com.smartgwt.client.data.DSResponse; +import com.smartgwt.client.types.SelectionStyle; +import com.smartgwt.client.widgets.Window; +import com.smartgwt.client.widgets.events.CloseClickHandler; +import com.smartgwt.client.widgets.events.CloseClientEvent; +import com.smartgwt.client.widgets.grid.events.SelectionChangedHandler; +import com.smartgwt.client.widgets.grid.events.SelectionEvent; +import com.smartgwt.client.widgets.layout.VLayout; +import com.smartgwt.client.widgets.menu.Menu; +import com.smartgwt.client.widgets.menu.MenuItem; +import com.smartgwt.client.widgets.menu.MenuItemSeparator; +import com.smartgwt.client.widgets.menu.events.ClickHandler; +import com.smartgwt.client.widgets.menu.events.MenuItemClickEvent; +import com.smartgwt.client.widgets.tree.TreeGrid; +import com.smartgwt.client.widgets.tree.TreeNode; +import com.smartgwt.client.widgets.tree.events.DataArrivedEvent; +import com.smartgwt.client.widgets.tree.events.DataArrivedHandler; +import com.smartgwt.client.widgets.tree.events.NodeContextClickEvent; +import com.smartgwt.client.widgets.tree.events.NodeContextClickHandler; + import org.rhq.core.domain.configuration.PropertySimple; +import org.rhq.core.domain.criteria.ResourceCriteria; import org.rhq.core.domain.criteria.ResourceTypeCriteria; import org.rhq.core.domain.dashboard.Dashboard; import org.rhq.core.domain.dashboard.DashboardPortlet; @@ -43,38 +72,13 @@ import org.rhq.enterprise.gui.coregui.client.inventory.resource.factory.Resource import org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTypeRepository; import org.rhq.enterprise.gui.coregui.client.util.message.Message;
-import com.google.gwt.user.client.History; -import com.google.gwt.user.client.rpc.AsyncCallback; -import com.smartgwt.client.types.SelectionStyle; -import com.smartgwt.client.util.SC; -import com.smartgwt.client.widgets.Window; -import com.smartgwt.client.widgets.events.CloseClickHandler; -import com.smartgwt.client.widgets.events.CloseClientEvent; -import com.smartgwt.client.widgets.events.ShowContextMenuEvent; -import com.smartgwt.client.widgets.events.ShowContextMenuHandler; -import com.smartgwt.client.widgets.grid.events.SelectionChangedHandler; -import com.smartgwt.client.widgets.grid.events.SelectionEvent; -import com.smartgwt.client.widgets.layout.VLayout; -import com.smartgwt.client.widgets.menu.Menu; -import com.smartgwt.client.widgets.menu.MenuItem; -import com.smartgwt.client.widgets.menu.MenuItemSeparator; -import com.smartgwt.client.widgets.menu.events.ClickHandler; -import com.smartgwt.client.widgets.menu.events.MenuItemClickEvent; -import com.smartgwt.client.widgets.tree.TreeGrid; -import com.smartgwt.client.widgets.tree.TreeNode; -import com.smartgwt.client.widgets.tree.events.DataArrivedEvent; -import com.smartgwt.client.widgets.tree.events.DataArrivedHandler; -import com.smartgwt.client.widgets.tree.events.NodeContextClickEvent; -import com.smartgwt.client.widgets.tree.events.NodeContextClickHandler; - -import java.util.ArrayList; -import java.util.EnumSet; -import java.util.List; - /** * @author Greg Hinkle */ public class ResourceTreeView extends VLayout { + + private int selectedResourceId; + private Resource selectedResource; private Resource rootResource;
@@ -138,7 +142,6 @@ public class ResourceTreeView extends VLayout {
} } - } } }); @@ -147,7 +150,7 @@ public class ResourceTreeView extends VLayout { // This constructs the context menu for the resource at the time of the click. setContextMenu(contextMenu);
- +
treeGrid.addNodeContextClickHandler(new NodeContextClickHandler() { public void onNodeContextClick(final NodeContextClickEvent event) { @@ -161,6 +164,44 @@ public class ResourceTreeView extends VLayout { } } }); + + treeGrid.addDataArrivedHandler(new DataArrivedHandler() { + public void onDataArrived(DataArrivedEvent dataArrivedEvent) { + if (!initialSelect) { + + updateBreadcrumb(); + } + } + }); + } + + private void updateBreadcrumb() { + TreeNode selectedNode = treeGrid.getTree().findById(String.valueOf(selectedResourceId)); +// System.out.println("Trying to preopen: " + selectedNode); + if (selectedNode != null) { + TreeNode[] parents = treeGrid.getTree().getParents(selectedNode); + treeGrid.getTree().openFolders(parents); + treeGrid.getTree().openFolder(selectedNode); + + for (TreeNode p : parents) { +// System.out.println("open? " + treeGrid.getTree().isOpen(p) + " node: " + p.getName()); + } + + treeGrid.selectRecord(selectedNode); + initialSelect = true; + treeGrid.markForRedraw(); + + // Update breadcrumbs + if (currentViewId != null) { + currentViewId.getBreadcrumbs().clear(); + for (int i = parents.length - 1; i >= 0; i--) { + TreeNode n = parents[i]; + adjustBreadcrumb(n, currentViewId); + } + adjustBreadcrumb(selectedNode, currentViewId); + CoreGUI.refreshBreadCrumbTrail(); + } + } }
@@ -252,7 +293,21 @@ public class ResourceTreeView extends VLayout { MenuItem operationItem = new MenuItem(operationDefinition.getDisplayName()); operationItem.addClickHandler(new ClickHandler() { public void onClick(MenuItemClickEvent event) { - new OperationCreateWizard(selectedResource, operationDefinition).startOperationWizard(); + + ResourceCriteria criteria = new ResourceCriteria(); + criteria.addFilterId(selectedResourceId); + + GWTServiceLookup.getResourceService().findResourcesByCriteria(criteria, + new AsyncCallback<PageList<Resource>>() { + public void onFailure(Throwable caught) { + CoreGUI.getErrorHandler().handleError("Failed to get resource to run operation",caught); + } + + public void onSuccess(PageList<Resource> result) { + new OperationCreateWizard(result.get(0), operationDefinition).startOperationWizard(); + } + }); + } }); opSubMenu.addItem(operationItem); @@ -351,8 +406,6 @@ public class ResourceTreeView extends VLayout { Menu defSubItem = new Menu(); defItem.setSubmenu(defSubItem);
- - for (final Dashboard d : result) { MenuItem addToDBItem = new MenuItem("Add chart to Dashboard: " + d.getName()); defSubItem.addItem(addToDBItem); @@ -361,7 +414,7 @@ public class ResourceTreeView extends VLayout { public void onClick(MenuItemClickEvent menuItemClickEvent) {
DashboardPortlet p = new DashboardPortlet(def.getDisplayName() + " Chart", GraphPortlet.KEY, 250); - p.getConfiguration().put(new PropertySimple(GraphPortlet.CFG_RESOURCE_ID, selectedResource.getId())); + p.getConfiguration().put(new PropertySimple(GraphPortlet.CFG_RESOURCE_ID, selectedResourceId)); p.getConfiguration().put(new PropertySimple(GraphPortlet.CFG_DEFINITION_ID, def.getId()));
d.addPortlet(p, 0, 0); @@ -405,12 +458,12 @@ public class ResourceTreeView extends VLayout { this.rootResource = rootResource; }
- public void setSelectedResource(final Resource selectedResource, final ViewId viewId) { - this.selectedResource = selectedResource; + public void setSelectedResource(final int selectedResourceId) { + this.selectedResourceId = selectedResourceId;
TreeNode node = null; if (treeGrid != null && treeGrid.getTree() != null - && (node = treeGrid.getTree().findById(String.valueOf(selectedResource.getId()))) != null) { + && (node = treeGrid.getTree().findById(String.valueOf(selectedResourceId))) != null) {
// This is the case where the tree was previously loaded and we get fired to look at a different // node in the same tree and just have to switch the selection @@ -423,6 +476,9 @@ public class ResourceTreeView extends VLayout { treeGrid.selectRecord(node);
+ updateBreadcrumb(); + /* + TODO DELETEME // Update breadcrumbs viewId.getBreadcrumbs().clear(); for (int i = parents.length - 1; i >= 0; i--) { @@ -432,14 +488,15 @@ public class ResourceTreeView extends VLayout { adjustBreadcrumb(node, viewId);
CoreGUI.refreshBreadCrumbTrail(); +*/
- - // Todo: update viewId's breadcrumbs with known data } else {
+ // This is for cases where we have to load the tree fresh including down to the currently visible node + final ResourceGWTServiceAsync resourceService = GWTServiceLookup.getResourceService(); // This is an expensive call, but loads all nodes that are visible in the tree given a selected resource - resourceService.getResourceLineageAndSiblings(selectedResource.getId(), new AsyncCallback<List<Resource>>() { + resourceService.getResourceLineageAndSiblings(selectedResourceId, new AsyncCallback<List<Resource>>() { public void onFailure(Throwable caught) { CoreGUI.getErrorHandler().handleError("Failed to lookup platform for tree", caught); } @@ -457,39 +514,7 @@ public class ResourceTreeView extends VLayout { setRootResource(root);
- treeGrid.addDataArrivedHandler(new DataArrivedHandler() { - public void onDataArrived(DataArrivedEvent dataArrivedEvent) { - if (!initialSelect) {
- TreeNode selectedNode = treeGrid.getTree().findById(String.valueOf(selectedResource.getId())); -// System.out.println("Trying to preopen: " + selectedNode); - if (selectedNode != null) { - TreeNode[] parents = treeGrid.getTree().getParents(selectedNode); - treeGrid.getTree().openFolders(parents); - treeGrid.getTree().openFolder(selectedNode); - - for (TreeNode p : parents) { -// System.out.println("open? " + treeGrid.getTree().isOpen(p) + " node: " + p.getName()); - } - - treeGrid.selectRecord(selectedNode); - initialSelect = true; - treeGrid.markForRedraw(); - - // Update breadcrumbs - if (viewId != null) { - viewId.getBreadcrumbs().clear(); - for (int i = parents.length - 1; i >= 0; i--) { - TreeNode n = parents[i]; - adjustBreadcrumb(n, viewId); - } - adjustBreadcrumb(selectedNode, viewId); - CoreGUI.refreshBreadCrumbTrail(); - } - } - } - } - });
ResourceTreeDatasource dataSource = new ResourceTreeDatasource(result); treeGrid.setDataSource(dataSource); @@ -500,7 +525,16 @@ public class ResourceTreeView extends VLayout { addMember(treeGrid);
- TreeNode selectedNode = treeGrid.getTree().findById(String.valueOf(selectedResource.getId())); + treeGrid.fetchData(treeGrid.getCriteria(),new DSCallback() { + public void execute(DSResponse dsResponse, Object o, DSRequest dsRequest) { + System.out.println("Here!!!!!"); + updateBreadcrumb(); + } + }); + + + + TreeNode selectedNode = treeGrid.getTree().findById(String.valueOf(selectedResourceId)); // System.out.println("Trying to preopen: " + selectedNode); if (selectedNode != null) { // System.out.println("Preopen node!!!"); @@ -512,6 +546,8 @@ public class ResourceTreeView extends VLayout { System.out.println("open? " + treeGrid.getTree().isOpen(p) + " node: " + p.getName()); }
+ updateBreadcrumb(); + treeGrid.selectRecord(selectedNode); initialSelect = true; treeGrid.markForRedraw(); @@ -527,7 +563,7 @@ public class ResourceTreeView extends VLayout {
treeGrid.getTree().linkNodes(ResourceTreeDatasource.build(result));
- TreeNode selectedNode = treeGrid.getTree().findById(String.valueOf(selectedResource.getId())); + TreeNode selectedNode = treeGrid.getTree().findById(String.valueOf(selectedResourceId)); if (selectedNode != null) { treeGrid.deselectAllRecords(); treeGrid.selectRecord(selectedNode); @@ -536,6 +572,8 @@ public class ResourceTreeView extends VLayout { treeGrid.getTree().openFolders(parents); treeGrid.getTree().openFolder(selectedNode);
+ /* + todo deleteme // Update breadcrumbs viewId.getBreadcrumbs().clear(); for (int i = parents.length - 1; i >= 0; i--) { @@ -543,10 +581,10 @@ public class ResourceTreeView extends VLayout { adjustBreadcrumb(n, viewId); } adjustBreadcrumb(selectedNode, viewId); - CoreGUI.refreshBreadCrumbTrail(); + CoreGUI.refreshBreadCrumbTrail();*/
} else { - CoreGUI.getMessageCenter().notify(new Message("Failed to select resource [" + selectedResource.getId() + "] in tree.", Message.Severity.Warning)); + CoreGUI.getMessageCenter().notify(new Message("Failed to select resource [" + selectedResourceId + "] in tree.", Message.Severity.Warning)); }
@@ -556,7 +594,7 @@ public class ResourceTreeView extends VLayout {
}
- TreeNode selectedNode = treeGrid.getTree().findById(String.valueOf(selectedResource.getId())); + TreeNode selectedNode = treeGrid.getTree().findById(String.valueOf(selectedResourceId)); // System.out.println("Trying to preopen: " + selectedNode); if (selectedNode != null) { TreeNode[] parents = treeGrid.getTree().getParents(selectedNode); @@ -622,6 +660,8 @@ public class ResourceTreeView extends VLayout {
public void renderView(ViewPath viewPath) { currentViewId = viewPath.getCurrent(); + Integer resourceId = Integer.parseInt(currentViewId.getPath()); + setSelectedResource(resourceId); } }
commit 13b0161e3f4f0912b54612f7f8507cc3053aa596 Author: Greg Hinkle ghinkle@redhat.com Date: Tue Aug 17 13:39:57 2010 -0400
Fix resource link to default resource view
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LinkManager.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LinkManager.java index 0375213..ee73969 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LinkManager.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LinkManager.java @@ -33,7 +33,7 @@ public class LinkManager { public static String getResourceLink(int resourceId) {
if (GWT) { - return "#Resource/" + resourceId; + return "#Resource/" + resourceId + "/Summary/Overview"; } else { return "/rhq/resource/summary/summary.xhtml?id=" + resourceId; }
commit 9132b980be2f36c13676f975a047203d56a9227a Author: Greg Hinkle ghinkle@redhat.com Date: Tue Aug 17 13:38:24 2010 -0400
Fix resource link
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertsView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertsView.java index ba81f5c..8983ffe 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertsView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertsView.java @@ -41,6 +41,7 @@ import com.smartgwt.client.widgets.tab.Tab; import com.smartgwt.client.widgets.tab.TabSet;
import org.rhq.core.domain.criteria.AlertCriteria; +import org.rhq.enterprise.gui.coregui.client.LinkManager; import org.rhq.enterprise.gui.coregui.client.components.table.Table; import org.rhq.enterprise.gui.coregui.client.components.table.TableAction;
@@ -105,7 +106,7 @@ public class AlertsView extends Table {
listGrid.getField("resourceName").setCellFormatter(new CellFormatter() { public String format(Object o, ListGridRecord listGridRecord, int i, int i1) { - return "<a href="#Resource/" + listGridRecord.getAttribute("resourceId") + "">" + o + "</a>"; + return "<a href="" + LinkManager.getResourceLink(listGridRecord.getAttributeAsInt("resourceId")) + "">" + o + "</a>"; } });
commit 1ffccc1d48ef1de58b2af3754c4e55db337af971 Author: Greg Hinkle ghinkle@redhat.com Date: Mon Aug 16 10:58:51 2010 -0400
Support enable/disablement of subtabs properly
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/SubTabLayout.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/SubTabLayout.java deleted file mode 100644 index ea27d0c..0000000 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/SubTabLayout.java +++ /dev/null @@ -1,101 +0,0 @@ -/* - * RHQ Management Platform - * Copyright (C) 2005-2010 Red Hat, Inc. - * All rights reserved. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation version 2 of the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ -package org.rhq.enterprise.gui.coregui.client.components; - -import com.smartgwt.client.types.SelectionType; -import com.smartgwt.client.widgets.Button; -import com.smartgwt.client.widgets.Canvas; -import com.smartgwt.client.widgets.events.ClickEvent; -import com.smartgwt.client.widgets.events.ClickHandler; -import com.smartgwt.client.widgets.layout.VLayout; -import com.smartgwt.client.widgets.toolbar.ToolStrip; - -import java.util.LinkedHashMap; - -/** - * @author Greg Hinkle - */ -public class SubTabLayout extends VLayout { - - ToolStrip buttonBar; - - LinkedHashMap<String, Canvas> subtabs = new LinkedHashMap<String, Canvas>(); - - Canvas currentlyDisplayed; - - @Override - protected void onDraw() { - super.onDraw(); - - setWidth100(); - setHeight100(); - setMargin(0); - setPadding(0); - - - buttonBar = new ToolStrip(); - buttonBar.setBackgroundColor("grey"); - buttonBar.setWidth100(); - buttonBar.setBorder(null); - - - for (final String title : subtabs.keySet()) { - if (currentlyDisplayed == null) { - currentlyDisplayed = subtabs.get(title); - } - - - Button button = new Button(title); - button.setShowRollOver(false); - button.setActionType(SelectionType.RADIO); - button.setRadioGroup("subtabs"); - button.setBorder(null); - - button.setBaseStyle("SubTabButton"); - -// button.setStyleName("SubTabButton"); -// button.setStylePrimaryName("SubTabButton"); - - button.addClickHandler(new ClickHandler() { - public void onClick(ClickEvent clickEvent) { - if (currentlyDisplayed != null) { - removeMember(currentlyDisplayed); - } - currentlyDisplayed = subtabs.get(title); - addMember(currentlyDisplayed); - markForRedraw(); - } - }); - - buttonBar.addMember(button); - - } - addMember(buttonBar); - - // Initial settings - Button b = (Button) buttonBar.getMember(0); - b.select(); - addMember(currentlyDisplayed); - } - - - public void registerSubTab(String title, Canvas canvas) { - subtabs.put(title, canvas); - } -} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/tab/SubTabLayout.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/tab/SubTabLayout.java index cda5761..afec88d 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/tab/SubTabLayout.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/tab/SubTabLayout.java @@ -18,6 +18,7 @@ */ package org.rhq.enterprise.gui.coregui.client.components.tab;
+import java.util.HashMap; import java.util.HashSet; import java.util.LinkedHashMap; import java.util.Map; @@ -39,10 +40,11 @@ import com.smartgwt.client.widgets.toolbar.ToolStrip; */ public class SubTabLayout extends VLayout {
- ToolStrip buttonBar; + private ToolStrip buttonBar;
- Map<String, Canvas> subtabs = new LinkedHashMap<String, Canvas>(); - Set<String> disabledSubTabs = new HashSet<String>(); + private LinkedHashMap<String, Canvas> subtabs = new LinkedHashMap<String, Canvas>(); + private HashMap<String, Button> subTabButtons = new HashMap<String, Button>(); + private Set<String> disabledSubTabs = new HashSet<String>();
Canvas currentlyDisplayed; String currentlySelected; @@ -107,6 +109,8 @@ public class SubTabLayout extends VLayout { } });
+ subTabButtons.put(title,button); + buttonBar.addMember(button);
} @@ -116,13 +120,17 @@ public class SubTabLayout extends VLayout { }
public void enableSubTab(String title) { - if (disabledSubTabs.remove(title)) { + disabledSubTabs.remove(title); + if (subTabButtons.containsKey(title)) { + subTabButtons.get(title).enable(); markForRedraw(); } }
public void disableSubTab(String title) { - if (disabledSubTabs.add(title)) { + disabledSubTabs.add(title); + if (subTabButtons.containsKey(title)) { + subTabButtons.get(title).disable(); markForRedraw(); } } @@ -201,7 +209,7 @@ public class SubTabLayout extends VLayout {
public void fireSubTabSelection() { TwoLevelTabSelectedEvent event = new TwoLevelTabSelectedEvent("?", currentlySelected, -1, currentIndex, - currentlyDisplayed); + currentlyDisplayed); hm.fireEvent(event); } } \ No newline at end of file
commit 7acc837d4759fe020daf9224df31bbfd83bcd524 Author: Greg Hinkle ghinkle@redhat.com Date: Fri Aug 13 13:51:29 2010 -0400
Remove out of date query settings from resourcedatasource
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceDatasource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceDatasource.java index 88c61d4..b56df20 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceDatasource.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceDatasource.java @@ -18,13 +18,6 @@ */ package org.rhq.enterprise.gui.coregui.client.inventory.resource;
-import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.AVAILABILITY; -import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.CATEGORY; -import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.DESCRIPTION; -import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.NAME; -import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.PLUGIN; -import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.TYPE; - import com.google.gwt.user.client.rpc.AsyncCallback; import com.smartgwt.client.data.DSRequest; import com.smartgwt.client.data.DSResponse; @@ -46,12 +39,18 @@ import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup; import org.rhq.enterprise.gui.coregui.client.gwt.ResourceGWTServiceAsync; import org.rhq.enterprise.gui.coregui.client.util.RPCDataSource;
+import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.AVAILABILITY; +import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.CATEGORY; +import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.DESCRIPTION; +import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.NAME; +import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.PLUGIN; +import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.TYPE; + /** * @author Greg Hinkle */ public class ResourceDatasource extends RPCDataSource<Resource> {
- private String query;
private ResourceGWTServiceAsync resourceService = GWTServiceLookup.getResourceService();
@@ -61,7 +60,7 @@ public class ResourceDatasource extends RPCDataSource<Resource> { DataSourceField idDataField = new DataSourceIntegerField("id", "ID", 20); idDataField.setPrimaryKey(true);
- DataSourceImageField iconField = new DataSourceImageField("icon"); + DataSourceImageField iconField = new DataSourceImageField("icon",""); iconField.setImageURLPrefix("types/");
DataSourceTextField nameDataField = new DataSourceTextField(NAME.propertyName(), NAME.title(), 200); @@ -84,13 +83,6 @@ public class ResourceDatasource extends RPCDataSource<Resource> { categoryDataField, availabilityDataField); }
- public String getQuery() { - return query; - } - - public void setQuery(String query) { - this.query = query; - }
public void executeFetch(final DSRequest request, final DSResponse response) {
commit c2aa64c1dbc3acf1251898359d48060fd72b9a56 Merge: 02a6eaf... cf30cd9... Author: Lukas Krejci lkrejci@redhat.com Date: Tue Aug 17 19:21:09 2010 +0200
Merge branch 'ui-updates'
commit cf30cd9117a2a179ae1d28fb820073405bcf1890 Author: Lukas Krejci lkrejci@redhat.com Date: Tue Aug 17 19:12:03 2010 +0200
clean up of the disambiguation API before merge into master
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/composite/ResourceNamesDisambiguationResult.java b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/composite/ResourceNamesDisambiguationResult.java deleted file mode 100644 index 4578aee..0000000 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/composite/ResourceNamesDisambiguationResult.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * RHQ Management Platform - * Copyright (C) 2005-2010 Red Hat, Inc. - * All rights reserved. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License, version 2, as - * published by the Free Software Foundation, and/or the GNU Lesser - * General Public License, version 2.1, also as published by the Free - * Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License and the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License - * and the GNU Lesser General Public License along with this program; - * if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -package org.rhq.core.domain.resource.composite; - -import java.io.Serializable; -import java.util.List; - -/** - * This class is a result of resource disambiguation. - * This is used in ResourceManager. When supplied a list of results, it returns an - * instance of this class describing how the results should be disambiguated. - * - * @author Lukas Krejci - */ -public class ResourceNamesDisambiguationResult<T> implements Serializable { - - private static final long serialVersionUID = 1L; - - private List<DisambiguationReport<T>> resolution; - - public ResourceNamesDisambiguationResult(List<DisambiguationReport<T>> resolution) { - this.resolution = resolution; - } - - /** - * Lists the disambiguation results. - * Each record contains the original value, disambiguated parents, the resource type name and - * the type plugin name. - */ - public List<DisambiguationReport<T>> getResolution() { - return resolution; - } - - public String toString() { - return "ResourceNamesDisambiguationResult(resolution=" + resolution + ")"; - } -} diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/common/paging/ResourceNameDisambiguatingPagedListDataModel.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/common/paging/ResourceNameDisambiguatingPagedListDataModel.java index 8999775..300fddc 100644 --- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/common/paging/ResourceNameDisambiguatingPagedListDataModel.java +++ b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/common/paging/ResourceNameDisambiguatingPagedListDataModel.java @@ -23,8 +23,9 @@
package org.rhq.enterprise.gui.common.paging;
+import java.util.List; + import org.rhq.core.domain.resource.composite.DisambiguationReport; -import org.rhq.core.domain.resource.composite.ResourceNamesDisambiguationResult; import org.rhq.core.domain.util.PageControl; import org.rhq.core.domain.util.PageList; import org.rhq.core.util.IntExtractor; @@ -66,10 +67,10 @@ public abstract class ResourceNameDisambiguatingPagedListDataModel<T> extends public PageList<DisambiguationReport<T>> fetchPage(PageControl pc) { PageList<T> data = fetchDataForPage(pc);
- ResourceNamesDisambiguationResult<T> disambiguation = resourceManager.disambiguate(data, getResourceIdExtractor(), + List<DisambiguationReport<T>> disambiguation = resourceManager.disambiguate(data, getResourceIdExtractor(), DefaultDisambiguationUpdateStrategies.getDefault());
- return new PageList<DisambiguationReport<T>>(disambiguation.getResolution(), data.getTotalSize(), data + return new PageList<DisambiguationReport<T>>(disambiguation, data.getTotalSize(), data .getPageControl()); }
diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/discovery/AutoDiscoveryQueueUIBean.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/discovery/AutoDiscoveryQueueUIBean.java index e079474..3f42406 100644 --- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/discovery/AutoDiscoveryQueueUIBean.java +++ b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/discovery/AutoDiscoveryQueueUIBean.java @@ -296,7 +296,7 @@ public class AutoDiscoveryQueueUIBean extends PagedDataTableUIBean {
List<DisambiguationReport<Resource>> disambiguatedQueuedPlatforms = resourceManager.disambiguate(queuedPlatforms, - RESOURCE_ID_EXTRACTOR, DefaultDisambiguationUpdateStrategies.getDefault()).getResolution(); + RESOURCE_ID_EXTRACTOR, DefaultDisambiguationUpdateStrategies.getDefault());
PageList<DisambiguationReport<Resource>> disambiguatedQueuedPlaformsPageList = new PageList<DisambiguationReport<Resource>>(disambiguatedQueuedPlatforms, queuedPlatforms.getTotalSize(), queuedPlatforms.getPageControl()); @@ -306,7 +306,7 @@ public class AutoDiscoveryQueueUIBean extends PagedDataTableUIBean { for (InventoryStatus status : newIgnoredSet) { List<Resource> childServers = discoveryBoss.getQueuedPlatformChildServers(subject, status, platform.getOriginal()); List<DisambiguationReport<Resource>> disambiguatedChildServers = - resourceManager.disambiguate(childServers, RESOURCE_ID_EXTRACTOR, DefaultDisambiguationUpdateStrategies.getDefault()).getResolution(); + resourceManager.disambiguate(childServers, RESOURCE_ID_EXTRACTOR, DefaultDisambiguationUpdateStrategies.getDefault());
queuedServers.addAll(disambiguatedChildServers); diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/group/inventory/AddGroupResourcesFormPrepareAction.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/group/inventory/AddGroupResourcesFormPrepareAction.java index 9b05558..766e551 100644 --- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/group/inventory/AddGroupResourcesFormPrepareAction.java +++ b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/group/inventory/AddGroupResourcesFormPrepareAction.java @@ -38,7 +38,6 @@ import org.rhq.core.domain.resource.Resource; import org.rhq.core.domain.resource.ResourceCategory; import org.rhq.core.domain.resource.ResourceType; import org.rhq.core.domain.resource.composite.DisambiguationReport; -import org.rhq.core.domain.resource.composite.ResourceNamesDisambiguationResult; import org.rhq.core.domain.resource.group.GroupCategory; import org.rhq.core.domain.resource.group.ResourceGroup; import org.rhq.core.domain.util.PageControl; @@ -181,44 +180,5 @@ public class AddGroupResourcesFormPrepareAction extends Action { }
return resourceCategoryTypes; - } - - // - // These two methods are to support the resource names disambiguation in the above code. - // Hopefully this page gets rewritten in JSF so that we don't have to employ this kind of - // nasties. - // - - private static PageList<Resource> buildResourceList(ResourceNamesDisambiguationResult<Resource> results, int totalSize, PageControl pageControl) { - ArrayList<Resource> convertedResults = new ArrayList<Resource>(results.getResolution().size()); - - for(DisambiguationReport<Resource> dr : results.getResolution()) { - Resource resource = dr.getOriginal(); - - Resource parent = resource.getParentResource(); - //platforms don't have parents, need to check for null here - if (parent != null) { - parent.setName(buildLineage(dr.getParents())); - } - - convertedResults.add(resource); - } - return new PageList<Resource>(convertedResults, totalSize, pageControl); - } - - private static String buildLineage(List<DisambiguationReport.Resource> parents) { - if (parents == null || parents.size() == 0) { - return ""; - } - - Iterator<DisambiguationReport.Resource> it = parents.iterator(); - - StringBuilder bld = new StringBuilder(it.next().getName()); - - while (it.hasNext()) { - bld.append(DisambiguatedResourceLineageComponent.DEFAULT_SEPARATOR).append(it.next().getName()); - } - - return bld.toString(); - } + } } diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/portlet/autodiscovery/ViewAction.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/portlet/autodiscovery/ViewAction.java index b8c7c63..4ac3c8d 100644 --- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/portlet/autodiscovery/ViewAction.java +++ b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/portlet/autodiscovery/ViewAction.java @@ -178,11 +178,11 @@ public class ViewAction extends TilesAction {
//first disambiguate the platforms List<Resource> platforms = new ArrayList<Resource>(queuedResources.keySet()); - List<DisambiguationReport<Resource>> disambiguatedPlatforms = resourceManager.disambiguate(platforms, RESOURCE_ID_EXTRACTOR, DefaultDisambiguationUpdateStrategies.getDefault()).getResolution(); + List<DisambiguationReport<Resource>> disambiguatedPlatforms = resourceManager.disambiguate(platforms, RESOURCE_ID_EXTRACTOR, DefaultDisambiguationUpdateStrategies.getDefault());
for (DisambiguationReport<Resource> platform : disambiguatedPlatforms) { List<Resource> servers = queuedResources.get(platform.getOriginal()); - List<DisambiguationReport<Resource>> disambiguatedServers = resourceManager.disambiguate(servers, RESOURCE_ID_EXTRACTOR, DefaultDisambiguationUpdateStrategies.getDefault()).getResolution(); + List<DisambiguationReport<Resource>> disambiguatedServers = resourceManager.disambiguate(servers, RESOURCE_ID_EXTRACTOR, DefaultDisambiguationUpdateStrategies.getDefault());
ret.put(platform, disambiguatedServers); } diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/portlet/recentlyApproved/ViewAction.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/portlet/recentlyApproved/ViewAction.java index 55d892d..90d59a3 100644 --- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/portlet/recentlyApproved/ViewAction.java +++ b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/portlet/recentlyApproved/ViewAction.java @@ -86,7 +86,7 @@ public class ViewAction extends TilesAction {
platformList = DisambiguatedRecentlyAddedResourceComposite.fromResolution(resourceManager.disambiguate( resourceManager.findRecentlyAddedPlatforms(subject, ts, recentlyApprovedPreferences.range), - RESOURCE_ID_EXTRACTOR, DefaultDisambiguationUpdateStrategies.getDefault()).getResolution()); + RESOURCE_ID_EXTRACTOR, DefaultDisambiguationUpdateStrategies.getDefault()));
Map<Integer, DisambiguatedRecentlyAddedResourceComposite> platformMap; platformMap = new HashMap<Integer, DisambiguatedRecentlyAddedResourceComposite>(); @@ -113,7 +113,7 @@ public class ViewAction extends TilesAction { miniPlatform.setChildren(DisambiguatedRecentlyAddedResourceComposite.fromResolution( resourceManager.disambiguate(resourceManager .findRecentlyAddedServers(subject, ts, platformId.intValue()), RESOURCE_ID_EXTRACTOR, - DefaultDisambiguationUpdateStrategies.getDefault()).getResolution())); + DefaultDisambiguationUpdateStrategies.getDefault()))); } else { removeExpandedPlatforms.add(expandedPlatform); } diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/portlet/resourcehealth/RSSAction.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/portlet/resourcehealth/RSSAction.java index fb9be73..2c52bfd 100755 --- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/portlet/resourcehealth/RSSAction.java +++ b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/portlet/resourcehealth/RSSAction.java @@ -35,7 +35,6 @@ import org.apache.struts.util.MessageResources;
import org.rhq.core.domain.resource.composite.DisambiguationReport; import org.rhq.core.domain.resource.composite.ResourceHealthComposite; -import org.rhq.core.domain.resource.composite.ResourceNamesDisambiguationResult; import org.rhq.core.domain.util.PageControl; import org.rhq.core.domain.util.PageList; import org.rhq.enterprise.gui.common.tag.FunctionTagLibrary; diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/portlet/resourcehealth/ViewAction.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/portlet/resourcehealth/ViewAction.java index 7a1a824..516b9c9 100644 --- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/portlet/resourcehealth/ViewAction.java +++ b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/portlet/resourcehealth/ViewAction.java @@ -31,7 +31,6 @@ import org.apache.struts.tiles.actions.TilesAction;
import org.rhq.core.domain.resource.composite.DisambiguationReport; import org.rhq.core.domain.resource.composite.ResourceHealthComposite; -import org.rhq.core.domain.resource.composite.ResourceNamesDisambiguationResult; import org.rhq.core.domain.util.PageControl; import org.rhq.core.domain.util.PageList; import org.rhq.core.util.IntExtractor; diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/util/DisambiguatedResourceListUtil.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/util/DisambiguatedResourceListUtil.java index 41e710f..4ad0df8 100644 --- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/util/DisambiguatedResourceListUtil.java +++ b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/util/DisambiguatedResourceListUtil.java @@ -23,8 +23,9 @@
package org.rhq.enterprise.gui.legacy.util;
+import java.util.List; + import org.rhq.core.domain.resource.composite.DisambiguationReport; -import org.rhq.core.domain.resource.composite.ResourceNamesDisambiguationResult; import org.rhq.core.domain.util.PageList; import org.rhq.core.util.IntExtractor; import org.rhq.enterprise.server.resource.ResourceManagerLocal; @@ -43,7 +44,7 @@ public class DisambiguatedResourceListUtil { }
public static <T> PageList<DisambiguationReport<T>> disambiguate(ResourceManagerLocal resourceManager, PageList<T> results, IntExtractor<T> resourceIdExtractor) { - ResourceNamesDisambiguationResult<T> result = resourceManager.disambiguate(results, resourceIdExtractor, DefaultDisambiguationUpdateStrategies.getDefault()); - return new PageList<DisambiguationReport<T>>(result.getResolution(), results.getTotalSize(), results.getPageControl()); + List<DisambiguationReport<T>> result = resourceManager.disambiguate(results, resourceIdExtractor, DefaultDisambiguationUpdateStrategies.getDefault()); + return new PageList<DisambiguationReport<T>>(result, results.getTotalSize(), results.getPageControl()); } } diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/navigation/resource/ResourceSelectUIBean.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/navigation/resource/ResourceSelectUIBean.java index afe2e3b..625c33f 100644 --- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/navigation/resource/ResourceSelectUIBean.java +++ b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/navigation/resource/ResourceSelectUIBean.java @@ -79,6 +79,6 @@ public class ResourceSelectUIBean { result = resourceManager.findResourceComposites(EnterpriseFacesContextUtility.getSubject(), null, null, null, null, pref, true, pc);
- return resourceManager.disambiguate(result, RESOURCE_ID_EXTRACTOR, DefaultDisambiguationUpdateStrategies.getDefault()).getResolution(); + return resourceManager.disambiguate(result, RESOURCE_ID_EXTRACTOR, DefaultDisambiguationUpdateStrategies.getDefault()); } } diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/subsystem/SubsystemConfigurationUpdateUIBean.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/subsystem/SubsystemConfigurationUpdateUIBean.java index 0f5777f..52b6812 100644 --- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/subsystem/SubsystemConfigurationUpdateUIBean.java +++ b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/subsystem/SubsystemConfigurationUpdateUIBean.java @@ -29,7 +29,6 @@ import javax.faces.model.SelectItem; import org.rhq.core.domain.configuration.ConfigurationUpdateStatus; import org.rhq.core.domain.configuration.composite.ConfigurationUpdateComposite; import org.rhq.core.domain.resource.composite.DisambiguationReport; -import org.rhq.core.domain.resource.composite.ResourceNamesDisambiguationResult; import org.rhq.core.domain.util.PageControl; import org.rhq.core.domain.util.PageList; import org.rhq.core.gui.util.FacesContextUtility; diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerBean.java index ea6a4fc..64fd5f8 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerBean.java @@ -87,13 +87,13 @@ import org.rhq.core.domain.resource.ResourceError; import org.rhq.core.domain.resource.ResourceErrorType; import org.rhq.core.domain.resource.ResourceSubCategory; import org.rhq.core.domain.resource.ResourceType; +import org.rhq.core.domain.resource.composite.DisambiguationReport; import org.rhq.core.domain.resource.composite.RecentlyAddedResourceComposite; import org.rhq.core.domain.resource.composite.ResourceAvailabilitySummary; import org.rhq.core.domain.resource.composite.ResourceComposite; import org.rhq.core.domain.resource.composite.ResourceHealthComposite; import org.rhq.core.domain.resource.composite.ResourceIdFlyWeight; import org.rhq.core.domain.resource.composite.ResourceInstallCount; -import org.rhq.core.domain.resource.composite.ResourceNamesDisambiguationResult; import org.rhq.core.domain.resource.composite.ResourcePermission; import org.rhq.core.domain.resource.composite.ResourceWithAvailability; import org.rhq.core.domain.resource.flyweight.FlyweightCache; @@ -2166,7 +2166,7 @@ public class ResourceManagerBean implements ResourceManagerLocal, ResourceManage return (findChildResources(subject, parentResource, pageControl)); }
- public <T> ResourceNamesDisambiguationResult<T> disambiguate(List<T> results, IntExtractor<? super T> extractor, + public <T> List<DisambiguationReport<T>> disambiguate(List<T> results, IntExtractor<? super T> extractor, DisambiguationUpdateStrategy updateStrategy) { return Disambiguator.disambiguate(results, updateStrategy, extractor, entityManager, typeManager.getDuplicateTypeNames()); } diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerLocal.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerLocal.java index d753c89..78ece78 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerLocal.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerLocal.java @@ -36,13 +36,13 @@ import org.rhq.core.domain.resource.ResourceCategory; import org.rhq.core.domain.resource.ResourceError; import org.rhq.core.domain.resource.ResourceErrorType; import org.rhq.core.domain.resource.ResourceType; +import org.rhq.core.domain.resource.composite.DisambiguationReport; import org.rhq.core.domain.resource.composite.RecentlyAddedResourceComposite; import org.rhq.core.domain.resource.composite.ResourceAvailabilitySummary; import org.rhq.core.domain.resource.composite.ResourceComposite; import org.rhq.core.domain.resource.composite.ResourceHealthComposite; import org.rhq.core.domain.resource.composite.ResourceIdFlyWeight; import org.rhq.core.domain.resource.composite.ResourceInstallCount; -import org.rhq.core.domain.resource.composite.ResourceNamesDisambiguationResult; import org.rhq.core.domain.resource.composite.ResourceWithAvailability; import org.rhq.core.domain.resource.flyweight.ResourceFlyweight; import org.rhq.core.domain.resource.group.ResourceGroup; @@ -453,6 +453,6 @@ public interface ResourceManagerLocal { * @see Disambiguator#disambiguate(List, boolean, IntExtractor, javax.persistence.EntityManager) * @return the disambiguation result or null on error */ - <T> ResourceNamesDisambiguationResult<T> disambiguate(List<T> results, IntExtractor<? super T> resourceIdExtractor, + <T> List<DisambiguationReport<T>> disambiguate(List<T> results, IntExtractor<? super T> resourceIdExtractor, DisambiguationUpdateStrategy updateStrategy); } \ No newline at end of file diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/disambiguation/DefaultDisambiguationUpdateStrategies.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/disambiguation/DefaultDisambiguationUpdateStrategies.java index 8a340d5..f948244 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/disambiguation/DefaultDisambiguationUpdateStrategies.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/disambiguation/DefaultDisambiguationUpdateStrategies.java @@ -134,7 +134,7 @@ public enum DefaultDisambiguationUpdateStrategies implements DisambiguationUpdat } };
- private static final DisambiguationPolicy.Level overridingResolution = new DisambiguationPolicy.Level(ResourceResolution.TYPE); + private static final DisambiguationPolicy.Level OVERRIDING_RESOLUTION = new DisambiguationPolicy.Level(ResourceResolution.TYPE);
/** * This updates the resources in the report according to the resolutions contained in the policy. @@ -182,7 +182,7 @@ public enum DefaultDisambiguationUpdateStrategies implements DisambiguationUpdat if (pushDownPluginInfo) { parentPlugins.add(report.parents.get(disambiguationPolicyIndex).resourceType.plugin); } - updateResource(overridingResolution, report.parents.get(disambiguationPolicyIndex), ambiguousTypeNames); + updateResource(OVERRIDING_RESOLUTION, report.parents.get(disambiguationPolicyIndex), ambiguousTypeNames); }
if (pushDownPluginInfo) { diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/disambiguation/Disambiguator.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/disambiguation/Disambiguator.java index 2baa4db..617d4fd 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/disambiguation/Disambiguator.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/disambiguation/Disambiguator.java @@ -33,7 +33,6 @@ import javax.persistence.EntityManager; import javax.persistence.Query;
import org.rhq.core.domain.resource.composite.DisambiguationReport; -import org.rhq.core.domain.resource.composite.ResourceNamesDisambiguationResult; import org.rhq.core.util.IntExtractor;
/** @@ -99,14 +98,14 @@ public class Disambiguator { * @param resourceIdExtractor an object able to extract resource id from an instance of type parameter. * @param entityManager an entityManager to be used to access the database * @param duplicateTypeNames the list of type names that are ambiguous without plugin spec - * @return the disambiguation result or null on error + * @return the disambiguation result */ - public static <T> ResourceNamesDisambiguationResult<T> disambiguate(List<T> results, + public static <T> List<DisambiguationReport<T>> disambiguate(List<T> results, DisambiguationUpdateStrategy disambiguationUpdateStrategy, IntExtractor<? super T> extractor, EntityManager entityManager, List<String> duplicateTypeNames) {
if (results.isEmpty()) { - return new ResourceNamesDisambiguationResult<T>(new ArrayList<DisambiguationReport<T>>()); + return new ArrayList<DisambiguationReport<T>>(); }
//we can't assume the ordering of the provided results and the disambiguation query results @@ -258,7 +257,7 @@ public class Disambiguator { resolution.add(report.getReport()); }
- return new ResourceNamesDisambiguationResult<T>(resolution); + return resolution; }
private static <T> void repartitionUnique(ReportPartitions<T> partitions, DisambiguationUpdateStrategy updateStrategy, List<ReportPartitions<T>> ambigousPartitions) { diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/disambiguation/ReportPartitions.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/disambiguation/ReportPartitions.java index 337ef31..04ae04f 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/disambiguation/ReportPartitions.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/disambiguation/ReportPartitions.java @@ -31,10 +31,6 @@ import java.util.List; * This class partitions the reports inserted into it by chunking them up * into sublists containing mutually ambiguous reports. The ambiguity is determined using * a {@link DisambiguationPolicy}. - * <p> - * The ReportPartition instances can form a tree using the {@link #getPreviousPartitioning()} - * and the parameters provided to the constructors. This is handy to keep track of what - * partitions have been disambiguated at what level and how. * * @param <T> the type of the original instances the are being disambiguated. *
commit 351594645e43c69b2be040e830746d67adae00fe Merge: c809e68... 5662138... Author: Lukas Krejci lkrejci@redhat.com Date: Tue Aug 17 12:05:30 2010 +0200
Merge branch 'master' into ui-updates
commit 02a6eafa5eb24c64fd7e09257b956ea3ebb424b1 Author: Ian Springer ian.springer@redhat.com Date: Tue Aug 17 00:14:26 2010 -0400
make togglable fields a different color to give the user a hint that they're editable
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/form/EnhancedDynamicForm.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/form/EnhancedDynamicForm.java index 0ae01ce..02592c8 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/form/EnhancedDynamicForm.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/form/EnhancedDynamicForm.java @@ -82,6 +82,7 @@ public class EnhancedDynamicForm extends DynamicForm { new StaticTextItem(getStaticTextItemName(togglableTextItem.getName()), togglableTextItem.getTitle()); staticTextItem.setAttribute("editing", false); + staticTextItem.setTextBoxStyle("editableText");
FormItemIcon editIcon = new FormItemIcon(); editIcon.setName("Edit"); diff --git a/modules/enterprise/gui/coregui/src/main/webapp/CoreGUI.css b/modules/enterprise/gui/coregui/src/main/webapp/CoreGUI.css index bc48f18..305fcf8 100644 --- a/modules/enterprise/gui/coregui/src/main/webapp/CoreGUI.css +++ b/modules/enterprise/gui/coregui/src/main/webapp/CoreGUI.css @@ -354,4 +354,8 @@ a:hover { .tallCellOver, .tallCellOverDark { background-color: rgb(230,230,230) !important; /* for browsers that don't like alpha */ background-color: rgba(230,230,230,0.6) !important; -} \ No newline at end of file +} + +.editableText { + color: #070; +}
commit efc9c02e61ca9536e007356b0e8e74972c76f975 Author: Joseph Marques joseph@redhat.com Date: Mon Aug 16 21:10:15 2010 -0400
add missing method to WebservicesManagerBean
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/webservices/WebservicesManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/webservices/WebservicesManagerBean.java index 25ffa7b..6c2c7f1 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/webservices/WebservicesManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/webservices/WebservicesManagerBean.java @@ -856,6 +856,11 @@ public class WebservicesManagerBean implements WebservicesRemote { resourceGroupManager.deleteResourceGroup(subject, groupId); }
+ public void deleteResourceGroups(Subject subject, int[] groupIds) throws ResourceGroupNotFoundException, + ResourceGroupDeleteException { + resourceGroupManager.deleteResourceGroups(subject, groupIds); + } + public PageList<ResourceGroup> findResourceGroupsByCriteria(Subject subject, ResourceGroupCriteria criteria) { checkParametersPassedIn(subject, criteria); return resourceGroupManager.findResourceGroupsByCriteria(subject, criteria);
commit 2968c8c3c37ba5432683577f16e0e8e929bbd18a Author: Joseph Marques joseph@redhat.com Date: Mon Aug 16 21:06:25 2010 -0400
AuthenticationUserAction doesn't need to pre-fetch any related subject data
diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/authentication/AuthenticateUserAction.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/authentication/AuthenticateUserAction.java index db8b1f0..432d95c 100644 --- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/authentication/AuthenticateUserAction.java +++ b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/authentication/AuthenticateUserAction.java @@ -105,8 +105,6 @@ public class AuthenticateUserAction extends TilesAction { subjectCriteria.setCaseSensitive(false); subjectCriteria.setStrict(true); subjectCriteria.addFilterName(logonForm.getJ_username()); - subjectCriteria.fetchRoles(true); - subjectCriteria.fetchConfiguration(true); PageList<Subject> subjectsLocated = LookupUtil.getSubjectManager().findSubjectsByCriteria( LookupUtil.getSubjectManager().getOverlord(), subjectCriteria); //if subject variants located then take the first one with a principal otherwise do nothing
commit 9ed36881c1424d3af8bdbd3621d6dbaec2938d75 Author: Joseph Marques joseph@redhat.com Date: Mon Aug 16 21:04:33 2010 -0400
SearchGUI.sessionSubject doesn't need to pre-load any related data
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/SearchGUI.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/SearchGUI.java index 42600a5..f4c52d7 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/SearchGUI.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/SearchGUI.java @@ -87,9 +87,7 @@ public class SearchGUI implements EntryPoint { // look up real user prefs
SubjectCriteria criteria = new SubjectCriteria(); - criteria.fetchConfiguration(true); criteria.addFilterId(subjectId); - criteria.fetchRoles(true);
GWTServiceLookup.getSubjectService().findSubjectsByCriteria(criteria, new AsyncCallback<PageList<Subject>>() {
commit 74b6b2958fb4bba076009217e1dd6607bcacc964 Author: Joseph Marques joseph@redhat.com Date: Mon Aug 16 21:04:07 2010 -0400
CoreGUI.sessionSubject only needs to pre-load Configuration, not roles
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java index aa6c084..b82b8ce 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java @@ -155,7 +155,7 @@ public class CoreGUI implements EntryPoint, ValueChangeHandler<String> { SubjectCriteria criteria = new SubjectCriteria(); criteria.fetchConfiguration(true); criteria.addFilterId(subjectId); - criteria.fetchRoles(true); + //criteria.fetchRoles(true);
GWTServiceLookup.getSubjectService().findSubjectsByCriteria(criteria, new AsyncCallback<PageList<Subject>>() {
commit 29e2b4eecd3658456856098518bbbc50b59bea1b Author: Joseph Marques joseph@redhat.com Date: Mon Aug 16 21:03:24 2010 -0400
uninventory all selected resources in a single async service call
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceDatasource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceDatasource.java index c0731b8..88c61d4 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceDatasource.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceDatasource.java @@ -25,9 +25,6 @@ import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceD import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.PLUGIN; import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.TYPE;
-import java.util.List; - -import com.google.gwt.core.client.JavaScriptObject; import com.google.gwt.user.client.rpc.AsyncCallback; import com.smartgwt.client.data.DSRequest; import com.smartgwt.client.data.DSResponse; @@ -48,7 +45,6 @@ import org.rhq.enterprise.gui.coregui.client.CoreGUI; import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup; import org.rhq.enterprise.gui.coregui.client.gwt.ResourceGWTServiceAsync; import org.rhq.enterprise.gui.coregui.client.util.RPCDataSource; -import org.rhq.enterprise.gui.coregui.client.util.message.Message;
/** * @author Greg Hinkle @@ -71,16 +67,16 @@ public class ResourceDatasource extends RPCDataSource<Resource> { DataSourceTextField nameDataField = new DataSourceTextField(NAME.propertyName(), NAME.title(), 200); nameDataField.setCanEdit(false);
- DataSourceTextField descriptionDataField = new DataSourceTextField(DESCRIPTION.propertyName(), DESCRIPTION - .title()); + DataSourceTextField descriptionDataField = new DataSourceTextField(DESCRIPTION.propertyName(), + DESCRIPTION.title()); descriptionDataField.setCanEdit(false);
DataSourceTextField typeNameDataField = new DataSourceTextField(TYPE.propertyName(), TYPE.title()); DataSourceTextField pluginNameDataField = new DataSourceTextField(PLUGIN.propertyName(), PLUGIN.title()); DataSourceTextField categoryDataField = new DataSourceTextField(CATEGORY.propertyName(), CATEGORY.title());
- DataSourceImageField availabilityDataField = new DataSourceImageField(AVAILABILITY.propertyName(), AVAILABILITY - .title(), 20); + DataSourceImageField availabilityDataField = new DataSourceImageField(AVAILABILITY.propertyName(), + AVAILABILITY.title(), 20);
availabilityDataField.setCanEdit(false);
@@ -120,8 +116,8 @@ public class ResourceDatasource extends RPCDataSource<Resource> { criteria.setPageControl(getPageControl(request));
if (request.getCriteria().getValues().get("parentId") != null) { - criteria.addFilterParentResourceId(Integer.parseInt((String) request.getCriteria().getValues().get( - "parentId"))); + criteria.addFilterParentResourceId(Integer.parseInt((String) request.getCriteria().getValues() + .get("parentId"))); }
if (request.getCriteria().getValues().get("id") != null) { @@ -158,8 +154,8 @@ public class ResourceDatasource extends RPCDataSource<Resource> { }
if (request.getCriteria().getValues().get(TYPE.propertyName()) != null) { - criteria.addFilterResourceTypeId(Integer.parseInt(((String) request.getCriteria().getValues().get( - TYPE.propertyName())))); + criteria.addFilterResourceTypeId(Integer.parseInt(((String) request.getCriteria().getValues() + .get(TYPE.propertyName())))); }
if (request.getCriteria().getValues().get(PLUGIN.propertyName()) != null) { @@ -185,30 +181,6 @@ public class ResourceDatasource extends RPCDataSource<Resource> { return criteria; }
- @Override - protected void executeRemove(final DSRequest request, final DSResponse response) { - JavaScriptObject data = request.getData(); - final ListGridRecord rec = new ListGridRecord(data); - final Resource resourceToDelete = copyValues(rec); - - final int resourceId = resourceToDelete.getId(); - resourceService.uninventoryResources(new int[] { resourceId }, new AsyncCallback<List<Integer>>() { - public void onFailure(Throwable caught) { - CoreGUI.getErrorHandler().handleError("Failed to uninventory resource " + resourceId, caught); - response.setStatus(DSResponse.STATUS_FAILURE); - processResponse(request.getRequestId(), response); - } - - public void onSuccess(List<Integer> result) { - CoreGUI.getMessageCenter().notify( - new Message("Resource [" + resourceId + "] successfully uninventoried.", Message.Severity.Info)); - response.setStatus(DSResponse.STATUS_SUCCESS); - processResponse(request.getRequestId(), response); - } - }); - - } - protected void dataRetrieved(PageList<Resource> result, DSResponse response, DSRequest request) { ListGridRecord[] records = buildRecords(result); response.setData(records); diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceSearchView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceSearchView.java index 1642c64..97a55db 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceSearchView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceSearchView.java @@ -18,35 +18,33 @@ */ package org.rhq.enterprise.gui.coregui.client.inventory.resource;
+import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.AVAILABILITY; +import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.CATEGORY; +import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.DESCRIPTION; +import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.NAME; +import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.PLUGIN; +import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.TYPE; + import java.util.ArrayList; +import java.util.List;
-import com.google.gwt.event.dom.client.KeyCodes; +import com.google.gwt.user.client.rpc.AsyncCallback; import com.smartgwt.client.data.Criteria; import com.smartgwt.client.data.SortSpecifier; import com.smartgwt.client.types.Alignment; import com.smartgwt.client.types.ListGridFieldType; -import com.smartgwt.client.types.SelectionAppearance; import com.smartgwt.client.types.SelectionStyle; -import com.smartgwt.client.widgets.form.DynamicForm; -import com.smartgwt.client.widgets.form.fields.TextItem; -import com.smartgwt.client.widgets.form.fields.events.KeyPressEvent; -import com.smartgwt.client.widgets.form.fields.events.KeyPressHandler; import com.smartgwt.client.widgets.grid.CellFormatter; import com.smartgwt.client.widgets.grid.ListGridField; import com.smartgwt.client.widgets.grid.ListGridRecord; -import com.smartgwt.client.widgets.layout.VLayout;
+import org.rhq.enterprise.gui.coregui.client.CoreGUI; import org.rhq.enterprise.gui.coregui.client.components.table.Table; import org.rhq.enterprise.gui.coregui.client.components.table.TableAction; - -import javax.persistence.Id; - -import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.AVAILABILITY; -import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.CATEGORY; -import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.DESCRIPTION; -import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.NAME; -import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.PLUGIN; -import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.TYPE; +import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup; +import org.rhq.enterprise.gui.coregui.client.gwt.ResourceGWTServiceAsync; +import org.rhq.enterprise.gui.coregui.client.util.message.Message; +import org.rhq.enterprise.gui.coregui.client.util.message.Message.Severity;
/** * @author Greg Hinkle @@ -90,24 +88,23 @@ public class ResourceSearchView extends Table { setWidth100(); setHeight100();
-// DynamicForm searchPanel = new DynamicForm(); -// final TextItem searchBox = new TextItem("query", "Search Resources"); -// searchBox.setValue(""); -// searchPanel.setWrapItemTitles(false); -// searchPanel.setFields(searchBox); - + // DynamicForm searchPanel = new DynamicForm(); + // final TextItem searchBox = new TextItem("query", "Search Resources"); + // searchBox.setValue(""); + // searchPanel.setWrapItemTitles(false); + // searchPanel.setFields(searchBox);
final ResourceDatasource datasource = new ResourceDatasource(); -// setTitleComponent(searchPanel); + // setTitleComponent(searchPanel); setDataSource(datasource);
getListGrid().setSelectionType(SelectionStyle.SIMPLE); -// getListGrid().setSelectionAppearance(SelectionAppearance.CHECKBOX); + // getListGrid().setSelectionAppearance(SelectionAppearance.CHECKBOX); getListGrid().setResizeFieldsInRealTime(true);
ListGridField idField = new ListGridField("id", "Id", 55); idField.setType(ListGridFieldType.INTEGER); - ListGridField iconField = new ListGridField("icon","", 40); + ListGridField iconField = new ListGridField("icon", "", 40); ListGridField nameField = new ListGridField(NAME.propertyName(), NAME.title(), 250); nameField.setCellFormatter(new CellFormatter() { public String format(Object o, ListGridRecord listGridRecord, int i, int i1) { @@ -123,15 +120,35 @@ public class ResourceSearchView extends Table { ListGridField availabilityField = new ListGridField(AVAILABILITY.propertyName(), AVAILABILITY.title(), 55); availabilityField.setAlign(Alignment.CENTER); getListGrid().setFields(idField, iconField, nameField, descriptionField, typeNameField, pluginNameField, - categoryField, availabilityField); + categoryField, availabilityField);
addTableAction("Uninventory", Table.SelectionEnablement.ANY, - "Are you sure you want to delete # resources?", new TableAction() { - public void executeAction(ListGridRecord[] selection) { - getListGrid().removeSelectedData(); + "Are you sure you want to uninventory # resources?", new TableAction() { + public void executeAction(ListGridRecord[] selections) { + int[] resourceIds = new int[selections.length]; + int index = 0; + for (ListGridRecord selection : selections) { + resourceIds[index++] = selection.getAttributeAsInt("id"); } - }); + ResourceGWTServiceAsync resourceManager = GWTServiceLookup.getResourceService(); + + resourceManager.uninventoryResources(resourceIds, new AsyncCallback<List<Integer>>() { + public void onFailure(Throwable caught) { + CoreGUI.getErrorHandler().handleError("Failed to uninventory selected resources", caught); + } + + public void onSuccess(List<Integer> result) { + CoreGUI.getMessageCenter() + .notify( + new Message("Successfully uninventoried " + result.size() + " resources", + Severity.Info));
+ ResourceSearchView.this.refresh(); + } + }); + + } + });
/*searchBox.addKeyPressHandler(new KeyPressHandler() { public void onKeyPress(KeyPressEvent event) { @@ -153,13 +170,10 @@ public class ResourceSearchView extends Table { });*/ }
- - public int getMatches() { return this.getListGrid().getTotalRows(); }
- public void addResourceSelectedListener(ResourceSelectListener listener) { selectListeners.add(listener); }
commit a064c1435259e596538243c7a86b8d80aa626557 Author: Joseph Marques joseph@redhat.com Date: Mon Aug 16 21:03:02 2010 -0400
delete all selected resource groups in a single async service call
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ResourceGroupGWTService.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ResourceGroupGWTService.java index 3d78c78..ff3be5b 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ResourceGroupGWTService.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ResourceGroupGWTService.java @@ -18,6 +18,9 @@ */ package org.rhq.enterprise.gui.coregui.client.gwt;
+import com.google.gwt.user.client.rpc.RemoteService; +import com.google.gwt.user.client.rpc.RemoteServiceRelativePath; + import org.rhq.core.domain.criteria.ResourceGroupCriteria; import org.rhq.core.domain.criteria.ResourceGroupDefinitionCriteria; import org.rhq.core.domain.resource.group.GroupDefinition; @@ -25,9 +28,6 @@ import org.rhq.core.domain.resource.group.ResourceGroup; import org.rhq.core.domain.resource.group.composite.ResourceGroupComposite; import org.rhq.core.domain.util.PageList;
-import com.google.gwt.user.client.rpc.RemoteService; -import com.google.gwt.user.client.rpc.RemoteServiceRelativePath; - /** * @author Greg Hinkle */ @@ -44,7 +44,7 @@ public interface ResourceGroupGWTService extends RemoteService {
ResourceGroup createResourceGroup(ResourceGroup group, int[] resourceIds);
- void deleteResourceGroup(int groupId); + void deleteResourceGroups(int[] groupIds);
void updateResourceGroup(ResourceGroup group);
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/ResourceGroupListView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/ResourceGroupListView.java index d2953eb..3206da5 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/ResourceGroupListView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/ResourceGroupListView.java @@ -27,7 +27,6 @@ import com.smartgwt.client.widgets.grid.CellFormatter; import com.smartgwt.client.widgets.grid.ListGridField; import com.smartgwt.client.widgets.grid.ListGridRecord;
-import org.rhq.core.domain.resource.group.ResourceGroup; import org.rhq.enterprise.gui.coregui.client.CoreGUI; import org.rhq.enterprise.gui.coregui.client.components.table.Table; import org.rhq.enterprise.gui.coregui.client.components.table.TableAction; @@ -88,24 +87,25 @@ public class ResourceGroupListView extends Table { addTableAction("Delete", Table.SelectionEnablement.ANY, "Delete the selected resource groups?", new TableAction() { public void executeAction(ListGridRecord[] selections) { - ResourceGroupsDataSource ds = (ResourceGroupsDataSource) getDataSource(); + int[] groupIds = new int[selections.length]; + int index = 0; for (ListGridRecord selection : selections) { - ResourceGroupGWTServiceAsync resourceGroupManager = GWTServiceLookup.getResourceGroupService(); - final ResourceGroup object = ds.copyValues(selection); - resourceGroupManager.deleteResourceGroup(object.getId(), new AsyncCallback<Void>() { - public void onFailure(Throwable caught) { - CoreGUI.getErrorHandler().handleError( - "Failed to delete resource group [" + object.getName() + "]", caught); - } - - public void onSuccess(Void result) { - CoreGUI.getMessageCenter().notify( - new Message("Deleted resource group [" + object.getName() + "]", Severity.Info)); - - CoreGUI.refresh(); - } - }); + groupIds[index++] = selection.getAttributeAsInt("id"); } + ResourceGroupGWTServiceAsync resourceGroupManager = GWTServiceLookup.getResourceGroupService(); + + resourceGroupManager.deleteResourceGroups(groupIds, new AsyncCallback<Void>() { + public void onFailure(Throwable caught) { + CoreGUI.getErrorHandler().handleError("Failed to delete selected resource groups", caught); + } + + public void onSuccess(Void result) { + CoreGUI.getMessageCenter().notify( + new Message("Deleted selected resource groups", Severity.Info)); + + ResourceGroupListView.this.refresh(); + } + }); } });
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ResourceGroupGWTServiceImpl.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ResourceGroupGWTServiceImpl.java index 31a4381..e6b5936 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ResourceGroupGWTServiceImpl.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ResourceGroupGWTServiceImpl.java @@ -41,17 +41,17 @@ public class ResourceGroupGWTServiceImpl extends AbstractGWTServiceImpl implemen
public PageList<ResourceGroup> findResourceGroupsByCriteria(ResourceGroupCriteria criteria) { return SerialUtility.prepare(groupManager.findResourceGroupsByCriteria(getSessionSubject(), criteria), - "ResourceGroupService.findResourceGroupsByCriteria"); + "ResourceGroupService.findResourceGroupsByCriteria"); }
public PageList<ResourceGroupComposite> findResourceGroupCompositesByCriteria(ResourceGroupCriteria criteria) { return SerialUtility.prepare(groupManager.findResourceGroupCompositesByCriteria(getSessionSubject(), criteria), - "ResourceGroupService.findResourceGroupCompositesByCriteria"); + "ResourceGroupService.findResourceGroupCompositesByCriteria"); }
public PageList<GroupDefinition> findGroupDefinitionsByCriteria(ResourceGroupDefinitionCriteria criteria) { return SerialUtility.prepare(definitionManager.findGroupDefinitionsByCriteria(getSessionSubject(), criteria), - "ResourceGroupService.findGroupDefinitionsByCriteria"); + "ResourceGroupService.findGroupDefinitionsByCriteria"); }
public void ensureMembershipMatches(int groupId, int[] resourceIds) { @@ -66,9 +66,9 @@ public class ResourceGroupGWTServiceImpl extends AbstractGWTServiceImpl implemen return SerialUtility.prepare(group, "ResourceGroupService.createResourceGroup"); }
- public void deleteResourceGroup(int groupId) { + public void deleteResourceGroups(int[] groupIds) { try { - groupManager.deleteResourceGroup(getSessionSubject(), groupId); + groupManager.deleteResourceGroups(getSessionSubject(), groupIds); } catch (ResourceGroupDeleteException e) { throw new RuntimeException(e.getMessage()); }
commit 1eb5159403a3bd12bd05aea4a9bc0b422d64f36b Author: Joseph Marques joseph@redhat.com Date: Mon Aug 16 19:13:21 2010 -0400
add the ability to delete multiple resource groups with a single SLSB call
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerBean.java index f6a5b4d..04dd614 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerBean.java @@ -181,8 +181,8 @@ public class ResourceGroupManagerBean implements ResourceGroupManagerLocal, Reso }
if (!authorizationManager.hasGroupPermission(user, Permission.MODIFY_RESOURCE, groupId)) { - throw new PermissionException("User [" + user + "] does not have permission to modify Resource group with id [" - + groupId + "]."); + throw new PermissionException("User [" + user + + "] does not have permission to modify Resource group with id [" + groupId + "]."); }
if (changeType == null) { @@ -197,7 +197,7 @@ public class ResourceGroupManagerBean implements ResourceGroupManagerLocal, Reso // recursive bit didn't change } } - + group.setMtime(System.currentTimeMillis()); group.setModifiedBy(user.getName());
@@ -285,6 +285,14 @@ public class ResourceGroupManagerBean implements ResourceGroupManagerLocal, Reso entityManager.remove(group); }
+ @RequiredPermission(Permission.MANAGE_INVENTORY) + public void deleteResourceGroups(Subject subject, int[] groupIds) throws ResourceGroupNotFoundException, + ResourceGroupDeleteException { + for (int nextGroupId : groupIds) { + deleteResourceGroup(subject, nextGroupId); + } + } + /* * TODO: Deletion of all associated group data (except implicit/explicit resource members) should be moved here. * in other words, we don't want Hibernate cascade annotations to remove that history upon deletion of an @@ -312,9 +320,7 @@ public class ResourceGroupManagerBean implements ResourceGroupManagerLocal, Reso try { operationManager.unscheduleGroupOperation(overlord, schedule.getJobId().toString(), group.getId()); } catch (UnscheduleException e) { - log - .warn("Failed to unschedule job [" + schedule + "] for a group being deleted [" + group + "]", - e); + log.warn("Failed to unschedule job [" + schedule + "] for a group being deleted [" + group + "]", e); } } } catch (Exception e) { @@ -753,8 +759,8 @@ public class ResourceGroupManagerBean implements ResourceGroupManagerLocal, Reso * to this method, we can just do simple RHQ_RESOURCE_GROUP_RES_IMP_MAP table insertions */ String insertImplicitQueryString = JDBCUtil.transformQueryForMultipleInParameters( - ResourceGroup.QUERY_NATIVE_ADD_RESOURCES_TO_GROUP_IMPLICIT, "@@RESOURCE_IDS@@", resourceIdsToAdd - .size()); + ResourceGroup.QUERY_NATIVE_ADD_RESOURCES_TO_GROUP_IMPLICIT, "@@RESOURCE_IDS@@", + resourceIdsToAdd.size()); insertImplicitStatement = conn.prepareStatement(insertImplicitQueryString); insertImplicitStatement.setInt(1, implicitRecursiveGroupId); JDBCUtil.bindNTimes(insertImplicitStatement, ArrayUtils.unwrapCollection(resourceIdsToAdd), 2); @@ -816,9 +822,9 @@ public class ResourceGroupManagerBean implements ResourceGroupManagerLocal, Reso ResourceGroup group = getResourceGroupById(subject, groupId, category); Set<Resource> res = group.getExplicitResources(); if (res != null && res.size() > 0) { - List<Resource> resources = PersistenceUtility.getHibernateSession(entityManager).createFilter(res, - "where this.inventoryStatus = :inventoryStatus").setParameter("inventoryStatus", - InventoryStatus.COMMITTED).list(); + List<Resource> resources = PersistenceUtility.getHibernateSession(entityManager) + .createFilter(res, "where this.inventoryStatus = :inventoryStatus") + .setParameter("inventoryStatus", InventoryStatus.COMMITTED).list();
return resources; } else { @@ -1465,8 +1471,8 @@ public class ResourceGroupManagerBean implements ResourceGroupManagerLocal, Reso }
if (!authorizationManager.hasGroupPermission(subject, Permission.MODIFY_RESOURCE, groupId)) { - throw new PermissionException("User [" + subject + "] does not have permission to modify Resource group with id [" - + groupId + "]."); + throw new PermissionException("User [" + subject + + "] does not have permission to modify Resource group with id [" + groupId + "]."); } return group; } diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerLocal.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerLocal.java index 9b0468b..2919879 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerLocal.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerLocal.java @@ -125,6 +125,9 @@ public interface ResourceGroupManagerLocal { void deleteResourceGroup(Subject user, int groupId) throws ResourceGroupNotFoundException, ResourceGroupDeleteException;
+ void deleteResourceGroups(Subject user, int[] groupIds) throws ResourceGroupNotFoundException, + ResourceGroupDeleteException; + ResourceGroup getResourceGroup(Subject subject, int groupId);
ResourceGroupComposite getResourceGroupComposite(Subject subject, int groupId); @@ -138,5 +141,5 @@ public interface ResourceGroupManagerLocal { ResourceGroup updateResourceGroup(Subject subject, ResourceGroup group);
PageList<ResourceGroup> findResourceGroupsByCriteria(Subject subject, ResourceGroupCriteria criteria); - + } \ No newline at end of file diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerRemote.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerRemote.java index fdda4e2..4071c39 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerRemote.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerRemote.java @@ -60,6 +60,12 @@ public interface ResourceGroupManagerRemote { @WebParam(name = "groupId") int groupId) throws ResourceGroupNotFoundException, ResourceGroupDeleteException;
@WebMethod + void deleteResourceGroups( // + @WebParam(name = "subject") Subject subject, // + @WebParam(name = "groupIds") int[] groupIds) throws ResourceGroupNotFoundException, + ResourceGroupDeleteException; + + @WebMethod ResourceGroup getResourceGroup( // @WebParam(name = "subject") Subject subject, // @WebParam(name = "groupId") int groupId);
commit 0cf06bb06f6975b68aeaa78a886c004851423409 Author: Joseph Marques joseph@redhat.com Date: Mon Aug 16 18:37:13 2010 -0400
refresh the ResourceGroupListView after adding a new group
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/ResourceGroupListView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/ResourceGroupListView.java index 8171d96..d2953eb 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/ResourceGroupListView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/ResourceGroupListView.java @@ -111,7 +111,7 @@ public class ResourceGroupListView extends Table {
addTableAction("New", new TableAction() { public void executeAction(ListGridRecord[] selection) { - new GroupCreateWizard().startBundleWizard(); + new GroupCreateWizard(ResourceGroupListView.this).startBundleWizard(); } }); } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/wizard/GroupCreateWizard.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/wizard/GroupCreateWizard.java index 55d1588..d579c8c 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/wizard/GroupCreateWizard.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/wizard/GroupCreateWizard.java @@ -35,6 +35,7 @@ import org.rhq.enterprise.gui.coregui.client.components.wizard.AbstractWizard; import org.rhq.enterprise.gui.coregui.client.components.wizard.WizardStep; import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup; import org.rhq.enterprise.gui.coregui.client.gwt.ResourceGroupGWTServiceAsync; +import org.rhq.enterprise.gui.coregui.client.inventory.groups.ResourceGroupListView; import org.rhq.enterprise.gui.coregui.client.util.message.Message;
/** @@ -42,10 +43,14 @@ import org.rhq.enterprise.gui.coregui.client.util.message.Message; */ public class GroupCreateWizard extends AbstractWizard {
+ private ResourceGroupListView resourceGroupListView; + private GroupCreateStep createStep; private GroupMembersStep memberStep;
- public GroupCreateWizard() { + public GroupCreateWizard(ResourceGroupListView resourceGroupListView) { + this.resourceGroupListView = resourceGroupListView; + ArrayList<WizardStep> steps = new ArrayList<WizardStep>();
steps.add(createStep = new GroupCreateStep()); @@ -98,7 +103,7 @@ public class GroupCreateWizard extends AbstractWizard { public void onSuccess(ResourceGroup result) { CoreGUI.getMessageCenter().notify( new Message("Saved new group " + result.getName(), Message.Severity.Info)); - // TODO: Implement this method. + resourceGroupListView.refresh(); } });
commit 9d21c482cfc4e294aafae0360a9285b575d845c8 Author: Ian Springer ian.springer@redhat.com Date: Mon Aug 16 19:05:15 2010 -0400
add support for updating collection interval to abstract metric schedules view
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/Table.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/Table.java index 67632e9..7b6ca8e 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/Table.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/Table.java @@ -399,6 +399,11 @@ public class Table extends VLayout { } tableAction.actionButton.setDisabled(!enabled); } + for (Canvas extraWidget : extraWidgets) { + if (extraWidget instanceof TableWidget) { + ((TableWidget)extraWidget).refresh(this.listGrid); + } + } this.tableInfo.setContents("Total: " + listGrid.getTotalRows() + " (" + count + " selected)"); } } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/TableWidget.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/TableWidget.java new file mode 100644 index 0000000..61c59e5 --- /dev/null +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/TableWidget.java @@ -0,0 +1,10 @@ +package org.rhq.enterprise.gui.coregui.client.components.table; + +import com.smartgwt.client.widgets.grid.ListGrid; + +/** + * + */ +public interface TableWidget { + void refresh(ListGrid listGrid); +} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMeasurementScheduleListView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMeasurementScheduleListView.java index 15c7127..333b500 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMeasurementScheduleListView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMeasurementScheduleListView.java @@ -79,7 +79,7 @@ public abstract class AbstractMeasurementScheduleListView extends Table { getDataSource().disableSchedules(AbstractMeasurementScheduleListView.this); } }); - // TODO: Add controls to set collection interval - base class is going to need massaging... + addExtraWidget(new UpdateCollectionIntervalWidget(this)); }
class MillisecondsCellFormatter implements CellFormatter { diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/UpdateCollectionIntervalWidget.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/UpdateCollectionIntervalWidget.java new file mode 100644 index 0000000..e4daee2 --- /dev/null +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/UpdateCollectionIntervalWidget.java @@ -0,0 +1,92 @@ +package org.rhq.enterprise.gui.coregui.client.inventory.common; + +import com.smartgwt.client.widgets.IButton; +import com.smartgwt.client.widgets.events.ClickEvent; +import com.smartgwt.client.widgets.events.ClickHandler; +import com.smartgwt.client.widgets.form.DynamicForm; +import com.smartgwt.client.widgets.form.fields.FormItem; +import com.smartgwt.client.widgets.form.fields.IntegerItem; +import com.smartgwt.client.widgets.form.fields.SelectItem; +import com.smartgwt.client.widgets.form.fields.events.ChangedEvent; +import com.smartgwt.client.widgets.form.fields.events.ChangedHandler; +import com.smartgwt.client.widgets.form.validator.IntegerRangeValidator; +import com.smartgwt.client.widgets.grid.ListGrid; +import com.smartgwt.client.widgets.layout.HLayout; +import com.smartgwt.client.widgets.layout.VLayout; +import org.rhq.enterprise.gui.coregui.client.components.table.TableWidget; + +/** + * TODO + */ +public class UpdateCollectionIntervalWidget extends HLayout implements TableWidget { + private AbstractMeasurementScheduleListView schedulesView; + private DynamicForm form; + private IButton setButton; + + public UpdateCollectionIntervalWidget(AbstractMeasurementScheduleListView schedulesView) { + this.schedulesView = schedulesView; + } + + @Override + protected void onDraw() { + super.onDraw(); + + VLayout spacer = new VLayout(); + spacer.setWidth(20); + addMember(spacer); + + this.form = new DynamicForm(); + this.form.setNumCols(3); + IntegerItem intervalItem = new IntegerItem("interval", "Collection Interval"); + IntegerRangeValidator integerRangeValidator = new IntegerRangeValidator(); + integerRangeValidator.setMin(1); + intervalItem.setValidators(integerRangeValidator); + intervalItem.setValidateOnChange(true); + intervalItem.addChangedHandler(new ChangedHandler() { + public void onChanged(ChangedEvent changedEvent) { + refresh(UpdateCollectionIntervalWidget.this.schedulesView.getListGrid()); + } + }); + SelectItem unitsItem = new SelectItem("units", null); + unitsItem.setValueMap("seconds", "minutes", "hours"); + unitsItem.setDefaultValue("seconds"); + unitsItem.setShowTitle(false); + this.form.setFields(intervalItem, unitsItem); + addMember(this.form); + + this.setButton = new IButton("Set"); + this.setButton.setDisabled(true); + this.setButton.addClickHandler(new ClickHandler() { + public void onClick(ClickEvent clickEvent) { + form.validate(); + UpdateCollectionIntervalWidget.this.schedulesView.getDataSource().updateSchedules( + UpdateCollectionIntervalWidget.this.schedulesView, getInterval()); + } + }); + addMember(this.setButton); + } + + @Override + public void refresh(ListGrid listGrid) { + int count = listGrid.getSelection().length; + Long interval = getInterval(); + this.setButton.setDisabled(count == 0 || interval == null); + } + + private Long getInterval() { + FormItem item = this.form.getItem("interval"); + if (item.getValue() == null || !item.validate()) { + return null; + } + String stringValue = this.form.getValueAsString("interval"); + long value = Long.valueOf(stringValue.trim()); + String units = this.form.getValueAsString("units"); + value *= 1000; + if (units.equals("minutes")) { + value *= 60; + } else if (units.equals("hours")) { + value *= 60 * 60; + } + return value; + } +}
commit 76ed96cb78102d33520f33bece21e15963c2606e Author: Joseph Marques joseph@redhat.com Date: Mon Aug 16 18:01:59 2010 -0400
comment out method that doesn't exist in smart gwt 2.2
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/Table.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/Table.java index bcf95da..67632e9 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/Table.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/Table.java @@ -153,7 +153,7 @@ public class Table extends VLayout { // these fields to a bogus field name will disable this behavior. Note, setting them to null does *not* disable // the behavior. listGrid.setRecordEnabledProperty("foobar"); - listGrid.setRecordCanSelectProperty("foobar"); + //listGrid.setRecordCanSelectProperty("foobar"); listGrid.setRecordEditProperty("foobar");
// Footer
commit 6bd6bd06d5aeecf3d08d324ce545b164f0b47e8a Author: Ian Springer ian.springer@redhat.com Date: Mon Aug 16 13:15:58 2010 -0400
fix several bugs in the Schedules tabs
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/Table.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/Table.java index d5b8b13..bcf95da 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/Table.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/Table.java @@ -149,9 +149,12 @@ public class Table extends VLayout { listGrid.setAutoFitData(Autofit.HORIZONTAL); listGrid.setAlternateRecordStyles(true); listGrid.setResizeFieldsInRealTime(false); - // By default, SmartGWT will disable row that have a record named "enabled" with a value of false - setting this - // field to null will disable this behavior. - listGrid.setRecordEnabledProperty(null); + // By default, SmartGWT will disable any rows that have a record named "enabled" with a value of false - setting + // these fields to a bogus field name will disable this behavior. Note, setting them to null does *not* disable + // the behavior. + listGrid.setRecordEnabledProperty("foobar"); + listGrid.setRecordCanSelectProperty("foobar"); + listGrid.setRecordEditProperty("foobar");
// Footer footer = new ToolStrip(); diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMeasurementScheduleDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMeasurementScheduleDataSource.java index b9a017a..08f3473 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMeasurementScheduleDataSource.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMeasurementScheduleDataSource.java @@ -141,7 +141,7 @@ public abstract class AbstractMeasurementScheduleDataSource extends RPCDataSourc
@Override public MeasurementSchedule copyValues(ListGridRecord from) { - return null; // TODO: Implement? + return null; }
@Override @@ -162,26 +162,29 @@ public abstract class AbstractMeasurementScheduleDataSource extends RPCDataSourc }
public void enableSchedules(AbstractMeasurementScheduleListView measurementScheduleListView) { - int[] measurementDefinitionIds = getMeasurementDefinitionIds(measurementScheduleListView); - enableSchedules(measurementScheduleListView, measurementDefinitionIds); + int[] ids = getMeasurementDefinitionIds(measurementScheduleListView); + List<String> displayNames = getMeasurementDefinitionDisplayNames(measurementScheduleListView); + enableSchedules(measurementScheduleListView, ids, displayNames); measurementScheduleListView.refresh(); }
protected abstract void enableSchedules(AbstractMeasurementScheduleListView measurementScheduleListView, - int[] measurementDefinitionIds); + int[] measurementDefinitionIds, List<String> measurementDefinitionDisplayNames);
public void disableSchedules(AbstractMeasurementScheduleListView measurementScheduleListView) { - int[] measurementDefinitionIds = getMeasurementDefinitionIds(measurementScheduleListView); - disableSchedules(measurementScheduleListView, measurementDefinitionIds); + int[] ids = getMeasurementDefinitionIds(measurementScheduleListView); + List<String> displayNames = getMeasurementDefinitionDisplayNames(measurementScheduleListView); + disableSchedules(measurementScheduleListView, ids, displayNames); measurementScheduleListView.refresh(); }
protected abstract void disableSchedules(AbstractMeasurementScheduleListView measurementScheduleListView, - int[] measurementDefinitionIds); + int[] measurementDefinitionIds, List<String> measurementDefinitionDisplayNames);
public void updateSchedules(AbstractMeasurementScheduleListView measurementScheduleListView, long interval) { - int[] measurementDefinitionIds = getMeasurementDefinitionIds(measurementScheduleListView); - updateSchedules(measurementScheduleListView, measurementDefinitionIds, interval); + int[] ids = getMeasurementDefinitionIds(measurementScheduleListView); + List<String> displayNames = getMeasurementDefinitionDisplayNames(measurementScheduleListView); + updateSchedules(measurementScheduleListView, ids, displayNames, interval); measurementScheduleListView.refresh(); }
@@ -198,6 +201,17 @@ public abstract class AbstractMeasurementScheduleDataSource extends RPCDataSourc return measurementDefinitionIds; }
+ private List<String> getMeasurementDefinitionDisplayNames(AbstractMeasurementScheduleListView measurementScheduleListView) { + ListGrid listGrid = measurementScheduleListView.getListGrid(); + ListGridRecord[] records = listGrid.getSelection(); + List<String> displayNames = new ArrayList<String>(records.length); + for (ListGridRecord record : records) { + String displayName = record.getAttributeAsString(MeasurementScheduleCriteria.SORT_FIELD_DISPLAY_NAME); + displayNames.add(displayName); + } + return displayNames; + } + protected abstract void updateSchedules(final AbstractMeasurementScheduleListView measurementScheduleListView, - final int[] measurementDefinitionIds, final long interval); + final int[] measurementDefinitionIds, List<String> measurementDefinitionDisplayNames, final long interval); } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/schedules/SchedulesDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/schedules/SchedulesDataSource.java index 7b56290..ea28b3f 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/schedules/SchedulesDataSource.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/schedules/SchedulesDataSource.java @@ -47,38 +47,42 @@ public class SchedulesDataSource extends AbstractMeasurementScheduleDataSource {
@Override protected void enableSchedules(AbstractMeasurementScheduleListView measurementScheduleListView, - int[] measurementDefinitionIds) { + int[] measurementDefinitionIds, final List<String> measurementDefinitionDisplayNames) { this.measurementService.enableSchedulesForCompatibleGroup(this.resourceGroupId, measurementDefinitionIds, new AsyncCallback<Void>() { - @Override - public void onFailure(Throwable throwable) { - CoreGUI.getErrorHandler().handleError("Failed to enable specified metric schedules for Resource group with id[" + resourceGroupId + "].", - throwable); - } + @Override + public void onFailure(Throwable throwable) { + CoreGUI.getErrorHandler().handleError("Failed to enable collection of metrics " + + measurementDefinitionDisplayNames + " for Resource group with id [" + resourceGroupId + "].", + throwable); + }
- @Override - public void onSuccess(Void aVoid) { - CoreGUI.getMessageCenter().notify(new Message("Specified Metric schedules for Resource group with id [" + resourceGroupId + - "] enabled.", Message.Severity.Info)); + @Override + public void onSuccess(Void aVoid) { + CoreGUI.getMessageCenter().notify(new Message("Enabled collection of metrics " + + measurementDefinitionDisplayNames + " for Resource group with id [" + resourceGroupId + + "].", Message.Severity.Info));
- } + } }); }
@Override - protected void disableSchedules(AbstractMeasurementScheduleListView measurementScheduleListView, int[] measurementDefinitionIds) { + protected void disableSchedules(AbstractMeasurementScheduleListView measurementScheduleListView, int[] measurementDefinitionIds, final List<String> measurementDefinitionDisplayNames) { this.measurementService.disableSchedulesForCompatibleGroup(this.resourceGroupId, measurementDefinitionIds, new AsyncCallback<Void>() { @Override public void onFailure(Throwable throwable) { - CoreGUI.getErrorHandler().handleError("Failed to disable specified metric schedules for Resource group with id[" + resourceGroupId + "].", + CoreGUI.getErrorHandler().handleError("Failed to disable collection of metrics " + + measurementDefinitionDisplayNames + " for Resource group with id [" + resourceGroupId + "].", throwable); }
@Override public void onSuccess(Void aVoid) { - CoreGUI.getMessageCenter().notify(new Message("Specified metric schedules for Resource group with id [" + resourceGroupId + - "] disabled.", Message.Severity.Info)); + CoreGUI.getMessageCenter().notify(new Message("Disabled collection of metrics " + + measurementDefinitionDisplayNames + " for Resource group with id [" + resourceGroupId + + "].", Message.Severity.Info));
} }); @@ -86,19 +90,22 @@ public class SchedulesDataSource extends AbstractMeasurementScheduleDataSource {
@Override protected void updateSchedules(AbstractMeasurementScheduleListView measurementScheduleListView, - int[] measurementDefinitionIds, long collectionInterval) { + int[] measurementDefinitionIds, final List<String> measurementDefinitionDisplayNames, final long collectionInterval) { this.measurementService.updateSchedulesForCompatibleGroup(this.resourceGroupId, measurementDefinitionIds, collectionInterval, new AsyncCallback<Void>() { @Override public void onFailure(Throwable throwable) { - CoreGUI.getErrorHandler().handleError("Failed to update specified metric schedules for Resource group with id[" + resourceGroupId + "].", + CoreGUI.getErrorHandler().handleError("Failed to set collection interval to " + (collectionInterval / 1000) + + " seconds for metrics " + measurementDefinitionDisplayNames + " for Resource group with id [" + + resourceGroupId + "].", throwable); }
@Override public void onSuccess(Void aVoid) { - CoreGUI.getMessageCenter().notify(new Message("Specified Metric schedules for Resource group with id [" + resourceGroupId + - "] updated.", Message.Severity.Info)); + CoreGUI.getMessageCenter().notify(new Message("Collection interval for metrics " + + measurementDefinitionDisplayNames + " for Resource group with id [" + resourceGroupId + + "] set to " + (collectionInterval / 1000) + " seconds.", Message.Severity.Info));
} }); diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/schedules/SchedulesView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/schedules/SchedulesView.java index 3f1f7dc..d944bd0 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/schedules/SchedulesView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/schedules/SchedulesView.java @@ -3,7 +3,6 @@ package org.rhq.enterprise.gui.coregui.client.inventory.groups.detail.monitoring import com.smartgwt.client.data.Criteria; import org.rhq.core.domain.criteria.MeasurementScheduleCriteria; import org.rhq.enterprise.gui.coregui.client.inventory.common.AbstractMeasurementScheduleListView; -import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.monitoring.schedules.SchedulesDataSource;
/** * The group Monitoring>Schedules subtab. diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/schedules/SchedulesDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/schedules/SchedulesDataSource.java index dbfb9a0..10a5646 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/schedules/SchedulesDataSource.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/schedules/SchedulesDataSource.java @@ -47,58 +47,65 @@ public class SchedulesDataSource extends AbstractMeasurementScheduleDataSource {
@Override protected void enableSchedules(AbstractMeasurementScheduleListView measurementScheduleListView, - int[] measurementDefinitionIds) { + int[] measurementDefinitionIds, final List<String> measurementDefinitionDisplayNames) { this.measurementService.enableSchedulesForResource(this.resourceId, measurementDefinitionIds, new AsyncCallback<Void>() { - @Override - public void onFailure(Throwable throwable) { - CoreGUI.getErrorHandler().handleError("Failed to enable specified metric schedules for Resource with id[" + resourceId + "].", - throwable); - } + @Override + public void onFailure(Throwable throwable) { + CoreGUI.getErrorHandler().handleError("Failed to enable collection of metrics " + + measurementDefinitionDisplayNames + " for Resource with id [" + resourceId + "].", + throwable); + }
- @Override - public void onSuccess(Void aVoid) { - CoreGUI.getMessageCenter().notify(new Message("Specified Metric schedules for Resource with id [" + resourceId + - "] enabled.", Message.Severity.Info)); + @Override + public void onSuccess(Void aVoid) { + CoreGUI.getMessageCenter().notify(new Message("Enabled collection of metrics " + + measurementDefinitionDisplayNames + " for Resource with id [" + resourceId + + "].", Message.Severity.Info));
- } + } }); }
@Override - protected void disableSchedules(AbstractMeasurementScheduleListView measurementScheduleListView, int[] measurementDefinitionIds) { + protected void disableSchedules(AbstractMeasurementScheduleListView measurementScheduleListView, int[] measurementDefinitionIds, final List<String> measurementDefinitionDisplayNames) { this.measurementService.disableSchedulesForResource(this.resourceId, measurementDefinitionIds, new AsyncCallback<Void>() { - @Override - public void onFailure(Throwable throwable) { - CoreGUI.getErrorHandler().handleError("Failed to disable specified metric schedules for Resource with id[" + resourceId + "].", - throwable); - } + @Override + public void onFailure(Throwable throwable) { + CoreGUI.getErrorHandler().handleError("Failed to disable collection of metrics " + + measurementDefinitionDisplayNames + " for Resource with id [" + resourceId + "].", + throwable); + }
- @Override - public void onSuccess(Void aVoid) { - CoreGUI.getMessageCenter().notify(new Message("Specified metric schedules for Resource with id [" + resourceId + - "] disabled.", Message.Severity.Info)); + @Override + public void onSuccess(Void aVoid) { + CoreGUI.getMessageCenter().notify(new Message("Disabled collection of metrics " + + measurementDefinitionDisplayNames + " for Resource with id [" + resourceId + + "].", Message.Severity.Info));
- } + } }); }
@Override protected void updateSchedules(AbstractMeasurementScheduleListView measurementScheduleListView, - int[] measurementDefinitionIds, long collectionInterval) { + int[] measurementDefinitionIds, final List<String> measurementDefinitionDisplayNames, final long collectionInterval) { this.measurementService.updateSchedulesForResource(this.resourceId, measurementDefinitionIds, collectionInterval, new AsyncCallback<Void>() { @Override public void onFailure(Throwable throwable) { - CoreGUI.getErrorHandler().handleError("Failed to update specified metric schedules for Resource with id[" + resourceId + "].", + CoreGUI.getErrorHandler().handleError("Failed to set collection interval to " + (collectionInterval / 1000) + + " seconds for metrics " + measurementDefinitionDisplayNames + " for Resource with id [" + + resourceId + "].", throwable); }
@Override public void onSuccess(Void aVoid) { - CoreGUI.getMessageCenter().notify(new Message("Specified Metric schedules for Resource with id [" + resourceId + - "] updated.", Message.Severity.Info)); + CoreGUI.getMessageCenter().notify(new Message("Collection interval for metrics " + + measurementDefinitionDisplayNames + " for Resource with id [" + resourceId + + "] set to " + (collectionInterval / 1000) + " seconds.", Message.Severity.Info));
} });
commit 78d42055bb2657c9c9b938697ac6121c9d2354c1 Author: Ian Springer ian.springer@redhat.com Date: Mon Aug 16 11:55:22 2010 -0400
first cut of group Monitoring>Schedules subtab; add resourcePermission field to ResourceGroupComposite
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/group/composite/ResourceGroupComposite.java b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/group/composite/ResourceGroupComposite.java index 5199ba2..1925c37 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/group/composite/ResourceGroupComposite.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/group/composite/ResourceGroupComposite.java @@ -27,6 +27,7 @@ import java.io.Serializable; import javax.xml.bind.annotation.XmlTransient;
import org.rhq.core.domain.resource.composite.ResourceFacets; +import org.rhq.core.domain.resource.composite.ResourcePermission; import org.rhq.core.domain.resource.group.GroupCategory; import org.rhq.core.domain.resource.group.ResourceGroup;
@@ -53,7 +54,8 @@ public class ResourceGroupComposite implements Serializable {
private ResourceFacets resourceFacets;
- // TODO: Expose authz permissions current user has for the group. + @XmlTransient + private ResourcePermission resourcePermission;
private class GroupDefinitionMember extends ResourceGroup { public void setGroupCategory(GroupCategory category) { @@ -159,6 +161,14 @@ public class ResourceGroupComposite implements Serializable { return resourceFacets; }
+ public ResourcePermission getResourcePermission() { + return resourcePermission; + } + + public void setResourcePermission(ResourcePermission resourcePermission) { + this.resourcePermission = resourcePermission; + } + /** * Returns a query string snippet that can be passed to group URLs that reference this specific group. * Note that the returned string does not include the "?" itself. diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertsView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertsView.java index 1cb4b9e..ba81f5c 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertsView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertsView.java @@ -21,7 +21,6 @@ package org.rhq.enterprise.gui.coregui.client.alert; import java.util.ArrayList; import java.util.List;
-import com.google.gwt.user.client.ui.VerticalPanel; import com.smartgwt.client.core.DataClass; import com.smartgwt.client.data.Criteria; import com.smartgwt.client.data.Record; @@ -64,9 +63,6 @@ public class AlertsView extends Table { private static final String DELETE_CONFIRM_MESSAGE = "Are you sure you want to delete the selected alert(s)?";
private AlertDataSource dataSource; - private HTMLFlow detailsContent; - private DynamicForm detailsTable; - private VerticalPanel vpanel; private static final String SENDER = "sender";
Criteria criteria; @@ -95,7 +91,6 @@ public class AlertsView extends Table { protected void onInit() { super.onInit();
- // Add the list table as the top half of the view. //Criteria criteria = new Criteria(AlertCriteria.); ListGrid listGrid = getListGrid(); @@ -129,7 +124,6 @@ public class AlertsView extends Table { listGrid.addSelectionChangedHandler(new SelectionChangedHandler() { public void onSelectionChanged(SelectionEvent event) { ListGridRecord[] selectedRecords = AlertsView.this.getListGrid().getSelection(); - String contents; if (selectedRecords.length == 1) { ListGridRecord record = selectedRecords[0];
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/BooleanCellFormatter.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/BooleanCellFormatter.java index 6300f6a..8d61228 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/BooleanCellFormatter.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/BooleanCellFormatter.java @@ -8,12 +8,15 @@ import com.smartgwt.client.widgets.grid.ListGridRecord; */ public class BooleanCellFormatter implements CellFormatter { public String format(Object value, ListGridRecord record, int rowNum, int colNum) { - if (value == null) { - return ""; - } - if (!(value instanceof Boolean)) { - throw new IllegalArgumentException("value parameter is not a Boolean."); - } - return ((Boolean) value) ? "yes" : "no"; + if (value == null) { + return ""; + } + if (value instanceof Boolean) { + return ((Boolean) value) ? "yes" : "no"; + } else if (value instanceof String) { + return Boolean.parseBoolean((String) value) ? "yes" : "no"; + } else { + throw new IllegalArgumentException("value parameter is not a Boolean or a String."); + } } } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/Table.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/Table.java index ee29754..d5b8b13 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/Table.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/Table.java @@ -19,6 +19,7 @@ package org.rhq.enterprise.gui.coregui.client.components.table;
import java.util.ArrayList; +import java.util.List;
import com.smartgwt.client.data.Criteria; import com.smartgwt.client.data.SortSpecifier; @@ -96,8 +97,8 @@ public class Table extends VLayout {
;
- private ArrayList<TableActionInfo> tableActions = new ArrayList<TableActionInfo>(); - private ArrayList<Canvas> extraWidgets = new ArrayList<Canvas>(); + private List<TableActionInfo> tableActions = new ArrayList<TableActionInfo>(); + private List<Canvas> extraWidgets = new ArrayList<Canvas>();
public Table() { this(null, null, null, null, true); @@ -148,6 +149,9 @@ public class Table extends VLayout { listGrid.setAutoFitData(Autofit.HORIZONTAL); listGrid.setAlternateRecordStyles(true); listGrid.setResizeFieldsInRealTime(false); + // By default, SmartGWT will disable row that have a record named "enabled" with a value of false - setting this + // field to null will disable this behavior. + listGrid.setRecordEnabledProperty(null);
// Footer footer = new ToolStrip(); diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/MeasurementDataGWTService.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/MeasurementDataGWTService.java index 2b163f6..cf1a9a2 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/MeasurementDataGWTService.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/MeasurementDataGWTService.java @@ -68,4 +68,10 @@ public interface MeasurementDataGWTService extends RemoteService {
void updateSchedulesForResource(int resourceId, int[] measurementDefinitionIds, long collectionInterval);
+ void enableSchedulesForCompatibleGroup(int resourceGroupId, int[] measurementDefinitionIds); + + void disableSchedulesForCompatibleGroup(int resourceGroupId, int[] measurementDefinitionIds); + + void updateSchedulesForCompatibleGroup(int resourceGroupId, int[] measurementDefinitionIds, long collectionInterval); + } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMeasurementScheduleDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMeasurementScheduleDataSource.java index 81fe163..b9a017a 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMeasurementScheduleDataSource.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMeasurementScheduleDataSource.java @@ -18,8 +18,6 @@ */ package org.rhq.enterprise.gui.coregui.client.inventory.common;
-import com.google.gwt.core.client.JavaScriptObject; -import com.google.gwt.user.client.Window; import com.google.gwt.user.client.rpc.AsyncCallback; import com.smartgwt.client.data.Criteria; import com.smartgwt.client.data.DSRequest; @@ -163,12 +161,6 @@ public abstract class AbstractMeasurementScheduleDataSource extends RPCDataSourc return record; }
- protected void executeRemove(final DSRequest request, final DSResponse response) { - JavaScriptObject data = request.getData(); - ListGridRecord record = new ListGridRecord(data); - Window.alert(String.valueOf(record.getAttributeAsInt("id"))); - } - public void enableSchedules(AbstractMeasurementScheduleListView measurementScheduleListView) { int[] measurementDefinitionIds = getMeasurementDefinitionIds(measurementScheduleListView); enableSchedules(measurementScheduleListView, measurementDefinitionIds); diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMeasurementScheduleListView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMeasurementScheduleListView.java index 605c857..15c7127 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMeasurementScheduleListView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMeasurementScheduleListView.java @@ -36,12 +36,11 @@ import org.rhq.enterprise.gui.coregui.client.components.table.TableAction; * * @author Ian Springer */ -// TODO: Actually, this class probably does not need to be abstract... public abstract class AbstractMeasurementScheduleListView extends Table { private static final String TITLE = "Metric Collection Schedules";
private static final SortSpecifier[] SORT_SPECIFIERS = new SortSpecifier[]{ - new SortSpecifier(MeasurementScheduleCriteria.SORT_FIELD_DISPLAY_NAME, SortDirection.ASCENDING) + new SortSpecifier(MeasurementScheduleCriteria.SORT_FIELD_DISPLAY_NAME, SortDirection.ASCENDING) };
public AbstractMeasurementScheduleListView(AbstractMeasurementScheduleDataSource dataSource, Criteria criteria, @@ -59,89 +58,87 @@ public abstract class AbstractMeasurementScheduleListView extends Table { protected void onInit() { super.onInit();
- ListGrid listGrid = getListGrid(); - listGrid.getField(MeasurementScheduleCriteria.SORT_FIELD_DISPLAY_NAME).setWidth("25%"); + ListGrid listGrid = getListGrid(); + listGrid.getField(MeasurementScheduleCriteria.SORT_FIELD_DISPLAY_NAME).setWidth("20%"); listGrid.getField(MeasurementScheduleCriteria.SORT_FIELD_DESCRIPTION).setWidth("40%"); listGrid.getField(MeasurementScheduleCriteria.SORT_FIELD_DATA_TYPE).setWidth("10%"); ListGridField enabledField = listGrid.getField(MeasurementScheduleCriteria.SORT_FIELD_ENABLED); - enabledField.setWidth("5%"); + enabledField.setWidth("10%"); enabledField.setCellFormatter(new BooleanCellFormatter()); ListGridField intervalField = listGrid.getField(MeasurementScheduleCriteria.SORT_FIELD_INTERVAL); - intervalField.setCellFormatter(new CellFormatter() { - public String format(Object value, ListGridRecord record, int rowNum, int colNum) { - if (value == null) { - return ""; - } + intervalField.setCellFormatter(new MillisecondsCellFormatter()); + intervalField.setWidth("25%");
- long milliseconds = (Integer)value; - if (milliseconds == 0) { - return "0"; - } + addTableAction("Enable", Table.SelectionEnablement.ANY, null, new TableAction() { + public void executeAction(ListGridRecord[] selection) { + getDataSource().enableSchedules(AbstractMeasurementScheduleListView.this); + } + }); + addTableAction("Disable", Table.SelectionEnablement.ANY, null, new TableAction() { + public void executeAction(ListGridRecord[] selection) { + getDataSource().disableSchedules(AbstractMeasurementScheduleListView.this); + } + }); + // TODO: Add controls to set collection interval - base class is going to need massaging... + }
- StringBuilder result = new StringBuilder(); - if (milliseconds > 1000) { - long seconds = milliseconds / 1000; - milliseconds = milliseconds % 1000; - if (seconds >= 60) { - long minutes = seconds / 60; - seconds = seconds % 60; - if (minutes > 60) { - long hours = minutes / 60; - minutes = minutes % 60; - result.append(hours).append(" hour"); - if (hours > 1) { - result.append("s"); - } - } - if (minutes != 0) { - if (result.length() != 0) { - result.append(", "); - } - result.append(minutes).append(" minute"); - if (minutes > 1) { - result.append("s"); - } + class MillisecondsCellFormatter implements CellFormatter { + public String format(Object value, ListGridRecord record, int rowNum, int colNum) { + if (value == null) { + return ""; + } + + long milliseconds = (Integer) value; + if (milliseconds == 0) { + return "0"; + } + + StringBuilder result = new StringBuilder(); + if (milliseconds > 1000) { + long seconds = milliseconds / 1000; + milliseconds = milliseconds % 1000; + if (seconds >= 60) { + long minutes = seconds / 60; + seconds = seconds % 60; + if (minutes > 60) { + long hours = minutes / 60; + minutes = minutes % 60; + result.append(hours).append(" hour"); + if (hours > 1) { + result.append("s"); } } - if (seconds != 0) { + if (minutes != 0) { if (result.length() != 0) { result.append(", "); } - result.append(seconds).append(" second"); - if (seconds > 1) { + result.append(minutes).append(" minute"); + if (minutes > 1) { result.append("s"); } } } - if (milliseconds != 0) { + if (seconds != 0) { if (result.length() != 0) { result.append(", "); } - result.append(milliseconds).append(" millisecond"); - if (milliseconds > 1) { + result.append(seconds).append(" second"); + if (seconds > 1) { result.append("s"); } } - return result.toString(); - } - }); - intervalField.setWidth("25%"); - - addTableAction("Enable", Table.SelectionEnablement.ANY, null, new TableAction() { - public void executeAction(ListGridRecord[] selection) { - getDataSource().enableSchedules(AbstractMeasurementScheduleListView.this); } - }); - addTableAction("Disable", Table.SelectionEnablement.ANY, null, new TableAction() { - public void executeAction(ListGridRecord[] selection) { - getDataSource().disableSchedules(AbstractMeasurementScheduleListView.this); + if (milliseconds != 0) { + if (result.length() != 0) { + result.append(", "); + } + result.append(milliseconds).append(" millisecond"); + if (milliseconds > 1) { + result.append("s"); + } } - }); - // TODO: Add controls to set collection interval - base class is going to need massaging... - } + return result.toString(); + }
- public void refresh() { - this.getListGrid().invalidateCache(); - //this.table.getListGrid().markForRedraw(); - } + } } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java index e6b208c..a9a6989 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java @@ -23,7 +23,6 @@ import java.util.Set;
import com.google.gwt.user.client.History; import com.google.gwt.user.client.rpc.AsyncCallback; -import com.smartgwt.client.docs.Members; import com.smartgwt.client.types.Side; import com.smartgwt.client.widgets.layout.VLayout;
@@ -43,6 +42,7 @@ import org.rhq.enterprise.gui.coregui.client.components.tab.TwoLevelTabSelectedE import org.rhq.enterprise.gui.coregui.client.components.tab.TwoLevelTabSelectedHandler; import org.rhq.enterprise.gui.coregui.client.components.tab.TwoLevelTabSet; import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup; +import org.rhq.enterprise.gui.coregui.client.inventory.groups.detail.monitoring.schedules.SchedulesView; import org.rhq.enterprise.gui.coregui.client.inventory.groups.detail.summary.OverviewView; import org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceSearchView; import org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTypeRepository; @@ -138,8 +138,9 @@ public class ResourceGroupDetailView extends VLayout implements BookmarkableView + groupId)); monitoringTab.updateSubTab("Tables", new FullHTMLPane("/rhq/group/monitor/tables-plain.xhtml?groupId=" + groupId)); - monitoringTab.updateSubTab("Schedules", new FullHTMLPane("/rhq/group/monitor/schedules-plain.xhtml?groupId=" - + groupId)); + monitoringTab.updateSubTab("Schedules", new SchedulesView(groupId)); + + //new FullHTMLPane("/rhq/group/monitor/schedules-plain.xhtml?groupId=" + groupId)); monitoringTab.updateSubTab("Call Time", new FullHTMLPane("/rhq/group/monitor/response-plain.xhtml?groupId=" + groupId));
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/schedules/SchedulesDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/schedules/SchedulesDataSource.java new file mode 100644 index 0000000..7b56290 --- /dev/null +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/schedules/SchedulesDataSource.java @@ -0,0 +1,106 @@ +package org.rhq.enterprise.gui.coregui.client.inventory.groups.detail.monitoring.schedules; + +import com.google.gwt.user.client.rpc.AsyncCallback; +import com.smartgwt.client.data.DataSourceField; +import com.smartgwt.client.data.fields.DataSourceIntegerField; +import com.smartgwt.client.widgets.grid.ListGridRecord; +import org.rhq.core.domain.criteria.MeasurementScheduleCriteria; +import org.rhq.core.domain.measurement.MeasurementSchedule; +import org.rhq.enterprise.gui.coregui.client.CoreGUI; +import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup; +import org.rhq.enterprise.gui.coregui.client.gwt.MeasurementDataGWTServiceAsync; +import org.rhq.enterprise.gui.coregui.client.inventory.common.AbstractMeasurementScheduleDataSource; +import org.rhq.enterprise.gui.coregui.client.inventory.common.AbstractMeasurementScheduleListView; +import org.rhq.enterprise.gui.coregui.client.util.message.Message; + +import java.util.List; + +/** + * A DataSource for reading and updating the metric schedules for the current group. + * + * @author Ian Springer + */ +public class SchedulesDataSource extends AbstractMeasurementScheduleDataSource { + private MeasurementDataGWTServiceAsync measurementService = GWTServiceLookup.getMeasurementDataService(); + private int resourceGroupId; + + public SchedulesDataSource(int resourceGroupId) { + this.resourceGroupId = resourceGroupId; + } + + @Override + protected List<DataSourceField> createFields() { + List<DataSourceField> fields = super.createFields(); + DataSourceField resourceGroupIdField = new DataSourceIntegerField(MeasurementScheduleCriteria.FILTER_FIELD_RESOURCE_GROUP_ID, + "Resource Group Id"); + resourceGroupIdField.setHidden(true); + fields.add(resourceGroupIdField); + return fields; + } + + @Override + public ListGridRecord copyValues(MeasurementSchedule from) { + ListGridRecord record = super.copyValues(from); + record.setAttribute(MeasurementScheduleCriteria.FILTER_FIELD_RESOURCE_GROUP_ID, this.resourceGroupId); + return record; + } + + @Override + protected void enableSchedules(AbstractMeasurementScheduleListView measurementScheduleListView, + int[] measurementDefinitionIds) { + this.measurementService.enableSchedulesForCompatibleGroup(this.resourceGroupId, measurementDefinitionIds, + new AsyncCallback<Void>() { + @Override + public void onFailure(Throwable throwable) { + CoreGUI.getErrorHandler().handleError("Failed to enable specified metric schedules for Resource group with id[" + resourceGroupId + "].", + throwable); + } + + @Override + public void onSuccess(Void aVoid) { + CoreGUI.getMessageCenter().notify(new Message("Specified Metric schedules for Resource group with id [" + resourceGroupId + + "] enabled.", Message.Severity.Info)); + + } + }); + } + + @Override + protected void disableSchedules(AbstractMeasurementScheduleListView measurementScheduleListView, int[] measurementDefinitionIds) { + this.measurementService.disableSchedulesForCompatibleGroup(this.resourceGroupId, measurementDefinitionIds, + new AsyncCallback<Void>() { + @Override + public void onFailure(Throwable throwable) { + CoreGUI.getErrorHandler().handleError("Failed to disable specified metric schedules for Resource group with id[" + resourceGroupId + "].", + throwable); + } + + @Override + public void onSuccess(Void aVoid) { + CoreGUI.getMessageCenter().notify(new Message("Specified metric schedules for Resource group with id [" + resourceGroupId + + "] disabled.", Message.Severity.Info)); + + } + }); + } + + @Override + protected void updateSchedules(AbstractMeasurementScheduleListView measurementScheduleListView, + int[] measurementDefinitionIds, long collectionInterval) { + this.measurementService.updateSchedulesForCompatibleGroup(this.resourceGroupId, measurementDefinitionIds, collectionInterval, + new AsyncCallback<Void>() { + @Override + public void onFailure(Throwable throwable) { + CoreGUI.getErrorHandler().handleError("Failed to update specified metric schedules for Resource group with id[" + resourceGroupId + "].", + throwable); + } + + @Override + public void onSuccess(Void aVoid) { + CoreGUI.getMessageCenter().notify(new Message("Specified Metric schedules for Resource group with id [" + resourceGroupId + + "] updated.", Message.Severity.Info)); + + } + }); + } +} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/schedules/SchedulesView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/schedules/SchedulesView.java new file mode 100644 index 0000000..3f1f7dc --- /dev/null +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/monitoring/schedules/SchedulesView.java @@ -0,0 +1,25 @@ +package org.rhq.enterprise.gui.coregui.client.inventory.groups.detail.monitoring.schedules; + +import com.smartgwt.client.data.Criteria; +import org.rhq.core.domain.criteria.MeasurementScheduleCriteria; +import org.rhq.enterprise.gui.coregui.client.inventory.common.AbstractMeasurementScheduleListView; +import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.monitoring.schedules.SchedulesDataSource; + +/** + * The group Monitoring>Schedules subtab. + * + * @author Ian Springer + */ +public class SchedulesView extends AbstractMeasurementScheduleListView { + private static final String[] EXCLUDED_FIELD_NAMES = new String[] { MeasurementScheduleCriteria.FILTER_FIELD_RESOURCE_GROUP_ID }; + + public SchedulesView(int resourceGroupId) { + super(new SchedulesDataSource(resourceGroupId), createCriteria(resourceGroupId), EXCLUDED_FIELD_NAMES); + } + + private static Criteria createCriteria(int resourceGroupId) { + Criteria criteria = new Criteria(); + criteria.addCriteria(MeasurementScheduleCriteria.FILTER_FIELD_RESOURCE_GROUP_ID, resourceGroupId); + return criteria; + } +} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/schedules/SchedulesDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/schedules/SchedulesDataSource.java index 31247f4..dbfb9a0 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/schedules/SchedulesDataSource.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/schedules/SchedulesDataSource.java @@ -16,7 +16,7 @@ import org.rhq.enterprise.gui.coregui.client.util.message.Message; import java.util.List;
/** - * A DataSource for reading an updating the metric schedules for the current Resource. + * A DataSource for reading and updating the metric schedules for the current Resource. * * @author Ian Springer */ diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/MeasurementDataGWTServiceImpl.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/MeasurementDataGWTServiceImpl.java index cdac27f..52b5619 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/MeasurementDataGWTServiceImpl.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/MeasurementDataGWTServiceImpl.java @@ -118,9 +118,24 @@ public class MeasurementDataGWTServiceImpl extends AbstractGWTServiceImpl implem }
public void updateSchedulesForResource(int resourceId, int[] measurementDefinitionIds, long collectionInterval) { - scheduleManager.updateSchedulesForResource(getSessionSubject(), resourceId, measurementDefinitionIds, collectionInterval); + scheduleManager.updateSchedulesForResource(getSessionSubject(), resourceId, measurementDefinitionIds, + collectionInterval); }
+ public void enableSchedulesForCompatibleGroup(int resourceGroupId, int[] measurementDefinitionIds) { + scheduleManager.enableSchedulesForCompatibleGroup(getSessionSubject(), resourceGroupId, measurementDefinitionIds); + } + + public void disableSchedulesForCompatibleGroup(int resourceGroupId, int[] measurementDefinitionIds) { + scheduleManager.disableSchedulesForCompatibleGroup(getSessionSubject(), resourceGroupId, measurementDefinitionIds); + } + + public void updateSchedulesForCompatibleGroup(int resourceGroupId, int[] measurementDefinitionIds, + long collectionInterval) { + scheduleManager.updateSchedulesForCompatibleGroup(getSessionSubject(), resourceGroupId, measurementDefinitionIds, + collectionInterval); + } + }
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerBean.java index 43c6f0f..f6a5b4d 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerBean.java @@ -70,6 +70,7 @@ import org.rhq.core.domain.resource.Resource; import org.rhq.core.domain.resource.ResourceCategory; import org.rhq.core.domain.resource.ResourceType; import org.rhq.core.domain.resource.composite.ResourceFacets; +import org.rhq.core.domain.resource.composite.ResourcePermission; import org.rhq.core.domain.resource.group.GroupCategory; import org.rhq.core.domain.resource.group.ResourceGroup; import org.rhq.core.domain.resource.group.composite.ResourceGroupComposite; @@ -1024,6 +1025,8 @@ public class ResourceGroupManagerBean implements ResourceGroupManagerLocal, Reso ResourceFacets facets = (type != null) ? resourceTypeManager.getResourceFacets(type.getId()) : ResourceFacets.NONE; composite.setResourceFacets(facets); + Set<Permission> perms = authorizationManager.getImplicitGroupPermissions(subject, group.getId()); + composite.setResourcePermission(new ResourcePermission(perms)); } return results; } @@ -1223,6 +1226,8 @@ public class ResourceGroupManagerBean implements ResourceGroupManagerLocal, Reso } ResourceGroupComposite composite = new ResourceGroupComposite(explicitCount, explicitAvail, implicitCount, implicitAvail, group, facets); + Set<Permission> perms = authorizationManager.getImplicitGroupPermissions(subject, group.getId()); + composite.setResourcePermission(new ResourcePermission(perms)); results.add(composite); }
commit 56621380a7a59b9047fd3aa3563944b0043039a5 Author: Lukas Krejci lkrejci@redhat.com Date: Mon Aug 16 14:37:26 2010 +0200
added the missing @WebMethod annotation and copied the javadoc from the local interface method.
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerRemote.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerRemote.java index b3fbce0..01ed5a1 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerRemote.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerRemote.java @@ -100,6 +100,14 @@ public interface ResourceManagerRemote { @WebParam(name = "subject") Subject subject, // @WebParam(name = "resourceId") int resourceId);
+ /** + * Update resource's editable properties (name, description, location). + * + * @param user the logged in user + * @param resource the resource to update + * @return the updated resource + */ + @WebMethod Resource updateResource( // @WebParam(name = "subject") Subject user, // @WebParam(name = "resource") Resource resource);
commit 1c5c441b9d59362f538f795c3d928a6aaedee4a1 Author: Ian Springer ian.springer@redhat.com Date: Fri Aug 13 22:31:25 2010 -0400
implement first cut of Resource Monitoring>Schedules subtab (all that's missing is ability to update collection intervals)
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertsView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertsView.java index c4cf1b4..1cb4b9e 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertsView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertsView.java @@ -27,7 +27,6 @@ import com.smartgwt.client.data.Criteria; import com.smartgwt.client.data.Record; import com.smartgwt.client.data.SortSpecifier; import com.smartgwt.client.types.Alignment; -import com.smartgwt.client.types.ListGridFieldType; import com.smartgwt.client.types.SortDirection; import com.smartgwt.client.widgets.HTMLFlow; import com.smartgwt.client.widgets.form.DynamicForm; @@ -39,7 +38,6 @@ import com.smartgwt.client.widgets.grid.ListGridField; import com.smartgwt.client.widgets.grid.ListGridRecord; import com.smartgwt.client.widgets.grid.events.SelectionChangedHandler; import com.smartgwt.client.widgets.grid.events.SelectionEvent; -import com.smartgwt.client.widgets.layout.VLayout; import com.smartgwt.client.widgets.tab.Tab; import com.smartgwt.client.widgets.tab.TabSet;
@@ -261,7 +259,6 @@ public class AlertsView extends Table { DataClass[] input = record.getAttributeAsRecordArray("conditionLogs"); String mode = record.getAttribute("conditionExpression");
- Table table = new Table("Conditions: match = " + mode, false); table.setHeight("35%"); table.setWidth100(); @@ -272,16 +269,10 @@ public class AlertsView extends Table { condition.setWidth("60%"); ListGridField value = new ListGridField("value", "Value");
- grid.setFields(condition, value);
return table;
}
- public void refresh() { - this.getListGrid().invalidateCache(); - //this.table.getListGrid().markForRedraw(); - } - } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/BooleanCellFormatter.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/BooleanCellFormatter.java new file mode 100644 index 0000000..6300f6a --- /dev/null +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/BooleanCellFormatter.java @@ -0,0 +1,19 @@ +package org.rhq.enterprise.gui.coregui.client.components.table; + +import com.smartgwt.client.widgets.grid.CellFormatter; +import com.smartgwt.client.widgets.grid.ListGridRecord; + +/** + * @author Ian Springer + */ +public class BooleanCellFormatter implements CellFormatter { + public String format(Object value, ListGridRecord record, int rowNum, int colNum) { + if (value == null) { + return ""; + } + if (!(value instanceof Boolean)) { + throw new IllegalArgumentException("value parameter is not a Boolean."); + } + return ((Boolean) value) ? "yes" : "no"; + } +} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/MeasurementDataGWTService.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/MeasurementDataGWTService.java index c3c67e2..2b163f6 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/MeasurementDataGWTService.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/MeasurementDataGWTService.java @@ -62,4 +62,10 @@ public interface MeasurementDataGWTService extends RemoteService {
PageList<MeasurementOOBComposite> getHighestNOOBsForResource(int resourceId, int n);
+ void enableSchedulesForResource(int resourceId, int[] measurementDefinitionIds); + + void disableSchedulesForResource(int resourceId, int[] measurementDefinitionIds); + + void updateSchedulesForResource(int resourceId, int[] measurementDefinitionIds, long collectionInterval); + } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMeasurementScheduleDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMeasurementScheduleDataSource.java index 9137081..81fe163 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMeasurementScheduleDataSource.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMeasurementScheduleDataSource.java @@ -63,7 +63,7 @@ public abstract class AbstractMeasurementScheduleDataSource extends RPCDataSourc protected List<DataSourceField> createFields() { List<DataSourceField> fields = new ArrayList<DataSourceField>();
- DataSourceField idField = new DataSourceIntegerField(MeasurementScheduleCriteria.SORT_FIELD_DEFINITION_ID, + DataSourceIntegerField idField = new DataSourceIntegerField(MeasurementScheduleCriteria.SORT_FIELD_DEFINITION_ID, "Id"); idField.setPrimaryKey(true); idField.setHidden(true); @@ -85,7 +85,7 @@ public abstract class AbstractMeasurementScheduleDataSource extends RPCDataSourc "Enabled?"); fields.add(enabledField);
- DataSourceTextField intervalField = new DataSourceTextField(MeasurementScheduleCriteria.SORT_FIELD_INTERVAL, + DataSourceIntegerField intervalField = new DataSourceIntegerField(MeasurementScheduleCriteria.SORT_FIELD_INTERVAL, "Collection Interval"); fields.add(intervalField);
@@ -149,13 +149,17 @@ public abstract class AbstractMeasurementScheduleDataSource extends RPCDataSourc @Override public ListGridRecord copyValues(MeasurementSchedule from) { ListGridRecord record = new ListGridRecord(); - record.setAttribute("id", from.getId()); + + record.setAttribute(MeasurementScheduleCriteria.SORT_FIELD_DEFINITION_ID, from.getDefinition().getId()); record.setAttribute(MeasurementScheduleCriteria.SORT_FIELD_DISPLAY_NAME, from.getDefinition().getDisplayName()); record.setAttribute(MeasurementScheduleCriteria.SORT_FIELD_DESCRIPTION, from.getDefinition().getDescription()); - record.setAttribute(MeasurementScheduleCriteria.SORT_FIELD_DATA_TYPE, from.getDefinition().getDataType().name()); + record.setAttribute(MeasurementScheduleCriteria.SORT_FIELD_DATA_TYPE, + from.getDefinition().getDataType().name().toLowerCase()); record.setAttribute(MeasurementScheduleCriteria.SORT_FIELD_ENABLED, from.isEnabled()); record.setAttribute(MeasurementScheduleCriteria.SORT_FIELD_INTERVAL, from.getInterval()); - // TODO: resourceId and resourceGroupId (can probably be handled by subclasses) + + // TODO: resourceId and resourceGroupId (in subclasses) + return record; }
@@ -166,31 +170,34 @@ public abstract class AbstractMeasurementScheduleDataSource extends RPCDataSourc }
public void enableSchedules(AbstractMeasurementScheduleListView measurementScheduleListView) { - Integer[] measurementDefinitionIds = getMeasurementDefinitionIds(measurementScheduleListView); + int[] measurementDefinitionIds = getMeasurementDefinitionIds(measurementScheduleListView); enableSchedules(measurementScheduleListView, measurementDefinitionIds); + measurementScheduleListView.refresh(); }
protected abstract void enableSchedules(AbstractMeasurementScheduleListView measurementScheduleListView, - Integer[] measurementDefinitionIds); + int[] measurementDefinitionIds);
public void disableSchedules(AbstractMeasurementScheduleListView measurementScheduleListView) { - Integer[] measurementDefinitionIds = getMeasurementDefinitionIds(measurementScheduleListView); + int[] measurementDefinitionIds = getMeasurementDefinitionIds(measurementScheduleListView); disableSchedules(measurementScheduleListView, measurementDefinitionIds); + measurementScheduleListView.refresh(); }
protected abstract void disableSchedules(AbstractMeasurementScheduleListView measurementScheduleListView, - Integer[] measurementDefinitionIds); + int[] measurementDefinitionIds);
public void updateSchedules(AbstractMeasurementScheduleListView measurementScheduleListView, long interval) { - Integer[] measurementDefinitionIds = getMeasurementDefinitionIds(measurementScheduleListView); + int[] measurementDefinitionIds = getMeasurementDefinitionIds(measurementScheduleListView); updateSchedules(measurementScheduleListView, measurementDefinitionIds, interval); + measurementScheduleListView.refresh(); }
- private Integer[] getMeasurementDefinitionIds(AbstractMeasurementScheduleListView measurementScheduleListView) { + private int[] getMeasurementDefinitionIds(AbstractMeasurementScheduleListView measurementScheduleListView) { ListGrid listGrid = measurementScheduleListView.getListGrid(); ListGridRecord[] records = listGrid.getSelection();
- Integer[] measurementDefinitionIds = new Integer[records.length]; + int[] measurementDefinitionIds = new int[records.length]; for (int i = 0, selectionLength = records.length; i < selectionLength; i++) { ListGridRecord record = records[i]; Integer measurementDefinitionId = record.getAttributeAsInt(MeasurementScheduleCriteria.SORT_FIELD_DEFINITION_ID); @@ -200,5 +207,5 @@ public abstract class AbstractMeasurementScheduleDataSource extends RPCDataSourc }
protected abstract void updateSchedules(final AbstractMeasurementScheduleListView measurementScheduleListView, - final Integer[] measurementDefinitionIds, final long interval); + final int[] measurementDefinitionIds, final long interval); } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMeasurementScheduleListView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMeasurementScheduleListView.java index 8d76d32..605c857 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMeasurementScheduleListView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMeasurementScheduleListView.java @@ -21,9 +21,12 @@ package org.rhq.enterprise.gui.coregui.client.inventory.common; import com.smartgwt.client.data.Criteria; import com.smartgwt.client.data.SortSpecifier; import com.smartgwt.client.types.SortDirection; +import com.smartgwt.client.widgets.grid.CellFormatter; import com.smartgwt.client.widgets.grid.ListGrid; +import com.smartgwt.client.widgets.grid.ListGridField; import com.smartgwt.client.widgets.grid.ListGridRecord; import org.rhq.core.domain.criteria.MeasurementScheduleCriteria; +import org.rhq.enterprise.gui.coregui.client.components.table.BooleanCellFormatter; import org.rhq.enterprise.gui.coregui.client.components.table.Table; import org.rhq.enterprise.gui.coregui.client.components.table.TableAction;
@@ -41,11 +44,8 @@ public abstract class AbstractMeasurementScheduleListView extends Table { new SortSpecifier(MeasurementScheduleCriteria.SORT_FIELD_DISPLAY_NAME, SortDirection.ASCENDING) };
- public AbstractMeasurementScheduleListView(AbstractMeasurementScheduleDataSource dataSource) { - this(dataSource, null, null); - } - - public AbstractMeasurementScheduleListView(AbstractMeasurementScheduleDataSource dataSource, Criteria criteria, String[] excludedFieldNames) { + public AbstractMeasurementScheduleListView(AbstractMeasurementScheduleDataSource dataSource, Criteria criteria, + String[] excludedFieldNames) { super(TITLE, criteria, SORT_SPECIFIERS, excludedFieldNames); setDataSource(dataSource); } @@ -60,11 +60,72 @@ public abstract class AbstractMeasurementScheduleListView extends Table { super.onInit();
ListGrid listGrid = getListGrid(); - listGrid.getField(MeasurementScheduleCriteria.SORT_FIELD_DISPLAY_NAME).setWidth("20%"); - listGrid.getField(MeasurementScheduleCriteria.SORT_FIELD_DESCRIPTION).setWidth("30%"); - listGrid.getField(MeasurementScheduleCriteria.SORT_FIELD_DATA_TYPE).setWidth("20%"); - listGrid.getField(MeasurementScheduleCriteria.SORT_FIELD_ENABLED).setWidth("10%"); - listGrid.getField(MeasurementScheduleCriteria.SORT_FIELD_INTERVAL).setWidth("20%"); + listGrid.getField(MeasurementScheduleCriteria.SORT_FIELD_DISPLAY_NAME).setWidth("25%"); + listGrid.getField(MeasurementScheduleCriteria.SORT_FIELD_DESCRIPTION).setWidth("40%"); + listGrid.getField(MeasurementScheduleCriteria.SORT_FIELD_DATA_TYPE).setWidth("10%"); + ListGridField enabledField = listGrid.getField(MeasurementScheduleCriteria.SORT_FIELD_ENABLED); + enabledField.setWidth("5%"); + enabledField.setCellFormatter(new BooleanCellFormatter()); + ListGridField intervalField = listGrid.getField(MeasurementScheduleCriteria.SORT_FIELD_INTERVAL); + intervalField.setCellFormatter(new CellFormatter() { + public String format(Object value, ListGridRecord record, int rowNum, int colNum) { + if (value == null) { + return ""; + } + + long milliseconds = (Integer)value; + if (milliseconds == 0) { + return "0"; + } + + StringBuilder result = new StringBuilder(); + if (milliseconds > 1000) { + long seconds = milliseconds / 1000; + milliseconds = milliseconds % 1000; + if (seconds >= 60) { + long minutes = seconds / 60; + seconds = seconds % 60; + if (minutes > 60) { + long hours = minutes / 60; + minutes = minutes % 60; + result.append(hours).append(" hour"); + if (hours > 1) { + result.append("s"); + } + } + if (minutes != 0) { + if (result.length() != 0) { + result.append(", "); + } + result.append(minutes).append(" minute"); + if (minutes > 1) { + result.append("s"); + } + } + } + if (seconds != 0) { + if (result.length() != 0) { + result.append(", "); + } + result.append(seconds).append(" second"); + if (seconds > 1) { + result.append("s"); + } + } + } + if (milliseconds != 0) { + if (result.length() != 0) { + result.append(", "); + } + result.append(milliseconds).append(" millisecond"); + if (milliseconds > 1) { + result.append("s"); + } + } + return result.toString(); + } + }); + intervalField.setWidth("25%");
addTableAction("Enable", Table.SelectionEnablement.ANY, null, new TableAction() { public void executeAction(ListGridRecord[] selection) { @@ -78,4 +139,9 @@ public abstract class AbstractMeasurementScheduleListView extends Table { }); // TODO: Add controls to set collection interval - base class is going to need massaging... } + + public void refresh() { + this.getListGrid().invalidateCache(); + //this.table.getListGrid().markForRedraw(); + } } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java index 24c2e00..410a4a4 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java @@ -41,6 +41,7 @@ import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.configura import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.configuration.ResourceConfigurationEditView; import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.inventory.PluginConfigurationEditView; import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.monitoring.GraphListView; +import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.monitoring.schedules.SchedulesView; import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.summary.DashboardView; import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.summary.OverviewView;
@@ -144,8 +145,8 @@ public class ResourceDetailView extends VLayout implements BookmarkableView, Res + resource.getId())); monitoringTab.updateSubTab("Availability", new FullHTMLPane( "/rhq/resource/monitor/availabilityHistory-plain.xhtml?id=" + resource.getId())); - monitoringTab.updateSubTab("Schedules", new FullHTMLPane("/rhq/resource/monitor/schedules-plain.xhtml?id=" - + resource.getId())); + monitoringTab.updateSubTab("Schedules", new SchedulesView(resource.getId())); + //new FullHTMLPane("/rhq/resource/monitor/schedules-plain.xhtml?id=" + resource.getId())); monitoringTab.updateSubTab("Call Time", new FullHTMLPane("/rhq/resource/monitor/response-plain.xhtml?id=" + resource.getId()));
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/schedules/SchedulesDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/schedules/SchedulesDataSource.java new file mode 100644 index 0000000..31247f4 --- /dev/null +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/schedules/SchedulesDataSource.java @@ -0,0 +1,106 @@ +package org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.monitoring.schedules; + +import com.google.gwt.user.client.rpc.AsyncCallback; +import com.smartgwt.client.data.DataSourceField; +import com.smartgwt.client.data.fields.DataSourceIntegerField; +import com.smartgwt.client.widgets.grid.ListGridRecord; +import org.rhq.core.domain.criteria.MeasurementScheduleCriteria; +import org.rhq.core.domain.measurement.MeasurementSchedule; +import org.rhq.enterprise.gui.coregui.client.CoreGUI; +import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup; +import org.rhq.enterprise.gui.coregui.client.gwt.MeasurementDataGWTServiceAsync; +import org.rhq.enterprise.gui.coregui.client.inventory.common.AbstractMeasurementScheduleDataSource; +import org.rhq.enterprise.gui.coregui.client.inventory.common.AbstractMeasurementScheduleListView; +import org.rhq.enterprise.gui.coregui.client.util.message.Message; + +import java.util.List; + +/** + * A DataSource for reading an updating the metric schedules for the current Resource. + * + * @author Ian Springer + */ +public class SchedulesDataSource extends AbstractMeasurementScheduleDataSource { + private MeasurementDataGWTServiceAsync measurementService = GWTServiceLookup.getMeasurementDataService(); + private int resourceId; + + public SchedulesDataSource(int resourceId) { + this.resourceId = resourceId; + } + + @Override + protected List<DataSourceField> createFields() { + List<DataSourceField> fields = super.createFields(); + DataSourceField resourceIdField = new DataSourceIntegerField(MeasurementScheduleCriteria.FILTER_FIELD_RESOURCE_ID, + "Resource Id"); + resourceIdField.setHidden(true); + fields.add(resourceIdField); + return fields; + } + + @Override + public ListGridRecord copyValues(MeasurementSchedule from) { + ListGridRecord record = super.copyValues(from); + record.setAttribute(MeasurementScheduleCriteria.FILTER_FIELD_RESOURCE_ID, this.resourceId); + return record; + } + + @Override + protected void enableSchedules(AbstractMeasurementScheduleListView measurementScheduleListView, + int[] measurementDefinitionIds) { + this.measurementService.enableSchedulesForResource(this.resourceId, measurementDefinitionIds, + new AsyncCallback<Void>() { + @Override + public void onFailure(Throwable throwable) { + CoreGUI.getErrorHandler().handleError("Failed to enable specified metric schedules for Resource with id[" + resourceId + "].", + throwable); + } + + @Override + public void onSuccess(Void aVoid) { + CoreGUI.getMessageCenter().notify(new Message("Specified Metric schedules for Resource with id [" + resourceId + + "] enabled.", Message.Severity.Info)); + + } + }); + } + + @Override + protected void disableSchedules(AbstractMeasurementScheduleListView measurementScheduleListView, int[] measurementDefinitionIds) { + this.measurementService.disableSchedulesForResource(this.resourceId, measurementDefinitionIds, + new AsyncCallback<Void>() { + @Override + public void onFailure(Throwable throwable) { + CoreGUI.getErrorHandler().handleError("Failed to disable specified metric schedules for Resource with id[" + resourceId + "].", + throwable); + } + + @Override + public void onSuccess(Void aVoid) { + CoreGUI.getMessageCenter().notify(new Message("Specified metric schedules for Resource with id [" + resourceId + + "] disabled.", Message.Severity.Info)); + + } + }); + } + + @Override + protected void updateSchedules(AbstractMeasurementScheduleListView measurementScheduleListView, + int[] measurementDefinitionIds, long collectionInterval) { + this.measurementService.updateSchedulesForResource(this.resourceId, measurementDefinitionIds, collectionInterval, + new AsyncCallback<Void>() { + @Override + public void onFailure(Throwable throwable) { + CoreGUI.getErrorHandler().handleError("Failed to update specified metric schedules for Resource with id[" + resourceId + "].", + throwable); + } + + @Override + public void onSuccess(Void aVoid) { + CoreGUI.getMessageCenter().notify(new Message("Specified Metric schedules for Resource with id [" + resourceId + + "] updated.", Message.Severity.Info)); + + } + }); + } +} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/schedules/SchedulesView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/schedules/SchedulesView.java new file mode 100644 index 0000000..f9a1d80 --- /dev/null +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/schedules/SchedulesView.java @@ -0,0 +1,24 @@ +package org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.monitoring.schedules; + +import com.smartgwt.client.data.Criteria; +import org.rhq.core.domain.criteria.MeasurementScheduleCriteria; +import org.rhq.enterprise.gui.coregui.client.inventory.common.AbstractMeasurementScheduleListView; + +/** + * The Resource Monitoring>Schedules subtab. + * + * @author Ian Springer + */ +public class SchedulesView extends AbstractMeasurementScheduleListView { + private static final String[] EXCLUDED_FIELD_NAMES = new String[] { MeasurementScheduleCriteria.FILTER_FIELD_RESOURCE_ID }; + + public SchedulesView(int resourceId) { + super(new SchedulesDataSource(resourceId), createCriteria(resourceId), EXCLUDED_FIELD_NAMES); + } + + private static Criteria createCriteria(int resourceId) { + Criteria criteria = new Criteria(); + criteria.addCriteria(MeasurementScheduleCriteria.FILTER_FIELD_RESOURCE_ID, resourceId); + return criteria; + } +} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/MeasurementDataGWTServiceImpl.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/MeasurementDataGWTServiceImpl.java index 2514bd6..cdac27f 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/MeasurementDataGWTServiceImpl.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/MeasurementDataGWTServiceImpl.java @@ -36,7 +36,6 @@ import org.rhq.core.domain.util.PageList; import org.rhq.enterprise.gui.coregui.client.gwt.MeasurementDataGWTService; import org.rhq.enterprise.gui.coregui.server.util.SerialUtility; import org.rhq.enterprise.server.measurement.CallTimeDataManagerLocal; -import org.rhq.enterprise.server.measurement.MeasurementBaselineManagerLocal; import org.rhq.enterprise.server.measurement.MeasurementDataManagerLocal; import org.rhq.enterprise.server.measurement.MeasurementDefinitionManagerLocal; import org.rhq.enterprise.server.measurement.MeasurementOOBManagerLocal; @@ -109,4 +108,19 @@ public class MeasurementDataGWTServiceImpl extends AbstractGWTServiceImpl implem n), "MeasurementDataService.getHighestNOOBsForResource"); } + + public void enableSchedulesForResource(int resourceId, int[] measurementDefinitionIds) { + scheduleManager.enableSchedulesForResource(getSessionSubject(), resourceId, measurementDefinitionIds); + } + + public void disableSchedulesForResource(int resourceId, int[] measurementDefinitionIds) { + scheduleManager.disableSchedulesForResource(getSessionSubject(), resourceId, measurementDefinitionIds); + } + + public void updateSchedulesForResource(int resourceId, int[] measurementDefinitionIds, long collectionInterval) { + scheduleManager.updateSchedulesForResource(getSessionSubject(), resourceId, measurementDefinitionIds, collectionInterval); + } + } + +
commit d7aaa1768dba37a238b1c2d4bd77a9cb1e6a193c Author: John Mazzitelli mazz@redhat.com Date: Fri Aug 13 19:36:42 2010 -0400
starting conditions tab
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/AbstractAlertDefinitionsDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/AbstractAlertDefinitionsDataSource.java index c3c6660..7e56aec 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/AbstractAlertDefinitionsDataSource.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/AbstractAlertDefinitionsDataSource.java @@ -28,7 +28,6 @@ import com.smartgwt.client.types.FieldType; import com.smartgwt.client.widgets.grid.ListGridRecord;
import org.rhq.core.domain.alert.AlertDefinition; -import org.rhq.core.domain.alert.AlertPriority; import org.rhq.core.domain.criteria.AlertDefinitionCriteria; import org.rhq.core.domain.util.PageList; import org.rhq.enterprise.gui.coregui.client.CoreGUI; @@ -49,7 +48,7 @@ public abstract class AbstractAlertDefinitionsDataSource extends RPCDataSource<A protected static final String FIELD_ENABLED = "enabled"; protected static final String FIELD_DELETED = "deleted"; protected static final String FIELD_PRIORITY = "priority"; // not the actual object; a string for the UI - protected static final String FIELD_PRIORITY_ENUM = "priority_enum"; // the actual enum name + protected static final String FIELD_OBJECT = "_object"; // the actual AlertDefinition object
public AbstractAlertDefinitionsDataSource() { setupFields(); @@ -57,14 +56,7 @@ public abstract class AbstractAlertDefinitionsDataSource extends RPCDataSource<A
@Override public AlertDefinition copyValues(ListGridRecord from) { - AlertDefinition alertDef = new AlertDefinition(); - alertDef.setId(from.getAttributeAsInt(FIELD_ID)); - alertDef.setName(from.getAttributeAsString(FIELD_NAME)); - alertDef.setDescription(from.getAttributeAsString(FIELD_DESCRIPTION)); - alertDef.setCtime(from.getAttributeAsDate(FIELD_CTIME).getTime()); - alertDef.setMtime(from.getAttributeAsDate(FIELD_MTIME).getTime()); - alertDef.setEnabled(from.getAttributeAsBoolean(FIELD_ENABLED)); - alertDef.setPriority(AlertPriority.valueOf(from.getAttributeAsString(FIELD_PRIORITY_ENUM))); + AlertDefinition alertDef = (AlertDefinition) from.getAttributeAsObject(FIELD_OBJECT); return alertDef; }
@@ -79,7 +71,7 @@ public abstract class AbstractAlertDefinitionsDataSource extends RPCDataSource<A record.setAttribute(FIELD_ENABLED, from.getEnabled()); record.setAttribute(FIELD_DELETED, from.getDeleted()); record.setAttribute(FIELD_PRIORITY, from.getPriority().getDisplayName()); - record.setAttribute(FIELD_PRIORITY_ENUM, from.getPriority().name()); + record.setAttribute(FIELD_OBJECT, from); return record; }
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/AbstractAlertDefinitionsView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/AbstractAlertDefinitionsView.java index 4a57272..f7257f4 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/AbstractAlertDefinitionsView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/AbstractAlertDefinitionsView.java @@ -97,6 +97,7 @@ public abstract class AbstractAlertDefinitionsView extends VLayout { : SelectionEnablement.NEVER, "Are You Sure?", new TableAction() { public void executeAction(ListGridRecord[] selection) { disableButtonPressed(selection); + CoreGUI.refresh(); } });
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/ConditionsAlertDefinitionForm.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/ConditionsAlertDefinitionForm.java index 819260f..8be60bb 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/ConditionsAlertDefinitionForm.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/ConditionsAlertDefinitionForm.java @@ -23,8 +23,11 @@
package org.rhq.enterprise.gui.coregui.client.alert.definitions;
+import java.util.LinkedHashMap; + import com.smartgwt.client.widgets.form.DynamicForm; import com.smartgwt.client.widgets.form.fields.SelectItem; +import com.smartgwt.client.widgets.form.fields.StaticTextItem;
import org.rhq.core.domain.alert.AlertDefinition; import org.rhq.core.domain.alert.BooleanExpression; @@ -38,6 +41,8 @@ public class ConditionsAlertDefinitionForm extends DynamicForm implements EditAl
private SelectItem conditionExpression;
+ private StaticTextItem conditionExpressionStatic; + private boolean formBuilt = false;
public ConditionsAlertDefinitionForm() { @@ -73,8 +78,8 @@ public class ConditionsAlertDefinitionForm extends DynamicForm implements EditAl if (alertDef == null) { clearFormValues(); } else { - // TODO: why is cond expression always null???? - //conditionExpression.setValue(alertDef.getConditionExpression().toString()); + conditionExpression.setValue(alertDef.getConditionExpression().name()); + conditionExpressionStatic.setValue(alertDef.getConditionExpression().toString()); }
markForRedraw(); @@ -82,23 +87,32 @@ public class ConditionsAlertDefinitionForm extends DynamicForm implements EditAl
@Override public void makeEditable() { - // TODO Auto-generated method stub + conditionExpression.show(); + conditionExpressionStatic.hide(); + + markForRedraw(); }
@Override public void makeViewOnly() { - // TODO Auto-generated method stub + conditionExpression.hide(); + conditionExpressionStatic.show(); + + markForRedraw(); }
@Override public void saveAlertDefinition() { - // TODO Auto-generated method stub + String condExpr = conditionExpression.getValue().toString(); + alertDefinition.setConditionExpression(BooleanExpression.valueOf(condExpr)); }
@Override public void clearFormValues() { conditionExpression.clearValue();
+ conditionExpressionStatic.clearValue(); + markForRedraw(); }
@@ -106,10 +120,14 @@ public class ConditionsAlertDefinitionForm extends DynamicForm implements EditAl if (!formBuilt) {
conditionExpression = new SelectItem("conditionExpression", "Fire alert when"); - conditionExpression.setValueMap(BooleanExpression.ALL.toString(), BooleanExpression.ANY.toString()); - conditionExpression.setDefaultValue(BooleanExpression.ALL.toString()); - - setFields(conditionExpression); + LinkedHashMap<String, String> condExprs = new LinkedHashMap<String, String>(2); + condExprs.put(BooleanExpression.ALL.name(), BooleanExpression.ALL.toString()); + condExprs.put(BooleanExpression.ANY.name(), BooleanExpression.ANY.toString()); + conditionExpression.setValueMap(condExprs); + conditionExpression.setDefaultValue(BooleanExpression.ALL.name()); + conditionExpressionStatic = new StaticTextItem("conditionExpressionStatic", "Fire alert when"); + + setFields(conditionExpression, conditionExpressionStatic);
formBuilt = true; } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/DampeningAlertDefinitionForm.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/DampeningAlertDefinitionForm.java index 5590af6..1da8f49 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/DampeningAlertDefinitionForm.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/DampeningAlertDefinitionForm.java @@ -78,11 +78,15 @@ public class DampeningAlertDefinitionForm extends DynamicForm implements EditAle @Override public void makeEditable() { // TODO Auto-generated method stub + + markForRedraw(); }
@Override public void makeViewOnly() { // TODO Auto-generated method stub + + markForRedraw(); }
@Override diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/NotificationsAlertDefinitionForm.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/NotificationsAlertDefinitionForm.java index ab79d1c..d0fddc6 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/NotificationsAlertDefinitionForm.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/NotificationsAlertDefinitionForm.java @@ -78,11 +78,15 @@ public class NotificationsAlertDefinitionForm extends DynamicForm implements Edi @Override public void makeEditable() { // TODO Auto-generated method stub + + markForRedraw(); }
@Override public void makeViewOnly() { // TODO Auto-generated method stub + + markForRedraw(); }
@Override diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/RecoveryAlertDefinitionForm.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/RecoveryAlertDefinitionForm.java index cff9ad7..637c2cc 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/RecoveryAlertDefinitionForm.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/RecoveryAlertDefinitionForm.java @@ -83,11 +83,15 @@ public class RecoveryAlertDefinitionForm extends DynamicForm implements EditAler @Override public void makeEditable() { // TODO Auto-generated method stub + + markForRedraw(); }
@Override public void makeViewOnly() { // TODO Auto-generated method stub + + markForRedraw(); }
@Override diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/ResourceAlertDefinitionsDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/ResourceAlertDefinitionsDataSource.java index ed19a24..ac7b789 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/ResourceAlertDefinitionsDataSource.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/ResourceAlertDefinitionsDataSource.java @@ -40,11 +40,8 @@ import org.rhq.core.domain.resource.Resource; */ public class ResourceAlertDefinitionsDataSource extends AbstractAlertDefinitionsDataSource {
- protected static final String FIELD_PARENT = "parent"; // the column field - may be template or group alert def parent - protected static final String FIELD_PARENT_TEMPLATEID = "parent_tid"; // the actual integer (may be 0) of template ID - protected static final String FIELD_PARENT_GROUPALERTDEF = "parentId_gad"; // the actual group alert def parent (may be null) + protected static final String FIELD_PARENT = "parent"; // may be template or group alert def parent protected static final String FIELD_READONLY = "readOnly"; // not necessarily the actual boolean; sometimes we display "N/A" - protected static final String FIELD_READONLY_BOOLEAN = "readOnly_boolean"; // the actual boolean value
private Resource resource;
@@ -54,15 +51,6 @@ public class ResourceAlertDefinitionsDataSource extends AbstractAlertDefinitions }
@Override - public AlertDefinition copyValues(ListGridRecord from) { - AlertDefinition alertDef = super.copyValues(from); - alertDef.setParentId(from.getAttributeAsInt(FIELD_PARENT_TEMPLATEID)); - alertDef.setGroupAlertDefinition((AlertDefinition) from.getAttributeAsObject(FIELD_PARENT_GROUPALERTDEF)); - alertDef.setReadOnly(from.getAttributeAsBoolean(FIELD_READONLY_BOOLEAN)); - return alertDef; - } - - @Override public ListGridRecord copyValues(AlertDefinition from) { ListGridRecord record = super.copyValues(from);
@@ -70,10 +58,6 @@ public class ResourceAlertDefinitionsDataSource extends AbstractAlertDefinitions AlertDefinition groupAlertDefinition = from.getGroupAlertDefinition(); boolean readOnly = from.isReadOnly();
- record.setAttribute(FIELD_PARENT_TEMPLATEID, parentId); - record.setAttribute(FIELD_PARENT_GROUPALERTDEF, groupAlertDefinition); - record.setAttribute(FIELD_READONLY_BOOLEAN, readOnly); - if ((parentId == null || parentId.intValue() == 0) && (groupAlertDefinition == null)) { record.setAttribute(FIELD_PARENT, ""); record.setLinkText(""); diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/ResourceAlertDefinitionsView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/ResourceAlertDefinitionsView.java index 6d01e26..84dd71c 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/ResourceAlertDefinitionsView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/ResourceAlertDefinitionsView.java @@ -29,6 +29,7 @@ import com.smartgwt.client.widgets.grid.ListGridRecord;
import org.rhq.core.domain.alert.AlertDefinition; import org.rhq.core.domain.alert.AlertPriority; +import org.rhq.core.domain.alert.BooleanExpression; import org.rhq.core.domain.resource.Resource;
/** @@ -76,6 +77,7 @@ public class ResourceAlertDefinitionsView extends AbstractAlertDefinitionsView { newAlertDef.setEnabled(true); newAlertDef.setNotifyFiltered(false); newAlertDef.setParentId(Integer.valueOf(0)); + newAlertDef.setConditionExpression(BooleanExpression.ALL); newAlertDef.setPriority(AlertPriority.MEDIUM); newAlertDef.setWillRecover(false);
commit e34f00313d65d75fc5d7fb0e5f423be09942d259 Author: Simeon Pinder spinder@redhat.com Date: Fri Aug 13 19:35:28 2010 -0400
fix wsprovide failure in build.
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/composite/ResourceComposite.java b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/composite/ResourceComposite.java index 8b6f809..823a785 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/composite/ResourceComposite.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/composite/ResourceComposite.java @@ -45,7 +45,7 @@ public class ResourceComposite implements Serializable { @XmlElement private Resource parent;
- @XmlElement + @XmlTransient private ResourcePermission resourcePermission;
@XmlElement
commit 2d5cada01618a79e2819b7dbfeb763bc32a1620d Author: Ian Springer ian.springer@redhat.com Date: Fri Aug 13 18:56:30 2010 -0400
change how togglable form items are rendered (edit icon now only appears when you hover over the item); add missing updateResource() method to WebServicesManagerBean; move group Overview subtab from Inventory tab to Summary tab; rename some classes to make resource and group View classnames more consistent witheach other
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/group/ResourceGroup.java b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/group/ResourceGroup.java index 9a8ff9d..d9ca343 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/group/ResourceGroup.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/group/ResourceGroup.java @@ -74,7 +74,7 @@ import org.rhq.core.domain.tagging.Tag; @NamedQuery(name = ResourceGroup.QUERY_FIND_ALL_FILTERED_COUNT, query = "SELECT count(DISTINCT g) " + "FROM ResourceGroup g JOIN g.roles r JOIN r.subjects s " // + "LEFT JOIN g.resourceType type " // - + "LEFT JOIN g.implicitResources res " // used for inventory>overview "member in groups" section, authz-related + + "LEFT JOIN g.implicitResources res " // used for inventory>summary "member in groups" section, authz-related + "WHERE s = :subject " // + " AND g.visible = true " + " AND ( res.id = :resourceId OR :resourceId is null ) " @@ -89,7 +89,7 @@ import org.rhq.core.domain.tagging.Tag; + " AND (type.category = :category OR :category is null) ) ) "), @NamedQuery(name = ResourceGroup.QUERY_FIND_ALL_FILTERED_COUNT_ADMIN, query = "SELECT count(DISTINCT g) FROM ResourceGroup g " + "LEFT JOIN g.resourceType type " - + "LEFT JOIN g.implicitResources res " // used for inventory>overview "member in groups" section, authz-related + + "LEFT JOIN g.implicitResources res " // used for inventory>summary "member in groups" section, authz-related + "WHERE ( g.groupCategory = :groupCategory OR :groupCategory is null ) " + " AND g.visible = true " + " AND ( res.id = :resourceId OR :resourceId is null ) " diff --git a/modules/core/domain/src/test/java/org/rhq/core/domain/configuration/test/DataSourceExample.java b/modules/core/domain/src/test/java/org/rhq/core/domain/configuration/test/DataSourceExample.java index a9ca740..2f270a4 100644 --- a/modules/core/domain/src/test/java/org/rhq/core/domain/configuration/test/DataSourceExample.java +++ b/modules/core/domain/src/test/java/org/rhq/core/domain/configuration/test/DataSourceExample.java @@ -30,7 +30,7 @@ import org.rhq.core.domain.configuration.PropertySimple;
public class DataSourceExample { /* This class exercises the Configuration domain model from a number of different actors and goals. - * The following overview describes the different use cases of the domain model: + * The following summary describes the different use cases of the domain model: * * 1. Plugin populating a value set to describe the resource's current state 2. Plugin reading a value set to write * the changes to the resource 3. Plugin Container creating a definition 4. Server storing a value set to the diff --git a/modules/enterprise/gui/coregui/pom.xml b/modules/enterprise/gui/coregui/pom.xml index ce9dfca..37e1993 100644 --- a/modules/enterprise/gui/coregui/pom.xml +++ b/modules/enterprise/gui/coregui/pom.xml @@ -27,7 +27,7 @@
<!-- If this is too much memory to allocate to your gwt:debug process then override this property in in your settings.xml --> - <gwt-plugin.extraJvmArgs>-Xms512M -Xmx512M</gwt-plugin.extraJvmArgs> + <gwt-plugin.extraJvmArgs>-Xms512M -Xmx512M -XX:PermSize=128M -XX:MaxPermSize=256M</gwt-plugin.extraJvmArgs> <gwt-plugin.localWorkers>2</gwt-plugin.localWorkers> </properties>
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java index 7cd621b..aa6c084 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java @@ -51,7 +51,7 @@ import org.rhq.enterprise.gui.coregui.client.dashboard.DashboardsView; import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup; import org.rhq.enterprise.gui.coregui.client.inventory.groups.detail.ResourceGroupTopView; import org.rhq.enterprise.gui.coregui.client.inventory.resource.InventoryView; -import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.ResourceView; +import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.ResourceTopView; import org.rhq.enterprise.gui.coregui.client.menu.MenuBarView; import org.rhq.enterprise.gui.coregui.client.report.ReportTopView; import org.rhq.enterprise.gui.coregui.client.report.tag.TaggedView; @@ -264,7 +264,7 @@ public class CoreGUI implements EntryPoint, ValueChangeHandler<String> { } else if (breadcrumbName.equals("Inventory")) { canvas = new InventoryView(); } else if (breadcrumbName.equals("Resource")) { - canvas = new ResourceView(); + canvas = new ResourceTopView(); } else if (breadcrumbName.equals("ResourceGroup")) { canvas = new ResourceGroupTopView(); } else if (breadcrumbName.equals("Dashboard")) { diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LinkManager.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LinkManager.java index fc93906..0375213 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LinkManager.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LinkManager.java @@ -35,7 +35,7 @@ public class LinkManager { if (GWT) { return "#Resource/" + resourceId; } else { - return "/rhq/resource/summary/overview.xhtml?id=" + resourceId; + return "/rhq/resource/summary/summary.xhtml?id=" + resourceId; } }
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/form/EnhancedDynamicForm.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/form/EnhancedDynamicForm.java index 02185e7..0ae01ce 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/form/EnhancedDynamicForm.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/form/EnhancedDynamicForm.java @@ -23,16 +23,18 @@ package org.rhq.enterprise.gui.coregui.client.components.form;
import com.google.gwt.core.client.JavaScriptObject; +import com.google.gwt.user.client.Timer; import com.smartgwt.client.widgets.form.DynamicForm; import com.smartgwt.client.widgets.form.FormItemIfFunction; import com.smartgwt.client.widgets.form.fields.FormItem; import com.smartgwt.client.widgets.form.fields.FormItemIcon; import com.smartgwt.client.widgets.form.fields.StaticTextItem; -import com.smartgwt.client.widgets.form.fields.TextItem; import com.smartgwt.client.widgets.form.fields.events.BlurEvent; import com.smartgwt.client.widgets.form.fields.events.BlurHandler; import com.smartgwt.client.widgets.form.fields.events.IconClickEvent; import com.smartgwt.client.widgets.form.fields.events.IconClickHandler; +import com.smartgwt.client.widgets.form.fields.events.ItemHoverEvent; +import com.smartgwt.client.widgets.form.fields.events.ItemHoverHandler; import com.smartgwt.client.widgets.form.fields.events.KeyPressEvent; import com.smartgwt.client.widgets.form.fields.events.KeyPressHandler;
@@ -40,7 +42,12 @@ import java.util.ArrayList; import java.util.List;
/** - * TODO + * A subclass of SmartGWT's DynamicForm widget that provides the following additional feature: + * + * If any {@link TogglableTextItem}s are added to the form, they will initially be rendered as static text items, except + * when the user hovers over one of them, an edit icon will be displayed immediately to the right of it for five seconds. + * If the user clicks this icon, the form item will become editable and the user can update its value. Once the user + * hits Enter or switches focus somewhere outside the form item, the form item will become static again. * * @author Ian Springer */ @@ -80,20 +87,33 @@ public class EnhancedDynamicForm extends DynamicForm { editIcon.setName("Edit"); editIcon.setSrc("[SKIN]/actions/edit.png"); staticTextItem.setIcons(editIcon); - staticTextItem.setShowIcons(true); + staticTextItem.setShowIcons(false);
+ staticTextItem.setShowIfCondition(new FormItemIfFunction() { + public boolean execute(FormItem formItem, Object o, DynamicForm dynamicForm) { + boolean editing = staticTextItem.getAttributeAsBoolean("editing"); + return !editing; + } + }); staticTextItem.addIconClickHandler(new IconClickHandler() { public void onIconClick(IconClickEvent iconClickEvent) { if ("Edit".equals(iconClickEvent.getIcon().getName())) { staticTextItem.setAttribute("editing", true); + staticTextItem.setShowIcons(false); markForRedraw(); } } }); - staticTextItem.setShowIfCondition(new FormItemIfFunction() { - public boolean execute(FormItem formItem, Object o, DynamicForm dynamicForm) { - boolean editing = staticTextItem.getAttributeAsBoolean("editing"); - return !editing; + staticTextItem.addItemHoverHandler(new ItemHoverHandler() { + public void onItemHover(ItemHoverEvent itemHoverEvent) { + staticTextItem.setShowIcons(true); + markForRedraw(); + new Timer() { + public void run() { + staticTextItem.setShowIcons(false); + markForRedraw(); + } + }.schedule(5000); } }); staticTextItem.addClickHandler(new com.smartgwt.client.widgets.form.fields.events.ClickHandler() { @@ -126,7 +146,7 @@ public class EnhancedDynamicForm extends DynamicForm { itemsList.add(togglableTextItem); } else { itemsList.add(item); - } + } }
super.setItems((FormItem[]) itemsList.toArray(new FormItem[itemsList.size()])); diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/form/TogglableTextItem.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/form/TogglableTextItem.java index 399cb7e..9807b35 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/form/TogglableTextItem.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/form/TogglableTextItem.java @@ -29,7 +29,8 @@ import java.util.ArrayList; import java.util.List;
/** - * TODO + * This class should only be used on conjunction with an {@link EnhancedDynamicForm}. See that class's Javadoc for + * all the details. * * @author Ian Springer */ diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java index 8fff6e2..e6b208c 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java @@ -23,6 +23,7 @@ import java.util.Set;
import com.google.gwt.user.client.History; import com.google.gwt.user.client.rpc.AsyncCallback; +import com.smartgwt.client.docs.Members; import com.smartgwt.client.types.Side; import com.smartgwt.client.widgets.layout.VLayout;
@@ -42,7 +43,7 @@ import org.rhq.enterprise.gui.coregui.client.components.tab.TwoLevelTabSelectedE import org.rhq.enterprise.gui.coregui.client.components.tab.TwoLevelTabSelectedHandler; import org.rhq.enterprise.gui.coregui.client.components.tab.TwoLevelTabSet; import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup; -import org.rhq.enterprise.gui.coregui.client.inventory.groups.detail.inventory.OverviewView; +import org.rhq.enterprise.gui.coregui.client.inventory.groups.detail.summary.OverviewView; import org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceSearchView; import org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTypeRepository;
@@ -93,7 +94,7 @@ public class ResourceGroupDetailView extends VLayout implements BookmarkableView monitoringTab.registerSubTabs("Graphs", "Tables", "Schedules", "Call Time");
inventoryTab = new TwoLevelTab("Inventory", "/images/icons/Inventory_grey_16.png"); - inventoryTab.registerSubTabs("Overview", "Members", "Connection Settings"); + inventoryTab.registerSubTabs("Members", "Connection Settings");
operationsTab = new TwoLevelTab("Operations", "/images/icons/Operation_grey_16.png"); operationsTab.registerSubTabs("History", "Scheduled"); @@ -126,11 +127,11 @@ public class ResourceGroupDetailView extends VLayout implements BookmarkableView
this.titleBar.setGroup(groupComposite.getResourceGroup());
- // TODO: Implement the rest of the tabs. - // FullHTMLPane timelinePane = new FullHTMLPane("/rhq/resource/summary/timeline-plain.xhtml?id=" + resource.getId()); - // summaryTab.updateSubTab("Overview", new ResourceOverviewView(resource)); + // summaryTab.updateSubTab("Overview", new DashboardView(resource)); // summaryTab.updateSubTab("Timeline", timelinePane); + summaryTab.updateSubTab("Overview", new OverviewView(this.groupComposite)); + int groupId = this.groupComposite.getResourceGroup().getId();
monitoringTab.updateSubTab("Graphs", new FullHTMLPane("/rhq/group/monitor/graphs-plain.xhtml?groupId=" @@ -142,7 +143,6 @@ public class ResourceGroupDetailView extends VLayout implements BookmarkableView monitoringTab.updateSubTab("Call Time", new FullHTMLPane("/rhq/group/monitor/response-plain.xhtml?groupId=" + groupId));
- inventoryTab.updateSubTab("Overview", new OverviewView(this.groupComposite)); inventoryTab.updateSubTab("Members", ResourceSearchView.getMembersOf(groupId)); // inventoryTab.updateSubTab("Connection Settings", new GroupPluginConfigurationEditView(this.group.getId(), this.group.getResourceType().getId(), ConfigurationEditor.ConfigType.plugin));
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/inventory/OverviewView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/inventory/OverviewView.java deleted file mode 100644 index 01faa2d..0000000 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/inventory/OverviewView.java +++ /dev/null @@ -1,241 +0,0 @@ -/* - * RHQ Management Platform - * Copyright (C) 2010 Red Hat, Inc. - * All rights reserved. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation version 2 of the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ -package org.rhq.enterprise.gui.coregui.client.inventory.groups.detail.inventory; - -import com.google.gwt.user.client.rpc.AsyncCallback; -import com.smartgwt.client.types.Alignment; -import com.smartgwt.client.widgets.HTMLFlow; -import com.smartgwt.client.widgets.form.fields.FormItem; -import com.smartgwt.client.widgets.form.fields.StaticTextItem; -import com.smartgwt.client.widgets.layout.HLayout; -import com.smartgwt.client.widgets.layout.VLayout; -import org.rhq.core.domain.resource.ResourceType; -import org.rhq.core.domain.resource.group.GroupDefinition; -import org.rhq.core.domain.resource.group.ResourceGroup; -import org.rhq.core.domain.resource.group.composite.ResourceGroupComposite; -import org.rhq.enterprise.gui.coregui.client.CoreGUI; -import org.rhq.enterprise.gui.coregui.client.components.form.EnhancedDynamicForm; -import org.rhq.enterprise.gui.coregui.client.components.form.TogglableTextItem; -import org.rhq.enterprise.gui.coregui.client.components.form.ValueUpdatedHandler; -import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup; -import org.rhq.enterprise.gui.coregui.client.gwt.ResourceGroupGWTServiceAsync; -import org.rhq.enterprise.gui.coregui.client.util.message.Message; - -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -/** - * The group Inventory>Overview subtab. - * - * @author Ian Springer - */ -public class OverviewView extends VLayout { - private ResourceGroupGWTServiceAsync resourceGroupService = GWTServiceLookup.getResourceGroupService(); - private ResourceGroupComposite groupComposite; - - public OverviewView(ResourceGroupComposite groupComposite) { - super(); - this.groupComposite = groupComposite; - } - - @Override - protected void onInit() { - super.onInit(); - - final ResourceGroup group = this.groupComposite.getResourceGroup(); - - HLayout spacer = new HLayout(); - spacer.setHeight(15); - addMember(spacer); - - final EnhancedDynamicForm generalPropsForm = new EnhancedDynamicForm(); - - List<FormItem> formItems = new ArrayList<FormItem>(); - - // TODO: Uncomment the below header if we decide to add other stuff to this page besides the general props. - //HeaderItem headerItem = new HeaderItem("header", "General Properties"); - //headerItem.setValue("General Properties"); - //formItems.add(headerItem); - - boolean dynamic = (group.getGroupDefinition() != null); - - final FormItem nameItem = (dynamic) ? new StaticTextItem() : new TogglableTextItem(); - nameItem.setName("name"); - nameItem.setTitle("Name"); - nameItem.setValue(group.getName()); - if (nameItem instanceof TogglableTextItem) { - final TogglableTextItem togglableNameItem = (TogglableTextItem) nameItem; - togglableNameItem.addValueUpdatedHandler(new ValueUpdatedHandler() { - public void onValueUpdated(final String newName) { - final String oldName = group.getName(); - if (newName.equals(oldName)) { - return; - } - group.setName(newName); - OverviewView.this.resourceGroupService.updateResourceGroup(group, new AsyncCallback<Void>() { - public void onFailure(Throwable caught) { - CoreGUI.getErrorHandler().handleError("Failed to change name of Resource group with id " - + group.getId() - + " from "" + oldName + "" to "" + newName + "".", caught); - // We failed to update it on the Server, so change back the ResourceGroup and the form item - // to the original value. - group.setName(oldName); - nameItem.setValue(oldName); - } - - public void onSuccess(Void result) { - CoreGUI.getMessageCenter().notify(new Message("Name of Resource group with id " - + group.getId() + " was changed from "" - + oldName + "" to "" + newName + "".", Message.Severity.Info)); - } - }); - } - }); - } - formItems.add(nameItem); - - StaticTextItem typeItem = new StaticTextItem("memberType", "Member Type"); - ResourceType type = group.getResourceType(); - if (type != null) { - typeItem.setTooltip("Plugin: " + type.getPlugin() + "\n<br>" + "Type: " + type.getName()); - typeItem.setValue(type.getName() + " (" + type.getPlugin() + ")"); - } else { - typeItem.setValue("<i>Mixed</i>"); - } - formItems.add(typeItem); - - StaticTextItem countItem = new StaticTextItem("memberCount", "Member Count"); - long memberCount = this.groupComposite.getImplicitUp() + this.groupComposite.getImplicitDown(); - countItem.setValue(memberCount); - formItems.add(countItem); - - final FormItem descriptionItem = (dynamic) ? new StaticTextItem() : new TogglableTextItem(); - descriptionItem.setName("description"); - descriptionItem.setTitle("Description"); - descriptionItem.setValue(group.getDescription()); - if (descriptionItem instanceof TogglableTextItem) { - final TogglableTextItem togglableDescriptionItem = (TogglableTextItem) descriptionItem; - togglableDescriptionItem.addValueUpdatedHandler(new ValueUpdatedHandler() { - public void onValueUpdated(final String newDescription) { - final String oldDescription = group.getDescription(); - if (newDescription.equals(oldDescription)) { - return; - } - group.setDescription(newDescription); - OverviewView.this.resourceGroupService.updateResourceGroup(group, new AsyncCallback<Void>() { - public void onFailure(Throwable caught) { - CoreGUI.getErrorHandler().handleError("Failed to change description of Resource group with id " - + group.getId() - + " from "" + oldDescription + "" to "" + newDescription + "".", caught); - // We failed to update it on the Server, so change back the ResourceGroup and the form item - // to the original value. - group.setDescription(oldDescription); - descriptionItem.setValue(oldDescription); - } - - public void onSuccess(Void result) { - CoreGUI.getMessageCenter().notify(new Message("Description of Resource group with id " - + group.getId() + " was changed from "" - + oldDescription + "" to "" + newDescription + "".", Message.Severity.Info)); - } - }); - } - }); - } - formItems.add(descriptionItem); - - final FormItem locationItem = (dynamic) ? new StaticTextItem() : new TogglableTextItem(); - locationItem.setName("location"); - locationItem.setTitle("Location"); - locationItem.setValue(group.getLocation()); - if (locationItem instanceof TogglableTextItem) { - final TogglableTextItem togglableLocationItem = (TogglableTextItem) locationItem; - togglableLocationItem.addValueUpdatedHandler(new ValueUpdatedHandler() { - public void onValueUpdated(final String newLocation) { - final String oldLocation = group.getLocation(); - if (newLocation.equals(oldLocation)) { - return; - } - group.setLocation(newLocation); - OverviewView.this.resourceGroupService.updateResourceGroup(group, new AsyncCallback<Void>() { - public void onFailure(Throwable caught) { - CoreGUI.getErrorHandler().handleError("Failed to change location of Resource group with id " - + group.getId() - + " from "" + oldLocation + "" to "" + newLocation + "".", caught); - // We failed to update it on the Server, so change back the ResourceGroup and the form item - // to the original value. - group.setLocation(oldLocation); - locationItem.setValue(oldLocation); - } - - public void onSuccess(Void result) { - CoreGUI.getMessageCenter().notify(new Message("Location of Resource group with id " - + group.getId() + " was changed from "" - + oldLocation + "" to "" + newLocation + "".", Message.Severity.Info)); - } - }); - } - }); - } - formItems.add(locationItem); - - StaticTextItem dynamicItem = new StaticTextItem("dynamic", "Dynamic?"); - dynamicItem.setValue(dynamic ? "yes" : "no"); - formItems.add(dynamicItem); - - StaticTextItem recursiveItem = new StaticTextItem("recursive", "Recursive?"); - recursiveItem.setValue((group.isRecursive()) ? "yes" : "no"); - formItems.add(recursiveItem); - - StaticTextItem createdItem = new StaticTextItem("created", "Created"); - createdItem.setValue(new Date(group.getCtime())); - formItems.add(createdItem); - - StaticTextItem lastModifiedItem = new StaticTextItem("lastModified", "Last Modified"); - lastModifiedItem.setValue(new Date(group.getMtime())); - formItems.add(lastModifiedItem); - - StaticTextItem lastModifiedByItem = new StaticTextItem("lastModifiedBy", "Last Modified By"); - lastModifiedByItem.setValue(group.getModifiedBy()); - formItems.add(lastModifiedByItem); - - if (dynamic) { - StaticTextItem groupDefinitionItem = new StaticTextItem("groupDefinition", "Group Definition"); - GroupDefinition groupDefinition = group.getGroupDefinition(); - // TODO (ips): Make this a link to the group def. - groupDefinitionItem.setValue(groupDefinition.getName()); - formItems.add(groupDefinitionItem); - } - - generalPropsForm.setItems(formItems.toArray(new FormItem[formItems.size()])); - addMember(generalPropsForm); - - if (dynamic) { - spacer = new HLayout(); - spacer.setHeight(10); - addMember(spacer); - - HTMLFlow note = new HTMLFlow(); - note.setContents("<b>*</b> Dynamic group names and descriptions are managed, and therefore are not editable."); - note.setAlign(Alignment.CENTER); - addMember(note); - } - } -} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/summary/OverviewView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/summary/OverviewView.java new file mode 100644 index 0000000..41de300 --- /dev/null +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/summary/OverviewView.java @@ -0,0 +1,241 @@ +/* + * RHQ Management Platform + * Copyright (C) 2010 Red Hat, Inc. + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ +package org.rhq.enterprise.gui.coregui.client.inventory.groups.detail.summary; + +import com.google.gwt.user.client.rpc.AsyncCallback; +import com.smartgwt.client.types.Alignment; +import com.smartgwt.client.widgets.HTMLFlow; +import com.smartgwt.client.widgets.form.fields.FormItem; +import com.smartgwt.client.widgets.form.fields.StaticTextItem; +import com.smartgwt.client.widgets.layout.HLayout; +import com.smartgwt.client.widgets.layout.VLayout; +import org.rhq.core.domain.resource.ResourceType; +import org.rhq.core.domain.resource.group.GroupDefinition; +import org.rhq.core.domain.resource.group.ResourceGroup; +import org.rhq.core.domain.resource.group.composite.ResourceGroupComposite; +import org.rhq.enterprise.gui.coregui.client.CoreGUI; +import org.rhq.enterprise.gui.coregui.client.components.form.EnhancedDynamicForm; +import org.rhq.enterprise.gui.coregui.client.components.form.TogglableTextItem; +import org.rhq.enterprise.gui.coregui.client.components.form.ValueUpdatedHandler; +import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup; +import org.rhq.enterprise.gui.coregui.client.gwt.ResourceGroupGWTServiceAsync; +import org.rhq.enterprise.gui.coregui.client.util.message.Message; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +/** + * The group Inventory>Overview subtab. + * + * @author Ian Springer + */ +public class OverviewView extends VLayout { + private ResourceGroupGWTServiceAsync resourceGroupService = GWTServiceLookup.getResourceGroupService(); + private ResourceGroupComposite groupComposite; + + public OverviewView(ResourceGroupComposite groupComposite) { + super(); + this.groupComposite = groupComposite; + } + + @Override + protected void onInit() { + super.onInit(); + + final ResourceGroup group = this.groupComposite.getResourceGroup(); + + HLayout spacer = new HLayout(); + spacer.setHeight(15); + addMember(spacer); + + final EnhancedDynamicForm generalPropsForm = new EnhancedDynamicForm(); + + List<FormItem> formItems = new ArrayList<FormItem>(); + + // TODO: Uncomment the below header if we decide to add other stuff to this page besides the general props. + //HeaderItem headerItem = new HeaderItem("header", "General Properties"); + //headerItem.setValue("General Properties"); + //formItems.add(headerItem); + + boolean dynamic = (group.getGroupDefinition() != null); + + final FormItem nameItem = (dynamic) ? new StaticTextItem() : new TogglableTextItem(); + nameItem.setName("name"); + nameItem.setTitle("Name"); + nameItem.setValue(group.getName()); + if (nameItem instanceof TogglableTextItem) { + final TogglableTextItem togglableNameItem = (TogglableTextItem) nameItem; + togglableNameItem.addValueUpdatedHandler(new ValueUpdatedHandler() { + public void onValueUpdated(final String newName) { + final String oldName = group.getName(); + if (newName.equals(oldName)) { + return; + } + group.setName(newName); + OverviewView.this.resourceGroupService.updateResourceGroup(group, new AsyncCallback<Void>() { + public void onFailure(Throwable caught) { + CoreGUI.getErrorHandler().handleError("Failed to change name of Resource group with id " + + group.getId() + + " from "" + oldName + "" to "" + newName + "".", caught); + // We failed to update it on the Server, so change back the ResourceGroup and the form item + // to the original value. + group.setName(oldName); + nameItem.setValue(oldName); + } + + public void onSuccess(Void result) { + CoreGUI.getMessageCenter().notify(new Message("Name of Resource group with id " + + group.getId() + " was changed from "" + + oldName + "" to "" + newName + "".", Message.Severity.Info)); + } + }); + } + }); + } + formItems.add(nameItem); + + StaticTextItem typeItem = new StaticTextItem("memberType", "Member Type"); + ResourceType type = group.getResourceType(); + if (type != null) { + typeItem.setTooltip("Plugin: " + type.getPlugin() + "\n<br>" + "Type: " + type.getName()); + typeItem.setValue(type.getName() + " (" + type.getPlugin() + ")"); + } else { + typeItem.setValue("<i>Mixed</i>"); + } + formItems.add(typeItem); + + StaticTextItem countItem = new StaticTextItem("memberCount", "Member Count"); + long memberCount = this.groupComposite.getImplicitUp() + this.groupComposite.getImplicitDown(); + countItem.setValue(memberCount); + formItems.add(countItem); + + final FormItem descriptionItem = (dynamic) ? new StaticTextItem() : new TogglableTextItem(); + descriptionItem.setName("description"); + descriptionItem.setTitle("Description"); + descriptionItem.setValue(group.getDescription()); + if (descriptionItem instanceof TogglableTextItem) { + final TogglableTextItem togglableDescriptionItem = (TogglableTextItem) descriptionItem; + togglableDescriptionItem.addValueUpdatedHandler(new ValueUpdatedHandler() { + public void onValueUpdated(final String newDescription) { + final String oldDescription = group.getDescription(); + if (newDescription.equals(oldDescription)) { + return; + } + group.setDescription(newDescription); + OverviewView.this.resourceGroupService.updateResourceGroup(group, new AsyncCallback<Void>() { + public void onFailure(Throwable caught) { + CoreGUI.getErrorHandler().handleError("Failed to change description of Resource group with id " + + group.getId() + + " from "" + oldDescription + "" to "" + newDescription + "".", caught); + // We failed to update it on the Server, so change back the ResourceGroup and the form item + // to the original value. + group.setDescription(oldDescription); + descriptionItem.setValue(oldDescription); + } + + public void onSuccess(Void result) { + CoreGUI.getMessageCenter().notify(new Message("Description of Resource group with id " + + group.getId() + " was changed from "" + + oldDescription + "" to "" + newDescription + "".", Message.Severity.Info)); + } + }); + } + }); + } + formItems.add(descriptionItem); + + final FormItem locationItem = (dynamic) ? new StaticTextItem() : new TogglableTextItem(); + locationItem.setName("location"); + locationItem.setTitle("Location"); + locationItem.setValue(group.getLocation()); + if (locationItem instanceof TogglableTextItem) { + final TogglableTextItem togglableLocationItem = (TogglableTextItem) locationItem; + togglableLocationItem.addValueUpdatedHandler(new ValueUpdatedHandler() { + public void onValueUpdated(final String newLocation) { + final String oldLocation = group.getLocation(); + if (newLocation.equals(oldLocation)) { + return; + } + group.setLocation(newLocation); + OverviewView.this.resourceGroupService.updateResourceGroup(group, new AsyncCallback<Void>() { + public void onFailure(Throwable caught) { + CoreGUI.getErrorHandler().handleError("Failed to change location of Resource group with id " + + group.getId() + + " from "" + oldLocation + "" to "" + newLocation + "".", caught); + // We failed to update it on the Server, so change back the ResourceGroup and the form item + // to the original value. + group.setLocation(oldLocation); + locationItem.setValue(oldLocation); + } + + public void onSuccess(Void result) { + CoreGUI.getMessageCenter().notify(new Message("Location of Resource group with id " + + group.getId() + " was changed from "" + + oldLocation + "" to "" + newLocation + "".", Message.Severity.Info)); + } + }); + } + }); + } + formItems.add(locationItem); + + StaticTextItem dynamicItem = new StaticTextItem("dynamic", "Dynamic?"); + dynamicItem.setValue(dynamic ? "yes" : "no"); + formItems.add(dynamicItem); + + StaticTextItem recursiveItem = new StaticTextItem("recursive", "Recursive?"); + recursiveItem.setValue((group.isRecursive()) ? "yes" : "no"); + formItems.add(recursiveItem); + + StaticTextItem createdItem = new StaticTextItem("created", "Created"); + createdItem.setValue(new Date(group.getCtime())); + formItems.add(createdItem); + + StaticTextItem lastModifiedItem = new StaticTextItem("lastModified", "Last Modified"); + lastModifiedItem.setValue(new Date(group.getMtime())); + formItems.add(lastModifiedItem); + + StaticTextItem lastModifiedByItem = new StaticTextItem("lastModifiedBy", "Last Modified By"); + lastModifiedByItem.setValue(group.getModifiedBy()); + formItems.add(lastModifiedByItem); + + if (dynamic) { + StaticTextItem groupDefinitionItem = new StaticTextItem("groupDefinition", "Group Definition"); + GroupDefinition groupDefinition = group.getGroupDefinition(); + // TODO (ips): Make this a link to the group def. + groupDefinitionItem.setValue(groupDefinition.getName()); + formItems.add(groupDefinitionItem); + } + + generalPropsForm.setItems(formItems.toArray(new FormItem[formItems.size()])); + addMember(generalPropsForm); + + if (dynamic) { + spacer = new HLayout(); + spacer.setHeight(10); + addMember(spacer); + + HTMLFlow note = new HTMLFlow(); + note.setContents("<b>*</b> Dynamic group names and descriptions are managed, and therefore are not editable."); + note.setAlign(Alignment.CENTER); + addMember(note); + } + } +} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java index 2a7183e..24c2e00 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java @@ -41,7 +41,8 @@ import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.configura import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.configuration.ResourceConfigurationEditView; import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.inventory.PluginConfigurationEditView; import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.monitoring.GraphListView; -import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.overview.ResourceOverviewView; +import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.summary.DashboardView; +import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.summary.OverviewView;
import java.util.Set;
@@ -88,7 +89,7 @@ public class ResourceDetailView extends VLayout implements BookmarkableView, Res topTabSet.setEdgeSize(0);
summaryTab = new TwoLevelTab("Summary", "/images/icons/Service_up_16.png"); - summaryTab.registerSubTabs("Overview", "Timeline"); + summaryTab.registerSubTabs("Overview", "Dashboard", "Timeline");
monitoringTab = new TwoLevelTab("Monitoring", "/images/icons/Monitor_grey_16.png"); monitoringTab.registerSubTabs("Graphs", "Tables", "Traits", "Availability", "Schedules", "Call Time"); @@ -131,7 +132,8 @@ public class ResourceDetailView extends VLayout implements BookmarkableView, Res final Resource resource = this.resourceComposite.getResource(); this.titleBar.setResource(resource);
- summaryTab.updateSubTab("Overview", new ResourceOverviewView(this.resourceComposite)); + summaryTab.updateSubTab("Overview", new OverviewView(this.resourceComposite)); + summaryTab.updateSubTab("Dashboard", new DashboardView(this.resourceComposite)); summaryTab.updateSubTab("Timeline", new FullHTMLPane("/rhq/resource/summary/timeline-plain.xhtml?id=" + resource.getId()));
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTopView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTopView.java new file mode 100644 index 0000000..efed5ff --- /dev/null +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTopView.java @@ -0,0 +1,160 @@ +/* + * RHQ Management Platform + * Copyright (C) 2005-2010 Red Hat, Inc. + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ +package org.rhq.enterprise.gui.coregui.client.inventory.resource.detail; + +import com.google.gwt.user.client.rpc.AsyncCallback; +import com.smartgwt.client.widgets.Canvas; +import com.smartgwt.client.widgets.layout.HLayout; + +import org.rhq.core.domain.criteria.ResourceCriteria; +import org.rhq.core.domain.resource.Resource; +import org.rhq.core.domain.resource.ResourceType; +import org.rhq.core.domain.resource.composite.ResourceComposite; +import org.rhq.core.domain.util.PageList; +import org.rhq.enterprise.gui.coregui.client.BookmarkableView; +import org.rhq.enterprise.gui.coregui.client.CoreGUI; +import org.rhq.enterprise.gui.coregui.client.ViewId; +import org.rhq.enterprise.gui.coregui.client.ViewPath; +import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup; +import org.rhq.enterprise.gui.coregui.client.gwt.ResourceGWTServiceAsync; +import org.rhq.enterprise.gui.coregui.client.inventory.resource.InventoryView; +import org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTypeRepository; +import org.rhq.enterprise.gui.coregui.client.util.message.Message; + +import java.util.EnumSet; + +/** + * @author Greg Hinkle + */ +public class ResourceTopView extends HLayout implements BookmarkableView { + + private Canvas contentCanvas; + + private ResourceComposite currentResource; + //private Resource resourcePlatform; + + private ResourceTreeView treeView; + private ResourceDetailView detailView = new ResourceDetailView(); + + private ResourceGWTServiceAsync resourceService = GWTServiceLookup.getResourceService(); + + + public ResourceTopView() { + + } + + @Override + protected void onInit() { + super.onInit(); + + setWidth100(); + setHeight100(); + + treeView = new ResourceTreeView(); + addMember(treeView); + + contentCanvas = new Canvas(); + addMember(contentCanvas); + + // created above +// detailView = new ResourceDetailView(); + + treeView.addResourceSelectListener(detailView); + + setContent(detailView); + } + + + public void setSelectedResource(final int resourceId, final ViewPath view) { + ResourceCriteria criteria = new ResourceCriteria(); + criteria.addFilterId(resourceId); + criteria.fetchTags(true); + //criteria.fetchParentResource(true); + resourceService.findResourceCompositesByCriteria(criteria, new AsyncCallback<PageList<ResourceComposite>>() { + public void onFailure(Throwable caught) { + CoreGUI.getMessageCenter().notify(new Message("Resource with id [" + resourceId + + "] does not exist or is not accessible.", Message.Severity.Warning)); + + CoreGUI.goTo(InventoryView.VIEW_PATH); + } + + public void onSuccess(PageList<ResourceComposite> result) { + if (result.isEmpty()) { + //noinspection ThrowableInstanceNeverThrown + onFailure(new Exception("Resource with id [" + resourceId + "] does not exist.")); + } else { + final ResourceComposite resourceComposite = result.get(0); + loadResourceType(resourceComposite, view); + } + } + }); + } + + + private void loadResourceType(final ResourceComposite resourceComposite, final ViewPath view) { + final Resource resource = resourceComposite.getResource(); + ResourceTypeRepository.Cache.getInstance().getResourceTypes( + resource.getResourceType().getId(), + EnumSet.of(ResourceTypeRepository.MetadataType.content, ResourceTypeRepository.MetadataType.operations, + ResourceTypeRepository.MetadataType.events, + ResourceTypeRepository.MetadataType.resourceConfigurationDefinition), + new ResourceTypeRepository.TypeLoadedCallback() { + public void onTypesLoaded(ResourceType type) { + resource.setResourceType(type); + completeSetSelectedResource(resourceComposite, view); + } + }); + } + + + private void completeSetSelectedResource(ResourceComposite resourceComposite, ViewPath viewPath) { + this.currentResource = resourceComposite; + this.treeView.setSelectedResource(resourceComposite.getResource(), viewPath.getCurrent()); + this.detailView.onResourceSelected(resourceComposite); + } + + + public void setContent(Canvas newContent) { + if (contentCanvas.getChildren().length > 0) + contentCanvas.getChildren()[0].destroy(); + contentCanvas.addChild(newContent); + contentCanvas.markForRedraw(); + } + + + public void renderView(ViewPath viewPath) { + if (viewPath.isEnd()) { + // default detail view + viewPath.getViewPath().add(new ViewId("Summary")); + viewPath.getViewPath().add(new ViewId("Overview")); + } + + Integer resourceId = Integer.parseInt(viewPath.getCurrent().getPath()); + + if (currentResource == null || currentResource.getResource().getId() != resourceId) { + // The previous history item did not already point to this Resource. + setSelectedResource(resourceId, viewPath); + } + + viewPath.next(); + this.treeView.renderView(viewPath); + this.detailView.renderView(viewPath); + } + +} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceView.java deleted file mode 100644 index 39e748f..0000000 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceView.java +++ /dev/null @@ -1,160 +0,0 @@ -/* - * RHQ Management Platform - * Copyright (C) 2005-2010 Red Hat, Inc. - * All rights reserved. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation version 2 of the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ -package org.rhq.enterprise.gui.coregui.client.inventory.resource.detail; - -import com.google.gwt.user.client.rpc.AsyncCallback; -import com.smartgwt.client.widgets.Canvas; -import com.smartgwt.client.widgets.layout.HLayout; - -import org.rhq.core.domain.criteria.ResourceCriteria; -import org.rhq.core.domain.resource.Resource; -import org.rhq.core.domain.resource.ResourceType; -import org.rhq.core.domain.resource.composite.ResourceComposite; -import org.rhq.core.domain.util.PageList; -import org.rhq.enterprise.gui.coregui.client.BookmarkableView; -import org.rhq.enterprise.gui.coregui.client.CoreGUI; -import org.rhq.enterprise.gui.coregui.client.ViewId; -import org.rhq.enterprise.gui.coregui.client.ViewPath; -import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup; -import org.rhq.enterprise.gui.coregui.client.gwt.ResourceGWTServiceAsync; -import org.rhq.enterprise.gui.coregui.client.inventory.resource.InventoryView; -import org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTypeRepository; -import org.rhq.enterprise.gui.coregui.client.util.message.Message; - -import java.util.EnumSet; - -/** - * @author Greg Hinkle - */ -public class ResourceView extends HLayout implements BookmarkableView { - - private Canvas contentCanvas; - - private ResourceComposite currentResource; - //private Resource resourcePlatform; - - private ResourceTreeView treeView; - private ResourceDetailView detailView = new ResourceDetailView(); - - private ResourceGWTServiceAsync resourceService = GWTServiceLookup.getResourceService(); - - - public ResourceView() { - - } - - @Override - protected void onInit() { - super.onInit(); - - setWidth100(); - setHeight100(); - - treeView = new ResourceTreeView(); - addMember(treeView); - - contentCanvas = new Canvas(); - addMember(contentCanvas); - - // created above -// detailView = new ResourceDetailView(); - - treeView.addResourceSelectListener(detailView); - - setContent(detailView); - } - - - public void setSelectedResource(final int resourceId, final ViewPath view) { - ResourceCriteria criteria = new ResourceCriteria(); - criteria.addFilterId(resourceId); - criteria.fetchTags(true); - //criteria.fetchParentResource(true); - resourceService.findResourceCompositesByCriteria(criteria, new AsyncCallback<PageList<ResourceComposite>>() { - public void onFailure(Throwable caught) { - CoreGUI.getMessageCenter().notify(new Message("Resource with id [" + resourceId + - "] does not exist or is not accessible.", Message.Severity.Warning)); - - CoreGUI.goTo(InventoryView.VIEW_PATH); - } - - public void onSuccess(PageList<ResourceComposite> result) { - if (result.isEmpty()) { - //noinspection ThrowableInstanceNeverThrown - onFailure(new Exception("Resource with id [" + resourceId + "] does not exist.")); - } else { - final ResourceComposite resourceComposite = result.get(0); - loadResourceType(resourceComposite, view); - } - } - }); - } - - - private void loadResourceType(final ResourceComposite resourceComposite, final ViewPath view) { - final Resource resource = resourceComposite.getResource(); - ResourceTypeRepository.Cache.getInstance().getResourceTypes( - resource.getResourceType().getId(), - EnumSet.of(ResourceTypeRepository.MetadataType.content, ResourceTypeRepository.MetadataType.operations, - ResourceTypeRepository.MetadataType.events, - ResourceTypeRepository.MetadataType.resourceConfigurationDefinition), - new ResourceTypeRepository.TypeLoadedCallback() { - public void onTypesLoaded(ResourceType type) { - resource.setResourceType(type); - completeSetSelectedResource(resourceComposite, view); - } - }); - } - - - private void completeSetSelectedResource(ResourceComposite resourceComposite, ViewPath viewPath) { - this.currentResource = resourceComposite; - this.treeView.setSelectedResource(resourceComposite.getResource(), viewPath.getCurrent()); - this.detailView.onResourceSelected(resourceComposite); - } - - - public void setContent(Canvas newContent) { - if (contentCanvas.getChildren().length > 0) - contentCanvas.getChildren()[0].destroy(); - contentCanvas.addChild(newContent); - contentCanvas.markForRedraw(); - } - - - public void renderView(ViewPath viewPath) { - if (viewPath.isEnd()) { - // default detail view - viewPath.getViewPath().add(new ViewId("Summary")); - viewPath.getViewPath().add(new ViewId("Overview")); - } - - Integer resourceId = Integer.parseInt(viewPath.getCurrent().getPath()); - - if (currentResource == null || currentResource.getResource().getId() != resourceId) { - // The previous history item did not already point to this Resource. - setSelectedResource(resourceId, viewPath); - } - - viewPath.next(); - this.treeView.renderView(viewPath); - this.detailView.renderView(viewPath); - } - -} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/overview/ResourceOverviewView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/overview/ResourceOverviewView.java deleted file mode 100644 index 92cd3ff..0000000 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/overview/ResourceOverviewView.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * RHQ Management Platform - * Copyright (C) 2005-2010 Red Hat, Inc. - * All rights reserved. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation version 2 of the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ -package org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.overview; - -import com.smartgwt.client.widgets.layout.VLayout; - -import org.rhq.core.domain.resource.composite.ResourceComposite; -import org.rhq.enterprise.gui.coregui.client.components.FullHTMLPane; -import org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceSelectListener; - -/** - * @author Greg Hinkle - */ -public class ResourceOverviewView extends VLayout implements ResourceSelectListener { - private ResourceSummaryView summaryView; - private FullHTMLPane summaryPane; - private ResourceComposite resourceComposite; - - public ResourceOverviewView(ResourceComposite resourceComposite) { - this.resourceComposite = resourceComposite; - } - - @Override - protected void onDraw() { - super.onDraw(); - - this.summaryView = new ResourceSummaryView(); - addMember(this.summaryView); - - this.summaryPane = new FullHTMLPane(); - addMember(this.summaryPane); - - if (this.resourceComposite != null) { - onResourceSelected(this.resourceComposite); - } - } - - @Override - public void onResourceSelected(ResourceComposite resourceComposite) { - this.resourceComposite = resourceComposite; - this.summaryView.onResourceSelected(resourceComposite); - this.summaryPane.setContentsURL("/rhq/resource/summary/overview-plain.xhtml?id=" - + resourceComposite.getResource().getId()); - } -} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/overview/ResourceSummaryView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/overview/ResourceSummaryView.java deleted file mode 100644 index 4d98f82..0000000 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/overview/ResourceSummaryView.java +++ /dev/null @@ -1,289 +0,0 @@ -/* - * RHQ Management Platform - * Copyright (C) 2005-2010 Red Hat, Inc. - * All rights reserved. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation version 2 of the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ -package org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.overview; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.Comparator; -import java.util.EnumSet; -import java.util.List; - -import com.google.gwt.user.client.rpc.AsyncCallback; -import com.smartgwt.client.util.SC; -import com.smartgwt.client.widgets.form.fields.FormItem; -import com.smartgwt.client.widgets.form.fields.HeaderItem; -import com.smartgwt.client.widgets.form.fields.SpacerItem; -import com.smartgwt.client.widgets.form.fields.StaticTextItem; - -import org.rhq.core.domain.measurement.DataType; -import org.rhq.core.domain.measurement.DisplayType; -import org.rhq.core.domain.measurement.MeasurementDataTrait; -import org.rhq.core.domain.measurement.MeasurementDefinition; -import org.rhq.core.domain.resource.Resource; -import org.rhq.core.domain.resource.ResourceType; -import org.rhq.core.domain.resource.composite.ResourceComposite; -import org.rhq.enterprise.gui.coregui.client.CoreGUI; -import org.rhq.enterprise.gui.coregui.client.components.form.EnhancedDynamicForm; -import org.rhq.enterprise.gui.coregui.client.components.form.TogglableTextItem; -import org.rhq.enterprise.gui.coregui.client.components.form.ValueUpdatedHandler; -import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup; -import org.rhq.enterprise.gui.coregui.client.gwt.ResourceGWTServiceAsync; -import org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceSelectListener; -import org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTypeRepository; -import org.rhq.enterprise.gui.coregui.client.util.message.Message; - -/** - * @author Greg Hinkle - * @author Ian Springer - */ -public class ResourceSummaryView extends EnhancedDynamicForm implements ResourceSelectListener { - - private ResourceGWTServiceAsync resourceService = GWTServiceLookup.getResourceService(); - private ResourceComposite resourceComposite; - - @Override - protected void onDraw() { - super.onDraw(); - - setLeft("10%"); - setWidth("80%"); - } - - - public void onResourceSelected(ResourceComposite resourceComposite) { - - this.resourceComposite = resourceComposite; - Resource resource = resourceComposite.getResource(); - - // Load metric defs. - ResourceTypeRepository.Cache.getInstance().getResourceTypes(resource.getResourceType().getId(), - EnumSet.of(ResourceTypeRepository.MetadataType.measurements), - new ResourceTypeRepository.TypeLoadedCallback() { - public void onTypesLoaded(ResourceType type) { - try { - buildForm(type); - loadTraitValues(); - } catch (Exception e) { - SC.say("Form load failure"); - e.printStackTrace(); - } - } - }); - } - - private void loadTraitValues() { - final Resource resource = resourceComposite.getResource(); - GWTServiceLookup.getMeasurementDataService().findCurrentTraitsForResource( - resource.getId(), - DisplayType.SUMMARY, - new AsyncCallback<List<MeasurementDataTrait>>() { - public void onFailure(Throwable caught) { - CoreGUI.getErrorHandler().handleError("Failed to load traits for " + resource + ".", - caught); - } - - public void onSuccess(List<MeasurementDataTrait> result) { - // TODO: Implement this method. - for (MeasurementDataTrait trait : result) { - String formId = trait.getName().replaceAll("\.", "_").replaceAll(" ", "__"); - FormItem item = getItem(formId); - - if (item != null) { - setValue(formId, trait.getValue()); - } - } - markForRedraw(); - } - } - ); - - } - - private void buildForm(ResourceType type) { - List<MeasurementDefinition> traits = new ArrayList<MeasurementDefinition>(); - - for (MeasurementDefinition measurement : type.getMetricDefinitions()) { - if (measurement.getDataType() == DataType.TRAIT && measurement.getDisplayType() == DisplayType.SUMMARY) { - traits.add(measurement); - } - } - - Collections.sort(traits, new Comparator<MeasurementDefinition>() { - public int compare(MeasurementDefinition o1, MeasurementDefinition o2) { - return new Integer(o1.getDisplayOrder()).compareTo(o2.getDisplayOrder()); - } - }); - - List<FormItem> formItems = new ArrayList<FormItem>(); - - HeaderItem headerItem = new HeaderItem("header", "Summary"); - headerItem.setValue("Summary"); - formItems.add(headerItem); - - StaticTextItem typeItem = new StaticTextItem("type", "Type"); - typeItem.setTooltip("Plugin: " + type.getPlugin() + "\n<br>" + "Type: " + type.getName()); - typeItem.setValue(type.getName() + " (" + type.getPlugin() + ")"); - formItems.add(typeItem); - - final Resource resource = this.resourceComposite.getResource(); - boolean modifiable = this.resourceComposite.getResourcePermission().isInventory(); - - final FormItem nameItem = (modifiable) ? new TogglableTextItem() : new StaticTextItem(); - nameItem.setName("name"); - nameItem.setTitle("Name"); - nameItem.setValue(resource.getName()); - if (nameItem instanceof TogglableTextItem) { - TogglableTextItem togglableNameItem = (TogglableTextItem) nameItem; - togglableNameItem.addValueUpdatedHandler(new ValueUpdatedHandler() { - public void onValueUpdated(final String newName) { - final String oldName = resource.getName(); - if (newName.equals(oldName)) { - return; - } - resource.setName(newName); - ResourceSummaryView.this.resourceService.updateResource(resource, new AsyncCallback<Void>() { - public void onFailure(Throwable caught) { - CoreGUI.getErrorHandler().handleError("Failed to change name of Resource with id " - + resource.getId() - + " from "" + oldName + "" to "" + newName + "".", caught); - // We failed to update it on the Server, so change back the Resource and the form item to - // the original value. - resource.setName(oldName); - nameItem.setValue(oldName); - } - - public void onSuccess(Void result) { - CoreGUI.getMessageCenter().notify(new Message("Name of Resource with id " - + resource.getId() + " was changed from "" - + oldName + "" to "" + newName + "".", Message.Severity.Info)); - } - }); - } - }); - } - formItems.add(nameItem); - - final FormItem descriptionItem = (modifiable) ? new TogglableTextItem() : new StaticTextItem(); - descriptionItem.setName("description"); - descriptionItem.setTitle("Description"); - descriptionItem.setValue(resource.getDescription()); - if (descriptionItem instanceof TogglableTextItem) { - TogglableTextItem togglableDescriptionItem = (TogglableTextItem) descriptionItem; - togglableDescriptionItem.addValueUpdatedHandler(new ValueUpdatedHandler() { - public void onValueUpdated(final String newDescription) { - final String oldDescription = resource.getDescription(); - if (newDescription.equals(oldDescription)) { - return; - } - resource.setDescription(newDescription); - ResourceSummaryView.this.resourceService.updateResource(resource, new AsyncCallback<Void>() { - public void onFailure(Throwable caught) { - CoreGUI.getErrorHandler().handleError("Failed to change description of Resource with id " - + resource.getId() - + " from "" + oldDescription + "" to "" + newDescription + "".", caught); - // We failed to update it on the Server, so change back the Resource and the form item to - // the original value. - resource.setDescription(oldDescription); - descriptionItem.setValue(oldDescription); - } - - public void onSuccess(Void result) { - CoreGUI.getMessageCenter().notify(new Message("Description of Resource with id " - + resource.getId() + " was changed from "" - + oldDescription + "" to "" + newDescription + "".", Message.Severity.Info)); - } - }); - } - }); - } - formItems.add(descriptionItem); - - final FormItem locationItem = (modifiable) ? new TogglableTextItem() : new StaticTextItem(); - locationItem.setName("location"); - locationItem.setTitle("Location"); - locationItem.setValue(resource.getLocation()); - if (locationItem instanceof TogglableTextItem) { - TogglableTextItem togglableNameItem = (TogglableTextItem) locationItem; - togglableNameItem.addValueUpdatedHandler(new ValueUpdatedHandler() { - public void onValueUpdated(final String newLocation) { - final String oldLocation = resource.getLocation(); - if (newLocation.equals(oldLocation)) { - return; - } - resource.setLocation(newLocation); - ResourceSummaryView.this.resourceService.updateResource(resource, new AsyncCallback<Void>() { - public void onFailure(Throwable caught) { - CoreGUI.getErrorHandler().handleError("Failed to change location of Resource with id " - + resource.getId() - + " from "" + oldLocation + "" to "" + newLocation + "".", caught); - // We failed to update it on the Server, so change back the Resource and the form item to - // the original value. - resource.setLocation(oldLocation); - locationItem.setValue(oldLocation); - } - - public void onSuccess(Void result) { - CoreGUI.getMessageCenter().notify(new Message("Location of Resource with id " - + resource.getId() + " was changed from "" - + oldLocation + "" to "" + newLocation + "".", Message.Severity.Info)); - } - }); - } - }); - } - formItems.add(locationItem); - - - StaticTextItem versionItem = new StaticTextItem("version", "Version"); - formItems.add(versionItem); - - StaticTextItem parentItem = new StaticTextItem("parent", "Parent"); - formItems.add(parentItem); - - for (MeasurementDefinition trait : traits) { - String id = trait.getDisplayName().replaceAll("\.", "_").replaceAll(" ", "__"); - - StaticTextItem item = new StaticTextItem(id, trait.getDisplayName()); - item.setTooltip(trait.getDescription()); - formItems.add(item); -// item.setValue("?"); - } - -// SectionItem section = new SectionItem("Summary", "Summary"); -// section.setTitle("Summary"); -// section.setDefaultValue("Summary"); -// section.setCanCollapse(true); -// section.setCellStyle("HidablePlainSectionHeader"); -// section.setItemIds(itemIds.toArray(new String[itemIds.size()])); -// formItems.add(0, section); - - formItems.add(new SpacerItem()); - setItems(formItems.toArray(new FormItem[formItems.size()])); - - setValue("type", type.getName() + " (" + type.getPlugin() + ")"); - setValue("name", resource.getName()); - setValue("description", resource.getDescription()); - setValue("location", resource.getLocation()); - setValue("version", (resource.getVersion() != null) ? resource.getVersion() : "<i>none</i>"); - Resource parentResource = resource.getParentResource(); - setValue("parent", parentResource != null ? - ("<a href="#Resource/" + parentResource.getId() + "">" + - parentResource.getName() + "</a>") : "<i>none</i>"); - } -} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/summary/DashboardView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/summary/DashboardView.java new file mode 100644 index 0000000..c29deec --- /dev/null +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/summary/DashboardView.java @@ -0,0 +1,52 @@ +/* + * RHQ Management Platform + * Copyright (C) 2005-2010 Red Hat, Inc. + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ +package org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.summary; + +import org.rhq.core.domain.resource.composite.ResourceComposite; +import org.rhq.enterprise.gui.coregui.client.components.FullHTMLPane; +import org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceSelectListener; + +/** + * The Resource Summary>Dashboard tab. + * + * @author Greg Hinkle + */ +public class DashboardView extends FullHTMLPane implements ResourceSelectListener { + private ResourceComposite resourceComposite; + + public DashboardView(ResourceComposite resourceComposite) { + this.resourceComposite = resourceComposite; + } + + @Override + protected void onDraw() { + super.onDraw(); + + if (this.resourceComposite != null) { + onResourceSelected(this.resourceComposite); + } + } + + @Override + public void onResourceSelected(ResourceComposite resourceComposite) { + this.resourceComposite = resourceComposite; + setContentsURL("/rhq/resource/summary/summary-plain.xhtml?id=" + + resourceComposite.getResource().getId()); + } +} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/summary/OverviewView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/summary/OverviewView.java new file mode 100644 index 0000000..ac2abc2 --- /dev/null +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/summary/OverviewView.java @@ -0,0 +1,302 @@ +/* + * RHQ Management Platform + * Copyright (C) 2005-2010 Red Hat, Inc. + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ +package org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.summary; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.EnumSet; +import java.util.List; + +import com.google.gwt.user.client.rpc.AsyncCallback; +import com.smartgwt.client.util.SC; +import com.smartgwt.client.widgets.form.fields.FormItem; +import com.smartgwt.client.widgets.form.fields.HeaderItem; +import com.smartgwt.client.widgets.form.fields.SpacerItem; +import com.smartgwt.client.widgets.form.fields.StaticTextItem; + +import org.rhq.core.domain.measurement.DataType; +import org.rhq.core.domain.measurement.DisplayType; +import org.rhq.core.domain.measurement.MeasurementDataTrait; +import org.rhq.core.domain.measurement.MeasurementDefinition; +import org.rhq.core.domain.resource.Resource; +import org.rhq.core.domain.resource.ResourceType; +import org.rhq.core.domain.resource.composite.ResourceComposite; +import org.rhq.enterprise.gui.coregui.client.CoreGUI; +import org.rhq.enterprise.gui.coregui.client.components.form.EnhancedDynamicForm; +import org.rhq.enterprise.gui.coregui.client.components.form.TogglableTextItem; +import org.rhq.enterprise.gui.coregui.client.components.form.ValueUpdatedHandler; +import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup; +import org.rhq.enterprise.gui.coregui.client.gwt.ResourceGWTServiceAsync; +import org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceSelectListener; +import org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTypeRepository; +import org.rhq.enterprise.gui.coregui.client.util.message.Message; + +/** + * The Resource Summary>Overview tab. + * + * @author Greg Hinkle + * @author Ian Springer + */ +public class OverviewView extends EnhancedDynamicForm implements ResourceSelectListener { + + private ResourceGWTServiceAsync resourceService = GWTServiceLookup.getResourceService(); + private ResourceComposite resourceComposite; + + + public OverviewView(ResourceComposite resourceComposite) { + super(); + this.resourceComposite = resourceComposite; + } + + + @Override + protected void onDraw() { + super.onDraw(); + + setLeft("10%"); + setWidth("80%"); + + if (this.resourceComposite != null) { + onResourceSelected(this.resourceComposite); + } + } + + + public void onResourceSelected(ResourceComposite resourceComposite) { + + this.resourceComposite = resourceComposite; + Resource resource = resourceComposite.getResource(); + + // Load metric defs. + ResourceTypeRepository.Cache.getInstance().getResourceTypes(resource.getResourceType().getId(), + EnumSet.of(ResourceTypeRepository.MetadataType.measurements), + new ResourceTypeRepository.TypeLoadedCallback() { + public void onTypesLoaded(ResourceType type) { + try { + buildForm(type); + loadTraitValues(); + } catch (Exception e) { + SC.say("Form load failure"); + e.printStackTrace(); + } + } + }); + } + + private void loadTraitValues() { + final Resource resource = resourceComposite.getResource(); + GWTServiceLookup.getMeasurementDataService().findCurrentTraitsForResource( + resource.getId(), + DisplayType.SUMMARY, + new AsyncCallback<List<MeasurementDataTrait>>() { + public void onFailure(Throwable caught) { + CoreGUI.getErrorHandler().handleError("Failed to load traits for " + resource + ".", + caught); + } + + public void onSuccess(List<MeasurementDataTrait> result) { + // TODO: Implement this method. + for (MeasurementDataTrait trait : result) { + String formId = trait.getName().replaceAll("\.", "_").replaceAll(" ", "__"); + FormItem item = getItem(formId); + + if (item != null) { + setValue(formId, trait.getValue()); + } + } + markForRedraw(); + } + } + ); + + } + + private void buildForm(ResourceType type) { + List<MeasurementDefinition> traits = new ArrayList<MeasurementDefinition>(); + + for (MeasurementDefinition measurement : type.getMetricDefinitions()) { + if (measurement.getDataType() == DataType.TRAIT && measurement.getDisplayType() == DisplayType.SUMMARY) { + traits.add(measurement); + } + } + + Collections.sort(traits, new Comparator<MeasurementDefinition>() { + public int compare(MeasurementDefinition o1, MeasurementDefinition o2) { + return new Integer(o1.getDisplayOrder()).compareTo(o2.getDisplayOrder()); + } + }); + + List<FormItem> formItems = new ArrayList<FormItem>(); + + HeaderItem headerItem = new HeaderItem("header", "Summary"); + headerItem.setValue("Summary"); + formItems.add(headerItem); + + StaticTextItem typeItem = new StaticTextItem("type", "Type"); + typeItem.setTooltip("Plugin: " + type.getPlugin() + "\n<br>" + "Type: " + type.getName()); + typeItem.setValue(type.getName() + " (" + type.getPlugin() + ")"); + formItems.add(typeItem); + + final Resource resource = this.resourceComposite.getResource(); + boolean modifiable = this.resourceComposite.getResourcePermission().isInventory(); + + final FormItem nameItem = (modifiable) ? new TogglableTextItem() : new StaticTextItem(); + nameItem.setName("name"); + nameItem.setTitle("Name"); + nameItem.setValue(resource.getName()); + if (nameItem instanceof TogglableTextItem) { + TogglableTextItem togglableNameItem = (TogglableTextItem) nameItem; + togglableNameItem.addValueUpdatedHandler(new ValueUpdatedHandler() { + public void onValueUpdated(final String newName) { + final String oldName = resource.getName(); + if (newName.equals(oldName)) { + return; + } + resource.setName(newName); + OverviewView.this.resourceService.updateResource(resource, new AsyncCallback<Void>() { + public void onFailure(Throwable caught) { + CoreGUI.getErrorHandler().handleError("Failed to change name of Resource with id " + + resource.getId() + + " from "" + oldName + "" to "" + newName + "".", caught); + // We failed to update it on the Server, so change back the Resource and the form item to + // the original value. + resource.setName(oldName); + nameItem.setValue(oldName); + } + + public void onSuccess(Void result) { + CoreGUI.getMessageCenter().notify(new Message("Name of Resource with id " + + resource.getId() + " was changed from "" + + oldName + "" to "" + newName + "".", Message.Severity.Info)); + } + }); + } + }); + } + formItems.add(nameItem); + + final FormItem descriptionItem = (modifiable) ? new TogglableTextItem() : new StaticTextItem(); + descriptionItem.setName("description"); + descriptionItem.setTitle("Description"); + descriptionItem.setValue(resource.getDescription()); + if (descriptionItem instanceof TogglableTextItem) { + TogglableTextItem togglableDescriptionItem = (TogglableTextItem) descriptionItem; + togglableDescriptionItem.addValueUpdatedHandler(new ValueUpdatedHandler() { + public void onValueUpdated(final String newDescription) { + final String oldDescription = resource.getDescription(); + if (newDescription.equals(oldDescription)) { + return; + } + resource.setDescription(newDescription); + OverviewView.this.resourceService.updateResource(resource, new AsyncCallback<Void>() { + public void onFailure(Throwable caught) { + CoreGUI.getErrorHandler().handleError("Failed to change description of Resource with id " + + resource.getId() + + " from "" + oldDescription + "" to "" + newDescription + "".", caught); + // We failed to update it on the Server, so change back the Resource and the form item to + // the original value. + resource.setDescription(oldDescription); + descriptionItem.setValue(oldDescription); + } + + public void onSuccess(Void result) { + CoreGUI.getMessageCenter().notify(new Message("Description of Resource with id " + + resource.getId() + " was changed from "" + + oldDescription + "" to "" + newDescription + "".", Message.Severity.Info)); + } + }); + } + }); + } + formItems.add(descriptionItem); + + final FormItem locationItem = (modifiable) ? new TogglableTextItem() : new StaticTextItem(); + locationItem.setName("location"); + locationItem.setTitle("Location"); + locationItem.setValue(resource.getLocation()); + if (locationItem instanceof TogglableTextItem) { + TogglableTextItem togglableNameItem = (TogglableTextItem) locationItem; + togglableNameItem.addValueUpdatedHandler(new ValueUpdatedHandler() { + public void onValueUpdated(final String newLocation) { + final String oldLocation = resource.getLocation(); + if (newLocation.equals(oldLocation)) { + return; + } + resource.setLocation(newLocation); + OverviewView.this.resourceService.updateResource(resource, new AsyncCallback<Void>() { + public void onFailure(Throwable caught) { + CoreGUI.getErrorHandler().handleError("Failed to change location of Resource with id " + + resource.getId() + + " from "" + oldLocation + "" to "" + newLocation + "".", caught); + // We failed to update it on the Server, so change back the Resource and the form item to + // the original value. + resource.setLocation(oldLocation); + locationItem.setValue(oldLocation); + } + + public void onSuccess(Void result) { + CoreGUI.getMessageCenter().notify(new Message("Location of Resource with id " + + resource.getId() + " was changed from "" + + oldLocation + "" to "" + newLocation + "".", Message.Severity.Info)); + } + }); + } + }); + } + formItems.add(locationItem); + + + StaticTextItem versionItem = new StaticTextItem("version", "Version"); + formItems.add(versionItem); + + StaticTextItem parentItem = new StaticTextItem("parent", "Parent"); + formItems.add(parentItem); + + for (MeasurementDefinition trait : traits) { + String id = trait.getDisplayName().replaceAll("\.", "_").replaceAll(" ", "__"); + + StaticTextItem item = new StaticTextItem(id, trait.getDisplayName()); + item.setTooltip(trait.getDescription()); + formItems.add(item); +// item.setValue("?"); + } + +// SectionItem section = new SectionItem("Summary", "Summary"); +// section.setTitle("Summary"); +// section.setDefaultValue("Summary"); +// section.setCanCollapse(true); +// section.setCellStyle("HidablePlainSectionHeader"); +// section.setItemIds(itemIds.toArray(new String[itemIds.size()])); +// formItems.add(0, section); + + formItems.add(new SpacerItem()); + setItems(formItems.toArray(new FormItem[formItems.size()])); + + setValue("type", type.getName() + " (" + type.getPlugin() + ")"); + setValue("name", resource.getName()); + setValue("description", resource.getDescription()); + setValue("location", resource.getLocation()); + setValue("version", (resource.getVersion() != null) ? resource.getVersion() : "<i>none</i>"); + Resource parentResource = resource.getParentResource(); + setValue("parent", parentResource != null ? + ("<a href="#Resource/" + parentResource.getId() + "">" + + parentResource.getName() + "</a>") : "<i>none</i>"); + } +} diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/common/tag/FunctionTagLibrary.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/common/tag/FunctionTagLibrary.java index 7a5a8d5..e9f24fa 100644 --- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/common/tag/FunctionTagLibrary.java +++ b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/common/tag/FunctionTagLibrary.java @@ -351,7 +351,7 @@ public class FunctionTagLibrary extends AbstractTagLibrary {
// needs to exist separately from getDefaultContextTabURL because only some facelets understand EntityContext public static String getDefaultResourceTabURL() { - return "/rhq/resource/summary/overview.xhtml"; + return "/rhq/resource/summary/summary.xhtml"; }
public static String getDefaultGroupTabURL() { diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/resource/DisambiguatedResourceLineageRenderer.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/resource/DisambiguatedResourceLineageRenderer.java index 60f5031..56d5465 100644 --- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/resource/DisambiguatedResourceLineageRenderer.java +++ b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/resource/DisambiguatedResourceLineageRenderer.java @@ -40,7 +40,7 @@ import org.rhq.core.domain.resource.composite.DisambiguationReport; * @author Lukas Krejci */ public class DisambiguatedResourceLineageRenderer extends Renderer { - private static final String RESOURCE_URL = "/rhq/resource/summary/overview.xhtml"; + private static final String RESOURCE_URL = "/rhq/resource/summary/summary.xhtml";
@Override public void encodeBegin(FacesContext context, UIComponent component) throws IOException { diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/resource/ResourceLineageRenderer.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/resource/ResourceLineageRenderer.java index 94e6614..33310b6 100644 --- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/resource/ResourceLineageRenderer.java +++ b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/resource/ResourceLineageRenderer.java @@ -37,7 +37,7 @@ import org.rhq.enterprise.server.util.LookupUtil; * @author Ian Springer */ public class ResourceLineageRenderer extends Renderer { - private static final String BASE_RESOURCE_URL = "/rhq/resource/summary/overview.xhtml"; + private static final String BASE_RESOURCE_URL = "/rhq/resource/summary/summary.xhtml"; private static final String SEPARATOR = " > ";
private ResourceManagerLocal resourceManager = LookupUtil.getResourceManager(); diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/taglib/InventoryHierarchyTag.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/taglib/InventoryHierarchyTag.java index 5e02e32..4f5bfa9 100644 --- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/taglib/InventoryHierarchyTag.java +++ b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/taglib/InventoryHierarchyTag.java @@ -46,7 +46,7 @@ import org.rhq.enterprise.server.util.LookupUtil; * @author Ian Springer */ public class InventoryHierarchyTag extends TagSupport { - private static final String BASE_RESOURCE_URL = "/rhq/resource/summary/overview.xhtml"; + private static final String BASE_RESOURCE_URL = "/rhq/resource/summary/summary.xhtml";
//private static final String BASE_GROUP_URL = "/Resource.do?type=GROUP"; private static final String BASE_GROUP_URL = "/rhq/group/inventory/view.xhtml"; diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/taglib/display/DisambiguatedResourceNameTag.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/taglib/display/DisambiguatedResourceNameTag.java index 1077aab..2efedc9 100644 --- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/taglib/display/DisambiguatedResourceNameTag.java +++ b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/taglib/display/DisambiguatedResourceNameTag.java @@ -170,6 +170,6 @@ public class DisambiguatedResourceNameTag extends TagSupport { }
public static String getDefaultResourceUrl(int resourceId) { - return "/rhq/resource/summary/overview.xhtml?id=" + resourceId; + return "/rhq/resource/summary/summary.xhtml?id=" + resourceId; } } diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/navigation/group/ResourceGroupTreeContextMenuUIBean.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/navigation/group/ResourceGroupTreeContextMenuUIBean.java index 34fb0a6..4650eef 100644 --- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/navigation/group/ResourceGroupTreeContextMenuUIBean.java +++ b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/navigation/group/ResourceGroupTreeContextMenuUIBean.java @@ -175,7 +175,7 @@ public class ResourceGroupTreeContextMenuUIBean extends TreeContextMenuBase { menuItem.setValue(res.getName()); menuItem.setId("groupMember_" + res.getId());
- String url = "/rhq/resource/summary/overview.xhtml?id=" + res.getId(); + String url = "/rhq/resource/summary/summary.xhtml?id=" + res.getId();
menuItem.setSubmitMode("none"); menuItem.setOnclick("document.location.href='" + url + "'"); diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/perspective/PerspectiveTarget.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/perspective/PerspectiveTarget.java index 3bf4596..0ea233b 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/perspective/PerspectiveTarget.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/perspective/PerspectiveTarget.java @@ -33,7 +33,7 @@ public enum PerspectiveTarget { GROUP_MIXED("/rhq/group/inventory/view.xhtml?category=MIXED&groupId="), // METRIC_TEMPLATE("/admin/platform/monitor/Config.do?mode=configure&id=", false, true), // REPO("/rhq/content/repo.xhtml?mode=view&id="), // - RESOURCE("/rhq/resource/summary/overview.xhtml?id="), // + RESOURCE("/rhq/resource/summary/summary.xhtml?id="), // ROLE("/admin/role/RoleAdmin.do?mode=view&r="), // SERVER("/rhq/ha/viewServer.xhtml?mode=view&serverId="), // USER("/admin/user/UserAdmin.do?mode=view&u="); diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/webservices/WebservicesManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/webservices/WebservicesManagerBean.java index e5f2802..25ffa7b 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/webservices/WebservicesManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/webservices/WebservicesManagerBean.java @@ -835,6 +835,10 @@ public class WebservicesManagerBean implements WebservicesRemote { return resourceManager.uninventoryResources(subject, resourceIds); }
+ public Resource updateResource(Subject subject, Resource resource) { + return resourceManager.updateResource(subject, resource); + } + //RESOURCEMANAGER: END ----------------------------------
//RESOURCEGROUPMANAGER: BEGIN ---------------------------------- diff --git a/modules/plugins/cron/src/main/java/org/rhq/plugins/cron/CronComponent.java b/modules/plugins/cron/src/main/java/org/rhq/plugins/cron/CronComponent.java index ae22c2f..a7cdba4 100644 --- a/modules/plugins/cron/src/main/java/org/rhq/plugins/cron/CronComponent.java +++ b/modules/plugins/cron/src/main/java/org/rhq/plugins/cron/CronComponent.java @@ -45,7 +45,7 @@ import org.rhq.augeas.util.GlobFilter; import org.rhq.plugins.platform.PlatformComponent;
/** - * Provides an overview of all entries in the crontabs split into hourly/daily/weekly/monthly entries. + * Provides an summary of all entries in the crontabs split into hourly/daily/weekly/monthly entries. * Is able to create new cron tabs. * * @author Lukas Krejci diff --git a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/serviceBinding/SetComponent.java b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/serviceBinding/SetComponent.java index 5e02571..024d60d 100644 --- a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/serviceBinding/SetComponent.java +++ b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/serviceBinding/SetComponent.java @@ -192,7 +192,7 @@ public class SetComponent implements ResourceComponent<ManagerComponent>, Config
Configuration bindings = result.getComplexResults();
- //populate the resulting binding map so that the users have overview what the + //populate the resulting binding map so that the users have summary what the //the bindings would look like if this binding set was active. PropertyList resultingBindings = new PropertyList(RESULTING_BINDINGS_PROPERTY); bindings.put(resultingBindings);
commit 38aa7252752eb905b84127662e0149f6d470ba7b Author: Ian Springer ian.springer@redhat.com Date: Fri Aug 13 15:54:55 2010 -0400
get rid of new updateResource*Name, updateResource*Description, and updateResource*Location in resource and group managers, and use updateResource() and updateResourceGroup() instead
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/ResourceSubCategory.java b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/ResourceSubCategory.java index 7714e39..80e92f6 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/ResourceSubCategory.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/ResourceSubCategory.java @@ -50,7 +50,7 @@ import javax.persistence.Table; import org.jetbrains.annotations.NotNull;
/** - * Class representing a sub category, where a sub category is meant to group similar resource types together. + * Class representing a sub category, where a sub category is meant to group similar Resource types together. */ @Entity @SequenceGenerator(name = "SEQ", sequenceName = "RHQ_RESOURCE_SUBCAT_ID_SEQ") @@ -213,7 +213,7 @@ public class ResourceSubCategory implements Comparable<ResourceSubCategory>, Ser }
/** - * Updates the contents of this definition with values from the specified new defintion. The intention is for this + * Updates the contents of this definition with values from the specified new definition. The intention is for this * to be used as a merge between this attached instance and a detached instance. The name and resourceType will NOT * be updated as part of this call; they are used as identifiers and should already be the same if this merge is * being performed. @@ -246,10 +246,9 @@ public class ResourceSubCategory implements Comparable<ResourceSubCategory>, Ser }
public void setChildSubCategories(List<ResourceSubCategory> childSubCategories) { - if (childSubCategories == null) { - throw new IllegalArgumentException("childSubCategories is null."); + if (childSubCategories != null) { + this.childSubCategories = childSubCategories; } - this.childSubCategories = childSubCategories; }
public void setParentSubCategory(ResourceSubCategory parentSubCategory) { diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ResourceGWTService.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ResourceGWTService.java index 53741a9..f92e7d5 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ResourceGWTService.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ResourceGWTService.java @@ -65,10 +65,4 @@ public interface ResourceGWTService extends RemoteService {
void unignoreResources(Integer[] resourceIds);
- void updateResourceName(int resourceId, String name); - - void updateResourceDescription(int resourceId, String description); - - void updateResourceLocation(int resourceId, String location); - } \ No newline at end of file diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ResourceGroupGWTService.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ResourceGroupGWTService.java index 9134199..3d78c78 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ResourceGroupGWTService.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ResourceGroupGWTService.java @@ -46,10 +46,6 @@ public interface ResourceGroupGWTService extends RemoteService {
void deleteResourceGroup(int groupId);
- void updateResourceGroupName(int groupId, String name); - - void updateResourceGroupDescription(int groupId, String description); - - void updateResourceGroupLocation(int groupId, String location); + void updateResourceGroup(ResourceGroup group);
} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/inventory/OverviewView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/inventory/OverviewView.java index e9078cd..01faa2d 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/inventory/OverviewView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/inventory/OverviewView.java @@ -85,13 +85,18 @@ public class OverviewView extends VLayout { togglableNameItem.addValueUpdatedHandler(new ValueUpdatedHandler() { public void onValueUpdated(final String newName) { final String oldName = group.getName(); - OverviewView.this.resourceGroupService.updateResourceGroupName(group.getId(), - newName, new AsyncCallback<Void>() { + if (newName.equals(oldName)) { + return; + } + group.setName(newName); + OverviewView.this.resourceGroupService.updateResourceGroup(group, new AsyncCallback<Void>() { public void onFailure(Throwable caught) { CoreGUI.getErrorHandler().handleError("Failed to change name of Resource group with id " + group.getId() + " from "" + oldName + "" to "" + newName + "".", caught); - // We failed to update it on the Server, so change back the form item to the original value. + // We failed to update it on the Server, so change back the ResourceGroup and the form item + // to the original value. + group.setName(oldName); nameItem.setValue(oldName); }
@@ -99,7 +104,6 @@ public class OverviewView extends VLayout { CoreGUI.getMessageCenter().notify(new Message("Name of Resource group with id " + group.getId() + " was changed from "" + oldName + "" to "" + newName + "".", Message.Severity.Info)); - group.setName(newName); } }); } @@ -131,13 +135,18 @@ public class OverviewView extends VLayout { togglableDescriptionItem.addValueUpdatedHandler(new ValueUpdatedHandler() { public void onValueUpdated(final String newDescription) { final String oldDescription = group.getDescription(); - OverviewView.this.resourceGroupService.updateResourceGroupDescription(group.getId(), - newDescription, new AsyncCallback<Void>() { + if (newDescription.equals(oldDescription)) { + return; + } + group.setDescription(newDescription); + OverviewView.this.resourceGroupService.updateResourceGroup(group, new AsyncCallback<Void>() { public void onFailure(Throwable caught) { CoreGUI.getErrorHandler().handleError("Failed to change description of Resource group with id " + group.getId() + " from "" + oldDescription + "" to "" + newDescription + "".", caught); - // We failed to update it on the Server, so change back the form item to the original value. + // We failed to update it on the Server, so change back the ResourceGroup and the form item + // to the original value. + group.setDescription(oldDescription); descriptionItem.setValue(oldDescription); }
@@ -145,7 +154,6 @@ public class OverviewView extends VLayout { CoreGUI.getMessageCenter().notify(new Message("Description of Resource group with id " + group.getId() + " was changed from "" + oldDescription + "" to "" + newDescription + "".", Message.Severity.Info)); - group.setDescription(newDescription); } }); } @@ -162,13 +170,18 @@ public class OverviewView extends VLayout { togglableLocationItem.addValueUpdatedHandler(new ValueUpdatedHandler() { public void onValueUpdated(final String newLocation) { final String oldLocation = group.getLocation(); - OverviewView.this.resourceGroupService.updateResourceGroupLocation(group.getId(), - newLocation, new AsyncCallback<Void>() { + if (newLocation.equals(oldLocation)) { + return; + } + group.setLocation(newLocation); + OverviewView.this.resourceGroupService.updateResourceGroup(group, new AsyncCallback<Void>() { public void onFailure(Throwable caught) { CoreGUI.getErrorHandler().handleError("Failed to change location of Resource group with id " + group.getId() + " from "" + oldLocation + "" to "" + newLocation + "".", caught); - // We failed to update it on the Server, so change back the form item to the original value. + // We failed to update it on the Server, so change back the ResourceGroup and the form item + // to the original value. + group.setLocation(oldLocation); locationItem.setValue(oldLocation); }
@@ -176,7 +189,6 @@ public class OverviewView extends VLayout { CoreGUI.getMessageCenter().notify(new Message("Location of Resource group with id " + group.getId() + " was changed from "" + oldLocation + "" to "" + newLocation + "".", Message.Severity.Info)); - group.setLocation(newLocation); } }); } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/overview/ResourceSummaryView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/overview/ResourceSummaryView.java index 56f84b6..4d98f82 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/overview/ResourceSummaryView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/overview/ResourceSummaryView.java @@ -50,6 +50,7 @@ import org.rhq.enterprise.gui.coregui.client.util.message.Message;
/** * @author Greg Hinkle + * @author Ian Springer */ public class ResourceSummaryView extends EnhancedDynamicForm implements ResourceSelectListener {
@@ -152,13 +153,18 @@ public class ResourceSummaryView extends EnhancedDynamicForm implements Resource togglableNameItem.addValueUpdatedHandler(new ValueUpdatedHandler() { public void onValueUpdated(final String newName) { final String oldName = resource.getName(); - ResourceSummaryView.this.resourceService.updateResourceName(resource.getId(), - newName, new AsyncCallback<Void>() { + if (newName.equals(oldName)) { + return; + } + resource.setName(newName); + ResourceSummaryView.this.resourceService.updateResource(resource, new AsyncCallback<Void>() { public void onFailure(Throwable caught) { CoreGUI.getErrorHandler().handleError("Failed to change name of Resource with id " + resource.getId() + " from "" + oldName + "" to "" + newName + "".", caught); - // We failed to update it on the Server, so change back the form item to the original value. + // We failed to update it on the Server, so change back the Resource and the form item to + // the original value. + resource.setName(oldName); nameItem.setValue(oldName); }
@@ -166,7 +172,6 @@ public class ResourceSummaryView extends EnhancedDynamicForm implements Resource CoreGUI.getMessageCenter().notify(new Message("Name of Resource with id " + resource.getId() + " was changed from "" + oldName + "" to "" + newName + "".", Message.Severity.Info)); - resource.setName(newName); } }); } @@ -183,13 +188,18 @@ public class ResourceSummaryView extends EnhancedDynamicForm implements Resource togglableDescriptionItem.addValueUpdatedHandler(new ValueUpdatedHandler() { public void onValueUpdated(final String newDescription) { final String oldDescription = resource.getDescription(); - ResourceSummaryView.this.resourceService.updateResourceDescription(resource.getId(), - newDescription, new AsyncCallback<Void>() { + if (newDescription.equals(oldDescription)) { + return; + } + resource.setDescription(newDescription); + ResourceSummaryView.this.resourceService.updateResource(resource, new AsyncCallback<Void>() { public void onFailure(Throwable caught) { CoreGUI.getErrorHandler().handleError("Failed to change description of Resource with id " + resource.getId() + " from "" + oldDescription + "" to "" + newDescription + "".", caught); - // We failed to update it on the Server, so change back the form item to the original value. + // We failed to update it on the Server, so change back the Resource and the form item to + // the original value. + resource.setDescription(oldDescription); descriptionItem.setValue(oldDescription); }
@@ -197,7 +207,6 @@ public class ResourceSummaryView extends EnhancedDynamicForm implements Resource CoreGUI.getMessageCenter().notify(new Message("Description of Resource with id " + resource.getId() + " was changed from "" + oldDescription + "" to "" + newDescription + "".", Message.Severity.Info)); - resource.setDescription(newDescription); } }); } @@ -214,13 +223,18 @@ public class ResourceSummaryView extends EnhancedDynamicForm implements Resource togglableNameItem.addValueUpdatedHandler(new ValueUpdatedHandler() { public void onValueUpdated(final String newLocation) { final String oldLocation = resource.getLocation(); - ResourceSummaryView.this.resourceService.updateResourceLocation(resource.getId(), - newLocation, new AsyncCallback<Void>() { + if (newLocation.equals(oldLocation)) { + return; + } + resource.setLocation(newLocation); + ResourceSummaryView.this.resourceService.updateResource(resource, new AsyncCallback<Void>() { public void onFailure(Throwable caught) { CoreGUI.getErrorHandler().handleError("Failed to change location of Resource with id " + resource.getId() + " from "" + oldLocation + "" to "" + newLocation + "".", caught); - // We failed to update it on the Server, so change back the form item to the original value. + // We failed to update it on the Server, so change back the Resource and the form item to + // the original value. + resource.setLocation(oldLocation); locationItem.setValue(oldLocation); }
@@ -228,7 +242,6 @@ public class ResourceSummaryView extends EnhancedDynamicForm implements Resource CoreGUI.getMessageCenter().notify(new Message("Location of Resource with id " + resource.getId() + " was changed from "" + oldLocation + "" to "" + newLocation + "".", Message.Severity.Info)); - resource.setLocation(newLocation); } }); } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ResourceGWTServiceImpl.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ResourceGWTServiceImpl.java index 56d91bd..c10254e 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ResourceGWTServiceImpl.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ResourceGWTServiceImpl.java @@ -127,7 +127,9 @@ public class ResourceGWTServiceImpl extends AbstractGWTServiceImpl implements Re criteria); List<Resource> resources = new ArrayList<Resource>(result.size());
- ObjectFilter.filterFieldsInCollection(resources, importantFieldsSet); + if (resources.size() > 1) { + ObjectFilter.filterFieldsInCollection(resources, importantFieldsSet); + }
return SerialUtility.prepare(result, "ResourceService.findResourceCompositesByCriteria"); } catch (Exception e) { @@ -212,16 +214,5 @@ public class ResourceGWTServiceImpl extends AbstractGWTServiceImpl implements Re public void unignoreResources(Integer[] resourceIds) { discoveryBoss.unignoreResources(getSessionSubject(), resourceIds); } - - public void updateResourceName(int resourceId, String name) { - resourceManager.updateResourceName(getSessionSubject(), resourceId, name); - } - - public void updateResourceDescription(int resourceId, String description) { - resourceManager.updateResourceDescription(getSessionSubject(), resourceId, description); - } - - public void updateResourceLocation(int resourceId, String location) { - resourceManager.updateResourceLocation(getSessionSubject(), resourceId, location); - } + } \ No newline at end of file diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ResourceGroupGWTServiceImpl.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ResourceGroupGWTServiceImpl.java index d4dd777..31a4381 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ResourceGroupGWTServiceImpl.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ResourceGroupGWTServiceImpl.java @@ -31,7 +31,6 @@ import org.rhq.enterprise.server.resource.group.ResourceGroupManagerLocal; import org.rhq.enterprise.server.resource.group.definition.GroupDefinitionManagerLocal; import org.rhq.enterprise.server.util.LookupUtil;
- /** * @author Greg Hinkle */ @@ -75,15 +74,8 @@ public class ResourceGroupGWTServiceImpl extends AbstractGWTServiceImpl implemen } }
- public void updateResourceGroupName(int groupId, String name) { - groupManager.updateResourceGroupName(getSessionSubject(), groupId, name); - } - - public void updateResourceGroupDescription(int groupId, String description) { - groupManager.updateResourceGroupDescription(getSessionSubject(), groupId, description); + public void updateResourceGroup(ResourceGroup group) { + groupManager.updateResourceGroup(getSessionSubject(), group); }
- public void updateResourceGroupLocation(int groupId, String location) { - groupManager.updateResourceGroupLocation(getSessionSubject(), groupId, location); - } } \ No newline at end of file diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationManagerBean.java index 5051bdf..cb17046 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationManagerBean.java @@ -285,6 +285,16 @@ public class ConfigurationManagerBean implements ConfigurationManagerLocal, Conf return result; }
+ // local only + public void setResourceConfiguration(int resourceId, Configuration configuration) { + Resource resource = entityManager.find(Resource.class, resourceId); + if (resource == null) { + throw new ResourceNotFoundException("Resource [" + resourceId + "] does not exist."); + } + resource.setResourceConfiguration(configuration); + entityManager.merge(resource); + } + // Use new transaction because this only works if the resource in question has not // yet been loaded by Hibernate. We want the query to return a non-proxied configuration, // this is critical for remote API use. @@ -2032,7 +2042,6 @@ public class ConfigurationManagerBean implements ConfigurationManagerLocal, Conf }
- @SuppressWarnings("unchecked") public PageList<ResourceConfigurationUpdate> findResourceConfigurationUpdatesByCriteria( Subject subject, ResourceConfigurationUpdateCriteria criteria) { @@ -2047,7 +2056,15 @@ public class ConfigurationManagerBean implements ConfigurationManagerLocal, Conf
PageList<ResourceConfigurationUpdate> updates = queryRunner.execute();
- return updates; } + + + // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + // + // Remote Interface Impl + // + // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + + // ***TODO***: Move all remoted methods below this line. } diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationManagerLocal.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationManagerLocal.java index 495583e..fc61a48 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationManagerLocal.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationManagerLocal.java @@ -490,6 +490,15 @@ public interface ConfigurationManagerLocal { Configuration getResourceConfiguration(Subject subject, int resourceId);
/** + * This method is called when the plugin container reports a new Resource configuration after an external change was + * detected. + * + * @param resourceId the Resource's id + * @param configuration the updated configuration + */ + void setResourceConfiguration(int resourceId, Configuration configuration); + + /** * @see ConfigurationManagerRemote#getPackageTypeConfigurationDefinition(Subject,int) */ ConfigurationDefinition getPackageTypeConfigurationDefinition(Subject subject, int packageTypeId); diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationServerServiceImpl.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationServerServiceImpl.java index 8932607..6ae1e16 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationServerServiceImpl.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationServerServiceImpl.java @@ -1,6 +1,6 @@ /* * RHQ Management Platform - * Copyright (C) 2005-2008 Red Hat, Inc. + * Copyright (C) 2005-2010 Red Hat, Inc. * All rights reserved. * * This program is free software; you can redistribute it and/or modify @@ -81,7 +81,10 @@ public class ConfigurationServerServiceImpl implements ConfigurationServerServic }
Resource resource = update.getResource(); - resource.setResourceConfiguration(update.getConfiguration().deepCopy(false)); + // First clone the config, zeroing out all id's. + Configuration configuration = update.getConfiguration().deepCopy(false); + configurationManager.setResourceConfiguration(resource.getId(), configuration); + resource.setResourceConfiguration(configuration); resourceManager.updateResource(overlord, resource); } } \ No newline at end of file diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerBean.java index 4804a73..7c34f0d 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerBean.java @@ -206,14 +206,29 @@ public class ResourceManagerBean implements ResourceManagerLocal, ResourceManage }
public Resource updateResource(Subject user, Resource resource) { + Resource persistedResource = entityManager.find(Resource.class, resource.getId()); + if (persistedResource == null) { + throw new ResourceNotFoundException(resource.getId()); + } + if (!authorizationManager.hasResourcePermission(user, Permission.MODIFY_RESOURCE, resource.getId())) { - throw new PermissionException("You do not have permission to modify resource"); + throw new PermissionException("You do not have permission to modify Resource with id " + resource.getId() + + "."); }
/*if (getResourceByParentAndKey(user, resource.getParentResource(), resource.getResourceKey()) != null) * { throw new ResourceAlreadyExistsException("Resource with key '" + resource.getName() + "' already * exists");}*/ - return entityManager.merge(resource); + + persistedResource.setName(resource.getName()); + persistedResource.setLocation(resource.getLocation()); + persistedResource.setDescription(resource.getDescription()); + + // NOTE: Updating the mtime will tell the Agent it needs to sync this Resource. + persistedResource.setMtime(System.currentTimeMillis()); + persistedResource.setModifiedBy(user.getName()); + + return entityManager.merge(persistedResource); }
public List<Integer> uninventoryResources(Subject user, int[] resourceIds) { @@ -2155,39 +2170,4 @@ public class ResourceManagerBean implements ResourceManagerLocal, ResourceManage DisambiguationUpdateStrategy updateStrategy) { return Disambiguator.disambiguate(results, updateStrategy, extractor, entityManager); } - - public void updateResourceName(Subject subject, int resourceId, String name) { - if (name == null) { - throw new IllegalArgumentException("Resource name cannot be null."); - } - Resource resource = getResourceToBeModified(subject, resourceId); - resource.setName(name); - resource.setMtime(System.currentTimeMillis()); - } - - public void updateResourceDescription(Subject subject, int resourceId, String description) { - Resource resource = getResourceToBeModified(subject, resourceId); - resource.setDescription(description); - resource.setMtime(System.currentTimeMillis()); - } - - public void updateResourceLocation(Subject subject, int resourceId, String location) { - Resource resource = getResourceToBeModified(subject, resourceId); - resource.setLocation(location); - resource.setMtime(System.currentTimeMillis()); - } - - private Resource getResourceToBeModified(Subject subject, int resourceId) { - Resource resource = entityManager.find(Resource.class, resourceId); - - if (resource == null) { - throw new ResourceNotFoundException(resourceId); - } - - if (!authorizationManager.hasResourcePermission(subject, Permission.MODIFY_RESOURCE, resourceId)) { - throw new PermissionException("User [" + subject + "] does not have permission to modify Resource with id [" - + resourceId + "]."); - } - return resource; - } } diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerLocal.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerLocal.java index 3dd1fcb..d753c89 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerLocal.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerLocal.java @@ -74,10 +74,10 @@ public interface ResourceManagerLocal { void createResource(Subject user, Resource resource, int parentId) throws ResourceAlreadyExistsException;
/** - * Update an existing Resource. + * Update a Resource's editable properties (name, description, and location). * - * @param user the user updating the resource - * @param resource the resource to be updated + * @param user the user updating the Resource + * @param resource the Resource to be updated * @return the updated (attached) resource */ Resource updateResource(Subject user, Resource resource); @@ -386,7 +386,7 @@ public interface ResourceManagerLocal { * view of the platform inventory. This includes resource type and subcategory information * as well as current availability and structure. * - * This method also returns placesholder {@link org.rhq.core.domain.resource.composite.LockedResourcerce} + * This method also returns placesholder {@link org.rhq.core.domain.resource.composite.LockedResource} * objects for resources that a user should not have visibility to in order to keep the tree a * directed graph. * @@ -455,10 +455,4 @@ public interface ResourceManagerLocal { */ <T> ResourceNamesDisambiguationResult<T> disambiguate(List<T> results, IntExtractor<? super T> resourceIdExtractor, DisambiguationUpdateStrategy updateStrategy); - - void updateResourceName(Subject subject, int resourceId, String name); - - void updateResourceDescription(Subject subject, int resourceId, String description); - - void updateResourceLocation(Subject subject, int resourceId, String location); } \ No newline at end of file diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerRemote.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerRemote.java index 2eb9d62..b3fbce0 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerRemote.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerRemote.java @@ -100,6 +100,10 @@ public interface ResourceManagerRemote { @WebParam(name = "subject") Subject subject, // @WebParam(name = "resourceId") int resourceId);
+ Resource updateResource( // + @WebParam(name = "subject") Subject user, // + @WebParam(name = "resource") Resource resource); + /** * Removes these resources from inventory. The resources may subsequently be rediscovered. Note that for * each specified resource all children will also be removed, it it not necessary or recommended to @@ -137,22 +141,4 @@ public interface ResourceManagerRemote { Resource getParentResource( // @WebParam(name = "subject") Subject subject, // @WebParam(name = "resourceId") int resourceId); - - @WebMethod - void updateResourceName( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "resourceId") int resourceId, // - @WebParam(name = "name") String name); - - @WebMethod - void updateResourceDescription( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "resourceId") int resourceId, // - @WebParam(name = "description") String description); - - @WebMethod - void updateResourceLocation( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "resourceId") int resourceId, // - @WebParam(name = "location") String location); } \ No newline at end of file diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceNotFoundException.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceNotFoundException.java index 7c31d96..946d7e3 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceNotFoundException.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceNotFoundException.java @@ -35,7 +35,7 @@ public class ResourceNotFoundException extends RuntimeException { * @param resourceId a resource id */ public ResourceNotFoundException(int resourceId) { - super("A resource with id " + resourceId + " does not exist in inventory."); + super("A Resource with id " + resourceId + " does not exist in inventory."); }
public ResourceNotFoundException(String message) { diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerBean.java index 987015b..43c6f0f 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerBean.java @@ -90,7 +90,6 @@ import org.rhq.enterprise.server.jaxb.adapter.ResourceGroupAdapter; import org.rhq.enterprise.server.operation.GroupOperationSchedule; import org.rhq.enterprise.server.operation.OperationManagerLocal; import org.rhq.enterprise.server.resource.ResourceManagerLocal; -import org.rhq.enterprise.server.resource.ResourceNotFoundException; import org.rhq.enterprise.server.resource.ResourceTypeManagerLocal; import org.rhq.enterprise.server.util.CriteriaQueryGenerator; import org.rhq.enterprise.server.util.CriteriaQueryRunner; @@ -175,9 +174,17 @@ public class ResourceGroupManagerBean implements ResourceGroupManagerLocal, Reso throws ResourceGroupUpdateException {
int groupId = group.getId(); + ResourceGroup attachedGroup = entityManager.find(ResourceGroup.class, groupId); + if (attachedGroup == null) { + throw new ResourceGroupNotFoundException(groupId); + } + + if (!authorizationManager.hasGroupPermission(user, Permission.MODIFY_RESOURCE, groupId)) { + throw new PermissionException("User [" + user + "] does not have permission to modify Resource group with id [" + + groupId + "]."); + }
if (changeType == null) { - ResourceGroup attachedGroup = entityManager.find(ResourceGroup.class, groupId); changeType = RecursivityChangeType.None; if (attachedGroup.isRecursive() == true && group.isRecursive() == false) { // making a recursive group into a "normal" group @@ -189,9 +196,8 @@ public class ResourceGroupManagerBean implements ResourceGroupManagerLocal, Reso // recursive bit didn't change } } - - long time = System.currentTimeMillis(); - group.setMtime(time); + + group.setMtime(System.currentTimeMillis()); group.setModifiedBy(user.getName());
ResourceGroup newlyAttachedGroup = entityManager.merge(group); diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerLocal.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerLocal.java index 8ed40b6..9b0468b 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerLocal.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerLocal.java @@ -138,10 +138,5 @@ public interface ResourceGroupManagerLocal { ResourceGroup updateResourceGroup(Subject subject, ResourceGroup group);
PageList<ResourceGroup> findResourceGroupsByCriteria(Subject subject, ResourceGroupCriteria criteria); - - void updateResourceGroupName(Subject subject, int groupId, String name); - - void updateResourceGroupDescription(Subject subject, int groupId, String description); - - void updateResourceGroupLocation(Subject subject, int groupId, String location); + } \ No newline at end of file diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerRemote.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerRemote.java index 8907ea9..fdda4e2 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerRemote.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerRemote.java @@ -97,21 +97,4 @@ public interface ResourceGroupManagerRemote { @WebParam(name = "subject") Subject subject, // @WebParam(name = "criteria") ResourceGroupCriteria criteria);
- @WebMethod - void updateResourceGroupName( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "groupId") int groupId, // - @WebParam(name = "name") String name); - - @WebMethod - void updateResourceGroupDescription( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "groupId") int groupId, // - @WebParam(name = "description") String description); - - @WebMethod - void updateResourceGroupLocation( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "groupId") int groupId, // - @WebParam(name = "location") String location); }
commit 8772b4ebacc2d74f66b24dd744ea843450da4082 Author: Ian Springer ian.springer@redhat.com Date: Fri Aug 13 12:38:43 2010 -0400
only display Connection Settings subtab when appropriate; some failed attempts to get subtabs to deraw after selecting a different Resource
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/tab/SubTabLayout.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/tab/SubTabLayout.java index eb66445..cda5761 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/tab/SubTabLayout.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/tab/SubTabLayout.java @@ -20,6 +20,7 @@ package org.rhq.enterprise.gui.coregui.client.components.tab;
import java.util.HashSet; import java.util.LinkedHashMap; +import java.util.Map; import java.util.Set;
import com.google.gwt.event.shared.HandlerManager; @@ -40,7 +41,7 @@ public class SubTabLayout extends VLayout {
ToolStrip buttonBar;
- LinkedHashMap<String, Canvas> subtabs = new LinkedHashMap<String, Canvas>(); + Map<String, Canvas> subtabs = new LinkedHashMap<String, Canvas>(); Set<String> disabledSubTabs = new HashSet<String>();
Canvas currentlyDisplayed; @@ -115,11 +116,15 @@ public class SubTabLayout extends VLayout { }
public void enableSubTab(String title) { - disabledSubTabs.remove(title); + if (disabledSubTabs.remove(title)) { + markForRedraw(); + } }
public void disableSubTab(String title) { - disabledSubTabs.add(title); + if (disabledSubTabs.add(title)) { + markForRedraw(); + } }
public void updateSubTab(String title, Canvas canvas) { diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/tab/TwoLevelTab.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/tab/TwoLevelTab.java index c335dc9..cc5cac4 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/tab/TwoLevelTab.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/tab/TwoLevelTab.java @@ -28,6 +28,7 @@ public class TwoLevelTab extends Tab {
private SubTabLayout layout;
+ public TwoLevelTab(String title, String icon) { super(title, icon);
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/tab/TwoLevelTabSet.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/tab/TwoLevelTabSet.java index b12304c..e5cacf8 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/tab/TwoLevelTabSet.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/tab/TwoLevelTabSet.java @@ -30,7 +30,6 @@ import com.smartgwt.client.widgets.tab.events.TabSelectedHandler; */ public class TwoLevelTabSet extends TabSet implements TabSelectedHandler, TwoLevelTabSelectedHandler {
- public void setTabs(TwoLevelTab... tabs) { super.setTabs(tabs); for (TwoLevelTab tab : tabs) { diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java index 51c225a..8fff6e2 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java @@ -203,11 +203,16 @@ public class ResourceGroupDetailView extends VLayout implements BookmarkableView
private void completeTabUpdate() {
+ GroupCategory groupCategory = groupComposite.getResourceGroup().getGroupCategory(); + Set<ResourceTypeFacet> facets = groupComposite.getResourceFacets().getFacets(); + // Summary and Inventory tabs are always enabled. topTabSet.enableTab(summaryTab); topTabSet.enableTab(inventoryTab);
- GroupCategory groupCategory = groupComposite.getResourceGroup().getGroupCategory(); + // Inventory>Connection Settings subtab is only enabled for compat groups that define conn props. + inventoryTab.setSubTabEnabled("Connection Settings", + groupCategory == GroupCategory.COMPATIBLE && facets.contains(ResourceTypeFacet.PLUGIN_CONFIGURATION));
// Monitoring and Alerts tabs are always enabled for compatible groups and always disabled for mixed groups. if (groupCategory == GroupCategory.COMPATIBLE) { @@ -219,8 +224,7 @@ public class ResourceGroupDetailView extends VLayout implements BookmarkableView }
// Operations tab is only enabled for compatible groups of a type that supports the Operations facet. - Set<ResourceTypeFacet> typeFacets = groupComposite.getResourceFacets().getFacets(); - if (typeFacets.contains(ResourceTypeFacet.OPERATION)) { + if (facets.contains(ResourceTypeFacet.OPERATION)) { topTabSet.enableTab(operationsTab); } else { topTabSet.disableTab(operationsTab); @@ -228,21 +232,21 @@ public class ResourceGroupDetailView extends VLayout implements BookmarkableView
// Configuration tab is only enabled for compatible groups of a type that supports the Configuration facet // and when the current user has the CONFIGURE_READ permission. - if (typeFacets.contains(ResourceTypeFacet.CONFIGURATION) && permissions.isConfigureRead()) { + if (facets.contains(ResourceTypeFacet.CONFIGURATION) && permissions.isConfigureRead()) { topTabSet.enableTab(configurationTab); } else { topTabSet.disableTab(configurationTab); }
// Events tab is only enabled for compatible groups of a type that supports the Events facet. - if (typeFacets.contains(ResourceTypeFacet.EVENT)) { + if (facets.contains(ResourceTypeFacet.EVENT)) { topTabSet.enableTab(eventsTab); } else { topTabSet.disableTab(eventsTab); }
// only enable "Call Time" sub-tab for those that implement it - monitoringTab.setSubTabEnabled("Call Time", typeFacets.contains(ResourceTypeFacet.CALL_TIME)); + monitoringTab.setSubTabEnabled("Call Time", facets.contains(ResourceTypeFacet.CALL_TIME)); }
public void onTabSelected(TwoLevelTabSelectedEvent tabSelectedEvent) { diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java index 5c2e94f..2a7183e 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java @@ -23,8 +23,8 @@ import com.smartgwt.client.types.Side; import com.smartgwt.client.widgets.layout.VLayout;
import org.rhq.core.domain.resource.Resource; +import org.rhq.core.domain.resource.ResourceTypeFacet; import org.rhq.core.domain.resource.composite.ResourceComposite; -import org.rhq.core.domain.resource.composite.ResourceFacets; import org.rhq.core.domain.resource.composite.ResourcePermission; import org.rhq.enterprise.gui.coregui.client.BookmarkableView; import org.rhq.enterprise.gui.coregui.client.CoreGUI; @@ -43,6 +43,8 @@ import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.inventory import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.monitoring.GraphListView; import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.overview.ResourceOverviewView;
+import java.util.Set; + /** * Right panel of the Resource view. * @@ -201,41 +203,44 @@ public class ResourceDetailView extends VLayout implements BookmarkableView, Res private void completeTabUpdate() {
ResourcePermission permissions = this.resourceComposite.getResourcePermission(); - ResourceFacets facets = this.resourceComposite.getResourceFacets(); + Set<ResourceTypeFacet> facets = this.resourceComposite.getResourceFacets().getFacets();
// Summary, Monitoring, Inventory, and Alerts tabs are always enabled.
- monitoringTab.setSubTabEnabled("Call Time", facets.isCallTime()); + monitoringTab.setSubTabEnabled("Call Time", facets.contains(ResourceTypeFacet.CALL_TIME)); + + inventoryTab.setSubTabEnabled("Connection Settings", facets.contains(ResourceTypeFacet.PLUGIN_CONFIGURATION));
- if (facets.isOperation()) { + if (facets.contains(ResourceTypeFacet.OPERATION)) { topTabSet.enableTab(operationsTab); } else { topTabSet.disableTab(operationsTab); }
- if (facets.isConfiguration() && permissions.isConfigureRead()) { + if (facets.contains(ResourceTypeFacet.CONFIGURATION) && permissions.isConfigureRead()) { topTabSet.enableTab(configurationTab); } else { topTabSet.disableTab(configurationTab); }
- if (facets.isEvent()) { + if (facets.contains(ResourceTypeFacet.EVENT)) { topTabSet.enableTab(eventsTab); } else { topTabSet.disableTab(eventsTab); }
- if (facets.isContent()) { + if (facets.contains(ResourceTypeFacet.CONTENT)) { topTabSet.enableTab(contentTab); } else { topTabSet.disableTab(contentTab); }
- if (topTabSet.getSelectedTab().getDisabled()) { topTabSet.selectTab(0); }
+ // TODO: This doesn't seem to actually be calling redraw(), draw(), or onDraw() on topTabSet, so subtab + // enablement isn't getting updated... topTabSet.markForRedraw(); }
commit 1c98f96a1d2751aacd48ff4ba6b07666906b7dc9 Merge: 761b250... 40fc34f... Author: John Mazzitelli mazz@redhat.com Date: Fri Aug 13 13:17:53 2010 -0400
Merge branch 'alert-def-gwt'
commit 40fc34f2b200c1ea90e8faf26cae4f0bd2c03658 Author: John Mazzitelli mazz@redhat.com Date: Fri Aug 13 13:16:08 2010 -0400
the general properties tab now works nicely. starting the "edit" feature. still doesn't store anything to the DB yet
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/alert/AlertDefinition.java b/modules/core/domain/src/main/java/org/rhq/core/domain/alert/AlertDefinition.java index 807d3d3..31be645 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/alert/AlertDefinition.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/alert/AlertDefinition.java @@ -623,6 +623,14 @@ public class AlertDefinition implements Serializable { this.deleted = deleted; }
+ /** + * A definition is "read-only" with respect to updates that come from the group/template level. + * If "read only" is true, then changes to the parent group/template alert definition will not + * change this resource alert def. If read only is false, changes to the parent propagate to the + * child resource alert. + * + * @return read only flag + */ public boolean isReadOnly() { return this.readOnly; } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/AbstractAlertDefinitionsView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/AbstractAlertDefinitionsView.java index 6c6aa9f..4a57272 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/AbstractAlertDefinitionsView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/AbstractAlertDefinitionsView.java @@ -39,6 +39,7 @@ import org.rhq.enterprise.gui.coregui.client.components.table.Table.SelectionEna public abstract class AbstractAlertDefinitionsView extends VLayout {
private SingleAlertDefinitionView singleAlertDefinitionView; + private Table alertDefinitionsTable;
public AbstractAlertDefinitionsView() { setWidth100(); @@ -51,11 +52,11 @@ public abstract class AbstractAlertDefinitionsView extends VLayout { super.onDraw();
Criteria criteria = getCriteria(); - final Table table = new Table(getTableTitle(), criteria); - table.setDataSource(getAlertDefinitionDataSource()); - table.getListGrid().setUseAllDataSourceFields(true); + alertDefinitionsTable = new Table(getTableTitle(), criteria); + alertDefinitionsTable.setDataSource(getAlertDefinitionDataSource()); + alertDefinitionsTable.getListGrid().setUseAllDataSourceFields(true);
- table.getListGrid().addSelectionChangedHandler(new SelectionChangedHandler() { + alertDefinitionsTable.getListGrid().addSelectionChangedHandler(new SelectionChangedHandler() { public void onSelectionChanged(SelectionEvent selectionEvent) { AlertDefinition alertDef = null; ListGridRecord selectedRecord = null; @@ -64,16 +65,11 @@ public abstract class AbstractAlertDefinitionsView extends VLayout { selectedRecord = allSelections[0]; } if (selectedRecord != null) { - alertDef = ((AbstractAlertDefinitionsDataSource) table.getDataSource()).copyValues(selectedRecord); - table.setHeight("33%"); - table.setShowResizeBar(true); - singleAlertDefinitionView.setHeight("67%"); - singleAlertDefinitionView.show(); - singleAlertDefinitionView.setAlertDefinition(alertDef); + alertDef = ((AbstractAlertDefinitionsDataSource) alertDefinitionsTable.getDataSource()) + .copyValues(selectedRecord); + showSingleAlertDefinitionView(alertDef); } else { - table.setHeight100(); - table.setShowResizeBar(false); - singleAlertDefinitionView.hide(); + hideSingleAlertDefinitionView(); } markForRedraw(); } @@ -81,49 +77,63 @@ public abstract class AbstractAlertDefinitionsView extends VLayout {
boolean permitted = isAllowedToModifyAlerts();
- table.addTableAction("New", (permitted) ? SelectionEnablement.ALWAYS : SelectionEnablement.NEVER, null, - new TableAction() { - public void executeAction(ListGridRecord[] selection) { - newButtonPressed(selection); - CoreGUI.refresh(); - } - }); + alertDefinitionsTable.addTableAction("New", (permitted) ? SelectionEnablement.ALWAYS + : SelectionEnablement.NEVER, null, new TableAction() { + public void executeAction(ListGridRecord[] selection) { + newButtonPressed(selection); + CoreGUI.refresh(); + } + });
- table.addTableAction("Enable", (permitted) ? SelectionEnablement.ANY : SelectionEnablement.NEVER, - "Are You Sure?", new TableAction() { - public void executeAction(ListGridRecord[] selection) { - enableButtonPressed(selection); - CoreGUI.refresh(); - } - }); + alertDefinitionsTable.addTableAction("Enable", (permitted) ? SelectionEnablement.ANY + : SelectionEnablement.NEVER, "Are You Sure?", new TableAction() { + public void executeAction(ListGridRecord[] selection) { + enableButtonPressed(selection); + CoreGUI.refresh(); + } + });
- table.addTableAction("Disable", (permitted) ? SelectionEnablement.ANY : SelectionEnablement.NEVER, - "Are You Sure?", new TableAction() { - public void executeAction(ListGridRecord[] selection) { - disableButtonPressed(selection); - } - }); + alertDefinitionsTable.addTableAction("Disable", (permitted) ? SelectionEnablement.ANY + : SelectionEnablement.NEVER, "Are You Sure?", new TableAction() { + public void executeAction(ListGridRecord[] selection) { + disableButtonPressed(selection); + } + });
- table.addTableAction("Delete", (permitted) ? SelectionEnablement.ANY : SelectionEnablement.NEVER, - "Are You Sure?", new TableAction() { - public void executeAction(ListGridRecord[] selection) { - deleteButtonPressed(selection); - CoreGUI.refresh(); - } - }); + alertDefinitionsTable.addTableAction("Delete", (permitted) ? SelectionEnablement.ANY + : SelectionEnablement.NEVER, "Are You Sure?", new TableAction() { + public void executeAction(ListGridRecord[] selection) { + deleteButtonPressed(selection); + CoreGUI.refresh(); + } + });
- addMember(table); + addMember(alertDefinitionsTable);
- this.singleAlertDefinitionView = buildSingleAlertDefinitionView(); - this.singleAlertDefinitionView.hide(); - this.singleAlertDefinitionView.setWidth100(); - this.singleAlertDefinitionView.setHeight100(); - this.singleAlertDefinitionView.setMargin(10); - addMember(this.singleAlertDefinitionView); + singleAlertDefinitionView = buildSingleAlertDefinitionView(); + singleAlertDefinitionView.hide(); + singleAlertDefinitionView.setWidth100(); + singleAlertDefinitionView.setHeight100(); + singleAlertDefinitionView.setMargin(10); + addMember(singleAlertDefinitionView); }
protected SingleAlertDefinitionView getSingleAlertDefinitionView() { - return this.singleAlertDefinitionView; + return singleAlertDefinitionView; + } + + protected void showSingleAlertDefinitionView(AlertDefinition alertDef) { + alertDefinitionsTable.setHeight("33%"); + alertDefinitionsTable.setShowResizeBar(true); + singleAlertDefinitionView.setHeight("67%"); + singleAlertDefinitionView.show(); + singleAlertDefinitionView.setAlertDefinition(alertDef); + } + + protected void hideSingleAlertDefinitionView() { + alertDefinitionsTable.setHeight100(); + alertDefinitionsTable.setShowResizeBar(false); + singleAlertDefinitionView.hide(); }
protected SingleAlertDefinitionView buildSingleAlertDefinitionView() { diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/ConditionsAlertDefinitionForm.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/ConditionsAlertDefinitionForm.java index 3f91844..819260f 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/ConditionsAlertDefinitionForm.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/ConditionsAlertDefinitionForm.java @@ -38,6 +38,8 @@ public class ConditionsAlertDefinitionForm extends DynamicForm implements EditAl
private SelectItem conditionExpression;
+ private boolean formBuilt = false; + public ConditionsAlertDefinitionForm() { this(null); } @@ -50,7 +52,7 @@ public class ConditionsAlertDefinitionForm extends DynamicForm implements EditAl protected void onDraw() { super.onDraw();
- if (conditionExpression == null) { + if (!formBuilt) { buildForm(); setAlertDefinition(alertDefinition); makeViewOnly(); @@ -59,12 +61,14 @@ public class ConditionsAlertDefinitionForm extends DynamicForm implements EditAl
@Override public AlertDefinition getAlertDefinition() { - return this.alertDefinition; + return alertDefinition; }
@Override public void setAlertDefinition(AlertDefinition alertDef) { - this.alertDefinition = alertDef; + alertDefinition = alertDef; + + buildForm();
if (alertDef == null) { clearFormValues(); @@ -94,13 +98,20 @@ public class ConditionsAlertDefinitionForm extends DynamicForm implements EditAl @Override public void clearFormValues() { conditionExpression.clearValue(); + + markForRedraw(); }
private void buildForm() { - conditionExpression = new SelectItem("conditionExpression", "Fire alert when"); - conditionExpression.setValueMap(BooleanExpression.ALL.toString(), BooleanExpression.ANY.toString()); - conditionExpression.setDefaultValue(BooleanExpression.ALL.toString()); + if (!formBuilt) {
- setFields(conditionExpression); + conditionExpression = new SelectItem("conditionExpression", "Fire alert when"); + conditionExpression.setValueMap(BooleanExpression.ALL.toString(), BooleanExpression.ANY.toString()); + conditionExpression.setDefaultValue(BooleanExpression.ALL.toString()); + + setFields(conditionExpression); + + formBuilt = true; + } } } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/DampeningAlertDefinitionForm.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/DampeningAlertDefinitionForm.java index adf2173..5590af6 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/DampeningAlertDefinitionForm.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/DampeningAlertDefinitionForm.java @@ -34,6 +34,8 @@ public class DampeningAlertDefinitionForm extends DynamicForm implements EditAle
private AlertDefinition alertDefinition;
+ private boolean formBuilt = false; + public DampeningAlertDefinitionForm() { this(null); } @@ -46,8 +48,7 @@ public class DampeningAlertDefinitionForm extends DynamicForm implements EditAle protected void onDraw() { super.onDraw();
- // TODO only build form if we didn't do it yet - if (true) { + if (!formBuilt) { buildForm(); setAlertDefinition(alertDefinition); makeViewOnly(); @@ -56,12 +57,14 @@ public class DampeningAlertDefinitionForm extends DynamicForm implements EditAle
@Override public AlertDefinition getAlertDefinition() { - return this.alertDefinition; + return alertDefinition; }
@Override public void setAlertDefinition(AlertDefinition alertDef) { - this.alertDefinition = alertDef; + alertDefinition = alertDef; + + buildForm();
if (alertDef == null) { clearFormValues(); @@ -90,10 +93,16 @@ public class DampeningAlertDefinitionForm extends DynamicForm implements EditAle @Override public void clearFormValues() { // TODO component.clearValue(); + + markForRedraw(); }
private void buildForm() { - // TODO build components - // TODO setFields(components); + if (!formBuilt) { + // TODO build components + // TODO setFields(components); + + formBuilt = true; + } } } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/GeneralPropertiesAlertDefinitionForm.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/GeneralPropertiesAlertDefinitionForm.java index 712013c..3b46437 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/GeneralPropertiesAlertDefinitionForm.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/GeneralPropertiesAlertDefinitionForm.java @@ -23,6 +23,8 @@
package org.rhq.enterprise.gui.coregui.client.alert.definitions;
+import java.util.LinkedHashMap; + import com.smartgwt.client.widgets.form.DynamicForm; import com.smartgwt.client.widgets.form.fields.RadioGroupItem; import com.smartgwt.client.widgets.form.fields.SelectItem; @@ -75,12 +77,12 @@ public class GeneralPropertiesAlertDefinitionForm extends DynamicForm implements
@Override public AlertDefinition getAlertDefinition() { - return this.alertDefinition; + return alertDefinition; }
@Override public void setAlertDefinition(AlertDefinition alertDef) { - this.alertDefinition = alertDef; + alertDefinition = alertDef;
buildForm();
@@ -93,7 +95,7 @@ public class GeneralPropertiesAlertDefinitionForm extends DynamicForm implements descriptionTextField.setValue(alertDef.getDescription()); descriptionStatic.setValue(alertDef.getDescription());
- prioritySelection.setValue(alertDef.getPriority().getDisplayName()); + prioritySelection.setValue(alertDef.getPriority().name()); priorityStatic.setValue(alertDef.getPriority().getDisplayName());
enabledSelection.setValue(alertDef.getEnabled() ? "Yes" : "No"); @@ -123,11 +125,15 @@ public class GeneralPropertiesAlertDefinitionForm extends DynamicForm implements readOnlySelection.show(); readOnlyStatic.hide();
- Integer parentId = this.alertDefinition.getParentId(); - if ((parentId == null || parentId.intValue() == 0) && (this.alertDefinition.getGroupAlertDefinition() == null)) { - readOnlySelection.hide(); + if (alertDefinition != null) { + Integer parentId = alertDefinition.getParentId(); + if ((parentId == null || parentId.intValue() == 0) && (alertDefinition.getGroupAlertDefinition() == null)) { + readOnlySelection.hide(); + } else { + readOnlySelection.show(); + } } else { - readOnlySelection.show(); + readOnlySelection.hide(); } readOnlyStatic.hide();
@@ -151,11 +157,15 @@ public class GeneralPropertiesAlertDefinitionForm extends DynamicForm implements readOnlySelection.hide(); readOnlyStatic.show();
- Integer parentId = this.alertDefinition.getParentId(); - if ((parentId == null || parentId.intValue() == 0) && (this.alertDefinition.getGroupAlertDefinition() == null)) { - readOnlyStatic.hide(); + if (alertDefinition != null) { + Integer parentId = alertDefinition.getParentId(); + if ((parentId == null || parentId.intValue() == 0) && (alertDefinition.getGroupAlertDefinition() == null)) { + readOnlyStatic.hide(); + } else { + readOnlyStatic.show(); + } } else { - readOnlyStatic.show(); + readOnlyStatic.hide(); } readOnlySelection.hide();
@@ -164,7 +174,14 @@ public class GeneralPropertiesAlertDefinitionForm extends DynamicForm implements
@Override public void saveAlertDefinition() { - // TODO Auto-generated method stub + alertDefinition.setName(nameTextField.getValue().toString()); + alertDefinition.setDescription(descriptionTextField.getValue().toString()); + + String prioritySelected = prioritySelection.getValue().toString(); + alertDefinition.setPriority(AlertPriority.valueOf(prioritySelected)); + + alertDefinition.setEnabled("Yes".equals(enabledSelection.getValue())); + alertDefinition.setReadOnly("Yes".equals(readOnlySelection.getValue())); }
@Override @@ -188,16 +205,21 @@ public class GeneralPropertiesAlertDefinitionForm extends DynamicForm implements if (!formBuilt) { nameTextField = new TextItem("name", "Name"); nameTextField.setWidth(300); + nameTextField.setDefaultValue(""); nameStatic = new StaticTextItem("nameStatic", "Name");
descriptionTextField = new TextAreaItem("description", "Description"); descriptionTextField.setWidth(300); + descriptionTextField.setDefaultValue(""); descriptionStatic = new StaticTextItem("descriptionStatic", "Description");
prioritySelection = new SelectItem("priority", "Priority"); - prioritySelection.setValueMap(AlertPriority.HIGH.getDisplayName(), AlertPriority.MEDIUM.getDisplayName(), - AlertPriority.LOW.getDisplayName()); - prioritySelection.setDefaultValue(AlertPriority.MEDIUM.getDisplayName()); + LinkedHashMap<String, String> priorities = new LinkedHashMap<String, String>(3); + priorities.put(AlertPriority.HIGH.name(), AlertPriority.HIGH.getDisplayName()); + priorities.put(AlertPriority.MEDIUM.name(), AlertPriority.MEDIUM.getDisplayName()); + priorities.put(AlertPriority.LOW.name(), AlertPriority.LOW.getDisplayName()); + prioritySelection.setValueMap(priorities); + prioritySelection.setDefaultValue(AlertPriority.MEDIUM.name()); priorityStatic = new StaticTextItem("priorityStatic", "Priority");
enabledSelection = new RadioGroupItem("enabled", "Enabled"); @@ -205,11 +227,12 @@ public class GeneralPropertiesAlertDefinitionForm extends DynamicForm implements enabledSelection.setDefaultValue("Yes"); enabledStatic = new StaticTextItem("enabledStatic", "Enabled");
- readOnlySelection = new RadioGroupItem("readOnly", "Read Only"); + readOnlySelection = new RadioGroupItem("readOnly", "Protected"); readOnlySelection.setValueMap("Yes", "No"); readOnlySelection.setDefaultValue("Yes"); - readOnlySelection.setPrompt("If true, the parent definition will not override this alert definition"); - readOnlyStatic = new StaticTextItem("readOnlyStatic", "Read Only"); + readOnlySelection + .setPrompt("If true, this definition is protected from being changed by the parent definition. In other words, the parent definition settings will not override this definition."); + readOnlyStatic = new StaticTextItem("readOnlyStatic", "Protected");
setFields(nameTextField, nameStatic, descriptionTextField, descriptionStatic, prioritySelection, priorityStatic, enabledSelection, enabledStatic, readOnlySelection, readOnlyStatic); diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/NotificationsAlertDefinitionForm.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/NotificationsAlertDefinitionForm.java index 948656a..ab79d1c 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/NotificationsAlertDefinitionForm.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/NotificationsAlertDefinitionForm.java @@ -34,6 +34,8 @@ public class NotificationsAlertDefinitionForm extends DynamicForm implements Edi
private AlertDefinition alertDefinition;
+ private boolean formBuilt = false; + public NotificationsAlertDefinitionForm() { this(null); } @@ -46,8 +48,7 @@ public class NotificationsAlertDefinitionForm extends DynamicForm implements Edi protected void onDraw() { super.onDraw();
- // TODO only build form if we didn't do it yet - if (true) { + if (!formBuilt) { buildForm(); setAlertDefinition(alertDefinition); makeViewOnly(); @@ -56,12 +57,14 @@ public class NotificationsAlertDefinitionForm extends DynamicForm implements Edi
@Override public AlertDefinition getAlertDefinition() { - return this.alertDefinition; + return alertDefinition; }
@Override public void setAlertDefinition(AlertDefinition alertDef) { - this.alertDefinition = alertDef; + alertDefinition = alertDef; + + buildForm();
if (alertDef == null) { clearFormValues(); @@ -90,10 +93,16 @@ public class NotificationsAlertDefinitionForm extends DynamicForm implements Edi @Override public void clearFormValues() { // TODO component.clearValue(); + + markForRedraw(); }
private void buildForm() { - // TODO build components - // TODO setFields(components); + if (!formBuilt) { + // TODO build components + // TODO setFields(components); + + formBuilt = true; + } } } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/RecoveryAlertDefinitionForm.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/RecoveryAlertDefinitionForm.java index e95c771..cff9ad7 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/RecoveryAlertDefinitionForm.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/RecoveryAlertDefinitionForm.java @@ -62,12 +62,12 @@ public class RecoveryAlertDefinitionForm extends DynamicForm implements EditAler
@Override public AlertDefinition getAlertDefinition() { - return this.alertDefinition; + return alertDefinition; }
@Override public void setAlertDefinition(AlertDefinition alertDef) { - this.alertDefinition = alertDef; + alertDefinition = alertDef;
buildForm();
@@ -99,6 +99,8 @@ public class RecoveryAlertDefinitionForm extends DynamicForm implements EditAler public void clearFormValues() { recoverAlertSelection.clearValue(); disableWhenFiredSelection.clearValue(); + + markForRedraw(); }
private void buildForm() { @@ -113,6 +115,7 @@ public class RecoveryAlertDefinitionForm extends DynamicForm implements EditAler disableWhenFiredSelection.setDefaultValue("Yes");
setFields(recoverAlertSelection, disableWhenFiredSelection); + formBuilt = true; } } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/ResourceAlertDefinitionsView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/ResourceAlertDefinitionsView.java index 36c146c..6d01e26 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/ResourceAlertDefinitionsView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/ResourceAlertDefinitionsView.java @@ -27,6 +27,8 @@ import com.smartgwt.client.data.Criteria; import com.smartgwt.client.util.SC; import com.smartgwt.client.widgets.grid.ListGridRecord;
+import org.rhq.core.domain.alert.AlertDefinition; +import org.rhq.core.domain.alert.AlertPriority; import org.rhq.core.domain.resource.Resource;
/** @@ -68,12 +70,17 @@ public class ResourceAlertDefinitionsView extends AbstractAlertDefinitionsView {
@Override protected void newButtonPressed(ListGridRecord[] selection) { - // TODO Auto-generated method stub - String str = "this is not implemented yet but you selected"; - for (ListGridRecord record : selection) { - str += ": " + record.getAttribute("name"); - } - SC.say(str); + // create an empty one with all defaults + AlertDefinition newAlertDef = new AlertDefinition(); + newAlertDef.setDeleted(false); + newAlertDef.setEnabled(true); + newAlertDef.setNotifyFiltered(false); + newAlertDef.setParentId(Integer.valueOf(0)); + newAlertDef.setPriority(AlertPriority.MEDIUM); + newAlertDef.setWillRecover(false); + + showSingleAlertDefinitionView(newAlertDef); + getSingleAlertDefinitionView().makeEditable(); }
@Override diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/SingleAlertDefinitionView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/SingleAlertDefinitionView.java index eff934f..810d31e 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/SingleAlertDefinitionView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/SingleAlertDefinitionView.java @@ -107,6 +107,7 @@ public class SingleAlertDefinitionView extends VLayout { @Override public void onClick(ClickEvent event) { saveAlertDefinition(); + setAlertDefinition(getAlertDefinition()); // loads data into static fields makeViewOnly();
// TODO getAlertDefinition() should now have the new user data - commit it to DB
commit 761b250755f3b21feeace531c324afeb13b36d54 Author: Joseph Marques joseph@redhat.com Date: Fri Aug 13 10:12:00 2010 -0400
add the missing pieces to finish up filtering MeasurementSchedules by resourceTypeId
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/MeasurementScheduleCriteria.java b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/MeasurementScheduleCriteria.java index c82c98e..a4c8a09 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/MeasurementScheduleCriteria.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/MeasurementScheduleCriteria.java @@ -53,6 +53,7 @@ public class MeasurementScheduleCriteria extends Criteria { // filter fields public static final String FILTER_FIELD_RESOURCE_ID = "resourceId"; public static final String FILTER_FIELD_RESOURCE_GROUP_ID = "resourceGroupId"; + public static final String FILTER_FIELD_RESOURCE_TYPE_ID = "resourceTypeId";
private Integer filterId; private Boolean filterEnabled; @@ -89,6 +90,7 @@ public class MeasurementScheduleCriteria extends Criteria { + " FROM Resource res " // + " JOIN res.parentResource parent " // + " WHERE parent.id = ? )"); + filterOverrides.put(FILTER_FIELD_RESOURCE_TYPE_ID, "resource.type.id = ?");
sortOverrides.put(SORT_FIELD_DEFINITION_ID, "definition.id"); sortOverrides.put(SORT_FIELD_NAME, "definition.name"); @@ -130,6 +132,10 @@ public class MeasurementScheduleCriteria extends Criteria { this.filterAutoGroupParentResourceId = filterAutoGroupParentResourceId; }
+ public void addFilterResourceTypeId(Integer filterResourceTypeId) { + this.filterResourceTypeId = filterResourceTypeId; + } + public void fetchBaseline(boolean fetchBaseline) { this.fetchBaseline = fetchBaseline; }
commit 5e99a1a17683741a4fc7f92376e6269a7a73ddf3 Merge: 602b409... 9964a96... Author: John Mazzitelli mazz@redhat.com Date: Fri Aug 13 03:04:34 2010 -0400
Merge branch 'master' into alert-def-gwt
commit 602b40901e514a475854f00219e790cb5d6d0f47 Author: John Mazzitelli mazz@redhat.com Date: Fri Aug 13 03:02:06 2010 -0400
the start of the GWT resource alert definition tab
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/alert/AlertDefinition.java b/modules/core/domain/src/main/java/org/rhq/core/domain/alert/AlertDefinition.java index 23ecc44..807d3d3 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/alert/AlertDefinition.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/alert/AlertDefinition.java @@ -475,6 +475,10 @@ public class AlertDefinition implements Serializable { return this.ctime; }
+ public void setCtime(long ctime) { + this.ctime = ctime; + } + @PrePersist void onPersist() { this.mtime = this.ctime = System.currentTimeMillis(); @@ -484,6 +488,10 @@ public class AlertDefinition implements Serializable { return this.mtime; }
+ public void setMtime(long mtime) { + this.mtime = mtime; + } + @PreUpdate void onUpdate() { this.mtime = System.currentTimeMillis(); diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/alert/BooleanExpression.java b/modules/core/domain/src/main/java/org/rhq/core/domain/alert/BooleanExpression.java index 62c9a92..87ebf60 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/alert/BooleanExpression.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/alert/BooleanExpression.java @@ -1,25 +1,25 @@ - /* - * RHQ Management Platform - * Copyright (C) 2005-2008 Red Hat, Inc. - * All rights reserved. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License, version 2, as - * published by the Free Software Foundation, and/or the GNU Lesser - * General Public License, version 2.1, also as published by the Free - * Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License and the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License - * and the GNU Lesser General Public License along with this program; - * if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ +/* + * RHQ Management Platform + * Copyright (C) 2005-2008 Red Hat, Inc. + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License, version 2, as + * published by the Free Software Foundation, and/or the GNU Lesser + * General Public License, version 2.1, also as published by the Free + * Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License and the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License + * and the GNU Lesser General Public License along with this program; + * if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ package org.rhq.core.domain.alert;
public enum BooleanExpression { @@ -38,4 +38,4 @@ public enum BooleanExpression { * processing */ COMPLEX; // <-- not currently supported -} \ No newline at end of file +}; // gwt compiler wants semicolon diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/AlertDefinitionCriteria.java b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/AlertDefinitionCriteria.java index 9ddf148..298a6e5 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/AlertDefinitionCriteria.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/AlertDefinitionCriteria.java @@ -52,10 +52,10 @@ public class AlertDefinitionCriteria extends Criteria { private List<Integer> filterResourceIds; // requires overrides private List<Integer> filterResourceGroupIds; // requires overrides private Boolean filterEnabled; - private String filterOperationName; // requires overrides private Boolean filterDeleted = false; // find enabled definitions by default
private boolean fetchAlerts; + private boolean fetchGroupAlertDefinition; private boolean fetchConditions; private boolean fetchAlertNotifications;
@@ -68,7 +68,6 @@ public class AlertDefinitionCriteria extends Criteria { filterOverrides.put("alertTemplateResourceTypeName", "resourceType.name like ?"); filterOverrides.put("resourceIds", "resource.id IN ( ? )"); filterOverrides.put("resourceGroupIds", "resourceGroup.id IN ( ? )"); - filterOverrides.put("operationName", "operationDefinition.name like ?"); }
@Override @@ -116,10 +115,6 @@ public class AlertDefinitionCriteria extends Criteria { this.filterEnabled = filterEnabled; }
- public void addFilterOperationName(String filterOperationName) { - this.filterOperationName = filterOperationName; - } - public void addFilterDeleted(Boolean filterDeleted) { this.filterDeleted = filterDeleted; } @@ -128,6 +123,10 @@ public class AlertDefinitionCriteria extends Criteria { this.fetchAlerts = fetchAlerts; }
+ public void fetchGroupAlertDefinition(boolean fetchGroupAlertDefinition) { + this.fetchGroupAlertDefinition = fetchGroupAlertDefinition; + } + public void fetchConditions(boolean fetchConditions) { this.fetchConditions = fetchConditions; } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/AbstractAlertDefinitionsDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/AbstractAlertDefinitionsDataSource.java new file mode 100644 index 0000000..c3c6660 --- /dev/null +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/AbstractAlertDefinitionsDataSource.java @@ -0,0 +1,133 @@ +/* + * RHQ Management Platform + * Copyright (C) 2005-2010 Red Hat, Inc. + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ +package org.rhq.enterprise.gui.coregui.client.alert.definitions; + +import java.util.Date; + +import com.google.gwt.user.client.rpc.AsyncCallback; +import com.smartgwt.client.data.DSRequest; +import com.smartgwt.client.data.DSResponse; +import com.smartgwt.client.data.fields.DataSourceTextField; +import com.smartgwt.client.types.FieldType; +import com.smartgwt.client.widgets.grid.ListGridRecord; + +import org.rhq.core.domain.alert.AlertDefinition; +import org.rhq.core.domain.alert.AlertPriority; +import org.rhq.core.domain.criteria.AlertDefinitionCriteria; +import org.rhq.core.domain.util.PageList; +import org.rhq.enterprise.gui.coregui.client.CoreGUI; +import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup; +import org.rhq.enterprise.gui.coregui.client.util.RPCDataSource; + +/** + * @author Greg Hinkle + * @author John Mazzitelli + */ +public abstract class AbstractAlertDefinitionsDataSource extends RPCDataSource<AlertDefinition> { + + protected static final String FIELD_ID = "id"; + protected static final String FIELD_NAME = "name"; + protected static final String FIELD_DESCRIPTION = "description"; + protected static final String FIELD_CTIME = "ctime"; + protected static final String FIELD_MTIME = "mtime"; + protected static final String FIELD_ENABLED = "enabled"; + protected static final String FIELD_DELETED = "deleted"; + protected static final String FIELD_PRIORITY = "priority"; // not the actual object; a string for the UI + protected static final String FIELD_PRIORITY_ENUM = "priority_enum"; // the actual enum name + + public AbstractAlertDefinitionsDataSource() { + setupFields(); + } + + @Override + public AlertDefinition copyValues(ListGridRecord from) { + AlertDefinition alertDef = new AlertDefinition(); + alertDef.setId(from.getAttributeAsInt(FIELD_ID)); + alertDef.setName(from.getAttributeAsString(FIELD_NAME)); + alertDef.setDescription(from.getAttributeAsString(FIELD_DESCRIPTION)); + alertDef.setCtime(from.getAttributeAsDate(FIELD_CTIME).getTime()); + alertDef.setMtime(from.getAttributeAsDate(FIELD_MTIME).getTime()); + alertDef.setEnabled(from.getAttributeAsBoolean(FIELD_ENABLED)); + alertDef.setPriority(AlertPriority.valueOf(from.getAttributeAsString(FIELD_PRIORITY_ENUM))); + return alertDef; + } + + @Override + public ListGridRecord copyValues(AlertDefinition from) { + ListGridRecord record = new ListGridRecord(); + record.setAttribute(FIELD_ID, from.getId()); + record.setAttribute(FIELD_NAME, from.getName()); + record.setAttribute(FIELD_DESCRIPTION, from.getDescription()); + record.setAttribute(FIELD_CTIME, new Date(from.getCtime())); + record.setAttribute(FIELD_MTIME, new Date(from.getMtime())); + record.setAttribute(FIELD_ENABLED, from.getEnabled()); + record.setAttribute(FIELD_DELETED, from.getDeleted()); + record.setAttribute(FIELD_PRIORITY, from.getPriority().getDisplayName()); + record.setAttribute(FIELD_PRIORITY_ENUM, from.getPriority().name()); + return record; + } + + /** + * Sets up some basic alert definition fields for this data source. Subclasses are + * free to call this method and then add more, or add their own custom set and not + * call this method at all (if they don't want some of these basic fields or want to reorder them). + */ + protected void setupFields() { + DataSourceTextField nameField = new DataSourceTextField(FIELD_NAME, "Name"); + addField(nameField); + + DataSourceTextField descriptionField = new DataSourceTextField(FIELD_DESCRIPTION, "Description"); + addField(descriptionField); + + DataSourceTextField ctimeField = new DataSourceTextField(FIELD_CTIME, "Created Time"); + ctimeField.setType(FieldType.DATETIME); + addField(ctimeField); + + DataSourceTextField mtimeField = new DataSourceTextField(FIELD_MTIME, "Modified Time"); + mtimeField.setType(FieldType.DATETIME); + addField(mtimeField); + + DataSourceTextField enabledField = new DataSourceTextField(FIELD_ENABLED, "Enabled"); + enabledField.setType(FieldType.BOOLEAN); + addField(enabledField); + + DataSourceTextField priorityField = new DataSourceTextField(FIELD_PRIORITY, "Priority"); + addField(priorityField); + } + + @Override + protected void executeFetch(final DSRequest request, final DSResponse response) { + AlertDefinitionCriteria criteria = getCriteria(request); + GWTServiceLookup.getAlertService().findAlertDefinitionsByCriteria(criteria, + new AsyncCallback<PageList<AlertDefinition>>() { + public void onFailure(Throwable caught) { + CoreGUI.getErrorHandler().handleError("Failed to load alert definition data", caught); + response.setStatus(DSResponse.STATUS_FAILURE); + processResponse(request.getRequestId(), response); + } + + public void onSuccess(PageList<AlertDefinition> result) { + response.setData(buildRecords(result)); + processResponse(request.getRequestId(), response); + } + }); + } + + protected abstract AlertDefinitionCriteria getCriteria(DSRequest request); +} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/AbstractAlertDefinitionsView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/AbstractAlertDefinitionsView.java new file mode 100644 index 0000000..6c6aa9f --- /dev/null +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/AbstractAlertDefinitionsView.java @@ -0,0 +1,149 @@ +/* + * RHQ Management Platform + * Copyright (C) 2005-2010 Red Hat, Inc. + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ +package org.rhq.enterprise.gui.coregui.client.alert.definitions; + +import com.smartgwt.client.data.Criteria; +import com.smartgwt.client.widgets.grid.ListGridRecord; +import com.smartgwt.client.widgets.grid.events.SelectionChangedHandler; +import com.smartgwt.client.widgets.grid.events.SelectionEvent; +import com.smartgwt.client.widgets.layout.VLayout; + +import org.rhq.core.domain.alert.AlertDefinition; +import org.rhq.enterprise.gui.coregui.client.CoreGUI; +import org.rhq.enterprise.gui.coregui.client.components.table.Table; +import org.rhq.enterprise.gui.coregui.client.components.table.TableAction; +import org.rhq.enterprise.gui.coregui.client.components.table.Table.SelectionEnablement; + +/** + * Superclass to the different alert definition views. This should be subclassed + * to obtain resource, group, and template alert definition views. + * + * @author John Mazzitelli + */ +public abstract class AbstractAlertDefinitionsView extends VLayout { + + private SingleAlertDefinitionView singleAlertDefinitionView; + + public AbstractAlertDefinitionsView() { + setWidth100(); + setHeight100(); + setMembersMargin(10); + } + + @Override + protected void onDraw() { + super.onDraw(); + + Criteria criteria = getCriteria(); + final Table table = new Table(getTableTitle(), criteria); + table.setDataSource(getAlertDefinitionDataSource()); + table.getListGrid().setUseAllDataSourceFields(true); + + table.getListGrid().addSelectionChangedHandler(new SelectionChangedHandler() { + public void onSelectionChanged(SelectionEvent selectionEvent) { + AlertDefinition alertDef = null; + ListGridRecord selectedRecord = null; + ListGridRecord[] allSelections = selectionEvent.getSelection(); + if (allSelections != null && allSelections.length == 1) { + selectedRecord = allSelections[0]; + } + if (selectedRecord != null) { + alertDef = ((AbstractAlertDefinitionsDataSource) table.getDataSource()).copyValues(selectedRecord); + table.setHeight("33%"); + table.setShowResizeBar(true); + singleAlertDefinitionView.setHeight("67%"); + singleAlertDefinitionView.show(); + singleAlertDefinitionView.setAlertDefinition(alertDef); + } else { + table.setHeight100(); + table.setShowResizeBar(false); + singleAlertDefinitionView.hide(); + } + markForRedraw(); + } + }); + + boolean permitted = isAllowedToModifyAlerts(); + + table.addTableAction("New", (permitted) ? SelectionEnablement.ALWAYS : SelectionEnablement.NEVER, null, + new TableAction() { + public void executeAction(ListGridRecord[] selection) { + newButtonPressed(selection); + CoreGUI.refresh(); + } + }); + + table.addTableAction("Enable", (permitted) ? SelectionEnablement.ANY : SelectionEnablement.NEVER, + "Are You Sure?", new TableAction() { + public void executeAction(ListGridRecord[] selection) { + enableButtonPressed(selection); + CoreGUI.refresh(); + } + }); + + table.addTableAction("Disable", (permitted) ? SelectionEnablement.ANY : SelectionEnablement.NEVER, + "Are You Sure?", new TableAction() { + public void executeAction(ListGridRecord[] selection) { + disableButtonPressed(selection); + } + }); + + table.addTableAction("Delete", (permitted) ? SelectionEnablement.ANY : SelectionEnablement.NEVER, + "Are You Sure?", new TableAction() { + public void executeAction(ListGridRecord[] selection) { + deleteButtonPressed(selection); + CoreGUI.refresh(); + } + }); + + addMember(table); + + this.singleAlertDefinitionView = buildSingleAlertDefinitionView(); + this.singleAlertDefinitionView.hide(); + this.singleAlertDefinitionView.setWidth100(); + this.singleAlertDefinitionView.setHeight100(); + this.singleAlertDefinitionView.setMargin(10); + addMember(this.singleAlertDefinitionView); + } + + protected SingleAlertDefinitionView getSingleAlertDefinitionView() { + return this.singleAlertDefinitionView; + } + + protected SingleAlertDefinitionView buildSingleAlertDefinitionView() { + SingleAlertDefinitionView singleAlertDefinitionView = new SingleAlertDefinitionView(); + return singleAlertDefinitionView; + } + + protected abstract String getTableTitle(); + + protected abstract Criteria getCriteria(); + + protected abstract AbstractAlertDefinitionsDataSource getAlertDefinitionDataSource(); + + protected abstract boolean isAllowedToModifyAlerts(); + + protected abstract void newButtonPressed(ListGridRecord[] selection); + + protected abstract void deleteButtonPressed(ListGridRecord[] selection); + + protected abstract void enableButtonPressed(ListGridRecord[] selection); + + protected abstract void disableButtonPressed(ListGridRecord[] selection); +} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/AlertDefinitionsDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/AlertDefinitionsDataSource.java deleted file mode 100644 index e8ec455..0000000 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/AlertDefinitionsDataSource.java +++ /dev/null @@ -1,194 +0,0 @@ -/* - * RHQ Management Platform - * Copyright (C) 2005-2010 Red Hat, Inc. - * All rights reserved. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation version 2 of the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ -package org.rhq.enterprise.gui.coregui.client.alert.definitions; - -import java.util.ArrayList; -import java.util.Date; -import java.util.HashSet; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import javax.persistence.CascadeType; -import javax.persistence.Column; -import javax.persistence.Embedded; -import javax.persistence.EnumType; -import javax.persistence.Enumerated; -import javax.persistence.FetchType; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; -import javax.persistence.OneToMany; -import javax.persistence.OrderBy; -import javax.xml.bind.annotation.XmlTransient; - -import com.google.gwt.user.client.rpc.AsyncCallback; -import com.smartgwt.client.data.Criteria; -import com.smartgwt.client.data.DSRequest; -import com.smartgwt.client.data.DSResponse; -import com.smartgwt.client.data.fields.DataSourceIntegerField; -import com.smartgwt.client.data.fields.DataSourceTextField; -import com.smartgwt.client.types.FieldType; -import com.smartgwt.client.widgets.grid.ListGridRecord; - -import org.rhq.core.domain.alert.Alert; -import org.rhq.core.domain.alert.AlertCondition; -import org.rhq.core.domain.alert.AlertDampening; -import org.rhq.core.domain.alert.AlertDampeningEvent; -import org.rhq.core.domain.alert.AlertDefinition; -import org.rhq.core.domain.alert.AlertDefinitionContext; -import org.rhq.core.domain.alert.AlertPriority; -import org.rhq.core.domain.alert.BooleanExpression; -import org.rhq.core.domain.alert.notification.AlertNotification; -import org.rhq.core.domain.criteria.AlertCriteria; -import org.rhq.core.domain.criteria.AlertDefinitionCriteria; -import org.rhq.core.domain.operation.OperationDefinition; -import org.rhq.core.domain.resource.Resource; -import org.rhq.core.domain.resource.ResourceType; -import org.rhq.core.domain.resource.group.ResourceGroup; -import org.rhq.core.domain.util.PageList; -import org.rhq.enterprise.gui.coregui.client.CoreGUI; -import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup; -import org.rhq.enterprise.gui.coregui.client.util.RPCDataSource; - -/** - * @author Greg Hinkle - */ -public class AlertDefinitionsDataSource extends RPCDataSource<AlertDefinition> { - - - public AlertDefinitionsDataSource() { - - DataSourceIntegerField idField = new DataSourceIntegerField("id","ID"); - idField.setPrimaryKey(true); - addField(idField); - - DataSourceTextField nameField = new DataSourceTextField("name","Name"); - addField(nameField); - - DataSourceTextField ctimeField = new DataSourceTextField("ctime","Created Time"); - ctimeField.setType(FieldType.DATETIME); - addField(ctimeField); - - DataSourceTextField mtimeField = new DataSourceTextField("mtime", "Modified Time"); - mtimeField.setType(FieldType.DATETIME); - addField(mtimeField); - - DataSourceTextField descriptionField = new DataSourceTextField("description","Description"); - addField(descriptionField); - - DataSourceTextField priorityField = new DataSourceTextField("priority","Priority"); - addField(priorityField); - - DataSourceTextField enabledField = new DataSourceTextField("enabled","Enabled"); - enabledField.setType(FieldType.BOOLEAN); - addField(enabledField); - - } - - @Override - protected void executeFetch(final DSRequest request, final DSResponse response) { - - AlertDefinitionCriteria criteria = getCriteria(request); - - GWTServiceLookup.getAlertService().findAlertDefinitionsByCriteria( - criteria, - new AsyncCallback<PageList<AlertDefinition>>() { - public void onFailure(Throwable caught) { - CoreGUI.getErrorHandler().handleError("Failed to load alert definition data", caught); - response.setStatus(DSResponse.STATUS_FAILURE); - processResponse(request.getRequestId(), response); - } - - public void onSuccess(PageList<AlertDefinition> result) { - response.setData(buildRecords(result)); - processResponse(request.getRequestId(), response); - } - } - ); - } - - - protected AlertDefinitionCriteria getCriteria(DSRequest request) { - AlertDefinitionCriteria criteria = new AlertDefinitionCriteria(); - criteria.fetchConditions(true); - - Criteria requestCriteria = request.getCriteria(); - if (requestCriteria != null) { - Map values = requestCriteria.getValues(); - for (Object key : values.keySet()) { - String fieldName = (String) key; - if (fieldName.equals("resourceId")) { - Integer resourceId = (Integer) values.get(fieldName); - criteria.addFilterResourceIds(resourceId); - } - // TODO: Add support for other fields we need to filter by (e.g. resourceGroupId). - } - } - - criteria.setPageControl(getPageControl(request)); - return criteria; - } - - - @Override - public AlertDefinition copyValues(ListGridRecord from) { - return null; // TODO: Implement this method. - } - - @Override - public ListGridRecord copyValues(AlertDefinition from) { - ListGridRecord record = new ListGridRecord(); - - record.setAttribute("id", from.getId()); - record.setAttribute("name", from.getName()); - record.setAttribute("ctime", new Date(from.getCtime())); - record.setAttribute("mtime", new Date(from.getMtime())); - record.setAttribute("parentId", from.getParentId()); - record.setAttribute("description", from.getDescription()); - record.setAttribute("priority", from.getPriority().getDisplayName()); - record.setAttribute("enabled", from.getEnabled()); - - record.setAttribute("recoveryId", from.getRecoveryId()); - record.setAttribute("willRecover", from.getWillRecover()); - record.setAttribute("notifyFiltered", from.getNotifyFiltered()); - record.setAttribute("controlFiltered", from.getControlFiltered()); - record.setAttribute("deleted", from.getDeleted()); - record.setAttribute("readOnly", from.isReadOnly()); - record.setAttribute("conditionExpression", from.getConditionExpression()); - - - return record; - } - - -/* -The following is not yet translated into the record - private AlertDefinition groupAlertDefinition; - private Set<AlertDefinition> groupAlertDefinitionChildren = new LinkedHashSet<AlertDefinition>(); - private AlertDampening alertDampening; - private BooleanExpression conditionExpression; - private Set<AlertCondition> conditions = new LinkedHashSet<AlertCondition>(1); // Most alerts will only have one condition. - private List<AlertNotification> alertNotifications = new ArrayList<AlertNotification>(); - private OperationDefinition operationDefinition; - private Set<AlertDampeningEvent> alertDampeningEvents = new HashSet<AlertDampeningEvent>(); - private Set<Alert> alerts = new LinkedHashSet<Alert>(); -*/ - -} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/AlertDefinitionsView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/AlertDefinitionsView.java deleted file mode 100644 index 0e35a55..0000000 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/AlertDefinitionsView.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * RHQ Management Platform - * Copyright (C) 2005-2010 Red Hat, Inc. - * All rights reserved. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation version 2 of the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ -package org.rhq.enterprise.gui.coregui.client.alert.definitions; - -import com.smartgwt.client.data.Criteria; -import com.smartgwt.client.widgets.grid.ListGridRecord; -import com.smartgwt.client.widgets.layout.VLayout; - -import org.rhq.core.domain.resource.Resource; -import org.rhq.enterprise.gui.coregui.client.components.table.Table; -import org.rhq.enterprise.gui.coregui.client.components.table.TableAction; -import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.alert.AlertEditView; - -/** - * @author Greg Hinkle - */ -public class AlertDefinitionsView extends VLayout { - - private Resource resource; - - public AlertDefinitionsView(Resource resource) { - setWidth100(); - this.resource = resource; - } - - @Override - protected void onDraw() { - super.onDraw(); - - Criteria criteria = new Criteria(); - criteria.addCriteria("resourceId",resource.getId()); - - Table table = new Table("Alert Definitions", criteria); - table.setDataSource(new AlertDefinitionsDataSource()); - table.getListGrid().setUseAllDataSourceFields(true); - - - table.addTableAction("New", new TableAction() { - public void executeAction(ListGridRecord[] selection) { - new AlertEditView(resource).displayAsDialog(); - } - }); - - addMember(table); - } - - - public static AlertDefinitionsView getResourceView(Resource resource) { - return new AlertDefinitionsView(resource); - } - - -} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/ConditionsAlertDefinitionForm.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/ConditionsAlertDefinitionForm.java new file mode 100644 index 0000000..3f91844 --- /dev/null +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/ConditionsAlertDefinitionForm.java @@ -0,0 +1,106 @@ +/* + * RHQ Management Platform + * Copyright (C) 2005-2010 Red Hat, Inc. + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License, version 2, as + * published by the Free Software Foundation, and/or the GNU Lesser + * General Public License, version 2.1, also as published by the Free + * Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License and the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License + * and the GNU Lesser General Public License along with this program; + * if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +package org.rhq.enterprise.gui.coregui.client.alert.definitions; + +import com.smartgwt.client.widgets.form.DynamicForm; +import com.smartgwt.client.widgets.form.fields.SelectItem; + +import org.rhq.core.domain.alert.AlertDefinition; +import org.rhq.core.domain.alert.BooleanExpression; + +/** + * @author John Mazzitelli + */ +public class ConditionsAlertDefinitionForm extends DynamicForm implements EditAlertDefinitionForm { + + private AlertDefinition alertDefinition; + + private SelectItem conditionExpression; + + public ConditionsAlertDefinitionForm() { + this(null); + } + + public ConditionsAlertDefinitionForm(AlertDefinition alertDefinition) { + this.alertDefinition = alertDefinition; + } + + @Override + protected void onDraw() { + super.onDraw(); + + if (conditionExpression == null) { + buildForm(); + setAlertDefinition(alertDefinition); + makeViewOnly(); + } + } + + @Override + public AlertDefinition getAlertDefinition() { + return this.alertDefinition; + } + + @Override + public void setAlertDefinition(AlertDefinition alertDef) { + this.alertDefinition = alertDef; + + if (alertDef == null) { + clearFormValues(); + } else { + // TODO: why is cond expression always null???? + //conditionExpression.setValue(alertDef.getConditionExpression().toString()); + } + + markForRedraw(); + } + + @Override + public void makeEditable() { + // TODO Auto-generated method stub + } + + @Override + public void makeViewOnly() { + // TODO Auto-generated method stub + } + + @Override + public void saveAlertDefinition() { + // TODO Auto-generated method stub + } + + @Override + public void clearFormValues() { + conditionExpression.clearValue(); + } + + private void buildForm() { + conditionExpression = new SelectItem("conditionExpression", "Fire alert when"); + conditionExpression.setValueMap(BooleanExpression.ALL.toString(), BooleanExpression.ANY.toString()); + conditionExpression.setDefaultValue(BooleanExpression.ALL.toString()); + + setFields(conditionExpression); + } +} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/DampeningAlertDefinitionForm.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/DampeningAlertDefinitionForm.java new file mode 100644 index 0000000..adf2173 --- /dev/null +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/DampeningAlertDefinitionForm.java @@ -0,0 +1,99 @@ +/* + * RHQ Management Platform + * Copyright (C) 2005-2010 Red Hat, Inc. + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License, version 2, as + * published by the Free Software Foundation, and/or the GNU Lesser + * General Public License, version 2.1, also as published by the Free + * Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License and the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License + * and the GNU Lesser General Public License along with this program; + * if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +package org.rhq.enterprise.gui.coregui.client.alert.definitions; + +import com.smartgwt.client.widgets.form.DynamicForm; + +import org.rhq.core.domain.alert.AlertDefinition; + +/** + * @author John Mazzitelli + */ +public class DampeningAlertDefinitionForm extends DynamicForm implements EditAlertDefinitionForm { + + private AlertDefinition alertDefinition; + + public DampeningAlertDefinitionForm() { + this(null); + } + + public DampeningAlertDefinitionForm(AlertDefinition alertDefinition) { + this.alertDefinition = alertDefinition; + } + + @Override + protected void onDraw() { + super.onDraw(); + + // TODO only build form if we didn't do it yet + if (true) { + buildForm(); + setAlertDefinition(alertDefinition); + makeViewOnly(); + } + } + + @Override + public AlertDefinition getAlertDefinition() { + return this.alertDefinition; + } + + @Override + public void setAlertDefinition(AlertDefinition alertDef) { + this.alertDefinition = alertDef; + + if (alertDef == null) { + clearFormValues(); + } else { + // TODO set values of the components + } + + markForRedraw(); + } + + @Override + public void makeEditable() { + // TODO Auto-generated method stub + } + + @Override + public void makeViewOnly() { + // TODO Auto-generated method stub + } + + @Override + public void saveAlertDefinition() { + // TODO Auto-generated method stub + } + + @Override + public void clearFormValues() { + // TODO component.clearValue(); + } + + private void buildForm() { + // TODO build components + // TODO setFields(components); + } +} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/EditAlertDefinitionForm.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/EditAlertDefinitionForm.java new file mode 100644 index 0000000..439ed3e --- /dev/null +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/EditAlertDefinitionForm.java @@ -0,0 +1,21 @@ +package org.rhq.enterprise.gui.coregui.client.alert.definitions; + +import org.rhq.core.domain.alert.AlertDefinition; + +/** + * @author John Mazzitelli + */ +public interface EditAlertDefinitionForm { + + AlertDefinition getAlertDefinition(); + + void setAlertDefinition(AlertDefinition alertDef); + + void makeEditable(); + + void makeViewOnly(); + + void saveAlertDefinition(); + + void clearFormValues(); +} \ No newline at end of file diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/GeneralPropertiesAlertDefinitionForm.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/GeneralPropertiesAlertDefinitionForm.java new file mode 100644 index 0000000..712013c --- /dev/null +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/GeneralPropertiesAlertDefinitionForm.java @@ -0,0 +1,221 @@ +/* + * RHQ Management Platform + * Copyright (C) 2005-2010 Red Hat, Inc. + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License, version 2, as + * published by the Free Software Foundation, and/or the GNU Lesser + * General Public License, version 2.1, also as published by the Free + * Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License and the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License + * and the GNU Lesser General Public License along with this program; + * if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +package org.rhq.enterprise.gui.coregui.client.alert.definitions; + +import com.smartgwt.client.widgets.form.DynamicForm; +import com.smartgwt.client.widgets.form.fields.RadioGroupItem; +import com.smartgwt.client.widgets.form.fields.SelectItem; +import com.smartgwt.client.widgets.form.fields.StaticTextItem; +import com.smartgwt.client.widgets.form.fields.TextAreaItem; +import com.smartgwt.client.widgets.form.fields.TextItem; + +import org.rhq.core.domain.alert.AlertDefinition; +import org.rhq.core.domain.alert.AlertPriority; + +/** + * @author John Mazzitelli + */ +public class GeneralPropertiesAlertDefinitionForm extends DynamicForm implements EditAlertDefinitionForm { + + private AlertDefinition alertDefinition; + + private TextItem nameTextField; + private TextAreaItem descriptionTextField; + private SelectItem prioritySelection; + private RadioGroupItem enabledSelection; + private RadioGroupItem readOnlySelection; + + private StaticTextItem nameStatic; + private StaticTextItem descriptionStatic; + private StaticTextItem priorityStatic; + private StaticTextItem enabledStatic; + private StaticTextItem readOnlyStatic; + + private boolean formBuilt = false; + + public GeneralPropertiesAlertDefinitionForm() { + this(null); + } + + public GeneralPropertiesAlertDefinitionForm(AlertDefinition alertDefinition) { + this.alertDefinition = alertDefinition; + } + + @Override + protected void onDraw() { + super.onDraw(); + + if (!formBuilt) { + buildForm(); + setAlertDefinition(alertDefinition); + makeViewOnly(); + } + } + + @Override + public AlertDefinition getAlertDefinition() { + return this.alertDefinition; + } + + @Override + public void setAlertDefinition(AlertDefinition alertDef) { + this.alertDefinition = alertDef; + + buildForm(); + + if (alertDef == null) { + clearFormValues(); + } else { + nameTextField.setValue(alertDef.getName()); + nameStatic.setValue(alertDef.getName()); + + descriptionTextField.setValue(alertDef.getDescription()); + descriptionStatic.setValue(alertDef.getDescription()); + + prioritySelection.setValue(alertDef.getPriority().getDisplayName()); + priorityStatic.setValue(alertDef.getPriority().getDisplayName()); + + enabledSelection.setValue(alertDef.getEnabled() ? "Yes" : "No"); + enabledStatic.setValue(alertDef.getEnabled() ? "Yes" : "No"); + + readOnlySelection.setValue(alertDef.isReadOnly() ? "Yes" : "No"); + readOnlyStatic.setValue(alertDef.isReadOnly() ? "Yes" : "No"); + } + + markForRedraw(); + } + + @Override + public void makeEditable() { + nameTextField.show(); + nameStatic.hide(); + + descriptionTextField.show(); + descriptionStatic.hide(); + + prioritySelection.show(); + priorityStatic.hide(); + + enabledSelection.show(); + enabledStatic.hide(); + + readOnlySelection.show(); + readOnlyStatic.hide(); + + Integer parentId = this.alertDefinition.getParentId(); + if ((parentId == null || parentId.intValue() == 0) && (this.alertDefinition.getGroupAlertDefinition() == null)) { + readOnlySelection.hide(); + } else { + readOnlySelection.show(); + } + readOnlyStatic.hide(); + + markForRedraw(); + } + + @Override + public void makeViewOnly() { + nameTextField.hide(); + nameStatic.show(); + + descriptionTextField.hide(); + descriptionStatic.show(); + + prioritySelection.hide(); + priorityStatic.show(); + + enabledSelection.hide(); + enabledStatic.show(); + + readOnlySelection.hide(); + readOnlyStatic.show(); + + Integer parentId = this.alertDefinition.getParentId(); + if ((parentId == null || parentId.intValue() == 0) && (this.alertDefinition.getGroupAlertDefinition() == null)) { + readOnlyStatic.hide(); + } else { + readOnlyStatic.show(); + } + readOnlySelection.hide(); + + markForRedraw(); + } + + @Override + public void saveAlertDefinition() { + // TODO Auto-generated method stub + } + + @Override + public void clearFormValues() { + nameTextField.clearValue(); + descriptionTextField.clearValue(); + prioritySelection.clearValue(); + enabledSelection.clearValue(); + readOnlySelection.clearValue(); + + nameStatic.clearValue(); + descriptionStatic.clearValue(); + priorityStatic.clearValue(); + enabledStatic.clearValue(); + readOnlyStatic.clearValue(); + + markForRedraw(); + } + + private void buildForm() { + if (!formBuilt) { + nameTextField = new TextItem("name", "Name"); + nameTextField.setWidth(300); + nameStatic = new StaticTextItem("nameStatic", "Name"); + + descriptionTextField = new TextAreaItem("description", "Description"); + descriptionTextField.setWidth(300); + descriptionStatic = new StaticTextItem("descriptionStatic", "Description"); + + prioritySelection = new SelectItem("priority", "Priority"); + prioritySelection.setValueMap(AlertPriority.HIGH.getDisplayName(), AlertPriority.MEDIUM.getDisplayName(), + AlertPriority.LOW.getDisplayName()); + prioritySelection.setDefaultValue(AlertPriority.MEDIUM.getDisplayName()); + priorityStatic = new StaticTextItem("priorityStatic", "Priority"); + + enabledSelection = new RadioGroupItem("enabled", "Enabled"); + enabledSelection.setValueMap("Yes", "No"); + enabledSelection.setDefaultValue("Yes"); + enabledStatic = new StaticTextItem("enabledStatic", "Enabled"); + + readOnlySelection = new RadioGroupItem("readOnly", "Read Only"); + readOnlySelection.setValueMap("Yes", "No"); + readOnlySelection.setDefaultValue("Yes"); + readOnlySelection.setPrompt("If true, the parent definition will not override this alert definition"); + readOnlyStatic = new StaticTextItem("readOnlyStatic", "Read Only"); + + setFields(nameTextField, nameStatic, descriptionTextField, descriptionStatic, prioritySelection, + priorityStatic, enabledSelection, enabledStatic, readOnlySelection, readOnlyStatic); + + formBuilt = true; + } + + } +} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/GroupAlertDefinitionsDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/GroupAlertDefinitionsDataSource.java new file mode 100644 index 0000000..90f9490 --- /dev/null +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/GroupAlertDefinitionsDataSource.java @@ -0,0 +1,57 @@ +/* + * RHQ Management Platform + * Copyright (C) 2005-2010 Red Hat, Inc. + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License, version 2, as + * published by the Free Software Foundation, and/or the GNU Lesser + * General Public License, version 2.1, also as published by the Free + * Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License and the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License + * and the GNU Lesser General Public License along with this program; + * if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +package org.rhq.enterprise.gui.coregui.client.alert.definitions; + +import java.util.Map; + +import com.smartgwt.client.data.Criteria; +import com.smartgwt.client.data.DSRequest; + +import org.rhq.core.domain.criteria.AlertDefinitionCriteria; + +/** + * @author John Mazzitelli + */ +public class GroupAlertDefinitionsDataSource extends AbstractAlertDefinitionsDataSource { + + @Override + protected AlertDefinitionCriteria getCriteria(DSRequest request) { + AlertDefinitionCriteria criteria = new AlertDefinitionCriteria(); + + Criteria requestCriteria = request.getCriteria(); + if (requestCriteria != null) { + Map values = requestCriteria.getValues(); + for (Object key : values.keySet()) { + String fieldName = (String) key; + if (fieldName.equals(GroupAlertDefinitionsView.CRITERIA_GROUP_ID)) { + Integer resourceId = (Integer) values.get(fieldName); + criteria.addFilterResourceGroupIds(resourceId); + } + } + } + + criteria.setPageControl(getPageControl(request)); + return criteria; + } +} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/GroupAlertDefinitionsView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/GroupAlertDefinitionsView.java new file mode 100644 index 0000000..7283f8f --- /dev/null +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/GroupAlertDefinitionsView.java @@ -0,0 +1,108 @@ +/* + * RHQ Management Platform + * Copyright (C) 2005-2010 Red Hat, Inc. + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License, version 2, as + * published by the Free Software Foundation, and/or the GNU Lesser + * General Public License, version 2.1, also as published by the Free + * Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License and the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License + * and the GNU Lesser General Public License along with this program; + * if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +package org.rhq.enterprise.gui.coregui.client.alert.definitions; + +import com.smartgwt.client.data.Criteria; +import com.smartgwt.client.util.SC; +import com.smartgwt.client.widgets.grid.ListGridRecord; + +import org.rhq.core.domain.resource.group.ResourceGroup; + +/** + * @author John Mazzitelli + */ +public class GroupAlertDefinitionsView extends AbstractAlertDefinitionsView { + + public static final String CRITERIA_GROUP_ID = "groupId"; + + private ResourceGroup group; + + public GroupAlertDefinitionsView(ResourceGroup group) { + super(); + this.group = group; + } + + @Override + protected Criteria getCriteria() { + Criteria criteria = new Criteria(); + criteria.addCriteria(CRITERIA_GROUP_ID, group.getId()); + return criteria; + } + + @Override + protected AbstractAlertDefinitionsDataSource getAlertDefinitionDataSource() { + return new GroupAlertDefinitionsDataSource(); + } + + @Override + protected String getTableTitle() { + return "Group Alert Definitions"; + } + + @Override + protected boolean isAllowedToModifyAlerts() { + // TODO: see if user can modify group alerts on this group + return true; + } + + @Override + protected void newButtonPressed(ListGridRecord[] selection) { + // TODO Auto-generated method stub + String str = "this is not implemented yet but you selected"; + for (ListGridRecord record : selection) { + str += ": " + record.getAttribute("name"); + } + SC.say(str); + } + + @Override + protected void enableButtonPressed(ListGridRecord[] selection) { + // TODO Auto-generated method stub + String str = "this is not implemented yet but you selected"; + for (ListGridRecord record : selection) { + str += ": " + record.getAttribute("name"); + } + SC.say(str); + } + + @Override + protected void disableButtonPressed(ListGridRecord[] selection) { + // TODO Auto-generated method stub + String str = "this is not implemented yet but you selected"; + for (ListGridRecord record : selection) { + str += ": " + record.getAttribute("name"); + } + SC.say(str); + } + + @Override + protected void deleteButtonPressed(ListGridRecord[] selection) { + // TODO Auto-generated method stub + String str = "this is not implemented yet but you selected"; + for (ListGridRecord record : selection) { + str += ": " + record.getAttribute("name"); + } + SC.say(str); + } +} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/NotificationsAlertDefinitionForm.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/NotificationsAlertDefinitionForm.java new file mode 100644 index 0000000..948656a --- /dev/null +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/NotificationsAlertDefinitionForm.java @@ -0,0 +1,99 @@ +/* + * RHQ Management Platform + * Copyright (C) 2005-2010 Red Hat, Inc. + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License, version 2, as + * published by the Free Software Foundation, and/or the GNU Lesser + * General Public License, version 2.1, also as published by the Free + * Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License and the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License + * and the GNU Lesser General Public License along with this program; + * if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +package org.rhq.enterprise.gui.coregui.client.alert.definitions; + +import com.smartgwt.client.widgets.form.DynamicForm; + +import org.rhq.core.domain.alert.AlertDefinition; + +/** + * @author John Mazzitelli + */ +public class NotificationsAlertDefinitionForm extends DynamicForm implements EditAlertDefinitionForm { + + private AlertDefinition alertDefinition; + + public NotificationsAlertDefinitionForm() { + this(null); + } + + public NotificationsAlertDefinitionForm(AlertDefinition alertDefinition) { + this.alertDefinition = alertDefinition; + } + + @Override + protected void onDraw() { + super.onDraw(); + + // TODO only build form if we didn't do it yet + if (true) { + buildForm(); + setAlertDefinition(alertDefinition); + makeViewOnly(); + } + } + + @Override + public AlertDefinition getAlertDefinition() { + return this.alertDefinition; + } + + @Override + public void setAlertDefinition(AlertDefinition alertDef) { + this.alertDefinition = alertDef; + + if (alertDef == null) { + clearFormValues(); + } else { + // TODO set values of the components + } + + markForRedraw(); + } + + @Override + public void makeEditable() { + // TODO Auto-generated method stub + } + + @Override + public void makeViewOnly() { + // TODO Auto-generated method stub + } + + @Override + public void saveAlertDefinition() { + // TODO Auto-generated method stub + } + + @Override + public void clearFormValues() { + // TODO component.clearValue(); + } + + private void buildForm() { + // TODO build components + // TODO setFields(components); + } +} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/RecoveryAlertDefinitionForm.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/RecoveryAlertDefinitionForm.java new file mode 100644 index 0000000..e95c771 --- /dev/null +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/RecoveryAlertDefinitionForm.java @@ -0,0 +1,119 @@ +/* + * RHQ Management Platform + * Copyright (C) 2005-2010 Red Hat, Inc. + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License, version 2, as + * published by the Free Software Foundation, and/or the GNU Lesser + * General Public License, version 2.1, also as published by the Free + * Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License and the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License + * and the GNU Lesser General Public License along with this program; + * if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +package org.rhq.enterprise.gui.coregui.client.alert.definitions; + +import com.smartgwt.client.widgets.form.DynamicForm; +import com.smartgwt.client.widgets.form.fields.RadioGroupItem; +import com.smartgwt.client.widgets.form.fields.SelectItem; + +import org.rhq.core.domain.alert.AlertDefinition; + +/** + * @author John Mazzitelli + */ +public class RecoveryAlertDefinitionForm extends DynamicForm implements EditAlertDefinitionForm { + + private AlertDefinition alertDefinition; + + private SelectItem recoverAlertSelection; + private RadioGroupItem disableWhenFiredSelection; + + private boolean formBuilt = false; + + public RecoveryAlertDefinitionForm() { + this(null); + } + + public RecoveryAlertDefinitionForm(AlertDefinition alertDefinition) { + this.alertDefinition = alertDefinition; + } + + @Override + protected void onDraw() { + super.onDraw(); + + if (!formBuilt) { + buildForm(); + setAlertDefinition(alertDefinition); + makeViewOnly(); + } + } + + @Override + public AlertDefinition getAlertDefinition() { + return this.alertDefinition; + } + + @Override + public void setAlertDefinition(AlertDefinition alertDef) { + this.alertDefinition = alertDef; + + buildForm(); + + if (alertDef == null) { + clearFormValues(); + } else { + disableWhenFiredSelection.setValue(alertDef.getWillRecover() ? "Yes" : "No"); + } + + markForRedraw(); + } + + @Override + public void makeEditable() { + // TODO Auto-generated method stub + } + + @Override + public void makeViewOnly() { + // TODO Auto-generated method stub + } + + @Override + public void saveAlertDefinition() { + // TODO Auto-generated method stub + } + + @Override + public void clearFormValues() { + recoverAlertSelection.clearValue(); + disableWhenFiredSelection.clearValue(); + } + + private void buildForm() { + if (!formBuilt) { + recoverAlertSelection = new SelectItem("recoveryAlert", "Recover Alert"); + recoverAlertSelection.setValueMap("Select..."); + recoverAlertSelection.setDefaultValue("Select..."); + // TODO: call into server and get the menu list of all alerts that we can recover + + disableWhenFiredSelection = new RadioGroupItem("disableWhenFired", "Disable When Fired"); + disableWhenFiredSelection.setValueMap("Yes", "No"); + disableWhenFiredSelection.setDefaultValue("Yes"); + + setFields(recoverAlertSelection, disableWhenFiredSelection); + formBuilt = true; + } + } +} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/ResourceAlertDefinitionsDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/ResourceAlertDefinitionsDataSource.java new file mode 100644 index 0000000..ed19a24 --- /dev/null +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/ResourceAlertDefinitionsDataSource.java @@ -0,0 +1,132 @@ +/* + * RHQ Management Platform + * Copyright (C) 2005-2010 Red Hat, Inc. + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License, version 2, as + * published by the Free Software Foundation, and/or the GNU Lesser + * General Public License, version 2.1, also as published by the Free + * Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License and the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License + * and the GNU Lesser General Public License along with this program; + * if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +package org.rhq.enterprise.gui.coregui.client.alert.definitions; + +import java.util.Map; + +import com.smartgwt.client.data.Criteria; +import com.smartgwt.client.data.DSRequest; +import com.smartgwt.client.data.fields.DataSourceLinkField; +import com.smartgwt.client.data.fields.DataSourceTextField; +import com.smartgwt.client.widgets.grid.ListGridRecord; + +import org.rhq.core.domain.alert.AlertDefinition; +import org.rhq.core.domain.criteria.AlertDefinitionCriteria; +import org.rhq.core.domain.resource.Resource; + +/** + * @author John Mazzitelli + */ +public class ResourceAlertDefinitionsDataSource extends AbstractAlertDefinitionsDataSource { + + protected static final String FIELD_PARENT = "parent"; // the column field - may be template or group alert def parent + protected static final String FIELD_PARENT_TEMPLATEID = "parent_tid"; // the actual integer (may be 0) of template ID + protected static final String FIELD_PARENT_GROUPALERTDEF = "parentId_gad"; // the actual group alert def parent (may be null) + protected static final String FIELD_READONLY = "readOnly"; // not necessarily the actual boolean; sometimes we display "N/A" + protected static final String FIELD_READONLY_BOOLEAN = "readOnly_boolean"; // the actual boolean value + + private Resource resource; + + public ResourceAlertDefinitionsDataSource(Resource resource) { + super(); + this.resource = resource; + } + + @Override + public AlertDefinition copyValues(ListGridRecord from) { + AlertDefinition alertDef = super.copyValues(from); + alertDef.setParentId(from.getAttributeAsInt(FIELD_PARENT_TEMPLATEID)); + alertDef.setGroupAlertDefinition((AlertDefinition) from.getAttributeAsObject(FIELD_PARENT_GROUPALERTDEF)); + alertDef.setReadOnly(from.getAttributeAsBoolean(FIELD_READONLY_BOOLEAN)); + return alertDef; + } + + @Override + public ListGridRecord copyValues(AlertDefinition from) { + ListGridRecord record = super.copyValues(from); + + Integer parentId = from.getParentId(); // a valid non-zero number means the alert def came from a template + AlertDefinition groupAlertDefinition = from.getGroupAlertDefinition(); + boolean readOnly = from.isReadOnly(); + + record.setAttribute(FIELD_PARENT_TEMPLATEID, parentId); + record.setAttribute(FIELD_PARENT_GROUPALERTDEF, groupAlertDefinition); + record.setAttribute(FIELD_READONLY_BOOLEAN, readOnly); + + if ((parentId == null || parentId.intValue() == 0) && (groupAlertDefinition == null)) { + record.setAttribute(FIELD_PARENT, ""); + record.setLinkText(""); + record.setAttribute(FIELD_READONLY, "N/A"); + } else { + // TODO: fix the URLs so they point to the new GWT pages when they are implemented + if (parentId != null && parentId.intValue() != 0) { + record.setAttribute(FIELD_PARENT, "/alerts/Config.do?mode=viewRoles&type=" + + this.resource.getResourceType().getId() + "&from=" + from.getId() + "&ad=" + parentId); + record.setLinkText("View Template"); + } else { + record.setAttribute(FIELD_PARENT, "/alerts/Config.do?mode=viewRoles&groupId=" + + groupAlertDefinition.getResourceGroup().getId() + "&from=" + from.getId() + "&ad=" + + groupAlertDefinition.getId()); + record.setLinkText("View Group Definition"); + } + record.setAttribute(FIELD_READONLY, readOnly); + } + + return record; + } + + @Override + protected void setupFields() { + super.setupFields(); + + // add two more columns + DataSourceLinkField parentIdField = new DataSourceLinkField(FIELD_PARENT, "Parent"); + addField(parentIdField); + + DataSourceTextField readOnlyField = new DataSourceTextField(FIELD_READONLY, "Read Only"); + addField(readOnlyField); + } + + @Override + protected AlertDefinitionCriteria getCriteria(DSRequest request) { + AlertDefinitionCriteria criteria = new AlertDefinitionCriteria(); + + criteria.fetchGroupAlertDefinition(true); + + Criteria requestCriteria = request.getCriteria(); + if (requestCriteria != null) { + Map values = requestCriteria.getValues(); + for (Object key : values.keySet()) { + String fieldName = (String) key; + if (fieldName.equals(ResourceAlertDefinitionsView.CRITERIA_RESOURCE_ID)) { + Integer resourceId = (Integer) values.get(fieldName); + criteria.addFilterResourceIds(resourceId); + } + } + } + + criteria.setPageControl(getPageControl(request)); + return criteria; + } +} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/ResourceAlertDefinitionsView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/ResourceAlertDefinitionsView.java new file mode 100644 index 0000000..36c146c --- /dev/null +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/ResourceAlertDefinitionsView.java @@ -0,0 +1,108 @@ +/* + * RHQ Management Platform + * Copyright (C) 2005-2010 Red Hat, Inc. + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License, version 2, as + * published by the Free Software Foundation, and/or the GNU Lesser + * General Public License, version 2.1, also as published by the Free + * Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License and the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License + * and the GNU Lesser General Public License along with this program; + * if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +package org.rhq.enterprise.gui.coregui.client.alert.definitions; + +import com.smartgwt.client.data.Criteria; +import com.smartgwt.client.util.SC; +import com.smartgwt.client.widgets.grid.ListGridRecord; + +import org.rhq.core.domain.resource.Resource; + +/** + * @author John Mazzitelli + */ +public class ResourceAlertDefinitionsView extends AbstractAlertDefinitionsView { + + public static final String CRITERIA_RESOURCE_ID = "resourceId"; + + private Resource resource; + + public ResourceAlertDefinitionsView(Resource resource) { + super(); + this.resource = resource; + } + + @Override + protected Criteria getCriteria() { + Criteria criteria = new Criteria(); + criteria.addCriteria(CRITERIA_RESOURCE_ID, resource.getId()); + return criteria; + } + + @Override + protected AbstractAlertDefinitionsDataSource getAlertDefinitionDataSource() { + return new ResourceAlertDefinitionsDataSource(this.resource); + } + + @Override + protected String getTableTitle() { + return "Alert Definitions"; + } + + @Override + protected boolean isAllowedToModifyAlerts() { + // TODO: see if user can modify alerts on this resource + return true; + } + + @Override + protected void newButtonPressed(ListGridRecord[] selection) { + // TODO Auto-generated method stub + String str = "this is not implemented yet but you selected"; + for (ListGridRecord record : selection) { + str += ": " + record.getAttribute("name"); + } + SC.say(str); + } + + @Override + protected void enableButtonPressed(ListGridRecord[] selection) { + // TODO Auto-generated method stub + String str = "this is not implemented yet but you selected"; + for (ListGridRecord record : selection) { + str += ": " + record.getAttribute("name"); + } + SC.say(str); + } + + @Override + protected void disableButtonPressed(ListGridRecord[] selection) { + // TODO Auto-generated method stub + String str = "this is not implemented yet but you selected"; + for (ListGridRecord record : selection) { + str += ": " + record.getAttribute("name"); + } + SC.say(str); + } + + @Override + protected void deleteButtonPressed(ListGridRecord[] selection) { + // TODO Auto-generated method stub + String str = "this is not implemented yet but you selected"; + for (ListGridRecord record : selection) { + str += ": " + record.getAttribute("name"); + } + SC.say(str); + } +} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/SingleAlertDefinitionView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/SingleAlertDefinitionView.java new file mode 100644 index 0000000..eff934f --- /dev/null +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/SingleAlertDefinitionView.java @@ -0,0 +1,175 @@ +/* + * RHQ Management Platform + * Copyright (C) 2005-2010 Red Hat, Inc. + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License, version 2, as + * published by the Free Software Foundation, and/or the GNU Lesser + * General Public License, version 2.1, also as published by the Free + * Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License and the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License + * and the GNU Lesser General Public License along with this program; + * if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +package org.rhq.enterprise.gui.coregui.client.alert.definitions; + +import com.smartgwt.client.widgets.Button; +import com.smartgwt.client.widgets.events.ClickEvent; +import com.smartgwt.client.widgets.events.ClickHandler; +import com.smartgwt.client.widgets.layout.HLayout; +import com.smartgwt.client.widgets.layout.VLayout; +import com.smartgwt.client.widgets.tab.Tab; +import com.smartgwt.client.widgets.tab.TabSet; + +import org.rhq.core.domain.alert.AlertDefinition; + +/** + * @author John Mazzitelli + */ +public class SingleAlertDefinitionView extends VLayout { + + private AlertDefinition alertDefinition; + private GeneralPropertiesAlertDefinitionForm generalProperties; + private ConditionsAlertDefinitionForm conditions; + private NotificationsAlertDefinitionForm notifications; + private RecoveryAlertDefinitionForm recovery; + private DampeningAlertDefinitionForm dampening; + + private Button editButton; + private Button saveButton; + private Button cancelButton; + + public SingleAlertDefinitionView() { + this(null); + } + + public SingleAlertDefinitionView(AlertDefinition alertDefinition) { + this.alertDefinition = alertDefinition; + + TabSet tabSet = new TabSet(); + tabSet.setHeight100(); + + Tab generalPropertiesTab = new Tab("General Properties"); + generalProperties = new GeneralPropertiesAlertDefinitionForm(alertDefinition); + generalPropertiesTab.setPane(generalProperties); + + Tab conditionsTab = new Tab("Conditions"); + conditions = new ConditionsAlertDefinitionForm(alertDefinition); + conditionsTab.setPane(conditions); + + Tab notificationsTab = new Tab("Notifications"); + notifications = new NotificationsAlertDefinitionForm(alertDefinition); + notificationsTab.setPane(notifications); + + Tab recoveryTab = new Tab("Recovery"); + recovery = new RecoveryAlertDefinitionForm(alertDefinition); + recoveryTab.setPane(recovery); + + Tab dampeningTab = new Tab("Dampening"); + dampening = new DampeningAlertDefinitionForm(alertDefinition); + dampeningTab.setPane(dampening); + + tabSet.setTabs(generalPropertiesTab, conditionsTab, notificationsTab, recoveryTab, dampeningTab); + + final HLayout buttons = new HLayout(); + buttons.setMembersMargin(20); + + editButton = new Button("Edit"); + saveButton = new Button("Save"); + cancelButton = new Button("Cancel"); + + editButton.show(); + saveButton.hide(); + cancelButton.hide(); + + buttons.addMember(editButton); + buttons.addMember(saveButton); + buttons.addMember(cancelButton); + + editButton.addClickHandler(new ClickHandler() { + @Override + public void onClick(ClickEvent event) { + makeEditable(); + } + }); + + saveButton.addClickHandler(new ClickHandler() { + @Override + public void onClick(ClickEvent event) { + saveAlertDefinition(); + makeViewOnly(); + + // TODO getAlertDefinition() should now have the new user data - commit it to DB + } + }); + + cancelButton.addClickHandler(new ClickHandler() { + @Override + public void onClick(ClickEvent event) { + makeViewOnly(); + } + }); + + setMembersMargin(10); + addMember(tabSet); + addMember(buttons); + } + + public AlertDefinition getAlertDefinition() { + return alertDefinition; + } + + public void setAlertDefinition(AlertDefinition alertDef) { + alertDefinition = alertDef; + + generalProperties.setAlertDefinition(alertDef); + conditions.setAlertDefinition(alertDef); + notifications.setAlertDefinition(alertDef); + recovery.setAlertDefinition(alertDef); + dampening.setAlertDefinition(alertDef); + + makeViewOnly(); + } + + public void makeEditable() { + saveButton.show(); + cancelButton.show(); + editButton.hide(); + + generalProperties.makeEditable(); + conditions.makeEditable(); + notifications.makeEditable(); + recovery.makeEditable(); + dampening.makeEditable(); + } + + public void makeViewOnly() { + saveButton.hide(); + cancelButton.hide(); + editButton.show(); + + generalProperties.makeViewOnly(); + conditions.makeViewOnly(); + notifications.makeViewOnly(); + recovery.makeViewOnly(); + dampening.makeViewOnly(); + } + + public void saveAlertDefinition() { + generalProperties.saveAlertDefinition(); + conditions.saveAlertDefinition(); + notifications.saveAlertDefinition(); + recovery.saveAlertDefinition(); + dampening.saveAlertDefinition(); + } +} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/TemplateAlertDefinitionsDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/TemplateAlertDefinitionsDataSource.java new file mode 100644 index 0000000..9a96db8 --- /dev/null +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/TemplateAlertDefinitionsDataSource.java @@ -0,0 +1,57 @@ +/* + * RHQ Management Platform + * Copyright (C) 2005-2010 Red Hat, Inc. + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License, version 2, as + * published by the Free Software Foundation, and/or the GNU Lesser + * General Public License, version 2.1, also as published by the Free + * Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License and the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License + * and the GNU Lesser General Public License along with this program; + * if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +package org.rhq.enterprise.gui.coregui.client.alert.definitions; + +import java.util.Map; + +import com.smartgwt.client.data.Criteria; +import com.smartgwt.client.data.DSRequest; + +import org.rhq.core.domain.criteria.AlertDefinitionCriteria; + +/** + * @author John Mazzitelli + */ +public class TemplateAlertDefinitionsDataSource extends AbstractAlertDefinitionsDataSource { + + @Override + protected AlertDefinitionCriteria getCriteria(DSRequest request) { + AlertDefinitionCriteria criteria = new AlertDefinitionCriteria(); + + Criteria requestCriteria = request.getCriteria(); + if (requestCriteria != null) { + Map values = requestCriteria.getValues(); + for (Object key : values.keySet()) { + String fieldName = (String) key; + if (fieldName.equals(TemplateAlertDefinitionsView.CRITERIA_RESOURCE_TYPE_ID)) { + Integer resourceId = (Integer) values.get(fieldName); + criteria.addFilterAlertTemplateResourceTypeId(resourceId); + } + } + } + + criteria.setPageControl(getPageControl(request)); + return criteria; + } +} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/TemplateAlertDefinitionsView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/TemplateAlertDefinitionsView.java new file mode 100644 index 0000000..e9674ad --- /dev/null +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/TemplateAlertDefinitionsView.java @@ -0,0 +1,108 @@ +/* + * RHQ Management Platform + * Copyright (C) 2005-2010 Red Hat, Inc. + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License, version 2, as + * published by the Free Software Foundation, and/or the GNU Lesser + * General Public License, version 2.1, also as published by the Free + * Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License and the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License + * and the GNU Lesser General Public License along with this program; + * if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +package org.rhq.enterprise.gui.coregui.client.alert.definitions; + +import com.smartgwt.client.data.Criteria; +import com.smartgwt.client.util.SC; +import com.smartgwt.client.widgets.grid.ListGridRecord; + +import org.rhq.core.domain.resource.ResourceType; + +/** + * @author John Mazzitelli + */ +public class TemplateAlertDefinitionsView extends AbstractAlertDefinitionsView { + + public static final String CRITERIA_RESOURCE_TYPE_ID = "resourceTypeId"; + + private ResourceType resourceType; + + public TemplateAlertDefinitionsView(ResourceType resourceType) { + super(); + this.resourceType = resourceType; + } + + @Override + protected Criteria getCriteria() { + Criteria criteria = new Criteria(); + criteria.addCriteria(CRITERIA_RESOURCE_TYPE_ID, resourceType.getId()); + return criteria; + } + + @Override + protected AbstractAlertDefinitionsDataSource getAlertDefinitionDataSource() { + return new TemplateAlertDefinitionsDataSource(); + } + + @Override + protected String getTableTitle() { + return "Alert Templates"; + } + + @Override + protected boolean isAllowedToModifyAlerts() { + // TODO: see if user can modify template alerts + return true; + } + + @Override + protected void newButtonPressed(ListGridRecord[] selection) { + // TODO Auto-generated method stub + String str = "this is not implemented yet but you selected"; + for (ListGridRecord record : selection) { + str += ": " + record.getAttribute("name"); + } + SC.say(str); + } + + @Override + protected void enableButtonPressed(ListGridRecord[] selection) { + // TODO Auto-generated method stub + String str = "this is not implemented yet but you selected"; + for (ListGridRecord record : selection) { + str += ": " + record.getAttribute("name"); + } + SC.say(str); + } + + @Override + protected void disableButtonPressed(ListGridRecord[] selection) { + // TODO Auto-generated method stub + String str = "this is not implemented yet but you selected"; + for (ListGridRecord record : selection) { + str += ": " + record.getAttribute("name"); + } + SC.say(str); + } + + @Override + protected void deleteButtonPressed(ListGridRecord[] selection) { + // TODO Auto-generated method stub + String str = "this is not implemented yet but you selected"; + for (ListGridRecord record : selection) { + str += ": " + record.getAttribute("name"); + } + SC.say(str); + } +} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/Table.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/Table.java index 2418783..ee29754 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/Table.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/Table.java @@ -34,11 +34,8 @@ import com.smartgwt.client.widgets.Label; import com.smartgwt.client.widgets.events.ClickEvent; import com.smartgwt.client.widgets.events.ClickHandler; import com.smartgwt.client.widgets.grid.ListGrid; -import com.smartgwt.client.widgets.grid.ListGridField; import com.smartgwt.client.widgets.grid.events.DataArrivedEvent; import com.smartgwt.client.widgets.grid.events.DataArrivedHandler; -import com.smartgwt.client.widgets.grid.events.FieldStateChangedEvent; -import com.smartgwt.client.widgets.grid.events.FieldStateChangedHandler; import com.smartgwt.client.widgets.grid.events.SelectionChangedHandler; import com.smartgwt.client.widgets.grid.events.SelectionEvent; import com.smartgwt.client.widgets.layout.HLayout; @@ -68,7 +65,6 @@ public class Table extends VLayout {
private String headerIcon;
- private boolean showHeader = true; private boolean showFooter = true;
@@ -91,7 +87,11 @@ public class Table extends VLayout { /** * Two or more rows are selected. */ - MULTIPLE + MULTIPLE, + /** + * Never enabled - usually due to the user having a lack of permissions + */ + NEVER }
; @@ -124,7 +124,7 @@ public class Table extends VLayout { }
public Table(String tableTitle, Criteria criteria, SortSpecifier[] sortSpecifiers, String[] excludedFieldNames, - boolean autoFetchData) { + boolean autoFetchData) { super();
setWidth100(); @@ -164,7 +164,6 @@ public class Table extends VLayout { protected void onInit() { super.onInit();
- // NOTE: It is essential that we wait to hide any excluded fields until after super.onDraw() is called, since // super.onDraw() is what actually adds the fields to the ListGrid (based on what fields are defined in // the underlying datasource). @@ -174,13 +173,10 @@ public class Table extends VLayout { } }
- tableInfo.setWrap(false);
- }
- @Override protected void onDraw() { super.onDraw(); @@ -222,7 +218,7 @@ public class Table extends VLayout { if (tableAction.confirmMessage != null) {
String message = tableAction.confirmMessage.replaceAll("\#", String.valueOf(listGrid - .getSelection().length)); + .getSelection().length));
SC.ask(message, new BooleanCallback() { public void execute(Boolean confirmed) { @@ -244,7 +240,6 @@ public class Table extends VLayout { footer.addMember(extraWidgetCanvas); }
- footer.addMember(new LayoutSpacer());
IButton refreshButton = new IButton("Refresh"); @@ -268,11 +263,9 @@ public class Table extends VLayout { public void onDataArrived(DataArrivedEvent dataArrivedEvent) { refreshTableInfo(); fieldSizes.clear(); - totalWidth = 0; } });
- addMember(footer); } } @@ -297,9 +290,7 @@ public class Table extends VLayout { this.showFooter = showFooter; }
- private int totalWidth; private ArrayList<Integer> fieldSizes = new ArrayList<Integer>(); - private boolean autoSizing = false;
public void refresh(Criteria criteria) { this.listGrid.invalidateCache(); @@ -311,7 +302,6 @@ public class Table extends VLayout { this.listGrid.invalidateCache(); this.listGrid.markForRedraw(); } -
public void setTableTitle(String titleString) { if (titleString == null) { @@ -346,7 +336,6 @@ public class Table extends VLayout { return listGrid; }
- public void setTitleComponent(Canvas canvas) { this.titleComponent = canvas; } @@ -356,7 +345,7 @@ public class Table extends VLayout { }
public void addTableAction(String title, SelectionEnablement enablement, String confirmation, - TableAction tableAction) { + TableAction tableAction) { if (enablement == null) { enablement = DEFAULT_SELECTION_ENABLEMENT; } @@ -383,20 +372,23 @@ public class Table extends VLayout { for (TableActionInfo tableAction : tableActions) { boolean enabled; switch (tableAction.enablement) { - case ALWAYS: - enabled = true; - break; - case ANY: - enabled = (count >= 1); - break; - case SINGLE: - enabled = (count == 1); - break; - case MULTIPLE: - enabled = (count > 1); - break; - default: - throw new IllegalStateException("Unhandled SelectionEnablement: " + tableAction.enablement.name()); + case ALWAYS: + enabled = true; + break; + case NEVER: + enabled = false; + break; + case ANY: + enabled = (count >= 1); + break; + case SINGLE: + enabled = (count == 1); + break; + case MULTIPLE: + enabled = (count > 1); + break; + default: + throw new IllegalStateException("Unhandled SelectionEnablement: " + tableAction.enablement.name()); } tableAction.actionButton.setDisabled(!enabled); } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java index ea7b88e..5da123b 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java @@ -33,6 +33,7 @@ import org.rhq.core.domain.resource.composite.ResourcePermission; import org.rhq.enterprise.gui.coregui.client.BookmarkableView; import org.rhq.enterprise.gui.coregui.client.CoreGUI; import org.rhq.enterprise.gui.coregui.client.ViewPath; +import org.rhq.enterprise.gui.coregui.client.alert.definitions.ResourceAlertDefinitionsView; import org.rhq.enterprise.gui.coregui.client.components.FullHTMLPane; import org.rhq.enterprise.gui.coregui.client.components.tab.TwoLevelTab; import org.rhq.enterprise.gui.coregui.client.components.tab.TwoLevelTabSelectedEvent; @@ -108,7 +109,7 @@ public class ResourceDetailView extends VLayout implements BookmarkableView, Res operationsTab.registerSubTabs("History", "Scheduled");
alertsTab = new TwoLevelTab("Alerts", "/images/icons/Alert_grey_16.png"); - alertsTab.registerSubTabs("History", "Definitions"); + alertsTab.registerSubTabs("History", "Definitions", "DELETEME");
configurationTab = new TwoLevelTab("Configuration", "/images/icons/Configure_grey_16.png"); configurationTab.registerSubTabs("Current", "History"); @@ -178,11 +179,11 @@ public class ResourceDetailView extends VLayout implements BookmarkableView, Res // 3) user can enable/disable/delete alert definitions if they possess the appropriate permissions // 4) user can search alert history by: date alert was fired, alert priority, or alert definition //alertsTab.updateSubTab("History", new ResourceAlertHistoryView(resource.getId())); - //alertsTab.updateSubTab("Definitions", AlertDefinitionsView.getResourceView(resource)); alertsTab.updateSubTab("History", new FullHTMLPane("/rhq/resource/alert/listAlertHistory-plain.xhtml?id=" + resource.getId())); - alertsTab.updateSubTab("Definitions", new FullHTMLPane( - "/rhq/resource/alert/listAlertDefinitions-plain.xhtml?id=" + resource.getId())); + alertsTab.updateSubTab("Definitions", new ResourceAlertDefinitionsView(resource)); + alertsTab.updateSubTab("DELETEME", new FullHTMLPane("/rhq/resource/alert/listAlertDefinitions-plain.xhtml?id=" + + resource.getId()));
// comment out GWT-based view until... // 1) user can search event history by: metric display range, event source, event details, event severity
commit 9964a96c296a2ecde766d5e899b5c30bc74a6d2a Author: Ian Springer ian.springer@redhat.com Date: Thu Aug 12 17:28:02 2010 -0400
first rev of the base classes needed for the metric schedule list pages for resources, groups, and templates
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/MeasurementScheduleCriteria.java b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/MeasurementScheduleCriteria.java index cae02bf..c82c98e 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/MeasurementScheduleCriteria.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/MeasurementScheduleCriteria.java @@ -39,6 +39,21 @@ import org.rhq.core.domain.util.PageOrdering; public class MeasurementScheduleCriteria extends Criteria { private static final long serialVersionUID = 1L;
+ // sort fields from the MeasurementSchedule itself + public static final String SORT_FIELD_ENABLED = "enabled"; + public static final String SORT_FIELD_INTERVAL = "interval"; + + // sort fields from the MeasurementSchedule's MeasurementDefinition + public static final String SORT_FIELD_DEFINITION_ID = "definitionId"; + public static final String SORT_FIELD_NAME = "name"; + public static final String SORT_FIELD_DISPLAY_NAME = "displayName"; + public static final String SORT_FIELD_DESCRIPTION = "description"; + public static final String SORT_FIELD_DATA_TYPE = "dataType"; + + // filter fields + public static final String FILTER_FIELD_RESOURCE_ID = "resourceId"; + public static final String FILTER_FIELD_RESOURCE_GROUP_ID = "resourceGroupId"; + private Integer filterId; private Boolean filterEnabled; private List<Integer> filterDefinitionIds; // requires overrides @@ -46,6 +61,7 @@ public class MeasurementScheduleCriteria extends Criteria { private Integer filterResourceGroupId; // requires overrides private Integer filterAutoGroupResourceTypeId; // requires overrides private Integer filterAutoGroupParentResourceId; // requires overrides + private Integer filterResourceTypeId; // requires overrides
private boolean fetchBaseline; private boolean fetchDefinition; @@ -57,8 +73,8 @@ public class MeasurementScheduleCriteria extends Criteria {
public MeasurementScheduleCriteria() { filterOverrides.put("definitionIds", "definition.id IN ( ? )"); - filterOverrides.put("resourceId", "resource.id IN ( ? )"); - filterOverrides.put("resourceGroupId", "resource.id IN " // + filterOverrides.put(FILTER_FIELD_RESOURCE_ID, "resource.id IN ( ? )"); + filterOverrides.put(FILTER_FIELD_RESOURCE_GROUP_ID, "resource.id IN " // + "( SELECT res.id " // + " FROM Resource res " // + " JOIN res.implicitGroups ig " // @@ -74,9 +90,11 @@ public class MeasurementScheduleCriteria extends Criteria { + " JOIN res.parentResource parent " // + " WHERE parent.id = ? )");
- sortOverrides.put("name", "definition.name"); - sortOverrides.put("displayName", "definition.displayName"); - sortOverrides.put("dataType", "definition.dataType"); + sortOverrides.put(SORT_FIELD_DEFINITION_ID, "definition.id"); + sortOverrides.put(SORT_FIELD_NAME, "definition.name"); + sortOverrides.put(SORT_FIELD_DISPLAY_NAME, "definition.displayName"); + sortOverrides.put(SORT_FIELD_DESCRIPTION, "definition.description"); + sortOverrides.put(SORT_FIELD_DATA_TYPE, "definition.dataType"); }
@Override diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertDataSource.java index 6e5430f..3369352 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertDataSource.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertDataSource.java @@ -70,9 +70,7 @@ public class AlertDataSource extends RPCDataSource<Alert> { setCanMultiSort(true);
List<DataSourceField> fields = createFields(); - for (DataSourceField field : fields) { - addField(field); - } + addFields(fields); }
protected List<DataSourceField> createFields() { diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertsView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertsView.java index 9240e83..c4cf1b4 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertsView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertsView.java @@ -279,18 +279,9 @@ public class AlertsView extends Table {
}
- protected Criteria getCriteria() { - return null; - } - public void refresh() { this.getListGrid().invalidateCache(); //this.table.getListGrid().markForRedraw(); }
- public void refresh(Criteria criteria) { - this.refresh(criteria); - //this.table.getListGrid().markForRedraw(); - } - } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/Table.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/Table.java index 2418783..8d71fe2 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/Table.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/Table.java @@ -34,11 +34,8 @@ import com.smartgwt.client.widgets.Label; import com.smartgwt.client.widgets.events.ClickEvent; import com.smartgwt.client.widgets.events.ClickHandler; import com.smartgwt.client.widgets.grid.ListGrid; -import com.smartgwt.client.widgets.grid.ListGridField; import com.smartgwt.client.widgets.grid.events.DataArrivedEvent; import com.smartgwt.client.widgets.grid.events.DataArrivedHandler; -import com.smartgwt.client.widgets.grid.events.FieldStateChangedEvent; -import com.smartgwt.client.widgets.grid.events.FieldStateChangedHandler; import com.smartgwt.client.widgets.grid.events.SelectionChangedHandler; import com.smartgwt.client.widgets.grid.events.SelectionEvent; import com.smartgwt.client.widgets.layout.HLayout; diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/MeasurementDataGWTService.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/MeasurementDataGWTService.java index cd99ad7..c3c67e2 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/MeasurementDataGWTService.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/MeasurementDataGWTService.java @@ -53,9 +53,9 @@ public interface MeasurementDataGWTService extends RemoteService { PageList<CallTimeDataComposite> findCallTimeDataForResource(int scheduleId, long start, long end, PageControl pageControl);
- public PageList<MeasurementDefinition> findMeasurementDefinitionsByCriteria(MeasurementDefinitionCriteria criteria); + PageList<MeasurementDefinition> findMeasurementDefinitionsByCriteria(MeasurementDefinitionCriteria criteria);
- public PageList<MeasurementSchedule> findMeasurementSchedulesByCriteria(MeasurementScheduleCriteria criteria); + PageList<MeasurementSchedule> findMeasurementSchedulesByCriteria(MeasurementScheduleCriteria criteria);
PageList<MeasurementOOBComposite> getSchedulesWithOOBs(String metricNameFilter, String resourceNameFilter, String parentNameFilter, PageControl pc); diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMeasurementScheduleDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMeasurementScheduleDataSource.java new file mode 100644 index 0000000..9137081 --- /dev/null +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMeasurementScheduleDataSource.java @@ -0,0 +1,204 @@ +/* + * RHQ Management Platform + * Copyright (C) 2010 Red Hat, Inc. + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ +package org.rhq.enterprise.gui.coregui.client.inventory.common; + +import com.google.gwt.core.client.JavaScriptObject; +import com.google.gwt.user.client.Window; +import com.google.gwt.user.client.rpc.AsyncCallback; +import com.smartgwt.client.data.Criteria; +import com.smartgwt.client.data.DSRequest; +import com.smartgwt.client.data.DSResponse; +import com.smartgwt.client.data.DataSourceField; +import com.smartgwt.client.data.fields.DataSourceBooleanField; +import com.smartgwt.client.data.fields.DataSourceIntegerField; +import com.smartgwt.client.data.fields.DataSourceTextField; +import com.smartgwt.client.rpc.RPCResponse; +import com.smartgwt.client.widgets.grid.ListGrid; +import com.smartgwt.client.widgets.grid.ListGridRecord; +import org.rhq.core.domain.criteria.MeasurementScheduleCriteria; +import org.rhq.core.domain.measurement.MeasurementSchedule; +import org.rhq.core.domain.util.PageList; +import org.rhq.enterprise.gui.coregui.client.CoreGUI; +import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup; +import org.rhq.enterprise.gui.coregui.client.gwt.MeasurementDataGWTServiceAsync; +import org.rhq.enterprise.gui.coregui.client.util.RPCDataSource; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +/** + * A server-side SmartGWT DataSource for reading and updating {@link MeasurementSchedule}s. + * + * @author Ian Springer + */ +public abstract class AbstractMeasurementScheduleDataSource extends RPCDataSource<MeasurementSchedule> { + private MeasurementDataGWTServiceAsync measurementService = GWTServiceLookup.getMeasurementDataService(); + + protected AbstractMeasurementScheduleDataSource() { + super(); + + setCanMultiSort(true); + + List<DataSourceField> fields = createFields(); + addFields(fields); + } + + protected List<DataSourceField> createFields() { + List<DataSourceField> fields = new ArrayList<DataSourceField>(); + + DataSourceField idField = new DataSourceIntegerField(MeasurementScheduleCriteria.SORT_FIELD_DEFINITION_ID, + "Id"); + idField.setPrimaryKey(true); + idField.setHidden(true); + fields.add(idField); + + DataSourceTextField nameField = new DataSourceTextField(MeasurementScheduleCriteria.SORT_FIELD_DISPLAY_NAME, + "Metric"); + fields.add(nameField); + + DataSourceTextField descriptionField = new DataSourceTextField(MeasurementScheduleCriteria.SORT_FIELD_DESCRIPTION, + "Description"); + fields.add(descriptionField); + + DataSourceTextField typeField = new DataSourceTextField(MeasurementScheduleCriteria.SORT_FIELD_DATA_TYPE, + "Type"); + fields.add(typeField); + + DataSourceBooleanField enabledField = new DataSourceBooleanField(MeasurementScheduleCriteria.SORT_FIELD_ENABLED, + "Enabled?"); + fields.add(enabledField); + + DataSourceTextField intervalField = new DataSourceTextField(MeasurementScheduleCriteria.SORT_FIELD_INTERVAL, + "Collection Interval"); + fields.add(intervalField); + + return fields; + } + + protected void executeFetch(final DSRequest request, final DSResponse response) { + final long startTime = System.currentTimeMillis(); + + final MeasurementScheduleCriteria criteria = getCriteria(request); + + this.measurementService.findMeasurementSchedulesByCriteria(criteria, new AsyncCallback<PageList<MeasurementSchedule>>() { + public void onFailure(Throwable caught) { + CoreGUI.getErrorHandler().handleError("Failed to fetch measurement schedules for criteria " + criteria, + caught); + response.setStatus(RPCResponse.STATUS_FAILURE); + processResponse(request.getRequestId(), response); + } + + public void onSuccess(PageList<MeasurementSchedule> result) { + long fetchDuration = System.currentTimeMillis() - startTime; + System.out.println(result.size() + " measurement schedules fetched in: " + fetchDuration + "ms"); + + response.setData(buildRecords(result)); + // For paging to work, we have to specify size of full result set. + response.setTotalRows(result.getTotalSize()); + processResponse(request.getRequestId(), response); + } + }); + } + + protected MeasurementScheduleCriteria getCriteria(DSRequest request) { + MeasurementScheduleCriteria criteria = new MeasurementScheduleCriteria(); + criteria.fetchDefinition(true); + + Criteria requestCriteria = request.getCriteria(); + if (requestCriteria != null) { + Map values = requestCriteria.getValues(); + for (Object key : values.keySet()) { + String fieldName = (String) key; + if (fieldName.equals(MeasurementScheduleCriteria.FILTER_FIELD_RESOURCE_ID)) { + Integer resourceId = (Integer) values.get(fieldName); + criteria.addFilterResourceId(resourceId); + } else if (fieldName.equals(MeasurementScheduleCriteria.FILTER_FIELD_RESOURCE_GROUP_ID)) { + Integer resourceGroupId = (Integer) values.get(fieldName); + criteria.addFilterResourceGroupId(resourceGroupId); + } + // TODO: Add support for other fields we need to filter by (e.g. resourceTypeId for metric templates). + } + } + + criteria.setPageControl(getPageControl(request)); + return criteria; + } + + @Override + public MeasurementSchedule copyValues(ListGridRecord from) { + return null; // TODO: Implement? + } + + @Override + public ListGridRecord copyValues(MeasurementSchedule from) { + ListGridRecord record = new ListGridRecord(); + record.setAttribute("id", from.getId()); + record.setAttribute(MeasurementScheduleCriteria.SORT_FIELD_DISPLAY_NAME, from.getDefinition().getDisplayName()); + record.setAttribute(MeasurementScheduleCriteria.SORT_FIELD_DESCRIPTION, from.getDefinition().getDescription()); + record.setAttribute(MeasurementScheduleCriteria.SORT_FIELD_DATA_TYPE, from.getDefinition().getDataType().name()); + record.setAttribute(MeasurementScheduleCriteria.SORT_FIELD_ENABLED, from.isEnabled()); + record.setAttribute(MeasurementScheduleCriteria.SORT_FIELD_INTERVAL, from.getInterval()); + // TODO: resourceId and resourceGroupId (can probably be handled by subclasses) + return record; + } + + protected void executeRemove(final DSRequest request, final DSResponse response) { + JavaScriptObject data = request.getData(); + ListGridRecord record = new ListGridRecord(data); + Window.alert(String.valueOf(record.getAttributeAsInt("id"))); + } + + public void enableSchedules(AbstractMeasurementScheduleListView measurementScheduleListView) { + Integer[] measurementDefinitionIds = getMeasurementDefinitionIds(measurementScheduleListView); + enableSchedules(measurementScheduleListView, measurementDefinitionIds); + } + + protected abstract void enableSchedules(AbstractMeasurementScheduleListView measurementScheduleListView, + Integer[] measurementDefinitionIds); + + public void disableSchedules(AbstractMeasurementScheduleListView measurementScheduleListView) { + Integer[] measurementDefinitionIds = getMeasurementDefinitionIds(measurementScheduleListView); + disableSchedules(measurementScheduleListView, measurementDefinitionIds); + } + + protected abstract void disableSchedules(AbstractMeasurementScheduleListView measurementScheduleListView, + Integer[] measurementDefinitionIds); + + public void updateSchedules(AbstractMeasurementScheduleListView measurementScheduleListView, long interval) { + Integer[] measurementDefinitionIds = getMeasurementDefinitionIds(measurementScheduleListView); + updateSchedules(measurementScheduleListView, measurementDefinitionIds, interval); + } + + private Integer[] getMeasurementDefinitionIds(AbstractMeasurementScheduleListView measurementScheduleListView) { + ListGrid listGrid = measurementScheduleListView.getListGrid(); + ListGridRecord[] records = listGrid.getSelection(); + + Integer[] measurementDefinitionIds = new Integer[records.length]; + for (int i = 0, selectionLength = records.length; i < selectionLength; i++) { + ListGridRecord record = records[i]; + Integer measurementDefinitionId = record.getAttributeAsInt(MeasurementScheduleCriteria.SORT_FIELD_DEFINITION_ID); + measurementDefinitionIds[i] = measurementDefinitionId; + } + return measurementDefinitionIds; + } + + protected abstract void updateSchedules(final AbstractMeasurementScheduleListView measurementScheduleListView, + final Integer[] measurementDefinitionIds, final long interval); +} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMeasurementScheduleListView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMeasurementScheduleListView.java new file mode 100644 index 0000000..8d76d32 --- /dev/null +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMeasurementScheduleListView.java @@ -0,0 +1,81 @@ +/* + * RHQ Management Platform + * Copyright (C) 2010 Red Hat, Inc. + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ +package org.rhq.enterprise.gui.coregui.client.inventory.common; + +import com.smartgwt.client.data.Criteria; +import com.smartgwt.client.data.SortSpecifier; +import com.smartgwt.client.types.SortDirection; +import com.smartgwt.client.widgets.grid.ListGrid; +import com.smartgwt.client.widgets.grid.ListGridRecord; +import org.rhq.core.domain.criteria.MeasurementScheduleCriteria; +import org.rhq.enterprise.gui.coregui.client.components.table.Table; +import org.rhq.enterprise.gui.coregui.client.components.table.TableAction; + +/** + * A view that displays a non-paginated table of {@link org.rhq.core.domain.measurement.MeasurementSchedule measurement + * schedule}s, along with the ability to sort, enable, disable, or update the collection interval on those schedules. + * + * @author Ian Springer + */ +// TODO: Actually, this class probably does not need to be abstract... +public abstract class AbstractMeasurementScheduleListView extends Table { + private static final String TITLE = "Metric Collection Schedules"; + + private static final SortSpecifier[] SORT_SPECIFIERS = new SortSpecifier[]{ + new SortSpecifier(MeasurementScheduleCriteria.SORT_FIELD_DISPLAY_NAME, SortDirection.ASCENDING) + }; + + public AbstractMeasurementScheduleListView(AbstractMeasurementScheduleDataSource dataSource) { + this(dataSource, null, null); + } + + public AbstractMeasurementScheduleListView(AbstractMeasurementScheduleDataSource dataSource, Criteria criteria, String[] excludedFieldNames) { + super(TITLE, criteria, SORT_SPECIFIERS, excludedFieldNames); + setDataSource(dataSource); + } + + @Override + public AbstractMeasurementScheduleDataSource getDataSource() { + return (AbstractMeasurementScheduleDataSource) super.getDataSource(); + } + + @Override + protected void onInit() { + super.onInit(); + + ListGrid listGrid = getListGrid(); + listGrid.getField(MeasurementScheduleCriteria.SORT_FIELD_DISPLAY_NAME).setWidth("20%"); + listGrid.getField(MeasurementScheduleCriteria.SORT_FIELD_DESCRIPTION).setWidth("30%"); + listGrid.getField(MeasurementScheduleCriteria.SORT_FIELD_DATA_TYPE).setWidth("20%"); + listGrid.getField(MeasurementScheduleCriteria.SORT_FIELD_ENABLED).setWidth("10%"); + listGrid.getField(MeasurementScheduleCriteria.SORT_FIELD_INTERVAL).setWidth("20%"); + + addTableAction("Enable", Table.SelectionEnablement.ANY, null, new TableAction() { + public void executeAction(ListGridRecord[] selection) { + getDataSource().enableSchedules(AbstractMeasurementScheduleListView.this); + } + }); + addTableAction("Disable", Table.SelectionEnablement.ANY, null, new TableAction() { + public void executeAction(ListGridRecord[] selection) { + getDataSource().disableSchedules(AbstractMeasurementScheduleListView.this); + } + }); + // TODO: Add controls to set collection interval - base class is going to need massaging... + } +} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/RPCDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/RPCDataSource.java index 95436d4..1b6f6cd 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/RPCDataSource.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/RPCDataSource.java @@ -23,6 +23,7 @@ import java.util.Collection; import com.smartgwt.client.data.DSRequest; import com.smartgwt.client.data.DSResponse; import com.smartgwt.client.data.DataSource; +import com.smartgwt.client.data.DataSourceField; import com.smartgwt.client.types.DSDataFormat; import com.smartgwt.client.types.DSProtocol; import com.smartgwt.client.widgets.grid.ListGridRecord; @@ -169,4 +170,10 @@ public abstract class RPCDataSource<T> extends DataSource { response.setStatus(0); return response; } + + public void addFields(Collection<DataSourceField> fields) { + for (DataSourceField field : fields) { + addField(field); + } + } }
commit 1043bd79d2744f13a4b8db9b54fc7df9811fa619 Author: Joseph Marques joseph@redhat.com Date: Thu Aug 12 16:24:14 2010 -0400
BZ-536368 - fix for ConcurrentModificationException during resource discovery
diff --git a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/RuntimeDiscoveryExecutor.java b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/RuntimeDiscoveryExecutor.java index c16ba56..1d803b4 100644 --- a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/RuntimeDiscoveryExecutor.java +++ b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/RuntimeDiscoveryExecutor.java @@ -136,7 +136,7 @@ public class RuntimeDiscoveryExecutor implements Runnable, Callable<InventoryRep discoverForResource(platform, report, false);
// Next discover all other services and non-top-level servers - Set<Resource> servers = platform.getChildResources(); + Set<Resource> servers = new HashSet<Resource>(platform.getChildResources()); // prevent concurrent mod for (Resource server : servers) { discoverForResource(server, report, false); }
commit 733cabfa08d3ca73b943665a65771ee7fef41256 Author: Joseph Marques joseph@redhat.com Date: Thu Aug 12 14:54:11 2010 -0400
mplement "plain" / "nomenu" scheme using iframed-struts for unimplemented metric templates section
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/struts-config.xml b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/struts-config.xml index 6c08474..61a14fe 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/struts-config.xml +++ b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/struts-config.xml @@ -1264,6 +1264,16 @@ <forward name="success" path="/resource/platform/monitor/Config.do?mode=configure"/> </action>
+ <action path="/resource/platform/monitor/config/ConfigMetricsNoMenu" + name="MonitoringConfigForm" + scope="request" + input="/resource/platform/monitor/Config.do?mode=configure&nomenu=true" + type="org.rhq.enterprise.gui.legacy.action.resource.common.monitor.config.ConfigMetricsAction"> + <forward name="remove" path="/resource/platform/monitor/Config.do?mode=configure&nomenu=true"/> + <forward name="failure" path="/resource/platform/monitor/Config.do?mode=configure&nomenu=true"/> + <forward name="success" path="/resource/platform/monitor/Config.do?mode=configure&nomenu=true"/> + </action> + <!-- / -->
<!-- server monitoring actions --> @@ -3135,6 +3145,16 @@ <forward name="failure" path="/admin/platform/monitor/Config.do?mode=configure"/> <forward name="success" path="/admin/platform/monitor/Config.do?mode=configure"/> </action> + + <action path="/resource/common/monitor/config/ConfigMetricsNoMenu" + name="MonitoringConfigForm" + scope="request" + input="/admin/platform/monitor/Config.do?mode=configure&nomenu=true" + type="org.rhq.enterprise.gui.legacy.action.resource.common.monitor.config.ConfigMetricsAction"> + <forward name="remove" path="/admin/platform/monitor/Config.do?mode=configure&nomenu=true"/> + <forward name="failure" path="/admin/platform/monitor/Config.do?mode=configure&nomenu=true"/> + <forward name="success" path="/admin/platform/monitor/Config.do?mode=configure&nomenu=true"/> + </action>
<!-- === Resource Monitor>Events Tab === --> <action path="/resource/common/Events" diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/admin/config/ChangeResourceTemplate.jsp b/modules/enterprise/gui/portal-war/src/main/webapp/admin/config/ChangeResourceTemplate.jsp index 988672f..0ec1a85 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/admin/config/ChangeResourceTemplate.jsp +++ b/modules/enterprise/gui/portal-war/src/main/webapp/admin/config/ChangeResourceTemplate.jsp @@ -32,9 +32,16 @@ <td class="ListCellPrimary"><c:out value="${entry.type.name}"/> <c:out value="${entry.pluginInfo}"/></td> <td class="ListCell" align="left" nowrap="nowrap"> <c:if test="${monitorEnabled}"> - <html:link page="/admin/platform/monitor/Config.do?mode=configure&id=${entry.type.id}&type=${entry.type.id}" styleClass="buttonsmall"> - Edit Metric Template - </html:link> + <c:if test="${not empty param.nomenu}"> + <html:link page="/admin/platform/monitor/Config.do?nomenu=true&mode=configure&id=${entry.type.id}&type=${entry.type.id}" styleClass="buttonsmall"> + Edit Metric Template + </html:link> + </c:if> + <c:if test="${empty param.nomenu}"> + <html:link page="/admin/platform/monitor/Config.do?mode=configure&id=${entry.type.id}&type=${entry.type.id}" styleClass="buttonsmall"> + Edit Metric Template + </html:link> + </c:if> <c:if test="${(entry.enabledMetricCount + entry.disabledMetricCount) > 0}"> <span title="(enabled | disabled)"> (<c:out value="${entry.enabledMetricCount}" /> | <c:out value="${entry.disabledMetricCount}" />) @@ -99,9 +106,16 @@ <td class="ListCellPrimary"><c:out value="${entry.type.name}"/> <c:out value="${entry.pluginInfo}"/></td> <td class="ListCell" align="left"> <c:if test="${monitorEnabled}"> - <html:link page="/admin/platform/monitor/Config.do?mode=configure&type=${entry.type.id}" styleClass="buttonsmall"> - Edit Metric Template - </html:link> + <c:if test="${not empty param.nomenu}"> + <html:link page="/admin/platform/monitor/Config.do?nomenu=true&mode=configure&type=${entry.type.id}" styleClass="buttonsmall"> + Edit Metric Template + </html:link> + </c:if> + <c:if test="${empty param.nomenu}"> + <html:link page="/admin/platform/monitor/Config.do?mode=configure&type=${entry.type.id}" styleClass="buttonsmall"> + Edit Metric Template + </html:link> + </c:if> <c:if test="${(entry.enabledMetricCount + entry.disabledMetricCount) > 0}"> <span title="(enabled | disabled)"> (<c:out value="${entry.enabledMetricCount}" /> | <c:out value="${entry.disabledMetricCount}" />) diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/config/ConfigMetrics.jsp b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/config/ConfigMetrics.jsp index 8ce14ae..26b0682 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/config/ConfigMetrics.jsp +++ b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/config/ConfigMetrics.jsp @@ -22,17 +22,30 @@ <c:param name="mode" value="configure"/> <c:param name="groupId" value="${groupId}"/> <c:param name="category" value="COMPATIBLE"/> + <c:if test="${not empty param.nomenu}"> + <c:param name="nomenu" value="${param.nomenu}" /> + </c:if> </c:url> </c:when> <c:otherwise> <c:url var="selfAction" value="/resource/common/monitor/Config.do"> <c:param name="mode" value="configure"/> <c:param name="id" value="${Resource.id}"/> + <c:if test="${not empty param.nomenu}"> + <c:param name="nomenu" value="${param.nomenu}" /> + </c:if> </c:url> </c:otherwise> </c:choose>
-<html:form action="/resource/${section}/monitor/config/ConfigMetrics"> +<c:if test="${not empty param.nomenu}"> + <c:set var="actionSuffix" value="NoMenu" /> +</c:if> +<c:if test="${empty param.nomenu}"> + <c:set var="actionSuffix" value="" /> +</c:if> + +<html:form action="/resource/${section}/monitor/config/ConfigMetrics${actionSuffix}"> <c:choose> <c:when test="${not empty ResourceType && empty param.parent}"> <!-- resource type wasn't empty so it is a default--> diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/config/EditConfigMetricsVisibility.jsp b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/config/EditConfigMetricsVisibility.jsp index c89b9e7..6780c28 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/config/EditConfigMetricsVisibility.jsp +++ b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/config/EditConfigMetricsVisibility.jsp @@ -40,6 +40,9 @@ <c:if test="${not empty param.ps}"> <c:param name="ps" value="${param.ps}"/> </c:if> + <c:if test="${not empty param.nomenu}"> + <c:param name="nomenu" value="${param.nomenu}"/> + </c:if> </c:url> <c:if test="${ResourceType != null && param.parent > 0}"> <c:set var="isAutoGroup" value="true"/> diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/config/ShowOneResourceType.jsp b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/config/ShowOneResourceType.jsp index 4ce0cf2..9165090 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/config/ShowOneResourceType.jsp +++ b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/config/ShowOneResourceType.jsp @@ -50,9 +50,16 @@ </td> <td class="ListCell" align="left" nowrap="nowrap"> <c:if test="${monitorEnabled}"> - <html:link page="/admin/platform/monitor/Config.do?mode=configure&id=${serviceType.type.id}&type=${serviceType.type.id}" styleClass="buttonsmall"> - Edit Metric Template - </html:link> + <c:if test="${not empty param.nomenu}"> + <html:link page="/admin/platform/monitor/Config.do?nomenu=true&mode=configure&id=${serviceType.type.id}&type=${serviceType.type.id}" styleClass="buttonsmall"> + Edit Metric Template + </html:link> + </c:if> + <c:if test="${empty param.nomenu}"> + <html:link page="/admin/platform/monitor/Config.do?mode=configure&id=${serviceType.type.id}&type=${serviceType.type.id}" styleClass="buttonsmall"> + Edit Metric Template + </html:link> + </c:if> <c:if test="${(serviceType.enabledMetricCount + serviceType.disabledMetricCount) > 0}"> <span title="(enabled | disabled)"> (<c:out value="${serviceType.enabledMetricCount}" /> | <c:out value="${serviceType.disabledMetricCount}" />)
commit d8fca9dc8305e86a642cd4be9633b93476670c98 Author: Joseph Marques joseph@redhat.com Date: Thu Aug 12 13:57:54 2010 -0400
implement "plain" scheme using iframed-facelets for unimplemented admin > config > plugins section
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/AdministrationView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/AdministrationView.java index dc1bb5c..5779155 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/AdministrationView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/AdministrationView.java @@ -241,7 +241,7 @@ public class AdministrationView extends HLayout implements BookmarkableView { } else if ("License".equals(page)) { url = "/admin/license/LicenseAdmin.do?mode=view"; } else if ("Plugins".equals(page)) { - url = "/rhq/admin/plugin/plugin-list.xhtml"; + url = "/rhq/admin/plugin/plugin-list-plain.xhtml"; } url = addQueryStringParam(url, "nomenu=true"); content = new FullHTMLPane(url); diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation/admin-navigation-plain.xml b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation/admin-navigation-plain.xml new file mode 100644 index 0000000..e2c4d98 --- /dev/null +++ b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation/admin-navigation-plain.xml @@ -0,0 +1,106 @@ +<?xml version="1.0"?> + +<faces-config version="1.2" xmlns="http://java.sun.com/xml/ns/javaee" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd%22%3E + + <navigation-rule> + <from-view-id>/rhq/admin/largeenv-plain.xhtml</from-view-id> + + <navigation-case> + <!-- catch all navigation-case: if any actions return 'success', go here --> + <from-outcome>success</from-outcome> + <to-view-id>/rhq/admin/largeenv-plain.xhtml</to-view-id> + <redirect/> + </navigation-case> + + </navigation-rule> + + <navigation-rule> + <from-view-id>/rhq/admin/plugin/plugin-list-plain.xhtml</from-view-id> + + <navigation-case> + <!-- catch all navigation-case: if any actions return 'success', go here --> + <from-action>#{InstalledPluginsUIBean.uploadPlugin}</from-action> + <from-outcome>success</from-outcome> + <to-view-id>/rhq/admin/plugin/plugin-list-plain.xhtml</to-view-id> + <redirect/> + </navigation-case> + + </navigation-rule> + + <navigation-rule> + <from-view-id>/rhq/admin/plugin/plugin-config-plain.xhtml</from-view-id> + + <navigation-case> + <from-action>#{ConfigHelperUIBean.accessMap}</from-action> + <to-view-id>/rhq/admin/plugin/plugin-edit-view-map-plain.xhtml?plugin=#{pluginConfigUIBean.plugin.name}&deployment=#{pluginConfigUIBean.plugin.deployment}&pluginType=#{pluginConfigUIBean.plugin.type}&listName=#{param.listName}&listIndex=#{param.listIndex}</to-view-id> + + <redirect /> + </navigation-case> + </navigation-rule> + + <navigation-rule> + <from-view-id>/rhq/admin/plugin/plugin-edit-plain.xhtml</from-view-id> + + <navigation-case> + <from-action>#{ConfigHelperUIBean.addNewMap}</from-action> + <to-view-id>/rhq/admin/plugin/plugin-edit-add-map-plain.xhtml</to-view-id> + </navigation-case> + + <navigation-case> + <from-action>#{ConfigHelperUIBean.accessMap}</from-action> + <to-view-id>/rhq/admin/plugin/plugin-edit-update-map-plain.xhtml</to-view-id> + </navigation-case> + + <navigation-case> + <from-action>#{editPluginConfigurationUIBean.updatePlugin}</from-action> + <from-outcome>success</from-outcome> + <to-view-id>/rhq/admin/plugin/plugin-config-plain.xhtml?pluginName=#{editPluginConfigurationUIBean.plugin.name}</to-view-id> + + <redirect /> + </navigation-case> + </navigation-rule> + + <navigation-rule> + <from-view-id>/rhq/admin/plugin/plugin-edit-add-map-plain.xhtml</from-view-id> + + <navigation-case> + <from-outcome>success</from-outcome> + <to-view-id>/rhq/admin/plugin/plugin-edit-plain.xhtml?plugin=#{pluginConfigUIBean.plugin.name}&deployment=#{pluginConfigUIBean.plugin.deployment}&pluginType=#{pluginConfigUIBean.plugin.type}</to-view-id> + + <redirect/> + </navigation-case> + + </navigation-rule> + + <navigation-rule> + <from-view-id>/rhq/admin/plugin/plugin-edit-update-map-plain.xhtml</from-view-id> + + <navigation-case> + <from-outcome>success</from-outcome> + <to-view-id>/rhq/admin/plugin/plugin-edit-plain.xhtml?plugin=#{pluginConfigUIBean.plugin.name}&deployment=#{pluginConfigUIBean.plugin.deployment}&pluginType=#{pluginConfigUIBean.plugin.type}</to-view-id> + + <redirect/> + </navigation-case> + + </navigation-rule> + + <navigation-rule> + <from-view-id>/rhq/admin/plugin/plugin-details-plain.xhtml</from-view-id> + <navigation-case> + <from-outcome>success</from-outcome> + <to-view-id>/rhq/admin/plugin/plugin-details-plain.xhtml?plugin=#{plugin.name}&deployment=#{plugin.deployment}&pluginType=#{serverPlugin.type}&control=#{param.control}</to-view-id> + <redirect/> + </navigation-case> + </navigation-rule> + + <navigation-rule> + <navigation-case> + <from-outcome>sessionExpired</from-outcome> + <to-view-id>/Login.do</to-view-id> + <redirect/> + </navigation-case> + </navigation-rule> + +</faces-config> \ No newline at end of file diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/web.xml b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/web.xml index 87580b6..ed22bc6 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/web.xml +++ b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/web.xml @@ -162,6 +162,7 @@ /WEB-INF/jsf-navigation/summary-navigation.xml, /WEB-INF/jsf-navigation/test-navigation.xml,
+ /WEB-INF/jsf-navigation/admin-plain-navigation.xml, /WEB-INF/jsf-navigation/alert-plain-navigation.xml, /WEB-INF/jsf-navigation/cluster-plain-navigation.xml, /WEB-INF/jsf-navigation/content-plain-navigation.xml, diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/admin/plugin/plugin-config-plain.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/admin/plugin/plugin-config-plain.xhtml new file mode 100644 index 0000000..56c872d --- /dev/null +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/admin/plugin/plugin-config-plain.xhtml @@ -0,0 +1,108 @@ +<ui:composition template="/rhq/entity/layout/main-plain.xhtml" + xmlns="http://www.w3.org/1999/xhtml" + xmlns:h="http://java.sun.com/jsf/html" + xmlns:f="http://java.sun.com/jsf/core" + xmlns:ui="http://java.sun.com/jsf/facelets" + xmlns:c="http://java.sun.com/jstl/core" + xmlns:onc="http://jboss.org/on/component" + xmlns:onf="http://jboss.org/on/function" + xmlns:s="http://jboss.com/products/seam/taglib" + xmlns:a4j="https://ajax4jsf.dev.java.net/ajax" + xmlns:rich="http://richfaces.ajax4jsf.org/rich%22%3E + + <ui:define name="content"> + + <h:form id="pluginsConfigForm"> + <h:panelGrid columns="2" width="100%" columnClasses="col1,col2"> + rich:panel + <f:facet name="header"> + <h:outputText value="Available Plugins" /> + </f:facet> + + <rich:tree nodeSelectListener="#{pluginConfigUIBean.processSelection}" + adviseNodeSelected="#{pluginConfigUIBean.adviseSelected}" + adviseNodeOpened="#{pluginConfigUIBean.adviseOpened}" + reRender="pluginConfig" + value="#{pluginConfigUIBean.root}" + ajaxSubmitSelection="true" + switchType="client" + var="item" + toggleOnClick="false" + nodeFace="#{item.class.simpleName}" + > + + <rich:treeNode type="String"> + <h:outputText value="#{item}s" /> + </rich:treeNode> + <rich:treeNode type="ServerPlugin"> + <h:outputText value="#{item.displayName}" /> + </rich:treeNode> + </rich:tree> + </rich:panel> + + <h:panelGroup id="pluginConfig"> + <rich:panel id="detailsLink" + style="background: #EEEEEE;" + rendered="#{pluginConfigUIBean.plugin != null}" > + <h:outputText value="See the " /> + <h:outputLink value="/rhq/admin/plugin/plugin-details-plain.xhtml"> + <f:param name="plugin" value="#{pluginConfigUIBean.plugin.name}"/> + <f:param name="deployment" value="#{pluginConfigUIBean.plugin.deployment}"/> + <f:param name="pluginType" value="#{pluginConfigUIBean.plugin.type}"/> + <h:outputText value="'#{pluginConfigUIBean.plugin.displayName}' details page"/> + </h:outputLink> + <h:outputText value=" for more plugin information." /> + </rich:panel> + + <rich:panel id="noConfigMessage" + style="background: #EEEEEE;" + rendered="#{not pluginConfigUIBean.editable and pluginConfigUIBean.plugin != null}" > + <h:outputText escape="true" value="Plugin '#{pluginConfigUIBean.plugin.displayName}' has no configuration." /> + </rich:panel> + + <rich:panel id="pluginButtonsTopPanel" rendered="#{pluginConfigUIBean.editable}"> + <h:panelGroup id="pluginButtonsTop"> + <h:outputLink value="/rhq/admin/plugin/plugin-edit-plain.xhtml" styleClass="buttonmed"> + <f:param name="plugin" value="#{pluginConfigUIBean.plugin.name}"/> + <f:param name="deployment" value="#{pluginConfigUIBean.plugin.deployment}"/> + <f:param name="pluginType" value="#{pluginConfigUIBean.plugin.type}"/> + <h:outputText value="EDIT"/> + </h:outputLink> + </h:panelGroup> + </rich:panel> + + <rich:panel rendered="#{pluginConfigUIBean.plugin.pluginConfiguration != null}"> + <f:facet name="header"> + <h:outputText value="Plugin Configuration"/> + </f:facet> + <onc:config configurationDefinition="#{pluginConfigUIBean.pluginConfigurationDefinition}" + configuration="#{pluginConfigUIBean.plugin.pluginConfiguration}" + readOnly="true" /> + </rich:panel> + + <rich:panel rendered="#{pluginConfigUIBean.plugin.scheduledJobsConfiguration != null}"> + <f:facet name="header"> + <h:outputText value="Scheduled Jobs"/> + </f:facet> + <onc:config configurationDefinition="#{pluginConfigUIBean.scheduledJobsDefinition}" + configuration="#{pluginConfigUIBean.plugin.scheduledJobsConfiguration}" + readOnly="true" /> + </rich:panel> + + <rich:panel id="pluginButtonsBottomPanel" rendered="#{pluginConfigUIBean.editable}"> + <h:panelGroup id="pluginButtonsBottom"> + <h:outputLink value="/rhq/admin/plugin/plugin-edit-plain.xhtml" styleClass="buttonmed"> + <f:param name="plugin" value="#{pluginConfigUIBean.plugin.name}"/> + <f:param name="deployment" value="#{pluginConfigUIBean.plugin.deployment}"/> + <f:param name="pluginType" value="#{pluginConfigUIBean.plugin.type}"/> + <h:outputText value="EDIT"/> + </h:outputLink> + </h:panelGroup> + </rich:panel> + + </h:panelGroup> + </h:panelGrid> + </h:form> + </ui:define> + +</ui:composition> diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/admin/plugin/plugin-details-plain.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/admin/plugin/plugin-details-plain.xhtml new file mode 100644 index 0000000..fc22797 --- /dev/null +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/admin/plugin/plugin-details-plain.xhtml @@ -0,0 +1,155 @@ +<ui:composition template="/rhq/entity/layout/main-plain.xhtml" + xmlns="http://www.w3.org/1999/xhtml" + xmlns:h="http://java.sun.com/jsf/html" + xmlns:f="http://java.sun.com/jsf/core" + xmlns:ui="http://java.sun.com/jsf/facelets" + xmlns:c="http://java.sun.com/jstl/core" + xmlns:onc="http://jboss.org/on/component" + xmlns:onf="http://jboss.org/on/function" + xmlns:s="http://jboss.com/products/seam/taglib" + xmlns:a4j="https://ajax4jsf.dev.java.net/ajax" + xmlns:rich="http://richfaces.ajax4jsf.org/rich%22%3E + + <ui:define name="content"> + + <h:form id="pluginsForm"> + + rich:panel + <f:facet name="header"> + <h:outputText value="Plugin: #{plugin.displayName} (#{plugin.name})"/> + </f:facet> + + <h:panelGrid styleClass="BlockContent" columns="4" width="100%"> + + <h:outputLabel styleClass="BlockLabel" value="Version:"/> + <h:outputText styleClass="BlockContent" value="#{plugin.version}"/> + + <h:outputLabel styleClass="BlockLabel" value="AMPS Version:"/> + <h:outputText styleClass="BlockContent" value="#{plugin.ampsVersion}"/> + + <h:outputLabel styleClass="BlockLabel" value="Enabled:"/> + <h:outputText styleClass="BlockContent" value="#{plugin.enabled}"/> + + <h:outputLabel styleClass="BlockLabel" value="Type:"/> + <h:outputText styleClass="BlockContent" value="#{plugin.deployment}"/> + + <h:outputLabel styleClass="BlockLabel" value="MD5:"/> + <h:outputText styleClass="BlockContent" value="#{plugin.md5}"/> + + <h:outputLabel styleClass="BlockLabel" value="Description:"/> + <h:outputText styleClass="BlockContent" value="#{plugin.description}"/> + + <h:outputLabel styleClass="BlockLabel" value="Path:"/> + <h:outputText styleClass="BlockContent" value="#{plugin.path}"/> + </h:panelGrid> + + <br /> + <h:outputLink value="/rhq/admin/plugin/plugin-config-plain.xhtml" rendered="#{plugin.deployment eq 'SERVER'}"> + <f:param name="pluginName" value="#{plugin.name}"/> + <h:outputText value="Configure '#{plugin.displayName}'"/> + </h:outputLink> + <br /> + <br /> + + rich:panel + <f:facet name="header"> + <h:outputText value="Plugin Help"/> + </f:facet> + + <h:outputText escape="false" value="<pre> #{plugin.help} </pre>"/> + </rich:panel> + + <rich:panel rendered="#{plugin.deployment == 'SERVER' and ServerPluginControlUIBean.controls.size > 0 and ServerPluginControlUIBean.permission }"> + <f:facet name="header"> + <h:outputText value="Plugin Controls"/> + </f:facet> + + <rich:dataTable id="serverPluginsDataTable" + value="#{ServerPluginControlUIBean.controls}" + var="control" + width="100%" + columnsWidth="25% 75%" + headerClass="tableRowHeader" + footerClass="on-pager-footer" + onRowMouseOver="this.style.backgroundColor='#E7E7E7'" + onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"> + + rich:column + <f:facet name="header"> + <h:outputText styleClass="headerText" value="Name"/> + </f:facet> + + <h:outputLink value="/rhq/admin/plugin/plugin-details-plain.xhtml"> + <f:param name="plugin" value="#{plugin.name}"/> + <f:param name="deployment" value="#{plugin.deployment}"/> + <f:param name="pluginType" value="#{plugin.type}"/> + <f:param name="control" value="#{control[0]}"/> + <h:outputText value="#{control[1]} *" rendered="#{param.control eq control[0]}"/> + <h:outputText value="#{control[1]}" rendered="#{param.control ne control[0]}"/> + </h:outputLink> + </rich:column> + + rich:column + <f:facet name="header"> + <h:outputText styleClass="headerText" value="Description"/> + </f:facet> + + <h:outputText value="#{control[2]}"/> + </rich:column> + </rich:dataTable> + + <br/> + <onc:config id="paramConfig" + rendered="#{param.control ne null}" + readOnly="#{ServerPluginControlUIBean.resultsAvailable}" + configurationDefinition="#{ServerPluginControlUIBean.paramsDefinition}" + configuration="#{ServerPluginControlUIBean.paramsConfiguration}" + nullConfigurationDefinitionMessage="This control does not accept parameters" + nullConfigurationMessage="This control does not accept parameters!" + nullConfigurationStyle="InfoBlock"/> + <br /> + <input type="hidden" name="plugin" value="#{plugin.name}" /> + <input type="hidden" name="deployment" value="#{plugin.deployment}" /> + <input type="hidden" name="pluginType" value="#{serverPlugin.type}" /> + <c:if test="${not empty param.control}"> + <input type="hidden" name="control" value="#{param.control}" /> + </c:if> + <h:commandButton action="#{ServerPluginControlUIBean.invokeControl}" + rendered="#{param.control ne null and !ServerPluginControlUIBean.resultsAvailable }" + value="EXECUTE" + styleClass="buttonmed" + onclick="return preventDoubleClick();"/> + <br/> + <h:panelGrid rendered="#{ServerPluginControlUIBean.resultsAvailable}"> + rich:panel + <h:outputText rendered="#{ServerPluginControlUIBean.resultsError ne null}" value="Results: #{ServerPluginControlUIBean.resultsError}" styleClass="ErrorBlock" /> + <h:outputText rendered="#{ServerPluginControlUIBean.resultsError eq null}" value="Results: Success!" styleClass="InfoBlock" /> + </rich:panel> + <rich:panel rendered="#{ServerPluginControlUIBean.resultsDefinition ne null}"> + <onc:config id="resultsConfig" + readOnly="true" + configurationDefinition="#{ServerPluginControlUIBean.resultsDefinition}" + configuration="#{ServerPluginControlUIBean.resultsConfiguration}" + nullConfigurationDefinitionMessage="No result properties were returned" + nullConfigurationMessage="No result properties were returned!" + nullConfigurationStyle="#{ServerPluginControlUIBean.resultsError eq null ? 'InfoBlock' : 'WarnBlock'}"/> + </rich:panel> + </h:panelGrid> + + + </rich:panel> + + </rich:panel> + </h:form> + + <script type="text/javascript"> + var submitted = false; + function preventDoubleClick() { + if (submitted) { return false; } + else { submitted = true; return true; } + } + </script> + + </ui:define> + + </ui:composition> diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/admin/plugin/plugin-edit-add-map-plain.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/admin/plugin/plugin-edit-add-map-plain.xhtml new file mode 100644 index 0000000..73d77e6 --- /dev/null +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/admin/plugin/plugin-edit-add-map-plain.xhtml @@ -0,0 +1,28 @@ +<ui:composition template="/rhq/admin/plugin/plugin-edit-map-plain.xhtml" + xmlns="http://www.w3.org/1999/xhtml" + xmlns:h="http://java.sun.com/jsf/html" + xmlns:f="http://java.sun.com/jsf/core" + xmlns:ui="http://java.sun.com/jsf/facelets" + xmlns:c="http://java.sun.com/jstl/core" + xmlns:onc="http://jboss.org/on/component" + xmlns:onf="http://jboss.org/on/function" + xmlns:s="http://jboss.com/products/seam/taglib" + xmlns:a4j="https://ajax4jsf.dev.java.net/ajax" + xmlns:rich="http://richfaces.ajax4jsf.org/rich%22%3E + + <ui:param name="actionVerb" value="Add to" /> + <ui:param name="editBreadCrumb" value="true" /> + + <ui:define name="mapConfig"> + <onc:config configurationDefinition="#{editPluginConfigurationUIBean.currentConfigurationDefinition}" + configuration="#{editPluginConfigurationUIBean.currentConfiguration}" + listName="#{param.listName}" /> + + <h:panelGrid columns="2" styleClass="buttons-table" columnClasses="button-cell"> + <h:commandButton value="OK" type="submit" action="#{editPluginConfigurationUIBean.finishMap}" + alt="Click to Add Map" styleClass="buttonmed"/> + <h:commandButton value="RESET" type="reset" immediate="true" + alt="Click to Reset Fields" styleClass="buttonmed"/> + </h:panelGrid> + </ui:define> +</ui:composition> \ No newline at end of file diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/admin/plugin/plugin-edit-map-plain.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/admin/plugin/plugin-edit-map-plain.xhtml new file mode 100644 index 0000000..8e0f8b9 --- /dev/null +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/admin/plugin/plugin-edit-map-plain.xhtml @@ -0,0 +1,21 @@ +<ui:composition template="/rhq/entity/layout/main-plain.xhtml" + xmlns="http://www.w3.org/1999/xhtml" + xmlns:h="http://java.sun.com/jsf/html" + xmlns:f="http://java.sun.com/jsf/core" + xmlns:ui="http://java.sun.com/jsf/facelets" + xmlns:c="http://java.sun.com/jstl/core" + xmlns:onc="http://jboss.org/on/component" + xmlns:onf="http://jboss.org/on/function" + xmlns:s="http://jboss.com/products/seam/taglib" + xmlns:a4j="https://ajax4jsf.dev.java.net/ajax" + xmlns:rich="http://richfaces.ajax4jsf.org/rich%22%3E + + <ui:define name="content"> + + <h:form id="editPluginConfigurationForm" onsubmit="prepareInputsForSubmission(this)"> + <ui:insert name="mapConfig" /> + </h:form> + + </ui:define> + +</ui:composition> diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/admin/plugin/plugin-edit-plain.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/admin/plugin/plugin-edit-plain.xhtml new file mode 100644 index 0000000..ffa8733 --- /dev/null +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/admin/plugin/plugin-edit-plain.xhtml @@ -0,0 +1,41 @@ +<ui:composition template="/rhq/entity/layout/main-plain.xhtml" + xmlns="http://www.w3.org/1999/xhtml" + xmlns:h="http://java.sun.com/jsf/html" + xmlns:f="http://java.sun.com/jsf/core" + xmlns:ui="http://java.sun.com/jsf/facelets" + xmlns:c="http://java.sun.com/jstl/core" + xmlns:onc="http://jboss.org/on/component" + xmlns:onf="http://jboss.org/on/function" + xmlns:s="http://jboss.com/products/seam/taglib" + xmlns:a4j="https://ajax4jsf.dev.java.net/ajax" + xmlns:rich="http://richfaces.ajax4jsf.org/rich%22%3E + + <ui:define name="content"> + + <h:form id="pluginConfigForm"> + <rich:panel rendered="#{editPluginConfigurationUIBean.plugin.pluginConfiguration != null}"> + <f:facet name="header"> + <h:outputText value="Plugin Configuration"/> + </f:facet> + <onc:config configurationDefinition="#{editPluginConfigurationUIBean.pluginConfigurationDefinition}" + configuration="#{editPluginConfigurationUIBean.plugin.pluginConfiguration}" /> + </rich:panel> + + <rich:panel rendered="#{editPluginConfigurationUIBean.plugin.scheduledJobsConfiguration != null}"> + <f:facet name="header"> + <h:outputText value="Scheduled Jobs"/> + </f:facet> + <onc:config configurationDefinition="#{editPluginConfigurationUIBean.scheduledJobsDefinition}" + configuration="#{editPluginConfigurationUIBean.plugin.scheduledJobsConfiguration}" /> + </rich:panel> + + <h:panelGroup id="pluginButtons"> + <h:commandButton value="SAVE" type="submit" action="#{editPluginConfigurationUIBean.updatePlugin}" + alt="Click to Save Changes" styleClass="buttonmed" /> + <h:commandButton value="RESET" type="reset" immediate="true" + title="Click to Reset Fields" styleClass="buttonmed"/> + </h:panelGroup> + </h:form> + </ui:define> + +</ui:composition> diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/admin/plugin/plugin-edit-update-map-plain.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/admin/plugin/plugin-edit-update-map-plain.xhtml new file mode 100644 index 0000000..8d847b7 --- /dev/null +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/admin/plugin/plugin-edit-update-map-plain.xhtml @@ -0,0 +1,29 @@ +<ui:composition template="/rhq/admin/plugin/plugin-edit-map-plain.xhtml" + xmlns="http://www.w3.org/1999/xhtml" + xmlns:h="http://java.sun.com/jsf/html" + xmlns:f="http://java.sun.com/jsf/core" + xmlns:ui="http://java.sun.com/jsf/facelets" + xmlns:c="http://java.sun.com/jstl/core" + xmlns:onc="http://jboss.org/on/component" + xmlns:onf="http://jboss.org/on/function" + xmlns:s="http://jboss.com/products/seam/taglib" + xmlns:a4j="https://ajax4jsf.dev.java.net/ajax" + xmlns:rich="http://richfaces.ajax4jsf.org/rich%22%3E + + <ui:param name="actionVerb" value="Update" /> + <ui:param name="editBreadCrumb" value="true" /> + + <ui:define name="mapConfig"> + <onc:config configurationDefinition="#{editPluginConfigurationUIBean.currentConfigurationDefinition}" + configuration="#{editPluginConfigurationUIBean.currentConfiguration}" + listName="#{param.listName}" + listIndex="#{param.listIndex}" /> + + <h:panelGrid columns="2" styleClass="buttons-table" columnClasses="button-cell"> + <h:commandButton value="OK" type="submit" action="#{editPluginConfigurationUIBean.finishMap}" + alt="Click to Update Map" styleClass="buttonmed"/> + <h:commandButton value="RESET" type="reset" immediate="true" + alt="Click to Reset Fields" styleClass="buttonmed"/> + </h:panelGrid> + </ui:define> +</ui:composition> diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/admin/plugin/plugin-edit-view-map-plain.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/admin/plugin/plugin-edit-view-map-plain.xhtml new file mode 100644 index 0000000..02b18c4 --- /dev/null +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/admin/plugin/plugin-edit-view-map-plain.xhtml @@ -0,0 +1,22 @@ +<ui:composition template="/rhq/admin/plugin/plugin-edit-map-plain.xhtml" + xmlns="http://www.w3.org/1999/xhtml" + xmlns:h="http://java.sun.com/jsf/html" + xmlns:f="http://java.sun.com/jsf/core" + xmlns:ui="http://java.sun.com/jsf/facelets" + xmlns:c="http://java.sun.com/jstl/core" + xmlns:onc="http://jboss.org/on/component" + xmlns:onf="http://jboss.org/on/function" + xmlns:s="http://jboss.com/products/seam/taglib" + xmlns:a4j="https://ajax4jsf.dev.java.net/ajax" + xmlns:rich="http://richfaces.ajax4jsf.org/rich%22%3E + + <ui:param name="actionVerb" value="View" /> + + <ui:define name="mapConfig"> + <onc:config configurationDefinition="#{editPluginConfigurationUIBean.scheduledJobsDefinition}" + configuration="#{editPluginConfigurationUIBean.plugin.scheduledJobsConfiguration}" + listName="#{param.listName}" + listIndex="#{param.listIndex}" + readOnly="true" /> + </ui:define> +</ui:composition> diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/admin/plugin/plugin-list-plain.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/admin/plugin/plugin-list-plain.xhtml new file mode 100644 index 0000000..c85a6c1 --- /dev/null +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/admin/plugin/plugin-list-plain.xhtml @@ -0,0 +1,268 @@ +<ui:composition template="/rhq/entity/layout/main-plain.xhtml" + xmlns="http://www.w3.org/1999/xhtml" + xmlns:h="http://java.sun.com/jsf/html" + xmlns:f="http://java.sun.com/jsf/core" + xmlns:ui="http://java.sun.com/jsf/facelets" + xmlns:c="http://java.sun.com/jstl/core" + xmlns:onc="http://jboss.org/on/component" + xmlns:onf="http://jboss.org/on/function" + xmlns:s="http://jboss.com/products/seam/taglib" + xmlns:a4j="https://ajax4jsf.dev.java.net/ajax" + xmlns:rich="http://richfaces.ajax4jsf.org/rich%22%3E + + <ui:define name="content"> + +<h:form id="pluginsForm"> + + rich:panel + <f:facet name="header"> + <h:outputText value="Installed Plugins"/> + </f:facet> + + <h:panelGrid columns="1" width="100%"> + <rich:tabPanel switchType="ajax" selectedTab="#{InstalledPluginsSessionUIBean.selectedTab}"> + + <!-- ========== AGENT PLUGINS TAB ========== --> + + <rich:tab name="AGENT" label="Agent Plugins"> + + <rich:dataTable id="agentPluginsDataTable" + value="#{InstalledPluginsUIBean.installedAgentPlugins}" + var="agentPlugin" + width="100%" + columnsWidth="3%, 20%, 52%, 15%, 10%" + styleClass="resources-table" + footerClass="on-pager-footer" + onRowMouseOver="this.style.backgroundColor='#E7E7E7'" + onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"> + + + rich:column + <f:facet name="header"> + <onc:allSelect target="selectedPlugin"/> + </f:facet> + + <onc:select name="selectedPlugin" value="#{agentPlugin.id}"/> + </rich:column> + + <rich:column rendered="#{param.debug}"> + <f:facet name="header"> + <h:outputText styleClass="headerText" value="ID"/> + </f:facet> + + <h:outputText value="#{agentPlugin.id}"/> + </rich:column> + + <rich:column sortBy="#{agentPlugin.displayName}"> + <f:facet name="header"> + <h:outputText styleClass="headerText" value="Name"/> + </f:facet> + + <h:outputLink value="/rhq/admin/plugin/plugin-details-plain.xhtml"> + <f:param name="plugin" value="#{agentPlugin.name}"/> + <f:param name="deployment" value="AGENT"/> + <h:outputText value="#{agentPlugin.displayName}"/> + </h:outputLink> + + </rich:column> + + <rich:column sortBy="#{agentPlugin.description}"> + <f:facet name="header"> + <h:outputText styleClass="headerText" value="Description"/> + </f:facet> + + <h:outputText value="#{agentPlugin.description}"/> + </rich:column> + + <rich:column sortBy="#{agentPlugin.mtime}"> + <f:facet name="header"> + <h:outputText styleClass="headerText" value="Last Update"/> + </f:facet> + + <h:outputText value="#{agentPlugin.mtime}"> + <f:converter converterId="UserDateTimeConverter" /> + </h:outputText> + </rich:column> + + rich:column + <f:facet name="header"> + <h:outputText styleClass="headerText" value="Enabled"/> + </f:facet> + + <h:graphicImage value="/images/icons/availability_green_16.png" rendered="#{agentPlugin.enabled}"/> + <h:graphicImage value="/images/icons/availability_red_16.png" rendered="#{!agentPlugin.enabled}"/> + </rich:column> + + <f:facet name="footer"> + rich:columnGroup + <rich:column colspan="5" width="100%"> + <onc:selectCommandButton action="#{InstalledPluginsUIBean.enableAgentPlugins}" + value="ENABLE" target="selectedPlugin" styleClass="on-pager-button buttonsmall"> + </onc:selectCommandButton> + <onc:selectCommandButton action="#{InstalledPluginsUIBean.disableAgentPlugins}" + value="DISABLE" target="selectedPlugin" styleClass="on-pager-button buttonsmall"> + </onc:selectCommandButton> + </rich:column> + <rich:column colspan="5" width="100%" breakBefore="true"> + <h:commandButton action="#{InstalledPluginsUIBean.scan}" + value="SCAN FOR UPDATES" styleClass="on-pager-button buttonsmall"> + </h:commandButton> + </rich:column> + </rich:columnGroup> + </f:facet> + + </rich:dataTable> + + </rich:tab> + + <!-- ========== SERVER PLUGINS TAB ========== --> + + <rich:tab name="SERVER" label="Server Plugins"> + + <rich:dataTable id="serverPluginsDataTable" + value="#{InstalledPluginsUIBean.installedServerPlugins}" + var="serverPlugin" + width="100%" + columnsWidth="#{InstalledPluginsSessionUIBean.showAllServerPlugins ? '3%, 20%, 52%, 15%, 5%, 5%' : '3%, 20%, 52%, 15%, 10%'}" + styleClass="resources-table" + footerClass="on-pager-footer" + onRowMouseOver="this.style.backgroundColor='#E7E7E7'" + onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"> + + + rich:column + <f:facet name="header"> + <onc:allSelect target="selectedPlugin"/> + </f:facet> + + <onc:select name="selectedPlugin" value="#{serverPlugin.id}"/> + </rich:column> + + <rich:column rendered="#{param.debug}"> + <f:facet name="header"> + <h:outputText styleClass="headerText" value="ID"/> + </f:facet> + + <h:outputText value="#{serverPlugin.id}"/> + </rich:column> + + <rich:column sortBy="#{serverPlugin.displayName}"> + <f:facet name="header"> + <h:outputText styleClass="headerText" value="Name"/> + </f:facet> + + <h:outputLink value="/rhq/admin/plugin/plugin-details-plain.xhtml" rendered="#{serverPlugin.status eq 'INSTALLED'}"> + <f:param name="plugin" value="#{serverPlugin.name}"/> + <f:param name="deployment" value="SERVER"/> + <f:param name="pluginType" value="#{serverPlugin.type}"/> + <h:outputText value="#{serverPlugin.displayName}"/> + </h:outputLink> + <h:outputText value="#{serverPlugin.displayName}" rendered="#{serverPlugin.status ne 'INSTALLED'}"/> + + </rich:column> + + <rich:column sortBy="#{serverPlugin.description}"> + <f:facet name="header"> + <h:outputText styleClass="headerText" value="Description"/> + </f:facet> + + <h:outputText value="#{serverPlugin.description}"/> + </rich:column> + + <rich:column sortBy="#{serverPlugin.mtime}"> + <f:facet name="header"> + <h:outputText styleClass="headerText" value="Last Update"/> + </f:facet> + + <h:outputText value="#{serverPlugin.mtime}"> + <f:converter converterId="UserDateTimeConverter" /> + </h:outputText> + </rich:column> + + + <rich:column sortBy="#{serverPlugin.enabled}"> + <f:facet name="header"> + <h:outputText styleClass="headerText" value="Enabled"/> + </f:facet> + + <h:graphicImage value="/images/icons/availability_green_16.png" rendered="#{serverPlugin.enabled}"/> + <h:graphicImage value="/images/icons/availability_red_16.png" rendered="#{!serverPlugin.enabled}"/> + </rich:column> + + <rich:column sortBy="#{serverPlugin.status}" rendered="#{InstalledPluginsSessionUIBean.showAllServerPlugins}"> + <f:facet name="header"> + <h:outputText styleClass="headerText" value="Deployed"/> + </f:facet> + + <h:graphicImage value="/images/icons/availability_green_16.png" rendered="#{serverPlugin.status eq 'INSTALLED' }"/> + <h:graphicImage value="/images/icons/availability_red_16.png" rendered="#{serverPlugin.status ne 'INSTALLED' }"/> + </rich:column> + + <f:facet name="footer"> + rich:columnGroup + <rich:column colspan="#{InstalledPluginsSessionUIBean.showAllServerPlugins ? 6 : 5}" width="100%"> + <onc:selectCommandButton action="#{InstalledPluginsUIBean.enableServerPlugins}" + value="ENABLE" target="selectedPlugin" styleClass="on-pager-button buttonsmall"> + </onc:selectCommandButton> + <onc:selectCommandButton action="#{InstalledPluginsUIBean.disableServerPlugins}" + value="DISABLE" target="selectedPlugin" styleClass="on-pager-button buttonsmall"> + </onc:selectCommandButton> + <onc:selectCommandButton action="#{InstalledPluginsUIBean.undeployServerPlugins}" + value="UNDEPLOY" target="selectedPlugin" styleClass="on-pager-button buttonsmall"> + </onc:selectCommandButton> + <onc:selectCommandButton action="#{InstalledPluginsUIBean.purgeServerPlugins}" + rendered="#{InstalledPluginsSessionUIBean.showAllServerPlugins}" + value="PURGE" target="selectedPlugin" styleClass="on-pager-button buttonsmall"> + </onc:selectCommandButton> + </rich:column> + <rich:column breakBefore="true" colspan="#{InstalledPluginsSessionUIBean.showAllServerPlugins ? 6 : 5}" width="100%"> + <h:commandButton action="#{InstalledPluginsUIBean.scan}" + value="SCAN FOR UPDATES" styleClass="on-pager-button buttonsmall"> + </h:commandButton> + <h:commandButton action="#{InstalledPluginsUIBean.restartMasterPluginContainer}" + value="RESTART MASTER PLUGIN CONTAINER" styleClass="on-pager-button buttonsmall"> + </h:commandButton> + <h:commandButton action="#{InstalledPluginsSessionUIBean.showUndeployedServerPlugins}" + rendered="#{!InstalledPluginsSessionUIBean.showAllServerPlugins}" + value="SHOW UNDEPLOYED" styleClass="on-pager-button buttonsmall"> + </h:commandButton> + <h:commandButton action="#{InstalledPluginsSessionUIBean.hideUndeployedServerPlugins}" + rendered="#{InstalledPluginsSessionUIBean.showAllServerPlugins}" + value="HIDE UNDEPLOYED" styleClass="on-pager-button buttonsmall"> + </h:commandButton> + </rich:column> + </rich:columnGroup> + </f:facet> + + </rich:dataTable> + + </rich:tab> + </rich:tabPanel> + </h:panelGrid> + + </rich:panel> + +rich:panel + <f:facet name="header"> + <h:outputText value="Upload Plugin"/> + </f:facet> + + <h:panelGrid columns="1" width="100%"> + <rich:fileUpload + id="upload" + fileUploadListener="#{InstalledPluginsUIBean.fileUploadListener}" + maxFilesQuantity="10" + acceptedTypes="jar" + noDuplicate="true" + immediateUpload="false" + autoclear="false" + allowFlash="false"> + <a4j:support event="onuploadcomplete" reRender="pluginsmessages" /> + </rich:fileUpload> + </h:panelGrid> + +</rich:panel> +</h:form> +</ui:define> + +</ui:composition>
commit dc2c58ac2e463d43f331d393955a605576e0476f Author: Joseph Marques joseph@redhat.com Date: Thu Aug 12 13:57:21 2010 -0400
implement "plain" scheme using iframed-facelets for unimplemented admin > config > settings section
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/admin/config/EditServerConfig.jsp b/modules/enterprise/gui/portal-war/src/main/webapp/admin/config/EditServerConfig.jsp index 4ad7b5f..dc5dcfb 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/admin/config/EditServerConfig.jsp +++ b/modules/enterprise/gui/portal-war/src/main/webapp/admin/config/EditServerConfig.jsp @@ -33,6 +33,9 @@ <c:if test="${not empty param.debug}"> <input type="hidden" name="debug" value="${param.debug}" /> </c:if> +<c:if test="${not empty param.nomenu}"> + <input type="hidden" name="nomenu" value="${param.nomenu}" /> +</c:if>
<tiles:insert page="/admin/config/SystemInfoForm.jsp"/> <br>
commit 36bde6fd9ce6e52d996ae59be1a131abf2905630 Author: Joseph Marques joseph@redhat.com Date: Thu Aug 12 13:56:50 2010 -0400
implement "plain" / "nomenu" scheme using iframed-facelets for unimplemented admin > config > license section
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/struts-config.xml b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/struts-config.xml index a4a323e..6c08474 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/struts-config.xml +++ b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/struts-config.xml @@ -1898,6 +1898,19 @@ <forward name="failure" path="/admin/license/LicenseAdmin.do?mode=edit&error=true" redirect="true"/> <forward name="success" path="/admin/license/LicenseAdmin.do?mode=view&update=true" redirect="true"/> </action> + + <action path="/admin/license/UpdateLicenseNoMenu" + name="LicenseAdminForm" + scope="request" + parameter="mode" + type="org.rhq.enterprise.gui.action.license.LicenseUpdateAction" + input="/admin/license/LicenseAdmin.do?mode=edit&nomenu=true"> + <set-property property="title" value="License"/> + <forward name="cancel" path="/admin/license/LicenseAdmin.do?mode=view&nomenu=true" redirect="true"/> + <forward name="reset" path="/admin/license/LicenseAdmin.do?mode=edit&nomenu=true" redirect="true"/> + <forward name="failure" path="/admin/license/LicenseAdmin.do?mode=edit&error=true&nomenu=true" redirect="true"/> + <forward name="success" path="/admin/license/LicenseAdmin.do?mode=view&update=true&nomenu=true" redirect="true"/> + </action>
<action path="/dashboard/Admin" forward=".dashboard.admin.layout"> diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/admin/license/License.jsp b/modules/enterprise/gui/portal-war/src/main/webapp/admin/license/License.jsp index 6f30264..4c7d47a 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/admin/license/License.jsp +++ b/modules/enterprise/gui/portal-war/src/main/webapp/admin/license/License.jsp @@ -84,7 +84,7 @@
<hq:authorization permission="MANAGE_SETTINGS"> <tr> - <td class="BlockContent" colspan="4" align="center"><html:link action="/admin/license/LicenseAdmin.do?mode=edit">Update License</html:link> + <td class="BlockContent" colspan="4" align="center"><html:link action="/admin/license/LicenseAdmin.do?mode=edit&nomenu=true">Update License</html:link> </td> </tr> </hq:authorization> diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/admin/license/LicenseEdit.jsp b/modules/enterprise/gui/portal-war/src/main/webapp/admin/license/LicenseEdit.jsp index 5019eb0..f49a8bf 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/admin/license/LicenseEdit.jsp +++ b/modules/enterprise/gui/portal-war/src/main/webapp/admin/license/LicenseEdit.jsp @@ -10,7 +10,8 @@
<table width="100%" cellpadding="0" cellspacing="0" border="0">
- <html:form action="/admin/license/UpdateLicense" enctype="multipart/form-data" method="POST"> + <c:if test="${not empty param.nomenu}"> + <html:form action="/admin/license/UpdateLicenseNoMenu" enctype="multipart/form-data" method="POST"> <tr> <td colspan="4" class="BlockHeader"> <tiles:insert definition=".header.tab"> @@ -30,7 +31,30 @@ </tr>
<tiles:insert definition=".form.buttons"/> - </html:form> + </c:if>
+ <c:if test="${empty param.nomenu}"> + <html:form action="/admin/license/UpdateLicense" enctype="multipart/form-data" method="POST"> + <tr> + <td colspan="4" class="BlockHeader"> + <tiles:insert definition=".header.tab"> + <tiles:put name="tabKey" value="admin.license.UpdateLicenseTab"/> + </tiles:insert> + </td> + </tr> + <tr> + <td colspan="4">An up to date license file can be downloaded from the + <a href="https://network.jboss.com/jbossnetwork/restricted/listSoftware.html"> + JBoss Network Customer Service Portal</a>.</td> + </tr> + <tr> + <td class="BlockLabel"><fmt:message key="admin.license.LicenseFile"/></td> + <td class="BlockContent"><html:file property="licenseFile"/></td> + <td colspan="2" class="BlockContent"> </td> + </tr> + + <tiles:insert definition=".form.buttons"/> + </html:form> + </c:if> </table> \ No newline at end of file
commit 805562e28f654ad90f65c93e16ce2644707af6c3 Author: Joseph Marques joseph@redhat.com Date: Thu Aug 12 12:38:14 2010 -0400
implement "plain" scheme using iframed-facelets for unimplemented administration > cluster section
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/AdministrationView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/AdministrationView.java index 469fda4..dc1bb5c 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/AdministrationView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/AdministrationView.java @@ -249,15 +249,14 @@ public class AdministrationView extends HLayout implements BookmarkableView { } else if ("Cluster".equals(section)) { String url = null; if ("Servers".equals(page)) { - url = "/rhq/ha/listServers.xhtml"; + url = "/rhq/ha/listServers-plain.xhtml"; } else if ("Agents".equals(page)) { - url = "/rhq/ha/listAgents.xhtml"; + url = "/rhq/ha/listAgents-plain.xhtml"; } else if ("Affinity Groups".equals(page)) { - url = "/rhq/ha/listAffinityGroups.xhtml"; + url = "/rhq/ha/listAffinityGroups-plain.xhtml"; } else if ("Partition Events".equals(page)) { - url = "/rhq/ha/listPartitionEvents.xhtml"; + url = "/rhq/ha/listPartitionEvents-plain.xhtml"; } - url = addQueryStringParam(url, "nomenu=true"); content = new FullHTMLPane(url); }
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation/cluster-plain-navigation.xml b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation/cluster-plain-navigation.xml new file mode 100644 index 0000000..b51e6b2 --- /dev/null +++ b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation/cluster-plain-navigation.xml @@ -0,0 +1,211 @@ +<?xml version="1.0"?> + +<faces-config version="1.2" xmlns="http://java.sun.com/xml/ns/javaee" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd%22%3E + + <!-- Server View/Edit --> + <navigation-rule> + <from-view-id>/rhq/ha/viewServer-plain.xhtml</from-view-id> + + <navigation-case> + <from-outcome>success</from-outcome> + <to-view-id>/rhq/ha/viewServer-plain.xhtml?mode=view&serverId=#{param.serverId}</to-view-id> + <redirect/> + </navigation-case> + + <navigation-case> + <from-outcome>edit</from-outcome> + <to-view-id>/rhq/ha/viewServer-plain.xhtml?mode=edit&serverId=#{param.serverId}</to-view-id> + <redirect/> + </navigation-case> + + <navigation-case> + <!-- sorting rule --> + <from-outcome>sort</from-outcome> + <to-view-id>/rhq/ha/viewServer-plain.xhtml?mode=view&serverId=#{param.serverId}</to-view-id> + <redirect/> + </navigation-case> + </navigation-rule> + + <!-- Server List --> + <navigation-rule> + <from-view-id>/rhq/ha/listServers-plain.xhtml</from-view-id> + + <navigation-case> + <from-outcome>success</from-outcome> + <to-view-id>/rhq/ha/listServers-plain.xhtml</to-view-id> + <redirect/> + </navigation-case> + + <navigation-case> + <!-- sorting rule --> + <from-outcome>sort</from-outcome> + <to-view-id>/rhq/ha/listServers-plain.xhtml</to-view-id> + <redirect/> + </navigation-case> + </navigation-rule> + + <!-- Agent View --> + <navigation-rule> + <from-view-id>/rhq/ha/viewAgent-plain.xhtml</from-view-id> + + <navigation-case> + <!-- sorting rule --> + <from-outcome>sort</from-outcome> + <to-view-id>/rhq/ha/viewAgent-plain.xhtml?mode=view&agentId=#{param.agentId}&serverId=#{param.serverId}</to-view-id> + <redirect/> + </navigation-case> + </navigation-rule> + + <!-- AffinityGroup View/Edit --> + <navigation-rule> + <from-view-id>/rhq/ha/viewAffinityGroup-plain.xhtml</from-view-id> + + <navigation-case> + <from-outcome>createSuccess</from-outcome> + <to-view-id>/rhq/ha/viewAffinityGroup-plain.xhtml?mode=view&affinityGroupId=#{ViewAffinityGroupDetailsUIBean.affinityGroup.id}</to-view-id> + <redirect/> + </navigation-case> + + <navigation-case> + <from-outcome>cancelCreate</from-outcome> + <to-view-id>/rhq/ha/listAffinityGroups-plain.xhtml</to-view-id> + <redirect/> + </navigation-case> + + <navigation-case> + <from-outcome>createFailure</from-outcome> + <to-view-id>/rhq/ha/viewAffinityGroup-plain.xhtml?mode=create</to-view-id> + <redirect/> + </navigation-case> + + <navigation-case> + <from-outcome>success</from-outcome> + <to-view-id>/rhq/ha/viewAffinityGroup-plain.xhtml?mode=view&affinityGroupId=#{param.affinityGroupId}</to-view-id> + <redirect/> + </navigation-case> + + <navigation-case> + <from-outcome>edit</from-outcome> + <to-view-id>/rhq/ha/viewAffinityGroup-plain.xhtml?mode=edit&affinityGroupId=#{param.affinityGroupId}</to-view-id> + <redirect/> + </navigation-case> + + <navigation-case> + <from-outcome>addAgentToAffinityGroup</from-outcome> + <to-view-id>/rhq/ha/affinityGroupAgents-plain.xhtml?affinityGroupId=#{param.affinityGroupId}&mode=#{param.mode}</to-view-id> + <redirect/> + </navigation-case> + + <navigation-case> + <from-outcome>editServers</from-outcome> + <to-view-id>/rhq/ha/affinityGroupServers-plain.xhtml?affinityGroupId=#{param.affinityGroupId}&mode=#{param.mode}</to-view-id> + <redirect/> + </navigation-case> + + <navigation-case> + <!-- sorting rule --> + <from-outcome>sort</from-outcome> + <to-view-id>/rhq/ha/viewAffinityGroup-plain.xhtml?mode=view&affinityGroupId=#{param.affinityGroupId}</to-view-id> + <redirect/> + </navigation-case> + </navigation-rule> + + <!-- AffinityGroup List --> + <navigation-rule> + <from-view-id>/rhq/ha/listAffinityGroups-plain.xhtml</from-view-id> + + <navigation-case> + <from-outcome>success</from-outcome> + <to-view-id>/rhq/ha/listAffinityGroups-plain.xhtml</to-view-id> + <redirect/> + </navigation-case> + + <navigation-case> + <from-outcome>create</from-outcome> + <to-view-id>/rhq/ha/viewAffinityGroup-plain.xhtml?mode=create</to-view-id> + <redirect/> + </navigation-case> + + <navigation-case> + <!-- sorting rule --> + <from-outcome>sort</from-outcome> + <to-view-id>/rhq/ha/listAffinityGroups-plain.xhtml</to-view-id> + <redirect/> + </navigation-case> + </navigation-rule> + + <!-- Agent add/remove from group --> + <navigation-rule> + <from-view-id>/rhq/ha/affinityGroupAgents-plain.xhtml</from-view-id> + + <navigation-case> + <from-outcome>successOrFailure</from-outcome> + <to-view-id>/rhq/ha/affinityGroupAgents-plain.xhtml?affinityGroupId=#{param.affinityGroupId}&mode=#{param.mode}</to-view-id> + <redirect/> + </navigation-case> + + <navigation-case> + <!-- sorting rule --> + <from-outcome>sort</from-outcome> + <to-view-id>/rhq/ha/affinityGroupAgents-plain.xhtml?affinityGroupId=#{param.affinityGroupId}&mode=#{param.mode}</to-view-id> + <redirect/> + </navigation-case> + </navigation-rule> + + <!-- Server add/remove from group --> + <navigation-rule> + <from-view-id>/rhq/ha/affinityGroupServers-plain.xhtml</from-view-id> + + <navigation-case> + <from-outcome>successOrFailure</from-outcome> + <to-view-id>/rhq/ha/affinityGroupServers-plain.xhtml?affinityGroupId=#{param.affinityGroupId}&mode=#{param.mode}</to-view-id> + <redirect/> + </navigation-case> + + <navigation-case> + <!-- sorting rule --> + <from-outcome>sort</from-outcome> + <to-view-id>/rhq/ha/affinityGroupServers-plain.xhtml?affinityGroupId=#{param.affinityGroupId}&mode=#{param.mode}</to-view-id> + <redirect/> + </navigation-case> + </navigation-rule> + + <!-- List PartitionEvents --> + <navigation-rule> + <from-view-id>/rhq/ha/listPartitionEvents-plain.xhtml</from-view-id> + + <navigation-case> + <from-outcome>success</from-outcome> + <to-view-id>/rhq/ha/listPartitionEvents-plain.xhtml</to-view-id> + <redirect/> + </navigation-case> + + <navigation-case> + <!-- sorting rule --> + <from-outcome>sort</from-outcome> + <to-view-id>/rhq/ha/listPartitionEvents-plain.xhtml</to-view-id> + <redirect/> + </navigation-case> + </navigation-rule> + + <!-- View PartitionEventDetails --> + <navigation-rule> + <from-view-id>/rhq/ha/viewPartitionEvent-plain.xhtml</from-view-id> + + <navigation-case> + <from-outcome>success</from-outcome> + <to-view-id>/rhq/ha/viewPartitionEvent-plain.xhtml?eventId=#{param.eventId}</to-view-id> + <redirect/> + </navigation-case> + + <navigation-case> + <!-- sorting rule --> + <from-outcome>sort</from-outcome> + <to-view-id>/rhq/ha/viewPartitionEvent-plain.xhtml?eventId=#{param.eventId}</to-view-id> + <redirect/> + </navigation-case> + </navigation-rule> + +</faces-config> \ No newline at end of file diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/web.xml b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/web.xml index 1bcfe79..87580b6 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/web.xml +++ b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/web.xml @@ -163,6 +163,7 @@ /WEB-INF/jsf-navigation/test-navigation.xml,
/WEB-INF/jsf-navigation/alert-plain-navigation.xml, + /WEB-INF/jsf-navigation/cluster-plain-navigation.xml, /WEB-INF/jsf-navigation/content-plain-navigation.xml, /WEB-INF/jsf-navigation/events-plain-navigation.xml, /WEB-INF/jsf-navigation/operation-plain-navigation.xml, diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/ha/affinityGroupAgents-plain.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/ha/affinityGroupAgents-plain.xhtml new file mode 100644 index 0000000..1943479 --- /dev/null +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/ha/affinityGroupAgents-plain.xhtml @@ -0,0 +1,288 @@ +<ui:composition template="/rhq/entity/layout/main-plain.xhtml" + xmlns="http://www.w3.org/1999/xhtml" + xmlns:h="http://java.sun.com/jsf/html" + xmlns:f="http://java.sun.com/jsf/core" + xmlns:ui="http://java.sun.com/jsf/facelets" + xmlns:c="http://java.sun.com/jstl/core" + xmlns:onc="http://jboss.org/on/component" + xmlns:onf="http://jboss.org/on/function" + xmlns:s="http://jboss.com/products/seam/taglib" + xmlns:a4j="https://ajax4jsf.dev.java.net/ajax" + xmlns:rich="http://richfaces.ajax4jsf.org/rich%22%3E + + <ui:define name="content"> + + <ui:param name="affinityGroupDetails" value="#{ViewAffinityGroupDetailsUIBean.affinityGroup}" /> + <ui:param name="mode" value="#{param.mode}" /> + + <h:form id="subscribedAgentsForm"> + <input type="hidden" name="affinityGroupId" value="#{param.affinityGroupId}"/> + <input type="hidden" name="mode" value="#{param.mode}"/> + + rich:panel + <f:facet name="header"> + <h:outputText value="Agents in this group"/> + </f:facet> + + <ui:param name="subscribedAgentsDataModel" value="#{AffinityGroupSubscribedAgentsUIBean.dataModel}"/> + <rich:dataTable id="subscribedAgentsDataTable" + rows="#{PageControl.AffinityGroupSubscribedAgents.pageSize}" + value="#{subscribedAgentsDataModel}" + var="agentItem" + width="100%" + columnsWidth="1%, 15%, 10%, 10%, 10%" + styleClass="resources-table" + footerClass="on-pager-footer" + onRowMouseOver="this.style.backgroundColor='#E7E7E7'" + onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"> + + <f:facet name="PageControlView"> + <onc:paginationControl id="AffinityGroupSubscribedAgents" /> + </f:facet> + + rich:column + <f:facet name="header"> + <onc:allSelect target="selectedAgentsToUnsubscribe" /> + </f:facet> + + <onc:select name="selectedAgentsToUnsubscribe" value="#{agentItem.id}" /> + </rich:column> + + <rich:column rendered="#{param.debug}"> + <f:facet name="header"> + <onc:sortableColumnHeader sort="a.id"> + <h:outputText styleClass="headerText" value="ID" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputText value="#{agentItem.id}"/> + </rich:column> + + rich:column + <f:facet name="header"> + <onc:sortableColumnHeader sort="a.name"> + <h:outputText styleClass="headerText" value="Agent Name" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputLink value="viewAgent-plain.xhtml"> + <f:param name="mode" value="view"/> + <f:param name="agentId" value="#{agentItem.id}"/> + <h:outputText value="#{agentItem.name}" /> + </h:outputLink> + </rich:column> + + rich:column + <f:facet name="header"> + <onc:sortableColumnHeader sort="a.address"> + <h:outputText styleClass="headerText" value="Bind Address" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputText value="#{agentItem.address}"/> + </rich:column> + + rich:column + <f:facet name="header"> + <onc:sortableColumnHeader sort="a.port"> + <h:outputText styleClass="headerText" value="Bind Port" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputText value="#{agentItem.port}"/> + </rich:column> + + <rich:column rendered="#{param.debug}"> + <f:facet name="header"> + <onc:sortableColumnHeader sort="a.agentToken"> + <h:outputText styleClass="headerText" value="Token" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputText value="#{agentItem.agentToken}"/> + </rich:column> + + rich:column + <f:facet name="header"> + <onc:sortableColumnHeader sort="a.lastAvailabilityReport"> + <h:outputText styleClass="headerText" value="Last Availability Report" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputText value="#{agentItem.lastAvailabilityReport}"> + <f:convertDateTime pattern="M/d/yy, h:mm:ss aa, zzz" timeZone="#{ServerInfoUIBean.timeZone}"/> + </h:outputText> + </rich:column> + + <rich:column rendered="#{param.debug}"> + <f:facet name="header"> + <onc:sortableColumnHeader sort="a.status"> + <h:outputText styleClass="headerText" value="Status" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputText value="#{agentItem.status}"/> + </rich:column> + + <f:facet name="footer"> + rich:columnGroup + <!-- colspan 8:5 for the debug 'id' column --> + <rich:column colspan="#{param.debug ? 8 : 5}" width="100%"> + + <onc:selectCommandButton action="#{AffinityGroupSubscribedAgentsUIBean.unsubscribeAgents}" + value="REMOVE FROM GROUP" styleClass="on-pager-button buttonsmall" + target="selectedAgentsToUnsubscribe"/> + + <ui:param name="paginationDataTableName" value="subscribedAgentsDataTable"/> + <ui:param name="paginationDataModel" value="#{subscribedAgentsDataModel}"/> + <ui:param name="paginationPageControl" value="#{PageControl.AffinityGroupSubscribedAgents}"/> + <ui:include src="/rhq/resource/include/pagination-plain.xhtml"/> + </rich:column> + </rich:columnGroup> + </f:facet> + + </rich:dataTable> + + </rich:panel> + </h:form> + + <h:form id="unsubscribedAgentsForm"> + <input type="hidden" name="affinityGroupId" value="#{param.affinityGroupId}"/> + <input type="hidden" name="mode" value="#{param.mode}"/> + + rich:panel + <f:facet name="header"> + <h:outputText value="Agents not part of an affinity group"/> + </f:facet> + + <ui:param name="unsubscribedAgentsDataModel" value="#{AffinityGroupUnsubscribedAgentsUIBean.dataModel}"/> + <rich:dataTable id="unsubscribedAgentsDataTable" + rows="#{PageControl.AffinityGroupUnsubscribedAgents.pageSize}" + value="#{unsubscribedAgentsDataModel}" + var="agentItem" + width="100%" + columnsWidth="1%, 15%, 10%, 10%, 10%" + headerClass="tableRowHeader" + footerClass="on-pager-footer" + onRowMouseOver="this.style.backgroundColor='#E7E7E7'" + onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"> + + <f:facet name="PageControlView"> + <onc:paginationControl id="AffinityGroupUnsubscribedAgents" /> + </f:facet> + + rich:column + <f:facet name="header"> + <onc:allSelect target="selectedAgentsToSubscribe" /> + </f:facet> + + <onc:select name="selectedAgentsToSubscribe" value="#{agentItem.id}" /> + </rich:column> + + <rich:column rendered="#{param.debug}"> + <f:facet name="header"> + <onc:sortableColumnHeader sort="a.id"> + <h:outputText styleClass="headerText" value="ID" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputText value="#{agentItem.id}"/> + </rich:column> + + rich:column + <f:facet name="header"> + <onc:sortableColumnHeader sort="a.name"> + <h:outputText styleClass="headerText" value="Agent Name" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputLink value="viewAgent-plain.xhtml"> + <f:param name="mode" value="view"/> + <f:param name="agentId" value="#{agentItem.id}"/> + <h:outputText value="#{agentItem.name}" /> + </h:outputLink> + </rich:column> + + rich:column + <f:facet name="header"> + <onc:sortableColumnHeader sort="a.address"> + <h:outputText styleClass="headerText" value="Bind Address" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputText value="#{agentItem.address}"/> + </rich:column> + + rich:column + <f:facet name="header"> + <onc:sortableColumnHeader sort="a.port"> + <h:outputText styleClass="headerText" value="Bind Port" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputText value="#{agentItem.port}"/> + </rich:column> + + <rich:column rendered="#{param.debug}"> + <f:facet name="header"> + <onc:sortableColumnHeader sort="a.agentToken"> + <h:outputText styleClass="headerText" value="Token" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputText value="#{agentItem.agentToken}"/> + </rich:column> + + rich:column + <f:facet name="header"> + <onc:sortableColumnHeader sort="a.lastAvailabilityReport"> + <h:outputText styleClass="headerText" value="Last Availability Report" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputText value="#{agentItem.lastAvailabilityReport}"> + <f:convertDateTime pattern="M/d/yy, h:mm:ss aa, zzz" timeZone="#{ServerInfoUIBean.timeZone}"/> + </h:outputText> + </rich:column> + + <rich:column rendered="#{param.debug}"> + <f:facet name="header"> + <onc:sortableColumnHeader sort="a.status"> + <h:outputText styleClass="headerText" value="Status" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputText value="#{agentItem.status}"/> + </rich:column> + + <f:facet name="footer"> + rich:columnGroup + <!-- colspan 8:5 for the debug 'id' column --> + <rich:column colspan="#{param.debug ? 8 : 5}" width="100%"> + + <onc:selectCommandButton action="#{AffinityGroupUnsubscribedAgentsUIBean.subscribeAgents}" + value="ADD TO GROUP" styleClass="on-pager-button buttonsmall" + target="selectedAgentsToSubscribe"/> + + <ui:param name="paginationDataTableName" value="unsubscribedAgentsDataTable"/> + <ui:param name="paginationDataModel" value="#{unsubscribedAgentsDataModel}"/> + <ui:param name="paginationPageControl" value="#{PageControl.AffinityGroupUnsubscribedAgents}"/> + <ui:include src="/rhq/resource/include/pagination-plain.xhtml"/> + </rich:column> + </rich:columnGroup> + </f:facet> + + </rich:dataTable> + + </rich:panel> + </h:form> + + <h:outputLink value="viewAffinityGroup-plain.xhtml"> + <h:outputText value="Return to Affinity Group"/> + <f:param name="affinityGroupId" value="#{param.affinityGroupId}"/> + <f:param name="mode" value="#{param.mode}"/> + </h:outputLink> + + </ui:define> + +</ui:composition> diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/ha/affinityGroupServers-plain.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/ha/affinityGroupServers-plain.xhtml new file mode 100644 index 0000000..79b86d7 --- /dev/null +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/ha/affinityGroupServers-plain.xhtml @@ -0,0 +1,290 @@ +<ui:composition template="/rhq/entity/layout/main-plain.xhtml" + xmlns="http://www.w3.org/1999/xhtml" + xmlns:h="http://java.sun.com/jsf/html" + xmlns:f="http://java.sun.com/jsf/core" + xmlns:ui="http://java.sun.com/jsf/facelets" + xmlns:c="http://java.sun.com/jstl/core" + xmlns:onc="http://jboss.org/on/component" + xmlns:onf="http://jboss.org/on/function" + xmlns:s="http://jboss.com/products/seam/taglib" + xmlns:a4j="https://ajax4jsf.dev.java.net/ajax" + xmlns:rich="http://richfaces.ajax4jsf.org/rich%22%3E + + <ui:define name="content"> + + <ui:param name="affinityGroupDetails" value="#{ViewAffinityGroupDetailsUIBean.affinityGroup}" /> + <ui:param name="mode" value="#{param.mode}" /> + + <h:form id="subscribedServersForm"> + <input type="hidden" name="affinityGroupId" value="#{param.affinityGroupId}"/> + <input type="hidden" name="mode" value="#{param.mode}"/> + + rich:panel + <f:facet name="header"> + <h:outputText value="Server Members"/> + </f:facet> + + <ui:param name="subscribedServersDataModel" value="#{AffinityGroupSubscribedServersUIBean.dataModel}"/> + <rich:dataTable id="subscribedServersDataTable" + rows="#{PageControl.AffinityGroupSubscribedServers.pageSize}" + value="#{subscribedServersDataModel}" + var="serverItem" + width="100%" + columnsWidth="1%, 15%, 10%, 10%, 8%, 8%, 15%" + styleClass="resources-table" + footerClass="on-pager-footer" + onRowMouseOver="this.style.backgroundColor='#E7E7E7'" + onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"> + + <f:facet name="PageControlView"> + <onc:paginationControl id="AffinityGroupSubscribedServers" /> + </f:facet> + + rich:column + <f:facet name="header"> + <onc:allSelect target="selectedServersToUnsubscribe" /> + </f:facet> + + <onc:select name="selectedServersToUnsubscribe" value="#{serverItem.id}" /> + </rich:column> + + <rich:column rendered="#{param.debug}"> + <f:facet name="header"> + <onc:sortableColumnHeader sort="s.id"> + <h:outputText styleClass="headerText" value="ID" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputText value="#{serverItem.id}"/> + </rich:column> + + rich:column + <f:facet name="header"> + <onc:sortableColumnHeader sort="s.name"> + <h:outputText styleClass="headerText" value="Name" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputLink value="viewServer-plain.xhtml"> + <f:param name="mode" value="view"/> + <f:param name="serverId" value="#{serverItem.id}"/> + <h:outputText value="#{serverItem.name}" /> + </h:outputLink> + </rich:column> + + rich:column + <f:facet name="header"> + <onc:sortableColumnHeader sort="s.operationMode"> + <h:outputText styleClass="headerText" value="Mode" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputText value="#{serverItem.operationMode}"/> + </rich:column> + + rich:column + <f:facet name="header"> + <onc:sortableColumnHeader sort="s.address"> + <h:outputText styleClass="headerText" value="Endpoint Address" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputText value="#{serverItem.address}"/> + </rich:column> + + rich:column + <f:facet name="header"> + <onc:sortableColumnHeader sort="s.port"> + <h:outputText styleClass="headerText" value="HTTP Port" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputText value="#{serverItem.port}"/> + </rich:column> + + rich:column + <f:facet name="header"> + <onc:sortableColumnHeader sort="s.securePort"> + <h:outputText styleClass="headerText" value="Secure HTTPS Port" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputText value="#{serverItem.securePort}"/> + </rich:column> + + rich:column + <f:facet name="header"> + <onc:sortableColumnHeader sort="s.ctime"> + <h:outputText styleClass="headerText" value="Last Update Time" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputText value="#{serverItem.ctime}"> + <f:converter converterId="UserDateTimeConverter" /> + </h:outputText> + </rich:column> + + <f:facet name="footer"> + rich:columnGroup + <!-- colspan 8:7 for the debug 'id' column --> + <rich:column colspan="#{param.debug ? 8 : 7}" width="100%"> + + <onc:selectCommandButton action="#{AffinityGroupSubscribedServersUIBean.unsubscribeServers}" + value="REMOVE FROM GROUP" styleClass="on-pager-button buttonsmall" + target="selectedServersToUnsubscribe"/> + + <ui:param name="paginationDataTableName" value="subscribedServersDataTable"/> + <ui:param name="paginationDataModel" value="#{subscribedServersDataModel}"/> + <ui:param name="paginationPageControl" value="#{PageControl.AffinityGroupSubscribedServers}"/> + <ui:include src="../resource/include/pagination-plain.xhtml"/> + </rich:column> + </rich:columnGroup> + </f:facet> + + </rich:dataTable> + + </rich:panel> + + </h:form> + + <h:form id="unsubscribedServersForm"> + <input type="hidden" name="affinityGroupId" value="#{param.affinityGroupId}"/> + <input type="hidden" name="mode" value="#{param.mode}"/> + + rich:panel + <f:facet name="header"> + <h:outputText value="Server Members"/> + </f:facet> + + <ui:param name="unsubscribedServersDataModel" value="#{AffinityGroupUnsubscribedServersUIBean.dataModel}"/> + <rich:dataTable id="unsubscribedServersDataTable" + rows="#{PageControl.AffinityGroupUnsubscribedServers.pageSize}" + value="#{unsubscribedServersDataModel}" + var="serverItem" + width="100%" + columnsWidth="1%, 15%, 10%, 10%, 8%, 8%, 15%" + headerClass="tableRowHeader" + footerClass="on-pager-footer" + onRowMouseOver="this.style.backgroundColor='#E7E7E7'" + onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"> + + <f:facet name="PageControlView"> + <onc:paginationControl id="AffinityGroupUnsubscribedServers" /> + </f:facet> + + rich:column + <f:facet name="header"> + <onc:allSelect target="selectedServersToSubscribe" /> + </f:facet> + + <onc:select name="selectedServersToSubscribe" value="#{serverItem.id}" /> + </rich:column> + + <rich:column rendered="#{param.debug}"> + <f:facet name="header"> + <onc:sortableColumnHeader sort="s.id"> + <h:outputText styleClass="headerText" value="ID" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputText value="#{serverItem.id}"/> + </rich:column> + + rich:column + <f:facet name="header"> + <onc:sortableColumnHeader sort="s.name"> + <h:outputText styleClass="headerText" value="Name" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputLink value="viewServer-plain.xhtml"> + <f:param name="mode" value="view"/> + <f:param name="serverId" value="#{serverItem.id}"/> + <h:outputText value="#{serverItem.name}" /> + </h:outputLink> + </rich:column> + + rich:column + <f:facet name="header"> + <onc:sortableColumnHeader sort="s.operationMode"> + <h:outputText styleClass="headerText" value="Mode" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputText value="#{serverItem.operationMode}"/> + </rich:column> + + rich:column + <f:facet name="header"> + <onc:sortableColumnHeader sort="s.address"> + <h:outputText styleClass="headerText" value="Endpoint Address" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputText value="#{serverItem.address}"/> + </rich:column> + + rich:column + <f:facet name="header"> + <onc:sortableColumnHeader sort="s.port"> + <h:outputText styleClass="headerText" value="HTTP Port" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputText value="#{serverItem.port}"/> + </rich:column> + + rich:column + <f:facet name="header"> + <onc:sortableColumnHeader sort="s.securePort"> + <h:outputText styleClass="headerText" value="Secure HTTPS Port" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputText value="#{serverItem.securePort}"/> + </rich:column> + + rich:column + <f:facet name="header"> + <onc:sortableColumnHeader sort="s.ctime"> + <h:outputText styleClass="headerText" value="Last Update Time" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputText value="#{serverItem.ctime}"> + <f:converter converterId="UserDateTimeConverter" /> + </h:outputText> + </rich:column> + + <f:facet name="footer"> + rich:columnGroup + <!-- colspan 8:7 for the debug 'id' column --> + <rich:column colspan="#{param.debug ? 8 : 7}" width="100%"> + + <onc:selectCommandButton action="#{AffinityGroupUnsubscribedServersUIBean.subscribeServers}" + value="ADD TO GROUP" styleClass="on-pager-button buttonsmall" + target="selectedServersToSubscribe"/> + + <ui:param name="paginationDataTableName" value="unsubscribedServersDataTable"/> + <ui:param name="paginationDataModel" value="#{unsubscribedServersDataModel}"/> + <ui:param name="paginationPageControl" value="#{PageControl.AffinityGroupUnsubscribedServers}"/> + <ui:include src="../resource/include/pagination-plain.xhtml"/> + </rich:column> + </rich:columnGroup> + </f:facet> + + </rich:dataTable> + + </rich:panel> + + </h:form> + + <h:outputLink value="viewAffinityGroup-plain.xhtml"> + <h:outputText value="Return to Affinity Group"/> + <f:param name="affinityGroupId" value="#{param.affinityGroupId}"/> + <f:param name="mode" value="#{param.mode}"/> + </h:outputLink> + + </ui:define> + +</ui:composition> \ No newline at end of file diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/ha/listAffinityGroups-plain.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/ha/listAffinityGroups-plain.xhtml new file mode 100644 index 0000000..3756548 --- /dev/null +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/ha/listAffinityGroups-plain.xhtml @@ -0,0 +1,113 @@ +<ui:composition template="/rhq/entity/layout/main-plain.xhtml" + xmlns="http://www.w3.org/1999/xhtml" + xmlns:h="http://java.sun.com/jsf/html" + xmlns:f="http://java.sun.com/jsf/core" + xmlns:ui="http://java.sun.com/jsf/facelets" + xmlns:c="http://java.sun.com/jstl/core" + xmlns:onc="http://jboss.org/on/component" + xmlns:onf="http://jboss.org/on/function" + xmlns:s="http://jboss.com/products/seam/taglib" + xmlns:a4j="https://ajax4jsf.dev.java.net/ajax" + xmlns:rich="http://richfaces.ajax4jsf.org/rich%22%3E + + <ui:define name="content"> + + <h:form id="affinityGroupsForm"> + <input type="hidden" name="affinityGroupId" value="#{param.affinityGroupId}"/> + + <rich:panel styleClass="BlockContent"> + + <ui:param name="affinityGroupsDataModel" value="#{ListAffinityGroupsUIBean.dataModel}"/> + <rich:dataTable id="affinityGroupsDataTable" + rows="#{PageControl.ListAffinityGroups.pageSize}" + value="#{affinityGroupsDataModel}" + var="item" + width="100%" + columnsWidth="1%, 15%, 10%, 10%" + styleClass="resources-table" + footerClass="on-pager-footer" + onRowMouseOver="this.style.backgroundColor='#E7E7E7'" + onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"> + + <f:facet name="PageControlView"> + <onc:paginationControl id="ListAffinityGroups" /> + </f:facet> + + rich:column + <f:facet name="header"> + <onc:allSelect target="selectedAffinityGroups" /> + </f:facet> + + <onc:select name="selectedAffinityGroups" value="#{item.affinityGroup.id}" /> + </rich:column> + + <rich:column rendered="#{param.debug}"> + <f:facet name="header"> + <onc:sortableColumnHeader sort="ag.id"> + <h:outputText styleClass="headerText" value="ID" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputText value="#{item.affinityGroup.id}"/> + </rich:column> + + rich:column + <f:facet name="header"> + <onc:sortableColumnHeader sort="ag.name"> + <h:outputText styleClass="headerText" value="Name" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputLink value="viewAffinityGroup-plain.xhtml"> + <f:param name="mode" value="view"/> + <f:param name="affinityGroupId" value="#{item.affinityGroup.id}"/> + <h:outputText value="#{item.affinityGroup.name}" /> + </h:outputLink> + </rich:column> + + rich:column + <f:facet name="header"> + <h:outputText styleClass="headerText" value="Agent Count" /> + </f:facet> + + <h:outputText value="#{item.agentCount}"/> + </rich:column> + + rich:column + <f:facet name="header"> + <h:outputText styleClass="headerText" value="Server Count" /> + </f:facet> + + <h:outputText value="#{item.serverCount}"/> + </rich:column> + + <f:facet name="footer"> + rich:columnGroup + <!-- colspan 5:4 for the debug 'id' column --> + <rich:column colspan="#{param.debug ? 5 : 4}" width="100%"> + <h:commandButton action="#{ListAffinityGroupsUIBean.createNewAffinityGroup}" + value="CREATE NEW" + styleClass="on-pager-button buttonsmall" + rendered="${GlobalPermissionsUIBean.inventory}" /> + + <onc:selectCommandButton action="#{ListAffinityGroupsUIBean.deleteSelectedAffinityGroups}" + value="REMOVE SELECTED" target="selectedAffinityGroups" + styleClass="on-pager-button buttonsmall" + rendered="${GlobalPermissionsUIBean.inventory}" /> + + <ui:param name="paginationDataTableName" value="affinityGroupsDataTable"/> + <ui:param name="paginationDataModel" value="#{affinityGroupsDataModel}"/> + <ui:param name="paginationPageControl" value="#{PageControl.ListAffinityGroups}"/> + <ui:include src="/rhq/resource/include/pagination-plain.xhtml"/> + </rich:column> + </rich:columnGroup> + </f:facet> + + </rich:dataTable> + + </rich:panel> + </h:form> + + </ui:define> + +</ui:composition> \ No newline at end of file diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/ha/listAgents-plain.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/ha/listAgents-plain.xhtml new file mode 100644 index 0000000..e085d20 --- /dev/null +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/ha/listAgents-plain.xhtml @@ -0,0 +1,138 @@ +<ui:composition template="/rhq/entity/layout/main-plain.xhtml" + xmlns="http://www.w3.org/1999/xhtml" + xmlns:h="http://java.sun.com/jsf/html" + xmlns:f="http://java.sun.com/jsf/core" + xmlns:ui="http://java.sun.com/jsf/facelets" + xmlns:c="http://java.sun.com/jstl/core" + xmlns:onc="http://jboss.org/on/component" + xmlns:onf="http://jboss.org/on/function" + xmlns:s="http://jboss.com/products/seam/taglib" + xmlns:a4j="https://ajax4jsf.dev.java.net/ajax" + xmlns:rich="http://richfaces.ajax4jsf.org/rich%22%3E + + <ui:define name="content"> + + <h:form id="AgentsListForm"> + + <rich:panel styleClass="BlockContent"> + + <ui:param name="agentsDataModel" value="#{ListAgentsUIBean.dataModel}"/> + <rich:dataTable id="agentsDataTable" + rows="#{PageControl.AgentsList.pageSize}" + value="#{agentsDataModel}" + var="item" + width="100%" + columnsWidth="15%, 15%, 10%, 10%, 10%, 10%" + styleClass="resources-table" + footerClass="on-pager-footer" + onRowMouseOver="this.style.backgroundColor='#E7E7E7'" + onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"> + + + <f:facet name="PageControlView"> + <onc:paginationControl id="AgentsList" /> + </f:facet> + + <rich:column rendered="false"> + <f:facet name="header"> + <onc:allSelect target="selectedAgents" /> + </f:facet> + + <onc:select name="selectedAgents" value="#{item.id}" /> + </rich:column> + + rich:column + <f:facet name="header"> + <onc:sortableColumnHeader sort="a.name"> + <h:outputText styleClass="headerText" value="Agent Name" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputLink value="viewAgent-plain.xhtml"> + <f:param name="mode" value="view"/> + <f:param name="serverId" value="#{item.server.id}"/> + <f:param name="agentId" value="#{item.id}"/> + <h:outputText value="#{item.name}" /> + </h:outputLink> + </rich:column> + + rich:column + <f:facet name="header"> + <onc:sortableColumnHeader sort="a.server.name"> + <h:outputText styleClass="headerText" value="Connected Server" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputLink value="viewServer-plain.xhtml"> + <f:param name="mode" value="view"/> + <f:param name="serverId" value="#{item.server.id}"/> + <h:outputText value="#{item.server.name}" /> + </h:outputLink> + </rich:column> + + rich:column + <f:facet name="header"> + <onc:sortableColumnHeader sort="a.address"> + <h:outputText styleClass="headerText" value="Agent Bind Address" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputText value="#{item.address}"/> + </rich:column> + + rich:column + <f:facet name="header"> + <onc:sortableColumnHeader sort="a.port"> + <h:outputText styleClass="headerText" value="Agent Bind Port" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputText value="#{item.port}"/> + </rich:column> + + rich:column + <f:facet name="header"> + <onc:sortableColumnHeader sort="a.lastAvailabilityReport"> + <h:outputText styleClass="headerText" value="Last Availability Report" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputText value="#{item.lastAvailabilityReport}"> + <f:convertDateTime pattern="M/d/yy, h:mm:ss aa, zzz" timeZone="#{ServerInfoUIBean.timeZone}"/> + </h:outputText> + </rich:column> + + rich:column + <f:facet name="header"> + <onc:sortableColumnHeader sort="a.affinityGroup"> + <h:outputText styleClass="headerText" value="Affinity Group" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputLink value="viewAffinityGroup-plain.xhtml"> + <f:param name="mode" value="view"/> + <f:param name="affinityGroupId" value="#{item.affinityGroup.id}"/> + <h:outputText value="#{item.affinityGroup.name}"/> + </h:outputLink> + </rich:column> + + <f:facet name="footer"> + rich:columnGroup + <!-- colspan 9:6 for the debug 'id' column --> + <rich:column colspan="6" width="100%"> + <ui:param name="paginationDataTableName" value="agentsDataTable"/> + <ui:param name="paginationDataModel" value="#{agentsDataModel}"/> + <ui:param name="paginationPageControl" value="#{PageControl.AgentsList}"/> + <ui:include src="/rhq/resource/include/pagination-plain.xhtml"/> + </rich:column> + </rich:columnGroup> + </f:facet> + + </rich:dataTable> + + </rich:panel> + </h:form> + + </ui:define> + +</ui:composition> diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/ha/listPartitionEvents-plain.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/ha/listPartitionEvents-plain.xhtml new file mode 100644 index 0000000..29dfc51 --- /dev/null +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/ha/listPartitionEvents-plain.xhtml @@ -0,0 +1,162 @@ +<ui:composition template="/rhq/entity/layout/main-plain.xhtml" + xmlns="http://www.w3.org/1999/xhtml" + xmlns:h="http://java.sun.com/jsf/html" + xmlns:f="http://java.sun.com/jsf/core" + xmlns:ui="http://java.sun.com/jsf/facelets" + xmlns:c="http://java.sun.com/jstl/core" + xmlns:onc="http://jboss.org/on/component" + xmlns:onf="http://jboss.org/on/function" + xmlns:s="http://jboss.com/products/seam/taglib" + xmlns:a4j="https://ajax4jsf.dev.java.net/ajax" + xmlns:rich="http://richfaces.ajax4jsf.org/rich%22%3E + + <ui:define name="content"> + + <h:form id="partitionEventsForm"> + + <rich:panel styleClass="BlockContent"> + + <h:panelGrid columns="4" cellspacing="3"> + <h:outputLabel for="typeFilter" value="Type Filter: " /> + <h:selectOneMenu id="typeFilter" value="#{ListPartitionEventsUIBean.typeFilter}" + style="width: 300px;"> + <a4j:support event="onchange" reRender="partitionEventsDataTable, partitionEventsDataTableScroller"/> + + <f:selectItems value="#{ListPartitionEventsUIBean.typeSelectItems}"/> + </h:selectOneMenu> + rich:spacer/ + rich:spacer/ + + <h:outputLabel for="executionStatusFilter" value="Execution Status Filter: " /> + <h:selectOneMenu id="executionStatusFilter" value="#{ListPartitionEventsUIBean.executionStatusFilter}" + style="width: 300px;"> + <a4j:support event="onchange" reRender="partitionEventsDataTable, partitionEventsDataTableScroller"/> + + <f:selectItems value="#{ListPartitionEventsUIBean.executionStatusSelectItems}"/> + </h:selectOneMenu> + rich:spacer/ + rich:spacer/ + + <h:outputLabel for="detailsFilter" value="Details Filter: " /> + <h:inputText id="detailsFilter" value="#{ListPartitionEventsUIBean.detailsFilter}" + onkeypress="return ignoreEnterKey(event);" + style="width: 300px;"/> + <a4j:commandButton value="GO" reRender="partitionEventsDataTable, partitionEventsDataTableScroller" + styleClass="buttonmed"> + <s:defaultAction /> + </a4j:commandButton> + rich:spacer/ + </h:panelGrid> + + <br/> + + <ui:param name="partitionEventsDataModel" value="#{ListPartitionEventsUIBean.dataModel}"/> + <rich:dataTable id="partitionEventsDataTable" + rows="#{PageControl.ListPartitionEventsView.pageSize}" + value="#{partitionEventsDataModel}" + var="item" + width="100%" + columnsWidth="1%, 25%, 20%, 30% 10% 15%" + styleClass="resources-table" + footerClass="on-pager-footer" + onRowMouseOver="this.style.backgroundColor='#E7E7E7'" + onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"> + + <f:facet name="PageControlView"> + <onc:paginationControl id="ListPartitionEventsView" /> + </f:facet> + + rich:column + <f:facet name="header"> + <onc:allSelect target="selectedEvents" /> + </f:facet> + + <onc:select name="selectedEvents" value="#{item.id}" /> + </rich:column> + + rich:column + <f:facet name="header"> + <onc:sortableColumnHeader sort="pe.ctime"> + <h:outputText styleClass="headerText" value="Execution Time" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputText value="#{item.ctime}"> + <f:converter converterId="UserDateTimeConverter" /> + </h:outputText> + + </rich:column> + + rich:column + <f:facet name="header"> + <onc:sortableColumnHeader sort="pe.eventType"> + <h:outputText styleClass="headerText" value="Type" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputLink value="viewPartitionEvent-plain.xhtml"> + <f:param name="eventId" value="#{item.id}"/> + <h:outputText value="#{item.eventType}" /> + </h:outputLink> + + </rich:column> + + rich:column + <f:facet name="header"> + <onc:sortableColumnHeader sort="pe.eventDetail"> + <h:outputText styleClass="headerText" value="Details" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputText value="#{item.eventDetail}" /> + </rich:column> + + rich:column + <f:facet name="header"> + <onc:sortableColumnHeader sort="pe.subjectName"> + <h:outputText styleClass="headerText" value="Initiated By" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputText value="#{item.subjectName}"/> + </rich:column> + + rich:column + <f:facet name="header"> + <onc:sortableColumnHeader sort="pe.executionStatus"> + <h:outputText styleClass="headerText" value="Execution Status" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputText value="#{item.executionStatus}" /> + </rich:column> + + <f:facet name="footer"> + rich:columnGroup + <rich:column colspan="6" width="100%"> + <onc:selectCommandButton action="#{ListPartitionEventsUIBean.removeSelectedEvents}" + value="REMOVE SELECTED" target="selectedEvents" styleClass="on-pager-button buttonsmall" + rendered="${GlobalPermissionsUIBean.inventory}" /> + <h:commandButton action="#{ListPartitionEventsUIBean.purgeAllEvents}" + value="PURGE ALL" styleClass="on-pager-button buttonsmall" + rendered="${GlobalPermissionsUIBean.inventory}" /> + <h:commandButton action="#{ListPartitionEventsUIBean.repartition}" + value="FORCE REPARTITION" styleClass="on-pager-button buttonsmall" + rendered="${GlobalPermissionsUIBean.inventory}" /> + + <ui:param name="paginationDataTableName" value="partitionEventsDataTable"/> + <ui:param name="paginationDataModel" value="#{partitionEventsDataModel}"/> + <ui:param name="paginationPageControl" value="#{PageControl.ListPartitionEventsView}"/> + <ui:include src="/rhq/resource/include/pagination-plain.xhtml"/> + </rich:column> + </rich:columnGroup> + </f:facet> + + </rich:dataTable> + + </rich:panel> + </h:form> + + </ui:define> + +</ui:composition> \ No newline at end of file diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/ha/listServers-plain.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/ha/listServers-plain.xhtml new file mode 100644 index 0000000..d3ddce8 --- /dev/null +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/ha/listServers-plain.xhtml @@ -0,0 +1,168 @@ +<ui:composition template="/rhq/entity/layout/main-plain.xhtml" + xmlns="http://www.w3.org/1999/xhtml" + xmlns:h="http://java.sun.com/jsf/html" + xmlns:f="http://java.sun.com/jsf/core" + xmlns:ui="http://java.sun.com/jsf/facelets" + xmlns:c="http://java.sun.com/jstl/core" + xmlns:onc="http://jboss.org/on/component" + xmlns:onf="http://jboss.org/on/function" + xmlns:s="http://jboss.com/products/seam/taglib" + xmlns:a4j="https://ajax4jsf.dev.java.net/ajax" + xmlns:rich="http://richfaces.ajax4jsf.org/rich%22%3E + + <ui:define name="content"> + + <h:form id="serversListForm"> + + <rich:panel styleClass="BlockContent"> + + <ui:param name="serversDataModel" value="#{ListServersUIBean.dataModel}"/> + <rich:dataTable id="serversDataTable" + rows="#{PageControl.ServersList.pageSize}" + value="#{serversDataModel}" + var="item" + width="100%" + columnsWidth="1%, 15%, 10%, 10%, 10%, 10%" + styleClass="resources-table" + footerClass="on-pager-footer" + onRowMouseOver="this.style.backgroundColor='#E7E7E7'" + onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"> + + + <f:facet name="PageControlView"> + <onc:paginationControl id="ServersList" /> + </f:facet> + + rich:column + <f:facet name="header"> + <onc:allSelect target="selectedServers" /> + </f:facet> + + <onc:select name="selectedServers" value="#{item.server.id}" /> + </rich:column> + + <rich:column rendered="#{param.debug}"> + <f:facet name="header"> + <onc:sortableColumnHeader sort="s.id"> + <h:outputText styleClass="headerText" value="ID" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputText value="#{item.server.id}"/> + </rich:column> + + rich:column + <f:facet name="header"> + <onc:sortableColumnHeader sort="s.name"> + <h:outputText styleClass="headerText" value="Name" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputLink value="viewServer-plain.xhtml"> + <f:param name="mode" value="view"/> + <f:param name="serverId" value="#{item.server.id}"/> + <h:outputText value="#{item.server.name}" /> + </h:outputLink> + </rich:column> + + rich:column + <f:facet name="header"> + <onc:sortableColumnHeader sort="s.operationMode"> + <h:outputText styleClass="headerText" value="Mode" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputText value="#{item.server.operationMode}"/> + </rich:column> + + rich:column + <f:facet name="header"> + <onc:sortableColumnHeader sort="s.address"> + <h:outputText styleClass="headerText" value="Endpoint Address" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputText value="#{item.server.address}"/> + </rich:column> + + rich:column + <f:facet name="header"> + <onc:sortableColumnHeader sort="s.port"> + <h:outputText styleClass="headerText" value="Nonsecure Port" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputText value="#{item.server.port}"/> + </rich:column> + + rich:column + <f:facet name="header"> + <onc:sortableColumnHeader sort="s.securePort"> + <h:outputText styleClass="headerText" value="Secure Port" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputText value="#{item.server.securePort}"/> + </rich:column> + + rich:column + <f:facet name="header"> + <onc:sortableColumnHeader sort="s.mtime"> + <h:outputText styleClass="headerText" value="Last Update Time" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputText value="#{item.server.mtime}"> + <f:converter converterId="UserDateTimeConverter" /> + </h:outputText> + </rich:column> + + rich:column + <f:facet name="header"> + <onc:sortableColumnHeader sort="s.affinityGroup"> + <h:outputText styleClass="headerText" value="Affinity Group" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputLink value="viewAffinityGroup-plain.xhtml"> + <f:param name="mode" value="view"/> + <f:param name="affinityGroupId" value="#{item.server.affinityGroup.id}"/> + <h:outputText value="#{item.server.affinityGroup.name}"/> + </h:outputLink> + </rich:column> + + rich:column + <f:facet name="header"> + <h:outputText styleClass="headerText" value="Agent Count" /> + </f:facet> + + <h:outputText value="#{item.agentCount}"/> + </rich:column> + + <f:facet name="footer"> + rich:columnGroup + <!-- colspan 10:9 for the debug 'id' column --> + <rich:column colspan="#{param.debug ? 10 : 9}" width="100%"> + <onc:selectCommandButton action="#{ListServersUIBean.setSelectedServersModeNormal}" + value="SET NORMAL" target="selectedServers" styleClass="on-pager-button buttonsmall"/> + <onc:selectCommandButton action="#{ListServersUIBean.setSelectedServersModeMaintenance}" + value="SET MAINTENANCE" target="selectedServers" styleClass="on-pager-button buttonsmall"/> + <onc:selectCommandButton action="#{ListServersUIBean.removeSelectedServers}" + value="REMOVE SELECTED" target="selectedServers" styleClass="on-pager-button buttonsmall"/> + + <ui:param name="paginationDataTableName" value="serversDataTable"/> + <ui:param name="paginationDataModel" value="#{serversDataModel}"/> + <ui:param name="paginationPageControl" value="#{PageControl.ServersList}"/> + <ui:include src="/rhq/resource/include/pagination-plain.xhtml"/> + </rich:column> + </rich:columnGroup> + </f:facet> + + </rich:dataTable> + + </rich:panel> + </h:form> + + </ui:define> + +</ui:composition> diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/ha/viewAffinityGroup-plain.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/ha/viewAffinityGroup-plain.xhtml new file mode 100644 index 0000000..968f4d8 --- /dev/null +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/ha/viewAffinityGroup-plain.xhtml @@ -0,0 +1,291 @@ +<ui:composition template="/rhq/entity/layout/main-plain.xhtml" + xmlns="http://www.w3.org/1999/xhtml" + xmlns:h="http://java.sun.com/jsf/html" + xmlns:f="http://java.sun.com/jsf/core" + xmlns:ui="http://java.sun.com/jsf/facelets" + xmlns:c="http://java.sun.com/jstl/core" + xmlns:onc="http://jboss.org/on/component" + xmlns:onf="http://jboss.org/on/function" + xmlns:s="http://jboss.com/products/seam/taglib" + xmlns:a4j="https://ajax4jsf.dev.java.net/ajax" + xmlns:rich="http://richfaces.ajax4jsf.org/rich%22%3E + + <ui:define name="content"> + + <ui:param name="affinityGroupDetails" value="#{ViewAffinityGroupDetailsUIBean.affinityGroup}" /> + <ui:param name="mode" value="#{param.mode}" /> + + <h:form id="affinityGroupDetailsForm"> + <input type="hidden" name="affinityGroupId" value="#{param.affinityGroupId}" /> + <input type="hidden" name="mode" value="#{param.mode}"/> + + rich:panel + <f:facet name="header">Affinity Group Details</f:facet> + <table> + <tr> + <td align="right"><b>Name:</b></td> + <td align="left"> + <h:outputText rendered="#{mode eq 'view'}" value="#{affinityGroupDetails.name}" /> + <h:inputText rendered="#{mode eq 'edit' || mode eq 'create'}" value="#{affinityGroupDetails.name}" /> + </td> + </tr> + </table> + </rich:panel> + + <h:panelGrid columns="2" styleClass="buttons-table" columnClasses="button-cell"> + <h:commandButton rendered="#{mode eq 'view'}" + value="EDIT" action="#{ViewAffinityGroupDetailsUIBean.edit}" + alt="Edit" styleClass="buttonmed" id="editButton"/> + <h:commandButton rendered="#{mode eq 'edit'}" + value="SAVE" action="#{ViewAffinityGroupDetailsUIBean.save}" + alt="Save" styleClass="buttonmed" id="saveButton"/> + <h:commandButton rendered="#{mode eq 'edit'}" + value="CANCEL" action="#{ViewAffinityGroupDetailsUIBean.cancelEdit}" immediate="true" + alt="Cancel" styleClass="buttonmed" id="cancelEditButton"/> + <h:commandButton rendered="#{mode eq 'create'}" + value="CREATE" action="#{ViewAffinityGroupDetailsUIBean.createNew}" + alt="Create" styleClass="buttonmed" id="createButton"/> + <h:commandButton rendered="#{mode eq 'create'}" + value="CANCEL" action="#{ViewAffinityGroupDetailsUIBean.cancelCreate}" immediate="true" + alt="Cancel" styleClass="buttonmed" id="cancelCreateButton"/> + </h:panelGrid> + </h:form> + + <h:form id="agentsForm" rendered="#{mode eq 'view'}"> + <input type="hidden" name="affinityGroupId" value="#{param.affinityGroupId}"/> + <input type="hidden" name="mode" value="#{param.mode}"/> + + rich:panel + <f:facet name="header"> + <h:outputText value="Agent Members"/> + </f:facet> + + <ui:param name="agentsDataModel" value="#{ViewAffinityGroupAgentMembersUIBean.dataModel}"/> + <rich:dataTable id="agentsDataTable" + rows="#{PageControl.AffinityGroupAgentMembersView.pageSize}" + value="#{agentsDataModel}" + var="agentItem" + width="100%" + columnsWidth="15%, 10%, 10%, 10%" + styleClass="resources-table" + footerClass="on-pager-footer" + onRowMouseOver="this.style.backgroundColor='#E7E7E7'" + onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"> + + <f:facet name="PageControlView"> + <onc:paginationControl id="AffinityGroupAgentMembersView" /> + </f:facet> + + rich:column + <f:facet name="header"> + <onc:sortableColumnHeader sort="a.name"> + <h:outputText styleClass="headerText" value="Agent Name" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputLink value="viewAgent-plain.xhtml"> + <f:param name="mode" value="view"/> + <f:param name="agentId" value="#{agentItem.id}"/> + <h:outputText value="#{agentItem.name}" /> + </h:outputLink> + </rich:column> + + rich:column + <f:facet name="header"> + <onc:sortableColumnHeader sort="a.address"> + <h:outputText styleClass="headerText" value="Bind Address" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputText value="#{agentItem.address}"/> + </rich:column> + + rich:column + <f:facet name="header"> + <onc:sortableColumnHeader sort="a.port"> + <h:outputText styleClass="headerText" value="Bind Port" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputText value="#{agentItem.port}"/> + </rich:column> + + <rich:column rendered="#{param.debug}"> + <f:facet name="header"> + <onc:sortableColumnHeader sort="a.agentToken"> + <h:outputText styleClass="headerText" value="Token" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputText value="#{agentItem.agentToken}"/> + </rich:column> + + rich:column + <f:facet name="header"> + <onc:sortableColumnHeader sort="a.lastAvailabilityReport"> + <h:outputText styleClass="headerText" value="Last Availability Report" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputText value="#{agentItem.lastAvailabilityReport}"> + <f:convertDateTime pattern="M/d/yy, h:mm:ss aa, zzz" timeZone="#{ServerInfoUIBean.timeZone}"/> + </h:outputText> + </rich:column> + + <rich:column rendered="#{param.debug}"> + <f:facet name="header"> + <onc:sortableColumnHeader sort="a.status"> + <h:outputText styleClass="headerText" value="Status" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputText value="#{agentItem.status}"/> + </rich:column> + + <f:facet name="footer"> + rich:columnGroup + <!-- colspan 8:5 for the debug 'id' column --> + <rich:column colspan="#{param.debug ? 7 : 4}" width="100%"> + + <h:commandButton action="#{ViewAffinityGroupAgentMembersUIBean.addAgentToAffinityGroup}" + value="EDIT GROUP AGENTS" styleClass="on-pager-button buttonsmall"/> + + <ui:param name="paginationDataTableName" value="agentsDataTable"/> + <ui:param name="paginationDataModel" value="#{agentsDataModel}"/> + <ui:param name="paginationPageControl" value="#{PageControl.AffinityGroupAgentMembersView}"/> + <ui:include src="/rhq/resource/include/pagination-plain.xhtml"/> + </rich:column> + </rich:columnGroup> + </f:facet> + + </rich:dataTable> + + </rich:panel> + </h:form> + + <h:form id="serversForm" rendered="#{mode eq 'view'}"> + <input type="hidden" name="affinityGroupId" value="#{param.affinityGroupId}"/> + <input type="hidden" name="mode" value="#{param.mode}"/> + + rich:panel + <f:facet name="header"> + <h:outputText value="Server Members"/> + </f:facet> + + <ui:param name="serversDataModel" value="#{ViewAffinityGroupServerMembersUIBean.dataModel}"/> + <rich:dataTable id="serversDataTable" + rows="#{PageControl.AffinityGroupServerMembersView.pageSize}" + value="#{serversDataModel}" + var="serverItem" + width="100%" + columnsWidth="15%, 10%, 10%, 8%, 8%, 15%" + styleClass="resources-table" + footerClass="on-pager-footer" + onRowMouseOver="this.style.backgroundColor='#E7E7E7'" + onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"> + + + <f:facet name="PageControlView"> + <onc:paginationControl id="AffinityGroupServerMembersView" /> + </f:facet> + + <rich:column rendered="#{param.debug}"> + <f:facet name="header"> + <onc:sortableColumnHeader sort="s.id"> + <h:outputText styleClass="headerText" value="ID" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputText value="#{serverItem.id}"/> + </rich:column> + + rich:column + <f:facet name="header"> + <onc:sortableColumnHeader sort="s.name"> + <h:outputText styleClass="headerText" value="Name" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputLink value="viewServer-plain.xhtml"> + <f:param name="mode" value="view"/> + <f:param name="serverId" value="#{serverItem.id}"/> + <h:outputText value="#{serverItem.name}" /> + </h:outputLink> + </rich:column> + + rich:column + <f:facet name="header"> + <onc:sortableColumnHeader sort="s.operationMode"> + <h:outputText styleClass="headerText" value="Mode" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputText value="#{serverItem.operationMode}"/> + </rich:column> + + rich:column + <f:facet name="header"> + <onc:sortableColumnHeader sort="s.address"> + <h:outputText styleClass="headerText" value="Endpoint Address" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputText value="#{serverItem.address}"/> + </rich:column> + + rich:column + <f:facet name="header"> + <onc:sortableColumnHeader sort="s.port"> + <h:outputText styleClass="headerText" value="HTTP Port" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputText value="#{serverItem.port}"/> + </rich:column> + + rich:column + <f:facet name="header"> + <onc:sortableColumnHeader sort="s.securePort"> + <h:outputText styleClass="headerText" value="Secure HTTPS Port" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputText value="#{serverItem.securePort}"/> + </rich:column> + + rich:column + <f:facet name="header"> + <onc:sortableColumnHeader sort="s.ctime"> + <h:outputText styleClass="headerText" value="Last Update Time" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputText value="#{serverItem.ctime}"> + <f:converter converterId="UserDateTimeConverter" /> + </h:outputText> + </rich:column> + + <f:facet name="footer"> + rich:columnGroup + <!-- colspan 8:7 for the debug 'id' column --> + <rich:column colspan="6" width="100%"> + + <h:commandButton action="#{ViewAffinityGroupServerMembersUIBean.editServers}" + value="EDIT GROUP SERVERS" styleClass="on-pager-button buttonsmall"/> + + <ui:param name="paginationDataTableName" value="serversDataTable"/> + <ui:param name="paginationDataModel" value="#{serversDataModel}"/> + <ui:param name="paginationPageControl" value="#{PageControl.AffinityGroupServerMembersView}"/> + <ui:include src="/rhq/resource/include/pagination-plain.xhtml"/> + </rich:column> + </rich:columnGroup> + </f:facet> + + </rich:dataTable> + + </rich:panel> + </h:form> + + </ui:define> + +</ui:composition> \ No newline at end of file diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/ha/viewAgent-plain.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/ha/viewAgent-plain.xhtml new file mode 100644 index 0000000..ba854ac --- /dev/null +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/ha/viewAgent-plain.xhtml @@ -0,0 +1,203 @@ +<ui:composition template="/rhq/entity/layout/main-plain.xhtml" + xmlns="http://www.w3.org/1999/xhtml" + xmlns:h="http://java.sun.com/jsf/html" + xmlns:f="http://java.sun.com/jsf/core" + xmlns:ui="http://java.sun.com/jsf/facelets" + xmlns:c="http://java.sun.com/jstl/core" + xmlns:onc="http://jboss.org/on/component" + xmlns:onf="http://jboss.org/on/function" + xmlns:s="http://jboss.com/products/seam/taglib" + xmlns:a4j="https://ajax4jsf.dev.java.net/ajax" + xmlns:rich="http://richfaces.ajax4jsf.org/rich%22%3E + + <ui:define name="content"> + + <ui:param name="agentDetails" value="#{ViewAgentUIBean.agent}" /> + <ui:param name="mode" value="#{param.mode}" /> + + <h:form id="agentDetailsForm"> + <input type="hidden" name="serverId" value="#{param.serverId}"/> + <input type="hidden" name="mode" value="#{param.mode}"/> + + rich:panel + <f:facet name="header">Agent Details</f:facet> + <table> + <tr> + <td align="right"><b>Agent Name:</b></td> + <td align="left"> + <h:outputText rendered="#{mode eq 'view'}" value="#{agentDetails.name}" /> + </td> + </tr> + <tr> + <td align="right"><b>Address:</b></td> + <td align="left"> + <h:outputText rendered="#{mode eq 'view'}" value="#{agentDetails.address}"/> + </td> + </tr> + <tr> + <td align="right"><b>Port:</b></td> + <td align="left"> + <h:outputText rendered="#{mode eq 'view'}" value="#{agentDetails.port}"/> + </td> + </tr> + <tr> + <td align="right"><b>Token:</b></td> + <td align="left"> + <h:outputText rendered="#{mode eq 'view'}" value="#{agentDetails.agentToken}"/> + </td> + </tr> + <tr> + <td align="right"><b>Last Availability Report Date:</b></td> + <td align="left"> + <h:outputText rendered="#{mode eq 'view'}" value="#{agentDetails.lastAvailabilityReport}"> + <f:convertDateTime pattern="M/d/yy, h:mm:ss aa, zzz" timeZone="#{ServerInfoUIBean.timeZone}"/> + </h:outputText> + </td> + </tr> + <tr> + <td align="right"><b>Affinity Group:</b></td> + <td align="left"> + <h:outputLink rendered="#{mode eq 'view'}" value="viewAffinityGroup-plain.xhtml"> + <f:param name="mode" value="view"/> + <f:param name="affinityGroupId" value="#{agentDetails.affinityGroup.id}"/> + <h:outputText rendered="#{mode eq 'view'}" value="#{agentDetails.affinityGroup.name}"/> + </h:outputLink> + </td> + </tr> + <tr> + <td align="right"><b>Current Server:</b></td> + <td align="left"> + <h:outputLink rendered="#{mode eq 'view'}" value="viewServer-plain.xhtml"> + <f:param name="mode" value="view"/> + <f:param name="serverId" value="#{agentDetails.server.id}"/> + <h:outputText value="#{agentDetails.server.name}" /> + </h:outputLink> + </td> + </tr> + </table> + </rich:panel> + + </h:form> + + + + <h:form id="failoverListForm" rendered="#{mode eq 'view'}"> + <input type="hidden" name="agentId" value="#{param.agentId}"/> + <input type="hidden" name="serverId" value="#{param.serverId}"/> + + rich:panel + <f:facet name="header"> + <h:outputText value="Agent Failover List"/> + </f:facet> + + <ui:param name="failoverListDataModel" value="#{ViewAgentUIBean.dataModel}"/> + <rich:dataTable id="failoverListDataTable" + rows="#{PageControl.AgentFailoverListView.pageSize}" + value="#{failoverListDataModel}" + var="item" + width="100%" + columnsWidth="20%, 16%, 16%, 16%, 16%, 16%" + styleClass="resources-table" + footerClass="on-pager-footer" + onRowMouseOver="this.style.backgroundColor='#E7E7E7'" + onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"> + + <f:facet name="PageControlView"> + <onc:paginationControl id="AgentFailoverListView" /> + </f:facet> + + <rich:column rendered="#{param.debug}"> + <f:facet name="header"> + <onc:sortableColumnHeader sort="fld.id"> + <h:outputText styleClass="headerText" value="ID" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputText value="#{item.id}"/> + </rich:column> + + rich:column + <f:facet name="header"> + <onc:sortableColumnHeader sort="fld.server.name"> + <h:outputText styleClass="headerText" value="Server Name" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputLink value="viewServer-plain.xhtml"> + <f:param name="mode" value="view"/> + <f:param name="serverId" value="#{item.server.id}"/> + <h:outputText value="#{item.server.name}" /> + </h:outputLink> + </rich:column> + + rich:column + <f:facet name="header"> + <onc:sortableColumnHeader sort="fld.server.operationMode"> + <h:outputText styleClass="headerText" value="Mode" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputText value="#{item.server.operationMode}"/> + </rich:column> + + rich:column + <f:facet name="header"> + <onc:sortableColumnHeader sort="fld.server.address"> + <h:outputText styleClass="headerText" value="Endpoint Address" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputText value="#{item.server.address}"/> + </rich:column> + + rich:column + <f:facet name="header"> + <onc:sortableColumnHeader sort="fld.server.port"> + <h:outputText styleClass="headerText" value="HTTP Port" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputText value="#{item.server.port}"/> + </rich:column> + + rich:column + <f:facet name="header"> + <onc:sortableColumnHeader sort="fld.server.securePort"> + <h:outputText styleClass="headerText" value="Secure HTTPS Port" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputText value="#{item.server.securePort}"/> + </rich:column> + + rich:column + <f:facet name="header"> + <onc:sortableColumnHeader sort="fld.server.mtime"> + <h:outputText styleClass="headerText" value="Last Update Time" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputText value="#{item.server.mtime}"> + <f:converter converterId="UserDateTimeConverter" /> + </h:outputText> + </rich:column> + + <f:facet name="footer"> + rich:columnGroup + <rich:column colspan="#{param.debug ? 7 : 6}" width="100%"> + <ui:param name="paginationDataTableName" value="failoverListDataTable"/> + <ui:param name="paginationDataModel" value="#{failoverListDataModel}"/> + <ui:param name="paginationPageControl" value="#{PageControl.AgentFailoverListView}"/> + <ui:include src="/rhq/resource/include/pagination-plain.xhtml"/> + </rich:column> + </rich:columnGroup> + </f:facet> + + </rich:dataTable> + + </rich:panel> + </h:form> + + </ui:define> + +</ui:composition> diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/ha/viewPartitionEvent-plain.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/ha/viewPartitionEvent-plain.xhtml new file mode 100644 index 0000000..65def3a --- /dev/null +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/ha/viewPartitionEvent-plain.xhtml @@ -0,0 +1,130 @@ +<ui:composition template="/rhq/entity/layout/main-plain.xhtml" + xmlns="http://www.w3.org/1999/xhtml" + xmlns:h="http://java.sun.com/jsf/html" + xmlns:f="http://java.sun.com/jsf/core" + xmlns:ui="http://java.sun.com/jsf/facelets" + xmlns:c="http://java.sun.com/jstl/core" + xmlns:onc="http://jboss.org/on/component" + xmlns:onf="http://jboss.org/on/function" + xmlns:s="http://jboss.com/products/seam/taglib" + xmlns:a4j="https://ajax4jsf.dev.java.net/ajax" + xmlns:rich="http://richfaces.ajax4jsf.org/rich%22%3E + + <ui:define name="content"> + + <h:form id="partitionEventForm"> + <input type="hidden" name="eventId" value="#{param.eventId}"/> + + <ui:param name="eventDetails" value="#{ViewPartitionEventUIBean.partitionEvent}" /> + rich:panel + <f:facet name="header"> + <h:outputText value="Event Details"/> + </f:facet> + <table> + <tr> + <td align="right"><b>Event Execution Time:</b></td> + <td align="left"> + <h:outputText value="#{eventDetails.ctime}"> + <f:converter converterId="UserDateTimeConverter" /> + </h:outputText> + </td> + </tr> + <tr> + <td align="right"><b>Event Type:</b></td> + <td align="left"> + <h:outputText value="#{eventDetails.eventType}"/> + </td> + </tr> + <tr> + <td align="right"><b>Event Details:</b></td> + <td align="left"> + <h:outputText value="#{eventDetails.eventDetail}"/> + </td> + </tr> + <tr> + <td align="right"><b>Initiated By:</b></td> + <td align="left"> + <h:outputText value="#{eventDetails.subjectName}"/> + </td> + </tr> + <tr> + <td align="right"><b>Execution Status:</b></td> + <td align="left"> + <h:outputText value="#{eventDetails.executionStatus}"/> + </td> + </tr> + </table> + </rich:panel> + + rich:panel + <f:facet name="header"> + <h:outputText value="Agent Assignments"/> + </f:facet> + + <ui:param name="partitionEventDataModel" value="#{ViewPartitionEventUIBean.dataModel}"/> + + <h:outputText value="No agents were reassigned as a result of this partition event" + rendered="#{partitionEventDataModel.rowCount eq 0}"/> + + <rich:dataTable rendered="#{partitionEventDataModel.rowCount gt 0}" + id="partitionEventDataTable" + rows="#{PageControl.PartitionEventsDetailsView.pageSize}" + value="#{partitionEventDataModel}" + var="item" + width="50%" + columnsWidth="50%, 50%" + styleClass="resources-table" + footerClass="on-pager-footer" + onRowMouseOver="this.style.backgroundColor='#E7E7E7'" + onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"> + + <f:facet name="PageControlView"> + <onc:paginationControl id="PartitionEventsDetailsView" /> + </f:facet> + + rich:column + <f:facet name="header"> + <onc:sortableColumnHeader sort="ped.agentName"> + <h:outputText styleClass="headerText" value="Agent Name" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputText value="#{item.agentName}"/> + + </rich:column> + + rich:column + <f:facet name="header"> + <onc:sortableColumnHeader sort="ped.serverName"> + <h:outputText styleClass="headerText" value="Server Name" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputText value="#{item.serverName}"/> + + </rich:column> + + <f:facet name="footer"> + rich:columnGroup + <rich:column colspan="2" width="100%"> + <ui:param name="paginationDataTableName" value="partitionEventDataTable"/> + <ui:param name="paginationDataModel" value="#{partitionEventDataModel}"/> + <ui:param name="paginationPageControl" value="#{PageControl.PartitionEventsDetailsView}"/> + <ui:include src="/rhq/resource/include/pagination-plain.xhtml"/> + </rich:column> + </rich:columnGroup> + </f:facet> + + </rich:dataTable> + + </rich:panel> + </h:form> + + <h:outputLink value="listPartitionEvents-plain.xhtml"> + <h:outputText value="Return to Partition Events List"/> + </h:outputLink> + + + </ui:define> + +</ui:composition> diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/ha/viewServer-plain.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/ha/viewServer-plain.xhtml new file mode 100644 index 0000000..f3b94ab --- /dev/null +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/ha/viewServer-plain.xhtml @@ -0,0 +1,206 @@ +<ui:composition template="/rhq/entity/layout/main-plain.xhtml" + xmlns="http://www.w3.org/1999/xhtml" + xmlns:h="http://java.sun.com/jsf/html" + xmlns:f="http://java.sun.com/jsf/core" + xmlns:ui="http://java.sun.com/jsf/facelets" + xmlns:c="http://java.sun.com/jstl/core" + xmlns:onc="http://jboss.org/on/component" + xmlns:onf="http://jboss.org/on/function" + xmlns:s="http://jboss.com/products/seam/taglib" + xmlns:a4j="https://ajax4jsf.dev.java.net/ajax" + xmlns:rich="http://richfaces.ajax4jsf.org/rich%22%3E + + <ui:define name="content"> + + <ui:param name="serverDetails" value="#{ViewServerUIBean.server}" /> + <ui:param name="mode" value="#{param.mode}" /> + + <h:form id="serverDetailsForm"> + <input type="hidden" name="serverId" value="#{param.serverId}"/> + <input type="hidden" name="mode" value="#{param.mode}"/> + + rich:panel + <f:facet name="header">Server Details</f:facet> + <table> + <tr> + <td align="right"><b>Server Name:</b></td> + <td align="left"> + <h:outputText value="#{serverDetails.name}" /> + </td> + </tr> + <tr> + <td align="right"><b>Address:</b></td> + <td align="left"> + <h:outputText rendered="#{mode eq 'view'}" value="#{serverDetails.address}"/> + <h:inputText rendered="#{mode eq 'edit'}" value="#{serverDetails.address}"/> + </td> + </tr> + <tr> + <td align="right"><b>Port:</b></td> + <td align="left"> + <h:outputText rendered="#{mode eq 'view'}" value="#{serverDetails.port}"/> + <h:inputText rendered="#{mode eq 'edit'}" value="#{serverDetails.port}"/> + </td> + </tr> + <tr> + <td align="right"><b>Secure Port:</b></td> + <td align="left"> + <h:outputText rendered="#{mode eq 'view'}" value="#{serverDetails.securePort}"/> + <h:inputText rendered="#{mode eq 'edit'}" value="#{serverDetails.securePort}"/> + </td> + </tr> + <tr> + <td align="right"><b>Operation Mode:</b></td> + <td align="left"> + <h:outputText value="#{serverDetails.operationMode}"/> + </td> + </tr> + <tr> + <td align="right"><b>Affinity Group:</b></td> + <td align="left"> + <h:outputText value="#{serverDetails.affinityGroup.name}"/> + </td> + </tr> + <tr> + <td align="right"><b>Installation Date:</b></td> + <td align="left"> + <h:outputText value="#{serverDetails.ctime}"> + <f:converter converterId="UserDateTimeConverter" /> + </h:outputText> + </td> + </tr> + <tr> + <td align="right"><b>Last Update Time:</b></td> + <td align="left"> + <h:outputText value="#{serverDetails.mtime}"> + <f:converter converterId="UserDateTimeConverter" /> + </h:outputText> + </td> + </tr> + </table> + </rich:panel> + + <h:panelGrid columns="2" styleClass="buttons-table" columnClasses="button-cell"> + <h:commandButton rendered="#{mode eq 'view'}" + value="EDIT" action="#{ViewServerUIBean.edit}" + alt="Edit" styleClass="buttonmed" id="editButton"/> + <h:commandButton rendered="#{mode eq 'edit'}" + value="SAVE" action="#{ViewServerUIBean.save}" + alt="Save" styleClass="buttonmed" id="saveButton"/> + <h:commandButton rendered="#{mode eq 'edit'}" + value="CANCEL" action="#{ViewServerUIBean.cancel}" immediate="true" + alt="Cancel" styleClass="buttonmed" id="cancelButton"/> + </h:panelGrid> + </h:form> + + <h:form id="connectedAgentsForm" rendered="#{mode eq 'view'}"> + <input type="hidden" name="serverId" value="#{param.serverId}"/> + + rich:panel + <f:facet name="header"> + <h:outputText value="Connected Agents"/> + </f:facet> + + <ui:param name="connectedAgentsDataModel" value="#{ViewServerUIBean.dataModel}"/> + <rich:dataTable id="connectedAgentsDataTable" + rows="#{PageControl.ServerConnectedAgentsView.pageSize}" + value="#{connectedAgentsDataModel}" + var="item" + width="100%" + columnsWidth="1%, 15%, 10%, 10%, 10%, 10%" + styleClass="resources-table" + footerClass="on-pager-footer" + onRowMouseOver="this.style.backgroundColor='#E7E7E7'" + onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"> + + <f:facet name="PageControlView"> + <onc:paginationControl id="ServerConnectedAgentsView" /> + </f:facet> + + rich:column + <f:facet name="header"> + <onc:allSelect target="selectedAgents" /> + </f:facet> + + <onc:select name="selectedAgents" value="#{item.id}" /> + </rich:column> + + rich:column + <f:facet name="header"> + <onc:sortableColumnHeader sort="a.name"> + <h:outputText styleClass="headerText" value="Agent Name" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputLink value="viewAgent-plain.xhtml"> + <f:param name="mode" value="view"/> + <f:param name="agentId" value="#{item.id}"/> + <f:param name="serverId" value="#{param.serverId}"/> + <h:outputText value="#{item.name}" /> + </h:outputLink> + </rich:column> + + rich:column + <f:facet name="header"> + <onc:sortableColumnHeader sort="a.address"> + <h:outputText styleClass="headerText" value="Bind Address" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputText value="#{item.address}"/> + </rich:column> + + rich:column + <f:facet name="header"> + <onc:sortableColumnHeader sort="a.port"> + <h:outputText styleClass="headerText" value="Bind Port" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputText value="#{item.port}"/> + </rich:column> + + rich:column + <f:facet name="header"> + <onc:sortableColumnHeader sort="a.lastAvailabilityReport"> + <h:outputText styleClass="headerText" value="Last Availability Report" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputText value="#{item.lastAvailabilityReport}"> + <f:convertDateTime pattern="M/d/yy, h:mm:ss aa, zzz" timeZone="#{ServerInfoUIBean.timeZone}"/> + </h:outputText> + </rich:column> + + rich:column + <f:facet name="header"> + <h:outputText styleClass="headerText" value="Affinity Group" /> + </f:facet> + + <h:outputLink value="viewAffinityGroup-plain.xhtml"> + <f:param name="mode" value="view"/> + <f:param name="affinityGroupId" value="#{item.affinityGroup.id}"/> + <h:outputText value="#{item.affinityGroup.name}"/> + </h:outputLink> + </rich:column> + + <f:facet name="footer"> + rich:columnGroup + <!-- colspan 9:6 for the debug 'id' column --> + <rich:column colspan="6" width="100%"> + <ui:param name="paginationDataTableName" value="connectedAgentsDataTable"/> + <ui:param name="paginationDataModel" value="#{connectedAgentsDataModel}"/> + <ui:param name="paginationPageControl" value="#{PageControl.ServerConnectedAgentsView}"/> + <ui:include src="/rhq/resource/include/pagination-plain.xhtml"/> + </rich:column> + </rich:columnGroup> + </f:facet> + + </rich:dataTable> + + </rich:panel> + </h:form> + + </ui:define> + +</ui:composition> \ No newline at end of file
commit 9c6f7cd5ed5a619166ba67faf7042f59899c1677 Author: Joseph Marques joseph@redhat.com Date: Thu Aug 12 12:37:25 2010 -0400
reformat, cosmetic
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/AdministrationView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/AdministrationView.java index 6eead0b..469fda4 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/AdministrationView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/AdministrationView.java @@ -49,11 +49,9 @@ public class AdministrationView extends HLayout implements BookmarkableView {
public static final String VIEW_PATH = "Administration";
- private ViewId currentSectionViewId; private ViewId currentPageViewId;
- private SectionStack sectionStack;
private Canvas contentCanvas; @@ -76,14 +74,12 @@ public class AdministrationView extends HLayout implements BookmarkableView { sectionStack.setWidth(250); sectionStack.setHeight100();
- treeGrids.put("Security", buildSecuritySection()); treeGrids.put("Configuration", buildSystemConfigurationSection()); treeGrids.put("Cluster", buildManagementClusterSection()); treeGrids.put("Reports", buildReportsSection()); treeGrids.put("Security", buildSecuritySection());
- for (final String name : treeGrids.keySet()) { TreeGrid grid = treeGrids.get(name);
@@ -93,7 +89,6 @@ public class AdministrationView extends HLayout implements BookmarkableView { } });
- SectionStackSection section = new SectionStackSection(name); section.setExpanded(true); section.addItem(grid); @@ -101,23 +96,20 @@ public class AdministrationView extends HLayout implements BookmarkableView { sectionStack.addSection(section); }
- addMember(sectionStack); addMember(contentCanvas);
}
- private HTMLFlow defaultView() { - String contents = "<h1>Administration</h1>\n" + - "From this section, the RHQ global settings can be administered. This includes configuring \n" + - "<a href="">Security</a>, setting up <a href="">Plugins</a> and other stuff."; + String contents = "<h1>Administration</h1>\n" + + "From this section, the RHQ global settings can be administered. This includes configuring \n" + + "<a href="">Security</a>, setting up <a href="">Plugins</a> and other stuff."; HTMLFlow flow = new HTMLFlow(contents); flow.setPadding(20); return flow; }
- private TreeGrid buildSecuritySection() {
final TreeGrid securityTreeGrid = new TreeGrid(); @@ -136,19 +128,14 @@ public class AdministrationView extends HLayout implements BookmarkableView {
final TreeNode remoteAgentInstall = new TreeNode("Remote Agent Install"); remoteAgentInstall.setIcon("global/Agent_16.png"); - - tree.setRoot(new TreeNode("security", - manageUsersNode, - manageRolesNode, - discoveryQueue, - remoteAgentInstall)); + + tree.setRoot(new TreeNode("security", manageUsersNode, manageRolesNode, discoveryQueue, remoteAgentInstall));
securityTreeGrid.setData(tree);
return securityTreeGrid; }
- private TreeGrid buildManagementClusterSection() {
final TreeGrid mgmtClusterTreeGrid = new TreeGrid(); @@ -161,18 +148,14 @@ public class AdministrationView extends HLayout implements BookmarkableView { final TreeNode manageAffinityGroupsNode = new TreeNode("Affinity Groups"); final TreeNode managePartitionEventsNode = new TreeNode("Partition Events");
- tree.setRoot(new TreeNode("clustering", - manageServersNode, - manageAgentsNode, - manageAffinityGroupsNode, - managePartitionEventsNode)); + tree.setRoot(new TreeNode("clustering", manageServersNode, manageAgentsNode, manageAffinityGroupsNode, + managePartitionEventsNode));
mgmtClusterTreeGrid.setData(tree);
return mgmtClusterTreeGrid; }
- private TreeGrid buildSystemConfigurationSection() {
final TreeGrid systemConfigTreeGrid = new TreeGrid(); @@ -186,15 +169,14 @@ public class AdministrationView extends HLayout implements BookmarkableView { final TreeNode manageLicense = new TreeNode("License"); final TreeNode managePlugins = new TreeNode("Plugins");
- tree.setRoot(new TreeNode("System Configuration", - manageSettings, manageTemplates, manageDownloads, manageLicense, managePlugins)); + tree.setRoot(new TreeNode("System Configuration", manageSettings, manageTemplates, manageDownloads, + manageLicense, managePlugins));
systemConfigTreeGrid.setData(tree);
return systemConfigTreeGrid; }
- private TreeGrid buildReportsSection() {
final TreeGrid reportsTreeGrid = new TreeGrid(); @@ -212,7 +194,6 @@ public class AdministrationView extends HLayout implements BookmarkableView { return reportsTreeGrid; }
- public void setContent(Canvas newContent) {
if (contentCanvas.getChildren().length > 0) @@ -222,7 +203,6 @@ public class AdministrationView extends HLayout implements BookmarkableView { contentCanvas.markForRedraw(); }
- private void renderContentView(ViewPath viewPath) {
currentSectionViewId = viewPath.getCurrent(); @@ -231,7 +211,6 @@ public class AdministrationView extends HLayout implements BookmarkableView { String section = currentSectionViewId.getPath(); String page = currentPageViewId.getPath();
- Canvas content = null; if ("Reports".equals(section)) {
@@ -239,7 +218,6 @@ public class AdministrationView extends HLayout implements BookmarkableView { content = new FullHTMLPane("/rhq/admin/report/resourceInstallReport-body.xhtml"); }
- } else if ("Security".equals(section)) {
if ("Manage Users".equals(page)) { @@ -268,7 +246,6 @@ public class AdministrationView extends HLayout implements BookmarkableView { url = addQueryStringParam(url, "nomenu=true"); content = new FullHTMLPane(url);
- } else if ("Cluster".equals(section)) { String url = null; if ("Servers".equals(page)) { @@ -284,30 +261,24 @@ public class AdministrationView extends HLayout implements BookmarkableView { content = new FullHTMLPane(url); }
- for (String name : treeGrids.keySet()) {
TreeGrid treeGrid = treeGrids.get(name); if (name.equals(section)) { -// treeGrid.setSelectedPaths(page); + // treeGrid.setSelectedPaths(page); } else { treeGrid.deselectAllRecords(); } }
- - setContent(content);
- if (content instanceof BookmarkableView) { ((BookmarkableView) content).renderView(viewPath.next().next()); }
- }
- public void renderView(ViewPath viewPath) {
if (!viewPath.isCurrent(currentSectionViewId) || !viewPath.isNext(currentPageViewId)) { @@ -320,7 +291,6 @@ public class AdministrationView extends HLayout implements BookmarkableView { } }
- }
private static String addQueryStringParam(String url, String param) {
commit 0d845ab5f35094598072d401ced32debc832812a Author: Ian Springer ian.springer@redhat.com Date: Thu Aug 12 11:53:17 2010 -0400
minor improvements
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/overview/ResourceSummaryView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/overview/ResourceSummaryView.java index 0015742..56f84b6 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/overview/ResourceSummaryView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/overview/ResourceSummaryView.java @@ -267,10 +267,10 @@ public class ResourceSummaryView extends EnhancedDynamicForm implements Resource setValue("name", resource.getName()); setValue("description", resource.getDescription()); setValue("location", resource.getLocation()); - setValue("version", resource.getVersion()); - setValue("parent", resource.getParentResource() == null ? null : - ("<a href="#Resource/" + resource.getParentResource().getId() + "">" + - resource.getParentResource().getName() + "</a>")); - + setValue("version", (resource.getVersion() != null) ? resource.getVersion() : "<i>none</i>"); + Resource parentResource = resource.getParentResource(); + setValue("parent", parentResource != null ? + ("<a href="#Resource/" + parentResource.getId() + "">" + + parentResource.getName() + "</a>") : "<i>none</i>"); } }
commit aad7ce9eabe9d79aeb035bd17f98f2ef8ffa7410 Author: Ian Springer ian.springer@redhat.com Date: Thu Aug 12 11:26:01 2010 -0400
fix logic that determines which resource tabs are enabled
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java index 68d92d5..1be470e 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java @@ -202,46 +202,34 @@ public class ResourceDetailView extends VLayout implements BookmarkableView, Res ResourcePermission permissions = this.resourceComposite.getResourcePermission(); ResourceFacets facets = this.resourceComposite.getResourceFacets();
- // TODO (ips): No perms should be needed to view Monitoring and Alerts tabs. + // Summary, Monitoring, Inventory, and Alerts tabs are always enabled.
- if (permissions.isMeasure()) { - topTabSet.enableTab(monitoringTab); - } else { - topTabSet.disableTab(monitoringTab); - } + monitoringTab.setSubTabEnabled("Call Time", facets.isCallTime());
- if (facets.isOperation() && permissions.isControl()) { + if (facets.isOperation()) { topTabSet.enableTab(operationsTab); } else { topTabSet.disableTab(operationsTab); }
- if (permissions.isAlert()) { - topTabSet.enableTab(alertsTab); - } else { - topTabSet.disableTab(alertsTab); - } - - if (!facets.isConfiguration() && permissions.isConfigureRead()) { + if (facets.isConfiguration() && permissions.isConfigureRead()) { topTabSet.enableTab(configurationTab); } else { topTabSet.disableTab(configurationTab); }
- if (facets.isEvent() && permissions.isMeasure()) { + if (facets.isEvent()) { topTabSet.enableTab(eventsTab); } else { topTabSet.disableTab(eventsTab); }
- if (facets.isContent() && permissions.isContent()) { + if (facets.isContent()) { topTabSet.enableTab(contentTab); } else { topTabSet.disableTab(contentTab); }
- // only enable "Call Time" sub-tab for those that implement it - monitoringTab.setSubTabEnabled("Call Time", facets.isCallTime());
if (topTabSet.getSelectedTab().getDisabled()) { topTabSet.selectTab(0);
commit d00cabef04eb1ae458a9dcf4b1f217e6d4c7b76e Author: Ian Springer ian.springer@redhat.com Date: Thu Aug 12 11:06:03 2010 -0400
add new EnhancedDynamicForm GWT component that supports fields that can be toggled back and forth between view and edit mode; add support for setting name, description, and location fields on both Resources and groups
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/composite/ResourceComposite.java b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/composite/ResourceComposite.java index 96745a8..8b6f809 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/composite/ResourceComposite.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/composite/ResourceComposite.java @@ -119,6 +119,10 @@ public class ResourceComposite implements Serializable { return resourcePermission; }
+ public void setResourcePermission(ResourcePermission resourcePermission) { + this.resourcePermission = resourcePermission; + } + @XmlTransient public ResourceFacets getResourceFacets() { return resourceFacets; diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/FullHTMLPane.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/FullHTMLPane.java index 3e8f61a..50ed0ae 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/FullHTMLPane.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/FullHTMLPane.java @@ -26,10 +26,15 @@ import com.smartgwt.client.widgets.HTMLPane; */ public class FullHTMLPane extends HTMLPane {
- public FullHTMLPane(String url) { + public FullHTMLPane() { setWidth100(); setHeight100(); setContentsType(ContentsType.PAGE); + } + + public FullHTMLPane(String url) { + this(); setContentsURL(url); } + } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/form/EnhancedDynamicForm.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/form/EnhancedDynamicForm.java new file mode 100644 index 0000000..02185e7 --- /dev/null +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/form/EnhancedDynamicForm.java @@ -0,0 +1,156 @@ +/* + * RHQ Management Platform + * Copyright (C) 2010 Red Hat, Inc. + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License, version 2, as + * published by the Free Software Foundation, and/or the GNU Lesser + * General Public License, version 2.1, also as published by the Free + * Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License and the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License + * and the GNU Lesser General Public License along with this program; + * if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +package org.rhq.enterprise.gui.coregui.client.components.form; + +import com.google.gwt.core.client.JavaScriptObject; +import com.smartgwt.client.widgets.form.DynamicForm; +import com.smartgwt.client.widgets.form.FormItemIfFunction; +import com.smartgwt.client.widgets.form.fields.FormItem; +import com.smartgwt.client.widgets.form.fields.FormItemIcon; +import com.smartgwt.client.widgets.form.fields.StaticTextItem; +import com.smartgwt.client.widgets.form.fields.TextItem; +import com.smartgwt.client.widgets.form.fields.events.BlurEvent; +import com.smartgwt.client.widgets.form.fields.events.BlurHandler; +import com.smartgwt.client.widgets.form.fields.events.IconClickEvent; +import com.smartgwt.client.widgets.form.fields.events.IconClickHandler; +import com.smartgwt.client.widgets.form.fields.events.KeyPressEvent; +import com.smartgwt.client.widgets.form.fields.events.KeyPressHandler; + +import java.util.ArrayList; +import java.util.List; + +/** + * TODO + * + * @author Ian Springer + */ +public class EnhancedDynamicForm extends DynamicForm { + public EnhancedDynamicForm(JavaScriptObject jsObj) { + super(jsObj); + } + + public EnhancedDynamicForm() { + super(); + } + + @Override + protected void onDraw() { + super.onDraw(); + setNumCols(4); + setColWidths("25%", "25%", "25%", "25%"); + setWrapItemTitles(false); + setWidth("90%"); + } + + @Override + public void setItems(FormItem... items) { + List<FormItem> itemsList = new ArrayList<FormItem>(); + List<String> togglableTextItemNames = new ArrayList<String>(); + for (FormItem item : items) { + if (item instanceof TogglableTextItem) { + final TogglableTextItem togglableTextItem = (TogglableTextItem) item; + togglableTextItemNames.add(togglableTextItem.getName()); + + final StaticTextItem staticTextItem = + new StaticTextItem(getStaticTextItemName(togglableTextItem.getName()), + togglableTextItem.getTitle()); + staticTextItem.setAttribute("editing", false); + + FormItemIcon editIcon = new FormItemIcon(); + editIcon.setName("Edit"); + editIcon.setSrc("[SKIN]/actions/edit.png"); + staticTextItem.setIcons(editIcon); + staticTextItem.setShowIcons(true); + + staticTextItem.addIconClickHandler(new IconClickHandler() { + public void onIconClick(IconClickEvent iconClickEvent) { + if ("Edit".equals(iconClickEvent.getIcon().getName())) { + staticTextItem.setAttribute("editing", true); + markForRedraw(); + } + } + }); + staticTextItem.setShowIfCondition(new FormItemIfFunction() { + public boolean execute(FormItem formItem, Object o, DynamicForm dynamicForm) { + boolean editing = staticTextItem.getAttributeAsBoolean("editing"); + return !editing; + } + }); + staticTextItem.addClickHandler(new com.smartgwt.client.widgets.form.fields.events.ClickHandler() { + public void onClick(com.smartgwt.client.widgets.form.fields.events.ClickEvent clickEvent) { + staticTextItem.setAttribute("editing", true); + markForRedraw(); + } + }); + staticTextItem.setRedrawOnChange(true); + itemsList.add(staticTextItem); + + togglableTextItem.addKeyPressHandler(new KeyPressHandler() { + public void onKeyPress(KeyPressEvent keyPressEvent) { + if (keyPressEvent.getKeyName().equals("Enter")) { + updateValue(staticTextItem, togglableTextItem); + } + } + }); + togglableTextItem.addBlurHandler(new BlurHandler() { + public void onBlur(BlurEvent blurEvent) { + updateValue(staticTextItem, togglableTextItem); + } + }); + togglableTextItem.setShowIfCondition(new FormItemIfFunction() { + public boolean execute(FormItem formItem, Object o, DynamicForm dynamicForm) { + boolean editing = staticTextItem.getAttributeAsBoolean("editing"); + return editing; + } + }); + itemsList.add(togglableTextItem); + } else { + itemsList.add(item); + } + } + + super.setItems((FormItem[]) itemsList.toArray(new FormItem[itemsList.size()])); + + // SmartGWT annoyingly barfs if getValue() is called on a form item before it's been added to a form, so + // we wait until after we've added all of the items to the form to set the values of the static items we + // added, because only at that point can we grab the values of the corresponding togglable items. + for (String name : togglableTextItemNames) { + String value = getValueAsString(name); + setValue(getStaticTextItemName(name), value); + } + } + + private String getStaticTextItemName(String togglableTextItemName) { + return "static" + togglableTextItemName; + } + + private void updateValue(StaticTextItem staticTextItem, TogglableTextItem textItem) { + String value = (String) textItem.getValue(); + staticTextItem.setValue(value); + staticTextItem.setAttribute("editing", false); + for (ValueUpdatedHandler handler : textItem.getValueUpdatedHandlers()) { + handler.onValueUpdated(value); + } + markForRedraw(); + } +} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/form/TogglableTextItem.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/form/TogglableTextItem.java new file mode 100644 index 0000000..399cb7e --- /dev/null +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/form/TogglableTextItem.java @@ -0,0 +1,61 @@ +/* + * RHQ Management Platform + * Copyright (C) 2010 Red Hat, Inc. + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License, version 2, as + * published by the Free Software Foundation, and/or the GNU Lesser + * General Public License, version 2.1, also as published by the Free + * Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License and the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License + * and the GNU Lesser General Public License along with this program; + * if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +package org.rhq.enterprise.gui.coregui.client.components.form; + +import com.google.gwt.core.client.JavaScriptObject; +import com.smartgwt.client.widgets.form.fields.TextItem; + +import java.util.ArrayList; +import java.util.List; + +/** + * TODO + * + * @author Ian Springer + */ +public class TogglableTextItem extends TextItem { + List<ValueUpdatedHandler> valueUpdatedHandlers = new ArrayList<ValueUpdatedHandler>(); + + public TogglableTextItem() { + } + + public TogglableTextItem(JavaScriptObject jsObj) { + super(jsObj); + } + + public TogglableTextItem(String name) { + super(name); + } + + public TogglableTextItem(String name, String title) { + super(name, title); + } + + public void addValueUpdatedHandler(ValueUpdatedHandler handler) { + this.valueUpdatedHandlers.add(handler); + } + + public List<ValueUpdatedHandler> getValueUpdatedHandlers() { + return valueUpdatedHandlers; + } +} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/form/ValueUpdatedHandler.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/form/ValueUpdatedHandler.java new file mode 100644 index 0000000..ac35115 --- /dev/null +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/form/ValueUpdatedHandler.java @@ -0,0 +1,8 @@ +package org.rhq.enterprise.gui.coregui.client.components.form; + +/** + * @author Ian Springer + */ +public interface ValueUpdatedHandler { + void onValueUpdated(String newValue); +} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ResourceGWTService.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ResourceGWTService.java index e7857cd..53741a9 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ResourceGWTService.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ResourceGWTService.java @@ -29,6 +29,7 @@ import org.rhq.core.domain.criteria.ResourceCriteria; import org.rhq.core.domain.resource.InventoryStatus; import org.rhq.core.domain.resource.Resource; import org.rhq.core.domain.resource.composite.RecentlyAddedResourceComposite; +import org.rhq.core.domain.resource.composite.ResourceComposite; import org.rhq.core.domain.util.PageControl; import org.rhq.core.domain.util.PageList;
@@ -39,6 +40,8 @@ public interface ResourceGWTService extends RemoteService {
PageList<Resource> findResourcesByCriteria(ResourceCriteria criteria);
+ PageList<ResourceComposite> findResourceCompositesByCriteria(ResourceCriteria criteria); + List<Resource> getResourceLineage(int resourceId);
List<Resource> getResourceLineageAndSiblings(int resourceId); @@ -61,4 +64,11 @@ public interface ResourceGWTService extends RemoteService { void ignoreResources(Integer[] resourceIds);
void unignoreResources(Integer[] resourceIds); + + void updateResourceName(int resourceId, String name); + + void updateResourceDescription(int resourceId, String description); + + void updateResourceLocation(int resourceId, String location); + } \ No newline at end of file diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ResourceGroupGWTService.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ResourceGroupGWTService.java index 5644554..9134199 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ResourceGroupGWTService.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ResourceGroupGWTService.java @@ -45,4 +45,11 @@ public interface ResourceGroupGWTService extends RemoteService { ResourceGroup createResourceGroup(ResourceGroup group, int[] resourceIds);
void deleteResourceGroup(int groupId); + + void updateResourceGroupName(int groupId, String name); + + void updateResourceGroupDescription(int groupId, String description); + + void updateResourceGroupLocation(int groupId, String location); + } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java index 7ce294f..51c225a 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java @@ -246,13 +246,17 @@ public class ResourceGroupDetailView extends VLayout implements BookmarkableView }
public void onTabSelected(TwoLevelTabSelectedEvent tabSelectedEvent) { - // Switch tabs directly, rather than letting the history framework do it, to avoid redrawing the outer views. - selectTab(tabSelectedEvent.getId(), tabSelectedEvent.getSubTabId()); - String tabPath = "/" + tabSelectedEvent.getId() + "/" + tabSelectedEvent.getSubTabId(); - String path = "ResourceGroup/" + this.groupComposite.getResourceGroup().getId() + tabPath; + if (this.groupComposite == null) { + History.fireCurrentHistoryState(); + } else { + // Switch tabs directly, rather than letting the history framework do it, to avoid redrawing the outer views. + selectTab(tabSelectedEvent.getId(), tabSelectedEvent.getSubTabId()); + String tabPath = "/" + tabSelectedEvent.getId() + "/" + tabSelectedEvent.getSubTabId(); + String path = "ResourceGroup/" + this.groupComposite.getResourceGroup().getId() + tabPath;
- // But still add an item to the history, specifying false to tell it not to fire an event. - History.newItem(path, false); + // But still add an item to the history, specifying false to tell it not to fire an event. + History.newItem(path, false); + } }
public void renderView(ViewPath viewPath) { @@ -282,4 +286,5 @@ public class ResourceGroupDetailView extends VLayout implements BookmarkableView tab.getLayout().selectTab(subtabName); } } -} \ No newline at end of file +} + diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/inventory/OverviewView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/inventory/OverviewView.java index 57ecbcd..e9078cd 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/inventory/OverviewView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/inventory/OverviewView.java @@ -18,11 +18,10 @@ */ package org.rhq.enterprise.gui.coregui.client.inventory.groups.detail.inventory;
+import com.google.gwt.user.client.rpc.AsyncCallback; import com.smartgwt.client.types.Alignment; import com.smartgwt.client.widgets.HTMLFlow; -import com.smartgwt.client.widgets.form.DynamicForm; import com.smartgwt.client.widgets.form.fields.FormItem; -import com.smartgwt.client.widgets.form.fields.SpacerItem; import com.smartgwt.client.widgets.form.fields.StaticTextItem; import com.smartgwt.client.widgets.layout.HLayout; import com.smartgwt.client.widgets.layout.VLayout; @@ -30,16 +29,25 @@ import org.rhq.core.domain.resource.ResourceType; import org.rhq.core.domain.resource.group.GroupDefinition; import org.rhq.core.domain.resource.group.ResourceGroup; import org.rhq.core.domain.resource.group.composite.ResourceGroupComposite; +import org.rhq.enterprise.gui.coregui.client.CoreGUI; +import org.rhq.enterprise.gui.coregui.client.components.form.EnhancedDynamicForm; +import org.rhq.enterprise.gui.coregui.client.components.form.TogglableTextItem; +import org.rhq.enterprise.gui.coregui.client.components.form.ValueUpdatedHandler; +import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup; +import org.rhq.enterprise.gui.coregui.client.gwt.ResourceGroupGWTServiceAsync; +import org.rhq.enterprise.gui.coregui.client.util.message.Message;
import java.util.ArrayList; import java.util.Date; +import java.util.List;
/** - * The group Inventory>Overview tab. + * The group Inventory>Overview subtab. * * @author Ian Springer */ public class OverviewView extends VLayout { + private ResourceGroupGWTServiceAsync resourceGroupService = GWTServiceLookup.getResourceGroupService(); private ResourceGroupComposite groupComposite;
public OverviewView(ResourceGroupComposite groupComposite) { @@ -51,31 +59,55 @@ public class OverviewView extends VLayout { protected void onInit() { super.onInit();
- ResourceGroup group = this.groupComposite.getResourceGroup(); + final ResourceGroup group = this.groupComposite.getResourceGroup();
HLayout spacer = new HLayout(); spacer.setHeight(15); addMember(spacer);
- DynamicForm generalPropsForm = new DynamicForm(); - generalPropsForm.setNumCols(4); - generalPropsForm.setColWidths("25%", "25%", "25%", "25%"); - generalPropsForm.setWrapItemTitles(false); - setWidth("90%"); + final EnhancedDynamicForm generalPropsForm = new EnhancedDynamicForm();
- ArrayList<FormItem> formItems = new ArrayList<FormItem>(); - ArrayList<String> itemIds = new ArrayList<String>(); + List<FormItem> formItems = new ArrayList<FormItem>();
+ // TODO: Uncomment the below header if we decide to add other stuff to this page besides the general props. //HeaderItem headerItem = new HeaderItem("header", "General Properties"); //headerItem.setValue("General Properties"); - //formItems.add(headerItem); + //formItems.add(headerItem);
- StaticTextItem nameItem = new StaticTextItem("nameItem", "Name"); + boolean dynamic = (group.getGroupDefinition() != null); + + final FormItem nameItem = (dynamic) ? new StaticTextItem() : new TogglableTextItem(); + nameItem.setName("name"); + nameItem.setTitle("Name"); nameItem.setValue(group.getName()); + if (nameItem instanceof TogglableTextItem) { + final TogglableTextItem togglableNameItem = (TogglableTextItem) nameItem; + togglableNameItem.addValueUpdatedHandler(new ValueUpdatedHandler() { + public void onValueUpdated(final String newName) { + final String oldName = group.getName(); + OverviewView.this.resourceGroupService.updateResourceGroupName(group.getId(), + newName, new AsyncCallback<Void>() { + public void onFailure(Throwable caught) { + CoreGUI.getErrorHandler().handleError("Failed to change name of Resource group with id " + + group.getId() + + " from "" + oldName + "" to "" + newName + "".", caught); + // We failed to update it on the Server, so change back the form item to the original value. + nameItem.setValue(oldName); + } + + public void onSuccess(Void result) { + CoreGUI.getMessageCenter().notify(new Message("Name of Resource group with id " + + group.getId() + " was changed from "" + + oldName + "" to "" + newName + "".", Message.Severity.Info)); + group.setName(newName); + } + }); + } + }); + } formItems.add(nameItem); - itemIds.add(nameItem.getName());
- StaticTextItem typeItem = new StaticTextItem("typeItem", "Member Type"); + StaticTextItem typeItem = new StaticTextItem("memberType", "Member Type"); ResourceType type = group.getResourceType(); if (type != null) { typeItem.setTooltip("Plugin: " + type.getPlugin() + "\n<br>" + "Type: " + type.getName()); @@ -84,56 +116,106 @@ public class OverviewView extends VLayout { typeItem.setValue("<i>Mixed</i>"); } formItems.add(typeItem); - itemIds.add(typeItem.getName());
- StaticTextItem countItem = new StaticTextItem("countItem", "Member Count"); + StaticTextItem countItem = new StaticTextItem("memberCount", "Member Count"); long memberCount = this.groupComposite.getImplicitUp() + this.groupComposite.getImplicitDown(); countItem.setValue(memberCount); formItems.add(countItem); - itemIds.add(countItem.getName());
- StaticTextItem descriptionItem = new StaticTextItem("descriptionItem", "Description"); - String description = group.getDescription(); - descriptionItem.setValue((description != null) ? description : "<i>none</i>"); + final FormItem descriptionItem = (dynamic) ? new StaticTextItem() : new TogglableTextItem(); + descriptionItem.setName("description"); + descriptionItem.setTitle("Description"); + descriptionItem.setValue(group.getDescription()); + if (descriptionItem instanceof TogglableTextItem) { + final TogglableTextItem togglableDescriptionItem = (TogglableTextItem) descriptionItem; + togglableDescriptionItem.addValueUpdatedHandler(new ValueUpdatedHandler() { + public void onValueUpdated(final String newDescription) { + final String oldDescription = group.getDescription(); + OverviewView.this.resourceGroupService.updateResourceGroupDescription(group.getId(), + newDescription, new AsyncCallback<Void>() { + public void onFailure(Throwable caught) { + CoreGUI.getErrorHandler().handleError("Failed to change description of Resource group with id " + + group.getId() + + " from "" + oldDescription + "" to "" + newDescription + "".", caught); + // We failed to update it on the Server, so change back the form item to the original value. + descriptionItem.setValue(oldDescription); + } + + public void onSuccess(Void result) { + CoreGUI.getMessageCenter().notify(new Message("Description of Resource group with id " + + group.getId() + " was changed from "" + + oldDescription + "" to "" + newDescription + "".", Message.Severity.Info)); + group.setDescription(newDescription); + } + }); + } + }); + } formItems.add(descriptionItem); - itemIds.add(descriptionItem.getName());
- StaticTextItem dynamicItem = new StaticTextItem("dynamicItem", "Dynamic?"); - dynamicItem.setValue((group.getGroupDefinition() != null) ? "yes" : "no"); + final FormItem locationItem = (dynamic) ? new StaticTextItem() : new TogglableTextItem(); + locationItem.setName("location"); + locationItem.setTitle("Location"); + locationItem.setValue(group.getLocation()); + if (locationItem instanceof TogglableTextItem) { + final TogglableTextItem togglableLocationItem = (TogglableTextItem) locationItem; + togglableLocationItem.addValueUpdatedHandler(new ValueUpdatedHandler() { + public void onValueUpdated(final String newLocation) { + final String oldLocation = group.getLocation(); + OverviewView.this.resourceGroupService.updateResourceGroupLocation(group.getId(), + newLocation, new AsyncCallback<Void>() { + public void onFailure(Throwable caught) { + CoreGUI.getErrorHandler().handleError("Failed to change location of Resource group with id " + + group.getId() + + " from "" + oldLocation + "" to "" + newLocation + "".", caught); + // We failed to update it on the Server, so change back the form item to the original value. + locationItem.setValue(oldLocation); + } + + public void onSuccess(Void result) { + CoreGUI.getMessageCenter().notify(new Message("Location of Resource group with id " + + group.getId() + " was changed from "" + + oldLocation + "" to "" + newLocation + "".", Message.Severity.Info)); + group.setLocation(newLocation); + } + }); + } + }); + } + formItems.add(locationItem); + + StaticTextItem dynamicItem = new StaticTextItem("dynamic", "Dynamic?"); + dynamicItem.setValue(dynamic ? "yes" : "no"); formItems.add(dynamicItem); - itemIds.add(dynamicItem.getName());
- StaticTextItem recursiveItem = new StaticTextItem("recursiveItem", "Recursive?"); + StaticTextItem recursiveItem = new StaticTextItem("recursive", "Recursive?"); recursiveItem.setValue((group.isRecursive()) ? "yes" : "no"); formItems.add(recursiveItem); - itemIds.add(recursiveItem.getName());
- StaticTextItem createdItem = new StaticTextItem("createdItem", "Created"); + StaticTextItem createdItem = new StaticTextItem("created", "Created"); createdItem.setValue(new Date(group.getCtime())); formItems.add(createdItem); - itemIds.add(createdItem.getName());
- StaticTextItem lastModifiedItem = new StaticTextItem("lastModifiedItem", "Last Modified"); + StaticTextItem lastModifiedItem = new StaticTextItem("lastModified", "Last Modified"); lastModifiedItem.setValue(new Date(group.getMtime())); formItems.add(lastModifiedItem); - itemIds.add(lastModifiedItem.getName());
- StaticTextItem lastModifiedByItem = new StaticTextItem("lastModifiedByItem", "Last Modified By"); + StaticTextItem lastModifiedByItem = new StaticTextItem("lastModifiedBy", "Last Modified By"); lastModifiedByItem.setValue(group.getModifiedBy()); formItems.add(lastModifiedByItem); - itemIds.add(lastModifiedByItem.getName()); - - StaticTextItem groupDefinitionItem = new StaticTextItem("groupDefinitionItem", "Group Definition"); - GroupDefinition groupDefinition = group.getGroupDefinition(); - // TODO (ips): Make this a link to the group def. - groupDefinitionItem.setValue((groupDefinition != null) ? groupDefinition.getName() : "<i>none</i>"); - formItems.add(groupDefinitionItem); - itemIds.add(groupDefinitionItem.getName()); + + if (dynamic) { + StaticTextItem groupDefinitionItem = new StaticTextItem("groupDefinition", "Group Definition"); + GroupDefinition groupDefinition = group.getGroupDefinition(); + // TODO (ips): Make this a link to the group def. + groupDefinitionItem.setValue(groupDefinition.getName()); + formItems.add(groupDefinitionItem); + }
generalPropsForm.setItems(formItems.toArray(new FormItem[formItems.size()])); addMember(generalPropsForm);
- if (groupDefinition != null) { + if (dynamic) { spacer = new HLayout(); spacer.setHeight(10); addMember(spacer); diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/InventoryView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/InventoryView.java index 2e2617e..70c5445 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/InventoryView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/InventoryView.java @@ -34,8 +34,8 @@ import com.smartgwt.client.widgets.tree.TreeGrid; import com.smartgwt.client.widgets.tree.TreeNode;
import org.rhq.core.domain.measurement.AvailabilityType; -import org.rhq.core.domain.resource.Resource; import org.rhq.core.domain.resource.ResourceCategory; +import org.rhq.core.domain.resource.composite.ResourceComposite; import org.rhq.enterprise.gui.coregui.client.BookmarkableView; import org.rhq.enterprise.gui.coregui.client.CoreGUI; import org.rhq.enterprise.gui.coregui.client.ViewId; @@ -50,7 +50,6 @@ public class InventoryView extends HLayout implements BookmarkableView {
public static final String VIEW_PATH = "Inventory";
- private ViewId currentSectionViewId; private ViewId currentPageViewId;
@@ -58,9 +57,9 @@ public class InventoryView extends HLayout implements BookmarkableView { private Canvas currentContent; private LinkedHashMap<String, TreeGrid> treeGrids = new LinkedHashMap<String, TreeGrid>();
- private SectionStack sectionStack;
+ @Override protected void onInit() { super.onInit(); @@ -110,9 +109,9 @@ public class InventoryView extends HLayout implements BookmarkableView { private ResourceSearchView buildResourceSearchView() { ResourceSearchView searchView = new ResourceSearchView(); searchView.addResourceSelectedListener(new ResourceSelectListener() { - public void onResourceSelected(Resource resource) { + public void onResourceSelected(ResourceComposite resourceComposite) { //CoreGUI.setContent(new ResourceView(resource)); - CoreGUI.goTo("Resource/" + resource.getId()); + CoreGUI.goTo("Resource/" + resourceComposite.getResource().getId()); } }); return searchView; diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceSelectListener.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceSelectListener.java index e64f27b..21806ab 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceSelectListener.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceSelectListener.java @@ -18,12 +18,19 @@ */ package org.rhq.enterprise.gui.coregui.client.inventory.resource;
-import org.rhq.core.domain.resource.Resource; +import org.rhq.core.domain.resource.composite.ResourceComposite;
/** * @author Greg Hinkle */ public interface ResourceSelectListener {
- void onResourceSelected(Resource resource); + /** + * An event handler that is called then the user selects a Resource. + * + * @param resourceComposite a Resource composite for the Resource that was just selected by the user; the Resource + * wrapped by the composite's ResourceType will be mostly fetched. + */ + void onResourceSelected(ResourceComposite resourceComposite); + } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java index 92d74eb..68d92d5 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java @@ -18,19 +18,13 @@ */ package org.rhq.enterprise.gui.coregui.client.inventory.resource.detail;
-import java.util.EnumSet; -import java.util.Set; - import com.google.gwt.user.client.History; -import com.google.gwt.user.client.rpc.AsyncCallback; import com.smartgwt.client.types.Side; import com.smartgwt.client.widgets.layout.VLayout;
-import org.rhq.core.domain.authz.Permission; -import org.rhq.core.domain.measurement.DataType; -import org.rhq.core.domain.measurement.MeasurementDefinition; import org.rhq.core.domain.resource.Resource; -import org.rhq.core.domain.resource.ResourceType; +import org.rhq.core.domain.resource.composite.ResourceComposite; +import org.rhq.core.domain.resource.composite.ResourceFacets; import org.rhq.core.domain.resource.composite.ResourcePermission; import org.rhq.enterprise.gui.coregui.client.BookmarkableView; import org.rhq.enterprise.gui.coregui.client.CoreGUI; @@ -40,7 +34,6 @@ import org.rhq.enterprise.gui.coregui.client.components.tab.TwoLevelTab; import org.rhq.enterprise.gui.coregui.client.components.tab.TwoLevelTabSelectedEvent; import org.rhq.enterprise.gui.coregui.client.components.tab.TwoLevelTabSelectedHandler; import org.rhq.enterprise.gui.coregui.client.components.tab.TwoLevelTabSet; -import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup; import org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceSearchView; import org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceSelectListener; import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.configuration.ConfigurationHistoryView; @@ -48,10 +41,9 @@ import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.configura import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.inventory.PluginConfigurationEditView; import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.monitoring.GraphListView; import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.overview.ResourceOverviewView; -import org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTypeRepository;
/** - * Right panel of the resource view. + * Right panel of the Resource view. * * @author Greg Hinkle */ @@ -60,9 +52,7 @@ public class ResourceDetailView extends VLayout implements BookmarkableView, Res
private static final String DEFAULT_TAB_NAME = "Summary";
- private Resource resource; - private ResourcePermission permissions; - private ResourceType type; + private ResourceComposite resourceComposite;
private TwoLevelTab summaryTab; private TwoLevelTab monitoringTab; @@ -77,9 +67,6 @@ public class ResourceDetailView extends VLayout implements BookmarkableView, Res
private ResourceTitleBar titleBar;
- public void setResource(Resource resource) { - this.resource = resource; - }
@Override protected void onDraw() { @@ -134,13 +121,14 @@ public class ResourceDetailView extends VLayout implements BookmarkableView, Res // CoreGUI.addBreadCrumb(getPlace()); }
- public void onResourceSelected(Resource resource) { + public void onResourceSelected(ResourceComposite resourceComposite) {
- this.resource = resource; + this.resourceComposite = resourceComposite;
- titleBar.setResource(resource); + final Resource resource = this.resourceComposite.getResource(); + this.titleBar.setResource(resource);
- summaryTab.updateSubTab("Overview", new ResourceOverviewView(resource)); + summaryTab.updateSubTab("Overview", new ResourceOverviewView(this.resourceComposite)); summaryTab.updateSubTab("Timeline", new FullHTMLPane("/rhq/resource/summary/timeline-plain.xhtml?id=" + resource.getId()));
@@ -204,80 +192,56 @@ public class ResourceDetailView extends VLayout implements BookmarkableView, Res
// topTabSet.setSelectedTab(selectedTab);
- updateTabStatus(); + completeTabUpdate();
}
- private void updateTabStatus() { - // Go and get the type with all needed metadata - // and then get the permissions for this resource - - ResourceTypeRepository.Cache.getInstance().getResourceTypes( - resource.getResourceType().getId(), - EnumSet.of(ResourceTypeRepository.MetadataType.content, ResourceTypeRepository.MetadataType.operations, - ResourceTypeRepository.MetadataType.events, - ResourceTypeRepository.MetadataType.resourceConfigurationDefinition, - ResourceTypeRepository.MetadataType.measurements), new ResourceTypeRepository.TypeLoadedCallback() { - public void onTypesLoaded(ResourceType type) { - - ResourceDetailView.this.type = type; - - GWTServiceLookup.getAuthorizationService().getImplicitResourcePermissions( - ResourceDetailView.this.resource.getId(), new AsyncCallback<Set<Permission>>() { - public void onFailure(Throwable caught) { - CoreGUI.getErrorHandler().handleError("Failed to load resource permissions", caught); - } - - public void onSuccess(Set<Permission> result) { - ResourceDetailView.this.permissions = new ResourcePermission(result); - completeTabUpdate(); - } - }); - } - }); - }
private void completeTabUpdate() {
- if (!permissions.isMeasure()) { - topTabSet.disableTab(monitoringTab); - } else { + ResourcePermission permissions = this.resourceComposite.getResourcePermission(); + ResourceFacets facets = this.resourceComposite.getResourceFacets(); + + // TODO (ips): No perms should be needed to view Monitoring and Alerts tabs. + + if (permissions.isMeasure()) { topTabSet.enableTab(monitoringTab); + } else { + topTabSet.disableTab(monitoringTab); }
- if (type.getOperationDefinitions() == null || type.getOperationDefinitions().isEmpty() - || !permissions.isControl()) { - topTabSet.disableTab(operationsTab); - } else { + if (facets.isOperation() && permissions.isControl()) { topTabSet.enableTab(operationsTab); + } else { + topTabSet.disableTab(operationsTab); }
- if (!permissions.isAlert()) { - topTabSet.disableTab(alertsTab); - } else { + if (permissions.isAlert()) { topTabSet.enableTab(alertsTab); + } else { + topTabSet.disableTab(alertsTab); }
- if (type.getResourceConfigurationDefinition() == null || !permissions.isConfigureRead()) { - topTabSet.disableTab(configurationTab); - } else { + if (!facets.isConfiguration() && permissions.isConfigureRead()) { topTabSet.enableTab(configurationTab); + } else { + topTabSet.disableTab(configurationTab); }
- if (type.getEventDefinitions() == null || type.getEventDefinitions().isEmpty() || !permissions.isMeasure()) { + if (facets.isEvent() && permissions.isMeasure()) { topTabSet.enableTab(eventsTab); } else { - topTabSet.enableTab(eventsTab); + topTabSet.disableTab(eventsTab); }
- if (type.getPackageTypes() == null || type.getPackageTypes().isEmpty() || !permissions.isContent()) { - topTabSet.disableTab(contentTab); - } else { + if (facets.isContent() && permissions.isContent()) { topTabSet.enableTab(contentTab); + } else { + topTabSet.disableTab(contentTab); }
// only enable "Call Time" sub-tab for those that implement it - monitoringTab.setSubTabEnabled("Call Time", implementsCallTime(type)); + monitoringTab.setSubTabEnabled("Call Time", facets.isCallTime());
if (topTabSet.getSelectedTab().getDisabled()) { topTabSet.selectTab(0); @@ -286,25 +250,22 @@ public class ResourceDetailView extends VLayout implements BookmarkableView, Res topTabSet.markForRedraw(); }
- private boolean implementsCallTime(ResourceType type) { - for (MeasurementDefinition definition : type.getMetricDefinitions()) { - if (definition.getDataType() == DataType.CALLTIME) { - return true; - } - } - return false; - }
public void onTabSelected(TwoLevelTabSelectedEvent tabSelectedEvent) { - // Switch tabs directly, rather than letting the history framework do it, to avoid redrawing the outer views. - selectTab(tabSelectedEvent.getId(), tabSelectedEvent.getSubTabId()); - String tabPath = "/" + tabSelectedEvent.getId() + "/" + tabSelectedEvent.getSubTabId(); - String path = "Resource/" + this.resource.getId() + tabPath; + if (this.resourceComposite == null) { + History.fireCurrentHistoryState(); + } else { + // Switch tabs directly, rather than letting the history framework do it, to avoid redrawing the outer views. + selectTab(tabSelectedEvent.getId(), tabSelectedEvent.getSubTabId()); + String tabPath = "/" + tabSelectedEvent.getId() + "/" + tabSelectedEvent.getSubTabId(); + String path = "Resource/" + this.resourceComposite.getResource().getId() + tabPath;
- // But still add an item to the history, specifying false to tell it not to fire an event. - History.newItem(path, false); + // But still add an item to the history, specifying false to tell it not to fire an event. + History.newItem(path, false); + } }
+ public void renderView(ViewPath viewPath) { // e.g. #Resource/10010/Inventory/Overview String tabName = (!viewPath.isEnd()) ? viewPath.getCurrent().getPath() : null; // e.g. "Inventory" @@ -312,6 +273,7 @@ public class ResourceDetailView extends VLayout implements BookmarkableView, Res selectTab(tabName, subTabName); }
+ public void selectTab(String tabName, String subtabName) { if (tabName == null) { tabName = DEFAULT_TAB_NAME; diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceView.java index f7b5c6e..39e748f 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceView.java @@ -24,6 +24,8 @@ import com.smartgwt.client.widgets.layout.HLayout;
import org.rhq.core.domain.criteria.ResourceCriteria; import org.rhq.core.domain.resource.Resource; +import org.rhq.core.domain.resource.ResourceType; +import org.rhq.core.domain.resource.composite.ResourceComposite; import org.rhq.core.domain.util.PageList; import org.rhq.enterprise.gui.coregui.client.BookmarkableView; import org.rhq.enterprise.gui.coregui.client.CoreGUI; @@ -32,8 +34,11 @@ import org.rhq.enterprise.gui.coregui.client.ViewPath; import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup; import org.rhq.enterprise.gui.coregui.client.gwt.ResourceGWTServiceAsync; import org.rhq.enterprise.gui.coregui.client.inventory.resource.InventoryView; +import org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTypeRepository; import org.rhq.enterprise.gui.coregui.client.util.message.Message;
+import java.util.EnumSet; + /** * @author Greg Hinkle */ @@ -41,7 +46,7 @@ public class ResourceView extends HLayout implements BookmarkableView {
private Canvas contentCanvas;
- private Resource currentResource; + private ResourceComposite currentResource; //private Resource resourcePlatform;
private ResourceTreeView treeView; @@ -61,60 +66,70 @@ public class ResourceView extends HLayout implements BookmarkableView { setWidth100(); setHeight100();
- treeView = new ResourceTreeView(); addMember(treeView);
contentCanvas = new Canvas(); addMember(contentCanvas);
- // created above // detailView = new ResourceDetailView();
treeView.addResourceSelectListener(detailView);
- setContent(detailView); - }
+ public void setSelectedResource(final int resourceId, final ViewPath view) { - Resource resource = this.treeView.getResource(resourceId); - if (resource != null) { - setSelectedResource(resource, view); - } else { - ResourceCriteria criteria = new ResourceCriteria(); - criteria.addFilterId(resourceId); - criteria.fetchTags(true); - //criteria.fetchParentResource(true); - resourceService.findResourcesByCriteria(criteria, new AsyncCallback<PageList<Resource>>() { - public void onFailure(Throwable caught) { - CoreGUI.getMessageCenter().notify(new Message("Resource with id [" + resourceId + - "] does not exist or is not accessible.", Message.Severity.Warning)); - - CoreGUI.goTo(InventoryView.VIEW_PATH); + ResourceCriteria criteria = new ResourceCriteria(); + criteria.addFilterId(resourceId); + criteria.fetchTags(true); + //criteria.fetchParentResource(true); + resourceService.findResourceCompositesByCriteria(criteria, new AsyncCallback<PageList<ResourceComposite>>() { + public void onFailure(Throwable caught) { + CoreGUI.getMessageCenter().notify(new Message("Resource with id [" + resourceId + + "] does not exist or is not accessible.", Message.Severity.Warning)); + + CoreGUI.goTo(InventoryView.VIEW_PATH); + } + + public void onSuccess(PageList<ResourceComposite> result) { + if (result.isEmpty()) { + //noinspection ThrowableInstanceNeverThrown + onFailure(new Exception("Resource with id [" + resourceId + "] does not exist.")); + } else { + final ResourceComposite resourceComposite = result.get(0); + loadResourceType(resourceComposite, view); } + } + }); + } +
- public void onSuccess(PageList<Resource> result) { - if (result.isEmpty()) { - //noinspection ThrowableInstanceNeverThrown - onFailure(new Exception("Resource with id [" + resourceId + "] does not exist.")); - } else { - Resource resource = result.get(0); - setSelectedResource(resource, view); - } + private void loadResourceType(final ResourceComposite resourceComposite, final ViewPath view) { + final Resource resource = resourceComposite.getResource(); + ResourceTypeRepository.Cache.getInstance().getResourceTypes( + resource.getResourceType().getId(), + EnumSet.of(ResourceTypeRepository.MetadataType.content, ResourceTypeRepository.MetadataType.operations, + ResourceTypeRepository.MetadataType.events, + ResourceTypeRepository.MetadataType.resourceConfigurationDefinition), + new ResourceTypeRepository.TypeLoadedCallback() { + public void onTypesLoaded(ResourceType type) { + resource.setResourceType(type); + completeSetSelectedResource(resourceComposite, view); } }); - } }
- private void setSelectedResource(Resource resource, ViewPath viewPath) { - this.currentResource = resource; - this.treeView.setSelectedResource(resource, viewPath.getCurrent()); - this.detailView.onResourceSelected(resource); + + private void completeSetSelectedResource(ResourceComposite resourceComposite, ViewPath viewPath) { + this.currentResource = resourceComposite; + this.treeView.setSelectedResource(resourceComposite.getResource(), viewPath.getCurrent()); + this.detailView.onResourceSelected(resourceComposite); }
+ public void setContent(Canvas newContent) { if (contentCanvas.getChildren().length > 0) contentCanvas.getChildren()[0].destroy(); @@ -132,7 +147,7 @@ public class ResourceView extends HLayout implements BookmarkableView {
Integer resourceId = Integer.parseInt(viewPath.getCurrent().getPath());
- if (currentResource == null || currentResource.getId() != resourceId) { + if (currentResource == null || currentResource.getResource().getId() != resourceId) { // The previous history item did not already point to this Resource. setSelectedResource(resourceId, viewPath); } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/alert/ResourceAlertHistoryView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/alert/ResourceAlertHistoryView.java index cfa77c0..32c0f44 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/alert/ResourceAlertHistoryView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/alert/ResourceAlertHistoryView.java @@ -25,6 +25,8 @@ package org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.alert; import com.smartgwt.client.data.Criteria; import org.rhq.core.domain.criteria.AlertCriteria; import org.rhq.core.domain.resource.Resource; +import org.rhq.core.domain.resource.composite.ResourceComposite; +import org.rhq.core.domain.resource.composite.ResourcePermission; import org.rhq.enterprise.gui.coregui.client.alert.AlertsView; import org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceSelectListener;
@@ -39,8 +41,8 @@ public class ResourceAlertHistoryView extends AlertsView super(createCriteria(resourceId), EXCLUDED_FIELD_NAMES); }
- public void onResourceSelected(Resource resource) { - refresh(createCriteria(resource.getId())); + public void onResourceSelected(ResourceComposite resourceComposite) { + refresh(createCriteria(resourceComposite.getResource().getId())); }
private static Criteria createCriteria(int resourceId) { diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/GraphListView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/GraphListView.java index d77e08b..770c43b 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/GraphListView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/GraphListView.java @@ -24,6 +24,7 @@ import org.rhq.core.domain.measurement.MeasurementDefinition; import org.rhq.core.domain.measurement.composite.MeasurementDataNumericHighLowComposite; import org.rhq.core.domain.resource.Resource; import org.rhq.core.domain.resource.ResourceType; +import org.rhq.core.domain.resource.composite.ResourceComposite; import org.rhq.enterprise.gui.coregui.client.CoreGUI; import org.rhq.enterprise.gui.coregui.client.components.measurement.MeasurementRangeEditor; import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup; @@ -32,7 +33,6 @@ import org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTyp
import com.google.gwt.user.client.rpc.AsyncCallback; import com.smartgwt.client.types.Overflow; -import com.smartgwt.client.util.SC; import com.smartgwt.client.widgets.Canvas; import com.smartgwt.client.widgets.Label; import com.smartgwt.client.widgets.layout.VLayout; @@ -48,12 +48,9 @@ import java.util.List; */ public class GraphListView extends VLayout implements ResourceSelectListener {
- private Resource resource; private Label loadingLabel = new Label("Loading...");
- public GraphListView() { - }
public GraphListView(Resource resource) { this.resource = resource; @@ -83,7 +80,6 @@ public class GraphListView extends VLayout implements ResourceSelectListener {
private void buildGraphs() {
- ResourceTypeRepository.Cache.getInstance().getResourceTypes( resource.getResourceType().getId(), EnumSet.of(ResourceTypeRepository.MetadataType.measurements), new ResourceTypeRepository.TypeLoadedCallback() { @@ -139,18 +135,18 @@ public class GraphListView extends VLayout implements ResourceSelectListener { ); }
+ private void buildGraph(MeasurementDefinition def, List<MeasurementDataNumericHighLowComposite> data) { SmallGraphView graph = new SmallGraphView(resource.getId(), def, data); graph.setWidth("95%"); graph.setHeight(220);
addMember(graph); - }
- public void onResourceSelected(Resource resource) { - this.resource = resource;
+ public void onResourceSelected(ResourceComposite resourceComposite) { + this.resource = resourceComposite.getResource();
buildGraphs(); markForRedraw(); diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/overview/ResourceOverviewView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/overview/ResourceOverviewView.java index bb01526..92cd3ff 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/overview/ResourceOverviewView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/overview/ResourceOverviewView.java @@ -20,36 +20,42 @@ package org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.overview
import com.smartgwt.client.widgets.layout.VLayout;
-import org.rhq.core.domain.resource.Resource; +import org.rhq.core.domain.resource.composite.ResourceComposite; import org.rhq.enterprise.gui.coregui.client.components.FullHTMLPane; -import org.rhq.enterprise.gui.coregui.client.components.SimpleCollapsiblePanel; +import org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceSelectListener;
/** * @author Greg Hinkle */ -public class ResourceOverviewView extends VLayout { +public class ResourceOverviewView extends VLayout implements ResourceSelectListener { + private ResourceSummaryView summaryView; + private FullHTMLPane summaryPane; + private ResourceComposite resourceComposite;
- private Resource resource; - - - public ResourceOverviewView(Resource resource) { - this.resource = resource; + public ResourceOverviewView(ResourceComposite resourceComposite) { + this.resourceComposite = resourceComposite; }
- @Override protected void onDraw() { super.onDraw();
- ResourceSummaryView summaryView = new ResourceSummaryView(); - summaryView.onResourceSelected(resource); - - addMember(summaryView); + this.summaryView = new ResourceSummaryView(); + addMember(this.summaryView);
+ this.summaryPane = new FullHTMLPane(); + addMember(this.summaryPane);
- FullHTMLPane summaryPane = new FullHTMLPane("/rhq/resource/summary/overview-plain.xhtml?id=" + resource.getId()); - addMember(summaryPane); - + if (this.resourceComposite != null) { + onResourceSelected(this.resourceComposite); + } + }
+ @Override + public void onResourceSelected(ResourceComposite resourceComposite) { + this.resourceComposite = resourceComposite; + this.summaryView.onResourceSelected(resourceComposite); + this.summaryPane.setContentsURL("/rhq/resource/summary/overview-plain.xhtml?id=" + + resourceComposite.getResource().getId()); } } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/overview/ResourceSummaryView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/overview/ResourceSummaryView.java index 6f1228c..0015742 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/overview/ResourceSummaryView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/overview/ResourceSummaryView.java @@ -26,7 +26,6 @@ import java.util.List;
import com.google.gwt.user.client.rpc.AsyncCallback; import com.smartgwt.client.util.SC; -import com.smartgwt.client.widgets.form.DynamicForm; import com.smartgwt.client.widgets.form.fields.FormItem; import com.smartgwt.client.widgets.form.fields.HeaderItem; import com.smartgwt.client.widgets.form.fields.SpacerItem; @@ -38,59 +37,64 @@ import org.rhq.core.domain.measurement.MeasurementDataTrait; import org.rhq.core.domain.measurement.MeasurementDefinition; import org.rhq.core.domain.resource.Resource; import org.rhq.core.domain.resource.ResourceType; +import org.rhq.core.domain.resource.composite.ResourceComposite; import org.rhq.enterprise.gui.coregui.client.CoreGUI; +import org.rhq.enterprise.gui.coregui.client.components.form.EnhancedDynamicForm; +import org.rhq.enterprise.gui.coregui.client.components.form.TogglableTextItem; +import org.rhq.enterprise.gui.coregui.client.components.form.ValueUpdatedHandler; import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup; +import org.rhq.enterprise.gui.coregui.client.gwt.ResourceGWTServiceAsync; import org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceSelectListener; import org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTypeRepository; +import org.rhq.enterprise.gui.coregui.client.util.message.Message;
/** * @author Greg Hinkle */ -public class ResourceSummaryView extends DynamicForm implements ResourceSelectListener { +public class ResourceSummaryView extends EnhancedDynamicForm implements ResourceSelectListener {
- private Resource resource; + private ResourceGWTServiceAsync resourceService = GWTServiceLookup.getResourceService(); + private ResourceComposite resourceComposite;
@Override protected void onDraw() { super.onDraw();
- setNumCols(4); - setWrapItemTitles(false); setLeft("10%"); setWidth("80%"); }
- public void onResourceSelected(Resource resource) { + public void onResourceSelected(ResourceComposite resourceComposite) {
- this.resource = resource; + this.resourceComposite = resourceComposite; + Resource resource = resourceComposite.getResource();
+ // Load metric defs. ResourceTypeRepository.Cache.getInstance().getResourceTypes(resource.getResourceType().getId(), EnumSet.of(ResourceTypeRepository.MetadataType.measurements), new ResourceTypeRepository.TypeLoadedCallback() { public void onTypesLoaded(ResourceType type) { try { buildForm(type); - loadValues(); + loadTraitValues(); } catch (Exception e) { SC.say("Form load failure"); e.printStackTrace(); } } }); - - - markForRedraw(); }
- private void loadValues() { + private void loadTraitValues() { + final Resource resource = resourceComposite.getResource(); GWTServiceLookup.getMeasurementDataService().findCurrentTraitsForResource( resource.getId(), DisplayType.SUMMARY, new AsyncCallback<List<MeasurementDataTrait>>() { public void onFailure(Throwable caught) { - SC.say("Failed to load traits"); - CoreGUI.getErrorHandler().handleError("Failed to load traits information for resource",caught); + CoreGUI.getErrorHandler().handleError("Failed to load traits for " + resource + ".", + caught); }
public void onSuccess(List<MeasurementDataTrait> result) { @@ -111,7 +115,7 @@ public class ResourceSummaryView extends DynamicForm implements ResourceSelectLi }
private void buildForm(ResourceType type) { - ArrayList<MeasurementDefinition> traits = new ArrayList<MeasurementDefinition>(); + List<MeasurementDefinition> traits = new ArrayList<MeasurementDefinition>();
for (MeasurementDefinition measurement : type.getMetricDefinitions()) { if (measurement.getDataType() == DataType.TRAIT && measurement.getDisplayType() == DisplayType.SUMMARY) { @@ -125,39 +129,122 @@ public class ResourceSummaryView extends DynamicForm implements ResourceSelectLi } });
- - ArrayList<FormItem> formItems = new ArrayList<FormItem>(); - ArrayList<String> itemIds = new ArrayList<String>(); + List<FormItem> formItems = new ArrayList<FormItem>();
HeaderItem headerItem = new HeaderItem("header", "Summary"); headerItem.setValue("Summary"); formItems.add(headerItem);
- StaticTextItem typeItem = new StaticTextItem("typeItem", "Type"); + StaticTextItem typeItem = new StaticTextItem("type", "Type"); typeItem.setTooltip("Plugin: " + type.getPlugin() + "\n<br>" + "Type: " + type.getName()); typeItem.setValue(type.getName() + " (" + type.getPlugin() + ")"); formItems.add(typeItem); - itemIds.add(typeItem.getName());
- StaticTextItem descriptionItem = new StaticTextItem("descriptionItem", "Description"); + final Resource resource = this.resourceComposite.getResource(); + boolean modifiable = this.resourceComposite.getResourcePermission().isInventory(); + + final FormItem nameItem = (modifiable) ? new TogglableTextItem() : new StaticTextItem(); + nameItem.setName("name"); + nameItem.setTitle("Name"); + nameItem.setValue(resource.getName()); + if (nameItem instanceof TogglableTextItem) { + TogglableTextItem togglableNameItem = (TogglableTextItem) nameItem; + togglableNameItem.addValueUpdatedHandler(new ValueUpdatedHandler() { + public void onValueUpdated(final String newName) { + final String oldName = resource.getName(); + ResourceSummaryView.this.resourceService.updateResourceName(resource.getId(), + newName, new AsyncCallback<Void>() { + public void onFailure(Throwable caught) { + CoreGUI.getErrorHandler().handleError("Failed to change name of Resource with id " + + resource.getId() + + " from "" + oldName + "" to "" + newName + "".", caught); + // We failed to update it on the Server, so change back the form item to the original value. + nameItem.setValue(oldName); + } + + public void onSuccess(Void result) { + CoreGUI.getMessageCenter().notify(new Message("Name of Resource with id " + + resource.getId() + " was changed from "" + + oldName + "" to "" + newName + "".", Message.Severity.Info)); + resource.setName(newName); + } + }); + } + }); + } + formItems.add(nameItem); + + final FormItem descriptionItem = (modifiable) ? new TogglableTextItem() : new StaticTextItem(); + descriptionItem.setName("description"); + descriptionItem.setTitle("Description"); descriptionItem.setValue(resource.getDescription()); + if (descriptionItem instanceof TogglableTextItem) { + TogglableTextItem togglableDescriptionItem = (TogglableTextItem) descriptionItem; + togglableDescriptionItem.addValueUpdatedHandler(new ValueUpdatedHandler() { + public void onValueUpdated(final String newDescription) { + final String oldDescription = resource.getDescription(); + ResourceSummaryView.this.resourceService.updateResourceDescription(resource.getId(), + newDescription, new AsyncCallback<Void>() { + public void onFailure(Throwable caught) { + CoreGUI.getErrorHandler().handleError("Failed to change description of Resource with id " + + resource.getId() + + " from "" + oldDescription + "" to "" + newDescription + "".", caught); + // We failed to update it on the Server, so change back the form item to the original value. + descriptionItem.setValue(oldDescription); + } + + public void onSuccess(Void result) { + CoreGUI.getMessageCenter().notify(new Message("Description of Resource with id " + + resource.getId() + " was changed from "" + + oldDescription + "" to "" + newDescription + "".", Message.Severity.Info)); + resource.setDescription(newDescription); + } + }); + } + }); + } formItems.add(descriptionItem); - itemIds.add(descriptionItem.getName());
- StaticTextItem versionItem = new StaticTextItem("versionItem", "Version"); - formItems.add(versionItem); - itemIds.add(versionItem.getName()); + final FormItem locationItem = (modifiable) ? new TogglableTextItem() : new StaticTextItem(); + locationItem.setName("location"); + locationItem.setTitle("Location"); + locationItem.setValue(resource.getLocation()); + if (locationItem instanceof TogglableTextItem) { + TogglableTextItem togglableNameItem = (TogglableTextItem) locationItem; + togglableNameItem.addValueUpdatedHandler(new ValueUpdatedHandler() { + public void onValueUpdated(final String newLocation) { + final String oldLocation = resource.getLocation(); + ResourceSummaryView.this.resourceService.updateResourceLocation(resource.getId(), + newLocation, new AsyncCallback<Void>() { + public void onFailure(Throwable caught) { + CoreGUI.getErrorHandler().handleError("Failed to change location of Resource with id " + + resource.getId() + + " from "" + oldLocation + "" to "" + newLocation + "".", caught); + // We failed to update it on the Server, so change back the form item to the original value. + locationItem.setValue(oldLocation); + }
+ public void onSuccess(Void result) { + CoreGUI.getMessageCenter().notify(new Message("Location of Resource with id " + + resource.getId() + " was changed from "" + + oldLocation + "" to "" + newLocation + "".", Message.Severity.Info)); + resource.setLocation(newLocation); + } + }); + } + }); + } + formItems.add(locationItem);
- StaticTextItem parentItem = new StaticTextItem("parentItem", "Parent"); - formItems.add(parentItem); - itemIds.add(parentItem.getName());
+ StaticTextItem versionItem = new StaticTextItem("version", "Version"); + formItems.add(versionItem);
- for (MeasurementDefinition trait : traits) { + StaticTextItem parentItem = new StaticTextItem("parent", "Parent"); + formItems.add(parentItem);
+ for (MeasurementDefinition trait : traits) { String id = trait.getDisplayName().replaceAll("\.", "_").replaceAll(" ", "__"); - itemIds.add(id);
StaticTextItem item = new StaticTextItem(id, trait.getDisplayName()); item.setTooltip(trait.getDescription()); @@ -176,14 +263,14 @@ public class ResourceSummaryView extends DynamicForm implements ResourceSelectLi formItems.add(new SpacerItem()); setItems(formItems.toArray(new FormItem[formItems.size()]));
- - setValue("typeItem", type.getName() + " (" + type.getPlugin() + ")"); - setValue("descriptionItem", resource.getDescription()); - setValue("versionItem", resource.getVersion()); - setValue("parentItem", resource.getParentResource() == null ? null : + setValue("type", type.getName() + " (" + type.getPlugin() + ")"); + setValue("name", resource.getName()); + setValue("description", resource.getDescription()); + setValue("location", resource.getLocation()); + setValue("version", resource.getVersion()); + setValue("parent", resource.getParentResource() == null ? null : ("<a href="#Resource/" + resource.getParentResource().getId() + "">" + resource.getParentResource().getName() + "</a>"));
- } } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ResourceGWTServiceImpl.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ResourceGWTServiceImpl.java index 7cd7fdd..56d91bd 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ResourceGWTServiceImpl.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ResourceGWTServiceImpl.java @@ -18,6 +18,7 @@ */ package org.rhq.enterprise.gui.coregui.server.gwt;
+import java.util.ArrayList; import java.util.Arrays; import java.util.EnumSet; import java.util.HashSet; @@ -35,6 +36,7 @@ import org.rhq.core.domain.criteria.ResourceCriteria; import org.rhq.core.domain.resource.InventoryStatus; import org.rhq.core.domain.resource.Resource; import org.rhq.core.domain.resource.composite.RecentlyAddedResourceComposite; +import org.rhq.core.domain.resource.composite.ResourceComposite; import org.rhq.core.domain.util.PageControl; import org.rhq.core.domain.util.PageList; import org.rhq.enterprise.gui.coregui.client.gwt.ResourceGWTService; @@ -109,15 +111,27 @@ public class ResourceGWTServiceImpl extends AbstractGWTServiceImpl implements Re public PageList<Resource> findResourcesByCriteria(ResourceCriteria criteria) { try { PageList<Resource> result = resourceManager.findResourcesByCriteria(getSessionSubject(), criteria); - for (Resource resource : result) { - resource.setAgent(null); - }
ObjectFilter.filterFieldsInCollection(result, importantFieldsSet);
- return SerialUtility.prepare(result, "ResourceService.findResourceByCriteria"); + return SerialUtility.prepare(result, "ResourceService.findResourcesByCriteria"); } catch (Exception e) { - e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates. + e.printStackTrace(); + throw new RuntimeException(e); + } + } + + public PageList<ResourceComposite> findResourceCompositesByCriteria(ResourceCriteria criteria) { + try { + PageList<ResourceComposite> result = resourceManager.findResourceCompositesByCriteria(getSessionSubject(), + criteria); + List<Resource> resources = new ArrayList<Resource>(result.size()); + + ObjectFilter.filterFieldsInCollection(resources, importantFieldsSet); + + return SerialUtility.prepare(result, "ResourceService.findResourceCompositesByCriteria"); + } catch (Exception e) { + e.printStackTrace(); throw new RuntimeException(e); } } @@ -199,4 +213,15 @@ public class ResourceGWTServiceImpl extends AbstractGWTServiceImpl implements Re discoveryBoss.unignoreResources(getSessionSubject(), resourceIds); }
+ public void updateResourceName(int resourceId, String name) { + resourceManager.updateResourceName(getSessionSubject(), resourceId, name); + } + + public void updateResourceDescription(int resourceId, String description) { + resourceManager.updateResourceDescription(getSessionSubject(), resourceId, description); + } + + public void updateResourceLocation(int resourceId, String location) { + resourceManager.updateResourceLocation(getSessionSubject(), resourceId, location); + } } \ No newline at end of file diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ResourceGroupGWTServiceImpl.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ResourceGroupGWTServiceImpl.java index 67326c1..d4dd777 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ResourceGroupGWTServiceImpl.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ResourceGroupGWTServiceImpl.java @@ -74,4 +74,16 @@ public class ResourceGroupGWTServiceImpl extends AbstractGWTServiceImpl implemen throw new RuntimeException(e.getMessage()); } } + + public void updateResourceGroupName(int groupId, String name) { + groupManager.updateResourceGroupName(getSessionSubject(), groupId, name); + } + + public void updateResourceGroupDescription(int groupId, String description) { + groupManager.updateResourceGroupDescription(getSessionSubject(), groupId, description); + } + + public void updateResourceGroupLocation(int groupId, String location) { + groupManager.updateResourceGroupLocation(getSessionSubject(), groupId, location); + } } \ No newline at end of file diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerBean.java index 3dfc87f..4804a73 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerBean.java @@ -1,6 +1,6 @@ /* * RHQ Management Platform - * Copyright (C) 2005-2008 Red Hat, Inc. + * Copyright (C) 2005-2010 Red Hat, Inc. * All rights reserved. * * This program is free software; you can redistribute it and/or modify @@ -27,6 +27,7 @@ import java.util.LinkedList; import java.util.List; import java.util.ListIterator; import java.util.Map; +import java.util.Set;
import javax.ejb.EJB; import javax.ejb.Stateless; @@ -93,6 +94,7 @@ import org.rhq.core.domain.resource.composite.ResourceHealthComposite; import org.rhq.core.domain.resource.composite.ResourceIdFlyWeight; import org.rhq.core.domain.resource.composite.ResourceInstallCount; import org.rhq.core.domain.resource.composite.ResourceNamesDisambiguationResult; +import org.rhq.core.domain.resource.composite.ResourcePermission; import org.rhq.core.domain.resource.composite.ResourceWithAvailability; import org.rhq.core.domain.resource.flyweight.FlyweightCache; import org.rhq.core.domain.resource.flyweight.ResourceFlyweight; @@ -864,7 +866,8 @@ public class ResourceManagerBean implements ResourceManagerLocal, ResourceManage * * @param user * @param category Limit the search to a given {@link ResourceCategory} - * @param type Limit the search to to a given {@link ResourceType} + * @param typeName Limit the search to to {@link ResourceType}(s) with the given name + * @param pluginName Limit the search to the plugin with the given name * @param parentResource Limit the search to children of a given parent resource * @param searchString * @param pageControl @@ -2040,9 +2043,7 @@ public class ResourceManagerBean implements ResourceManagerLocal, ResourceManage // lineage is a getXXX (not findXXX) because it logically returns a single object, but modeled as a list here public @XmlJavaTypeAdapter(value = ResourceListAdapter.class) List<Resource> findResourceLineage(Subject subject, int resourceId) { - List<Resource> result = null; - - result = getResourceLineage(resourceId); + List<Resource> result = getResourceLineage(resourceId);
for (Resource resource : result) { if (!authorizationManager.canViewResource(subject, resource.getId())) { @@ -2069,19 +2070,21 @@ public class ResourceManagerBean implements ResourceManagerLocal, ResourceManage }
public PageList<ResourceComposite> findResourceCompositesByCriteria(Subject subject, ResourceCriteria criteria) { - PageList<Resource> intermediate = findResourcesByCriteria(subject, criteria); + PageList<Resource> resources = findResourcesByCriteria(subject, criteria);
List<ResourceComposite> results = new ArrayList<ResourceComposite>(); - for (Resource next : intermediate) { - AvailabilityType availType = next.getCurrentAvailability().getAvailabilityType(); - Resource parent = next.getParentResource(); - ResourceComposite composite = new ResourceComposite(next, parent, availType); - composite.setResourceFacets(typeManager.getResourceFacets(next.getResourceType().getId())); - // TODO: jmarques: need to set resource permissions here, or alter criteria projection to include it + for (Resource resource : resources) { + AvailabilityType availType = resource.getCurrentAvailability().getAvailabilityType(); + Resource parent = resource.getParentResource(); + ResourceComposite composite = new ResourceComposite(resource, parent, availType); + composite.setResourceFacets(typeManager.getResourceFacets(resource.getResourceType().getId())); + Set<Permission> permissions = authorizationManager.getImplicitResourcePermissions(subject, resource.getId()); + composite.setResourcePermission(new ResourcePermission(permissions)); + // TODO: jmarques: Alter criteria projection to include permissions. results.add(composite); }
- return new PageList<ResourceComposite>(results, (int) intermediate.getTotalSize(), intermediate + return new PageList<ResourceComposite>(results, resources.getTotalSize(), resources .getPageControl()); }
@@ -2152,4 +2155,39 @@ public class ResourceManagerBean implements ResourceManagerLocal, ResourceManage DisambiguationUpdateStrategy updateStrategy) { return Disambiguator.disambiguate(results, updateStrategy, extractor, entityManager); } + + public void updateResourceName(Subject subject, int resourceId, String name) { + if (name == null) { + throw new IllegalArgumentException("Resource name cannot be null."); + } + Resource resource = getResourceToBeModified(subject, resourceId); + resource.setName(name); + resource.setMtime(System.currentTimeMillis()); + } + + public void updateResourceDescription(Subject subject, int resourceId, String description) { + Resource resource = getResourceToBeModified(subject, resourceId); + resource.setDescription(description); + resource.setMtime(System.currentTimeMillis()); + } + + public void updateResourceLocation(Subject subject, int resourceId, String location) { + Resource resource = getResourceToBeModified(subject, resourceId); + resource.setLocation(location); + resource.setMtime(System.currentTimeMillis()); + } + + private Resource getResourceToBeModified(Subject subject, int resourceId) { + Resource resource = entityManager.find(Resource.class, resourceId); + + if (resource == null) { + throw new ResourceNotFoundException(resourceId); + } + + if (!authorizationManager.hasResourcePermission(subject, Permission.MODIFY_RESOURCE, resourceId)) { + throw new PermissionException("User [" + subject + "] does not have permission to modify Resource with id [" + + resourceId + "]."); + } + return resource; + } } diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerLocal.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerLocal.java index 327c439..3dd1fcb 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerLocal.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerLocal.java @@ -1,6 +1,6 @@ /* * RHQ Management Platform - * Copyright (C) 2005-2008 Red Hat, Inc. + * Copyright (C) 2005-2010 Red Hat, Inc. * All rights reserved. * * This program is free software; you can redistribute it and/or modify @@ -429,7 +429,7 @@ public interface ResourceManagerLocal { * order (for example, if a given resource is actually a child of one of the other given resources, this method * ensures the uninventory occurs properly). * - * @param user the user performing the uninventory action + * @param subject the user performing the uninventory action * @param resourceIds the ID of the resource to be deleted * * @return the list of all resources that were deleted - in effect, this will contain <code>resourceIds</code> and @@ -455,4 +455,10 @@ public interface ResourceManagerLocal { */ <T> ResourceNamesDisambiguationResult<T> disambiguate(List<T> results, IntExtractor<? super T> resourceIdExtractor, DisambiguationUpdateStrategy updateStrategy); + + void updateResourceName(Subject subject, int resourceId, String name); + + void updateResourceDescription(Subject subject, int resourceId, String description); + + void updateResourceLocation(Subject subject, int resourceId, String location); } \ No newline at end of file diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerRemote.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerRemote.java index d633909..2eb9d62 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerRemote.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerRemote.java @@ -1,6 +1,6 @@ /* * RHQ Management Platform - * Copyright (C) 2005-2008 Red Hat, Inc. + * Copyright (C) 2005-2010 Red Hat, Inc. * All rights reserved. * * This program is free software; you can redistribute it and/or modify @@ -43,7 +43,6 @@ import org.rhq.enterprise.server.system.ServerVersion; * @author Jay Shaughnessy * @author Simeon Pinder */ - @SOAPBinding(style = SOAPBinding.Style.DOCUMENT) @WebService(targetNamespace = ServerVersion.namespace) @Remote @@ -139,4 +138,21 @@ public interface ResourceManagerRemote { @WebParam(name = "subject") Subject subject, // @WebParam(name = "resourceId") int resourceId);
+ @WebMethod + void updateResourceName( // + @WebParam(name = "subject") Subject subject, // + @WebParam(name = "resourceId") int resourceId, // + @WebParam(name = "name") String name); + + @WebMethod + void updateResourceDescription( // + @WebParam(name = "subject") Subject subject, // + @WebParam(name = "resourceId") int resourceId, // + @WebParam(name = "description") String description); + + @WebMethod + void updateResourceLocation( // + @WebParam(name = "subject") Subject subject, // + @WebParam(name = "resourceId") int resourceId, // + @WebParam(name = "location") String location); } \ No newline at end of file diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerBean.java index b2ed76e..987015b 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerBean.java @@ -1,6 +1,6 @@ /* * RHQ Management Platform - * Copyright (C) 2005-2008 Red Hat, Inc. + * Copyright (C) 2005-2010 Red Hat, Inc. * All rights reserved. * * This program is free software; you can redistribute it and/or modify @@ -90,6 +90,7 @@ import org.rhq.enterprise.server.jaxb.adapter.ResourceGroupAdapter; import org.rhq.enterprise.server.operation.GroupOperationSchedule; import org.rhq.enterprise.server.operation.OperationManagerLocal; import org.rhq.enterprise.server.resource.ResourceManagerLocal; +import org.rhq.enterprise.server.resource.ResourceNotFoundException; import org.rhq.enterprise.server.resource.ResourceTypeManagerLocal; import org.rhq.enterprise.server.util.CriteriaQueryGenerator; import org.rhq.enterprise.server.util.CriteriaQueryRunner; @@ -1424,4 +1425,39 @@ public class ResourceGroupManagerBean implements ResourceGroupManagerLocal, Reso } }
+ public void updateResourceGroupName(Subject subject, int groupId, String name) { + if (name == null) { + throw new IllegalArgumentException("Group name cannot be null."); + } + ResourceGroup group = getResourceGroupToBeModified(subject, groupId); + group.setName(name); + group.setMtime(System.currentTimeMillis()); + } + + public void updateResourceGroupDescription(Subject subject, int groupId, String description) { + ResourceGroup group = getResourceGroupToBeModified(subject, groupId); + group.setDescription(description); + group.setMtime(System.currentTimeMillis()); + } + + public void updateResourceGroupLocation(Subject subject, int groupId, String location) { + ResourceGroup group = getResourceGroupToBeModified(subject, groupId); + group.setDescription(location); + group.setMtime(System.currentTimeMillis()); + } + + private ResourceGroup getResourceGroupToBeModified(Subject subject, int groupId) { + ResourceGroup group = entityManager.find(ResourceGroup.class, groupId); + + if (group == null) { + throw new ResourceGroupNotFoundException(groupId); + } + + if (!authorizationManager.hasGroupPermission(subject, Permission.MODIFY_RESOURCE, groupId)) { + throw new PermissionException("User [" + subject + "] does not have permission to modify Resource group with id [" + + groupId + "]."); + } + return group; + } + } \ No newline at end of file diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerLocal.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerLocal.java index 5975099..8ed40b6 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerLocal.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerLocal.java @@ -1,6 +1,6 @@ /* * RHQ Management Platform - * Copyright (C) 2005-2008 Red Hat, Inc. + * Copyright (C) 2005-2010 Red Hat, Inc. * All rights reserved. * * This program is free software; you can redistribute it and/or modify @@ -138,4 +138,10 @@ public interface ResourceGroupManagerLocal { ResourceGroup updateResourceGroup(Subject subject, ResourceGroup group);
PageList<ResourceGroup> findResourceGroupsByCriteria(Subject subject, ResourceGroupCriteria criteria); + + void updateResourceGroupName(Subject subject, int groupId, String name); + + void updateResourceGroupDescription(Subject subject, int groupId, String description); + + void updateResourceGroupLocation(Subject subject, int groupId, String location); } \ No newline at end of file diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerRemote.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerRemote.java index f285fb5..8907ea9 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerRemote.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerRemote.java @@ -1,6 +1,6 @@ /* * RHQ Management Platform - * Copyright (C) 2005-2008 Red Hat, Inc. + * Copyright (C) 2005-2010 Red Hat, Inc. * All rights reserved. * * This program is free software; you can redistribute it and/or modify @@ -96,4 +96,22 @@ public interface ResourceGroupManagerRemote { PageList<ResourceGroup> findResourceGroupsByCriteria( // @WebParam(name = "subject") Subject subject, // @WebParam(name = "criteria") ResourceGroupCriteria criteria); + + @WebMethod + void updateResourceGroupName( // + @WebParam(name = "subject") Subject subject, // + @WebParam(name = "groupId") int groupId, // + @WebParam(name = "name") String name); + + @WebMethod + void updateResourceGroupDescription( // + @WebParam(name = "subject") Subject subject, // + @WebParam(name = "groupId") int groupId, // + @WebParam(name = "description") String description); + + @WebMethod + void updateResourceGroupLocation( // + @WebParam(name = "subject") Subject subject, // + @WebParam(name = "groupId") int groupId, // + @WebParam(name = "location") String location); }
commit 36c35567dbd5482c3878af2e7fef96b68fb81fad Author: John Mazzitelli mazz@redhat.com Date: Thu Aug 12 11:22:31 2010 -0400
remove AS keyword - Oracle doesn't like it.
diff --git a/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml b/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml index f36ad4a..07b448b 100644 --- a/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml +++ b/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml @@ -3152,7 +3152,7 @@ <schema-addColumn table="RHQ_RESOURCE_GROUP" column="MODIFIED_BY_VARCHAR" columnType="VARCHAR2" precision="100"/> <schema-directSQL> <statement desc="RESOURCE_GROUP: Populate the tmp modifiedBy column with existing user names or null if user does not exist"> - UPDATE RHQ_RESOURCE_GROUP AS g SET MODIFIED_BY_VARCHAR = (SELECT NAME FROM RHQ_SUBJECT WHERE ID = g.MODIFIED_BY) + UPDATE RHQ_RESOURCE_GROUP g SET MODIFIED_BY_VARCHAR = (SELECT NAME FROM RHQ_SUBJECT WHERE ID = g.MODIFIED_BY) </statement> <statement desc="RESOURCE_GROUP: Make unknown usernames as rhqadmin in tmp modifiedBy column"> UPDATE RHQ_RESOURCE_GROUP SET MODIFIED_BY_VARCHAR = 'rhqadmin' WHERE MODIFIED_BY_VARCHAR IS NULL @@ -3172,7 +3172,7 @@ <schema-addColumn table="RHQ_RESOURCE" column="MODIFIED_BY_VARCHAR" columnType="VARCHAR2" precision="100"/> <schema-directSQL> <statement desc="RESOURCE: Populate the tmp modifiedBy column with existing user names or null if user does not exist"> - UPDATE RHQ_RESOURCE AS r SET MODIFIED_BY_VARCHAR = (SELECT NAME FROM RHQ_SUBJECT WHERE ID = r.MODIFIED_BY) + UPDATE RHQ_RESOURCE r SET MODIFIED_BY_VARCHAR = (SELECT NAME FROM RHQ_SUBJECT WHERE ID = r.MODIFIED_BY) </statement> <statement desc="RESOURCE: Make unknown usernames as rhqadmin in tmp modifiedBy column"> UPDATE RHQ_RESOURCE SET MODIFIED_BY_VARCHAR = 'rhqadmin' WHERE MODIFIED_BY_VARCHAR IS NULL
commit 910702a4e6da5c6c7cd223f9ad7de12eac8d156c Author: Joseph Marques joseph@redhat.com Date: Thu Aug 12 02:10:30 2010 -0400
we don't support content at the group-level, so delete those commented-out sub-tab references
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java index 4a5f363..7ce294f 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java @@ -149,13 +149,6 @@ public class ResourceGroupDetailView extends VLayout implements BookmarkableView operationsTab.updateSubTab("History", new FullHTMLPane( "/rhq/group/operation/groupOperationHistory-plain.xhtml?groupId=" + groupId)); operationsTab.updateSubTab("Scheduled", new FullHTMLPane( - // - // eventsTab.updateSubTab("History", EventHistoryView.createResourceHistoryView(resource.getId())); //new FullHTMLPane("/rhq/common/events/history-plain.xhtml?id=" + resource.getId())); - // - // contentTab.updateSubTab("Deployed", new FullHTMLPane("/rhq/resource/content/view-plain.xhtml?id=" + resource.getId())); - // contentTab.updateSubTab("New", new FullHTMLPane("/rhq/resource/content/deploy-plain.xhtml?id=" + resource.getId())); - // contentTab.updateSubTab("Subscriptions", new FullHTMLPane("/rhq/resource/content/subscription-plain.xhtml?id=" + resource.getId())); - // contentTab.updateSubTab("History", new FullHTMLPane("/rhq/resource/content/history-plain.xhtml?id=" + resource.getId())); "/rhq/group/operation/groupOperationSchedules-plain.xhtml?groupId=" + groupId));
configurationTab.updateSubTab("Current", new FullHTMLPane(
commit a8cd0f333842f0059d06e8678cf0d38f9b5db3b5 Author: Joseph Marques joseph@redhat.com Date: Thu Aug 12 02:09:51 2010 -0400
implement "plain" scheme using iframed-facelets for unfinished group > operation tabs
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java index 709e304..4a5f363 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java @@ -145,8 +145,10 @@ public class ResourceGroupDetailView extends VLayout implements BookmarkableView inventoryTab.updateSubTab("Overview", new OverviewView(this.groupComposite)); inventoryTab.updateSubTab("Members", ResourceSearchView.getMembersOf(groupId)); // inventoryTab.updateSubTab("Connection Settings", new GroupPluginConfigurationEditView(this.group.getId(), this.group.getResourceType().getId(), ConfigurationEditor.ConfigType.plugin)); - // - // operationsTab.updateSubTab("History", OperationHistoryView.getResourceHistoryView(resource)); + + operationsTab.updateSubTab("History", new FullHTMLPane( + "/rhq/group/operation/groupOperationHistory-plain.xhtml?groupId=" + groupId)); + operationsTab.updateSubTab("Scheduled", new FullHTMLPane( // // eventsTab.updateSubTab("History", EventHistoryView.createResourceHistoryView(resource.getId())); //new FullHTMLPane("/rhq/common/events/history-plain.xhtml?id=" + resource.getId())); // @@ -154,6 +156,8 @@ public class ResourceGroupDetailView extends VLayout implements BookmarkableView // contentTab.updateSubTab("New", new FullHTMLPane("/rhq/resource/content/deploy-plain.xhtml?id=" + resource.getId())); // contentTab.updateSubTab("Subscriptions", new FullHTMLPane("/rhq/resource/content/subscription-plain.xhtml?id=" + resource.getId())); // contentTab.updateSubTab("History", new FullHTMLPane("/rhq/resource/content/history-plain.xhtml?id=" + resource.getId())); + "/rhq/group/operation/groupOperationSchedules-plain.xhtml?groupId=" + groupId)); + configurationTab.updateSubTab("Current", new FullHTMLPane( "/rhq/group/configuration/viewCurrent-plain.xhtml?groupId=" + groupId)); configurationTab.updateSubTab("History", new FullHTMLPane( diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/operation/groupOperationHistory-plain.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/operation/groupOperationHistory-plain.xhtml new file mode 100644 index 0000000..36f8b54 --- /dev/null +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/operation/groupOperationHistory-plain.xhtml @@ -0,0 +1,293 @@ +<ui:composition template="/rhq/group/layout/main-plain.xhtml" + xmlns="http://www.w3.org/1999/xhtml" + xmlns:h="http://java.sun.com/jsf/html" + xmlns:f="http://java.sun.com/jsf/core" + xmlns:ui="http://java.sun.com/jsf/facelets" + xmlns:c="http://java.sun.com/jstl/core" + xmlns:onc="http://jboss.org/on/component" + xmlns:onf="http://jboss.org/on/function" + xmlns:s="http://jboss.com/products/seam/taglib" + xmlns:a4j="https://ajax4jsf.dev.java.net/ajax" + xmlns:rich="http://richfaces.ajax4jsf.org/rich%22%3E + + <ui:define name="content"> + + <!-- + ResourceGroup Operation Pending History + --> + + <ui:param name="currentOperation" value="#{ResourceGroupOperationPendingHistoryUIBean.oldestInProgressResourceGroupOperation}" /> + + <h:form id="pendingForm"> + <input type="hidden" name="groupId" value="${param.groupId}"/> + <input type="hidden" name="category" value="#{param.category}" /> + + <rich:panel styleClass="BlockContent"> + <f:facet name="header">In Progress Operations</f:facet> + + <ui:param name="resourceGroupOperationPendingHistoryDataModel" value="#{ResourceGroupOperationPendingHistoryUIBean.dataModel}"/> + + <a4j:keepAlive beanName="ResourceGroupOperationPendingHistoryUIBean"/> + + <a4j:poll id="resourceGroupOperationPendingHistoryDataTableReRenderer" + oncomplete="disableConditionalButtons();" + interval="60000" + ignoreDupResponses="true" + actionListener="#{ResourceGroupOperationPendingHistoryUIBean.clearDataModel}" + reRender="resourceGroupOperationPendingHistoryDataTable" /> + <rich:dataTable id="resourceGroupOperationPendingHistoryDataTable" + rows="#{PageControl.ResourceGroupOperationPendingHistory.pageSize}" + value="#{resourceGroupOperationPendingHistoryDataModel}" + var="pendingItem" + width="100%" + columnsWidth="1%, 20%, 20%, 20%, 20%, 19%" + styleClass="resources-table" + footerClass="on-pager-footer" + onRowMouseOver="this.style.backgroundColor='#E7E7E7'" + onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"> + + <f:facet name="PageControlView"> + <onc:paginationControl id="ResourceGroupOperationPendingHistory" /> + </f:facet> + + rich:column + <f:facet name="header"> + <onc:allSelect target="pendingSelectedItems" /> + </f:facet> + + <onc:select name="pendingSelectedItems" value="#{pendingItem.id}" /> + </rich:column> + + rich:column + <f:facet name="header"> + <onc:sortableColumnHeader sort="h.createdTime"> + <h:outputText styleClass="headerText" value="Date Submitted" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputText value="#{pendingItem.createdTime}"> + <f:converter converterId="UserDateTimeConverter" /> + </h:outputText> + </rich:column> + + rich:column + <f:facet name="header"> + <h:outputText styleClass="headerText" value="Name" /> + </f:facet> + + <h:outputLink value="/rhq/group/operation/groupOperationHistoryDetails-plain.xhtml" > + <f:param name="groupId" value="#{param.groupId}" /> + <f:param name="opId" value="#{pendingItem.id}" /> + <f:param name="category" value="#{param.category}" /> + + <h:outputText value="#{pendingItem.operationDefinition.displayName}"/> + </h:outputLink> + </rich:column> + + rich:column + <f:facet name="header"> + <h:outputText styleClass="headerText" value="Description" /> + </f:facet> + + <h:outputText value="#{pendingItem.operationDefinition.description}"/> + </rich:column> + + rich:column + <f:facet name="header"> + <onc:sortableColumnHeader sort="h.status"> + <h:outputText styleClass="headerText" value="Status" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputText value="#{pendingItem.status}"/> + </rich:column> + + rich:column + <f:facet name="header"> + <onc:sortableColumnHeader sort="h.subjectName"> + <h:outputText styleClass="headerText" value="User" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputText value="#{pendingItem.subjectName}"/> + </rich:column> + + <f:facet name="footer"> + rich:columnGroup + <rich:column colspan="6" width="100%"> + <onc:selectCommandButton action="#{ResourceGroupOperationPendingHistoryUIBean.cancel}" + value="CANCEL SELECTED" target="pendingSelectedItems" + styleClass="on-pager-button buttonsmall" + rendered="#{ResourceGroupUIBean.permissions.control}"/> + + <ui:param name="paginationDataTableName" value="resourceGroupOperationPendingHistoryDataTable"/> + <ui:param name="paginationDataModel" value="#{resourceGroupOperationPendingHistoryDataModel}"/> + <ui:param name="paginationPageControl" value="#{PageControl.ResourceGroupOperationPendingHistory}"/> + <ui:include src="/rhq/resource/include/pagination-plain.xhtml" /> + </rich:column> + </rich:columnGroup> + </f:facet> + + </rich:dataTable> + + </rich:panel> + </h:form> + + <!-- + ResourceGroup Operation Completed History + --> + + <h:form id="historyForm"> + <input type="hidden" name="groupId" value="${param.groupId}"/> + <input type="hidden" name="category" value="#{param.category}" /> + + <rich:panel styleClass="BlockContent"> + <f:facet name="header">Completed Operations</f:facet> + + <a4j:keepAlive beanName="ResourceGroupOperationCompletedHistoryUIBean"/> + + <ui:param name="resourceGroupOperationCompletedHistoryDataModel" value="#{ResourceGroupOperationCompletedHistoryUIBean.dataModel}"/> + + <h:outputText value="There are no completed operations" rendered="#{resourceGroupOperationCompletedHistoryDataModel.rowCount eq 0}"/> + + <a4j:poll id="resourceGroupOperationCompletedHistoryDataTableReRenderer" + oncomplete="disableConditionalButtons();" + interval="60000" + ignoreDupResponses="true" + actionListener="#{ResourceGroupOperationCompletedHistoryUIBean.clearDataModel}" + reRender="resourceGroupOperationCompletedHistoryDataTable" /> + <rich:dataTable rendered="#{resourceGroupOperationCompletedHistoryDataModel.rowCount gt 0}" + id="resourceGroupOperationCompletedHistoryDataTable" + rows="#{PageControl.ResourceGroupOperationCompletedHistory.pageSize}" + value="#{resourceGroupOperationCompletedHistoryDataModel}" + var="historyItem" + width="100%" + columnsWidth="1%, 17%, 17%, 17%, 17%, 16%, 16%" + rowKeyVar="rowIndex" + styleClass="resources-table" + footerClass="on-pager-footer" + onRowMouseOver="this.style.backgroundColor='#E7E7E7'" + onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"> + + <f:facet name="PageControlView"> + <onc:paginationControl id="ResourceGroupOperationCompletedHistory" /> + </f:facet> + + rich:column + <f:facet name="header"> + <onc:allSelect target="completedSelectedItems" /> + </f:facet> + + <onc:select name="completedSelectedItems" value="#{historyItem.id}" /> + </rich:column> + + rich:column + <f:facet name="header"> + <onc:sortableColumnHeader sort="h.createdTime"> + <h:outputText styleClass="headerText" value="Date Submitted" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputText value="#{historyItem.createdTime}"> + <f:converter converterId="UserDateTimeConverter" /> + </h:outputText> + </rich:column> + + rich:column + <f:facet name="header"> + <onc:sortableColumnHeader sort="h.modifiedTime"> + <h:outputText styleClass="headerText" value="Date Completed" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputText value="#{historyItem.modifiedTime}"> + <f:converter converterId="UserDateTimeConverter" /> + </h:outputText> + </rich:column> + + rich:column + <f:facet name="header"> + <h:outputText styleClass="headerText" value="Name" /> + </f:facet> + + <h:outputLink value="/rhq/group/operation/groupOperationHistoryDetails-plain.xhtml" > + <f:param name="groupId" value="#{param.groupId}" /> + <f:param name="opId" value="#{historyItem.id}" /> + <f:param name="category" value="#{param.category}" /> + + <h:outputText value="#{historyItem.operationDefinition.displayName}"/> + </h:outputLink> + </rich:column> + + rich:column + <f:facet name="header"> + <h:outputText styleClass="headerText" value="Description" /> + </f:facet> + + <h:outputText value="#{historyItem.operationDefinition.description}"/> + </rich:column> + + rich:column + <f:facet name="header"> + <onc:sortableColumnHeader sort="h.status"> + <h:outputText styleClass="headerText" value="Status" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputText rendered="#{historyItem.status ne 'FAILURE'}" value="#{historyItem.status}"/> + <h:outputLink rendered="#{historyItem.status eq 'FAILURE'}" + value="javascript:displayMessageModal('Error Message','#{historyItem.errorMessage}')"> + <h:outputText value="#{historyItem.status}"/> + </h:outputLink> + </rich:column> + + rich:column + <f:facet name="header"> + <onc:sortableColumnHeader sort="h.subjectName"> + <h:outputText styleClass="headerText" value="User" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputText value="#{historyItem.subjectName}"/> + </rich:column> + + <f:facet name="footer"> + rich:columnGroup + <rich:column colspan="7" width="100%"> + <onc:selectCommandButton action="#{ResourceGroupOperationCompletedHistoryUIBean.delete}" + value="DELETE SELECTED" target="completedSelectedItems" + styleClass="on-pager-button buttonsmall" + rendered="#{ResourceGroupUIBean.permissions.control}" + onclick="return preventDoubleClick();"/> + + <ui:param name="paginationDataTableName" value="resourceGroupOperationCompletedHistoryDataTable"/> + <ui:param name="paginationDataModel" value="#{resourceGroupOperationCompletedHistoryDataModel}"/> + <ui:param name="paginationPageControl" value="#{PageControl.ResourceGroupOperationCompletedHistory}"/> + <ui:include src="/rhq/resource/include/pagination-plain.xhtml" /> + </rich:column> + </rich:columnGroup> + </f:facet> + + </rich:dataTable> + + <!-- use a hidden button trick (which sends the same action a column click would) so request params aren't lost --> + <h:commandButton id="hiddenHistoryButton" style="visibility: hidden;" action="#{TableSorter.obtainFromOutcome}" /> + + </rich:panel> + </h:form> + + <script type="text/javascript"> + var submitted = false; + function preventDoubleClick() { + if (submitted) { + return false; + } else { + submitted = true; + return true; + } + } + </script> + + </ui:define> + +</ui:composition> diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/operation/groupOperationHistoryDetails-plain.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/operation/groupOperationHistoryDetails-plain.xhtml new file mode 100644 index 0000000..8c9834e --- /dev/null +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/operation/groupOperationHistoryDetails-plain.xhtml @@ -0,0 +1,232 @@ +<ui:composition template="/rhq/group/layout/main-plain.xhtml" + xmlns="http://www.w3.org/1999/xhtml" + xmlns:h="http://java.sun.com/jsf/html" + xmlns:f="http://java.sun.com/jsf/core" + xmlns:ui="http://java.sun.com/jsf/facelets" + xmlns:c="http://java.sun.com/jstl/core" + xmlns:onc="http://jboss.org/on/component" + xmlns:onf="http://jboss.org/on/function" + xmlns:s="http://jboss.com/products/seam/taglib" + xmlns:a4j="https://ajax4jsf.dev.java.net/ajax" + xmlns:rich="http://richfaces.ajax4jsf.org/rich%22%3E + + <ui:define name="content"> + +<ui:param name="item" value="#{ResourceGroupOperationHistoryDetailsUIBean.history}"/> + +<h:form id="operationHistoryDetailsForm"> +<input type="hidden" name="groupId" value="${param.groupId}"/> +<input type="hidden" name="opId" value="${param.opId}"/> +<input type="hidden" name="category" value="#{param.category}"/> + +<a4j:keepAlive beanName="ResourceGroupOperationHistoryDetailsUIBean" ajaxOnly="true"/> + +<br/> +<h:outputLink value="/rhq/group/operation/groupOperationHistory-plain.xhtml"> + <f:param name="groupId" value="#{param.groupId}"/> + <f:param name="category" value="#{param.category}"/> + + <h:outputText value="< Return to Operation History"/> +</h:outputLink> + +<rich:panel styleClass="BlockContent"> + <f:facet name="header">Details</f:facet> + <table> + <tr> + <td align="right" style="width: 150px;">Operation:</td> + <td align="left"> + <h:outputText value="#{item.operationDefinition.displayName}"/> + </td> + </tr> + <tr> + <td align="right">Date Submitted:</td> + <td align="left"> + <h:outputText value="#{item.createdTime}"> + <f:converter converterId="UserDateTimeConverter"/> + </h:outputText> + </td> + </tr> + <tr> + <td align="right">Date Completed:</td> + <td align="left"> + <h:outputText value="#{item.modifiedTime}" rendered="#{item.status ne 'INPROGRESS'}"> + <f:converter converterId="UserDateTimeConverter"/> + </h:outputText> + </td> + </tr> + <tr> + <td align="right">Requester:</td> + <td align="left"> + <h:outputText value="#{item.subjectName}" rendered="#{!(empty item.subjectName)}"/> + <h:outputText value="(unknown)" rendered="#{empty item.subjectName}"/> + </td> + </tr> + <tr> + <td align="right">Status:</td> + <td align="left"> + <h:outputText rendered="#{item.status eq 'SUCCESS' or item.status eq 'INPROGRESS'}" + value="#{item.status}"/> + <h:outputLink rendered="#{item.status ne 'SUCCESS' and item.status ne 'INPROGRESS'}" + value="#" id="resultsLink"> + <h:outputText value="#{item.status}"/> + <rich:componentControl for="resultsModalPanel" attachTo="resultsLink" operation="show" + event="onclick"/> + </h:outputLink> + <rich:modalPanel id="resultsModalPanel" width="600" height="400" + style="overflow: auto;"> + <f:facet name="header"> + <h:panelGroup> + <h:outputText value="Results"/> + </h:panelGroup> + </f:facet> + <f:facet name="controls"> + <h:panelGroup> + <h:graphicImage value="/images/close.png" style="cursor:pointer" + id="resultsModelPanelHideLink"/> + <rich:componentControl for="resultsModalPanel" attachTo="resultsModelPanelHideLink" + operation="hide" event="onclick"/> + </h:panelGroup> + </f:facet> + + <div class="ErrorModalBody"> + <h:outputText value="#{item.errorMessage}"/> + </div> + </rich:modalPanel> + </td> + </tr> + </table> +</rich:panel> + +<rich:panel styleClass="BlockContent"> + <f:facet name="header">Parameters</f:facet> + <onc:config + configurationDefinition="#{ResourceGroupOperationHistoryDetailsUIBean.parameters.configurationDefinition}" + configuration="#{ResourceGroupOperationHistoryDetailsUIBean.parameters.configuration}" + readOnly="true" + nullConfigurationDefinitionMessage="#{ResourceGroupOperationHistoryDetailsUIBean.parameters.nullConfigurationDefinitionMessage}" + nullConfigurationMessage="#{ResourceGroupOperationHistoryDetailsUIBean.parameters.nullConfigurationMessage}" + nullConfigurationStyle="InfoBlock"/> +</rich:panel> + +<rich:panel styleClass="BlockContent"> + <f:facet name="header">Resource Operation Results</f:facet> + + <h:panelGrid columns="1" styleClass="data-table"> + + <ui:param name="resourceGroupOperationHistoryDetailsDataModel" + value="#{ResourceGroupOperationHistoryDetailsUIBean.dataModel}"/> + + <h:outputText value="There were no resources in the group when this operation was executed" + rendered="#{resourceGroupOperationHistoryDetailsDataModel.rowCount eq 0}"/> + + <rich:dataTable rendered="#{resourceGroupOperationHistoryDetailsDataModel.rowCount gt 0}" + id="resourceGroupOperationHistoryDetailsDataTable" + rows="#{PageControl.ResourceGroupOperationHistoryDetails.pageSize}" + value="#{resourceGroupOperationHistoryDetailsDataModel}" + var="resourceHistoryItem" + width="100%" + columnsWidth="20%, 20%, 20%, 20%, 19%" + headerClass="tableRowHeader" + footerClass="on-pager-footer" + onRowMouseOver="this.style.backgroundColor='#E7E7E7'" + onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"> + + <f:facet name="PageControlView"> + <onc:paginationControl id="ResourceGroupOperationHistoryDetails"/> + </f:facet> + + <rich:column rendered="#{param.debug}"> + <f:facet name="header"> + <onc:sortableColumnHeader sort="h.id"> + <h:outputText styleClass="headerText" value="ID"/> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputText value="#{resourceHistoryItem.id}"/> + </rich:column> + + rich:column + <f:facet name="header"> + <onc:sortableColumnHeader sort="h.createdTime"> + <h:outputText styleClass="headerText" value="Date Submitted"/> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputText value="#{resourceHistoryItem.createdTime}"> + <f:converter converterId="UserDateTimeConverter"/> + </h:outputText> + </rich:column> + + rich:column + <f:facet name="header"> + <h:outputText styleClass="headerText" value="Name"/> + </f:facet> + + <h:outputLink value="/rhq/resource/operation/resourceOperationHistoryDetails-plain.xhtml"> + <f:param name="id" value="#{resourceHistoryItem.resource.id}"/> + <f:param name="opId" value="#{resourceHistoryItem.id}"/> + <h:outputText value="#{resourceHistoryItem.operationDefinition.displayName}"/> + </h:outputLink> + + </rich:column> + + rich:column + <f:facet name="header"> + <h:outputText styleClass="headerText" value="Resource"/> + </f:facet> + + <h:outputText value="#{resourceHistoryItem.resource.name}"/> + </rich:column> + + rich:column + <f:facet name="header"> + <onc:sortableColumnHeader sort="h.status"> + <h:outputText styleClass="headerText" value="Status"/> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputText value="#{resourceHistoryItem.status}"/> + </rich:column> + + rich:column + <f:facet name="header"> + <onc:sortableColumnHeader sort="h.subjectName"> + <h:outputText styleClass="headerText" value="User"/> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputText value="#{resourceHistoryItem.subjectName}"/> + </rich:column> + + <f:facet name="footer"> + rich:columnGroup + <rich:column colspan="6" width="100%"> + <ui:param name="paginationDataTableName" + value="resourceGroupOperationHistoryDetailsDataTable"/> + <ui:param name="paginationDataModel" + value="#{resourceGroupOperationHistoryDetailsDataModel}"/> + <ui:param name="paginationPageControl" + value="#{PageControl.ResourceGroupOperationHistoryDetails}"/> + <ui:include src="/rhq/resource/include/pagination-plain.xhtml"/> + </rich:column> + </rich:columnGroup> + </f:facet> + + </rich:dataTable> + + </h:panelGrid> + +</rich:panel> + +<h:outputLink value="/rhq/group/operation/groupOperationHistory-plain.xhtml"> + <f:param name="groupId" value="#{param.groupId}"/> + <f:param name="category" value="#{param.category}"/> + + <h:outputText value="< Return to Operation History"/> +</h:outputLink> + +</h:form> + +</ui:define> + +</ui:composition> \ No newline at end of file diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/operation/groupOperationScheduleDetails-plain.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/operation/groupOperationScheduleDetails-plain.xhtml new file mode 100644 index 0000000..23274f2 --- /dev/null +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/operation/groupOperationScheduleDetails-plain.xhtml @@ -0,0 +1,118 @@ +<ui:composition template="/rhq/group/layout/main-plain.xhtml" + xmlns="http://www.w3.org/1999/xhtml" + xmlns:h="http://java.sun.com/jsf/html" + xmlns:f="http://java.sun.com/jsf/core" + xmlns:ui="http://java.sun.com/jsf/facelets" + xmlns:c="http://java.sun.com/jstl/core" + xmlns:onc="http://jboss.org/on/component" + xmlns:onf="http://jboss.org/on/function" + xmlns:s="http://jboss.com/products/seam/taglib" + xmlns:a4j="https://ajax4jsf.dev.java.net/ajax" + xmlns:rich="http://richfaces.ajax4jsf.org/rich%22%3E + + <ui:define name="content"> + <br/> + <!-- ResourceGroup Operation Schedules --> + <h:outputLink value="/rhq/group/operation/groupOperationSchedules-plain.xhtml"> + <f:param name="groupId" value="#{param.groupId}" /> + <f:param name="category" value="#{param.category}" /> + + <h:outputText value="< Return to Operation Schedules"/> + </h:outputLink> + + <rich:panel styleClass="BlockContent"> + <f:facet name="header">General Info</f:facet> + <table> + <tr> + <td align="right" style="width: 125px;">Operation:</td> + <td align="left"> + <h:outputText value="#{item.operationDisplayName}" /> + </td> + </tr> + <tr> + <td align="right" style="width: 125px;">Scheduled By:</td> + <td align="left"> + <h:outputText value="#{item.subject.name}" /> + </td> + </tr> + <tr> + <td align="right" style="width: 125px;">Halt on Failure:</td> + <td align="left"> + <h:outputText value="#{item.haltOnFailure}" /> + </td> + </tr> + <tr> + <td align="right" style="width: 125px;">Notes:</td> + <td align="left"> + <h:outputText value="#{item.description}" /> + </td> + </tr> + </table> + </rich:panel> + + <rich:panel styleClass="BlockContent"> + <f:facet name="header">Parameters</f:facet> + <onc:config configurationDefinition="#{ResourceGroupOperationScheduleDetailsUIBean.parameters.configurationDefinition}" + configuration="#{ResourceGroupOperationScheduleDetailsUIBean.parameters.configuration}" + readOnly="true" + nullConfigurationDefinitionMessage="#{ResourceGroupOperationScheduleDetailsUIBean.parameters.nullConfigurationDefinitionMessage}" + nullConfigurationMessage="#{ResourceGroupOperationScheduleDetailsUIBean.parameters.nullConfigurationMessage}" + nullConfigurationStyle="InfoBlock"/> + </rich:panel> + + <rich:panel styleClass="BlockContent"> + <f:facet name="header"> + <h:outputText value="Resource Operation Order"/> + </f:facet> + <h:panelGrid columns="2"> + <h:outputText value="Execute this operation: " /> + <h:selectOneRadio id="executionType" + layout="pageDirection" + disabled="true" + value="#{ResourceGroupOperationScheduleDetailsUIBean.resourceExecutionOption}"> + <f:selectItem value="#{ResourceGroupExecutionTypeUIBean.concurrentOption}" /> + <f:selectItem value="#{ResourceGroupExecutionTypeUIBean.orderedOption}" /> + </h:selectOneRadio> + + <h:outputText value=" " /> + <rich:orderingList id="resourceNameItems" + orderControlsVisible="false" + fastOrderControlsVisible="false" + value="#{ResourceGroupOperationScheduleDetailsUIBean.resourceNameItems}" + var="resourceNameItem" listHeight="150" listWidth="200" + converter="IntegerOptionItemConverter"> + rich:column + <h:outputText value="#{resourceNameItem.displayName}"></h:outputText> + </rich:column> + </rich:orderingList> + </h:panelGrid> + </rich:panel> + + <rich:panel styleClass="BlockContent"> + <f:facet name="header">Schedule Details</f:facet> + <onc:operationScheduler scheduleDetails="#{ResourceGroupOperationScheduleDetailsUIBean.operationDetails}" readOnly="true" /> + </rich:panel> + + <h:form id="scheduleForm"> + <input type="hidden" name="groupId" value="${param.groupId}"/> + <input type="hidden" name="jobId" value="${param.jobId}"/> + <h:panelGrid columns="1" styleClass="buttons-table" columnClasses="button-cell"> + <h:commandButton action="#{ResourceGroupOperationScheduleUIBean.executeNow}" + value="EXECUTE NOW" styleClass="buttonmed" + rendered="#{ResourceGroupUIBean.permissions.control}" /> + </h:panelGrid> + </h:form> + + <br /> + <br /> + + <h:outputLink value="/rhq/group/operation/groupOperationSchedules-plain.xhtml"> + <f:param name="groupId" value="#{param.groupId}" /> + <f:param name="category" value="#{param.category}" /> + + <h:outputText value="< Return to Operation Schedules"/> + </h:outputLink> + + </ui:define> + +</ui:composition> \ No newline at end of file diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/operation/groupOperationScheduleNew-plain.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/operation/groupOperationScheduleNew-plain.xhtml new file mode 100644 index 0000000..486d22a --- /dev/null +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/operation/groupOperationScheduleNew-plain.xhtml @@ -0,0 +1,173 @@ +<ui:composition template="/rhq/group/layout/main-plain.xhtml" + xmlns="http://www.w3.org/1999/xhtml" + xmlns:h="http://java.sun.com/jsf/html" + xmlns:f="http://java.sun.com/jsf/core" + xmlns:ui="http://java.sun.com/jsf/facelets" + xmlns:c="http://java.sun.com/jstl/core" + xmlns:onc="http://jboss.org/on/component" + xmlns:onf="http://jboss.org/on/function" + xmlns:s="http://jboss.com/products/seam/taglib" + xmlns:a4j="https://ajax4jsf.dev.java.net/ajax" + xmlns:rich="http://richfaces.ajax4jsf.org/rich%22%3E + + <ui:define name="content"> + + <!-- + ResourceGroup Operation Definitions + --> + + <h:outputText rendered="#{not ResourceGroupUIBean.permissions.control}" value="You do not have permissions to execute operations on this group"/> + + <h:form id="newScheduleForm"> + <input type="hidden" name="groupId" value="#{param.groupId}" /> + <input type="hidden" name="parentGroupId" value="#{param.parentGroupId}" /> + <input type="hidden" name="category" value="#{param.category}" /> + + <c:if test="${not empty param.opId}"> + <input type="hidden" name="opId" value="#{param.opId}" /> + </c:if> + + <rich:panel styleClass="BlockContent"> + <f:facet name="header">Supported Operations</f:facet> + + <rich:dataTable id="resourceGroupOperationDefinitionDataTable" + rows="0" + value="#{ResourceGroupOperationDefinitionUIBean.dataModel}" + var="item" + width="100%" + columnsWidth="35%, 65%" + styleClass="resources-table" + headerClass="tableRowHeader" + onRowMouseOver="this.style.backgroundColor='#E7E7E7'" + onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"> + + <f:facet name="PageControlView"> + <onc:paginationControl id="NONE" /> + </f:facet> + + <rich:column rendered="false"> + <f:facet name="header"> + <rich:spacer /> + </f:facet> + + <onc:select name="selectedItems" value="#{item.id}" type="radio" /> + </rich:column> + + rich:column + <f:facet name="header"> + <h:outputText styleClass="headerText" value="Name" /> + </f:facet> + + <h:outputLink action="success" rendered="#{ResourceGroupUIBean.permissions.control}"> + <f:param name="opId" value="#{item.id}" /> + <f:param name="groupId" value="#{param.groupId}"/> + <f:param name="parentGroupId" value="#{param.parentGroupId}" /> + <f:param name="category" value="#{param.category}" /> + + <h:outputText value="#{item.displayName} *" rendered="#{(not empty param.opId) and (param.opId == item.id)}"/> + <h:outputText value="#{item.displayName}" rendered="#{(empty param.opId) or (param.opId != item.id)}"/> + </h:outputLink> + + <h:outputText value="#{item.displayName}" rendered="#{not ResourceGroupUIBean.permissions.control}"/> + + </rich:column> + + rich:column + <f:facet name="header"> + <h:outputText styleClass="headerText" value="Description" /> + </f:facet> + + <h:outputText value="#{item.description}"/> + </rich:column> + + </rich:dataTable> + + </h:panelGrid> + </rich:panel> + + <rich:panel rendered="#{not empty param.opId and ResourceGroupUIBean.permissions.control}" styleClass="BlockContent"> + <f:facet name="header"> + <h:outputText value="Operation Parameters"/> + </f:facet> + <!-- even when things aren't rendered, they will still be executed? --> + <onc:config configurationDefinition="#{OperationDefinitionParametersUIBean.configurationDefinition}" + configuration="#{OperationDefinitionParametersUIBean.configuration}" + nullConfigurationDefinitionMessage="#{OperationDefinitionParametersUIBean.nullConfigurationDefinitionMessage}" + nullConfigurationMessage="#{OperationDefinitionParametersUIBean.nullConfigurationMessage}" + nullConfigurationStyle="InfoBlock"/> + </rich:panel> + + <rich:panel rendered="#{not empty param.opId and ResourceGroupUIBean.permissions.control}" styleClass="BlockContent"> + <f:facet name="header"> + <h:outputText value="Resource Operation Order"/> + </f:facet> + <h:panelGrid columns="2"> + <h:outputText value="Execute this operation: " /> + <h:selectOneRadio id="executionType" + layout="pageDirection" + value="#{ResourceGroupOperationDefinitionUIBean.resourceExecutionOption}" + onchange="updateDependent(this, 'newScheduleForm:haltOnFailure', '#{ResourceGroupExecutionTypeUIBean.concurrentOption.value}');"> + <f:selectItem value="#{ResourceGroupExecutionTypeUIBean.concurrentOption}" /> + <f:selectItem value="#{ResourceGroupExecutionTypeUIBean.orderedOption}" /> + </h:selectOneRadio> + + <h:outputText value=" " /> + <rich:orderingList id="resourceNameItems" + value="#{ResourceGroupOperationDefinitionUIBean.resourceNameItems}" + var="resourceNameItem" listHeight="150" listWidth="200" + converter="IntegerOptionItemConverter"> + rich:column + <h:outputText value="#{resourceNameItem.displayName}"></h:outputText> + </rich:column> + </rich:orderingList> + </h:panelGrid> + </rich:panel> + + <rich:panel rendered="#{not empty param.opId and ResourceGroupUIBean.permissions.control}" styleClass="BlockContent"> + <f:facet name="header"> + <h:outputText value="Operation Schedule Details"/> + </f:facet> + <!-- bug in rich:panel renders children even if the panel isn't rendered --> + <onc:operationScheduler scheduleDetails="#{ResourceGroupOperationScheduleUIBean.operationDetails}"/> + </rich:panel> + + <rich:panel rendered="#{not empty param.opId and ResourceGroupUIBean.permissions.control}" styleClass="BlockContent"> + <f:facet name="header"> + <h:outputText value="Other Options"/> + </f:facet> + + <!-- Notes are for user use only, displayed back in the History view --> + <!-- The Notes value must fit into the Quartz job_details.description field. Quartz does not protect against SQL errors --> + <h:panelGrid columns="3"> + <h:outputLabel for="timeout" value="Timeout:" /> + <h:inputText id="timeout" value="#{ResourceGroupOperationDefinitionUIBean.timeout}" /> + <h:outputText value="The maximum time this operation is given to finish, in seconds" /> + + <h:outputLabel for="haltOnFailure" value="Halt On Failure:" /> + <h:selectBooleanCheckbox id="haltOnFailure" value="#{ResourceGroupOperationDefinitionUIBean.haltOnFailure}" /> + <h:outputText value="If checked, an operation failure will cause the scheduling of the remaining ordered operations to halt" /> + + <h:outputLabel for="notes" value="Notes:" /> + <h:inputText id="notes" maxlength="120" size="40" value="#{ResourceGroupOperationDefinitionUIBean.description}" /> + <h:outputText value="Optional notes, if the operation is scheduled for execution later" /> + </h:panelGrid> + <hr /> + <h:panelGrid columns="1" styleClass="buttons-table" columnClasses="button-cell" + rendered="#{not empty param.opId}"> + <h:commandButton action="#{ResourceGroupOperationScheduleUIBean.schedule}" + value="SCHEDULE" styleClass="buttonmed" + rendered="#{ResourceGroupUIBean.permissions.control}" /> + </h:panelGrid> + </rich:panel> + <br /><br /><br /><br /> + <br /><br /><br /><br /> + </h:form> + + <script type="text/javascript"> + setInputDisabled(document.getElementById('newScheduleForm:haltOnFailure'), true, true); + clickAlreadySelectedElements(); + </script> + + </ui:define> + +</ui:composition> \ No newline at end of file diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/operation/groupOperationSchedules-plain.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/operation/groupOperationSchedules-plain.xhtml new file mode 100644 index 0000000..fbc7c17 --- /dev/null +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/operation/groupOperationSchedules-plain.xhtml @@ -0,0 +1,106 @@ +<ui:composition template="/rhq/group/layout/main-plain.xhtml" + xmlns="http://www.w3.org/1999/xhtml" + xmlns:h="http://java.sun.com/jsf/html" + xmlns:f="http://java.sun.com/jsf/core" + xmlns:ui="http://java.sun.com/jsf/facelets" + xmlns:c="http://java.sun.com/jstl/core" + xmlns:onc="http://jboss.org/on/component" + xmlns:onf="http://jboss.org/on/function" + xmlns:s="http://jboss.com/products/seam/taglib" + xmlns:a4j="https://ajax4jsf.dev.java.net/ajax" + xmlns:rich="http://richfaces.ajax4jsf.org/rich%22%3E + + <ui:define name="content"> + + <!-- ResourceGroup Operation Schedules --> + <h:form id="scheduleForm"> + <input type="hidden" name="groupId" value="${param.groupId}"/> + <input type="hidden" name="category" value="#{param.category}" /> + + <!-- Operation Schedule Table --> + <rich:panel styleClass="BlockContent"> + + <ui:param name="resourceGroupOperationScheduleDataModel" value="#{ResourceGroupOperationScheduleUIBean.dataModel}"/> + <rich:dataTable id="resourceGroupOperationScheduleDataTable" + rows="0" + value="#{resourceGroupOperationScheduleDataModel}" + var="item" + width="100%" + columnsWidth="1%, 30%, 39%, 30%" + styleClass="resources-table" + footerClass="on-pager-footer" + onRowMouseOver="this.style.backgroundColor='#E7E7E7'" + onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"> + + <f:facet name="PageControlView"> + <onc:paginationControl id="NONE" /> + </f:facet> + + <rich:column style="width: 1px;"> + <f:facet name="header"> + <onc:allSelect target="selectedItems" /> + </f:facet> + <onc:select name="selectedItems" value="#{item.jobId}" /> + </rich:column> + + <rich:column rendered="#{param.debug}"> + <f:facet name="header"> + <h:outputText styleClass="headerText" value="Job ID" /> + </f:facet> + <h:commandLink action="#{ResourceGroupOperationScheduleUIBean.selectScheduleToView}"> + <h:outputText value="#{item.jobId}" /> + </h:commandLink> + </rich:column> + + rich:column + <f:facet name="header"> + <h:outputText styleClass="headerText" value="Name" /> + </f:facet> + + <h:outputLink value="/rhq/group/operation/groupOperationScheduleDetails-plain.xhtml" > + <f:param name="groupId" value="#{param.groupId}" /> + <f:param name="jobId" value="#{item.jobId}" /> + <f:param name="category" value="#{param.category}" /> + + <h:outputText value="#{item.operationDisplayName}"/> + </h:outputLink> + </rich:column> + + rich:column + <f:facet name="header"> + <h:outputText styleClass="headerText" value="Notes" /> + </f:facet> + <h:outputText value="#{item.description}" /> + </rich:column> + + rich:column + <f:facet name="header"> + <h:outputText styleClass="headerText" value="User" /> + </f:facet> + <h:outputText value="#{item.subject.name}"/> + </rich:column> + + <f:facet name="footer"> + rich:columnGroup + <rich:column colspan="4" width="100%"> + <onc:selectCommandButton action="#{ResourceGroupOperationScheduleUIBean.unschedule}" + value="UNSCHEDULE" target="selectedItems" + styleClass="on-pager-button buttonsmall" + rendered="#{ResourceGroupUIBean.permissions.control}"/> + <onc:selectCommandButton action="#{ResourceGroupOperationScheduleUIBean.executeNow}" + value="EXECUTE NOW" target="selectedItems" + styleClass="on-pager-button buttonsmall" + low="1" high="1" + rendered="#{ResourceGroupUIBean.permissions.control}"/> + </rich:column> + </rich:columnGroup> + </f:facet> + + </rich:dataTable> + + </rich:panel> + </h:form> + + </ui:define> + +</ui:composition> \ No newline at end of file diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/operation/view-results-map-plain.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/operation/view-results-map-plain.xhtml new file mode 100644 index 0000000..001f5bb --- /dev/null +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/operation/view-results-map-plain.xhtml @@ -0,0 +1,41 @@ +<ui:composition template="/rhq/group/layout/main-plain.xhtml" + xmlns="http://www.w3.org/1999/xhtml" + xmlns:h="http://java.sun.com/jsf/html" + xmlns:f="http://java.sun.com/jsf/core" + xmlns:ui="http://java.sun.com/jsf/facelets" + xmlns:c="http://java.sun.com/jstl/core" + xmlns:onc="http://jboss.org/on/component" + xmlns:onf="http://jboss.org/on/function" + xmlns:s="http://jboss.com/products/seam/taglib" + xmlns:a4j="https://ajax4jsf.dev.java.net/ajax" + xmlns:rich="http://richfaces.ajax4jsf.org/rich%22%3E + + <ui:define name="content"> + + <p> + Below is the #{param.listName}[#{param.listIndex}] item from the results of the + execution of the #{ResourceGroupOperationHistoryDetailsUIBean.history.operationDefinition.displayName} + operation. Click OK to return to the main Operation History Details page. + </p> + + <h:form id="viewOperationResultsMapForm"> + + <input type="hidden" name="id" value="#{ResourceGroupUIBean.id}"/> + + <onc:config configurationDefinition="#{ResourceGroupOperationHistoryDetailsUIBean.results.configurationDefinition}" + configuration="#{ResourceGroupOperationHistoryDetailsUIBean.results.configuration}" + listName="#{param.listName}" + listIndex="#{param.listIndex}" + readOnly="true"/> + + </h:form> + + <h:panelGrid columns="1" styleClass="buttons-table" columnClasses="button-cell"> + <h:panelGroup layout="block"> + <div title="Return to Previous Page" onclick="history.back()" class="buttonmed">OK</div> + </h:panelGroup> + </h:panelGrid> + + </ui:define> + +</ui:composition> \ No newline at end of file
commit 62ce6dd82fc3dae5ca2f46c631256fe2e81014f7 Author: Joseph Marques joseph@redhat.com Date: Thu Aug 12 02:08:23 2010 -0400
implement "plain" scheme using iframed-facelets for unfinished group > alerts tabs
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java index cc5e636..709e304 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java @@ -148,9 +148,6 @@ public class ResourceGroupDetailView extends VLayout implements BookmarkableView // // operationsTab.updateSubTab("History", OperationHistoryView.getResourceHistoryView(resource)); // - // alertsTab.updateSubTab("History", new ResourceAlertHistoryView(resource.getId())); - // alertsTab.updateSubTab("Definitions", AlertDefinitionsView.getResourceView(resource)); - // // eventsTab.updateSubTab("History", EventHistoryView.createResourceHistoryView(resource.getId())); //new FullHTMLPane("/rhq/common/events/history-plain.xhtml?id=" + resource.getId())); // // contentTab.updateSubTab("Deployed", new FullHTMLPane("/rhq/resource/content/view-plain.xhtml?id=" + resource.getId())); @@ -162,6 +159,11 @@ public class ResourceGroupDetailView extends VLayout implements BookmarkableView configurationTab.updateSubTab("History", new FullHTMLPane( "/rhq/group/configuration/history-plain.xhtml?groupId=" + groupId));
+ alertsTab.updateSubTab("History", new FullHTMLPane( + "/rhq/group/alert/listGroupAlertHistory-plain.xhtml?groupId=" + groupId)); + alertsTab.updateSubTab("Definitions", new FullHTMLPane( + "/rhq/group/alert/listGroupAlertDefinitions-plain.xhtml?groupId=" + groupId)); + eventsTab.updateSubTab("History", new FullHTMLPane("/rhq/group/events/history-plain.xhtml?groupId=" + groupId));
// topTabSet.setSelectedTab(selectedTab); diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/alert/listGroupAlertDefinitions-plain.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/alert/listGroupAlertDefinitions-plain.xhtml new file mode 100644 index 0000000..7a677a5 --- /dev/null +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/alert/listGroupAlertDefinitions-plain.xhtml @@ -0,0 +1,126 @@ +<ui:composition template="/rhq/group/layout/main-plain.xhtml" + xmlns="http://www.w3.org/1999/xhtml" + xmlns:h="http://java.sun.com/jsf/html" + xmlns:f="http://java.sun.com/jsf/core" + xmlns:ui="http://java.sun.com/jsf/facelets" + xmlns:c="http://java.sun.com/jstl/core" + xmlns:onc="http://jboss.org/on/component" + xmlns:onf="http://jboss.org/on/function" + xmlns:s="http://jboss.com/products/seam/taglib" + xmlns:a4j="https://ajax4jsf.dev.java.net/ajax" + xmlns:rich="http://richfaces.ajax4jsf.org/rich%22%3E + + <ui:define name="content"> + + <h:form id="alertDefinitionsListForm"> + <input type="hidden" name="groupId" value="${param.groupId}"/> + + <rich:panel styleClass="BlockContent"> + <a4j:keepAlive beanName="ListGroupAlertDefinitionsUIBean"/> + + <ui:param name="alertDefinitionsDataModel" value="#{ListGroupAlertDefinitionsUIBean.dataModel}"/> + <rich:dataTable id="alertDefinitionsDataTable" + rows="#{PageControl.GroupAlertDefinitionsList.pageSize}" + value="#{alertDefinitionsDataModel}" + var="item" + width="100%" + columnsWidth="1%, 25%, 35%, 20%, 19%" + styleClass="resources-table" + footerClass="on-pager-footer" + onRowMouseOver="this.style.backgroundColor='#E7E7E7'" + onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"> + + + <f:facet name="PageControlView"> + <onc:paginationControl id="GroupAlertDefinitionsList" /> + </f:facet> + + rich:column + <f:facet name="header"> + <onc:allSelect target="selectedAlertDefinitions" /> + </f:facet> + + <onc:select name="selectedAlertDefinitions" value="#{item.id}" /> + </rich:column> + + rich:column + <f:facet name="header"> + <onc:sortableColumnHeader sort="a.name"> + <h:outputText styleClass="headerText" value="Name" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputLink value="/alerts/Config.do"> + <f:param name="mode" value="viewRoles"/> + <f:param name="groupId" value="#{param.groupId}"/> + <f:param name="ad" value="#{item.id}"/> + <h:outputText value="#{item.name}" /> + </h:outputLink> + </rich:column> + + rich:column + <f:facet name="header"> + <onc:sortableColumnHeader sort="a.description"> + <h:outputText styleClass="headerText" value="Description" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputText value="#{item.description}"/> + </rich:column> + + rich:column + <f:facet name="header"> + <onc:sortableColumnHeader sort="a.ctime"> + <h:outputText styleClass="headerText" value="Date Created" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputText value="#{item.ctime}"> + <f:converter converterId="UserDateTimeConverter" /> + </h:outputText> + </rich:column> + + rich:column + <f:facet name="header"> + <onc:sortableColumnHeader sort="a.enabled"> + <h:outputText styleClass="headerText" value="Active" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputText value="#{item.enabled}"/> + </rich:column> + + <f:facet name="footer"> + rich:columnGroup + <rich:column colspan="5" width="100%"> + <h:commandButton action="#{ListGroupAlertDefinitionsUIBean.createNewAlertDefinition}" + value="NEW DEFINITION" styleClass="on-pager-button buttonsmall" + rendered="#{ResourceGroupUIBean.permissions.alert}" > + <f:param name="groupId" value="${param.groupId}"/> + <f:param name="mode" value="new"/> + </h:commandButton> + <onc:selectCommandButton action="#{ListGroupAlertDefinitionsUIBean.enableSelectedAlertDefinitions}" + value="ENABLE SELECTED" target="selectedAlertDefinitions" styleClass="on-pager-button buttonsmall" + rendered="#{ResourceGroupUIBean.permissions.alert}" /> + <onc:selectCommandButton action="#{ListGroupAlertDefinitionsUIBean.disableSelectedAlertDefinitions}" + value="DISABLE SELECTED" target="selectedAlertDefinitions" styleClass="on-pager-button buttonsmall" + rendered="#{ResourceGroupUIBean.permissions.alert}" /> + <onc:selectCommandButton action="#{ListGroupAlertDefinitionsUIBean.deleteSelectedAlertDefinitions}" + value="DELETE SELECTED" target="selectedAlertDefinitions" styleClass="on-pager-button buttonsmall" + rendered="#{ResourceGroupUIBean.permissions.alert}" /> + + <ui:param name="paginationDataTableName" value="alertDefinitionsDataTable"/> + <ui:param name="paginationDataModel" value="#{alertDefinitionsDataModel}"/> + <ui:param name="paginationPageControl" value="#{PageControl.GroupAlertDefinitionsList}"/> + <ui:include src="/rhq/resource/include/pagination-plain.xhtml"/> + </rich:column> + </rich:columnGroup> + </f:facet> + + </rich:dataTable> + + </rich:panel> + </h:form> + + </ui:define> +</ui:composition> \ No newline at end of file diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/alert/listGroupAlertHistory-plain.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/alert/listGroupAlertHistory-plain.xhtml new file mode 100644 index 0000000..00aca9b --- /dev/null +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/alert/listGroupAlertHistory-plain.xhtml @@ -0,0 +1,177 @@ +<ui:composition template="/rhq/group/layout/main-plain.xhtml" + xmlns="http://www.w3.org/1999/xhtml" + xmlns:h="http://java.sun.com/jsf/html" + xmlns:f="http://java.sun.com/jsf/core" + xmlns:ui="http://java.sun.com/jsf/facelets" + xmlns:c="http://java.sun.com/jstl/core" + xmlns:onc="http://jboss.org/on/component" + xmlns:onf="http://jboss.org/on/function" + xmlns:s="http://jboss.com/products/seam/taglib" + xmlns:a4j="https://ajax4jsf.dev.java.net/ajax" + xmlns:rich="http://richfaces.ajax4jsf.org/rich%22%3E + + <ui:define name="content"> + + <h:form id="alertHistoryForm"> + <input type="hidden" name="groupId" value="${param.groupId}"/> + + <rich:panel styleClass="BlockContent"> + + <h:panelGrid columns="4" cellspacing="3"> + <h:outputLabel for="alertDefinitionFilter" value="Group Alert Definition Filter: " /> + <h:selectOneMenu id="alertDefinitionFilter" value="#{ListGroupAlertHistoryUIBean.alertDefinitionFilter}" + style="width: 300px;"> + <a4j:support event="onchange" + reRender="alertHistoryDataTable, alertHistoryDataTableScroller, dateErrors" + actionListener="#{ListGroupAlertHistoryUIBean.clearDataModel}" /> + + <f:selectItems value="#{ListGroupAlertHistoryUIBean.alertDefinitionSelectItems}"/> + </h:selectOneMenu> + rich:spacer/ + rich:spacer/ + + <h:outputLabel for="alertPriorityFilter" value="Alert Priority Filter: " /> + <h:selectOneMenu id="alertPriorityFilter" value="#{ListGroupAlertHistoryUIBean.alertPriorityFilter}" + style="width: 300px;"> + <a4j:support event="onchange" + reRender="alertHistoryDataTable, alertHistoryDataTableScroller, dateErrors" + actionListener="#{ListGroupAlertHistoryUIBean.clearDataModel}" /> + + <f:selectItems value="#{ListGroupAlertHistoryUIBean.alertPrioritySelectItems}"/> + </h:selectOneMenu> + rich:spacer/ + rich:spacer/ + + <h:outputLabel for="dateFilter" value="Date Filter: " /> + <h:inputText id="dateFilter" value="#{ListGroupAlertHistoryUIBean.dateFilter}" + onkeypress="return ignoreEnterKey(event);" + style="width: 300px;" /> + <a4j:commandButton value="GO" + reRender="alertHistoryDataTable, alertHistoryDataTableScroller, dateErrors" + actionListener="#{ListGroupAlertHistoryUIBean.clearDataModel}" + styleClass="buttonmed"> + <s:defaultAction /> + </a4j:commandButton> + <h:outputText id="dateErrors" value="#{ListGroupAlertHistoryUIBean.dateErrors}" /> + </h:panelGrid> + + <br/> + + <ui:param name="alertHistoryDataModel" value="#{ListGroupAlertHistoryUIBean.dataModel}"/> + <rich:dataTable id="alertHistoryDataTable" + rows="#{PageControl.GroupAlertHistoryList.pageSize}" + value="#{alertHistoryDataModel}" + var="item" + width="100%" + columnsWidth="1%, 20%, 20%, 20%, 30%, 9%" + styleClass="resources-table" + footerClass="on-pager-footer" + onRowMouseOver="this.style.backgroundColor='#E7E7E7'" + onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"> + + <f:facet name="PageControlView"> + <onc:paginationControl id="GroupAlertHistoryList" /> + </f:facet> + + rich:column + <f:facet name="header"> + <onc:allSelect target="selectedAlerts" /> + </f:facet> + + <onc:select name="selectedAlerts" value="#{item.alert.id}" /> + </rich:column> + + rich:column + <f:facet name="header"> + <onc:sortableColumnHeader sort="a.alertDefinition.priority"> + <h:outputText styleClass="headerText" value="Priority" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:graphicImage value="/images/icons/Flag_blue_16.png" rendered="#{item.alert.alertDefinition.priority.name == 'LOW'}"/> + <h:graphicImage value="/images/icons/Flag_yellow_16.png" rendered="#{item.alert.alertDefinition.priority.name == 'MEDIUM'}"/> + <h:graphicImage value="/images/icons/Flag_red_16.png" rendered="#{item.alert.alertDefinition.priority.name == 'HIGH'}"/> + + <h:outputText value="#{item.alert.alertDefinition.priority.name}"/> + </rich:column> + + rich:column + <f:facet name="header"> + <onc:sortableColumnHeader sort="a.ctime"> + <h:outputText styleClass="headerText" value="Date Created" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputLink value="/alerts/Alerts.do"> + <f:param name="mode" value="viewAlert" /> + <f:param name="id" value="#{item.alert.alertDefinition.resource.id}"/> + <f:param name="a" value="#{item.alert.id}" /> + <h:outputText value="#{item.alert.ctime}"> + <f:converter converterId="UserDateTimeConverter" /> + </h:outputText> + </h:outputLink> + </rich:column> + + rich:column + <f:facet name="header"> + <onc:sortableColumnHeader sort="a.alertDefinition.name"> + <h:outputText styleClass="headerText" value="Alert Definition" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputLink value="/alerts/Config.do"> + <f:param name="mode" value="viewRoles"/> + <f:param name="id" value="#{item.alert.alertDefinition.resource.id}"/> + <f:param name="ad" value="#{item.alert.alertDefinition.id}"/> + <h:outputText value="#{item.alert.alertDefinition.name}" /> + </h:outputLink> + </rich:column> + + rich:column + <f:facet name="header"> + <h:outputText styleClass="headerText" value="Alert Condition" /> + </f:facet> + <h:outputText value="#{item.conditionText}" /> + </rich:column> + + rich:column + <f:facet name="header"> + <h:outputText styleClass="headerText" value="Actual Value" /> + </f:facet> + <h:outputText value="#{item.conditionValue}" /> + </rich:column> + + rich:column + <f:facet name="header"> + <h:outputText styleClass="headerText" value="Recovery Info" /> + </f:facet> + <h:outputText value="#{item.recoveryInfo}" /> + </rich:column> + + <f:facet name="footer"> + rich:columnGroup + <rich:column colspan="7" width="100%"> + <onc:selectCommandButton action="#{ListGroupAlertHistoryUIBean.deleteSelectedAlerts}" + value="DELETE SELECTED" target="selectedAlerts" styleClass="on-pager-button buttonsmall" + rendered="#{ResourceGroupUIBean.permissions.alert}" /> + <h:commandButton action="#{ListGroupAlertHistoryUIBean.purgeAllAlerts}" + value="PURGE ALL" styleClass="on-pager-button buttonsmall" + rendered="#{ResourceGroupUIBean.permissions.alert}" /> + + <ui:param name="paginationDataTableName" value="alertHistoryDataTable"/> + <ui:param name="paginationDataModel" value="#{alertHistoryDataModel}"/> + <ui:param name="paginationPageControl" value="#{PageControl.GroupAlertHistoryList}"/> + <ui:include src="/rhq/resource/include/pagination-plain.xhtml"/> + </rich:column> + </rich:columnGroup> + </f:facet> + + </rich:dataTable> + + <a4j:keepAlive beanName="ListGroupAlertHistoryUIBean"/> + + </rich:panel> + </h:form> + + </ui:define> +</ui:composition> \ No newline at end of file
commit 79d8e1bb6ca9b8cb725aa2c40566ce1666d1a2a1 Author: Joseph Marques joseph@redhat.com Date: Thu Aug 12 02:07:41 2010 -0400
implement "plain" scheme using iframed-facelets for unfinished group > configuration tabs
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java index a1f46fc..cc5e636 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java @@ -148,9 +148,6 @@ public class ResourceGroupDetailView extends VLayout implements BookmarkableView // // operationsTab.updateSubTab("History", OperationHistoryView.getResourceHistoryView(resource)); // - // configurationTab.updateSubTab("Current", new ResourceConfigurationEditView(resource)); - // configurationTab.updateSubTab("History", ConfigurationHistoryView.getHistoryOf(resource.getId())); - // // alertsTab.updateSubTab("History", new ResourceAlertHistoryView(resource.getId())); // alertsTab.updateSubTab("Definitions", AlertDefinitionsView.getResourceView(resource)); // @@ -160,6 +157,10 @@ public class ResourceGroupDetailView extends VLayout implements BookmarkableView // contentTab.updateSubTab("New", new FullHTMLPane("/rhq/resource/content/deploy-plain.xhtml?id=" + resource.getId())); // contentTab.updateSubTab("Subscriptions", new FullHTMLPane("/rhq/resource/content/subscription-plain.xhtml?id=" + resource.getId())); // contentTab.updateSubTab("History", new FullHTMLPane("/rhq/resource/content/history-plain.xhtml?id=" + resource.getId())); + configurationTab.updateSubTab("Current", new FullHTMLPane( + "/rhq/group/configuration/viewCurrent-plain.xhtml?groupId=" + groupId)); + configurationTab.updateSubTab("History", new FullHTMLPane( + "/rhq/group/configuration/history-plain.xhtml?groupId=" + groupId));
eventsTab.updateSubTab("History", new FullHTMLPane("/rhq/group/events/history-plain.xhtml?groupId=" + groupId));
diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/configuration/group/EditGroupResourceConfigurationUIBean.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/configuration/group/EditGroupResourceConfigurationUIBean.java index 1ba9b78..a1c2c45 100644 --- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/configuration/group/EditGroupResourceConfigurationUIBean.java +++ b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/configuration/group/EditGroupResourceConfigurationUIBean.java @@ -90,7 +90,7 @@ public class EditGroupResourceConfigurationUIBean extends AbstractGroupResourceC "Failed to schedule group Resource Configuration update - cause: " + e); viewId = VIEW_ID; } - this.redirect.setViewId(viewId); + this.redirect.setViewId(getViewId(viewId)); this.redirect.execute(); }
@@ -100,7 +100,7 @@ public class EditGroupResourceConfigurationUIBean extends AbstractGroupResourceC @End public void cancel() { FacesContextUtility.addMessage(FacesMessage.SEVERITY_INFO, "Edit canceled."); - this.redirect.setViewId(ViewGroupResourceConfigurationUIBean.VIEW_ID); + this.redirect.setViewId(getViewId(ViewGroupResourceConfigurationUIBean.VIEW_ID)); this.redirect.execute(); return; } @@ -111,8 +111,17 @@ public class EditGroupResourceConfigurationUIBean extends AbstractGroupResourceC @End public void reset() { FacesContextUtility.addMessage(FacesMessage.SEVERITY_INFO, "All properties reset to original values."); - this.redirect.setViewId(VIEW_ID); + this.redirect.setViewId(getViewId(VIEW_ID)); this.redirect.execute(); return; } + + private String getViewId(String toViewId) { + String currentViewId = FacesContextUtility.getViewId(); + int currentPlainIndex = currentViewId.indexOf("-plain.xhtml"); + if (currentPlainIndex != -1) { + toViewId = toViewId.substring(0, toViewId.length() - 6) + "-plain.xhtml"; + } + return toViewId; + } } diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/configuration/group/ViewGroupResourceConfigurationUIBean.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/configuration/group/ViewGroupResourceConfigurationUIBean.java index 4839095..62d17d0 100644 --- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/configuration/group/ViewGroupResourceConfigurationUIBean.java +++ b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/configuration/group/ViewGroupResourceConfigurationUIBean.java @@ -18,15 +18,16 @@ */ package org.rhq.enterprise.gui.configuration.group;
-import org.rhq.enterprise.gui.legacy.ParamConstants; - import org.jboss.seam.ScopeType; -import org.jboss.seam.faces.Redirect; import org.jboss.seam.annotations.Create; -import org.jboss.seam.annotations.Name; -import org.jboss.seam.annotations.Scope; import org.jboss.seam.annotations.End; import org.jboss.seam.annotations.In; +import org.jboss.seam.annotations.Name; +import org.jboss.seam.annotations.Scope; +import org.jboss.seam.faces.Redirect; + +import org.rhq.core.gui.util.FacesContextUtility; +import org.rhq.enterprise.gui.legacy.ParamConstants;
/** * A POJO Seam component that handles loading Resource configurations across a compatible Group in view-only mode. @@ -53,8 +54,17 @@ public class ViewGroupResourceConfigurationUIBean extends AbstractGroupResourceC @End public void edit() { this.redirect.setParameter(ParamConstants.GROUP_ID_PARAM, getGroup().getId()); - this.redirect.setViewId(EditGroupResourceConfigurationUIBean.VIEW_ID); + this.redirect.setViewId(getViewId(EditGroupResourceConfigurationUIBean.VIEW_ID)); this.redirect.execute(); return; } + + private String getViewId(String toViewId) { + String currentViewId = FacesContextUtility.getViewId(); + int currentPlainIndex = currentViewId.indexOf("-plain.xhtml"); + if (currentPlainIndex != -1) { + toViewId = toViewId.substring(0, toViewId.length() - 6) + "-plain.xhtml"; + } + return toViewId; + } } \ No newline at end of file diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/configuration/addSimple-plain.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/configuration/addSimple-plain.xhtml new file mode 100644 index 0000000..6fad880 --- /dev/null +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/configuration/addSimple-plain.xhtml @@ -0,0 +1,45 @@ +<ui:composition template="/rhq/group/layout/main-plain.xhtml" + xmlns="http://www.w3.org/1999/xhtml" + xmlns:h="http://java.sun.com/jsf/html" + xmlns:f="http://java.sun.com/jsf/core" + xmlns:ui="http://java.sun.com/jsf/facelets" + xmlns:c="http://java.sun.com/jstl/core" + xmlns:onc="http://jboss.org/on/component" + xmlns:onf="http://jboss.org/on/function" + xmlns:s="http://jboss.com/products/seam/taglib" + xmlns:a4j="https://ajax4jsf.dev.java.net/ajax" + xmlns:rich="http://richfaces.ajax4jsf.org/rich%22%3E + + <ui:define name="content"> + + <p> + Enter a name and a value for the property to be added to the map '#{param.mapName}', + then click OK to return to the main Edit page for the '#{EditGroupResourceConfigurationUIBean.group.name}' Configuration. + </p> + + <h:form id="addNewOpenMapMemberPropertyForm"> + + <input type="hidden" name="groupId" value="#{EditGroupResourceConfigurationUIBean.group.id}"/> + <input type="hidden" name="mapName" value="#{param.mapName}"/> + + <h:panelGrid columns="2" width="400"> + <h:panelGroup> + Name: <h:inputText value="#{GroupResourceConfigurationAddNewOpenMapMemberPropertyUIBean.propertyName}"/> + </h:panelGroup> + <h:panelGroup> + Value: <h:inputText value="#{GroupResourceConfigurationAddNewOpenMapMemberPropertyUIBean.propertyValue}"/> + </h:panelGroup> + </h:panelGrid> + + <h:panelGrid columns="2" styleClass="buttons-table" columnClasses="button-cell"> + <h:commandButton value="OK" action="#{GroupResourceConfigurationAddNewOpenMapMemberPropertyUIBean.addProperty}" + alt="Click to Add Property" styleClass="buttonmed"/> + <h:commandButton value="CANCEL" action="#{GroupResourceConfigurationAddNewOpenMapMemberPropertyUIBean.cancel}" + immediate="true" alt="Click to Cancel" styleClass="buttonmed"/> + </h:panelGrid> + + </h:form> + + </ui:define> + +</ui:composition> \ No newline at end of file diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/configuration/editCurrent-plain.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/configuration/editCurrent-plain.xhtml new file mode 100644 index 0000000..cd365bd --- /dev/null +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/configuration/editCurrent-plain.xhtml @@ -0,0 +1,69 @@ +<ui:composition template="/rhq/group/layout/main-plain.xhtml" + xmlns="http://www.w3.org/1999/xhtml" + xmlns:h="http://java.sun.com/jsf/html" + xmlns:f="http://java.sun.com/jsf/core" + xmlns:ui="http://java.sun.com/jsf/facelets" + xmlns:c="http://java.sun.com/jstl/core" + xmlns:onc="http://jboss.org/on/component" + xmlns:onf="http://jboss.org/on/function" + xmlns:s="http://jboss.com/products/seam/taglib" + xmlns:a4j="https://ajax4jsf.dev.java.net/ajax" + xmlns:rich="http://richfaces.ajax4jsf.org/rich%22%3E + + <ui:define name="content"> + + <h:outputText rendered="#{not ResourceGroupUIBean.permissions.configureRead}" + value="You do not have permissions to view configuration data for this group" /> + + <h:form id="configSetForm" onsubmit="prepareInputsForSubmission(this)" + rendered="#{ResourceGroupUIBean.permissions.configureRead and EditGroupResourceConfigurationUIBean.configurationSet ne null}"> + + <h:outputText rendered="#{not ResourceGroupUIBean.permissions.configureWrite}" + value="You do not have permissions to change the configuration of this group"/> + + <input type="hidden" name="groupId" value="#{param.groupId}"/> + + <h:panelGrid columns="3" styleClass="buttons-table" columnClasses="button-cell" + rendered="${ResourceGroupUIBean.permissions.configureWrite}"> + <h:commandButton type="submit" action="#{EditGroupResourceConfigurationUIBean.updateConfigurations}" + value="SAVE" title="Click to Save Changes" + styleClass="buttonmed"/> + <h:commandButton type="submit" immediate="true" + action="#{EditGroupResourceConfigurationUIBean.reset}" + value="RESET" title="Click to Reset All Properties to Their Original Values" + styleClass="buttonmed"/> + <h:commandButton type="submit" immediate="true" + action="#{EditGroupResourceConfigurationUIBean.cancel}" + value="CANCEL" title="Click to Cancel Edits and Return to View Page" + styleClass="buttonmed"/> + </h:panelGrid> + + <a4j:region selfRendered="false"> + <a4j:outputPanel layout="block" ajaxRendered="true" keepTransient="true"> + <onc:configSet id="rhq_configSet" + configurationSet="#{EditGroupResourceConfigurationUIBean.configurationSet}"/> + </a4j:outputPanel> + </a4j:region> + + <h:panelGrid columns="3" styleClass="buttons-table" columnClasses="button-cell" + rendered="${ResourceGroupUIBean.permissions.configureWrite}"> + <h:commandButton type="submit" action="#{EditGroupResourceConfigurationUIBean.updateConfigurations}" + value="SAVE" title="Click to Save Changes" + styleClass="buttonmed"/> + <h:commandButton type="submit" immediate="true" + action="#{EditGroupResourceConfigurationUIBean.reset}" + value="RESET" title="Click to Reset All Properties to Their Original Values" + styleClass="buttonmed"/> + <h:commandButton type="submit" immediate="true" + action="#{EditGroupResourceConfigurationUIBean.cancel}" + value="CANCEL" title="Click to Cancel Edits and Return to View Page" + styleClass="buttonmed"/> + </h:panelGrid> + + </h:form> + + ui:remove<!--<a4j:log popup="false" level="ALL" style="width: 800px; height: 300px;"/>--></ui:remove> + + </ui:define> + +</ui:composition> \ No newline at end of file diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/configuration/history-plain.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/configuration/history-plain.xhtml new file mode 100644 index 0000000..566d95b --- /dev/null +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/configuration/history-plain.xhtml @@ -0,0 +1,281 @@ +<ui:composition template="/rhq/group/layout/main-plain.xhtml" + xmlns="http://www.w3.org/1999/xhtml" + xmlns:h="http://java.sun.com/jsf/html" + xmlns:f="http://java.sun.com/jsf/core" + xmlns:ui="http://java.sun.com/jsf/facelets" + xmlns:c="http://java.sun.com/jstl/core" + xmlns:onc="http://jboss.org/on/component" + xmlns:onf="http://jboss.org/on/function" + xmlns:s="http://jboss.com/products/seam/taglib" + xmlns:a4j="https://ajax4jsf.dev.java.net/ajax" + xmlns:rich="http://richfaces.ajax4jsf.org/rich%22%3E + + <ui:define name="content"> + + <h:outputText rendered="#{not ResourceGroupUIBean.permissions.configureRead}" + value="You do not have permissions to view configuration data for this group" /> + + <h:form id="historyForm" rendered="#{ResourceGroupUIBean.permissions.configureRead}"> + <input type="hidden" name="groupId" value="#{param.groupId}"/> + <input type="hidden" name="arcuId" value="#{param.arcuId}"/> + <input type="hidden" name="mode" value="#{param.mode}"/> + + rich:panel + <f:facet name="header"> + <h:outputText value="Group Configuration Update History"/> + </f:facet> + + <ui:param name="groupResourceConfigUpdateHistoryDataModel" value="#{GroupResourceConfigurationHistoryUIBean.dataModel}"/> + <rich:dataTable id="groupResourceConfigUpdateHistoryDataTable" + rows="#{PageControl.GroupResourceConfigurationUpdateHistory.pageSize}" + value="#{groupResourceConfigUpdateHistoryDataModel}" + var="item" + width="100%" + columnsWidth="1%, 9%, 25%, 25%, 10%, 10%, 20%" + styleClass="resources-table" + footerClass="on-pager-footer" + onRowMouseOver="this.style.backgroundColor='#E7E7E7'" + onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"> + + <f:facet name="PageControlView"> + <onc:paginationControl id="GroupResourceConfigurationUpdateHistory" /> + </f:facet> + + rich:column + <f:facet name="header"> + <onc:allSelect target="selectedUpdates" /> + </f:facet> + + <onc:select name="selectedUpdates" value="#{item.id}" /> + </rich:column> + + rich:column + <f:facet name="header"> + <onc:sortableColumnHeader sort="arcu.id"> + <h:outputText styleClass="headerText" value="Version" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputText value="#{item.id}"/> + </rich:column> + + rich:column + <f:facet name="header"> + <onc:sortableColumnHeader sort="arcu.createdTime"> + <h:outputText styleClass="headerText" value="Date Created" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputText value="#{item.createdTime}"> + <f:converter converterId="UserDateTimeConverter" /> + </h:outputText> + </rich:column> + + rich:column + <f:facet name="header"> + <onc:sortableColumnHeader sort="arcu.modifiedTime"> + <h:outputText styleClass="headerText" value="Last Updated" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputText value="#{item.modifiedTime}"> + <f:converter converterId="UserDateTimeConverter" /> + </h:outputText> + </rich:column> + + rich:column + <f:facet name="header"> + <onc:sortableColumnHeader sort="arcu.status"> + <h:outputText styleClass="headerText" value="Status" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputText value="#{item.status}"/> + </rich:column> + + rich:column + <f:facet name="header"> + <onc:sortableColumnHeader sort="arcu.subjectName"> + <h:outputText styleClass="headerText" value="User" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputText value="#{item.subjectName}" /> + </rich:column> + + rich:column + <f:facet name="header"> + <h:outputText styleClass="headerText" value="Action" /> + </f:facet> + + <h:outputLink value="/rhq/group/configuration/history-plain.xhtml"> + <f:param name="groupId" value="#{param.groupId}" /> + <f:param name="arcuId" value="#{item.id}" /> + <f:param name="mode" value="group" /> + <h:outputText value="View Group Update" /> + </h:outputLink> + ui:remove + <br /> + <h:outputLink value="/rhq/group/configuration/history-plain.xhtml"> + <f:param name="groupId" value="#{param.groupId}" /> + <f:param name="arcuId" value="#{item.id}" /> + <f:param name="mode" value="details" /> + <h:outputText value="View Member Updates" /> + </h:outputLink> + </ui:remove> + + </rich:column> + + <f:facet name="footer"> + rich:columnGroup + <rich:column colspan="7" width="100%"> + <onc:selectCommandButton action="#{GroupResourceConfigurationHistoryUIBean.deleteSelectedUpdates}" + rendered="${ResourceGroupUIBean.permissions.configureWrite}" + value="DELETE SELECTED" target="selectedUpdates" + styleClass="on-pager-button buttonsmall" /> + + <ui:param name="paginationDataTableName" value="groupResourceConfigUpdateHistoryDataTable"/> + <ui:param name="paginationDataModel" value="#{groupResourceConfigUpdateHistoryDataModel}"/> + <ui:param name="paginationPageControl" value="#{PageControl.GroupResourceConfigurationUpdateHistory}"/> + <ui:include src="/rhq/resource/include/pagination-plain.xhtml"/> + </rich:column> + </rich:columnGroup> + </f:facet> + + </rich:dataTable> + + </rich:panel> + </h:form> + + <rich:panel rendered="#{ResourceGroupUIBean.permissions.configureRead and param.mode eq 'group' and not empty param.arcuId}"> + <f:facet name="header"> + <h:outputText value="Group Configuration Update Request"/> + </f:facet> + <h:form id="configSetForm"> + <input type="hidden" name="groupId" value="#{param.groupId}"/> + <input type="hidden" name="arcuId" value="#{param.arcuId}"/> + <input type="hidden" name="mode" value="#{param.mode}"/> + + <a4j:region selfRendered="false"> + <a4j:outputPanel layout="block" ajaxRendered="true" keepTransient="true"> + <onc:configSet id="rhq_configSet" + configurationSet="#{GroupResourceConfigurationHistoryDetailsUIBean.configurationSet}" + readOnly="true"/> + </a4j:outputPanel> + </a4j:region> + </h:form> + </rich:panel> + + <rich:panel rendered="#{ResourceGroupUIBean.permissions.configureRead and param.mode eq 'details' and not empty param.arcuId}"> + <f:facet name="header"> + <h:outputText value="Individual Resource Configuration Updates"/> + </f:facet> + + <h:form id="resourceConfigurationUpdateDetailsForm"> + <input type="hidden" name="groupId" value="#{param.groupId}"/> + <input type="hidden" name="arcuId" value="#{param.arcuId}"/> + <input type="hidden" name="mode" value="#{param.mode}"/> + + <ui:param name="groupResourceConfigurationDetailsDataModel" value="#{GroupResourceConfigurationHistoryDetailsUIBean.dataModel}"/> + <rich:dataTable id="groupResourceConfigurationDetailsDataTable" + rows="#{PageControl.GroupResourceConfigurationUpdateDetails.pageSize}" + value="#{groupResourceConfigurationDetailsDataModel}" + var="item" + width="100%" + columnsWidth="1%, 20%, 20%, 20%, 30%, 9%" + styleClass="resources-table" + footerClass="on-pager-footer" + onRowMouseOver="this.style.backgroundColor='#E7E7E7'" + onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"> + + <f:facet name="PageControlView"> + <onc:paginationControl id="GroupResourceConfigurationUpdateDetails" /> + </f:facet> + + rich:column + <f:facet name="header"> + <onc:sortableColumnHeader sort="cu.resource.name"> + <h:outputText styleClass="headerText" value="Resource" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputText value="#{item.resourceName}"/> + </rich:column> + + rich:column + <f:facet name="header"> + <onc:sortableColumnHeader sort="cu.status"> + <h:outputText styleClass="headerText" value="Status" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputText value="#{item.status}"/> + </rich:column> + + rich:column + <f:facet name="header"> + <h:outputText styleClass="headerText" value="Details" /> + </f:facet> + + <h:outputText value="#{item.errorMessage}"/> + </rich:column> + + rich:column + <f:facet name="header"> + <onc:sortableColumnHeader sort="cu.createdTime"> + <h:outputText styleClass="headerText" value="Date Created" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputLink value="/rhq/resource/configuration/history-plain.xhtml"> + <f:param name="id" value="#{item.resourceId}" /> + <f:param name="configId" value="#{item.id}" /> + <h:outputText value="#{item.createdTime}"> + <f:converter converterId="UserDateTimeConverter" /> + </h:outputText> + </h:outputLink> + </rich:column> + + rich:column + <f:facet name="header"> + <onc:sortableColumnHeader sort="cu.modifiedTime"> + <h:outputText styleClass="headerText" value="Last Updated" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputText value="#{item.modifiedTime}"> + <f:converter converterId="UserDateTimeConverter" /> + </h:outputText> + </rich:column> + + rich:column + <f:facet name="header"> + <onc:sortableColumnHeader sort="cu.subjectName"> + <h:outputText styleClass="headerText" value="User" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputText value="#{item.subjectName}" /> + </rich:column> + + <f:facet name="footer"> + rich:columnGroup + <rich:column colspan="6" width="100%"> + <ui:param name="paginationDataTableName" value="groupResourceConfigurationDetailsDataTable"/> + <ui:param name="paginationDataModel" value="#{groupResourceConfigurationDetailsDataModel}"/> + <ui:param name="paginationPageControl" value="#{PageControl.GroupResourceConfigurationUpdateDetails}"/> + <ui:include src="/rhq/resource/include/pagination-plain.xhtml"/> + </rich:column> + </rich:columnGroup> + </f:facet> + + </rich:dataTable> + + <a4j:keepAlive beanName="GroupResourceConfigurationHistoryUIBean"/> + <a4j:keepAlive beanName="GroupResourceConfigurationHistoryDetailsUIBean"/> + </h:form> + </rich:panel> + + </ui:define> + +</ui:composition> \ No newline at end of file diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/configuration/viewCurrent-plain.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/configuration/viewCurrent-plain.xhtml new file mode 100644 index 0000000..97184d3 --- /dev/null +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/configuration/viewCurrent-plain.xhtml @@ -0,0 +1,55 @@ +<ui:composition template="/rhq/group/layout/main-plain.xhtml" + xmlns="http://www.w3.org/1999/xhtml" + xmlns:h="http://java.sun.com/jsf/html" + xmlns:f="http://java.sun.com/jsf/core" + xmlns:ui="http://java.sun.com/jsf/facelets" + xmlns:c="http://java.sun.com/jstl/core" + xmlns:onc="http://jboss.org/on/component" + xmlns:onf="http://jboss.org/on/function" + xmlns:s="http://jboss.com/products/seam/taglib" + xmlns:a4j="https://ajax4jsf.dev.java.net/ajax" + xmlns:rich="http://richfaces.ajax4jsf.org/rich%22%3E + + <ui:define name="content"> + + <h:outputText rendered="#{not ResourceGroupUIBean.permissions.configureRead}" + value="You do not have permissions to view configuration data for this group" /> + + <h:form id="configSetForm" rendered="#{ResourceGroupUIBean.permissions.configureRead and ViewGroupResourceConfigurationUIBean.configurationSet ne null}"> + + <input type="hidden" name="groupId" value="#{ViewGroupResourceConfigurationUIBean.group.id}" /> + + <h:outputText rendered="#{not ResourceGroupUIBean.permissions.configureWrite}" + value="You do not have permissions to change the configuration of this group"/> + + <!-- edit button at top of config --> + <h:panelGrid columns="1" styleClass="buttons-table" columnClasses="button-cell"> + <h:commandButton value="EDIT" action="#{ViewGroupResourceConfigurationUIBean.edit}" + title="Edit this Compatible Group Configuration" + rendered="${ResourceGroupUIBean.permissions.configureWrite}" + styleClass="buttonmed"/> + </h:panelGrid> + + <a4j:region selfRendered="false"> + <a4j:outputPanel layout="block" ajaxRendered="true" keepTransient="true"> + <onc:configSet id="rhq_configSet" + configurationSet="#{ViewGroupResourceConfigurationUIBean.configurationSet}" + readOnly="true"/> + </a4j:outputPanel> + </a4j:region> + + <!-- edit button at bottom of config --> + <h:panelGrid columns="1" styleClass="buttons-table" columnClasses="button-cell"> + <h:commandButton value="EDIT" action="#{ViewGroupResourceConfigurationUIBean.edit}" + title="Edit this Compatible Group Configuration" + rendered="${ResourceGroupUIBean.permissions.configureWrite}" + styleClass="buttonmed"/> + </h:panelGrid> + + </h:form> + + ui:remove<!--<a4j:log popup="false" level="ALL" style="width: 800px; height: 300px;"/>--></ui:remove> + + </ui:define> + +</ui:composition> \ No newline at end of file
commit ba1bfcc92fbd25264c50513436dcade710e87e4d Author: Joseph Marques joseph@redhat.com Date: Thu Aug 12 02:05:22 2010 -0400
reformat, cosmetic
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java index 3363ea8..a1f46fc 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java @@ -134,8 +134,6 @@ public class ResourceGroupDetailView extends VLayout implements BookmarkableView int groupId = this.groupComposite.getResourceGroup().getId();
monitoringTab.updateSubTab("Graphs", new FullHTMLPane("/rhq/group/monitor/graphs-plain.xhtml?groupId=" - inventoryTab.updateSubTab("Overview", new OverviewView(this.groupComposite)); - inventoryTab.updateSubTab("Members", ResourceSearchView.getMembersOf(this.groupComposite.getResourceGroup().getId())); + groupId)); monitoringTab.updateSubTab("Tables", new FullHTMLPane("/rhq/group/monitor/tables-plain.xhtml?groupId=" + groupId)); @@ -143,6 +141,9 @@ public class ResourceGroupDetailView extends VLayout implements BookmarkableView + groupId)); monitoringTab.updateSubTab("Call Time", new FullHTMLPane("/rhq/group/monitor/response-plain.xhtml?groupId=" + groupId)); + + inventoryTab.updateSubTab("Overview", new OverviewView(this.groupComposite)); + inventoryTab.updateSubTab("Members", ResourceSearchView.getMembersOf(groupId)); // inventoryTab.updateSubTab("Connection Settings", new GroupPluginConfigurationEditView(this.group.getId(), this.group.getResourceType().getId(), ConfigurationEditor.ConfigType.plugin)); // // operationsTab.updateSubTab("History", OperationHistoryView.getResourceHistoryView(resource));
commit 11ebce8b1b6188a2550f8b210d911ea225a355e0 Author: Joseph Marques joseph@redhat.com Date: Thu Aug 12 02:04:44 2010 -0400
implement "plain" scheme using iframed-facelets for unfinished group > events tabs
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java index c2a4f35..3363ea8 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java @@ -160,6 +160,8 @@ public class ResourceGroupDetailView extends VLayout implements BookmarkableView // contentTab.updateSubTab("Subscriptions", new FullHTMLPane("/rhq/resource/content/subscription-plain.xhtml?id=" + resource.getId())); // contentTab.updateSubTab("History", new FullHTMLPane("/rhq/resource/content/history-plain.xhtml?id=" + resource.getId()));
+ eventsTab.updateSubTab("History", new FullHTMLPane("/rhq/group/events/history-plain.xhtml?groupId=" + groupId)); + // topTabSet.setSelectedTab(selectedTab);
updateTabStatus(); diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/events/history-plain.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/events/history-plain.xhtml new file mode 100644 index 0000000..00547cb --- /dev/null +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/events/history-plain.xhtml @@ -0,0 +1,19 @@ +<ui:composition template="/rhq/group/layout/main-plain.xhtml" + xmlns="http://www.w3.org/1999/xhtml" + xmlns:h="http://java.sun.com/jsf/html" + xmlns:f="http://java.sun.com/jsf/core" + xmlns:ui="http://java.sun.com/jsf/facelets" + xmlns:c="http://java.sun.com/jstl/core" + xmlns:onc="http://jboss.org/on/component" + xmlns:onf="http://jboss.org/on/function" + xmlns:s="http://jboss.com/products/seam/taglib" + xmlns:a4j="https://ajax4jsf.dev.java.net/ajax" + xmlns:rich="http://richfaces.ajax4jsf.org/rich%22%3E + + <ui:define name="content"> + + <ui:include src="/rhq/common/events/history-plain.xhtml"/> + + </ui:define> + +</ui:composition> \ No newline at end of file
commit 3cc66b4df2bdfc4252f5e5844412458f3cca4f7d Author: Joseph Marques joseph@redhat.com Date: Thu Aug 12 02:04:13 2010 -0400
implement "plain" scheme using iframed-facelets for unfinished group > monitor tabs
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java index c7fbb97..c2a4f35 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java @@ -36,6 +36,7 @@ import org.rhq.core.domain.resource.group.composite.ResourceGroupComposite; import org.rhq.enterprise.gui.coregui.client.BookmarkableView; import org.rhq.enterprise.gui.coregui.client.CoreGUI; import org.rhq.enterprise.gui.coregui.client.ViewPath; +import org.rhq.enterprise.gui.coregui.client.components.FullHTMLPane; import org.rhq.enterprise.gui.coregui.client.components.tab.TwoLevelTab; import org.rhq.enterprise.gui.coregui.client.components.tab.TwoLevelTabSelectedEvent; import org.rhq.enterprise.gui.coregui.client.components.tab.TwoLevelTabSelectedHandler; @@ -130,16 +131,18 @@ public class ResourceGroupDetailView extends VLayout implements BookmarkableView // FullHTMLPane timelinePane = new FullHTMLPane("/rhq/resource/summary/timeline-plain.xhtml?id=" + resource.getId()); // summaryTab.updateSubTab("Overview", new ResourceOverviewView(resource)); // summaryTab.updateSubTab("Timeline", timelinePane); + int groupId = this.groupComposite.getResourceGroup().getId();
- // monitoringTab.updateSubTab("Graphs", new GraphListView(resource)); // new FullHTMLPane("/rhq/common/monitor/graphs.xhtml?id=" + resource.getId())); - // monitoringTab.updateSubTab("Tables", new FullHTMLPane("/rhq/common/monitor/tables-plain.xhtml?id=" + resource.getId())); - // monitoringTab.updateSubTab("Traits", new FullHTMLPane("/rhq/resource/monitor/traits-plain.xhtml?id=" + resource.getId())); - // monitoringTab.updateSubTab("Availability", new FullHTMLPane("/rhq/resource/monitor/availabilityHistory-plain.xhtml?id=" + resource.getId())); - // monitoringTab.updateSubTab("Schedules", new FullHTMLPane("/rhq/resource/monitor/schedules-plain.xhtml?id=" + resource.getId())); - // monitoringTab.updateSubTab("Call Time", new CallTimeView(resource)); - // + monitoringTab.updateSubTab("Graphs", new FullHTMLPane("/rhq/group/monitor/graphs-plain.xhtml?groupId=" inventoryTab.updateSubTab("Overview", new OverviewView(this.groupComposite)); inventoryTab.updateSubTab("Members", ResourceSearchView.getMembersOf(this.groupComposite.getResourceGroup().getId())); + + groupId)); + monitoringTab.updateSubTab("Tables", new FullHTMLPane("/rhq/group/monitor/tables-plain.xhtml?groupId=" + + groupId)); + monitoringTab.updateSubTab("Schedules", new FullHTMLPane("/rhq/group/monitor/schedules-plain.xhtml?groupId=" + + groupId)); + monitoringTab.updateSubTab("Call Time", new FullHTMLPane("/rhq/group/monitor/response-plain.xhtml?groupId=" + + groupId)); // inventoryTab.updateSubTab("Connection Settings", new GroupPluginConfigurationEditView(this.group.getId(), this.group.getResourceType().getId(), ConfigurationEditor.ConfigType.plugin)); // // operationsTab.updateSubTab("History", OperationHistoryView.getResourceHistoryView(resource)); @@ -235,6 +238,8 @@ public class ResourceGroupDetailView extends VLayout implements BookmarkableView topTabSet.disableTab(eventsTab); }
+ // only enable "Call Time" sub-tab for those that implement it + monitoringTab.setSubTabEnabled("Call Time", typeFacets.contains(ResourceTypeFacet.CALL_TIME)); }
public void onTabSelected(TwoLevelTabSelectedEvent tabSelectedEvent) { diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/monitor/graphs.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/monitor/graphs.xhtml index 89474e1..647d131 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/monitor/graphs.xhtml +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/monitor/graphs.xhtml @@ -1,20 +1,14 @@ -<?xml version="1.0"?> - -<!DOCTYPE html - PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml" +<ui:composition + xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:c="http://java.sun.com/jstl/core" - xmlns:rich="http://richfaces.ajax4jsf.org/rich" - xmlns:a4j="https://ajax4jsf.dev.java.net/ajax" xmlns:onc="http://jboss.org/on/component" - xmlns:onf="http://jboss.org/on/function%22%3E - -ui:composition + xmlns:onf="http://jboss.org/on/function" + xmlns:s="http://jboss.com/products/seam/taglib" + xmlns:a4j="https://ajax4jsf.dev.java.net/ajax" + xmlns:rich="http://richfaces.ajax4jsf.org/rich%22%3E
<table border="0" cellpadding="0" cellspacing="0" width="100%"> <!-- chart actions --> @@ -49,8 +43,8 @@ <!-- spacer for date/time overlay, so it doesn't overlap metric display range --> <tr class="BlockContent"> <td> - <br /> - <br /> + <br /> + <br /> </td> </tr>
@@ -126,6 +120,4 @@ addWindowOnResizeEvent(maxIndicatorDivHeight); </script>
-</ui:composition> - -</html> +</ui:composition> \ No newline at end of file diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/monitor/graphs-plain.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/monitor/graphs-plain.xhtml new file mode 100644 index 0000000..14f6b68 --- /dev/null +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/monitor/graphs-plain.xhtml @@ -0,0 +1,19 @@ +<ui:composition template="/rhq/group/layout/main-plain.xhtml" + xmlns="http://www.w3.org/1999/xhtml" + xmlns:h="http://java.sun.com/jsf/html" + xmlns:f="http://java.sun.com/jsf/core" + xmlns:ui="http://java.sun.com/jsf/facelets" + xmlns:c="http://java.sun.com/jstl/core" + xmlns:onc="http://jboss.org/on/component" + xmlns:onf="http://jboss.org/on/function" + xmlns:s="http://jboss.com/products/seam/taglib" + xmlns:a4j="https://ajax4jsf.dev.java.net/ajax" + xmlns:rich="http://richfaces.ajax4jsf.org/rich%22%3E + + <ui:define name="content"> + + <ui:include src="/rhq/common/monitor/graphs.xhtml" /> + + </ui:define> + +</ui:composition> \ No newline at end of file diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/monitor/response-plain.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/monitor/response-plain.xhtml new file mode 100644 index 0000000..75a22f5 --- /dev/null +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/monitor/response-plain.xhtml @@ -0,0 +1,15 @@ +<ui:composition + xmlns="http://www.w3.org/1999/xhtml" + xmlns:h="http://java.sun.com/jsf/html" + xmlns:f="http://java.sun.com/jsf/core" + xmlns:ui="http://java.sun.com/jsf/facelets" + xmlns:c="http://java.sun.com/jstl/core" + xmlns:onc="http://jboss.org/on/component" + xmlns:onf="http://jboss.org/on/function" + xmlns:s="http://jboss.com/products/seam/taglib" + xmlns:a4j="https://ajax4jsf.dev.java.net/ajax" + xmlns:rich="http://richfaces.ajax4jsf.org/rich%22%3E + + <ui:include src="/rhq/common/monitor/response-plain.xhtml" /> + +</ui:composition> \ No newline at end of file diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/monitor/schedules-plain.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/monitor/schedules-plain.xhtml new file mode 100644 index 0000000..0641783 --- /dev/null +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/monitor/schedules-plain.xhtml @@ -0,0 +1,153 @@ +<ui:composition template="/rhq/group/layout/main-plain.xhtml" + xmlns="http://www.w3.org/1999/xhtml" + xmlns:h="http://java.sun.com/jsf/html" + xmlns:f="http://java.sun.com/jsf/core" + xmlns:ui="http://java.sun.com/jsf/facelets" + xmlns:c="http://java.sun.com/jstl/core" + xmlns:onc="http://jboss.org/on/component" + xmlns:onf="http://jboss.org/on/function" + xmlns:s="http://jboss.com/products/seam/taglib" + xmlns:a4j="https://ajax4jsf.dev.java.net/ajax" + xmlns:rich="http://richfaces.ajax4jsf.org/rich%22%3E + + <ui:define name="content"> + + <h:outputText rendered="#{not ResourceGroupUIBean.permissions.measure}" value="You don't have the measure permission for this group and therefore can not change metric schedules"/> + + <h:form id="resourceGroupSchedulesForm"> + <!-- hack to override the default button on the page, make this button pseudo-first in the form, + but take it out of the document flow and position it off the screen --> + <div style="position:absolute; top:-100px; "> + <onc:selectCommandButton id="enableAndSetSelectedSchedules" + name="enableAndSetSelectedSchedules" + action="#{ListResourceGroupMeasurementScheduleUIBean.enableAndSetSelected}" + value="SET" target="selectedResourceGroupSchedules" + styleClass="on-pager-button buttonsmall" + rendered="#{ResourceGroupUIBean.permissions.measure}" /> + </div> + <input type="hidden" name="groupId" value="${param.groupId}"/> + + <rich:panel styleClass="BlockContent"> + <f:facet name="header"> + <h:outputText value="Configure Metric Collection Schedules"/> + </f:facet> + + <ui:param name="resourceGroupSchedulesDataModel" value="#{ListResourceGroupMeasurementScheduleUIBean.dataModel}"/> + <rich:dataTable id="resourceGroupSchedulesDataTable" + rows="#{PageControl.ResourceGroupMeasurementScheduleList.pageSize}" + value="#{resourceGroupSchedulesDataModel}" + var="item" + width="100%" + columnsWidth="1%, 20%, 30%, 20%, 9%, 20%" + styleClass="resources-table" + footerClass="on-pager-footer" + onRowMouseOver="this.style.backgroundColor='#E7E7E7'" + onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"> + + <f:facet name="PageControlView"> + <onc:paginationControl id="ResourceGroupMeasurementScheduleList" /> + </f:facet> + + <rich:column style="background-color: #{item.collectionEnabled ? '#E2F2E6' : '#E2D2D2'}"> + <f:facet name="header"> + <onc:allSelect target="selectedResourceGroupSchedules" /> + </f:facet> + + <onc:select name="selectedResourceGroupSchedules" value="#{item.measurementDefinition.id}" /> + </rich:column> + + <rich:column style="background-color: #{item.collectionEnabled ? '#E2F2E6' : '#E2D2D2'}"> + <f:facet name="header"> + <onc:sortableColumnHeader sort="definition.displayName"> + <h:outputText styleClass="headerText" value="Metric" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputText value="#{item.measurementDefinition.displayName}"/> + </rich:column> + + <rich:column style="background-color: #{item.collectionEnabled ? '#E2F2E6' : '#E2D2D2'}"> + <f:facet name="header"> + <h:outputText styleClass="headerText" value="Description" /> + </f:facet> + + <h:outputText value="#{item.measurementDefinition.description}"/> + </rich:column> + + <rich:column style="background-color: #{item.collectionEnabled ? '#E2F2E6' : '#E2D2D2'}"> + <f:facet name="header"> + <onc:sortableColumnHeader sort="definition.dataType"> + <h:outputText styleClass="headerText" value="Type" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputText value="#{item.measurementDefinition.dataType}"/> + </rich:column> + + <rich:column style="background-color: #{item.collectionEnabled ? '#E2F2E6' : '#E2D2D2'}"> + <f:facet name="header"> + <h:outputText styleClass="headerText" value="Enabled" /> + </f:facet> + <h:outputText value="#{(empty item.collectionEnabled) ? 'SOME' : (item.collectionEnabled ? 'Yes' : 'No')}" /> + </rich:column> + + <rich:column style="background-color: #{item.collectionEnabled ? '#E2F2E6' : '#E2D2D2'}"> + <f:facet name="header"> + <h:outputText styleClass="headerText" value="Collection Interval" /> + </f:facet> + + <h:outputText value="#{item.collectionInterval}" rendered="#{item.collectionInterval ne 0}"> + <f:converter converterId="DurationConverter" /> + </h:outputText> + <h:outputText value="DIFFERENT" rendered="#{item.collectionInterval eq 0}" /> + </rich:column> + + <f:facet name="footer" rendered="false"> + rich:columnGroup + <rich:column colspan="6"> + <h:panelGrid columns="5" width="100%" rendered="#{ResourceGroupUIBean.permissions.measure}"> + <onc:selectCommandButton id="enableSelectedSchedules" + name="enableSelectedSchedules" + action="#{ListResourceGroupMeasurementScheduleUIBean.enableSelected}" + value="ENABLE" target="selectedResourceGroupSchedules" + styleClass="on-pager-button buttonsmall" + rendered="#{ResourceGroupUIBean.permissions.measure}" /> + + + <onc:selectCommandButton id="disableSelectedSchedules" + name="disableSelectedSchedules" + action="#{ListResourceGroupMeasurementScheduleUIBean.disableSelected}" + value="DISABLE" target="selectedResourceGroupSchedules" + styleClass="on-pager-button buttonsmall" + rendered="#{ResourceGroupUIBean.permissions.measure}" /> + + <h:panelGrid columns="3"> + <h:outputText value="Collection Interval: "/> + <onc:duration binding="#{ListResourceGroupMeasurementScheduleUIBean.duration}" + optionList="s,m,h"/> + <onc:selectCommandButton id="enableAndSetSelectedSchedules" + name="enableAndSetSelectedSchedules" + action="#{ListResourceGroupMeasurementScheduleUIBean.enableAndSetSelected}" + value="SET" target="selectedResourceGroupSchedules" + styleClass="on-pager-button buttonsmall" + rendered="#{ResourceGroupUIBean.permissions.measure}"/> + </h:panelGrid> + rich:spacer/ + <ui:param name="paginationDataTableName" value="resourceGroupSchedulesDataTable"/> + <ui:param name="paginationDataModel" value="#{resourceGroupSchedulesDataModel}"/> + <ui:param name="paginationPageControl" + value="#{PageControl.ResourceGroupMeasurementScheduleList}"/> + <ui:include src="/rhq/resource/include/pagination-plain.xhtml"/> + </h:panelGrid> + </rich:column> + </rich:columnGroup> + </f:facet> + + </rich:dataTable> + + </rich:panel> + </h:form> + +</ui:define> + +</ui:composition> \ No newline at end of file diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/monitor/tables-plain.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/monitor/tables-plain.xhtml new file mode 100644 index 0000000..a58529d --- /dev/null +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/monitor/tables-plain.xhtml @@ -0,0 +1,128 @@ +<ui:composition template="/rhq/group/layout/main-plain.xhtml" + xmlns="http://www.w3.org/1999/xhtml" + xmlns:h="http://java.sun.com/jsf/html" + xmlns:f="http://java.sun.com/jsf/core" + xmlns:ui="http://java.sun.com/jsf/facelets" + xmlns:c="http://java.sun.com/jstl/core" + xmlns:onc="http://jboss.org/on/component" + xmlns:onf="http://jboss.org/on/function" + xmlns:s="http://jboss.com/products/seam/taglib" + xmlns:a4j="https://ajax4jsf.dev.java.net/ajax" + xmlns:rich="http://richfaces.ajax4jsf.org/rich%22%3E + + <ui:define name="content"> + + <ui:param name="resourceGroupHealthSummaryDataModel" + value="#{ResourceGroupMetricsTableUIBean.dataModel}" /> + + <ui:include src="/rhq/common/monitor/tables.xhtml" /> + + <rich:panel styleClass="BlockContent"> + + <f:facet name="header" styleClass="BlockTitle"> + <a name="Group member Health" /> + Group Member Health + </f:facet> + + <h:form id="groupHealthSummaryForm"> + + <!-- On submit make sure these are provided for the context of any new instance of the UI beans --> + <input type="hidden" name="groupId" + value="#{ResourceGroupUIBean.groupId}" /> + + <a4j:keepAlive beanName="ResourceGroupMetricsTableUIBean"/> + + <rich:dataTable id="resourceGroupHealthSummaryDataTable" + rows="#{PageControl.ResourceGroupHealthSummary.pageSize}" + value="#{resourceGroupHealthSummaryDataModel}" + var="healthSummary" + columnsWidth="1%" + width="100%" + styleClass="resources-table" + footerClass="on-pager-footer" + onRowMouseOver="this.style.backgroundColor='#E7E7E7'" + onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"> + + <rich:column width="1%"> + <f:facet name="header"> + <onc:allSelect target="selectedResources" /> + </f:facet> + + <onc:select name="selectedResources" + value="#{healthSummary.id}" /> + </rich:column> + + <rich:column> + <f:facet name="header"> + <h:outputText value="Resource Name" /> + </f:facet> + + <h:outputLink + value="#{onf:getDefaultResourceTabURL()}"> + <f:param name="id" value="#{healthSummary.id}" /> + <h:outputText value="#{healthSummary.name}" /> + </h:outputLink> + </rich:column> + + <rich:column> + <f:facet name="header"> + <h:outputText value="Alerts" /> + </f:facet> + + <h:outputLink + value="/rhq/resource/alert/listAlertHistory-plain.xhtml"> + <f:param name="id" value="#{healthSummary.id}"/> + <f:param name="mode" value="list"/> + <h:outputText value="#{healthSummary.alerts}" /> + </h:outputLink> + </rich:column> + + <rich:column> + <f:facet name="header"> + <h:outputText value="Availability" /> + </f:facet> + + <h:graphicImage + value="/images/icons/availability_green_16.png" alt="Up" + title="Up" + rendered="#{healthSummary.availabilityType == 'UP'}" /> + <h:graphicImage value="/images/icons/availability_red_16.png" + alt="Down" title="Down" + rendered="#{healthSummary.availabilityType == 'DOWN'}" /> + <h:graphicImage + value="/images/icons/availability_grey_16.png" + alt="Unknown" title="Unknown" + rendered="#{healthSummary.availabilityType == null}" /> + </rich:column> + + <f:facet name="footer"> + <rich:columnGroup> + <rich:column colspan="4" width="100%"> + + <onc:selectCommandButton + action="#{ResourceGroupMetricsCompareUIBean.compareSelected}" + value="COMPARE METRICS" + target="selectedResources" low="2" + styleClass="on-pager-button buttonsmall" /> + + <ui:param name="paginationDataTableName" + value="resourceGroupHealthSummaryDataTable" /> + <ui:param name="paginationDataModel" + value="#{resourceGroupHealthSummaryDataModel}" /> + <ui:param name="paginationPageControl" + value="#{PageControl.ResourceGroupHealthSummary}" /> + <ui:include + src="/rhq/resource/include/pagination-plain.xhtml" /> + + </rich:column> + </rich:columnGroup> + </f:facet> + + </rich:dataTable> + </h:form> + + </rich:panel> + + </ui:define> + +</ui:composition> \ No newline at end of file diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/monitor/tables-plain.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/monitor/tables-plain.xhtml new file mode 100644 index 0000000..2b4b0c1 --- /dev/null +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/monitor/tables-plain.xhtml @@ -0,0 +1,19 @@ +<ui:composition template="/rhq/resource/layout/main-plain.xhtml" + xmlns="http://www.w3.org/1999/xhtml" + xmlns:h="http://java.sun.com/jsf/html" + xmlns:f="http://java.sun.com/jsf/core" + xmlns:ui="http://java.sun.com/jsf/facelets" + xmlns:c="http://java.sun.com/jstl/core" + xmlns:onc="http://jboss.org/on/component" + xmlns:onf="http://jboss.org/on/function" + xmlns:s="http://jboss.com/products/seam/taglib" + xmlns:a4j="https://ajax4jsf.dev.java.net/ajax" + xmlns:rich="http://richfaces.ajax4jsf.org/rich"> + + <ui:define name="content"> + + <ui:include src="/rhq/common/monitor/tables.xhtml"/> + + </ui:define> + +</ui:composition> \ No newline at end of file
commit 242e1bbd40af27e6b06027da95b0cf5ee4e2024c Author: Joseph Marques <joseph@redhat.com> Date: Thu Aug 12 02:02:10 2010 -0400
move the measurement-based navigation rule to the appropriate *-navigiation.xml file
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation-resource-group/inventory-navigation.xml b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation-resource-group/inventory-navigation.xml index 9620666..976dd89 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation-resource-group/inventory-navigation.xml +++ b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation-resource-group/inventory-navigation.xml @@ -109,19 +109,4 @@
</navigation-rule>
- <navigation-rule> - - <from-view-id>/rhq/group/monitor/tables.xhtml</from-view-id> - - <!-- === compareResourcesGroupMetrics (struts) ========================= --> - - <navigation-case> - <from-action>#{ResourceGroupMetricsCompareUIBean.compareSelected}</from-action> - <from-outcome>compareResourceGroupMetrics</from-outcome> - <to-view-id>/resource/common/monitor/Visibility.do?mode=compareMetrics&category=COMPATIBLE&groupId=#{param.groupId}#{ResourceGroupMetricsCompareUIBean.selected}</to-view-id> - <redirect /> - </navigation-case> - - </navigation-rule> - </faces-config> diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation-resource-group/measurement-navigation.xml b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation-resource-group/measurement-navigation.xml index d7ef174..ee342f0 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation-resource-group/measurement-navigation.xml +++ b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation-resource-group/measurement-navigation.xml @@ -70,4 +70,19 @@
</navigation-rule>
+ <navigation-rule> + + <from-view-id>/rhq/group/monitor/tables.xhtml</from-view-id> + + <!-- === compareResourcesGroupMetrics (struts) ========================= --> + + <navigation-case> + <from-action>#{ResourceGroupMetricsCompareUIBean.compareSelected}</from-action> + <from-outcome>compareResourceGroupMetrics</from-outcome> + <to-view-id>/resource/common/monitor/Visibility.do?mode=compareMetrics&category=COMPATIBLE&groupId=#{param.groupId}#{ResourceGroupMetricsCompareUIBean.selected}</to-view-id> + <redirect /> + </navigation-case> + + </navigation-rule> + </faces-config> \ No newline at end of file
commit ede4e8b5e26a385afe77864f2d207cfb602d4df5 Author: Joseph Marques <joseph@redhat.com> Date: Thu Aug 12 02:01:35 2010 -0400
prepare "plain" navigation scheme for iframed-facelets for groups
* copy/paste entire XXX-navigation.xml file to XXX-plain-navigation.xml * search/replace *.xhtml with *-plain.xhtml inside each * do this for the follow group subsystems: ** alerts, configuration, events, measurement, operations
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation-resource-group/alert-plain-navigation.xml b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation-resource-group/alert-plain-navigation.xml new file mode 100644 index 0000000..854b6a6 --- /dev/null +++ b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation-resource-group/alert-plain-navigation.xml @@ -0,0 +1,60 @@ +<?xml version="1.0"?> + +<faces-config version="1.2" xmlns="http://java.sun.com/xml/ns/javaee" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd"> + + <!-- Group Alert Definition List --> + <navigation-rule> + <from-view-id>/rhq/group/alert/listGroupAlertDefinitions-plain.xhtml</from-view-id> + + <navigation-case> + <!-- catch all navigation-case: if any actions return 'success', go here --> + <from-outcome>success</from-outcome> + <to-view-id>/rhq/group/alert/listGroupAlertDefinitions-plain.xhtml?groupId=#{param.groupId}</to-view-id> + <redirect/> + </navigation-case> + + <navigation-case> + <from-outcome>createNewAlertDefinition</from-outcome> + <to-view-id>/alerts/Config.do?groupId=#{param.groupId}&mode=new</to-view-id> + <redirect/> + </navigation-case> + + <navigation-case> + <!-- sorting rule --> + <from-outcome>sort</from-outcome> + <to-view-id>/rhq/group/alert/listGroupAlertDefinitions-plain.xhtml?groupId=#{param.groupId}</to-view-id> + <redirect/> + </navigation-case> + + </navigation-rule> + + <!-- Alert History List --> + <navigation-rule> + <from-view-id>/rhq/group/alert/listGroupAlertHistory-plain.xhtml</from-view-id> + + <navigation-case> + <!-- catch all navigation-case: if any actions return 'success', go here --> + <from-outcome>dateFilter</from-outcome> + <to-view-id>/rhq/group/alert/listGroupAlertHistory-plain.xhtml?groupId=#{param.groupId}&date=#{param.date}</to-view-id> + <redirect/> + </navigation-case> + + <navigation-case> + <!-- catch all navigation-case: if any actions return 'success', go here --> + <from-outcome>success</from-outcome> + <to-view-id>/rhq/group/alert/listGroupAlertHistory-plain.xhtml?groupId=#{param.groupId}</to-view-id> + <redirect/> + </navigation-case> + + <navigation-case> + <!-- sorting rule --> + <from-outcome>sort</from-outcome> + <to-view-id>/rhq/group/alert/listGroupAlertHistory-plain.xhtml?groupId=#{param.groupId}</to-view-id> + <redirect/> + </navigation-case> + + </navigation-rule> + +</faces-config> \ No newline at end of file diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation-resource-group/configuration-plain-navigation.xml b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation-resource-group/configuration-plain-navigation.xml new file mode 100644 index 0000000..e89ccd6 --- /dev/null +++ b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation-resource-group/configuration-plain-navigation.xml @@ -0,0 +1,45 @@ +<?xml version="1.0"?> + +<faces-config version="1.2" xmlns="http://java.sun.com/xml/ns/javaee" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd"> + + <navigation-rule> + <from-view-id>/rhq/group/configuration/editCurrent-plain.xhtml</from-view-id> + + <navigation-case> + <from-action>#{ConfigHelperUIBean.addNewOpenMapMemberProperty}</from-action> + <to-view-id>/rhq/group/configuration/addSimple-plain.xhtml</to-view-id> + </navigation-case> + </navigation-rule> + + <navigation-rule> + <from-view-id>/rhq/group/configuration/addSimple-plain.xhtml</from-view-id> + + <navigation-case> + <to-view-id>/rhq/group/configuration/editCurrent-plain.xhtml?refresh=rhq_prop</to-view-id> + </navigation-case> + </navigation-rule> + + <navigation-rule> + + <from-view-id>/rhq/group/configuration/history-plain.xhtml</from-view-id> + + <navigation-case> + <from-outcome>sort</from-outcome> + <to-view-id>/rhq/group/configuration/history-plain.xhtml?groupId=#{param.groupId}&mode=#{param.mode}&arcuId=#{param.arcuId}</to-view-id> + <redirect/> + </navigation-case> + + <navigation-case> + <from-outcome>success</from-outcome> + <to-view-id>/rhq/group/configuration/history-plain.xhtml?groupId=#{param.groupId}&mode=#{param.mode}&arcuId=#{param.arcuId}</to-view-id> + <redirect/> + </navigation-case> + + </navigation-rule> + + + +</faces-config> + \ No newline at end of file diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation-resource-group/events-plain-navigation.xml b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation-resource-group/events-plain-navigation.xml new file mode 100644 index 0000000..447874c --- /dev/null +++ b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation-resource-group/events-plain-navigation.xml @@ -0,0 +1,26 @@ +<?xml version="1.0"?> + +<faces-config version="1.2" xmlns="http://java.sun.com/xml/ns/javaee" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd"> + + <navigation-rule> + + <from-view-id>/rhq/group/events/history-plain.xhtml</from-view-id> + + <navigation-case> + <from-outcome>sort</from-outcome> + <to-view-id>/rhq/group/events/history-plain.xhtml?groupId=#{param.groupId}&category=#{param.category}</to-view-id> + <redirect/> + </navigation-case> + + <navigation-case> + <from-outcome>success</from-outcome> + <to-view-id>/rhq/group/events/history-plain.xhtml?groupId=#{param.groupId}&category=#{param.category}</to-view-id> + <redirect/> + </navigation-case> + + </navigation-rule> + +</faces-config> + \ No newline at end of file diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation-resource-group/measurement-plain-navigation.xml b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation-resource-group/measurement-plain-navigation.xml new file mode 100644 index 0000000..d2a81e0 --- /dev/null +++ b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation-resource-group/measurement-plain-navigation.xml @@ -0,0 +1,88 @@ +<?xml version="1.0"?> + +<faces-config version="1.2" xmlns="http://java.sun.com/xml/ns/javaee" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd"> + + <!-- ResourceGroup Measurement Schedules --> + <navigation-rule> + <from-view-id>/rhq/group/monitor/schedules-plain.xhtml</from-view-id> + + <navigation-case> + <!-- catch all navigation-case: if any actions return 'success', go here --> + <from-outcome>success</from-outcome> + <to-view-id>/rhq/group/monitor/schedules-plain.xhtml?groupId=#{param.groupId}&category=COMPATIBLE</to-view-id> + <redirect/> + </navigation-case> + + <navigation-case> + <!-- sorting rule --> + <from-outcome>sort</from-outcome> + <to-view-id>/rhq/group/monitor/schedules-plain.xhtml?groupId=#{param.groupId}&category=COMPATIBLE</to-view-id> + <redirect/> + </navigation-case> + + </navigation-rule> + + <!-- changing metric display range on Monitor > Graphs --> + <navigation-rule> + <from-view-id>/rhq/group/monitor/graphs-plain.xhtml</from-view-id> + + <navigation-case> + <!-- catch all navigation-case: if any actions return 'success', go here --> + <from-outcome>success</from-outcome> + <to-view-id>/rhq/group/monitor/graphs-plain.xhtml?groupId=#{param.groupId}&category=COMPATIBLE</to-view-id> + <redirect/> + </navigation-case> + + </navigation-rule> + + <!-- changing metric display range on Monitor > Tables --> + <navigation-rule> + <from-view-id>/rhq/group/monitor/tables-plain.xhtml</from-view-id> + + <navigation-case> + <!-- catch all navigation-case: if any actions return 'success', go here --> + <from-outcome>success</from-outcome> + <to-view-id>/rhq/group/monitor/tables-plain.xhtml?groupId=#{param.groupId}&category=COMPATIBLE</to-view-id> + <redirect/> + </navigation-case> + + </navigation-rule> + + <!-- changing metric display range on Monitor > Response --> + <navigation-rule> + <from-view-id>/rhq/group/monitor/response-plain.xhtml</from-view-id> + + <navigation-case> + <!-- catch all navigation-case: if any actions return 'success', go here --> + <from-outcome>success</from-outcome> + <to-view-id>/rhq/group/monitor/response-plain.xhtml?groupId=#{param.groupId}&category=COMPATIBLE</to-view-id> + <redirect/> + </navigation-case> + + <navigation-case> + <!-- sorting rule --> + <from-outcome>sort</from-outcome> + <to-view-id>/rhq/group/monitor/response-plain.xhtml?groupId=#{param.groupId}&category=COMPATIBLE</to-view-id> + <redirect/> + </navigation-case> + + </navigation-rule> + + <navigation-rule> + + <from-view-id>/rhq/group/monitor/tables-plain.xhtml</from-view-id> + + <!-- === compareResourcesGroupMetrics (struts) ========================= --> + + <navigation-case> + <from-action>#{ResourceGroupMetricsCompareUIBean.compareSelected}</from-action> + <from-outcome>compareResourceGroupMetrics</from-outcome> + <to-view-id>/resource/common/monitor/Visibility.do?mode=compareMetrics&category=COMPATIBLE&groupId=#{param.groupId}#{ResourceGroupMetricsCompareUIBean.selected}</to-view-id> + <redirect /> + </navigation-case> + + </navigation-rule> + +</faces-config> \ No newline at end of file diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation-resource-group/operation-plain-navigation.xml b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation-resource-group/operation-plain-navigation.xml new file mode 100644 index 0000000..a60e56a --- /dev/null +++ b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation-resource-group/operation-plain-navigation.xml @@ -0,0 +1,119 @@ +<?xml version="1.0"?> + +<faces-config version="1.2" xmlns="http://java.sun.com/xml/ns/javaee" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd"> + + <!-- New Resource Group Operation Schedule --> + <navigation-rule> + <from-view-id>/rhq/group/operation/groupOperationScheduleNew-plain.xhtml</from-view-id> + + <navigation-case> + <!-- schedule an operation for deferred execution --> + <from-outcome>viewOperationSchedules</from-outcome> + <to-view-id>/rhq/group/operation/groupOperationSchedules-plain.xhtml?groupId=#{param.groupId}&category=#{param.category}</to-view-id> + <redirect/> + </navigation-case> + + <navigation-case> + <!-- schedule an operation for immediate execution --> + <from-outcome>viewOperationHistory</from-outcome> + <to-view-id>/rhq/group/operation/groupOperationHistory-plain.xhtml?groupId=#{param.groupId}&category=#{param.category}</to-view-id> + <redirect/> + </navigation-case> + + <navigation-case> + <!-- catch all navigation-case: if any actions return 'success', go back here --> + <from-outcome>success</from-outcome> + <to-view-id>/rhq/group/operation/groupOperationScheduleNew-plain.xhtml?groupId=#{param.groupId}&opId=#{param.opId}&category=#{param.category}</to-view-id> + <redirect/> + </navigation-case> + + <navigation-case> + <!-- sorting rule --> + <from-outcome>sort</from-outcome> + <to-view-id>/rhq/group/operation/groupOperationScheduleNew-plain.xhtml?groupId=#{param.groupId}&category=#{param.category}</to-view-id> + <redirect/> + </navigation-case> + + </navigation-rule> + + <!-- Resource Group Operation Schedules --> + <navigation-rule> + <from-view-id>/rhq/group/operation/groupOperationSchedules-plain.xhtml</from-view-id> + + <navigation-case> + <!-- catch all navigation-case: if any actions return 'success', go here --> + <from-outcome>success</from-outcome> + <to-view-id>/rhq/group/operation/groupOperationSchedules-plain.xhtml?groupId=#{param.groupId}&category=#{param.category}</to-view-id> + <redirect/> + </navigation-case> + + <navigation-case> + <!-- sorting rule --> + <from-outcome>sort</from-outcome> + <to-view-id>/rhq/group/operation/groupOperationSchedules-plain.xhtml?groupId=#{param.groupId}&category=#{param.category}</to-view-id> + <redirect/> + </navigation-case> + + <navigation-case> + <!-- schedule an operation for immediate execution --> + <from-outcome>viewOperationHistory</from-outcome> + <to-view-id>/rhq/group/operation/groupOperationHistory-plain.xhtml?groupId=#{param.groupId}&category=#{param.category}</to-view-id> + <redirect/> + </navigation-case> + + </navigation-rule> + + <navigation-rule> + + <from-view-id>/rhq/group/operation/groupOperationScheduleDetails-plain.xhtml</from-view-id> + + <navigation-case> + <!-- schedule an operation for immediate execution --> + <from-outcome>viewOperationHistory</from-outcome> + <to-view-id>/rhq/group/operation/groupOperationHistory-plain.xhtml?groupId=#{param.groupId}&category=#{param.category}</to-view-id> + <redirect/> + </navigation-case> + + </navigation-rule> + + <!-- Resource Group Operation History --> + <navigation-rule> + <from-view-id>/rhq/group/operation/groupOperationHistory-plain.xhtml</from-view-id> + + <navigation-case> + <!-- catch all navigation-case: if any actions return 'success', go here --> + <from-outcome>success</from-outcome> + <to-view-id>/rhq/group/operation/groupOperationHistory-plain.xhtml?groupId=#{param.groupId}&category=#{param.category}</to-view-id> + <redirect/> + </navigation-case> + + <navigation-case> + <!-- sorting rule --> + <from-outcome>sort</from-outcome> + <to-view-id>/rhq/group/operation/groupOperationHistory-plain.xhtml?groupId=#{param.groupId}&category=#{param.category}</to-view-id> + <redirect/> + </navigation-case> + + </navigation-rule> + + <navigation-rule> + + <from-view-id>/rhq/group/operation/groupOperationHistoryDetails-plain.xhtml</from-view-id> + + <navigation-case> + <from-action>#{ConfigHelperUIBean.accessMap}</from-action> + <to-view-id>/rhq/group/operation/view-results-map-plain.xhtml</to-view-id> + </navigation-case> + + <navigation-case> + <!-- sorting rule --> + <from-outcome>sort</from-outcome> + <to-view-id>/rhq/group/operation/groupOperationHistoryDetails-plain.xhtml?groupId=#{param.groupId}&opId=#{param.opId}&category=#{param.category}</to-view-id> + <redirect/> + </navigation-case> + + </navigation-rule> + +</faces-config> \ No newline at end of file diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/web.xml b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/web.xml index 03f80f0..1bcfe79 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/web.xml +++ b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/web.xml @@ -177,6 +177,12 @@ /WEB-INF/jsf-navigation-resource-group/operation-navigation.xml, /WEB-INF/jsf-navigation-resource-group/measurement-navigation.xml,
+ /WEB-INF/jsf-navigation-resource-group/alert-plain-navigation.xml, + /WEB-INF/jsf-navigation-resource-group/configuration-plain-navigation.xml, + /WEB-INF/jsf-navigation-resource-group/events-plain-navigation.xml, + /WEB-INF/jsf-navigation-resource-group/operation-plain-navigation.xml, + /WEB-INF/jsf-navigation-resource-group/measurement-plain-navigation.xml, + /WEB-INF/jsf-navigation-auto-group/events-navigation.xml, /WEB-INF/jsf-navigation-auto-group/measurement-navigation.xml,
commit 67479a29abb05104a075a8c5e6a4be1aea9135c6 Author: Joseph Marques <joseph@redhat.com> Date: Thu Aug 12 02:00:07 2010 -0400
extend the "plain" layout scheme for iframed-facelets for groups
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/layout/main-plain.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/layout/main-plain.xhtml new file mode 100644 index 0000000..5faaa7c --- /dev/null +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/layout/main-plain.xhtml @@ -0,0 +1,64 @@ +<ui:composition template="/rhq/entity/layout/main-plain.xhtml" + xmlns="http://www.w3.org/1999/xhtml" + xmlns:h="http://java.sun.com/jsf/html" + xmlns:f="http://java.sun.com/jsf/core" + xmlns:ui="http://java.sun.com/jsf/facelets" + xmlns:c="http://java.sun.com/jstl/core" + xmlns:onc="http://jboss.org/on/component" + xmlns:onf="http://jboss.org/on/function" + xmlns:s="http://jboss.com/products/seam/taglib" + xmlns:a4j="https://ajax4jsf.dev.java.net/ajax" + xmlns:rich="http://richfaces.ajax4jsf.org/rich"> + + <ui:define name="content"> + <h1>Default Group Content</h1> + </ui:define> + + <ui:remove> + +<!-- + <f:param name="groupId" value="#{param.groupId}"/> + <f:param name="parentGroupId" value="#{param.parentGroupId}"/> + <f:param name="category" value="#{param.category}"/> + + <onc:tab name="Monitor" image="/images/icons/Monitor_grey_16.png" rendered="#{ResourceGroupUIBean.compatible}"> + <onc:subtab name="Graphs" url="/rhq/group/monitor/graphs.xhtml"/> + <onc:subtab name="Tables" url="/rhq/group/monitor/tables.xhtml"/> + <onc:subtab name="Schedules" url="/rhq/group/monitor/schedules.xhtml"/> + <c:if test="#{GlobalPermissionsUIBean.experimental}"> + <onc:subtab name="Response" url="/rhq/group/monitor/response.xhtml"/> + </c:if> + </onc:tab> + + <onc:tab name="Inventory" image="/images/icons/Inventory_grey_16.png"> + <onc:subtab name="Overview" url="/rhq/group/inventory/view.xhtml" /> + <c:if test="#{ResourceGroupUIBean.compatible and ResourceGroupUIBean.facets.pluginConfiguration}"> + <onc:subtab name="Connection" url="/rhq/group/inventory/view-connection.xhtml" /> + </c:if> + </onc:tab> + + <onc:tab name="Alert" image="/images/icons/Alert_grey_16.png" + rendered="#{monitorEnabled and ResourceGroupUIBean.compatible}"> + <onc:subtab name="Definitions" url="/rhq/group/alert/listGroupAlertDefinitions.xhtml" /> + <onc:subtab name="History" url="/rhq/group/alert/listGroupAlertHistory.xhtml" /> + </onc:tab> + + <onc:tab name="Configuration" displayName="Configure" image="/images/icons/Configure_grey_16.png" + rendered="#{ResourceGroupUIBean.compatible and ResourceGroupUIBean.facets.configuration}"> + <onc:subtab name="Current" url="/rhq/group/configuration/viewCurrent.xhtml" /> + <onc:subtab name="History" url="/rhq/group/configuration/history.xhtml" /> + </onc:tab> + + <onc:tab name="Operations" image="/images/icons/Operation_grey_16.png" rendered="#{ResourceGroupUIBean.compatible and ResourceGroupUIBean.facets.operation}"> + <onc:subtab name="New" url="/rhq/group/operation/groupOperationScheduleNew.xhtml"/> + <onc:subtab name="Schedules" url="/rhq/group/operation/groupOperationSchedules.xhtml"/> + <onc:subtab name="History" url="/rhq/group/operation/groupOperationHistory.xhtml"/> + </onc:tab> + + <onc:tab name="Events" image="/images/icons/Events_grey_16.png" rendered="#{ResourceGroupUIBean.compatible and ResourceGroupUIBean.facets.event}"> + <onc:subtab name="History" url="/rhq/group/events/history.xhtml"/> + </onc:tab> + --> + </ui:remove> + +</ui:composition> \ No newline at end of file
commit 84c915b2f0955e7a7693c0c8f5676b0cef53419d Author: Joseph Marques <joseph@redhat.com> Date: Thu Aug 12 01:58:45 2010 -0400
fix group-wise sub-tabs, we only support a subset of resource-wise sub-tabs
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java index 23da6c5..c7fbb97 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java @@ -89,7 +89,7 @@ public class ResourceGroupDetailView extends VLayout implements BookmarkableView summaryTab.registerSubTabs("Overview", "Timeline");
monitoringTab = new TwoLevelTab("Monitoring", "/images/icons/Monitor_grey_16.png"); - monitoringTab.registerSubTabs("Graphs", "Tables", "Traits", "Availability", "Schedules", "Call Time"); + monitoringTab.registerSubTabs("Graphs", "Tables", "Schedules", "Call Time");
inventoryTab = new TwoLevelTab("Inventory", "/images/icons/Inventory_grey_16.png"); inventoryTab.registerSubTabs("Overview", "Members", "Connection Settings");
commit 79ffb74e96fafa82561a329341487bf149bb8c15 Author: Joseph Marques <joseph@redhat.com> Date: Thu Aug 12 01:57:38 2010 -0400
reformat, cosmetic
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java index 144442b..23da6c5 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java @@ -69,7 +69,6 @@ public class ResourceGroupDetailView extends VLayout implements BookmarkableView
private ResourceGroupTitleBar titleBar;
- @Override protected void onDraw() { super.onDraw(); @@ -120,7 +119,6 @@ public class ResourceGroupDetailView extends VLayout implements BookmarkableView // CoreGUI.addBreadCrumb(getPlace()); }
- public void onGroupSelected(ResourceGroupComposite groupComposite) {
this.groupComposite = groupComposite; @@ -181,8 +179,8 @@ public class ResourceGroupDetailView extends VLayout implements BookmarkableView new ResourceTypeRepository.TypeLoadedCallback() { public void onTypesLoaded(ResourceType type) { group.setResourceType(type); - GWTServiceLookup.getAuthorizationService().getImplicitGroupPermissions( - group.getId(), new AsyncCallback<Set<Permission>>() { + GWTServiceLookup.getAuthorizationService().getImplicitGroupPermissions(group.getId(), + new AsyncCallback<Set<Permission>>() { public void onFailure(Throwable caught) { CoreGUI.getErrorHandler().handleError("Failed to load group permissions.", caught); } @@ -224,7 +222,7 @@ public class ResourceGroupDetailView extends VLayout implements BookmarkableView
// Configuration tab is only enabled for compatible groups of a type that supports the Configuration facet // and when the current user has the CONFIGURE_READ permission. - if (!typeFacets.contains(ResourceTypeFacet.CONFIGURATION) && permissions.isConfigureRead()) { + if (typeFacets.contains(ResourceTypeFacet.CONFIGURATION) && permissions.isConfigureRead()) { topTabSet.enableTab(configurationTab); } else { topTabSet.disableTab(configurationTab); @@ -239,35 +237,32 @@ public class ResourceGroupDetailView extends VLayout implements BookmarkableView
}
- public void onTabSelected(TwoLevelTabSelectedEvent tabSelectedEvent) { // Switch tabs directly, rather than letting the history framework do it, to avoid redrawing the outer views. selectTab(tabSelectedEvent.getId(), tabSelectedEvent.getSubTabId()); String tabPath = "/" + tabSelectedEvent.getId() + "/" + tabSelectedEvent.getSubTabId(); String path = "ResourceGroup/" + this.groupComposite.getResourceGroup().getId() + tabPath; - + // But still add an item to the history, specifying false to tell it not to fire an event. History.newItem(path, false); }
- public void renderView(ViewPath viewPath) { // e.g. #ResourceGroup/10010/Inventory/Overview - String tabName = (!viewPath.isEnd()) ? viewPath.getCurrent().getPath() : null; // e.g. "Inventory" + String tabName = (!viewPath.isEnd()) ? viewPath.getCurrent().getPath() : null; // e.g. "Inventory" String subTabName = (viewPath.viewsLeft() >= 1) ? viewPath.getNext().getPath() : null; // e.g. "Overview" selectTab(tabName, subTabName); }
- public void selectTab(String tabName, String subtabName) { if (tabName == null) { tabName = DEFAULT_TAB_NAME; } - TwoLevelTab tab = (TwoLevelTab)this.topTabSet.getTabByTitle(tabName); + TwoLevelTab tab = (TwoLevelTab) this.topTabSet.getTabByTitle(tabName); if (tab == null) { CoreGUI.getErrorHandler().handleError("Invalid tab name: " + tabName); // TODO: Should we fire a history event here to redirect to a valid bookmark? - tab = (TwoLevelTab)this.topTabSet.getTabByTitle(DEFAULT_TAB_NAME); + tab = (TwoLevelTab) this.topTabSet.getTabByTitle(DEFAULT_TAB_NAME); } this.topTabSet.selectTab(tab); if (subtabName != null) {
commit 1a767576db3dfd69412a858eef0af3dcdd920955 Author: Joseph Marques <joseph@redhat.com> Date: Thu Aug 12 01:56:13 2010 -0400
always render call-time iframe-facelet, conditionally render the sub-tab instead
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java index ea7b88e..92d74eb 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java @@ -27,6 +27,8 @@ import com.smartgwt.client.types.Side; import com.smartgwt.client.widgets.layout.VLayout;
import org.rhq.core.domain.authz.Permission; +import org.rhq.core.domain.measurement.DataType; +import org.rhq.core.domain.measurement.MeasurementDefinition; import org.rhq.core.domain.resource.Resource; import org.rhq.core.domain.resource.ResourceType; import org.rhq.core.domain.resource.composite.ResourcePermission; @@ -204,7 +206,6 @@ public class ResourceDetailView extends VLayout implements BookmarkableView, Res
updateTabStatus();
- topTabSet.markForRedraw(); }
private void updateTabStatus() { @@ -215,8 +216,8 @@ public class ResourceDetailView extends VLayout implements BookmarkableView, Res resource.getResourceType().getId(), EnumSet.of(ResourceTypeRepository.MetadataType.content, ResourceTypeRepository.MetadataType.operations, ResourceTypeRepository.MetadataType.events, - ResourceTypeRepository.MetadataType.resourceConfigurationDefinition), - new ResourceTypeRepository.TypeLoadedCallback() { + ResourceTypeRepository.MetadataType.resourceConfigurationDefinition, + ResourceTypeRepository.MetadataType.measurements), new ResourceTypeRepository.TypeLoadedCallback() { public void onTypesLoaded(ResourceType type) {
ResourceDetailView.this.type = type; @@ -275,10 +276,23 @@ public class ResourceDetailView extends VLayout implements BookmarkableView, Res topTabSet.enableTab(contentTab); }
+ // only enable "Call Time" sub-tab for those that implement it + monitoringTab.setSubTabEnabled("Call Time", implementsCallTime(type)); + if (topTabSet.getSelectedTab().getDisabled()) { topTabSet.selectTab(0); }
+ topTabSet.markForRedraw(); + } + + private boolean implementsCallTime(ResourceType type) { + for (MeasurementDefinition definition : type.getMetricDefinitions()) { + if (definition.getDataType() == DataType.CALLTIME) { + return true; + } + } + return false; }
public void onTabSelected(TwoLevelTabSelectedEvent tabSelectedEvent) { diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/monitor/response-plain.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/monitor/response-plain.xhtml index aa6576f..3da09e2 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/monitor/response-plain.xhtml +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/monitor/response-plain.xhtml @@ -14,20 +14,6 @@
<rich:panel styleClass="BlockContent">
- <c:if test="#{!ResourceUIBean.facets.callTime}"> - <c:if test="#{CallTimeUIBean.context.resourceId != -1}"> - Response Time Metrics are not supported for this resource. - </c:if> - <c:if test="#{CallTimeUIBean.context.groupId != -1}"> - Response Time Metrics are not supported for this compatible group. - </c:if> - <c:if test="#{CallTimeUIBean.context.parentResourceId != -1 and CallTimeUIBean.context.resourceTypeId != -1}"> - Response Time Metrics are not supported for this auto-group. - </c:if> - - </c:if> - - <c:if test="#{ResourceUIBean.facets.callTime}"> <h:form id="callTimeForm"> <a4j:keepAlive beanName="CallTimeUIBean"/>
@@ -165,7 +151,6 @@ </table>
</h:form> - </c:if>
</rich:panel>
commit a18620eb8f17662207c96e6b757d59f5cce71b9a Author: Joseph Marques <joseph@redhat.com> Date: Thu Aug 12 01:55:03 2010 -0400
allow sub-tabs to render as conditionally enabled/disabled buttons
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/tab/SubTabLayout.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/tab/SubTabLayout.java index bc79260..eb66445 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/tab/SubTabLayout.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/tab/SubTabLayout.java @@ -18,6 +18,10 @@ */ package org.rhq.enterprise.gui.coregui.client.components.tab;
+import java.util.HashSet; +import java.util.LinkedHashMap; +import java.util.Set; + import com.google.gwt.event.shared.HandlerManager; import com.google.gwt.event.shared.HandlerRegistration; import com.smartgwt.client.types.Overflow; @@ -27,11 +31,8 @@ import com.smartgwt.client.widgets.Canvas; import com.smartgwt.client.widgets.events.ClickEvent; import com.smartgwt.client.widgets.events.ClickHandler; import com.smartgwt.client.widgets.layout.VLayout; -import com.smartgwt.client.widgets.tab.events.TabSelectedEvent; import com.smartgwt.client.widgets.toolbar.ToolStrip;
-import java.util.LinkedHashMap; - /** * @author Greg Hinkle */ @@ -40,6 +41,7 @@ public class SubTabLayout extends VLayout { ToolStrip buttonBar;
LinkedHashMap<String, Canvas> subtabs = new LinkedHashMap<String, Canvas>(); + Set<String> disabledSubTabs = new HashSet<String>();
Canvas currentlyDisplayed; String currentlySelected; @@ -59,7 +61,6 @@ public class SubTabLayout extends VLayout { setMargin(0); setPadding(0);
- buttonBar = new ToolStrip(); buttonBar.setBackgroundColor("grey"); buttonBar.setWidth100(); @@ -68,7 +69,6 @@ public class SubTabLayout extends VLayout {
addMember(buttonBar);
- int i = 0;
for (final String title : subtabs.keySet()) { @@ -78,18 +78,22 @@ public class SubTabLayout extends VLayout { currentlySelected = title; }
- Button button = new Button(title); button.setShowRollOver(false); button.setActionType(SelectionType.RADIO); button.setRadioGroup("subtabs"); button.setBorder(null); button.setAutoFit(true); + if (disabledSubTabs.contains(title)) { + button.disable(); + } else { + button.enable(); + }
button.setBaseStyle("SubTabButton");
-// button.setStyleName("SubTabButton"); -// button.setStylePrimaryName("SubTabButton"); + // button.setStyleName("SubTabButton"); + // button.setStylePrimaryName("SubTabButton");
final Integer index = i++;
@@ -110,6 +114,14 @@ public class SubTabLayout extends VLayout { selectTab(currentlySelected); }
+ public void enableSubTab(String title) { + disabledSubTabs.remove(title); + } + + public void disableSubTab(String title) { + disabledSubTabs.add(title); + } + public void updateSubTab(String title, Canvas canvas) { subtabs.put(title, canvas); if (isDrawn() && title.equals(currentlySelected)) { @@ -121,7 +133,7 @@ public class SubTabLayout extends VLayout { private void draw(Canvas canvas) { if (currentlyDisplayed != null) { currentlyDisplayed.hide(); -// removeMember(currentlyDisplayed); + // removeMember(currentlyDisplayed); } if (canvas != null) { if (hasMember(canvas)) { @@ -137,6 +149,9 @@ public class SubTabLayout extends VLayout { } }
+ public void unregisterAllSubTabs() { + subtabs.clear(); + }
public void registerSubTab(String title, Canvas canvas) { if (currentlySelected == null) { @@ -149,8 +164,6 @@ public class SubTabLayout extends VLayout { return currentIndex; }
- - public boolean selectTab(String title) { boolean foundTab = false; currentlySelected = title; @@ -164,16 +177,14 @@ public class SubTabLayout extends VLayout { i++; }
- if (isDrawn()) { - ((Button)buttonBar.getMember(currentIndex)).select(); + ((Button) buttonBar.getMember(currentIndex)).select(); draw(subtabs.get(title)); } - + return foundTab; }
- // ------- Event support ------- // Done with a separate handler manager from parent class on purpose (compatibility issue)
@@ -184,13 +195,8 @@ public class SubTabLayout extends VLayout { }
public void fireSubTabSelection() { - TwoLevelTabSelectedEvent event = new TwoLevelTabSelectedEvent( - "?", - currentlySelected, - -1, - currentIndex, - currentlyDisplayed - ); + TwoLevelTabSelectedEvent event = new TwoLevelTabSelectedEvent("?", currentlySelected, -1, currentIndex, + currentlyDisplayed); hm.fireEvent(event); } } \ No newline at end of file diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/tab/TwoLevelTab.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/tab/TwoLevelTab.java index 9f9e5d4..c335dc9 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/tab/TwoLevelTab.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/tab/TwoLevelTab.java @@ -34,17 +34,24 @@ public class TwoLevelTab extends Tab { layout = new SubTabLayout(); }
- public void updateSubTab(String tab, Canvas canvas) { layout.updateSubTab(tab, canvas); }
public void registerSubTabs(String... tabs) { - for (String tab :tabs) { + for (String tab : tabs) { layout.registerSubTab(tab, null); } }
+ public void setSubTabEnabled(String tab, boolean enabled) { + if (enabled) { + layout.enableSubTab(tab); + } else { + layout.disableSubTab(tab); + } + } + public SubTabLayout getLayout() { return layout; } @@ -54,6 +61,4 @@ public class TwoLevelTab extends Tab { return layout; }
- - }
commit 84b7bda95f895864671f515285923186475638be Merge: 484719e... a13c17d... Author: Heiko W. Rupp <hwr@redhat.com> Date: Wed Aug 11 15:49:10 2010 +0200
Merge branch 'master' of ssh://git.fedorahosted.org/git/rhq/rhq
commit a13c17de245205bc8b5703ab6b45fa8300942b3e Author: Joseph Marques <joseph@redhat.com> Date: Wed Aug 11 07:21:50 2010 -0400
implement "plain" scheme using iframed-facelets for unfinished resource > operation tabs
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java index 88e1abd..ea7b88e 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java @@ -157,7 +157,17 @@ public class ResourceDetailView extends VLayout implements BookmarkableView, Res inventoryTab.updateSubTab("Children", ResourceSearchView.getChildrenOf(resource.getId())); inventoryTab.updateSubTab("Connection Settings", new PluginConfigurationEditView(resource)); // new ConfigurationEditor(resource.getId(), resource.getResourceType().getId(), ConfigurationEditor.ConfigType.plugin));
- operationsTab.updateSubTab("History", OperationHistoryView.getResourceHistoryView(resource)); + // comment out GWT-based operation history until... + // 1) user can delete history if they possess the appropriate permissions + // 2) user can see both operation arguments and results in the history details pop-up + // 3) operation arguments/results become read-only configuration data in the history details pop-up + // 4) user can navigate to the group operation that spawned this resource operation history, if appropriate + //operationsTab.updateSubTab("History", OperationHistoryView.getResourceHistoryView(resource)); + // note: enabled operation execution/schedules from left-nav, if it doesn't already exist + operationsTab.updateSubTab("History", new FullHTMLPane( + "/rhq/resource/operation/resourceOperationHistory-plain.xhtml?id=" + resource.getId())); + operationsTab.updateSubTab("Scheduled", new FullHTMLPane( + "/rhq/resource/operation/resourceOperationSchedules-plain.xhtml?id=" + resource.getId()));
configurationTab.updateSubTab("Current", new ResourceConfigurationEditView(resource)); configurationTab.updateSubTab("History", ConfigurationHistoryView.getHistoryOf(resource.getId())); diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/operation/resourceOperationHistory-plain.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/operation/resourceOperationHistory-plain.xhtml new file mode 100644 index 0000000..13ee0b0 --- /dev/null +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/operation/resourceOperationHistory-plain.xhtml @@ -0,0 +1,270 @@ +<ui:composition template="/rhq/resource/layout/main-plain.xhtml" + xmlns="http://www.w3.org/1999/xhtml" + xmlns:h="http://java.sun.com/jsf/html" + xmlns:f="http://java.sun.com/jsf/core" + xmlns:ui="http://java.sun.com/jsf/facelets" + xmlns:c="http://java.sun.com/jstl/core" + xmlns:onc="http://jboss.org/on/component" + xmlns:onf="http://jboss.org/on/function" + xmlns:s="http://jboss.com/products/seam/taglib" + xmlns:a4j="https://ajax4jsf.dev.java.net/ajax" + xmlns:rich="http://richfaces.ajax4jsf.org/rich"> + + <ui:define name="content"> + + <!-- + Resource Operation Pending History + --> + + <ui:param name="currentOperation" + value="#{ResourceOperationPendingHistoryUIBean.oldestInProgressResourceOperation}" /> + + <h:form id="pendingForm"> + <input type="hidden" name="id" value="${param.id}"/> + + <rich:panel styleClass="BlockContent"> + <f:facet name="header">In Progress Operations</f:facet> + + <a4j:keepAlive beanName="ResourceOperationPendingHistoryUIBean"/> + + <ui:param name="resourceOperationPendingHistoryDataModel" value="#{ResourceOperationPendingHistoryUIBean.dataModel}"/> + + <a4j:poll id="resourceOperationPendingHistoryDataTableReRenderer" + oncomplete="disableConditionalButtons();" + interval="60000" + ignoreDupResponses="true" + actionListener="#{ResourceOperationPendingHistoryUIBean.clearDataModel}" + reRender="resourceOperationPendingHistoryDataTable" /> + <rich:dataTable id="resourceOperationPendingHistoryDataTable" + rows="#{PageControl.ResourceOperationPendingHistory.pageSize}" + value="#{resourceOperationPendingHistoryDataModel}" + var="pendingItem" + width="100%" + columnsWidth="1%, 15%, 15%, 20%, 30%, 19%" + styleClass="resources-table" + footerClass="on-pager-footer" + onRowMouseOver="this.style.backgroundColor='#E7E7E7'" + onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"> + + <f:facet name="PageControlView"> + <onc:paginationControl id="ResourceOperationPendingHistory" /> + </f:facet> + + <rich:column> + <f:facet name="header"> + <onc:allSelect target="pendingSelectedItems" /> + </f:facet> + + <onc:select name="pendingSelectedItems" value="#{pendingItem.id}" /> + </rich:column> + + <rich:column> + <f:facet name="header"> + <onc:sortableColumnHeader sort="h.createdTime"> + <h:outputText styleClass="headerText" value="Date Submitted" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputText value="#{pendingItem.createdTime}"> + <f:converter converterId="UserDateTimeConverter" /> + </h:outputText> + </rich:column> + + <rich:column> + <f:facet name="header"> + <h:outputText styleClass="headerText" value="Name" /> + </f:facet> + + <h:outputLink value="/rhq/resource/operation/resourceOperationHistoryDetails-plain.xhtml" > + <f:param name="id" value="#{param.id}" /> + <f:param name="opId" value="#{pendingItem.id}" /> + <h:outputText value="#{pendingItem.operationDefinition.displayName}"/> + </h:outputLink> + + </rich:column> + + <rich:column> + <f:facet name="header"> + <h:outputText styleClass="headerText" value="Description" /> + </f:facet> + + <h:outputText value="#{pendingItem.operationDefinition.description}"/> + </rich:column> + + <rich:column> + <f:facet name="header"> + <onc:sortableColumnHeader sort="h.status"> + <h:outputText styleClass="headerText" value="Status" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputText value="#{pendingItem.status}"/> + </rich:column> + + <rich:column> + <f:facet name="header"> + <onc:sortableColumnHeader sort="h.subjectName"> + <h:outputText styleClass="headerText" value="User" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputText value="#{pendingItem.subjectName}"/> + </rich:column> + + <f:facet name="footer"> + <rich:columnGroup> + <rich:column colspan="6"> + <onc:selectCommandButton action="#{ResourceOperationPendingHistoryUIBean.cancel}" + value="CANCEL SELECTED" target="pendingSelectedItems" + styleClass="on-pager-button buttonsmall" + rendered="#{ResourceUIBean.permissions.control}"/> + + <ui:param name="paginationDataTableName" value="resourceOperationPendingHistoryDataTable"/> + <ui:param name="paginationDataModel" value="#{resourceOperationPendingHistoryDataModel}"/> + <ui:param name="paginationPageControl" value="#{PageControl.ResourceOperationPendingHistory}"/> + <ui:include src="/rhq/resource/include/pagination-plain.xhtml"/> + </rich:column> + </rich:columnGroup> + </f:facet> + + </rich:dataTable> + + </rich:panel> + </h:form> + + <!-- + Resource Operation Completed History + --> + + <h:form id="historyForm"> + <input type="hidden" name="id" value="${param.id}"/> + + <rich:panel styleClass="BlockContent"> + <f:facet name="header">Completed Operations</f:facet> + + <a4j:keepAlive beanName="ResourceOperationCompletedHistoryUIBean"/> + + <ui:param name="resourceOperationCompletedHistoryDataModel" value="#{ResourceOperationCompletedHistoryUIBean.dataModel}"/> + + <a4j:poll id="resourceOperationCompletedHistoryDataTableReRenderer" + oncomplete="disableConditionalButtons();" + interval="60000" + ignoreDupResponses="true" + actionListener="#{ResourceOperationCompletedHistoryUIBean.clearDataModel}" + reRender="resourceOperationCompletedHistoryDataTable" /> + <rich:dataTable id="resourceOperationCompletedHistoryDataTable" + rows="#{PageControl.ResourceOperationCompletedHistory.pageSize}" + value="#{resourceOperationCompletedHistoryDataModel}" + var="historyItem" + width="100%" + columnsWidth="1%, 12%, 12%, 17%, 37%, 11%, 11%" + rowKeyVar="rowIndex" + styleClass="resources-table" + footerClass="on-pager-footer" + onRowMouseOver="this.style.backgroundColor='#E7E7E7'" + onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"> + + <f:facet name="PageControlView"> + <onc:paginationControl id="ResourceOperationCompletedHistory" /> + </f:facet> + + <rich:column> + <f:facet name="header"> + <onc:allSelect target="completedSelectedItems" /> + </f:facet> + + <onc:select name="completedSelectedItems" value="#{historyItem.id}" /> + </rich:column> + + <rich:column> + <f:facet name="header"> + <onc:sortableColumnHeader sort="h.createdTime"> + <h:outputText styleClass="headerText" value="Date Submitted" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputText value="#{historyItem.createdTime}"> + <f:converter converterId="UserDateTimeConverter" /> + </h:outputText> + </rich:column> + + <rich:column> + <f:facet name="header"> + <onc:sortableColumnHeader sort="h.modifiedTime"> + <h:outputText styleClass="headerText" value="Date Completed" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputText value="#{historyItem.modifiedTime}"> + <f:converter converterId="UserDateTimeConverter" /> + </h:outputText> + </rich:column> + + <rich:column> + <f:facet name="header"> + <h:outputText styleClass="headerText" value="Name" /> + </f:facet> + + <h:outputLink value="/rhq/resource/operation/resourceOperationHistoryDetails-plain.xhtml" > + <f:param name="id" value="#{param.id}" /> + <f:param name="opId" value="#{historyItem.id}" /> + <h:outputText value="#{historyItem.operationDefinition.displayName}"/> + </h:outputLink> + </rich:column> + + <rich:column> + <f:facet name="header"> + <h:outputText styleClass="headerText" value="Description" /> + </f:facet> + + <h:outputText value="#{historyItem.operationDefinition.description}"/> + </rich:column> + + <rich:column> + <f:facet name="header"> + <onc:sortableColumnHeader sort="h.status"> + <h:outputText styleClass="headerText" value="Status" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputText rendered="#{historyItem.status ne 'FAILURE'}" value="#{historyItem.status}"/> + <onc:errorPopup popupId="completed-#{historyItem.id}" errorMessage="#{historyItem.errorMessage}" rendered="#{historyItem.status eq 'FAILURE'}">Failure</onc:errorPopup> + </rich:column> + + <rich:column> + <f:facet name="header"> + <onc:sortableColumnHeader sort="h.subjectName"> + <h:outputText styleClass="headerText" value="User" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputText value="#{historyItem.subjectName}"/> + </rich:column> + + <f:facet name="footer"> + <rich:columnGroup> + <rich:column colspan="7" width="100%"> + <onc:selectCommandButton action="#{ResourceOperationCompletedHistoryUIBean.delete}" + value="DELETE SELECTED" target="completedSelectedItems" + styleClass="on-pager-button buttonsmall" + rendered="#{ResourceUIBean.permissions.control}"/> + + <ui:param name="paginationDataTableName" value="resourceOperationCompletedHistoryDataTable"/> + <ui:param name="paginationDataModel" value="#{resourceOperationCompletedHistoryDataModel}"/> + <ui:param name="paginationPageControl" value="#{PageControl.ResourceOperationCompletedHistory}"/> + <ui:include src="/rhq/resource/include/pagination-plain.xhtml"/> + </rich:column> + </rich:columnGroup> + </f:facet> + + </rich:dataTable> + + <!-- use a hidden button trick (which sends the same action a column click would) so request params aren't lost --> + <h:commandButton id="hiddenHistoryButton" style="visibility: hidden;" action="#{TableSorter.obtainFromOutcome}" /> + + </rich:panel> + </h:form> + + </ui:define> + +</ui:composition> diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/operation/resourceOperationHistoryDetails-plain.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/operation/resourceOperationHistoryDetails-plain.xhtml new file mode 100644 index 0000000..d7d9f27 --- /dev/null +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/operation/resourceOperationHistoryDetails-plain.xhtml @@ -0,0 +1,122 @@ +<ui:composition template="/rhq/resource/layout/main-plain.xhtml" + xmlns="http://www.w3.org/1999/xhtml" + xmlns:h="http://java.sun.com/jsf/html" + xmlns:f="http://java.sun.com/jsf/core" + xmlns:ui="http://java.sun.com/jsf/facelets" + xmlns:c="http://java.sun.com/jstl/core" + xmlns:onc="http://jboss.org/on/component" + xmlns:onf="http://jboss.org/on/function" + xmlns:s="http://jboss.com/products/seam/taglib" + xmlns:a4j="https://ajax4jsf.dev.java.net/ajax" + xmlns:rich="http://richfaces.ajax4jsf.org/rich"> + + <ui:define name="content"> + <br/> + <ui:param name="item" value="#{ResourceOperationHistoryDetailsUIBean.history}" /> + + <h:form id="operationHistoryDetailsForm"> + <input type="hidden" name="id" value="${param.id}"/> + <input type="hidden" name="opId" value="${param.opId}"/> + + <a4j:keepAlive beanName="ResourceOperationHistoryDetailsUIBean" ajaxOnly="true"/> + + <h:outputLink value="/rhq/resource/operation/resourceOperationHistory-plain.xhtml"> + <f:param name="id" value="#{param.id}" /> + <h:outputText value="< Return to Operation History"/> + </h:outputLink> + + <rich:panel styleClass="BlockContent"> + <f:facet name="header">Details</f:facet> + <table> + <tr> + <td align="right" style="width: 150px;">Operation:</td> + <td align="left"> + <h:outputText value="#{item.operationDefinition.displayName}" /> + </td> + </tr> + <tr> + <td align="right">Date Submitted:</td> + <td align="left"> + <h:outputText value="#{item.createdTime}"> + <f:converter converterId="UserDateTimeConverter" /> + </h:outputText> + </td> + </tr> + <tr> + <td align="right">Date Completed:</td> + <td align="left"> + <h:outputText value="#{item.modifiedTime}" rendered="#{item.status ne 'INPROGRESS'}" > + <f:converter converterId="UserDateTimeConverter" /> + </h:outputText> + </td> + </tr> + <tr> + <td align="right">Requester:</td> + <td align="left"> + <h:outputText value="#{item.subjectName}" rendered="#{!(empty item.subjectName)}" /> + <h:outputText value="(unknown)" rendered="#{empty item.subjectName}" /> + </td> + </tr> + <tr> + <td align="right">Status:</td> + <td align="left"> + <h:outputText rendered="#{item.status eq 'SUCCESS' or item.status eq 'INPROGRESS'}" + value="#{item.status}"/> + <h:outputLink rendered="#{item.status ne 'SUCCESS' and item.status ne 'INPROGRESS'}" + value="#" id="resultsLink"> + <h:outputText value="#{item.status}"/> + <rich:componentControl for="resultsModalPanel" attachTo="resultsLink" operation="show" event="onclick"/> + </h:outputLink> + <rich:modalPanel id="resultsModalPanel" width="600" height="400" + style="overflow: auto;"> + <f:facet name="header"> + <h:panelGroup> + <h:outputText value="Results" /> + </h:panelGroup> + </f:facet> + <f:facet name="controls"> + <h:panelGroup> + <h:graphicImage value="/images/close.png" style="cursor:pointer" id="resultsModelPanelHideLink"/> + <rich:componentControl for="resultsModalPanel" attachTo="resultsModelPanelHideLink" operation="hide" event="onclick"/> + </h:panelGroup> + </f:facet> + <div class="ErrorModalBody"> + <h:outputText value="#{item.errorMessage}" /> + </div> + </rich:modalPanel> + </td> + </tr> + </table> + </rich:panel> + + <rich:panel styleClass="BlockContent"> + <f:facet name="header">Parameters</f:facet> + <onc:config configurationDefinition="#{ResourceOperationHistoryDetailsUIBean.parameters.configurationDefinition}" + configuration="#{ResourceOperationHistoryDetailsUIBean.parameters.configuration}" + readOnly="true" + nullConfigurationDefinitionMessage="#{ResourceOperationHistoryDetailsUIBean.parameters.nullConfigurationDefinitionMessage}" + nullConfigurationMessage="#{ResourceOperationHistoryDetailsUIBean.parameters.nullConfigurationMessage}" + nullConfigurationStyle="InfoBlock"/> + </rich:panel> + + <rich:panel styleClass="BlockContent"> + <f:facet name="header">Results</f:facet> + <onc:config configurationDefinition="#{ResourceOperationHistoryDetailsUIBean.results.configurationDefinition}" + configuration="#{ResourceOperationHistoryDetailsUIBean.results.configuration}" + readOnly="true" + nullConfigurationDefinitionMessage="#{ResourceOperationHistoryDetailsUIBean.results.nullConfigurationDefinitionMessage}" + nullConfigurationMessage="#{ResourceOperationHistoryDetailsUIBean.results.nullConfigurationMessage}" + nullConfigurationStyle="InfoBlock" + rendered="#{item.status ne 'INPROGRESS'}" /> + </rich:panel> + + <h:outputLink value="/rhq/resource/operation/resourceOperationHistory-plain.xhtml"> + <f:param name="id" value="#{param.id}" /> + <h:outputText value="< Return to Operation History"/> + </h:outputLink> + + </h:form> + + </ui:define> + +</ui:composition> diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/operation/resourceOperationScheduleDetails-plain.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/operation/resourceOperationScheduleDetails-plain.xhtml new file mode 100644 index 0000000..95f9a96 --- /dev/null +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/operation/resourceOperationScheduleDetails-plain.xhtml @@ -0,0 +1,73 @@ +<ui:composition template="/rhq/resource/layout/main-plain.xhtml" + xmlns="http://www.w3.org/1999/xhtml" + xmlns:h="http://java.sun.com/jsf/html" + xmlns:f="http://java.sun.com/jsf/core" + xmlns:ui="http://java.sun.com/jsf/facelets" + xmlns:c="http://java.sun.com/jstl/core" + xmlns:onc="http://jboss.org/on/component" + xmlns:onf="http://jboss.org/on/function" + xmlns:s="http://jboss.com/products/seam/taglib" + xmlns:a4j="https://ajax4jsf.dev.java.net/ajax" + xmlns:rich="http://richfaces.ajax4jsf.org/rich"> + + <ui:define name="content"> + <br/> + <!-- Resource Operation Schedules --> + <h:form id="scheduleForm"> + <input type="hidden" name="id" value="${param.id}"/> + + <h:outputLink value="/rhq/resource/operation/resourceOperationSchedules-plain.xhtml"> + <f:param name="id" value="#{param.id}" /> + <h:outputText value="< Return to Operation Schedules"/> + </h:outputLink> + + <rich:panel styleClass="BlockContent"> + <f:facet name="header">General Info</f:facet> + <table> + <tr> + <td align="right" style="width: 125px;">Operation:</td> + <td align="left"> + <h:outputText value="#{item.operationDisplayName}" /> + </td> + </tr> + <tr> + <td align="right" style="width: 125px;">Scheduled By:</td> + <td align="left"> + <h:outputText value="#{item.subject.name}" /> + </td> + </tr> + <tr> + <td align="right" style="width: 125px;">Notes:</td> + <td align="left"> + <h:outputText value="#{item.description}" /> + </td> + </tr> + </table> + </rich:panel> + + <rich:panel styleClass="BlockContent"> + <f:facet name="header">Parameters</f:facet> + <onc:config configurationDefinition="#{ResourceOperationScheduleDetailsUIBean.parameters.configurationDefinition}" + configuration="#{ResourceOperationScheduleDetailsUIBean.parameters.configuration}" + readOnly="true" + nullConfigurationDefinitionMessage="#{ResourceOperationScheduleDetailsUIBean.parameters.nullConfigurationDefinitionMessage}" + nullConfigurationMessage="#{ResourceOperationScheduleDetailsUIBean.parameters.nullConfigurationMessage}" + nullConfigurationStyle="InfoBlock"/> + </rich:panel> + + <rich:panel styleClass="BlockContent"> + <f:facet name="header">Schedule Details</f:facet> + + <onc:operationScheduler scheduleDetails="#{ResourceOperationScheduleDetailsUIBean.operationDetails}" readOnly="true"/> + </rich:panel> + + <h:outputLink value="/rhq/resource/operation/resourceOperationSchedules-plain.xhtml"> + <f:param name="id" value="#{param.id}" /> + <h:outputText value="< Return to Operation Schedules"/> + </h:outputLink> + + </h:form> + + </ui:define> + +</ui:composition> diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/operation/resourceOperationSchedules-plain.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/operation/resourceOperationSchedules-plain.xhtml new file mode 100644 index 0000000..ef0b83f --- /dev/null +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/operation/resourceOperationSchedules-plain.xhtml @@ -0,0 +1,104 @@ +<ui:composition template="/rhq/resource/layout/main-plain.xhtml" + xmlns="http://www.w3.org/1999/xhtml" + xmlns:h="http://java.sun.com/jsf/html" + xmlns:f="http://java.sun.com/jsf/core" + xmlns:ui="http://java.sun.com/jsf/facelets" + xmlns:c="http://java.sun.com/jstl/core" + xmlns:onc="http://jboss.org/on/component" + xmlns:onf="http://jboss.org/on/function" + xmlns:s="http://jboss.com/products/seam/taglib" + xmlns:a4j="https://ajax4jsf.dev.java.net/ajax" + xmlns:rich="http://richfaces.ajax4jsf.org/rich"> + + <ui:define name="content"> + + <!-- Resource Operation Schedules --> + <h:form id="scheduleForm"> + <input type="hidden" name="id" value="${param.id}"/> + + <!-- Operation Schedule Table --> + <rich:panel styleClass="BlockContent"> + + <ui:param name="resourceOperationScheduleDataModel" value="#{ResourceOperationScheduleUIBean.dataModel}"/> + <rich:dataTable id="resourceOperationScheduleDataTable" + rows="0" + value="#{resourceOperationScheduleDataModel}" + var="item" + width="100%" + columnsWidth="1%, 30%, 39%, 30%" + styleClass="resources-table" + headerClass="tableRowHeader" + footerClass="on-pager-footer" + onRowMouseOver="this.style.backgroundColor='#E7E7E7'" + onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"> + + <f:facet name="PageControlView"> + <onc:paginationControl id="NONE" /> + </f:facet> + + <rich:column style="width: 1px;"> + <f:facet name="header"> + <onc:allSelect target="selectedItems" /> + </f:facet> + <onc:select name="selectedItems" value="#{item.jobId}" /> + </rich:column> + + <rich:column rendered="#{param.debug}"> + <f:facet name="header"> + <h:outputText styleClass="headerText" value="Job ID" /> + </f:facet> + <h:commandLink action="#{ResourceOperationScheduleUIBean.selectScheduleToView}"> + <h:outputText value="#{item.jobId}" /> + </h:commandLink> + </rich:column> + + <rich:column> + <f:facet name="header"> + <h:outputText styleClass="headerText" value="Name" /> + </f:facet> + + <h:outputLink value="/rhq/resource/operation/resourceOperationScheduleDetails-plain.xhtml" > + <f:param name="id" value="#{param.id}" /> + <f:param name="jobId" value="#{item.jobId}" /> + <h:outputText value="#{item.operationDisplayName}"/> + </h:outputLink> + </rich:column> + + <rich:column> + <f:facet name="header"> + <h:outputText styleClass="headerText" value="Notes" /> + </f:facet> + <h:outputText value="#{item.description}" /> + </rich:column> + + <rich:column> + <f:facet name="header"> + <h:outputText styleClass="headerText" value="User" /> + </f:facet> + <h:outputText value="#{item.subject.name}"/> + </rich:column> + + <f:facet name="footer"> + <rich:columnGroup> + <rich:column colspan="4" width="100%"> + <onc:selectCommandButton action="#{ResourceOperationScheduleUIBean.unschedule}" + value="UNSCHEDULE" target="selectedItems" + styleClass="on-pager-button buttonsmall" + rendered="#{ResourceUIBean.permissions.control}"/> + <onc:selectCommandButton action="#{ResourceOperationScheduleUIBean.executeNow}" + value="EXECUTE NOW" target="selectedItems" + styleClass="on-pager-button buttonsmall" + low="1" high="1" + rendered="#{ResourceUIBean.permissions.control}"/> + </rich:column> + </rich:columnGroup> + </f:facet> + + </rich:dataTable> + + </rich:panel> + </h:form> + + </ui:define> + +</ui:composition>
commit 4274e4c27857fec55a502d90ba0675bcf398f290 Author: Joseph Marques <joseph@redhat.com> Date: Wed Aug 11 07:21:31 2010 -0400
implement "plain" scheme using iframed-facelets for unfinished resource > alerts tabs
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java index bd39bfc..88e1abd 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java @@ -162,9 +162,17 @@ public class ResourceDetailView extends VLayout implements BookmarkableView, Res configurationTab.updateSubTab("Current", new ResourceConfigurationEditView(resource)); configurationTab.updateSubTab("History", ConfigurationHistoryView.getHistoryOf(resource.getId()));
- alertsTab.updateSubTab("History", new ResourceAlertHistoryView(resource.getId())); - alertsTab.updateSubTab("Definitions", AlertDefinitionsView.getResourceView(resource)); - + // comment out GWT-based alert definitions/history views until... + // 1) new workflow is implement for alert definition creation, with particular attention to interaction model for alert notifications + // 2) user can delete/ack/purgeAll alerts if they possess the appropriate permissions + // 3) user can enable/disable/delete alert definitions if they possess the appropriate permissions + // 4) user can search alert history by: date alert was fired, alert priority, or alert definition + //alertsTab.updateSubTab("History", new ResourceAlertHistoryView(resource.getId())); + //alertsTab.updateSubTab("Definitions", AlertDefinitionsView.getResourceView(resource)); + alertsTab.updateSubTab("History", new FullHTMLPane("/rhq/resource/alert/listAlertHistory-plain.xhtml?id=" + + resource.getId())); + alertsTab.updateSubTab("Definitions", new FullHTMLPane( + "/rhq/resource/alert/listAlertDefinitions-plain.xhtml?id=" + resource.getId()));
// comment out GWT-based view until... // 1) user can search event history by: metric display range, event source, event details, event severity diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/alert/listAlertDefinitions-plain.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/alert/listAlertDefinitions-plain.xhtml new file mode 100644 index 0000000..746eb4a --- /dev/null +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/alert/listAlertDefinitions-plain.xhtml @@ -0,0 +1,161 @@ +<ui:composition template="/rhq/resource/layout/main-plain.xhtml" + xmlns="http://www.w3.org/1999/xhtml" + xmlns:h="http://java.sun.com/jsf/html" + xmlns:f="http://java.sun.com/jsf/core" + xmlns:ui="http://java.sun.com/jsf/facelets" + xmlns:c="http://java.sun.com/jstl/core" + xmlns:onc="http://jboss.org/on/component" + xmlns:onf="http://jboss.org/on/function" + xmlns:s="http://jboss.com/products/seam/taglib" + xmlns:a4j="https://ajax4jsf.dev.java.net/ajax" + xmlns:rich="http://richfaces.ajax4jsf.org/rich"> + + <ui:define name="content"> + + <h:form id="alertDefinitionsListForm"> + <input type="hidden" name="id" value="${param.id}"/> + + <rich:panel styleClass="BlockContent"> + + <a4j:keepAlive beanName="ListAlertDefinitionsUIBean"/> + + <ui:param name="alertDefinitionsDataModel" value="#{ListAlertDefinitionsUIBean.dataModel}"/> + <rich:dataTable id="alertDefinitionsDataTable" + rows="#{PageControl.AlertDefinitionsList.pageSize}" + value="#{alertDefinitionsDataModel}" + var="item" + width="100%" + columnsWidth="1%, 25%, 30%, 20%, 5%, 14%, 5%" + styleClass="resources-table" + footerClass="on-pager-footer" + onRowMouseOver="this.style.backgroundColor='#E7E7E7'" + onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"> + + + <f:facet name="PageControlView"> + <onc:paginationControl id="AlertDefinitionsList" /> + </f:facet> + + <rich:column> + <f:facet name="header"> + <onc:allSelect target="selectedAlertDefinitions" /> + </f:facet> + + <onc:select name="selectedAlertDefinitions" value="#{item.id}" /> + </rich:column> + + <rich:column> + <f:facet name="header"> + <onc:sortableColumnHeader sort="a.name"> + <h:outputText styleClass="headerText" value="Name" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputLink value="/alerts/Config.do"> + <f:param name="mode" value="viewRoles"/> + <f:param name="id" value="#{Resource.id}"/> + <f:param name="ad" value="#{item.id}"/> + <h:outputText value="#{item.name}" /> + </h:outputLink> + </rich:column> + + <rich:column> + <f:facet name="header"> + <onc:sortableColumnHeader sort="a.description"> + <h:outputText styleClass="headerText" value="Description" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputText value="#{item.description}"/> + </rich:column> + + <rich:column> + <f:facet name="header"> + <onc:sortableColumnHeader sort="a.ctime"> + <h:outputText styleClass="headerText" value="Date Created" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputText value="#{item.ctime}"> + <f:converter converterId="UserDateTimeConverter" /> + </h:outputText> + </rich:column> + + <rich:column> + <f:facet name="header"> + <onc:sortableColumnHeader sort="a.enabled"> + <h:outputText styleClass="headerText" value="Active" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputText value="#{item.enabled}"/> + </rich:column> + + <rich:column> + <f:facet name="header"> + <h:outputText styleClass="headerText" value="Parent" /> + </f:facet> + + <h:outputLink value="/alerts/Config.do" rendered="#{item.parentId ne 0}"> + <f:param name="mode" value="viewRoles"/> + <f:param name="type" value="#{item.resource.resourceType.id}"/> + <f:param name="from" value="#{item.id}"/> + <f:param name="ad" value="#{item.parentId}"/> + <h:outputText value="View Template" /> + </h:outputLink> + + <h:outputLink value="/alerts/Config.do" rendered="#{not empty item.groupAlertDefinition}"> + <f:param name="mode" value="viewRoles"/> + <f:param name="groupId" value="#{item.groupAlertDefinition.resourceGroup.id}"/> + <f:param name="from" value="#{item.id}"/> + <f:param name="ad" value="#{item.groupAlertDefinition.id}"/> + <h:outputText value="View Group Definition" /> + </h:outputLink> + </rich:column> + + <rich:column> + <f:facet name="header"> + <h:outputText styleClass="headerText" value="Read Only" /> + </f:facet> + + <h:outputText value="N/A" rendered="#{item.parentId eq 0 and empty item.groupAlertDefinition}"/> + <h:outputText value="#{item.readOnly}" rendered="#{item.parentId ne 0 or not empty item.groupAlertDefinition}"/> + </rich:column> + + <f:facet name="footer"> + <rich:columnGroup> + <rich:column colspan="7" width="100%"> + <h:commandButton action="#{ListAlertDefinitionsUIBean.createNewAlertDefinition}" + value="NEW DEFINITION" styleClass="on-pager-button buttonsmall" + rendered="#{ResourceUIBean.permissions.alert}" > + <f:param name="id" value="${param.id}"/> + <f:param name="mode" value="new"/> + </h:commandButton> + <onc:selectCommandButton action="#{ListAlertDefinitionsUIBean.enableSelectedAlertDefinitions}" + value="ENABLE SELECTED" target="selectedAlertDefinitions" styleClass="on-pager-button buttonsmall" + rendered="#{ResourceUIBean.permissions.alert}" /> + <onc:selectCommandButton action="#{ListAlertDefinitionsUIBean.disableSelectedAlertDefinitions}" + value="DISABLE SELECTED" target="selectedAlertDefinitions" styleClass="on-pager-button buttonsmall" + rendered="#{ResourceUIBean.permissions.alert}" /> + <onc:selectCommandButton action="#{ListAlertDefinitionsUIBean.deleteSelectedAlertDefinitions}" + value="DELETE SELECTED" target="selectedAlertDefinitions" styleClass="on-pager-button buttonsmall" + rendered="#{ResourceUIBean.permissions.alert}" /> + <onc:selectCommandButton action="#{ListAlertDefinitionsUIBean.copySelectedAlertDefinitions}" + value="COPY SELECTED" target="selectedAlertDefinitions" styleClass="on-pager-button buttonsmall" + rendered="#{ResourceUIBean.permissions.alert and param.debug}" /> + + <ui:param name="paginationDataTableName" value="alertDefinitionsDataTable"/> + <ui:param name="paginationDataModel" value="#{alertDefinitionsDataModel}"/> + <ui:param name="paginationPageControl" value="#{PageControl.AlertDefinitionsList}"/> + <ui:include src="/rhq/resource/include/pagination-plain.xhtml"/> + </rich:column> + </rich:columnGroup> + </f:facet> + + </rich:dataTable> + + </rich:panel> + </h:form> + + </ui:define> +</ui:composition> diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/alert/listAlertHistory-plain.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/alert/listAlertHistory-plain.xhtml new file mode 100644 index 0000000..a6cb1fb --- /dev/null +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/alert/listAlertHistory-plain.xhtml @@ -0,0 +1,210 @@ +<ui:composition template="/rhq/resource/layout/main-plain.xhtml" + xmlns="http://www.w3.org/1999/xhtml" + xmlns:h="http://java.sun.com/jsf/html" + xmlns:f="http://java.sun.com/jsf/core" + xmlns:ui="http://java.sun.com/jsf/facelets" + xmlns:c="http://java.sun.com/jstl/core" + xmlns:onc="http://jboss.org/on/component" + xmlns:onf="http://jboss.org/on/function" + xmlns:s="http://jboss.com/products/seam/taglib" + xmlns:a4j="https://ajax4jsf.dev.java.net/ajax" + xmlns:rich="http://richfaces.ajax4jsf.org/rich"> + + <ui:define name="content"> + + <h:form id="alertHistoryForm"> + <input type="hidden" name="id" value="${param.id}"/> + + <rich:panel styleClass="BlockContent"> + + <h:panelGrid columns="4" cellspacing="3"> + <h:outputLabel for="alertDefinitionFilter" value="Alert Definition Filter: " /> + <h:selectOneMenu id="alertDefinitionFilter" value="#{ListAlertHistoryUIBean.alertDefinitionFilter}" + style="width: 300px;"> + <a4j:support event="onchange" + reRender="alertHistoryDataTable, alertHistoryDataTableScroller, dateErrors" + actionListener="#{ListAlertHistoryUIBean.clearDataModel}" /> + + <f:selectItems value="#{ListAlertHistoryUIBean.alertDefinitionSelectItems}"/> + </h:selectOneMenu> + <rich:spacer/> + <rich:spacer/> + + <h:outputLabel for="alertPriorityFilter" value="Alert Priority Filter: " /> + <h:selectOneMenu id="alertPriorityFilter" value="#{ListAlertHistoryUIBean.alertPriorityFilter}" + style="width: 300px;"> + <a4j:support event="onchange" + reRender="alertHistoryDataTable, alertHistoryDataTableScroller, dateErrors" + actionListener="#{ListAlertHistoryUIBean.clearDataModel}" /> + + <f:selectItems value="#{ListAlertHistoryUIBean.alertPrioritySelectItems}"/> + </h:selectOneMenu> + <rich:spacer/> + <rich:spacer/> + + <h:outputLabel for="dateFilter" value="Date Filter: " /> + <h:inputText id="dateFilter" value="#{ListAlertHistoryUIBean.dateFilter}" + onkeypress="return ignoreEnterKey(event);" + style="width: 300px;" /> + <a4j:commandButton value="GO" + reRender="alertHistoryDataTable, alertHistoryDataTableScroller, dateErrors" + actionListener="#{ListAlertHistoryUIBean.clearDataModel}" + styleClass="buttonmed"> + <s:defaultAction /> + </a4j:commandButton> + <h:outputText id="dateErrors" value="#{ListAlertHistoryUIBean.dateErrors}" /> + </h:panelGrid> + + <br/> + + <ui:param name="alertHistoryDataModel" value="#{ListAlertHistoryUIBean.dataModel}"/> + <rich:dataTable id="alertHistoryDataTable" + rows="#{PageControl.AlertHistoryList.pageSize}" + value="#{alertHistoryDataModel}" + var="item" + width="100%" + columnsWidth="1%, 15%, 20%, 20%, 20%, 7%, 8%, 9%" + styleClass="resources-table" + footerClass="on-pager-footer" + onRowMouseOver="this.style.backgroundColor='#E7E7E7'" + onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"> + + <f:facet name="PageControlView"> + <onc:paginationControl id="AlertHistoryList" /> + </f:facet> + + <rich:column> + <f:facet name="header"> + <onc:allSelect target="selectedAlerts" /> + </f:facet> + + <onc:select name="selectedAlerts" value="#{item.alert.id}" /> + </rich:column> + + <rich:column rendered="#{param.debug}"> + <f:facet name="header"> + <onc:sortableColumnHeader sort="a.id"> + <h:outputText styleClass="headerText" value="ID" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputText value="#{item.alert.id}"/> + </rich:column> + + <rich:column> + <f:facet name="header"> + <onc:sortableColumnHeader sort="a.alertDefinition.priority"> + <h:outputText styleClass="headerText" value="Priority" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:graphicImage value="/images/icons/Flag_blue_16.png" rendered="#{item.alert.alertDefinition.priority.name == 'LOW'}"/> + <h:graphicImage value="/images/icons/Flag_yellow_16.png" rendered="#{item.alert.alertDefinition.priority.name == 'MEDIUM'}"/> + <h:graphicImage value="/images/icons/Flag_red_16.png" rendered="#{item.alert.alertDefinition.priority.name == 'HIGH'}"/> + + <h:outputText value="#{item.alert.alertDefinition.priority.name}"/> + </rich:column> + + <rich:column> + <f:facet name="header"> + <onc:sortableColumnHeader sort="a.ctime"> + <h:outputText styleClass="headerText" value="Date Created" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputLink value="/alerts/Alerts.do"> + <f:param name="mode" value="viewAlert" /> + <f:param name="id" value="#{Resource.id}" /> + <f:param name="a" value="#{item.alert.id}" /> + <h:outputText value="#{item.alert.ctime}"> + <f:converter converterId="UserDateTimeConverter" /> + </h:outputText> + </h:outputLink> + </rich:column> + + <rich:column> + <f:facet name="header"> + <onc:sortableColumnHeader sort="a.alertDefinition.name"> + <h:outputText styleClass="headerText" value="Alert Definition" /> + </onc:sortableColumnHeader> + </f:facet> + + <h:outputLink value="/alerts/Config.do"> + <f:param name="mode" value="viewRoles" /> + <f:param name="id" value="#{Resource.id}"/> + <f:param name="ad" value="#{item.alert.alertDefinition.id}"/> + <h:outputText value="#{item.alert.alertDefinition.name}" /> + </h:outputLink> + </rich:column> + + <rich:column> + <f:facet name="header"> + <h:outputText styleClass="headerText" value="Alert Condition" /> + </f:facet> + <h:outputText value="#{item.conditionText}" /> + </rich:column> + + <rich:column> + <f:facet name="header"> + <h:outputText styleClass="headerText" value="Actual Value" /> + </f:facet> + <h:outputText value="#{item.conditionValue}" /> + </rich:column> + + <rich:column> + <f:facet name="header"> + <h:outputText styleClass="headerText" value="Ack by" /> + </f:facet> + <h:outputText value="#{item.alert.acknowledgingSubject}" /> + </rich:column> + + <rich:column> + <f:facet name="header"> + <onc:sortableColumnHeader sort="a.acknowledgeTime"> + <h:outputText styleClass="headerText" value="Ack date" /> + </onc:sortableColumnHeader> + </f:facet> + <h:outputText value="#{item.alert.acknowledgeTime}"> + <f:converter converterId="RelativeDurationConverter" /> + </h:outputText> + </rich:column> + + <rich:column> + <f:facet name="header"> + <h:outputText styleClass="headerText" value="Recovery Info" /> + </f:facet> + <h:outputText value="#{item.recoveryInfo}" /> + </rich:column> + + <f:facet name="footer"> + <rich:columnGroup> + <rich:column colspan="9" width="100%"> + <onc:selectCommandButton action="#{ListAlertHistoryUIBean.deleteSelectedAlerts}" + value="DELETE SELECTED" target="selectedAlerts" styleClass="on-pager-button buttonsmall" + rendered="#{ResourceUIBean.permissions.alert}" /> + <h:commandButton action="#{ListAlertHistoryUIBean.purgeAllAlerts}" + value="PURGE ALL" styleClass="on-pager-button buttonsmall" + rendered="#{ResourceUIBean.permissions.alert}" /> + <onc:selectCommandButton action="#{ListAlertHistoryUIBean.acknowledgeSelectedAlerts}" + value="ACKNOWLEDGE SELECTED" target="selectedAlerts" styleClass="on-pager-button buttonsmall" + rendered="#{ResourceUIBean.permissions.alert}" /> + + + + <ui:param name="paginationDataTableName" value="alertHistoryDataTable"/> + <ui:param name="paginationDataModel" value="#{alertHistoryDataModel}"/> + <ui:param name="paginationPageControl" value="#{PageControl.AlertHistoryList}"/> + <ui:include src="/rhq/resource/include/pagination-plain.xhtml"/> + </rich:column> + </rich:columnGroup> + </f:facet> + + </rich:dataTable> + + <a4j:keepAlive beanName="ListAlertHistoryUIBean"/> + + </rich:panel> + </h:form> + + </ui:define> +</ui:composition>
commit 0245ea3ea921514be30422fa5a6c62340f1a6736 Author: Joseph Marques <joseph@redhat.com> Date: Wed Aug 11 07:20:41 2010 -0400
implement "plain" scheme using iframed-facelets for unfinished resource > content tabs
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java index 8944436..bd39bfc 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java @@ -166,10 +166,6 @@ public class ResourceDetailView extends VLayout implements BookmarkableView, Res alertsTab.updateSubTab("Definitions", AlertDefinitionsView.getResourceView(resource));
- contentTab.updateSubTab("Deployed", new FullHTMLPane("/rhq/resource/content/view-plain.xhtml?id=" + resource.getId())); - contentTab.updateSubTab("New", new FullHTMLPane("/rhq/resource/content/deploy-plain.xhtml?id=" + resource.getId())); - contentTab.updateSubTab("Subscriptions", new FullHTMLPane("/rhq/resource/content/subscription-plain.xhtml?id=" + resource.getId())); - contentTab.updateSubTab("History", new FullHTMLPane("/rhq/resource/content/history-plain.xhtml?id=" + resource.getId())); // comment out GWT-based view until... // 1) user can search event history by: metric display range, event source, event details, event severity // 2) user can delete events if they possess the appropriate permissions @@ -177,6 +173,14 @@ public class ResourceDetailView extends VLayout implements BookmarkableView, Res eventsTab.updateSubTab("History", new FullHTMLPane("/rhq/resource/events/history-plain.xhtml?id=" + resource.getId()));
+ contentTab.updateSubTab("Deployed", new FullHTMLPane("/rhq/resource/content/view-plain.xhtml?id=" + + resource.getId())); + contentTab.updateSubTab("New", new FullHTMLPane("/rhq/resource/content/deploy-plain.xhtml?id=" + + resource.getId())); + contentTab.updateSubTab("Subscriptions", new FullHTMLPane("/rhq/resource/content/subscription-plain.xhtml?id=" + + resource.getId())); + contentTab.updateSubTab("History", new FullHTMLPane("/rhq/resource/content/history-plain.xhtml?id=" + + resource.getId()));
// topTabSet.setSelectedTab(selectedTab);
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/content/deploy-plain.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/content/deploy-plain.xhtml index ef85b15..28cc396 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/content/deploy-plain.xhtml +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/content/deploy-plain.xhtml @@ -1,34 +1,27 @@ -<?xml version="1.0"?> - -<!DOCTYPE html - PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml" +<ui:composition template="/rhq/resource/layout/main-plain.xhtml" + xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:c="http://java.sun.com/jstl/core" xmlns:onc="http://jboss.org/on/component" + xmlns:onf="http://jboss.org/on/function" + xmlns:s="http://jboss.com/products/seam/taglib" xmlns:a4j="https://ajax4jsf.dev.java.net/ajax" xmlns:rich="http://richfaces.ajax4jsf.org/rich">
-<head> - <link rel="stylesheet" href="/css/win.css" type="text/css"/> -</head> -<body> + <ui:define name="content">
<h:form id="currentPackageVersionsForm"> <input type="hidden" name="id" value="${param.id}"/>
<rich:panel styleClass="BlockContent"> - <f:facet name="header"><h:outputText value="Packages Eligible for Deployment"/></f:facet>
<p>The following packages were found from the repositories currently subscribed to by this resource. In order to enable more existing packages for deployment, use the subscriptions sub-tab to subscribe this resource to more repositories.</p>
- <a4j:keepAlive beanName="ResourcePackageVersionsUIBean"/> + <a4j:keepAlive beanName="ResourcePackageVersionsUIBean"/>
<ui:param name="resourcePackageVersionsDataModel" value="#{ResourcePackageVersionsUIBean.dataModel}"/> <rich:dataTable id="resourcePackageVersionsDataTable" @@ -37,7 +30,7 @@ var="item" width="100%" columnsWidth="1%, 15%, 10%, 10%, 10%, 54%" - headerClass="tableRowHeader" + styleClass="resources-table" footerClass="on-pager-footer" onRowMouseOver="this.style.backgroundColor='#E7E7E7'" onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"> @@ -113,7 +106,7 @@ value="DEPLOY SELECTED" target="selectedPackages" styleClass="on-pager-button buttonsmall" rendered="${ResourceUIBean.permissions.content}"/>
- <ui:include src="/rhq/resource/include/pagination.xhtml"> + <ui:include src="/rhq/resource/include/pagination-plain.xhtml"> <ui:param name="paginationDataTableName" value="resourcePackageVersionsDataTable"/> <ui:param name="paginationDataModel" value="#{resourcePackageVersionsDataModel}"/> <ui:param name="paginationPageControl" value="#{PageControl.ResourcePackageVersionsList}"/> @@ -144,5 +137,5 @@ </rich:panel>
</h:form> -</body> -</html> + </ui:define> +</ui:composition> diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/content/history-plain.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/content/history-plain.xhtml index 01ae31c..a237c26 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/content/history-plain.xhtml +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/content/history-plain.xhtml @@ -24,7 +24,7 @@ <h:form id="contentaRequestsForm"> <input type="hidden" name="id" value="${param.id}"/>
-<rich:panel> +<rich:panel styleClass="BlockContent"> <f:facet name="header"><h:outputText value="Currently Executing Requests"/></f:facet>
<i><h:outputText value="There are no currently executing content requests" @@ -37,7 +37,7 @@ var="item" width="100%" columnsWidth="16%, 17%, 16%, 16%, 16%, 16%" - headerClass="tableRowHeader" + styleClass="resources-table" footerClass="on-pager-footer" onRowMouseOver="this.style.backgroundColor='#E7E7E7'" onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"> @@ -124,7 +124,7 @@ <ui:param name="paginationDataTableName" value="contentInProgressRequestsDataTable"/> <ui:param name="paginationDataModel" value="#{ListInProgressContentRequestsUIBean.dataModel}"/> <ui:param name="paginationPageControl" value="#{PageControl.ContentInProgressRequestsList}"/> - <ui:include src="../include/pagination.xhtml"/> + <ui:include src="/rhq/resource/include/pagination-plain.xhtml"/> </rich:column> </rich:columnGroup> </f:facet> @@ -134,13 +134,12 @@
</rich:panel>
-<rich:panel> +<rich:panel styleClass="BlockContent"> <f:facet name="header"><h:outputText value="Completed Requests"/></f:facet>
<i><h:outputText value="There are no completed content requests" rendered="#{ListCompletedContentRequestsUIBean.dataModel.rowCount eq 0}"/></i>
- <rich:dataTable rendered="#{ListCompletedContentRequestsUIBean.dataModel.rowCount gt 0}" binding="#{ListCompletedContentRequestsUIBean.dataTable}" id="contentCompletedRequestsDataTable" @@ -149,7 +148,7 @@ var="item" width="100%" columnsWidth="16%, 17%, 16%, 16%, 16%, 16%" - headerClass="tableRowHeader" + styleClass="resources-table" footerClass="on-pager-footer" onRowMouseOver="this.style.backgroundColor='#E7E7E7'" onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"> @@ -236,18 +235,16 @@ <ui:param name="paginationDataTableName" value="contentCompletedRequestsDataTable"/> <ui:param name="paginationDataModel" value="#{ListCompletedContentRequestsUIBean.dataModel}"/> <ui:param name="paginationPageControl" value="#{PageControl.ContentCompletedRequestsList}"/> - <ui:include src="../include/pagination.xhtml"/> + <ui:include src="/rhq/resource/include/pagination-plain.xhtml"/> </rich:column> </rich:columnGroup> </f:facet>
</rich:dataTable> - - </rich:panel>
-<rich:panel> +<rich:panel styleClass="BlockContent"> <f:facet name="header"><h:outputText value="Full Package Audit Trail"/></f:facet>
<p>The following is a complete listing of all of the package operations that have occurred on this resource. @@ -266,7 +263,7 @@ var="item" width="100%" columnsWidth="20%, 20%, 20%, 10%, 20%, 10%" - headerClass="tableRowHeader" + styleClass="resources-table" footerClass="on-pager-footer" onRowMouseOver="this.style.backgroundColor='#E7E7E7'" onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"> @@ -346,15 +343,13 @@ <ui:param name="paginationDataTableName" value="auditTrailDataTable"/> <ui:param name="paginationDataModel" value="#{AuditTrailUIBean.dataModel}"/> <ui:param name="paginationPageControl" value="#{PageControl.AuditTrailList}"/> - <ui:include src="../include/pagination.xhtml"/> + <ui:include src="/rhq/resource/include/pagination-plain.xhtml"/> </rich:column> </rich:columnGroup> </f:facet>
- </rich:dataTable>
- </rich:panel>
</h:form> diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/content/installed_package_details-plain.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/content/installed_package_details-plain.xhtml index cf93350..61d62b0 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/content/installed_package_details-plain.xhtml +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/content/installed_package_details-plain.xhtml @@ -1,24 +1,16 @@ -<?xml version="1.0"?> - -<!DOCTYPE html - PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml" +<ui:composition template="/rhq/resource/layout/main-plain.xhtml" + xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:c="http://java.sun.com/jstl/core" xmlns:onc="http://jboss.org/on/component" - xmlns:rich="http://richfaces.ajax4jsf.org/rich" - xmlns:a4j="http://richfaces.org/a4j"> - - + xmlns:onf="http://jboss.org/on/function" + xmlns:s="http://jboss.com/products/seam/taglib" + xmlns:a4j="https://ajax4jsf.dev.java.net/ajax" + xmlns:rich="http://richfaces.ajax4jsf.org/rich">
-<head> - <link rel="stylesheet" href="/css/win.css" type="text/css"/> -</head> -<body> + <ui:define name="content">
<a4j:keepAlive beanName="ListPackageHistoryUIBean"/>
@@ -73,7 +65,6 @@ var="item" width="100%" columnsWidth="20%, 20%, 20%, 20%, 20%" - headerClass="tableRowHeader" footerClass="on-pager-footer" onRowMouseOver="this.style.backgroundColor='#E7E7E7'" onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"> @@ -153,5 +144,5 @@ <h:outputLink value="/rhq/resource/content/view-plain.xhtml?id=#{param.id}"> <h:outputText value="Return to Packages"/> </h:outputLink> -</body> -</html> + </ui:define> +</ui:composition> diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/content/subscription-plain.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/content/subscription-plain.xhtml index c5fb200..c5e970d 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/content/subscription-plain.xhtml +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/content/subscription-plain.xhtml @@ -1,30 +1,24 @@ -<?xml version="1.0"?> - -<!DOCTYPE html - PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml" +<ui:composition template="/rhq/resource/layout/main-plain.xhtml" + xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:c="http://java.sun.com/jstl/core" xmlns:onc="http://jboss.org/on/component" xmlns:onf="http://jboss.org/on/function" + xmlns:s="http://jboss.com/products/seam/taglib" xmlns:a4j="https://ajax4jsf.dev.java.net/ajax" xmlns:rich="http://richfaces.ajax4jsf.org/rich">
-<head> - <link rel="stylesheet" href="/css/win.css" type="text/css"/> -</head> -<body> + <ui:define name="content"> + <!-- CURRENT REPOS --> <h:form id="currentRepoForm"> <input type="hidden" name="id" value="${param.id}"/>
<rich:panel styleClass="BlockContent"> <f:facet name="header"><h:outputText value="Current Resource Subscriptions"/></f:facet> - <a4j:keepAlive beanName="ResourceReposUIBean"/> + <a4j:keepAlive beanName="ResourceReposUIBean"/>
<ui:param name="resourceReposDataModel" value="#{ResourceReposUIBean.dataModel}"/> <rich:dataTable id="resourceReposDataTable" @@ -33,7 +27,7 @@ var="item" width="100%" columnsWidth="1%, 25%, 40%, 5%, 15%, 15%" - headerClass="tableRowHeader" + styleClass="resources-table" footerClass="on-pager-footer" onRowMouseOver="this.style.backgroundColor='#E7E7E7'" onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"> @@ -115,7 +109,7 @@ styleClass="on-pager-button buttonsmall" rendered="${GlobalPermissionsUIBean.inventory}"/>
- <ui:include src="/rhq/resource/include/pagination.xhtml"> + <ui:include src="/rhq/resource/include/pagination-plain.xhtml"> <ui:param name="paginationDataTableName" value="resourceReposDataTable"/> <ui:param name="paginationDataModel" value="#{resourceReposDataModel}"/> <ui:param name="paginationPageControl" value="#{PageControl.ResourceReposList}"/> @@ -137,7 +131,7 @@ <rich:panel styleClass="BlockContent"> <f:facet name="header"><h:outputText value="Available Repositories"/></f:facet>
- <a4j:keepAlive beanName="AvailableResourceReposUIBean"/> + <a4j:keepAlive beanName="AvailableResourceReposUIBean"/>
<ui:param name="availableResourceReposDataModel" value="#{AvailableResourceReposUIBean.dataModel}"/> <rich:dataTable id="availableResourceReposDataTable" @@ -146,7 +140,7 @@ var="item" width="100%" columnsWidth="1%, 25%, 40%, 5%, 15%, 15%" - headerClass="tableRowHeader" + styleClass="resources-table" footerClass="on-pager-footer" onRowMouseOver="this.style.backgroundColor='#E7E7E7'" onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"> @@ -228,7 +222,7 @@ styleClass="on-pager-button buttonsmall" rendered="${GlobalPermissionsUIBean.inventory}"/>
- <ui:include src="/rhq/resource/include/pagination.xhtml"> + <ui:include src="/rhq/resource/include/pagination-plain.xhtml"> <ui:param name="paginationDataTableName" value="availableResourceReposDataTable"/> <ui:param name="paginationDataModel" value="#{availableResourceReposDataModel}"/> <ui:param name="paginationPageControl" value="#{PageControl.AvailableResourceReposList}"/> @@ -254,6 +248,5 @@
</h:form>
-</body> - -</html> + </ui:define> +</ui:composition> diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/content/view-plain.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/content/view-plain.xhtml index 918c3ce..7ff59f3 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/content/view-plain.xhtml +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/content/view-plain.xhtml @@ -1,41 +1,28 @@ -<?xml version="1.0"?> - -<!DOCTYPE html - PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml" +<ui:composition template="/rhq/resource/layout/main-plain.xhtml" + xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:c="http://java.sun.com/jstl/core" xmlns:onc="http://jboss.org/on/component" xmlns:onf="http://jboss.org/on/function" + xmlns:s="http://jboss.com/products/seam/taglib" xmlns:a4j="https://ajax4jsf.dev.java.net/ajax" xmlns:rich="http://richfaces.ajax4jsf.org/rich">
-<head> - <link rel="stylesheet" href="/css/win.css" type="text/css"/> -</head> -<body> + <ui:define name="content"> + <!-- Content Table -->
<h:form id="contentForm"> <input type="hidden" name="id" value="${param.id}"/> <rich:panel styleClass="BlockContent">
- - <f:facet name="header"><h:outputText value="Deployed Content"/></f:facet> - - <a4j:log level="debug" width="400"/> - - <h:panelGrid columns="3" width="100%"> <h:panelGroup> <h:outputText value="Filter: " /> <h:inputText id="search" value="#{ListPackagesUIBean.search}"> <a4j:support event="onchange" - status="commonStatus" reRender="packagesDataTable, packagesDataTableScroller" actionListener="#{ListPackagesUIBean.clearDataModel}"/> </h:inputText> @@ -46,7 +33,6 @@ <h:selectOneMenu id="packageTypeFilter" value="#{ListPackagesUIBean.packageTypeFilter}"> <a4j:support event="onchange" - status="commonStatus" reRender="packagesDataTable, packagesDataTableScroller" actionListener="#{ListPackagesUIBean.clearDataModel}"/> <f:selectItems value="#{ListPackagesUIBean.packageTypes}" /> @@ -58,7 +44,6 @@ <h:selectOneMenu id="packageVersionFilter" value="#{ListPackagesUIBean.packageVersionFilter}"> <a4j:support event="onchange" - status="commonStatus" reRender="packagesDataTable, packagesDataTableScroller" actionListener="#{ListPackagesUIBean.clearDataModel}"/> <f:selectItems value="#{ListPackagesUIBean.packageVersions}" /> @@ -66,9 +51,9 @@ </h:panelGroup>
</h:panelGrid> + <br/>
- <a4j:keepAlive beanName="ListPackagesUIBean"/> - + <a4j:keepAlive beanName="ListPackagesUIBean"/>
<ui:param name="packagesDataModel" value="#{ListPackagesUIBean.dataModel}"/> <rich:dataTable id="packagesDataTable" @@ -77,7 +62,7 @@ var="item" width="100%" columnsWidth="1%, 35%, 30%, 15%, 19%" - headerClass="tableRowHeader" + styleClass="resources-table" footerClass="on-pager-footer" onRowMouseOver="this.style.backgroundColor='#E7E7E7'" onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"> @@ -153,7 +138,7 @@ <onc:selectCommandButton action="#{DeletePackagesUIBean.beginDeleteWorkflow}" value="DELETE SELECTED" target="selectedPackages" styleClass="on-pager-button buttonsmall"/>
- <ui:include src="../include/pagination.xhtml"> + <ui:include src="/rhq/resource/include/pagination-plain.xhtml"> <ui:param name="paginationDataTableName" value="packagesDataTable"/> <ui:param name="paginationDataModel" value="#{packagesDataModel}"/> <ui:param name="paginationPageControl" value="#{PageControl.InstalledPackagesList}"/> @@ -166,5 +151,5 @@
</rich:panel> </h:form> -</body> -</html> + </ui:define> +</ui:composition>
commit 6c658cc0dbcff6b9090e71d05349e5b71e170fcd Author: Joseph Marques <joseph@redhat.com> Date: Wed Aug 11 07:19:59 2010 -0400
implement "plain" scheme using iframed-facelets for unfinished resource > events tabs
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java index 63e34e8..8944436 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java @@ -165,12 +165,17 @@ public class ResourceDetailView extends VLayout implements BookmarkableView, Res alertsTab.updateSubTab("History", new ResourceAlertHistoryView(resource.getId())); alertsTab.updateSubTab("Definitions", AlertDefinitionsView.getResourceView(resource));
- eventsTab.updateSubTab("History", EventHistoryView.createResourceHistoryView(resource.getId())); //new FullHTMLPane("/rhq/common/events/history-plain.xhtml?id=" + resource.getId()));
contentTab.updateSubTab("Deployed", new FullHTMLPane("/rhq/resource/content/view-plain.xhtml?id=" + resource.getId())); contentTab.updateSubTab("New", new FullHTMLPane("/rhq/resource/content/deploy-plain.xhtml?id=" + resource.getId())); contentTab.updateSubTab("Subscriptions", new FullHTMLPane("/rhq/resource/content/subscription-plain.xhtml?id=" + resource.getId())); contentTab.updateSubTab("History", new FullHTMLPane("/rhq/resource/content/history-plain.xhtml?id=" + resource.getId())); + // comment out GWT-based view until... + // 1) user can search event history by: metric display range, event source, event details, event severity + // 2) user can delete events if they possess the appropriate permissions + //eventsTab.updateSubTab("History", EventHistoryView.createResourceHistoryView(resource.getId())); + eventsTab.updateSubTab("History", new FullHTMLPane("/rhq/resource/events/history-plain.xhtml?id=" + + resource.getId()));
// topTabSet.setSelectedTab(selectedTab); diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/events/history-plain.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/events/history-plain.xhtml index fc68398..21bbc81 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/events/history-plain.xhtml +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/events/history-plain.xhtml @@ -1,5 +1,5 @@ - -<html xmlns="http://www.w3.org/1999/xhtml" +<ui:composition + xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:ui="http://java.sun.com/jsf/facelets" @@ -10,11 +10,6 @@ xmlns:a4j="https://ajax4jsf.dev.java.net/ajax" xmlns:rich="http://richfaces.ajax4jsf.org/rich">
-<head> - <link rel="stylesheet" href="/css/win.css" type="text/css" /> -</head> -<body> - <h:form id="eventHistoryForm" >
<a4j:keepAlive beanName="EventHistoryUIBean"/> @@ -36,16 +31,12 @@ </c:if>
<rich:panel styleClass="BlockContent"> - <f:facet name="header"> - <h:outputText value="Events" /> - </f:facet>
<h:panelGrid columns="3" cellspacing="3"> <h:outputLabel for="sourceFilter" value="Source Filter: " /> <h:inputText id="sourceFilter" value="#{EventHistoryUIBean.sourceFilter}" style="width: 300px;"> <a4j:support event="onchange" - status="commonStatus" reRender="eventHistoryDataTable, eventHistoryDataTableScroller" actionListener="#{EventHistoryUIBean.clearDataModel}" /> </h:inputText> @@ -56,7 +47,6 @@ onkeypress="return ignoreEnterKey(event);" style="width: 300px;" /> <a4j:support event="onchange" - status="commonStatus" reRender="eventHistoryDataTable, eventHistoryDataTableScroller" actionListener="#{EventHistoryUIBean.clearDataModel}" /> <rich:spacer/> @@ -65,7 +55,6 @@ <h:selectManyCheckbox id="severityFilter" value="#{EventHistoryUIBean.severityFilter}" style="width: 300px;"> <a4j:support event="onchange" - status="commonStatus" reRender="eventHistoryDataTable,eventHistoryDataTableScroller" actionListener="#{EventHistoryUIBean.clearDataModel}" />
@@ -73,7 +62,6 @@ </h:selectManyCheckbox>
<a4j:commandButton value="GO" - status="commonStatus" reRender="eventHistoryDataTable,eventHistoryDataTableScroller" actionListener="#{EventHistoryUIBean.clearDataModel}" styleClass="buttonmed"> @@ -91,7 +79,6 @@ var="item" width="100%" styleClass="resources-table" - headerClass="tableRowHeader" footerClass="on-pager-footer" onRowMouseOver="this.style.backgroundColor='#E7E7E7'" onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"> @@ -178,7 +165,7 @@ <ui:param name="paginationDataTableName" value="eventHistoryDataTable" /> <ui:param name="paginationDataModel" value="#{eventHistoryDataModel}" /> <ui:param name="paginationPageControl" value="#{PageControl.EventsHistoryList}" /> - <ui:include src="/rhq/resource/include/pagination.xhtml" /> + <ui:include src="/rhq/resource/include/pagination-plain.xhtml" /> </rich:column> </rich:columnGroup> </f:facet> @@ -252,6 +239,4 @@ </rich:modalPanel> </h:form>
-</body> -</html> - +</ui:composition> \ No newline at end of file diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/events/history-plain.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/events/history-plain.xhtml new file mode 100644 index 0000000..4cc4ca4 --- /dev/null +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/events/history-plain.xhtml @@ -0,0 +1,20 @@ +<ui:composition template="/rhq/resource/layout/main-plain.xhtml" + xmlns="http://www.w3.org/1999/xhtml" + xmlns:h="http://java.sun.com/jsf/html" + xmlns:f="http://java.sun.com/jsf/core" + xmlns:ui="http://java.sun.com/jsf/facelets" + xmlns:c="http://java.sun.com/jstl/core" + xmlns:onc="http://jboss.org/on/component" + xmlns:onf="http://jboss.org/on/function" + xmlns:s="http://jboss.com/products/seam/taglib" + xmlns:a4j="https://ajax4jsf.dev.java.net/ajax" + xmlns:rich="http://richfaces.ajax4jsf.org/rich"> + + <ui:define name="content"> + + <ui:include src="/rhq/common/events/history-plain.xhtml"/> + + </ui:define> + +</ui:composition> +
commit 74ac7e6a4910b36c67e211350d2a84e3ba6c80ff Author: Joseph Marques <joseph@redhat.com> Date: Wed Aug 11 07:19:04 2010 -0400
implement "plain" scheme using iframed-facelets for unfinished resource > monitor tabs
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java index e4cec95..63e34e8 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java @@ -143,12 +143,16 @@ public class ResourceDetailView extends VLayout implements BookmarkableView, Res + resource.getId()));
monitoringTab.updateSubTab("Graphs", new GraphListView(resource)); // new FullHTMLPane("/rhq/common/monitor/graphs.xhtml?id=" + resource.getId())); - monitoringTab.updateSubTab("Tables", new FullHTMLPane("/rhq/common/monitor/tables-plain.xhtml?id=" + resource.getId())); - monitoringTab.updateSubTab("Traits", new FullHTMLPane("/rhq/resource/monitor/traits-plain.xhtml?id=" + resource.getId())); - monitoringTab.updateSubTab("Availability", new FullHTMLPane("/rhq/resource/monitor/availabilityHistory-plain.xhtml?id=" + resource.getId())); - monitoringTab.updateSubTab("Schedules", new FullHTMLPane("/rhq/resource/monitor/schedules-plain.xhtml?id=" + resource.getId())); - monitoringTab.updateSubTab("Call Time", new CallTimeView(resource)); - + monitoringTab.updateSubTab("Tables", new FullHTMLPane("/rhq/common/monitor/tables-plain.xhtml?id=" + + resource.getId())); + monitoringTab.updateSubTab("Traits", new FullHTMLPane("/rhq/resource/monitor/traits-plain.xhtml?id=" + + resource.getId())); + monitoringTab.updateSubTab("Availability", new FullHTMLPane( + "/rhq/resource/monitor/availabilityHistory-plain.xhtml?id=" + resource.getId())); + monitoringTab.updateSubTab("Schedules", new FullHTMLPane("/rhq/resource/monitor/schedules-plain.xhtml?id=" + + resource.getId())); + monitoringTab.updateSubTab("Call Time", new FullHTMLPane("/rhq/resource/monitor/response-plain.xhtml?id=" + + resource.getId()));
inventoryTab.updateSubTab("Children", ResourceSearchView.getChildrenOf(resource.getId())); inventoryTab.updateSubTab("Connection Settings", new PluginConfigurationEditView(resource)); // new ConfigurationEditor(resource.getId(), resource.getResourceType().getId(), ConfigurationEditor.ConfigType.plugin)); diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/monitor/response-plain.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/monitor/response-plain.xhtml new file mode 100644 index 0000000..aa6576f --- /dev/null +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/monitor/response-plain.xhtml @@ -0,0 +1,173 @@ +<ui:composition template="/rhq/resource/layout/main-plain.xhtml" + xmlns="http://www.w3.org/1999/xhtml" + xmlns:h="http://java.sun.com/jsf/html" + xmlns:f="http://java.sun.com/jsf/core" + xmlns:ui="http://java.sun.com/jsf/facelets" + xmlns:c="http://java.sun.com/jstl/core" + xmlns:onc="http://jboss.org/on/component" + xmlns:onf="http://jboss.org/on/function" + xmlns:s="http://jboss.com/products/seam/taglib" + xmlns:a4j="https://ajax4jsf.dev.java.net/ajax" + xmlns:rich="http://richfaces.ajax4jsf.org/rich"> + + <ui:define name="content"> + + <rich:panel styleClass="BlockContent"> + + <c:if test="#{!ResourceUIBean.facets.callTime}"> + <c:if test="#{CallTimeUIBean.context.resourceId != -1}"> + Response Time Metrics are not supported for this resource. + </c:if> + <c:if test="#{CallTimeUIBean.context.groupId != -1}"> + Response Time Metrics are not supported for this compatible group. + </c:if> + <c:if test="#{CallTimeUIBean.context.parentResourceId != -1 and CallTimeUIBean.context.resourceTypeId != -1}"> + Response Time Metrics are not supported for this auto-group. + </c:if> + + </c:if> + + <c:if test="#{ResourceUIBean.facets.callTime}"> + <h:form id="callTimeForm"> + <a4j:keepAlive beanName="CallTimeUIBean"/> + + <!-- On submit make sure these are provided for the context of any new instance of the UI beans --> + <c:if test="#{CallTimeUIBean.context.resourceId != -1}"> + <input type="hidden" name="id" value="#{CallTimeUIBean.context.resourceId}" /> + </c:if> + <c:if test="#{CallTimeUIBean.context.groupId != -1}"> + <input type="hidden" name="groupId" value="#{CallTimeUIBean.context.groupId}" /> + </c:if> + <c:if + test="#{CallTimeUIBean.context.parentResourceId != -1}"> + <input type="hidden" name="parent" value="#{CallTimeUIBean.context.parentResourceId}" /> + </c:if> + <c:if test="#{CallTimeUIBean.context.resourceTypeId != -1}"> + <input type="hidden" name="type" value="#{CallTimeUIBean.context.resourceTypeId}" /> + </c:if> + + <h:panelGrid columns="3" cellspacing="3"> + <h:outputLabel for="destinationFilter" value="Destination Filter: " /> + <h:inputText id="destinationFilter" value="#{CallTimeUIBean.destinationFilter}" + onkeypress="return ignoreEnterKey(event);" + style="width: 300px;" /> + <a4j:commandButton value="GO" reRender="callTimeDataTable, callTimeDataTableScroller" + actionListener="#{CallTimeUIBean.clearDataModel}" + styleClass="buttonmed"> + <s:defaultAction/> + </a4j:commandButton> + </h:panelGrid> + + <ui:param name="callTimeDataModel" value="#{CallTimeUIBean.dataModel}" /> + <rich:dataTable id="callTimeDataTable" + value="#{callTimeDataModel}" + rows="#{PageControl.CallTimeHistory.pageSize}" + var="item" + width="100%" + styleClass="resources-table" + footerClass="on-pager-footer" + onRowMouseOver="this.style.backgroundColor='#E7E7E7'" + onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"> + + <f:facet name="PageControlView"> + <onc:paginationControl id="CallTimeHistory" /> + </f:facet> + + <rich:column> + <f:facet name="header"> + <onc:sortableColumnHeader sort="calltimedatavalue.key.callDestination"> + <h:outputText value="Destination" /> + </onc:sortableColumnHeader> + </f:facet> + <h:outputText value="#{onf:elideString(item.callDestination, 50, 'left')}" title="#{item.callDestination}"/> + </rich:column> + + <rich:column> + <f:facet name="header"> + <onc:sortableColumnHeader sort="SUM(calltimedatavalue.count)"> + <h:outputText value="Request Count" /> + </onc:sortableColumnHeader> + </f:facet> + <h:outputText value="#{item.count}" /> + </rich:column> + + <rich:column> + <f:facet name="header"> + <onc:sortableColumnHeader sort="MIN(calltimedatavalue.minimum)"> + <h:outputText value="Minimum" /> + </onc:sortableColumnHeader> + </f:facet> + <h:outputText value="#{item.minimum}"> + <f:converter converterId="ShortDurationConverter"/> + </h:outputText> + </rich:column> + + <rich:column> + <f:facet name="header"> + <onc:sortableColumnHeader sort="SUM(calltimedatavalue.total)/SUM(calltimedatavalue.count)"> + <h:outputText value="Average" /> + </onc:sortableColumnHeader> + </f:facet> + <h:outputText value="#{item.average}"> + <f:converter converterId="ShortDurationConverter"/> + </h:outputText> + </rich:column> + + <rich:column> + <f:facet name="header"> + <onc:sortableColumnHeader sort="MAX(calltimedatavalue.maximum)"> + <h:outputText value="Maximum" /> + </onc:sortableColumnHeader> + </f:facet> + <h:outputText value="#{item.maximum}"> + <f:converter converterId="ShortDurationConverter"/> + </h:outputText> + </rich:column> + + <rich:column> + <f:facet name="header"> + <onc:sortableColumnHeader sort="SUM(calltimedatavalue.total)"> + <h:outputText value="Total" /> + </onc:sortableColumnHeader> + </f:facet> + <h:outputText value="#{item.total}"> + <f:converter converterId="ShortDurationConverter"/> + </h:outputText> + </rich:column> + + <f:facet name="footer"> + <rich:columnGroup> + <rich:column colspan="6" width="100%"> + <ui:param name="paginationDataTableName" value="callTimeDataTable" /> + <ui:param name="paginationDataModel" value="#{callTimeDataModel}" /> + <ui:param name="paginationPageControl" value="#{PageControl.CallTimeHistory}" /> + <ui:include src="/rhq/resource/include/pagination-plain.xhtml" /> + </rich:column> + </rich:columnGroup> + </f:facet> + + </rich:dataTable> + + <table> + <tr> + <td><onc:metric optionList="m,h,d" /></td> + <td> + <h:commandLink rendered="#{not MetricComponentUtilityUIBean.readOnly}" + action="#{MetricComponentUtilityUIBean.update}" > + <img src="/images/dash-button_go-arrow.gif" alt="Apply Metric Settings "/> + </h:commandLink> + <h:commandLink rendered="#{MetricComponentUtilityUIBean.readOnly}" + action="#{MetricComponentUtilityUIBean.switchToSimpleMode}"> + <h:outputText value="Switch to Simple Mode" /> + </h:commandLink> + </td> + </tr> + </table> + + </h:form> + </c:if> + + </rich:panel> + + </ui:define> +</ui:composition> \ No newline at end of file diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/monitor/tables-plain.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/monitor/tables-plain.xhtml index b75b9b2..b6664e3 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/monitor/tables-plain.xhtml +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/monitor/tables-plain.xhtml @@ -1,28 +1,19 @@ -<?xml version="1.0"?> - -<!DOCTYPE html - PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml" - xmlns:h="http://java.sun.com/jsf/html" - xmlns:f="http://java.sun.com/jsf/core" - xmlns:ui="http://java.sun.com/jsf/facelets" - xmlns:c="http://java.sun.com/jstl/core" - xmlns:onc="http://jboss.org/on/component" - xmlns:onf="http://jboss.org/on/function" - xmlns:a4j="https://ajax4jsf.dev.java.net/ajax" - xmlns:rich="http://richfaces.ajax4jsf.org/rich"> - -<ui:composition> +<ui:composition template="/rhq/resource/layout/main-plain.xhtml" + xmlns="http://www.w3.org/1999/xhtml" + xmlns:h="http://java.sun.com/jsf/html" + xmlns:f="http://java.sun.com/jsf/core" + xmlns:ui="http://java.sun.com/jsf/facelets" + xmlns:c="http://java.sun.com/jstl/core" + xmlns:onc="http://jboss.org/on/component" + xmlns:onf="http://jboss.org/on/function" + xmlns:s="http://jboss.com/products/seam/taglib" + xmlns:a4j="https://ajax4jsf.dev.java.net/ajax" + xmlns:rich="http://richfaces.ajax4jsf.org/rich"> + + <ui:define name="content">
<rich:panel styleClass="BlockContent">
- <f:facet name="header" styleClass="BlockTitle"> - <a name="Numeric Metrics" /> - Numeric Metrics - </f:facet> - <h:form id="metricsTableForm"> <!-- On submit make sure these are provided for the context of any new instance of the UI beans --> <c:if test="#{MetricsTableUIBean.context.resourceId != -1}"> @@ -43,11 +34,12 @@ value="#{MetricsTableUIBean.context.resourceTypeId}" /> </c:if>
- <rich:dataTable value="#{MetricsTableUIBean.metricSummaries}" width="100%" var="metric" - columnsWidth="1%" + columnsWidth="1%,40%,12%,12%,12%,12%,12%" + styleClass="resources-table" + footerClass="on-pager-footer" onRowMouseOver="this.style.backgroundColor='#E7E7E7'" onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'">
@@ -159,10 +151,10 @@ </td> </tr> </table> + </h:form>
</rich:panel>
-</ui:composition> - -</html> + </ui:define> +</ui:composition> \ No newline at end of file diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/monitor/availabilityHistory-plain.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/monitor/availabilityHistory-plain.xhtml index 545e523..27f9d7a 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/monitor/availabilityHistory-plain.xhtml +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/monitor/availabilityHistory-plain.xhtml @@ -1,29 +1,16 @@ -<?xml version="1.0"?> - -<!DOCTYPE html - PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml" +<ui:composition template="/rhq/resource/layout/main-plain.xhtml" + xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:c="http://java.sun.com/jstl/core" xmlns:onc="http://jboss.org/on/component" xmlns:onf="http://jboss.org/on/function" + xmlns:s="http://jboss.com/products/seam/taglib" xmlns:a4j="https://ajax4jsf.dev.java.net/ajax" xmlns:rich="http://richfaces.ajax4jsf.org/rich">
-<head> - <link rel="stylesheet" href="/css/win.css" type="text/css"/> -</head> - -<body> - <f:facet name="header" styleClass="BlockTitle"> - <a name="AvailabilityHistory"/> - Availability History - </f:facet> - + <ui:define name="content">
<h:panelGroup layout="block" rendered="#{ListAvailabilityHistoryUIBean.dataModel.rowCount == 0}"> This resource does not currently have any availability history. @@ -135,8 +122,7 @@ rendered="#{availability.availabilityType == 'DOWN'}"/> <h:graphicImage value="/images/icons/availability_grey_16.png" alt="Unknown" title="Unknown" rendered="#{availability.availabilityType == null}"/> - - <h:outputText value="#{availability.availabilityType}"/> + <h:outputText value=" #{availability.availabilityType}"/> </rich:column>
<rich:column @@ -181,7 +167,7 @@ <rich:columnGroup> <rich:column colspan="4">
- <ui:include src="../include/pagination.xhtml"> + <ui:include src="/rhq/resource/include/pagination-plain.xhtml"> <ui:param name="paginationDataTableName" value="availabilityHistoryDataTable"/> <ui:param name="paginationDataModel" value="#{availabilityHistoryDataModel}"/> <ui:param name="paginationPageControl" @@ -195,6 +181,7 @@
</h:form> </rich:panel> -</body>
-</html> + </ui:define> + +</ui:composition> diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/monitor/response-plain.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/monitor/response-plain.xhtml new file mode 100644 index 0000000..e19932a --- /dev/null +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/monitor/response-plain.xhtml @@ -0,0 +1,14 @@ +<ui:composition + xmlns="http://www.w3.org/1999/xhtml" + xmlns:h="http://java.sun.com/jsf/html" + xmlns:f="http://java.sun.com/jsf/core" + xmlns:ui="http://java.sun.com/jsf/facelets" + xmlns:c="http://java.sun.com/jstl/core" + xmlns:onc="http://jboss.org/on/component" + xmlns:onf="http://jboss.org/on/function" + xmlns:a4j="https://ajax4jsf.dev.java.net/ajax" + xmlns:rich="http://richfaces.ajax4jsf.org/rich"> + + <ui:include src="/rhq/common/monitor/response-plain.xhtml" /> + +</ui:composition> \ No newline at end of file diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/monitor/schedules-plain.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/monitor/schedules-plain.xhtml index a9d1ab3..8854225 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/monitor/schedules-plain.xhtml +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/monitor/schedules-plain.xhtml @@ -1,10 +1,5 @@ -<?xml version="1.0"?> - -<!DOCTYPE html - PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml" +<ui:composition template="/rhq/resource/layout/main-plain.xhtml" + xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:ui="http://java.sun.com/jsf/facelets" @@ -14,13 +9,13 @@ xmlns:s="http://jboss.com/products/seam/taglib" xmlns:a4j="https://ajax4jsf.dev.java.net/ajax" xmlns:rich="http://richfaces.ajax4jsf.org/rich"> -<head> - <link rel="stylesheet" href="/css/win.css" type="text/css"/> -</head>
-<body> - <h:outputText rendered="#{not ResourceUIBean.permissions.measure}" value="You don't have the measure permission for this resource and therefore can not change metric schedules"/> + <ui:define name="content">
+ <rich:panel styleClass="BlockContent"> + + <h:outputText rendered="#{not ResourceUIBean.permissions.measure}" + value="You don't have the measure permission for this resource and therefore can not change metric schedules"/>
<h:form id="resourceSchedulesForm"> <!-- hack to override the default button on the page, make this button pseudo-first in the form, @@ -33,13 +28,6 @@ rendered="#{ResourceUIBean.permissions.measure}" /> </div> <input type="hidden" name="id" value="${param.id}"/> - - <rich:panel styleClass="BlockContent"> - <f:facet name="header"> - <h:outputText value="Configure Metric Collection Schedules"/> - </f:facet> - - <h:panelGrid columns="1" styleClass="data-table">
<ui:param name="resourceSchedulesDataModel" value="#{ListResourceMeasurementScheduleUIBean.dataModel}"/> <rich:dataTable id="resourceSchedulesDataTable" @@ -49,7 +37,6 @@ width="100%" columnsWidth="1%, 20%, 30%, 20%, 9%, 20%" styleClass="resources-table" - headerClass="tableRowHeader" footerClass="on-pager-footer" onRowMouseOver="this.style.backgroundColor='#E7E7E7'" onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"> @@ -163,10 +150,9 @@ </f:facet>
</rich:dataTable> - - </h:panelGrid> - - </rich:panel> </h:form> -</body> -</html> + + </rich:panel> + + </ui:define> +</ui:composition> \ No newline at end of file diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/monitor/traits-plain.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/monitor/traits-plain.xhtml index 9038116..61a1014 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/monitor/traits-plain.xhtml +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/monitor/traits-plain.xhtml @@ -1,30 +1,19 @@ -<?xml version="1.0"?> - -<!DOCTYPE html - PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml" +<ui:composition template="/rhq/resource/layout/main-plain.xhtml" + xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:c="http://java.sun.com/jstl/core" xmlns:onc="http://jboss.org/on/component" xmlns:onf="http://jboss.org/on/function" + xmlns:s="http://jboss.com/products/seam/taglib" xmlns:a4j="https://ajax4jsf.dev.java.net/ajax" xmlns:rich="http://richfaces.ajax4jsf.org/rich"> -<head> - <link rel="stylesheet" href="/css/win.css" type="text/css"/> -</head>
-<body> + <ui:define name="content"> + <rich:panel styleClass="BlockContent">
- <f:facet name="header" styleClass="BlockTitle"> - <a name="Traits"/> - Traits - </f:facet> - <rich:dataTable value="#{ResourceMetricsTableUIBean.traitSummaries}" width="100%" var="metric" @@ -80,6 +69,8 @@ <rich:dataTable value="#{ResourceMetricsTableUIBean.traitHistory}" width="100%" var="history" + styleClass="resources-table" + footerClass="on-pager-footer" onRowMouseOver="this.style.backgroundColor='#E7E7E7'" onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'">
@@ -101,5 +92,5 @@ </rich:dataTable>
</rich:panel> -</body> -</html> + </ui:define> +</ui:composition> diff --git a/modules/enterprise/server/plugins/perspectives/core/perspective/src/main/resources/META-INF/rhq-serverplugin.xml b/modules/enterprise/server/plugins/perspectives/core/perspective/src/main/resources/META-INF/rhq-serverplugin.xml index b3079dd..0ea6e12 100644 --- a/modules/enterprise/server/plugins/perspectives/core/perspective/src/main/resources/META-INF/rhq-serverplugin.xml +++ b/modules/enterprise/server/plugins/perspectives/core/perspective/src/main/resources/META-INF/rhq-serverplugin.xml @@ -759,10 +759,6 @@ <position name="Monitor.Schedules" placement="after" /> - <activators> - <facet - name="call_time" /> - </activators> </tab>
<!-- Inventory Subtabs -->
commit 8ff2464dbb943f9e87f7ad57d0dd87b53c2d94fb Author: Joseph Marques <joseph@redhat.com> Date: Wed Aug 11 07:15:25 2010 -0400
reformat, cosmetic
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java index 7415ba7..e4cec95 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java @@ -32,9 +32,7 @@ import org.rhq.core.domain.resource.ResourceType; import org.rhq.core.domain.resource.composite.ResourcePermission; import org.rhq.enterprise.gui.coregui.client.BookmarkableView; import org.rhq.enterprise.gui.coregui.client.CoreGUI; -import org.rhq.enterprise.gui.coregui.client.ViewId; import org.rhq.enterprise.gui.coregui.client.ViewPath; -import org.rhq.enterprise.gui.coregui.client.alert.definitions.AlertDefinitionsView; import org.rhq.enterprise.gui.coregui.client.components.FullHTMLPane; import org.rhq.enterprise.gui.coregui.client.components.tab.TwoLevelTab; import org.rhq.enterprise.gui.coregui.client.components.tab.TwoLevelTabSelectedEvent; @@ -43,14 +41,10 @@ import org.rhq.enterprise.gui.coregui.client.components.tab.TwoLevelTabSet; import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup; import org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceSearchView; import org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceSelectListener; -import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.alert.ResourceAlertHistoryView; import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.configuration.ConfigurationHistoryView; import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.configuration.ResourceConfigurationEditView; -import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.event.EventHistoryView; import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.inventory.PluginConfigurationEditView; import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.monitoring.GraphListView; -import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.monitoring.calltime.CallTimeView; -import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.operation.OperationHistoryView; import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.overview.ResourceOverviewView; import org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTypeRepository;
@@ -59,7 +53,8 @@ import org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTyp * * @author Greg Hinkle */ -public class ResourceDetailView extends VLayout implements BookmarkableView, ResourceSelectListener, TwoLevelTabSelectedHandler { +public class ResourceDetailView extends VLayout implements BookmarkableView, ResourceSelectListener, + TwoLevelTabSelectedHandler {
private static final String DEFAULT_TAB_NAME = "Summary";
@@ -80,7 +75,6 @@ public class ResourceDetailView extends VLayout implements BookmarkableView, Res
private ResourceTitleBar titleBar;
- public void setResource(Resource resource) { this.resource = resource; } @@ -92,7 +86,6 @@ public class ResourceDetailView extends VLayout implements BookmarkableView, Res setWidth100(); setHeight100();
- // The Tabs section
topTabSet = new TwoLevelTabSet(); @@ -126,8 +119,8 @@ public class ResourceDetailView extends VLayout implements BookmarkableView, Res contentTab = new TwoLevelTab("Content", "/images/icons/Content_grey_16.png"); contentTab.registerSubTabs("Deployed", "New", "Subscriptions", "History");
- topTabSet.setTabs(summaryTab, monitoringTab, inventoryTab, operationsTab, alertsTab, configurationTab, eventsTab, contentTab); - + topTabSet.setTabs(summaryTab, monitoringTab, inventoryTab, operationsTab, alertsTab, configurationTab, + eventsTab, contentTab);
topTabSet.addTwoLevelTabSelectedHandler(this);
@@ -136,7 +129,7 @@ public class ResourceDetailView extends VLayout implements BookmarkableView, Res
addMember(topTabSet);
-// CoreGUI.addBreadCrumb(getPlace()); + // CoreGUI.addBreadCrumb(getPlace()); }
public void onResourceSelected(Resource resource) { @@ -144,11 +137,10 @@ public class ResourceDetailView extends VLayout implements BookmarkableView, Res this.resource = resource;
titleBar.setResource(resource); - - FullHTMLPane timelinePane = new FullHTMLPane("/rhq/resource/summary/timeline-plain.xhtml?id=" + resource.getId()); - summaryTab.updateSubTab("Overview", new ResourceOverviewView(resource)); - summaryTab.updateSubTab("Timeline", timelinePane);
+ summaryTab.updateSubTab("Overview", new ResourceOverviewView(resource)); + summaryTab.updateSubTab("Timeline", new FullHTMLPane("/rhq/resource/summary/timeline-plain.xhtml?id=" + + resource.getId()));
monitoringTab.updateSubTab("Graphs", new GraphListView(resource)); // new FullHTMLPane("/rhq/common/monitor/graphs.xhtml?id=" + resource.getId())); monitoringTab.updateSubTab("Tables", new FullHTMLPane("/rhq/common/monitor/tables-plain.xhtml?id=" + resource.getId())); @@ -177,45 +169,42 @@ public class ResourceDetailView extends VLayout implements BookmarkableView, Res contentTab.updateSubTab("History", new FullHTMLPane("/rhq/resource/content/history-plain.xhtml?id=" + resource.getId()));
-// topTabSet.setSelectedTab(selectedTab); + // topTabSet.setSelectedTab(selectedTab);
updateTabStatus();
topTabSet.markForRedraw(); }
- private void updateTabStatus() { // Go and get the type with all needed metadata // and then get the permissions for this resource
- ResourceTypeRepository.Cache.getInstance().getResourceTypes(resource.getResourceType().getId(), - EnumSet.of(ResourceTypeRepository.MetadataType.content, - ResourceTypeRepository.MetadataType.operations, - ResourceTypeRepository.MetadataType.events, - ResourceTypeRepository.MetadataType.resourceConfigurationDefinition), - new ResourceTypeRepository.TypeLoadedCallback() { - public void onTypesLoaded(ResourceType type) { - - ResourceDetailView.this.type = type; - - GWTServiceLookup.getAuthorizationService(). - getImplicitResourcePermissions(ResourceDetailView.this.resource.getId(), - new AsyncCallback<Set<Permission>>() { - public void onFailure(Throwable caught) { - CoreGUI.getErrorHandler().handleError("Failed to load resource permissions", caught); - } - - public void onSuccess(Set<Permission> result) { - ResourceDetailView.this.permissions = new ResourcePermission(result); - completeTabUpdate(); - } - }); - } - }); + ResourceTypeRepository.Cache.getInstance().getResourceTypes( + resource.getResourceType().getId(), + EnumSet.of(ResourceTypeRepository.MetadataType.content, ResourceTypeRepository.MetadataType.operations, + ResourceTypeRepository.MetadataType.events, + ResourceTypeRepository.MetadataType.resourceConfigurationDefinition), + new ResourceTypeRepository.TypeLoadedCallback() { + public void onTypesLoaded(ResourceType type) { + + ResourceDetailView.this.type = type; + + GWTServiceLookup.getAuthorizationService().getImplicitResourcePermissions( + ResourceDetailView.this.resource.getId(), new AsyncCallback<Set<Permission>>() { + public void onFailure(Throwable caught) { + CoreGUI.getErrorHandler().handleError("Failed to load resource permissions", caught); + } + + public void onSuccess(Set<Permission> result) { + ResourceDetailView.this.permissions = new ResourcePermission(result); + completeTabUpdate(); + } + }); + } + }); }
- private void completeTabUpdate() {
if (!permissions.isMeasure()) { @@ -224,13 +213,13 @@ public class ResourceDetailView extends VLayout implements BookmarkableView, Res topTabSet.enableTab(monitoringTab); }
- if (type.getOperationDefinitions() == null || type.getOperationDefinitions().isEmpty() || !permissions.isControl()) { + if (type.getOperationDefinitions() == null || type.getOperationDefinitions().isEmpty() + || !permissions.isControl()) { topTabSet.disableTab(operationsTab); } else { topTabSet.enableTab(operationsTab); }
- if (!permissions.isAlert()) { topTabSet.disableTab(alertsTab); } else { @@ -255,14 +244,12 @@ public class ResourceDetailView extends VLayout implements BookmarkableView, Res topTabSet.enableTab(contentTab); }
- if (topTabSet.getSelectedTab().getDisabled()) { topTabSet.selectTab(0); }
}
- public void onTabSelected(TwoLevelTabSelectedEvent tabSelectedEvent) { // Switch tabs directly, rather than letting the history framework do it, to avoid redrawing the outer views. selectTab(tabSelectedEvent.getId(), tabSelectedEvent.getSubTabId()); @@ -273,24 +260,22 @@ public class ResourceDetailView extends VLayout implements BookmarkableView, Res History.newItem(path, false); }
- public void renderView(ViewPath viewPath) { // e.g. #Resource/10010/Inventory/Overview - String tabName = (!viewPath.isEnd()) ? viewPath.getCurrent().getPath() : null; // e.g. "Inventory" + String tabName = (!viewPath.isEnd()) ? viewPath.getCurrent().getPath() : null; // e.g. "Inventory" String subTabName = (viewPath.viewsLeft() >= 1) ? viewPath.getNext().getPath() : null; // e.g. "Overview" selectTab(tabName, subTabName); }
- public void selectTab(String tabName, String subtabName) { if (tabName == null) { tabName = DEFAULT_TAB_NAME; } - TwoLevelTab tab = (TwoLevelTab)this.topTabSet.getTabByTitle(tabName); + TwoLevelTab tab = (TwoLevelTab) this.topTabSet.getTabByTitle(tabName); if (tab == null) { CoreGUI.getErrorHandler().handleError("Invalid tab name: " + tabName); // TODO: Should we fire a history event here to redirect to a valid bookmark? - tab = (TwoLevelTab)this.topTabSet.getTabByTitle(DEFAULT_TAB_NAME); + tab = (TwoLevelTab) this.topTabSet.getTabByTitle(DEFAULT_TAB_NAME); } this.topTabSet.selectTab(tab); if (subtabName != null) {
commit e666b220a74d9784863570d292662fc5259781b1 Author: Joseph Marques <joseph@redhat.com> Date: Wed Aug 11 07:10:53 2010 -0400
prepare "plain" navigation scheme for iframed-facelets
* copy/paste entire XXX-navigation.xml file to XXX-plain-navigation.xml * search/replace *.xhtml with *-plain.xhtml inside each * do this for the follow resource subsystems: ** alerts, content, events, measurement, operations
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation/alert-plain-navigation.xml b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation/alert-plain-navigation.xml new file mode 100644 index 0000000..2bbef2d --- /dev/null +++ b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation/alert-plain-navigation.xml @@ -0,0 +1,183 @@ +<?xml version="1.0"?> + +<faces-config version="1.2" xmlns="http://java.sun.com/xml/ns/javaee" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd"> + + <!-- Alert Definition List --> + <navigation-rule> + <from-view-id>/rhq/resource/alert/listAlertDefinitions-plain.xhtml</from-view-id> + + <navigation-case> + <!-- catch all navigation-case: if any actions return 'success', go here --> + <from-outcome>success</from-outcome> + <to-view-id>/rhq/resource/alert/listAlertDefinitions-plain.xhtml?id=#{param.id}</to-view-id> + <redirect/> + </navigation-case> + + <navigation-case> + <from-outcome>createNewAlertDefinition</from-outcome> + <to-view-id>/alerts/Config.do?id=#{param.id}&mode=new&nomenu=true</to-view-id> + <redirect/> + </navigation-case> + + <navigation-case> + <!-- sorting rule --> + <from-outcome>sort</from-outcome> + <to-view-id>/rhq/resource/alert/listAlertDefinitions-plain.xhtml?id=#{param.id}</to-view-id> + <redirect/> + </navigation-case> + + </navigation-rule> + + <!-- Alert Templates List --> + <navigation-rule> + <from-view-id>/rhq/admin/listAlertTemplates-plain.xhtml</from-view-id> + + <navigation-case> + <!-- catch all navigation-case: if any actions return 'success', go here --> + <from-outcome>success</from-outcome> + <to-view-id>/rhq/admin/listAlertTemplates-plain.xhtml?type=#{param.type}</to-view-id> + <redirect/> + </navigation-case> + + <navigation-case> + <from-outcome>createNewAlertTemplate</from-outcome> + <to-view-id>/alerts/Config.do?type=#{param.type}&mode=new&nomenu=true</to-view-id> + <redirect/> + </navigation-case> + + <navigation-case> + <!-- sorting rule --> + <from-outcome>sort</from-outcome> + <to-view-id>/rhq/admin/listAlertTemplates-plain.xhtml?type=#{param.type}</to-view-id> + <redirect/> + </navigation-case> + + </navigation-rule> + + <!-- Alert History List --> + <navigation-rule> + <from-view-id>/rhq/resource/alert/listAlertHistory-plain.xhtml</from-view-id> + + <navigation-case> + <!-- catch all navigation-case: if any actions return 'success', go here --> + <from-outcome>dateFilter</from-outcome> + <to-view-id>/rhq/resource/alert/listAlertHistory-plain.xhtml?id=#{param.id}&date=#{param.date}</to-view-id> + <redirect/> + </navigation-case> + + <navigation-case> + <!-- catch all navigation-case: if any actions return 'success', go here --> + <from-outcome>success</from-outcome> + <to-view-id>/rhq/resource/alert/listAlertHistory-plain.xhtml?id=#{param.id}</to-view-id> + <redirect/> + </navigation-case> + + <navigation-case> + <!-- sorting rule --> + <from-outcome>sort</from-outcome> + <to-view-id>/rhq/resource/alert/listAlertHistory-plain.xhtml?id=#{param.id}</to-view-id> + <redirect/> + </navigation-case> + + </navigation-rule> + + <!-- CRUD for alert notification templates --> + <navigation-rule> + <from-view-id>/rhq/admin/alert/template/notification/list-plain.xhtml</from-view-id> + + <navigation-case> + <from-outcome>create</from-outcome> + <to-view-id>/rhq/admin/alert/template/notification/new-plain.xhtml</to-view-id> + + <redirect /> + </navigation-case> + + <navigation-case> + <from-outcome>success</from-outcome> + <to-view-id>/rhq/admin/alert/template/notification/list-plain.xhtml</to-view-id> + + <redirect /> + </navigation-case> + + </navigation-rule> + + <navigation-rule> + <from-view-id>/rhq/admin/alert/template/notification/new-plain.xhtml</from-view-id> + + <navigation-case> + <from-outcome>success</from-outcome> + <to-view-id>/rhq/admin/alert/template/notification/details-plain.xhtml?mode=view&templateId=#{NewAlertNotificationTemplateUIBean.createdTemplateId}</to-view-id> + + <redirect /> + </navigation-case> + + <navigation-case> + <from-outcome>cancel</from-outcome> + <to-view-id>/rhq/admin/alert/template/notification/list-plain.xhtml</to-view-id> + + <redirect /> + </navigation-case> + + </navigation-rule> + + <navigation-rule> + <from-view-id>/rhq/admin/alert/template/notification/details-plain.xhtml</from-view-id> + + <!-- navigation cases for CRUD of general properties --> + <navigation-case> + <from-action>#{AlertNotificationTemplateDetailsUIBean.edit}</from-action> + <to-view-id>/rhq/admin/alert/template/notification/details-plain.xhtml?mode=edit&templateId=#{param.templateId}</to-view-id> + + <redirect /> + </navigation-case> + + <navigation-case> + <from-action>#{AlertNotificationTemplateDetailsUIBean.save}</from-action> + <to-view-id>/rhq/admin/alert/template/notification/details-plain.xhtml?mode=view&templateId=#{param.templateId}</to-view-id> + + <redirect /> + </navigation-case> + + <navigation-case> + <from-action>#{AlertNotificationTemplateDetailsUIBean.cancel}</from-action> + <to-view-id>/rhq/admin/alert/template/notification/details-plain.xhtml?mode=view&templateId=#{param.templateId}</to-view-id> + + <redirect /> + </navigation-case> + + <!-- navigation case to go to the common page for editing alert notifications --> + <navigation-case> + <from-action>#{AlertNotificationTemplateDetailsUIBean.editNotifications}</from-action> + <to-view-id>/rhq/common/alert/notification/details-plain.xhtml?context=template&contextId=#{param.templateId}</to-view-id> + <redirect /> + </navigation-case> + + </navigation-rule> + + <!-- alert notifications and custom sender UI --> + <navigation-rule> + <from-view-id>/rhq/common/alert/notification/details-plain.xhtml</from-view-id> + + <!-- refresh *with* notification ID when: --> + <!-- 1) selecting an alert notification element from the table --> + <!-- 2) save alert notifications that use a configuration-based rendering schemes --> + <!-- 3) save alert notifications that use custom rendering schemes --> + <navigation-case> + <from-outcome>success</from-outcome> + <to-view-id>/rhq/common/alert/notification/details-plain.xhtml?context=#{param.context}&contextId=#{param.contextId}&contextSubId=#{param.contextSubId}&nid=#{alertNotificationsUIBean.activeNotification.id}</to-view-id> + + <redirect /> + </navigation-case> + + <!-- clicking remove button should refresh but deselect the active notification --> + <navigation-case> + <from-action>#{alertNotificationsUIBean.removeSelected}</from-action> + <to-view-id>/rhq/common/alert/notification/details-plain.xhtml?context=#{param.context}&contextId=#{param.contextId}&contextSubId=#{param.contextSubId}</to-view-id> + + <redirect /> + </navigation-case> + </navigation-rule> + +</faces-config> diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation/content-plain-navigation.xml b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation/content-plain-navigation.xml new file mode 100644 index 0000000..14db2d7 --- /dev/null +++ b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation/content-plain-navigation.xml @@ -0,0 +1,491 @@ +<?xml version="1.0"?> + +<faces-config version="1.2" xmlns="http://java.sun.com/xml/ns/javaee" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd"> + + <navigation-rule> + <from-view-id>/rhq/resource/content/subscription-plain.xhtml</from-view-id> + + <navigation-case> + <from-outcome>sort</from-outcome> + <to-view-id>/rhq/resource/content/subscription-plain.xhtml?id=#{param.id}</to-view-id> + <redirect/> + </navigation-case> + + <navigation-case> + <from-action>#{ResourceReposUIBean.deleteSelectedResourceRepos}</from-action> + <from-outcome>success</from-outcome> + <to-view-id>/rhq/resource/content/subscription-plain.xhtml?id=#{param.id}</to-view-id> + <redirect/> + </navigation-case> + + <navigation-case> + <from-action>#{AvailableResourceReposUIBean.subscribeSelectedResourceRepos}</from-action> + <from-outcome>success</from-outcome> + <to-view-id>/rhq/resource/content/subscription-plain.xhtml?id=#{param.id}</to-view-id> + <redirect/> + </navigation-case> + </navigation-rule> + + <navigation-rule> + <from-view-id>/rhq/resource/content/view-plain.xhtml</from-view-id> + + <navigation-case> + <from-outcome>sort</from-outcome> + <to-view-id>/rhq/resource/content/view-plain.xhtml?id=#{param.id}</to-view-id> + <redirect/> + </navigation-case> + +<!-- + <navigation-case> + <from-action>#{ListPackagesUIBean.deleteSelectedInstalledPackages}</from-action> + <from-outcome>successOrFailure</from-outcome> + <to-view-id>/rhq/resource/content/history-plain.xhtml?id=#{param.id}</to-view-id> + <redirect/> + </navigation-case> +--> + + <navigation-case> + <from-action>#{DeletePackagesUIBean.beginDeleteWorkflow}</from-action> + <from-outcome>beginDeleteWorkflow</from-outcome> + <to-view-id>/rhq/resource/content/confirm-delete-plain.xhtml</to-view-id> + </navigation-case> + + </navigation-rule> + + <navigation-rule> + <from-view-id>/rhq/resource/content/deploy-plain.xhtml</from-view-id> + + <navigation-case> + <from-outcome>uploadNew</from-outcome> + <to-view-id>/rhq/resource/content/create-plain.xhtml?id=#{param.id}</to-view-id> + <redirect/> + </navigation-case> + + <navigation-case> + <from-action>#{CreateNewPackageUIBean.deployExisting}</from-action> + <from-outcome>success</from-outcome> + <to-view-id>/rhq/resource/content/confirm-create-plain.xhtml</to-view-id> + </navigation-case> + + </navigation-rule> + + + <navigation-rule> + <from-view-id>/rhq/resource/content/update-plain.xhtml</from-view-id> + + <navigation-case> + <from-outcome>uploadNew</from-outcome> + <to-view-id>/rhq/resource/content/create-plain.xhtml?id=#{param.id}</to-view-id> + <redirect/> + </navigation-case> + + <navigation-case> + <from-action>#{CreateNewPackageUIBean.deployExisting}</from-action> + <from-outcome>success</from-outcome> + <to-view-id>/rhq/resource/content/confirm-create-plain.xhtml</to-view-id> + </navigation-case> + + </navigation-rule> + + + + <navigation-rule> + <from-view-id>/rhq/resource/content/history-plain.xhtml</from-view-id> + + <navigation-case> + <from-outcome>showContentServiceRequestDetails</from-outcome> + <to-view-id>/rhq/resource/content/history-request-plain.xhtml?id=#{param.id}&selectedRequestId=#{param.selectedRequestId}</to-view-id> + <redirect/> + </navigation-case> + + <navigation-case> + <from-outcome>showHistoryItem</from-outcome> + <to-view-id>/rhq/resource/content/audit-trail-item-plain.xhtml?id=#{param.id}&selectedHistoryId=#{param.selectedHistoryId}</to-view-id> + <redirect/> + </navigation-case> + + </navigation-rule> + + <navigation-rule> + <from-view-id>/rhq/resource/content/history-request-plain.xhtml</from-view-id> + + <navigation-case> + <from-outcome>showHistoryItem</from-outcome> + <to-view-id>/rhq/resource/content/history-request-item-plain.xhtml?id=#{param.id}&selectedHistoryId=#{param.selectedHistoryId}&selectedRequestId=#{param.selectedRequestId}</to-view-id> + <redirect/> + </navigation-case> + + <navigation-case> + <from-outcome>returnToAllRequests</from-outcome> + <to-view-id>/rhq/resource/content/history-plain.xhtml?id=#{param.id}</to-view-id> + <redirect/> + </navigation-case> + + </navigation-rule> + + <navigation-rule> + <from-view-id>/rhq/resource/content/history-request-item-plain.xhtml</from-view-id> + + <navigation-case> + <from-outcome>returnToRequest</from-outcome> + <to-view-id>/rhq/resource/content/history-request-plain.xhtml?id=#{param.id}&selectedRequestId=#{param.selectedRequestId}</to-view-id> + <redirect/> + </navigation-case> + + <navigation-case> + <from-outcome>stepDetails</from-outcome> + <to-view-id>/rhq/resource/content/history-request-step-details-plain.xhtml?id=#{param.id}&selectedHistoryId=#{param.selectedHistoryId}&selectedRequestId=#{param.selectedRequestId}&stepId=#{param.stepId}</to-view-id> + <redirect/> + </navigation-case> + + </navigation-rule> + + <navigation-rule> + <from-view-id>/rhq/resource/content/history-request-step-details-plain.xhtml</from-view-id> + + <navigation-case> + <from-outcome>returnToHistory</from-outcome> + <to-view-id>/rhq/resource/content/history-request-item-plain.xhtml?id=#{param.id}&selectedHistoryId=#{param.selectedHistoryId}&selectedRequestId=#{param.selectedRequestId}</to-view-id> + <redirect/> + </navigation-case> + + </navigation-rule> + + <navigation-rule> + <from-view-id>/rhq/resource/content/create-plain.xhtml</from-view-id> + + <navigation-case> + <from-action>#{CreateNewPackageUIBean.createPackage}</from-action> + <from-outcome>success</from-outcome> + <to-view-id>/rhq/resource/content/confirm-create-plain.xhtml</to-view-id> + </navigation-case> + + <navigation-case> + <from-outcome>cancel</from-outcome> + <to-view-id>/rhq/resource/content/deploy-plain.xhtml?id=#{param.id}</to-view-id> + <redirect/> + </navigation-case> + + </navigation-rule> + + <navigation-rule> + <from-view-id>/rhq/resource/content/confirm-create-plain.xhtml</from-view-id> + + <navigation-case> + <from-outcome>successOrFailure</from-outcome> + <to-view-id>/rhq/resource/content/history-plain.xhtml?id=#{param.id}</to-view-id> + <redirect/> + </navigation-case> + + <navigation-case> + <from-outcome>cancel</from-outcome> + <to-view-id>/rhq/resource/content/deploy-plain.xhtml?id=#{param.id}</to-view-id> + <redirect/> + </navigation-case> + + </navigation-rule> + + <navigation-rule> + <from-view-id>/rhq/resource/content/confirm-delete-plain.xhtml</from-view-id> + + <navigation-case> + <from-outcome>successOrFailure</from-outcome> + <to-view-id>/rhq/resource/content/history-plain.xhtml?id=#{param.id}</to-view-id> + <redirect/> + </navigation-case> + + <navigation-case> + <from-outcome>cancel</from-outcome> + <to-view-id>/rhq/resource/content/deploy-plain.xhtml?id=#{param.id}</to-view-id> + <redirect/> + </navigation-case> + + </navigation-rule> + + <!-- Repo List --> + <navigation-rule> + <from-view-id>/rhq/content/listRepos-plain.xhtml</from-view-id> + + <navigation-case> + <!-- catch all navigation-case: if any actions return 'success', go here --> + <from-outcome>success</from-outcome> + <to-view-id>/rhq/content/listRepos-plain.xhtml</to-view-id> + <redirect/> + </navigation-case> + + <navigation-case> + <from-outcome>createNewRepo</from-outcome> + <to-view-id>/rhq/content/createRepo-plain.xhtml</to-view-id> + <redirect/> + </navigation-case> + + <navigation-case> + <from-outcome>importRepos</from-outcome> + <to-view-id>/rhq/content/importRepos-plain.xhtml</to-view-id> + <redirect/> + </navigation-case> + + <navigation-case> + <!-- sorting rule --> + <from-outcome>sort</from-outcome> + <to-view-id>/rhq/content/listRepos-plain.xhtml</to-view-id> + <redirect/> + </navigation-case> + + </navigation-rule> + + <navigation-rule> + <from-view-id>/rhq/content/importRepos-plain.xhtml</from-view-id> + <navigation-case> + <!-- catch all navigation-case: if any actions return 'success', go here --> + <from-outcome>success</from-outcome> + <to-view-id>/rhq/content/listRepos-plain.xhtml</to-view-id> + <redirect/> + </navigation-case> + <navigation-case> + <!-- import failed --> + <from-outcome>failed</from-outcome> + <to-view-id>/rhq/content/importRepos-plain.xhtml</to-view-id> + <redirect/> + </navigation-case> + <navigation-case> + <!-- sorting rule --> + <from-outcome>sort</from-outcome> + <to-view-id>/rhq/content/importRepos-plain.xhtml</to-view-id> + <redirect/> + </navigation-case> + </navigation-rule> + + <!-- Repo View --> + <navigation-rule> + <from-view-id>/rhq/content/repo-plain.xhtml</from-view-id> + + <navigation-case> + <from-outcome>success</from-outcome> + <to-view-id>/rhq/content/repo-plain.xhtml?mode=view&id=#{param.id}</to-view-id> + <redirect/> + </navigation-case> + + <navigation-case> + <from-outcome>edit</from-outcome> + <to-view-id>/rhq/content/repo-plain.xhtml?mode=edit&id=#{param.id}</to-view-id> + <redirect/> + </navigation-case> + + <navigation-case> + <from-outcome>associateWithContentProviders</from-outcome> + <to-view-id>/rhq/content/repoAssociations-plain.xhtml?id=#{param.id}</to-view-id> + <redirect/> + </navigation-case> + + <navigation-case> + <from-outcome>subscribeResources</from-outcome> + <to-view-id>/rhq/content/repoSubscriptions-plain.xhtml?id=#{param.id}</to-view-id> + <redirect/> + </navigation-case> + + <navigation-case> + <!-- sorting rule --> + <from-outcome>sort</from-outcome> + <to-view-id>/rhq/content/repo-plain.xhtml?mode=view&id=#{param.id}</to-view-id> + <redirect/> + </navigation-case> + + </navigation-rule> + + <!-- Content Source List --> + <navigation-rule> + <from-view-id>/rhq/content/listContentProviders-plain.xhtml</from-view-id> + + <navigation-case> + <!-- catch all navigation-case: if any actions return 'success', go here --> + <from-outcome>success</from-outcome> + <to-view-id>/rhq/content/listContentProviders-plain.xhtml</to-view-id> + <redirect/> + </navigation-case> + + <navigation-case> + <from-outcome>createNewContentSource</from-outcome> + <to-view-id>/rhq/content/createContentProvider-plain.xhtml?mode=new</to-view-id> + <redirect/> + </navigation-case> + + <navigation-case> + <!-- sorting rule --> + <from-outcome>sort</from-outcome> + <to-view-id>/rhq/content/listContentProviders-plain.xhtml</to-view-id> + <redirect/> + </navigation-case> + + </navigation-rule> + + <!-- Content Source View --> + <navigation-rule> + <from-view-id>/rhq/content/contentProvider-plain.xhtml</from-view-id> + + <navigation-case> + <from-outcome>success</from-outcome> + <to-view-id>/rhq/content/contentProvider-plain.xhtml?mode=view&id=#{param.id}</to-view-id> + <redirect/> + </navigation-case> + + <navigation-case> + <from-outcome>edit</from-outcome> + <to-view-id>/rhq/content/contentProvider-plain.xhtml?mode=edit&id=#{param.id}</to-view-id> + <redirect/> + </navigation-case> + + <navigation-case> + <!-- sorting rule --> + <from-outcome>sort</from-outcome> + <to-view-id>/rhq/content/contentProvider-plain.xhtml?mode=view&id=#{param.id}</to-view-id> + <redirect/> + </navigation-case> + + <navigation-case> + <from-action>#{ConfigHelperUIBean.accessMap}</from-action> + <to-view-id>/rhq/content/contentProvider-view-map-plain.xhtml</to-view-id> + </navigation-case> + + <navigation-case> + <from-action>#{ConfigHelperUIBean.accessMap}</from-action> + <to-view-id>/rhq/content/contentProvider-edit-map-plain.xhtml</to-view-id> + </navigation-case> + + <navigation-case> + <from-action>#{ConfigHelperUIBean.addNewMap}</from-action> + <to-view-id>/rhq/content/contentProvider-add-map-plain.xhtml</to-view-id> + </navigation-case> + + </navigation-rule> + + <!-- Content Source Creation --> + <navigation-rule> + <from-view-id>/rhq/content/createContentProvider-plain.xhtml</from-view-id> + + <navigation-case> + <from-action>#{ConfigHelperUIBean.accessMap}</from-action> + <to-view-id>/rhq/content/createContentProvider-edit-map-plain.xhtml</to-view-id> + </navigation-case> + + <navigation-case> + <from-action>#{ConfigHelperUIBean.addNewMap}</from-action> + <to-view-id>/rhq/content/createContentProvider-add-map-plain.xhtml</to-view-id> + </navigation-case> + + <navigation-case> + <from-outcome>save</from-outcome> + <to-view-id>/rhq/content/listContentProviders-plain.xhtml</to-view-id> + <redirect/> + </navigation-case> + + <navigation-case> + <from-outcome>cancel</from-outcome> + <to-view-id>/rhq/content/listContentProviders-plain.xhtml</to-view-id> + </navigation-case> + </navigation-rule> + + <navigation-rule> + <from-view-id>/rhq/content/createContentProvider-edit-map-plain.xhtml</from-view-id> + + <navigation-case> + <to-view-id>/rhq/content/createContentProvider-plain.xhtml</to-view-id> + </navigation-case> + </navigation-rule> + + <navigation-rule> + <from-view-id>/rhq/content/createContentProvider-add-map-plain.xhtml</from-view-id> + + <navigation-case> + <to-view-id>/rhq/content/createContentProvider-plain.xhtml</to-view-id> + </navigation-case> + </navigation-rule> + + <navigation-rule> + <from-view-id>/rhq/content/contentProvider-view-map-plain.xhtml</from-view-id> + + <navigation-case> + <to-view-id>/rhq/content/contentProvider-plain.xhtml</to-view-id> + </navigation-case> + </navigation-rule> + + <navigation-rule> + <from-view-id>/rhq/content/contentProvider-edit-map-plain.xhtml</from-view-id> + + <navigation-case> + <to-view-id>/rhq/content/contentProvider-plain.xhtml</to-view-id> + </navigation-case> + </navigation-rule> + + <navigation-rule> + <from-view-id>/rhq/content/contentProvider-add-map-plain.xhtml</from-view-id> + + <navigation-case> + <to-view-id>/rhq/content/contentProvider-plain.xhtml</to-view-id> + </navigation-case> + </navigation-rule> + + <!-- Repo Creation --> + <navigation-rule> + <from-view-id>/rhq/content/createRepo-plain.xhtml</from-view-id> + + <navigation-case> + <from-outcome>save</from-outcome> + <to-view-id>/rhq/content/listRepos-plain.xhtml</to-view-id> + <redirect/> + </navigation-case> + + <navigation-case> + <from-outcome>cancel</from-outcome> + <to-view-id>/rhq/content/listRepos-plain.xhtml</to-view-id> + </navigation-case> + + </navigation-rule> + + <!-- Repo Associations With Content Sources --> + <navigation-rule> + <from-view-id>/rhq/content/repoAssociations-plain.xhtml</from-view-id> + + <navigation-case> + <from-outcome>success</from-outcome> + <to-view-id>/rhq/content/repoAssociations-plain.xhtml?id=#{param.id}</to-view-id> + <redirect/> + </navigation-case> + + <navigation-case> + <!-- sorting rule --> + <from-outcome>sort</from-outcome> + <to-view-id>/rhq/content/repoAssociations-plain.xhtml?id=#{param.id}</to-view-id> + <redirect/> + </navigation-case> + + </navigation-rule> + + <!-- Repo Subscriptions --> + <navigation-rule> + <from-view-id>/rhq/content/repoSubscriptions-plain.xhtml</from-view-id> + + <navigation-case> + <from-outcome>success</from-outcome> + <to-view-id>/rhq/content/repoSubscriptions-plain.xhtml?id=#{param.id}</to-view-id> + <redirect/> + </navigation-case> + + <navigation-case> + <from-outcome>search</from-outcome> + <to-view-id>/rhq/content/repoSubscriptions-plain.xhtml?id=#{param.id}</to-view-id> + <redirect/> + </navigation-case> + + <navigation-case> + <!-- sorting rule --> + <from-outcome>sort</from-outcome> + <to-view-id>/rhq/content/repoSubscriptions-plain.xhtml?id=#{param.id}</to-view-id> + <redirect/> + </navigation-case> + + </navigation-rule> + +</faces-config> diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation/events-plain-navigation.xml b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation/events-plain-navigation.xml new file mode 100644 index 0000000..ef6b120 --- /dev/null +++ b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation/events-plain-navigation.xml @@ -0,0 +1,26 @@ +<?xml version="1.0"?> + +<faces-config version="1.2" xmlns="http://java.sun.com/xml/ns/javaee" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd"> + + <navigation-rule> + + <from-view-id>/rhq/resource/events/history-plain.xhtml</from-view-id> + + <navigation-case> + <from-outcome>sort</from-outcome> + <to-view-id>/rhq/resource/events/history-plain.xhtml?id=#{param.id}</to-view-id> + <redirect/> + </navigation-case> + + <navigation-case> + <from-outcome>success</from-outcome> + <to-view-id>/rhq/resource/events/history-plain.xhtml?id=#{param.id}</to-view-id> + <redirect/> + </navigation-case> + + </navigation-rule> + +</faces-config> + \ No newline at end of file diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation/measurement-plain-navigation.xml b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation/measurement-plain-navigation.xml new file mode 100644 index 0000000..9578b33 --- /dev/null +++ b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation/measurement-plain-navigation.xml @@ -0,0 +1,73 @@ +<?xml version="1.0"?> + +<faces-config version="1.2" xmlns="http://java.sun.com/xml/ns/javaee" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd"> + + <!-- Resource Measurement Schedules --> + <navigation-rule> + <from-view-id>/rhq/resource/monitor/schedules-plain.xhtml</from-view-id> + + <navigation-case> + <!-- catch all navigation-case: if any actions return 'success', go here --> + <from-outcome>success</from-outcome> + <to-view-id>/rhq/resource/monitor/schedules-plain.xhtml?id=#{param.id}</to-view-id> + <redirect/> + </navigation-case> + + <navigation-case> + <!-- sorting rule --> + <from-outcome>sort</from-outcome> + <to-view-id>/rhq/resource/monitor/schedules-plain.xhtml?id=#{param.id}</to-view-id> + <redirect/> + </navigation-case> + + </navigation-rule> + + <!-- changing metric display range on Monitor > Graphs --> + <navigation-rule> + <from-view-id>/rhq/resource/monitor/graphs-plain.xhtml</from-view-id> + + <navigation-case> + <!-- catch all navigation-case: if any actions return 'success', go here --> + <from-outcome>success</from-outcome> + <to-view-id>/rhq/resource/monitor/graphs-plain.xhtml?id=#{param.id}</to-view-id> + <redirect/> + </navigation-case> + + </navigation-rule> + + <!-- changing metric display range on Monitor > Tables --> + <navigation-rule> + <from-view-id>/rhq/resource/monitor/tables-plain.xhtml</from-view-id> + + <navigation-case> + <!-- catch all navigation-case: if any actions return 'success', go here --> + <from-outcome>success</from-outcome> + <to-view-id>/rhq/resource/monitor/tables-plain.xhtml?id=#{param.id}</to-view-id> + <redirect/> + </navigation-case> + + </navigation-rule> + + <!-- changing metric display range on Monitor > Response --> + <navigation-rule> + <from-view-id>/rhq/resource/monitor/response-plain.xhtml</from-view-id> + + <navigation-case> + <!-- catch all navigation-case: if any actions return 'success', go here --> + <from-outcome>success</from-outcome> + <to-view-id>/rhq/resource/monitor/response-plain.xhtml?id=#{param.id}</to-view-id> + <redirect/> + </navigation-case> + + <navigation-case> + <!-- sorting rule --> + <from-outcome>sort</from-outcome> + <to-view-id>/rhq/resource/monitor/response-plain.xhtml?id=#{param.id}</to-view-id> + <redirect/> + </navigation-case> + + </navigation-rule> + +</faces-config> \ No newline at end of file diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation/operation-plain-navigation.xml b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation/operation-plain-navigation.xml new file mode 100644 index 0000000..9750c4c --- /dev/null +++ b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation/operation-plain-navigation.xml @@ -0,0 +1,89 @@ +<?xml version="1.0"?> +<faces-config version="1.2" + xmlns="http://java.sun.com/xml/ns/javaee" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://java.sun.com/xml/ns/javaee + http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd"> + + <!-- New Resource Operation Schedule --> + <navigation-rule> + <from-view-id>/rhq/resource/operation/resourceOperationScheduleNew-plain.xhtml</from-view-id> + <navigation-case> + <!-- schedule an operation for deferred execution --> + <from-outcome>viewOperationSchedules</from-outcome> + <to-view-id>/rhq/resource/operation/resourceOperationSchedules-plain.xhtml?id=#{param.id}</to-view-id> + <redirect /> + </navigation-case> + <navigation-case> + <!-- schedule an operation for immediate execution --> + <from-outcome>viewOperationHistory</from-outcome> + <to-view-id>/rhq/resource/operation/resourceOperationHistory-plain.xhtml?id=#{param.id}</to-view-id> + <redirect /> + </navigation-case> + <navigation-case> + <!-- catch all navigation-case: if any actions return 'success', go back here --> + <from-outcome>success</from-outcome> + <to-view-id>/rhq/resource/operation/resourceOperationScheduleNew-plain.xhtml?id=#{param.id}&opId=#{param.opId}</to-view-id> + <redirect /> + </navigation-case> + <navigation-case> + <!-- catch all navigation-case: if any actions return 'success', go back here --> + <from-outcome>validationError</from-outcome> + <to-view-id>/rhq/resource/operation/resourceOperationScheduleNew-plain.xhtml</to-view-id> + </navigation-case> + <navigation-case> + <!-- sorting rule --> + <from-outcome>sort</from-outcome> + <to-view-id>/rhq/resource/operation/resourceOperationScheduleNew-plain.xhtml?id=#{param.id}</to-view-id> + <redirect /> + </navigation-case> + </navigation-rule> + + <!-- Resource Operation Schedules --> + <navigation-rule> + <from-view-id>/rhq/resource/operation/resourceOperationSchedules-plain.xhtml</from-view-id> + <navigation-case> + <!-- catch all navigation-case: if any actions return 'success', go here --> + <from-outcome>success</from-outcome> + <to-view-id>/rhq/resource/operation/resourceOperationSchedules-plain.xhtml?id=#{param.id}</to-view-id> + <redirect /> + </navigation-case> + <navigation-case> + <!-- sorting rule --> + <from-outcome>sort</from-outcome> + <to-view-id>/rhq/resource/operation/resourceOperationSchedules-plain.xhtml?id=#{param.id}</to-view-id> + <redirect /> + </navigation-case> + <navigation-case> + <!-- schedule an operation for immediate execution --> + <from-outcome>viewOperationHistory</from-outcome> + <to-view-id>/rhq/resource/operation/resourceOperationHistory-plain.xhtml?id=#{param.id}</to-view-id> + <redirect /> + </navigation-case> + </navigation-rule> + + <!-- Resource Operation History --> + <navigation-rule> + <from-view-id>/rhq/resource/operation/resourceOperationHistory-plain.xhtml</from-view-id> + <navigation-case> + <!-- catch all navigation-case: if any actions return 'success', go here --> + <from-outcome>success</from-outcome> + <to-view-id>/rhq/resource/operation/resourceOperationHistory-plain.xhtml?id=#{param.id}</to-view-id> + <redirect /> + </navigation-case> + <navigation-case> + <!-- sorting rule --> + <from-outcome>sort</from-outcome> + <to-view-id>/rhq/resource/operation/resourceOperationHistory-plain.xhtml?id=#{param.id}</to-view-id> + <redirect /> + </navigation-case> + </navigation-rule> + + <navigation-rule> + <from-view-id>/rhq/resource/operation/resourceOperationHistoryDetails-plain.xhtml</from-view-id> + <navigation-case> + <from-action>#{ConfigHelperUIBean.accessMap}</from-action> + <to-view-id>/rhq/resource/operation/view-results-map-plain.xhtml</to-view-id> + </navigation-case> + </navigation-rule> +</faces-config> diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/web.xml b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/web.xml index 8d69a36..03f80f0 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/web.xml +++ b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/web.xml @@ -161,6 +161,12 @@ /WEB-INF/jsf-navigation/measurement-navigation.xml, /WEB-INF/jsf-navigation/summary-navigation.xml, /WEB-INF/jsf-navigation/test-navigation.xml, + + /WEB-INF/jsf-navigation/alert-plain-navigation.xml, + /WEB-INF/jsf-navigation/content-plain-navigation.xml, + /WEB-INF/jsf-navigation/events-plain-navigation.xml, + /WEB-INF/jsf-navigation/operation-plain-navigation.xml, + /WEB-INF/jsf-navigation/measurement-plain-navigation.xml,
/WEB-INF/jsf-navigation-definition/group-definition-navigation.xml,
commit d5dfe2ed9d42af51c6c3d3793f79e315c52ed092 Author: Joseph Marques <joseph@redhat.com> Date: Wed Aug 11 07:08:28 2010 -0400
create a "plain" pagination scheme for iframed-facelets
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/include/pagination-plain.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/include/pagination-plain.xhtml new file mode 100644 index 0000000..8a4debb --- /dev/null +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/include/pagination-plain.xhtml @@ -0,0 +1,112 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE html + PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html + xmlns:h="http://java.sun.com/jsf/html" + xmlns:f="http://java.sun.com/jsf/core" + xmlns:c="http://java.sun.com/jstl/core" + xmlns:ui="http://java.sun.com/jsf/facelets" + xmlns:rich="http://richfaces.ajax4jsf.org/rich" + xmlns:a4j="https://ajax4jsf.dev.java.net/ajax" + xmlns:onf="http://jboss.org/on/function"> + + <body> + + <f:view> + + Usage: The following parameters must be set in the calling page + + paginationDataTableName - Name of the data table to be controlled + paginationDataModel - Data model of the underlying table being controlled (used for total row count) + paginationPageControl - Page control value to set when changing the number of rows per page + + <ui:composition> + + <h:panelGroup layout="block" style="float: right; margin-right: 30px"> + <ui:param name="paginationDataScrollerName" value="#{paginationDataTableName}Scroller"/> + <c:if test="#{empty paginationUIBean}"> + <ui:param name="paginationSettingUIBean" value="#{PageControlSettingsUIBean}" /> + </c:if> + <c:if test="#{not empty paginationUIBean}"> + <ui:param name="paginationSettingUIBean" value="#{paginationUIBean}" /> + </c:if> + + <table> + <tr> + <td nowrap="nowrap"> + + + <h:outputText value="Total: #{paginationDataModel.rowCount}" + style="margin-right: 1em; font-weight: bold; "/> + <h:outputText value="Items Per Page: #{paginationPageControl.pageSize}" + style="font-weight: bold; " + rendered="#{paginationDataModel.rowCount gt paginationSettingUIBean.minimumPageSize + and not paginationPageControl.unlimited + and not (onf:length(paginationSettingUIBean.pageSizes) gt 1)}" /> + <h:outputText value="Items Per Page:" + style="margin-right: 1em; font-weight: bold; " + rendered="#{paginationDataModel.rowCount gt paginationSettingUIBean.minimumPageSize + and not paginationPageControl.unlimited + and (onf:length(paginationSettingUIBean.pageSizes) gt 1)}"/> + <h:selectOneListbox id="currentPageSize" + size="1" + value="#{paginationPageControl.pageSize}" + rendered="#{paginationDataModel.rowCount gt paginationSettingUIBean.minimumPageSize + and not paginationPageControl.unlimited + and (onf:length(paginationSettingUIBean.pageSizes) gt 1)}"> + <a4j:support event="onchange" + reRender="#{paginationDataTableName}, #{paginationDataScrollerName}"/> + <f:selectItems value="#{paginationSettingUIBean.pageSizes}" /> + </h:selectOneListbox> + + </td> + <td nowrap="nowrap"> + + <!-- Limit to 7 pages until e find a general fix for RHQ-1813 --> + <rich:datascroller id="#{paginationDataScrollerName}" + for="#{paginationDataTableName}" + rendered="#{not paginationPageControl.unlimited}" + selectedStyle="font-weight: bold;" + inactiveStyle="font-weight: normal;" + stepControls="show" + fastControls="hide" + boundaryControls="hide" + maxPages="7" + page="#{paginationPageControl.pageNumber}"> + <f:facet name="next"> + <h:panelGroup> + <h:graphicImage value="/images/tbb_pageright.gif" style="padding: 0px 5px 0px 7px;" /> + </h:panelGroup> + </f:facet> + <f:facet name="next_disabled"> + <h:panelGroup> + <h:graphicImage value="/images/tbb_pageright_gray.gif" style="padding: 0px 5px 0px 7px;" /> + </h:panelGroup> + </f:facet> + <f:facet name="previous"> + <h:panelGroup> + <h:graphicImage value="/images/tbb_pageleft.gif" style="padding: 0px 5px 0px 7px;" /> + </h:panelGroup> + </f:facet> + <f:facet name="previous_disabled"> + <h:panelGroup> + <h:graphicImage value="/images/tbb_pageleft_gray.gif" style="padding: 0px 5px 0px 7px;" /> + </h:panelGroup> + </f:facet> + </rich:datascroller> + + </td> + </tr> + </table> + + + </h:panelGroup> + + <div style="clear: both;"/> + + </ui:composition> + </f:view> + + </body> +</html> \ No newline at end of file
commit 5a37b80f0cee3cf67c9aea9ca386019555ece295 Author: Joseph Marques <joseph@redhat.com> Date: Wed Aug 11 07:08:08 2010 -0400
create a "plain" layout scheme for iframed-facelets
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/entity/layout/main-plain.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/entity/layout/main-plain.xhtml new file mode 100644 index 0000000..157b598 --- /dev/null +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/entity/layout/main-plain.xhtml @@ -0,0 +1,39 @@ +<ui:composition template="/rhq/layout/main-plain-layout.xhtml" + xmlns="http://www.w3.org/1999/xhtml" + xmlns:h="http://java.sun.com/jsf/html" + xmlns:f="http://java.sun.com/jsf/core" + xmlns:a4j="http://richfaces.org/a4j" + xmlns:rich="http://richfaces.ajax4jsf.org/rich" + xmlns:ui="http://java.sun.com/jsf/facelets"> + + <ui:define name="body-area"> + + <!-- work around for IE and its broken box model. Without the concrete height value, the nav pane will shrink on hover. --> + <!--[if IE]> + <div id="contentParent" style="height: 100%"> + <![endif]--> + <!--[if !IE]><!--> + <div id="contentParent"> + <!--<![endif]--> + <div id="centerContentWrapper" class="content-right"> + <div style="left: 0; right: 0; height: 100%;"> + + <!-- Shows the results of the last action executed. --> + <h:messages showSummary="true" + showDetail="true" + infoClass="InfoBlock" + warnClass="WarnBlock" + errorClass="ErrorBlock" + fatalClass="FatalBlock" + globalOnly="true" + layout="table" + width="100%" /> + + <ui:insert name="content"><p>Default Entity Content</p></ui:insert> + </div> + </div> + </div> + + </ui:define> + +</ui:composition> diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/layout/main-plain-layout.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/layout/main-plain-layout.xhtml new file mode 100644 index 0000000..ffb0bda --- /dev/null +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/layout/main-plain-layout.xhtml @@ -0,0 +1,310 @@ +<?xml version="1.0"?> + +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml" + xmlns:h="http://java.sun.com/jsf/html" + xmlns:f="http://java.sun.com/jsf/core" + xmlns:ui="http://java.sun.com/jsf/facelets" + xmlns:c="http://java.sun.com/jstl/core" + xmlns:a4j="http://richfaces.org/a4j" + xmlns:onc="http://jboss.org/on/component" + xmlns:rich="http://richfaces.ajax4jsf.org/rich"> + +<head> + <title>${msg["product.shortName"]} - #{(!empty pageTitle) ? pageTitle : defaultPageTitle}</title> + + <meta http-equiv="Expires" content="-1"/> + <meta http-equiv="Pragma" content="no-cache"/> + <meta http-equiv="Max-Age" content="0"/> + <meta http-equiv="Cache-Control" content="no-cache"/> + <ui:insert name="metaHeaders"></ui:insert> + + <link rel="stylesheet" type="text/css" media="screen" href="/css/win.css"/> + <link rel="stylesheet" type="text/css" media="screen" href="/css/form-style.css"/> + <link rel="stylesheet" type="text/css" media="screen" href="/css/menu.css"/> + + <script type="text/javascript" src="/js/functions.js"></script> + <script type="text/javascript" src="/js/prototype.js"></script> + <script type="text/javascript" src="/js/window.js"></script> + <script type="text/javascript" src="/js/effects.js"></script> + <!--<script type="text/javascript" src="/js/debug.js"></script>--> + <script type="text/javascript" src="/js/formValues.js"></script> + <script type="text/javascript" src="/js/rhq.js"></script> + <script type="text/javascript" src="/js/popup.js"></script> + <link href="/css/theme/default.css" rel="stylesheet" type="text/css"/> + <link href="/css/theme/alphacube.css" rel="stylesheet" type="text/css"/> + <link href="/css/theme/debug.css" rel="stylesheet" type="text/css"/> + + <link rel="icon" type="image/png" href="/images/favicon.png"/> + <link rel="apple-touch-icon" href="/images/favicon.png"/> + + <!-- Trims up the headers of RF toggle panel headers --> + <style type="text/css"> + .BlockTitle { + padding-top: 3px; + padding-bottom: 3px; + } + HTML, BODY { overflow: hidden; } + </style> + + +<style type="text/css"> + +.dr-pnl { + border-style: none; + padding: 0; +} + +.dr-pnl-b { + border-color: white; + padding: 0; + margin: 0; +} + +.dr-pnl-h { /* Files */ + background-image: none; + background-color: rgb(164, 178, 185); + font-family: sans-serif; + font-size: 10px; +} + +.dr-pmenu-group-self-label { /* filename */ + color: rgb(109, 120, 124); + font-family: sans-serif; + font-size: 9px; + white-space: nowrap; +} + +.rich-pmenu { /* Defines styles for panel menu */ + +} +.rich-pmenu-disabled-element { /* Defines styles for panel menu disabled element */ + +} +.rich-pmenu-group { /* styles for panel menu group */ + background-image: none; + background-color: rgb(217, 223, 227); +} + +.rich-pmenu-group-self-label { /* directory - Defines styles for panel menu group label */ + font-family: sans-serif; + font-size: 9px; + color: rgb(102, 102, 102); + white-space: nowrap; +} +.rich-pmenu-item { /* Defines styles for panel menu item */ + background-color: rgb(223, 228, 232); + color: rgb(217, 223, 227); + border-style: none; + margin: 0; + padding: 0; + padding-left: 15px; + +} +.rich-pmenu-nowrap { /* Defines styles for panel menu wrapper */ + +} +.rich-pmenu-selected-element { /* Defines styles for panel menu selected element */ + background-color: white; + font-style: normal; + font-weight: bold; + color: #00ff99; + +} +.rich-pmenu-top-group { /* Defines styles for panel menu top group element */ + padding-left: 15px; +} +.rich-pmenu-top-group-div { /* Defines styles for panel menu top group div element */ + border-style: none; + border-bottom-style: dotted; + border-bottom-color: white; + margin: 0; + padding: 0; +} + +.raw-outer-table-left-col { + background-color: rgb(217, 223, 227); +} + +.raw-outer-table-left-col-footer { + background-color: rgb(217, 223, 227); + width: 100%; +} + +.raw-outer-table-left-col-footer-content { + font-family: sans-serif; + font-size: 9px; + font-weight: bold; + color: gray; + padding-left: 10px; +} + +.rawConfigUndoButton { + font-size: 9px; + font-weight: bold; + color: #666666; + background-color: #FFFFFF; + border: 1px solid #B0B0B0; + padding: 0px 5px; + cursor: pointer; + text-decoration: none +} + +.rawCancelButton { + font-size: 11px; + font-weight: bold; + color: #E6E8ED; + background-color: #828CA3; + border: 1px outset #626C83; + padding: 1px 10px; + cursor: pointer; + text-decoration: none; + margin-left: 5px; +} + +.rawConfigFileNameCol { + color: rgb(109, 120, 124); + font-family: sans-serif; + font-size: 9px; + white-space: nowrap; +} + +.rawConfigUndoCol { + width: 25%; + text-align: right; +} + +.rawConfigFileHeader { + color: gray; + white-space: nowrap; + font-weight: bold; + font-family: sans-serif; +} + +.rawConfigFileContents { + font-family: sans-serif; + color: gray; + background-color: white; + border-style: solid; + border-width: thin; + border-color: rgb(102, 102, 102); + width: 100%; + height: 300px; + overflow-x: auto; + overflow-y: scroll; +} + + + + </style> + + + + <link rel="stylesheet" type="text/css" media="screen" href="/css/tabular.css"/> + <link rel="stylesheet" type="text/css" media="screen" href="/css/layout.css"/> + + <script type="text/javascript"> + var imagePath = "/images/"; + </script> + +</head> + +<body bgcolor="#FFFFFF" style="height: 100%;"> + +<ui:remove> + <!-- Set the content type to "text/html" (overriding the default of "application/xhtml+xml") to force +Firefox and other Gecko-based browsers to render the page in "Almost Standards" (i.e. transitional) mode. --> +</ui:remove> +<f:view contentType="text/html"> + + + <f:loadBundle basename="ApplicationResources" var="msg"/> + + <!-- =================== PAGE HEADER =================== --> + + <script language="javascript" type="text/javascript"> + //this has to be defined before the resize trackers inside + //the PageBody element because they depend on the values + //computed inside this tracker function. + WindowResizeTracker.addListener(function() { + var header = $('PageHeader'); + var borderHeight = 2; //set in the inline style of div PageHeader + + if (Prototype.Browser.IE) { + header.style.height = WindowResizeTracker.currentSizes.windowHeight + 'px'; + } else { + header.style.height = (WindowResizeTracker.currentSizes.windowHeight - borderHeight) + 'px'; + } + header.style.width = WindowResizeTracker.currentSizes.windowWidth + 'px'; + + var body = $('PageBody'); + //0 = menu height (and the top position of PageBody) + body.style.height = (WindowResizeTracker.currentSizes.windowHeight - 0 - borderHeight) + 'px'; + body.style.width = header.style.width; + + document.body.style.height = WindowResizeTracker.currentSizes.windowHeight + 'px'; + }); + </script> + <!-- work around for IE and its broken box model. Without the concrete height value, the nav pane will shrink on hover. --> + <!--[if IE]> + <div id="PageHeader" style="border-bottom: 2px solid #999; position: absolute; top: 0; bottom: 0; left: 0; right: 0; height: 100%"> + <![endif]--> + <!--[if !IE]><!--> + <div id="PageHeader" style="border-bottom: 2px solid #999; position: absolute; top: 0; bottom: 0; left: 0; right: 0;"> + <!--<![endif]--> + + <!-- work around for IE and its broken box model. Without the concrete height value, the nav pane will shrink on hover. --> + <!--[if IE]> + <div id="PageBody" style="width: 100%; position: absolute; top: 0px; bottom: 0; height: 100%;"> + <![endif]--> + <!--[if !IE]><!--> + <div id="PageBody" style="width: 100%; position: absolute; top: 0px; bottom: 0;"> + <!--<![endif]--> + <ui:insert name="body-area">Default Page Body</ui:insert> + </div> + + </div> + + + + <!-- =================== BODY =================== --> + + + <div id="about" class="dialog" style="display: none; position: absolute; top: 0; left: 0;"> + <div class="DisplayContent" style="margin: 0;"> + <div style="margin:5px"> + <p class="compact"> + <span class="DisplaySubhead">${msg['footer.aboutLink']}</span><br/> + <span class="DisplayLabel">${msg['footer.version']}: ${msg['product.version']}</span><br/> + <span class="DisplayLabel">${msg['footer.buildNumber']}: ${msg['product.buildNumber']}</span> + </p> + + <p class="compact"> + <f:verbatim>${msg['footer.copyright']}</f:verbatim> ${msg['about.Copyright.Content']} + </p> + + <p class="compact"> + ${msg['about.MoreInfo.Label']}<br/> + <a href="mailto:${msg['about.MoreInfo.LinkSales']}">${msg['about.MoreInfo.LinkSales']}</a><br/> + <a href="mailto:${msg['about.MoreInfo.LinkSupport']}">${msg['about.MoreInfo.LinkSupport']}</a> + </p> + </div> + </div> + </div> + + <!-- work-around to enable us to embed richfaces components inside the onc:simpleTrigger; +without this, the page will throw a javascript error "{blah} is not defined" or +"{yadda} is not a constructor", and the pop-up action will not work --> + <rich:calendar rendered="false"/> + <rich:inputNumberSpinner rendered="false"/> + +</f:view> + +<script type="text/javascript"> + addWindowOnLoadEvent(disableConditionalButtons); +</script> + +</body> +</html> diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/layout/main-plain.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/layout/main-plain.xhtml new file mode 100644 index 0000000..6f2cd02 --- /dev/null +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/layout/main-plain.xhtml @@ -0,0 +1,17 @@ +<ui:composition template="/rhq/entity/layout/main-plain.xhtml" + xmlns="http://www.w3.org/1999/xhtml" + xmlns:h="http://java.sun.com/jsf/html" + xmlns:f="http://java.sun.com/jsf/core" + xmlns:ui="http://java.sun.com/jsf/facelets" + xmlns:c="http://java.sun.com/jstl/core" + xmlns:onc="http://jboss.org/on/component" + xmlns:onf="http://jboss.org/on/function" + xmlns:s="http://jboss.com/products/seam/taglib" + xmlns:a4j="https://ajax4jsf.dev.java.net/ajax" + xmlns:rich="http://richfaces.ajax4jsf.org/rich%22%3E + + <ui:define name="content"> + <h1>Default Resource Content</h1> + </ui:define> + +</ui:composition> \ No newline at end of file
commit b0cac99b444d86edc047a3a1bc031907207c2350 Author: Joseph Marques joseph@redhat.com Date: Wed Aug 11 07:00:40 2010 -0400
criteria objects with customized sorting should not get LEFT JOIN treatment
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/CriteriaQueryGenerator.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/CriteriaQueryGenerator.java index 3216ec7..82ffd48 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/CriteriaQueryGenerator.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/CriteriaQueryGenerator.java @@ -342,6 +342,12 @@ public final class CriteriaQueryGenerator { boolean doNotPrefixAlias = isNumber(suffix) || criteria.hasCustomizedSorting(); String sortFragment = doNotPrefixAlias ? suffix : (alias + "." + suffix);
+ if (criteria.hasCustomizedSorting()) { + // customized sorting does not get LEFT JOIN expressions added + orderingFieldTokens.add(sortFragment + " " + ordering); + continue; + } + int lastDelimiterIndex = sortFragment.lastIndexOf('.'); if (lastDelimiterIndex == -1) { // does not require joins, just add the ordering field token directly @@ -568,8 +574,8 @@ public final class CriteriaQueryGenerator {
try { Class<?> entityClass = criteria.getPersistentClass(); - SearchTranslationManager searchManager = new SearchTranslationManager(subject, - SearchSubsystem.get(entityClass)); + SearchTranslationManager searchManager = new SearchTranslationManager(subject, SearchSubsystem + .get(entityClass)); searchManager.setExpression(searchExpression);
// translate first, if there was an error we won't add the dangling 'AND' to the where clause
commit 56cdad77b1f9e576bdeb7f27eec7d6f4ea929351 Author: Joseph Marques joseph@redhat.com Date: Wed Aug 11 01:01:03 2010 -0400
Don't allow "Step X of Y" for wizard-based flows to wrap to next line
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/wizard/WizardView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/wizard/WizardView.java index a8ff10b..3d88005 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/wizard/WizardView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/wizard/WizardView.java @@ -206,6 +206,7 @@ public class WizardView extends VLayout { currentStep = stepIndex;
stepLabel.setContents("Step " + (stepIndex + 1) + " of " + wizardSteps.size()); + stepLabel.setWrap(false);
WizardStep step = wizardSteps.get(currentStep);
commit 4bed8786b2d15c9ace92b938e1b9e160dde5d65e Author: Joseph Marques joseph@redhat.com Date: Wed Aug 11 00:30:37 2010 -0400
fix 2 compilation errors where Set could not be assigned to EnumSet
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/perspective/activator/context/GroupActivationContext.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/perspective/activator/context/GroupActivationContext.java index 9e853f0..2c572fb 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/perspective/activator/context/GroupActivationContext.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/perspective/activator/context/GroupActivationContext.java @@ -60,7 +60,7 @@ public class GroupActivationContext extends AbstractResourceOrGroupActivationCon // lazy load if (this.facets == null) { ResourceFacets resourceFacets = this.resourceTypeManager.getResourceFacets(getResourceType().getId()); - this.facets = resourceFacets.getFacets(); + this.facets = EnumSet.copyOf(resourceFacets.getFacets()); } return this.facets; } diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/perspective/activator/context/ResourceActivationContext.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/perspective/activator/context/ResourceActivationContext.java index 510f584..de91285 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/perspective/activator/context/ResourceActivationContext.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/perspective/activator/context/ResourceActivationContext.java @@ -62,7 +62,7 @@ public class ResourceActivationContext extends AbstractResourceOrGroupActivation if (this.facets == null) { ResourceFacets resourceFacets = this.resourceTypeManager.getResourceFacets(resource.getResourceType() .getId()); - this.facets = resourceFacets.getFacets(); + this.facets = EnumSet.copyOf(resourceFacets.getFacets()); } return this.facets; }
commit 6e66afbb63d19bad003c6c26b08b31c8c7135171 Author: Ian Springer ian.springer@redhat.com Date: Tue Aug 10 18:23:34 2010 -0400
fix bookmarking/history for Resource tabs
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java index 1204539..144442b 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java @@ -92,7 +92,7 @@ public class ResourceGroupDetailView extends VLayout implements BookmarkableView monitoringTab = new TwoLevelTab("Monitoring", "/images/icons/Monitor_grey_16.png"); monitoringTab.registerSubTabs("Graphs", "Tables", "Traits", "Availability", "Schedules", "Call Time");
- inventoryTab = new TwoLevelTab(DEFAULT_TAB_NAME, "/images/icons/Inventory_grey_16.png"); + inventoryTab = new TwoLevelTab("Inventory", "/images/icons/Inventory_grey_16.png"); inventoryTab.registerSubTabs("Overview", "Members", "Connection Settings");
operationsTab = new TwoLevelTab("Operations", "/images/icons/Operation_grey_16.png"); diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupTopView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupTopView.java index d16d403..c75f6e8 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupTopView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupTopView.java @@ -116,14 +116,14 @@ public class ResourceGroupTopView extends HLayout implements BookmarkableView { public void renderView(ViewPath viewPath) { if (viewPath.isEnd()) { // default detail view - viewPath.getViewPath().add(new ViewId("Summary")); + viewPath.getViewPath().add(new ViewId("Inventory")); viewPath.getViewPath().add(new ViewId("Overview")); }
Integer groupId = Integer.parseInt(viewPath.getCurrent().getPath());
if (currentGroup == null || currentGroup.getResourceGroup().getId() != groupId) { - // The previous bookmark did not already point to this group. + // The previous history item did not already point to this group. setSelectedGroup(groupId, viewPath); }
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java index a40f10a..7415ba7 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java @@ -25,7 +25,6 @@ import com.google.gwt.user.client.History; import com.google.gwt.user.client.rpc.AsyncCallback; import com.smartgwt.client.types.Side; import com.smartgwt.client.widgets.layout.VLayout; -import com.smartgwt.client.widgets.tab.Tab;
import org.rhq.core.domain.authz.Permission; import org.rhq.core.domain.resource.Resource; @@ -62,6 +61,8 @@ import org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTyp */ public class ResourceDetailView extends VLayout implements BookmarkableView, ResourceSelectListener, TwoLevelTabSelectedHandler {
+ private static final String DEFAULT_TAB_NAME = "Summary"; + private Resource resource; private ResourcePermission permissions; private ResourceType type; @@ -79,9 +80,6 @@ public class ResourceDetailView extends VLayout implements BookmarkableView, Res
private ResourceTitleBar titleBar;
- private ViewId tabView; - private ViewId subtabView; -
public void setResource(Resource resource) { this.resource = resource; @@ -146,10 +144,7 @@ public class ResourceDetailView extends VLayout implements BookmarkableView, Res this.resource = resource;
titleBar.setResource(resource); - - int selectedTab = topTabSet.getSelectedTabNumber(); - - + FullHTMLPane timelinePane = new FullHTMLPane("/rhq/resource/summary/timeline-plain.xhtml?id=" + resource.getId()); summaryTab.updateSubTab("Overview", new ResourceOverviewView(resource)); summaryTab.updateSubTab("Timeline", timelinePane); @@ -269,43 +264,43 @@ public class ResourceDetailView extends VLayout implements BookmarkableView, Res
public void onTabSelected(TwoLevelTabSelectedEvent tabSelectedEvent) { + // Switch tabs directly, rather than letting the history framework do it, to avoid redrawing the outer views. + selectTab(tabSelectedEvent.getId(), tabSelectedEvent.getSubTabId()); String tabPath = "/" + tabSelectedEvent.getId() + "/" + tabSelectedEvent.getSubTabId(); -// System.out.println("TAB: " + currentView.getPath() + tabPath); + String path = "Resource/" + this.resource.getId() + tabPath;
- if (resource != null) { - String path = "Resource/" + resource.getId() + tabPath; - History.newItem(path, false); - } + // But still add an item to the history, specifying false to tell it not to fire an event. + History.newItem(path, false); }
public void renderView(ViewPath viewPath) { - // TODO: Implement this method. - - if (viewPath.isEnd()) { - // default - - } else { - - tabView = viewPath.getCurrent(); - subtabView = viewPath.getNext(); - - for (Tab t : topTabSet.getTabs()) { - TwoLevelTab tab = (TwoLevelTab) t; - - if (tab.getTitle().equals(tabView.getPath())) { - topTabSet.selectTab(tab); //tabView.getPath()); - - tab.getLayout().selectTab(subtabView.getPath()); - + // e.g. #Resource/10010/Inventory/Overview + String tabName = (!viewPath.isEnd()) ? viewPath.getCurrent().getPath() : null; // e.g. "Inventory" + String subTabName = (viewPath.viewsLeft() >= 1) ? viewPath.getNext().getPath() : null; // e.g. "Overview" + selectTab(tabName, subTabName); + }
- }
+ public void selectTab(String tabName, String subtabName) { + if (tabName == null) { + tabName = DEFAULT_TAB_NAME; + } + TwoLevelTab tab = (TwoLevelTab)this.topTabSet.getTabByTitle(tabName); + if (tab == null) { + CoreGUI.getErrorHandler().handleError("Invalid tab name: " + tabName); + // TODO: Should we fire a history event here to redirect to a valid bookmark? + tab = (TwoLevelTab)this.topTabSet.getTabByTitle(DEFAULT_TAB_NAME); + } + this.topTabSet.selectTab(tab); + if (subtabName != null) { + if (!tab.getLayout().selectTab(subtabName)) { + CoreGUI.getErrorHandler().handleError("Invalid subtab name: " + subtabName); + // TODO: Should we fire a history event here to redirect to a valid bookmark? + return; } - - + tab.getLayout().selectTab(subtabName); } - - } + } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceView.java index e342628..f7b5c6e 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceView.java @@ -133,16 +133,13 @@ public class ResourceView extends HLayout implements BookmarkableView { Integer resourceId = Integer.parseInt(viewPath.getCurrent().getPath());
if (currentResource == null || currentResource.getId() != resourceId) { - + // The previous history item did not already point to this Resource. setSelectedResource(resourceId, viewPath); - - this.treeView.renderView(viewPath); - - viewPath.next(); - - this.detailView.renderView(viewPath); - } + + viewPath.next(); + this.treeView.renderView(viewPath); + this.detailView.renderView(viewPath); }
}
commit 92f76547ae768f78379d0abbd9fde4b3d0e375e8 Author: Ian Springer ian.springer@redhat.com Date: Tue Aug 10 17:33:32 2010 -0400
fix bookmarks/history for group tabs
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/tab/SubTabLayout.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/tab/SubTabLayout.java index 9b07011..bc79260 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/tab/SubTabLayout.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/tab/SubTabLayout.java @@ -151,12 +151,14 @@ public class SubTabLayout extends VLayout {
- public void selectTab(String title) { + public boolean selectTab(String title) { + boolean foundTab = false; currentlySelected = title; int i = 0; for (String sub : subtabs.keySet()) { if (sub.equals(title)) { currentIndex = i; + foundTab = true; break; } i++; @@ -167,11 +169,11 @@ public class SubTabLayout extends VLayout { ((Button)buttonBar.getMember(currentIndex)).select(); draw(subtabs.get(title)); } + + return foundTab; }
- - // ------- Event support ------- // Done with a separate handler manager from parent class on purpose (compatibility issue)
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/tab/TwoLevelTabSet.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/tab/TwoLevelTabSet.java index a8bc6cd..b12304c 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/tab/TwoLevelTabSet.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/tab/TwoLevelTabSet.java @@ -18,7 +18,6 @@ */ package org.rhq.enterprise.gui.coregui.client.components.tab;
-import com.google.gwt.event.shared.DefaultHandlerRegistration; import com.google.gwt.event.shared.HandlerManager; import com.google.gwt.event.shared.HandlerRegistration; import com.smartgwt.client.widgets.tab.Tab; @@ -26,15 +25,12 @@ import com.smartgwt.client.widgets.tab.TabSet; import com.smartgwt.client.widgets.tab.events.TabSelectedEvent; import com.smartgwt.client.widgets.tab.events.TabSelectedHandler;
-import java.util.ArrayList; - /** * @author Greg Hinkle */ public class TwoLevelTabSet extends TabSet implements TabSelectedHandler, TwoLevelTabSelectedHandler {
- public void setTabs(TwoLevelTab... tabs) { super.setTabs(tabs); for (TwoLevelTab tab : tabs) { @@ -48,9 +44,6 @@ public class TwoLevelTabSet extends TabSet implements TabSelectedHandler, TwoLev }
- - - // ------- Event support ------- // Done with a separate handler manager from parent class on purpose (compatibility issue)
@@ -80,5 +73,15 @@ public class TwoLevelTabSet extends TabSet implements TabSelectedHandler, TwoLev
m.fireEvent(tabSelectedEvent); } + + public Tab getTabByTitle(String title) { + Tab[] tabs = getTabs(); + for (Tab tab : tabs) { + if (tab.getTitle().equals(title)) { + return tab; + } + } + return null; + } }
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java index 7ce23a7..1204539 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java @@ -25,7 +25,6 @@ import com.google.gwt.user.client.History; import com.google.gwt.user.client.rpc.AsyncCallback; import com.smartgwt.client.types.Side; import com.smartgwt.client.widgets.layout.VLayout; -import com.smartgwt.client.widgets.tab.Tab;
import org.rhq.core.domain.authz.Permission; import org.rhq.core.domain.resource.ResourceType; @@ -36,7 +35,6 @@ import org.rhq.core.domain.resource.group.ResourceGroup; import org.rhq.core.domain.resource.group.composite.ResourceGroupComposite; import org.rhq.enterprise.gui.coregui.client.BookmarkableView; import org.rhq.enterprise.gui.coregui.client.CoreGUI; -import org.rhq.enterprise.gui.coregui.client.ViewId; import org.rhq.enterprise.gui.coregui.client.ViewPath; import org.rhq.enterprise.gui.coregui.client.components.tab.TwoLevelTab; import org.rhq.enterprise.gui.coregui.client.components.tab.TwoLevelTabSelectedEvent; @@ -51,11 +49,12 @@ import org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTyp * Right panel of the group view. * * @author Greg Hinkle + * @author Ian Springer */ public class ResourceGroupDetailView extends VLayout implements BookmarkableView, TwoLevelTabSelectedHandler { + private static final String DEFAULT_TAB_NAME = "Inventory";
private ResourceGroupComposite groupComposite; - private ResourceType groupType; private ResourcePermission permissions;
private TwoLevelTab summaryTab; @@ -70,8 +69,6 @@ public class ResourceGroupDetailView extends VLayout implements BookmarkableView
private ResourceGroupTitleBar titleBar;
- private ViewId tabView; - private ViewId subtabView;
@Override protected void onDraw() { @@ -95,7 +92,7 @@ public class ResourceGroupDetailView extends VLayout implements BookmarkableView monitoringTab = new TwoLevelTab("Monitoring", "/images/icons/Monitor_grey_16.png"); monitoringTab.registerSubTabs("Graphs", "Tables", "Traits", "Availability", "Schedules", "Call Time");
- inventoryTab = new TwoLevelTab("Inventory", "/images/icons/Inventory_grey_16.png"); + inventoryTab = new TwoLevelTab(DEFAULT_TAB_NAME, "/images/icons/Inventory_grey_16.png"); inventoryTab.registerSubTabs("Overview", "Members", "Connection Settings");
operationsTab = new TwoLevelTab("Operations", "/images/icons/Operation_grey_16.png"); @@ -123,6 +120,7 @@ public class ResourceGroupDetailView extends VLayout implements BookmarkableView // CoreGUI.addBreadCrumb(getPlace()); }
+ public void onGroupSelected(ResourceGroupComposite groupComposite) {
this.groupComposite = groupComposite; @@ -183,7 +181,6 @@ public class ResourceGroupDetailView extends VLayout implements BookmarkableView new ResourceTypeRepository.TypeLoadedCallback() { public void onTypesLoaded(ResourceType type) { group.setResourceType(type); - ResourceGroupDetailView.this.groupType = type; GWTServiceLookup.getAuthorizationService().getImplicitGroupPermissions( group.getId(), new AsyncCallback<Set<Permission>>() { public void onFailure(Throwable caught) { @@ -242,34 +239,44 @@ public class ResourceGroupDetailView extends VLayout implements BookmarkableView
}
+ public void onTabSelected(TwoLevelTabSelectedEvent tabSelectedEvent) { + // Switch tabs directly, rather than letting the history framework do it, to avoid redrawing the outer views. + selectTab(tabSelectedEvent.getId(), tabSelectedEvent.getSubTabId()); String tabPath = "/" + tabSelectedEvent.getId() + "/" + tabSelectedEvent.getSubTabId(); - // System.out.println("TAB: " + currentView.getPath() + tabPath); - - if (groupComposite != null) { - String path = "ResourceGroup/" + groupComposite.getResourceGroup().getId() + tabPath; - History.newItem(path, false); - } + String path = "ResourceGroup/" + this.groupComposite.getResourceGroup().getId() + tabPath; + + // But still add an item to the history, specifying false to tell it not to fire an event. + History.newItem(path, false); }
- public void renderView(ViewPath viewPath) { - if (viewPath.isEnd()) { - // default - } else { - tabView = viewPath.getCurrent(); - subtabView = viewPath.getNext(); - - for (Tab t : topTabSet.getTabs()) { - TwoLevelTab tab = (TwoLevelTab) t;
- if (tab.getTitle().equals(tabView.getPath())) { - topTabSet.selectTab(tabView.getPath()); + public void renderView(ViewPath viewPath) { + // e.g. #ResourceGroup/10010/Inventory/Overview + String tabName = (!viewPath.isEnd()) ? viewPath.getCurrent().getPath() : null; // e.g. "Inventory" + String subTabName = (viewPath.viewsLeft() >= 1) ? viewPath.getNext().getPath() : null; // e.g. "Overview" + selectTab(tabName, subTabName); + }
- tab.getLayout().selectTab(subtabView.getPath());
- } + public void selectTab(String tabName, String subtabName) { + if (tabName == null) { + tabName = DEFAULT_TAB_NAME; + } + TwoLevelTab tab = (TwoLevelTab)this.topTabSet.getTabByTitle(tabName); + if (tab == null) { + CoreGUI.getErrorHandler().handleError("Invalid tab name: " + tabName); + // TODO: Should we fire a history event here to redirect to a valid bookmark? + tab = (TwoLevelTab)this.topTabSet.getTabByTitle(DEFAULT_TAB_NAME); + } + this.topTabSet.selectTab(tab); + if (subtabName != null) { + if (!tab.getLayout().selectTab(subtabName)) { + CoreGUI.getErrorHandler().handleError("Invalid subtab name: " + subtabName); + // TODO: Should we fire a history event here to redirect to a valid bookmark? + return; } + tab.getLayout().selectTab(subtabName); } - } } \ No newline at end of file diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupTopView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupTopView.java index f45b169..d16d403 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupTopView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupTopView.java @@ -123,15 +123,12 @@ public class ResourceGroupTopView extends HLayout implements BookmarkableView { Integer groupId = Integer.parseInt(viewPath.getCurrent().getPath());
if (currentGroup == null || currentGroup.getResourceGroup().getId() != groupId) { - + // The previous bookmark did not already point to this group. setSelectedGroup(groupId, viewPath); - - this.treeView.setSelectedGroup(groupId); - - viewPath.next(); - - this.detailView.renderView(viewPath); } + + viewPath.next(); + this.detailView.renderView(viewPath); }
}
commit 484719eea50ab62afc6938632b0861b87712458d Author: Heiko W. Rupp hwr@redhat.com Date: Tue Aug 10 22:50:17 2010 +0200
Put some more developer URLs in there.
diff --git a/pom.xml b/pom.xml index ed621bf..bc895da 100644 --- a/pom.xml +++ b/pom.xml @@ -1139,6 +1139,7 @@ <developer> <name>Greg Hinkle</name> <timezone>-5</timezone> + <url>http://www.jroller.com/ghinkle/</url> </developer> <developer> <name>Lukas Krejci</name> @@ -1159,6 +1160,7 @@ <developer> <name>John 'Mazz' Mazzitelli</name> <timezone>-5</timezone> + <url>http://management-platform.blogspot.com</url> </developer> <developer> <name>Simeon Pinder</name>
commit c9c6d348a082f89c8f4a18edc2afb3d5e7498cc4 Author: Ian Springer ian.springer@redhat.com Date: Tue Aug 10 12:56:19 2010 -0400
implement group Inventory>Overview subtab, with the exception of the ability to edit the group's name and description
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/composite/ResourceFacets.java b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/composite/ResourceFacets.java index cc3cb50..c05d5ef 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/composite/ResourceFacets.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/composite/ResourceFacets.java @@ -1,6 +1,6 @@ /* * RHQ Management Platform - * Copyright (C) 2005-2008 Red Hat, Inc. + * Copyright (C) 2005-2010 Red Hat, Inc. * All rights reserved. * * This program is free software; you can redistribute it and/or modify @@ -23,12 +23,14 @@ package org.rhq.core.domain.resource.composite;
import java.io.Serializable; -import java.util.EnumSet; +import java.util.HashSet; +import java.util.Set;
import org.rhq.core.domain.resource.ResourceTypeFacet;
/** - * The set of facets a Resource supports - used to determine which quicknav icons and tabs to display in the UI. + * The set of facets a Resource or compatible Resource group supports - used to determine which quick-nav icons and tabs + * to display in the GUI. * * @author Ian Springer */ @@ -39,18 +41,22 @@ public class ResourceFacets implements Serializable { public static ResourceFacets ALL = new ResourceFacets(-1, true, true, true, true, true, true, true, true); /* * immutable private member data makes this object safe to use in a concurrent environment, such as a - * concurrent-access cache of ResourceFacets objects + * concurrent-access cache of ResourceFacets objects (TODO (ips): make these final again?) */ - private final int resourceTypeId; - private final boolean measurement; - private final boolean event; - private final boolean pluginConfiguration; - private final boolean configuration; - private final boolean operation; - private final boolean content; - private final boolean callTime; - private final boolean support; - private EnumSet<ResourceTypeFacet> facets; + private int resourceTypeId; + private boolean measurement; + private boolean event; + private boolean pluginConfiguration; + private boolean configuration; + private boolean operation; + private boolean content; + private boolean callTime; + private boolean support; + private Set<ResourceTypeFacet> facets; + + // no-arg constructor required by GWT compiler + public ResourceFacets() { + }
public ResourceFacets(int resourceTypeId, boolean measurement, boolean event, boolean pluginConfiguration, boolean configuration, boolean operation, boolean content, boolean callTime, boolean support) { @@ -163,12 +169,12 @@ public class ResourceFacets implements Serializable { * * @return an enum representation of the facets */ - public EnumSet<ResourceTypeFacet> getFacets() { + public Set<ResourceTypeFacet> getFacets() { return facets; }
private void initEnum() { - this.facets = EnumSet.noneOf(ResourceTypeFacet.class); + this.facets = new HashSet<ResourceTypeFacet>(); if (measurement) this.facets.add(ResourceTypeFacet.MEASUREMENT); if (event) diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/group/composite/ResourceGroupComposite.java b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/group/composite/ResourceGroupComposite.java index 6a837c9..5199ba2 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/group/composite/ResourceGroupComposite.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/group/composite/ResourceGroupComposite.java @@ -53,6 +53,8 @@ public class ResourceGroupComposite implements Serializable {
private ResourceFacets resourceFacets;
+ // TODO: Expose authz permissions current user has for the group. + private class GroupDefinitionMember extends ResourceGroup { public void setGroupCategory(GroupCategory category) { super.setGroupCategory(category); @@ -101,8 +103,8 @@ public class ResourceGroupComposite implements Serializable { } else if (this.resourceGroup.getGroupCategory() == GroupCategory.MIXED) { this.category = GroupCategory.MIXED; } else { - throw new IllegalArgumentException("Unknown category " + this.resourceGroup.getGroupCategory() - + " for ResourceGroup " + this.resourceGroup.getName()); + throw new IllegalArgumentException("Unknown category [" + this.resourceGroup.getGroupCategory() + + "] for ResourceGroup [" + this.resourceGroup.getName() + "]"); }
this.resourceFacets = facets; @@ -218,6 +220,6 @@ public class ResourceGroupComposite implements Serializable { + this.resourceGroup.getName() // + ", implicit[up/down/avail=," + this.implicitUp + "/" + this.implicitDown + "/" + this.implicitAvail + "]" + ", explicit[up/down/avail=," + this.explicitUp + "/" + this.explicitDown + "/" + this.explicitAvail + "]" - + ", permission=" + "]"; + + ", facets=" + this.resourceFacets + "]"; } } \ No newline at end of file diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ResourceGroupGWTService.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ResourceGroupGWTService.java index c6f5800..5644554 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ResourceGroupGWTService.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ResourceGroupGWTService.java @@ -18,18 +18,16 @@ */ package org.rhq.enterprise.gui.coregui.client.gwt;
- import org.rhq.core.domain.criteria.ResourceGroupCriteria; import org.rhq.core.domain.criteria.ResourceGroupDefinitionCriteria; import org.rhq.core.domain.resource.group.GroupDefinition; import org.rhq.core.domain.resource.group.ResourceGroup; +import org.rhq.core.domain.resource.group.composite.ResourceGroupComposite; import org.rhq.core.domain.util.PageList;
import com.google.gwt.user.client.rpc.RemoteService; import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
- - /** * @author Greg Hinkle */ @@ -38,6 +36,8 @@ public interface ResourceGroupGWTService extends RemoteService {
PageList<ResourceGroup> findResourceGroupsByCriteria(ResourceGroupCriteria criteria);
+ PageList<ResourceGroupComposite> findResourceGroupCompositesByCriteria(ResourceGroupCriteria criteria); + PageList<GroupDefinition> findGroupDefinitionsByCriteria(ResourceGroupDefinitionCriteria criteria);
void ensureMembershipMatches(int groupId, int[] resourceIds); diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java index c3d6a43..7ce23a7 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java @@ -29,9 +29,11 @@ import com.smartgwt.client.widgets.tab.Tab;
import org.rhq.core.domain.authz.Permission; import org.rhq.core.domain.resource.ResourceType; +import org.rhq.core.domain.resource.ResourceTypeFacet; import org.rhq.core.domain.resource.composite.ResourcePermission; import org.rhq.core.domain.resource.group.GroupCategory; import org.rhq.core.domain.resource.group.ResourceGroup; +import org.rhq.core.domain.resource.group.composite.ResourceGroupComposite; import org.rhq.enterprise.gui.coregui.client.BookmarkableView; import org.rhq.enterprise.gui.coregui.client.CoreGUI; import org.rhq.enterprise.gui.coregui.client.ViewId; @@ -52,10 +54,9 @@ import org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTyp */ public class ResourceGroupDetailView extends VLayout implements BookmarkableView, TwoLevelTabSelectedHandler {
- private ResourceGroup group; - private ResourcePermission permissions; - + private ResourceGroupComposite groupComposite; private ResourceType groupType; + private ResourcePermission permissions;
private TwoLevelTab summaryTab; private TwoLevelTab monitoringTab; @@ -122,15 +123,13 @@ public class ResourceGroupDetailView extends VLayout implements BookmarkableView // CoreGUI.addBreadCrumb(getPlace()); }
- public void onGroupSelected(ResourceGroup group) { + public void onGroupSelected(ResourceGroupComposite groupComposite) {
- this.group = group; + this.groupComposite = groupComposite;
- titleBar.setGroup(group); + this.titleBar.setGroup(groupComposite.getResourceGroup());
- int selectedTab = topTabSet.getSelectedTabNumber(); - - // TODO all of the tabs + // TODO: Implement the rest of the tabs.
// FullHTMLPane timelinePane = new FullHTMLPane("/rhq/resource/summary/timeline-plain.xhtml?id=" + resource.getId()); // summaryTab.updateSubTab("Overview", new ResourceOverviewView(resource)); @@ -143,8 +142,8 @@ public class ResourceGroupDetailView extends VLayout implements BookmarkableView // monitoringTab.updateSubTab("Schedules", new FullHTMLPane("/rhq/resource/monitor/schedules-plain.xhtml?id=" + resource.getId())); // monitoringTab.updateSubTab("Call Time", new CallTimeView(resource)); // - inventoryTab.updateSubTab("Overview", new OverviewView()); - inventoryTab.updateSubTab("Members", ResourceSearchView.getMembersOf(this.group.getId())); + inventoryTab.updateSubTab("Overview", new OverviewView(this.groupComposite)); + inventoryTab.updateSubTab("Members", ResourceSearchView.getMembersOf(this.groupComposite.getResourceGroup().getId())); // inventoryTab.updateSubTab("Connection Settings", new GroupPluginConfigurationEditView(this.group.getId(), this.group.getResourceType().getId(), ConfigurationEditor.ConfigType.plugin)); // // operationsTab.updateSubTab("History", OperationHistoryView.getResourceHistoryView(resource)); @@ -170,10 +169,11 @@ public class ResourceGroupDetailView extends VLayout implements BookmarkableView }
private void updateTabStatus() { - // Go and get the type with all needed metadata - // and then get the permissions for this resource + final ResourceGroup group = this.groupComposite.getResourceGroup();
if (group.getGroupCategory() == GroupCategory.COMPATIBLE) { + + // Load the fully fetched ResourceType. ResourceType groupType = group.getResourceType(); ResourceTypeRepository.Cache.getInstance().getResourceTypes( groupType.getId(), @@ -182,13 +182,12 @@ public class ResourceGroupDetailView extends VLayout implements BookmarkableView ResourceTypeRepository.MetadataType.resourceConfigurationDefinition), new ResourceTypeRepository.TypeLoadedCallback() { public void onTypesLoaded(ResourceType type) { - + group.setResourceType(type); ResourceGroupDetailView.this.groupType = type; - GWTServiceLookup.getAuthorizationService().getImplicitGroupPermissions( - ResourceGroupDetailView.this.group.getId(), new AsyncCallback<Set<Permission>>() { + group.getId(), new AsyncCallback<Set<Permission>>() { public void onFailure(Throwable caught) { - CoreGUI.getErrorHandler().handleError("Failed to load group permissions", caught); + CoreGUI.getErrorHandler().handleError("Failed to load group permissions.", caught); }
public void onSuccess(Set<Permission> result) { @@ -203,36 +202,42 @@ public class ResourceGroupDetailView extends VLayout implements BookmarkableView
private void completeTabUpdate() {
- if (!permissions.isMeasure()) { - topTabSet.disableTab(monitoringTab); - } else { - topTabSet.enableTab(monitoringTab); - } + // Summary and Inventory tabs are always enabled. + topTabSet.enableTab(summaryTab); + topTabSet.enableTab(inventoryTab);
- if (groupType.getOperationDefinitions() == null || groupType.getOperationDefinitions().isEmpty() - || !permissions.isControl()) { - topTabSet.disableTab(operationsTab); + GroupCategory groupCategory = groupComposite.getResourceGroup().getGroupCategory(); + + // Monitoring and Alerts tabs are always enabled for compatible groups and always disabled for mixed groups. + if (groupCategory == GroupCategory.COMPATIBLE) { + topTabSet.enableTab(monitoringTab); + topTabSet.enableTab(alertsTab); } else { - topTabSet.enableTab(operationsTab); + topTabSet.disableTab(monitoringTab); + topTabSet.disableTab(alertsTab); }
- if (!permissions.isAlert()) { - topTabSet.disableTab(alertsTab); + // Operations tab is only enabled for compatible groups of a type that supports the Operations facet. + Set<ResourceTypeFacet> typeFacets = groupComposite.getResourceFacets().getFacets(); + if (typeFacets.contains(ResourceTypeFacet.OPERATION)) { + topTabSet.enableTab(operationsTab); } else { - topTabSet.enableTab(alertsTab); + topTabSet.disableTab(operationsTab); }
- if (groupType.getResourceConfigurationDefinition() == null || !permissions.isConfigureRead()) { - topTabSet.disableTab(configurationTab); - } else { + // Configuration tab is only enabled for compatible groups of a type that supports the Configuration facet + // and when the current user has the CONFIGURE_READ permission. + if (!typeFacets.contains(ResourceTypeFacet.CONFIGURATION) && permissions.isConfigureRead()) { topTabSet.enableTab(configurationTab); + } else { + topTabSet.disableTab(configurationTab); }
- if (groupType.getEventDefinitions() == null || groupType.getEventDefinitions().isEmpty() - || !permissions.isMeasure()) { + // Events tab is only enabled for compatible groups of a type that supports the Events facet. + if (typeFacets.contains(ResourceTypeFacet.EVENT)) { topTabSet.enableTab(eventsTab); } else { - topTabSet.enableTab(eventsTab); + topTabSet.disableTab(eventsTab); }
} @@ -241,22 +246,16 @@ public class ResourceGroupDetailView extends VLayout implements BookmarkableView String tabPath = "/" + tabSelectedEvent.getId() + "/" + tabSelectedEvent.getSubTabId(); // System.out.println("TAB: " + currentView.getPath() + tabPath);
- if (group != null) { - String path = "ResourceGroup/" + group.getId() + tabPath; + if (groupComposite != null) { + String path = "ResourceGroup/" + groupComposite.getResourceGroup().getId() + tabPath; History.newItem(path, false); } }
public void renderView(ViewPath viewPath) { - - Integer groupId = Integer.parseInt(viewPath.getCurrent().getPath()); - - if (viewPath.isEnd()) { // default - } else { - tabView = viewPath.getCurrent(); subtabView = viewPath.getNext();
@@ -269,9 +268,7 @@ public class ResourceGroupDetailView extends VLayout implements BookmarkableView tab.getLayout().selectTab(subtabView.getPath());
} - } - }
} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupTopView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupTopView.java index 8faaae8..f45b169 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupTopView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupTopView.java @@ -27,7 +27,7 @@ import com.smartgwt.client.widgets.Canvas; import com.smartgwt.client.widgets.layout.HLayout;
import org.rhq.core.domain.criteria.ResourceGroupCriteria; -import org.rhq.core.domain.resource.group.ResourceGroup; +import org.rhq.core.domain.resource.group.composite.ResourceGroupComposite; import org.rhq.core.domain.util.PageList; import org.rhq.enterprise.gui.coregui.client.BookmarkableView; import org.rhq.enterprise.gui.coregui.client.CoreGUI; @@ -45,11 +45,10 @@ public class ResourceGroupTopView extends HLayout implements BookmarkableView {
private Canvas contentCanvas;
- private ResourceGroup currentGroup; - //private Resource resourcePlatform; + private ResourceGroupComposite currentGroup;
private ResourceGroupTreeView treeView; - private ResourceGroupDetailView detailView = new ResourceGroupDetailView(); + private ResourceGroupDetailView detailView;
private ResourceGroupGWTServiceAsync groupService = GWTServiceLookup.getResourceGroupService();
@@ -58,6 +57,7 @@ public class ResourceGroupTopView extends HLayout implements BookmarkableView {
}
+ @Override protected void onInit() { super.onInit(); @@ -65,58 +65,45 @@ public class ResourceGroupTopView extends HLayout implements BookmarkableView { setWidth100(); setHeight100();
- treeView = new ResourceGroupTreeView(); addMember(treeView);
contentCanvas = new Canvas(); addMember(contentCanvas);
- - // created above detailView = new ResourceGroupDetailView();
// treeView.addResourceSelectListener(detailView);
- setContent(detailView); - }
- public void setSelectedGroup(final int groupId, final ViewPath view) { - ResourceGroup group = this.treeView.getGroup(groupId); - if (group != null) { - setSelectedGroup(group, view); - } else { - ResourceGroupCriteria criteria = new ResourceGroupCriteria(); - criteria.addFilterId(groupId); - criteria.fetchTags(true); - groupService.findResourceGroupsByCriteria(criteria, new AsyncCallback<PageList<ResourceGroup>>() { - public void onFailure(Throwable caught) { - CoreGUI.getMessageCenter().notify(new Message("Group with id [" + groupId + - "] does not exist or is not accessible.", Message.Severity.Warning)); - - CoreGUI.goTo(InventoryView.VIEW_PATH); - }
- public void onSuccess(PageList<ResourceGroup> result) { - if (result.isEmpty()) { - //noinspection ThrowableInstanceNeverThrown - onFailure(new Exception("Group with id [" + groupId + "] does not exist.")); - } else { - ResourceGroup group = result.get(0); - setSelectedGroup(group, view); - } + public void setSelectedGroup(final int groupId, final ViewPath view) { + ResourceGroupCriteria criteria = new ResourceGroupCriteria(); + criteria.addFilterId(groupId); + //criteria.fetchTags(true); + groupService.findResourceGroupCompositesByCriteria(criteria, new AsyncCallback<PageList<ResourceGroupComposite>>() { + public void onFailure(Throwable caught) { + CoreGUI.getMessageCenter().notify(new Message("Group with id [" + groupId + + "] does not exist or is not accessible.", Message.Severity.Warning)); + caught.printStackTrace(); + CoreGUI.goTo(InventoryView.VIEW_PATH); + } + + public void onSuccess(PageList<ResourceGroupComposite> result) { + if (result.isEmpty()) { + //noinspection ThrowableInstanceNeverThrown + onFailure(new Exception("Group with id [" + groupId + "] does not exist.")); + } else { + currentGroup = result.get(0); + treeView.setSelectedGroup(currentGroup.getResourceGroup().getId()); + detailView.onGroupSelected(currentGroup); } - }); - } + } + }); }
- private void setSelectedGroup(ResourceGroup group, ViewPath viewPath) { - this.currentGroup = group; - this.treeView.setSelectedGroup(group.getId()); - this.detailView.onGroupSelected(group); - }
public void setContent(Canvas newContent) { if (contentCanvas.getChildren().length > 0) @@ -135,7 +122,7 @@ public class ResourceGroupTopView extends HLayout implements BookmarkableView {
Integer groupId = Integer.parseInt(viewPath.getCurrent().getPath());
- if (currentGroup == null || currentGroup.getId() != groupId) { + if (currentGroup == null || currentGroup.getResourceGroup().getId() != groupId) {
setSelectedGroup(groupId, viewPath);
@@ -144,7 +131,6 @@ public class ResourceGroupTopView extends HLayout implements BookmarkableView { viewPath.next();
this.detailView.renderView(viewPath); - } }
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupTreeView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupTreeView.java index bd79780..1730ac3 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupTreeView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupTreeView.java @@ -43,8 +43,6 @@ import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup; */ public class ResourceGroupTreeView extends VLayout {
- private int groupId; - private ResourceGroup group; private TreeGrid treeGrid;
public ResourceGroupTreeView() { @@ -52,24 +50,19 @@ public class ResourceGroupTreeView extends VLayout { setHeight100(); }
- @Override protected void onInit() { super.onInit();
- this.treeGrid = new TreeGrid(); this.treeGrid.setWidth100(); this.treeGrid.setHeight100(); treeGrid.setShowRoot(true);
addMember(this.treeGrid); - - }
public void setSelectedGroup(int groupId) { - this.groupId = groupId; GWTServiceLookup.getClusterService().getClusterTree(groupId, new AsyncCallback<ClusterFlyweight>() { public void onFailure(Throwable caught) { @@ -80,33 +73,9 @@ public class ResourceGroupTreeView extends VLayout { loadTree(result); } }); - - // TODO: Get the group from the ResourceGroupTreeView in case it was already loaded. - ResourceGroupCriteria criteria = new ResourceGroupCriteria(); - criteria.addFilterId(groupId); - criteria.fetchTags(true); - GWTServiceLookup.getResourceGroupService().findResourceGroupsByCriteria(criteria, - new AsyncCallback<PageList<ResourceGroup>>() { - public void onFailure(Throwable caught) { - CoreGUI.getErrorHandler().handleError("Failed to load group", caught); - } - - public void onSuccess(PageList<ResourceGroup> result) { - group = result.get(0); - } - }); - }
- ResourceGroup getGroup(int groupId) { - // TODO: Get the group from the ResourceGroupTreeView in case it was already loaded. - return this.group; - } - - private void loadTree(ClusterFlyweight root) { - - TreeNode rootNode = new TreeNode(root.getName());
loadTree(rootNode, root); @@ -116,7 +85,6 @@ public class ResourceGroupTreeView extends VLayout {
treeGrid.setData(tree); markForRedraw(); - }
public void loadTree(TreeNode parent, ClusterFlyweight parentNode) { @@ -125,14 +93,8 @@ public class ResourceGroupTreeView extends VLayout { ArrayList<TreeNode> childNodes = new ArrayList<TreeNode>();
HashMap<Integer,TreeNode> typeNodes = new HashMap<Integer, TreeNode>(); -
for (ClusterFlyweight child : parentNode.getChildren()) { - - - - - TreeNode node = new TreeNode(child.getName()); childNodes.add(node);
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/inventory/OverviewView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/inventory/OverviewView.java index c5aeb38..57ecbcd 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/inventory/OverviewView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/inventory/OverviewView.java @@ -1,12 +1,147 @@ +/* + * RHQ Management Platform + * Copyright (C) 2010 Red Hat, Inc. + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ package org.rhq.enterprise.gui.coregui.client.inventory.groups.detail.inventory;
+import com.smartgwt.client.types.Alignment; +import com.smartgwt.client.widgets.HTMLFlow; +import com.smartgwt.client.widgets.form.DynamicForm; +import com.smartgwt.client.widgets.form.fields.FormItem; +import com.smartgwt.client.widgets.form.fields.SpacerItem; +import com.smartgwt.client.widgets.form.fields.StaticTextItem; +import com.smartgwt.client.widgets.layout.HLayout; import com.smartgwt.client.widgets.layout.VLayout; +import org.rhq.core.domain.resource.ResourceType; +import org.rhq.core.domain.resource.group.GroupDefinition; +import org.rhq.core.domain.resource.group.ResourceGroup; +import org.rhq.core.domain.resource.group.composite.ResourceGroupComposite; + +import java.util.ArrayList; +import java.util.Date;
/** + * The group Inventory>Overview tab. + * * @author Ian Springer */ public class OverviewView extends VLayout { + private ResourceGroupComposite groupComposite; + + public OverviewView(ResourceGroupComposite groupComposite) { + super(); + this.groupComposite = groupComposite; + } + + @Override + protected void onInit() { + super.onInit(); + + ResourceGroup group = this.groupComposite.getResourceGroup(); + + HLayout spacer = new HLayout(); + spacer.setHeight(15); + addMember(spacer); + + DynamicForm generalPropsForm = new DynamicForm(); + generalPropsForm.setNumCols(4); + generalPropsForm.setColWidths("25%", "25%", "25%", "25%"); + generalPropsForm.setWrapItemTitles(false); + setWidth("90%"); + + ArrayList<FormItem> formItems = new ArrayList<FormItem>(); + ArrayList<String> itemIds = new ArrayList<String>(); + + //HeaderItem headerItem = new HeaderItem("header", "General Properties"); + //headerItem.setValue("General Properties"); + //formItems.add(headerItem); + + StaticTextItem nameItem = new StaticTextItem("nameItem", "Name"); + nameItem.setValue(group.getName()); + formItems.add(nameItem); + itemIds.add(nameItem.getName()); + + StaticTextItem typeItem = new StaticTextItem("typeItem", "Member Type"); + ResourceType type = group.getResourceType(); + if (type != null) { + typeItem.setTooltip("Plugin: " + type.getPlugin() + "\n<br>" + "Type: " + type.getName()); + typeItem.setValue(type.getName() + " (" + type.getPlugin() + ")"); + } else { + typeItem.setValue("<i>Mixed</i>"); + } + formItems.add(typeItem); + itemIds.add(typeItem.getName()); + + StaticTextItem countItem = new StaticTextItem("countItem", "Member Count"); + long memberCount = this.groupComposite.getImplicitUp() + this.groupComposite.getImplicitDown(); + countItem.setValue(memberCount); + formItems.add(countItem); + itemIds.add(countItem.getName()); + + StaticTextItem descriptionItem = new StaticTextItem("descriptionItem", "Description"); + String description = group.getDescription(); + descriptionItem.setValue((description != null) ? description : "<i>none</i>"); + formItems.add(descriptionItem); + itemIds.add(descriptionItem.getName()); + + StaticTextItem dynamicItem = new StaticTextItem("dynamicItem", "Dynamic?"); + dynamicItem.setValue((group.getGroupDefinition() != null) ? "yes" : "no"); + formItems.add(dynamicItem); + itemIds.add(dynamicItem.getName()); + + StaticTextItem recursiveItem = new StaticTextItem("recursiveItem", "Recursive?"); + recursiveItem.setValue((group.isRecursive()) ? "yes" : "no"); + formItems.add(recursiveItem); + itemIds.add(recursiveItem.getName()); + + StaticTextItem createdItem = new StaticTextItem("createdItem", "Created"); + createdItem.setValue(new Date(group.getCtime())); + formItems.add(createdItem); + itemIds.add(createdItem.getName()); + + StaticTextItem lastModifiedItem = new StaticTextItem("lastModifiedItem", "Last Modified"); + lastModifiedItem.setValue(new Date(group.getMtime())); + formItems.add(lastModifiedItem); + itemIds.add(lastModifiedItem.getName()); + + StaticTextItem lastModifiedByItem = new StaticTextItem("lastModifiedByItem", "Last Modified By"); + lastModifiedByItem.setValue(group.getModifiedBy()); + formItems.add(lastModifiedByItem); + itemIds.add(lastModifiedByItem.getName()); + + StaticTextItem groupDefinitionItem = new StaticTextItem("groupDefinitionItem", "Group Definition"); + GroupDefinition groupDefinition = group.getGroupDefinition(); + // TODO (ips): Make this a link to the group def. + groupDefinitionItem.setValue((groupDefinition != null) ? groupDefinition.getName() : "<i>none</i>"); + formItems.add(groupDefinitionItem); + itemIds.add(groupDefinitionItem.getName()); + + generalPropsForm.setItems(formItems.toArray(new FormItem[formItems.size()])); + addMember(generalPropsForm);
- // TODO: Group general properties go here. - + if (groupDefinition != null) { + spacer = new HLayout(); + spacer.setHeight(10); + addMember(spacer); + + HTMLFlow note = new HTMLFlow(); + note.setContents("<b>*</b> Dynamic group names and descriptions are managed, and therefore are not editable."); + note.setAlign(Alignment.CENTER); + addMember(note); + } + } } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/overview/ResourceSummaryView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/overview/ResourceSummaryView.java index 981fb60..6f1228c 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/overview/ResourceSummaryView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/overview/ResourceSummaryView.java @@ -144,7 +144,6 @@ public class ResourceSummaryView extends DynamicForm implements ResourceSelectLi formItems.add(descriptionItem); itemIds.add(descriptionItem.getName());
- StaticTextItem versionItem = new StaticTextItem("versionItem", "Version"); formItems.add(versionItem); itemIds.add(versionItem.getName()); diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ResourceGroupGWTServiceImpl.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ResourceGroupGWTServiceImpl.java index 48e9961..67326c1 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ResourceGroupGWTServiceImpl.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ResourceGroupGWTServiceImpl.java @@ -22,6 +22,7 @@ import org.rhq.core.domain.criteria.ResourceGroupCriteria; import org.rhq.core.domain.criteria.ResourceGroupDefinitionCriteria; import org.rhq.core.domain.resource.group.GroupDefinition; import org.rhq.core.domain.resource.group.ResourceGroup; +import org.rhq.core.domain.resource.group.composite.ResourceGroupComposite; import org.rhq.core.domain.util.PageList; import org.rhq.enterprise.gui.coregui.client.gwt.ResourceGroupGWTService; import org.rhq.enterprise.gui.coregui.server.util.SerialUtility; @@ -39,13 +40,15 @@ public class ResourceGroupGWTServiceImpl extends AbstractGWTServiceImpl implemen private ResourceGroupManagerLocal groupManager = LookupUtil.getResourceGroupManager(); private GroupDefinitionManagerLocal definitionManager = LookupUtil.getGroupDefinitionManager();
- public PageList<ResourceGroup> findResourceGroupsByCriteria(ResourceGroupCriteria criteria) { return SerialUtility.prepare(groupManager.findResourceGroupsByCriteria(getSessionSubject(), criteria), "ResourceGroupService.findResourceGroupsByCriteria"); }
- // TODO GH: build and expose findResourceGroupCompositesByCriteria + public PageList<ResourceGroupComposite> findResourceGroupCompositesByCriteria(ResourceGroupCriteria criteria) { + return SerialUtility.prepare(groupManager.findResourceGroupCompositesByCriteria(getSessionSubject(), criteria), + "ResourceGroupService.findResourceGroupCompositesByCriteria"); + }
public PageList<GroupDefinition> findGroupDefinitionsByCriteria(ResourceGroupDefinitionCriteria criteria) { return SerialUtility.prepare(definitionManager.findGroupDefinitionsByCriteria(getSessionSubject(), criteria),
commit 14cb5621315e2cfecdad8bb54c8d995b95340820 Author: Jay Shaughnessy jshaughn@redhat.com Date: Tue Aug 10 12:26:56 2010 -0400
Group List View and Create Wizard Work - converted group list view to extend Table instead of VLayout with single table - added group delete to list view - changed button and confirm text for consistency (now like bundle buttons) - removed checkboxes from list view - added some core gui refresh to list view - simplified wizard invoke style - left justify create step and increase text box sizes - improve Next/Previous handling - respect selected compatible type on member selection page - fetch only the required resources for compatible group member select - fix issues with member filtering
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/ResourceGroupListView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/ResourceGroupListView.java index f29a064..8171d96 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/ResourceGroupListView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/ResourceGroupListView.java @@ -18,51 +18,52 @@ */ package org.rhq.enterprise.gui.coregui.client.inventory.groups;
+import com.google.gwt.user.client.rpc.AsyncCallback; import com.smartgwt.client.data.Criteria; import com.smartgwt.client.types.Alignment; import com.smartgwt.client.types.ListGridFieldType; -import com.smartgwt.client.types.SelectionAppearance; import com.smartgwt.client.types.SelectionStyle; import com.smartgwt.client.widgets.grid.CellFormatter; import com.smartgwt.client.widgets.grid.ListGridField; import com.smartgwt.client.widgets.grid.ListGridRecord; -import com.smartgwt.client.widgets.layout.VLayout;
+import org.rhq.core.domain.resource.group.ResourceGroup; +import org.rhq.enterprise.gui.coregui.client.CoreGUI; import org.rhq.enterprise.gui.coregui.client.components.table.Table; import org.rhq.enterprise.gui.coregui.client.components.table.TableAction; -import org.rhq.enterprise.gui.coregui.client.components.wizard.WizardView; +import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup; +import org.rhq.enterprise.gui.coregui.client.gwt.ResourceGroupGWTServiceAsync; import org.rhq.enterprise.gui.coregui.client.inventory.groups.wizard.GroupCreateWizard; -import org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceSearchView; +import org.rhq.enterprise.gui.coregui.client.util.message.Message; +import org.rhq.enterprise.gui.coregui.client.util.message.Message.Severity;
/** * @author Greg Hinkle */ -public class ResourceGroupListView extends VLayout { - - private Table table; +public class ResourceGroupListView extends Table {
public ResourceGroupListView() { - this(null); - + super("Resource Groups"); + setWidth100(); + setHeight100(); }
- /** - * Resource Group list filtered by a given criteria - * @param criteria - */ public ResourceGroupListView(Criteria criteria) { + super("Resource Groups", criteria); + }
- setWidth100(); - setHeight100(); + @Override + protected void onInit() { + super.onInit();
- final ResourceGroupsDataSource datasource = ResourceGroupsDataSource.getInstance(); + // setHeaderIcon("?_24.png");
- table = new Table("Resource Groups", criteria); - table.setDataSource(datasource); + final ResourceGroupsDataSource datasource = ResourceGroupsDataSource.getInstance(); + setDataSource(datasource);
- table.getListGrid().setSelectionType(SelectionStyle.SIMPLE); - table.getListGrid().setSelectionAppearance(SelectionAppearance.CHECKBOX); - table.getListGrid().setResizeFieldsInRealTime(true); + getListGrid().setSelectionType(SelectionStyle.SIMPLE); + //table.getListGrid().setSelectionAppearance(SelectionAppearance.CHECKBOX); + getListGrid().setResizeFieldsInRealTime(true);
ListGridField idField = new ListGridField("id", "Id", 55); idField.setType(ListGridFieldType.INTEGER); @@ -81,26 +82,38 @@ public class ResourceGroupListView extends VLayout { ListGridField availabilityField = new ListGridField("currentAvailability", "Availability", 55);
availabilityField.setAlign(Alignment.CENTER); - table.getListGrid().setFields(idField, nameField, descriptionField, typeNameField, pluginNameField, - categoryField, availabilityField); - - table.addTableAction("Delete Groups", Table.SelectionEnablement.ANY, - "Are you sure you want to delete # groups?", new TableAction() { - public void executeAction(ListGridRecord[] selection) { - // TODO: Implement this method. + getListGrid().setFields(idField, nameField, descriptionField, typeNameField, pluginNameField, categoryField, + availabilityField); + + addTableAction("Delete", Table.SelectionEnablement.ANY, "Delete the selected resource groups?", + new TableAction() { + public void executeAction(ListGridRecord[] selections) { + ResourceGroupsDataSource ds = (ResourceGroupsDataSource) getDataSource(); + for (ListGridRecord selection : selections) { + ResourceGroupGWTServiceAsync resourceGroupManager = GWTServiceLookup.getResourceGroupService(); + final ResourceGroup object = ds.copyValues(selection); + resourceGroupManager.deleteResourceGroup(object.getId(), new AsyncCallback<Void>() { + public void onFailure(Throwable caught) { + CoreGUI.getErrorHandler().handleError( + "Failed to delete resource group [" + object.getName() + "]", caught); + } + + public void onSuccess(Void result) { + CoreGUI.getMessageCenter().notify( + new Message("Deleted resource group [" + object.getName() + "]", Severity.Info)); + + CoreGUI.refresh(); + } + }); + } } });
- table.addTableAction("New Group", new TableAction() { + addTableAction("New", new TableAction() { public void executeAction(ListGridRecord[] selection) { - WizardView view = new WizardView(new GroupCreateWizard()); - view.displayDialog(); + new GroupCreateWizard().startBundleWizard(); } }); - - - addMember(table); - }
} \ No newline at end of file diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/ResourceGroupsDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/ResourceGroupsDataSource.java index debe24d..aaaaeaa 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/ResourceGroupsDataSource.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/ResourceGroupsDataSource.java @@ -28,6 +28,7 @@ import com.smartgwt.client.rpc.RPCResponse; import com.smartgwt.client.widgets.grid.ListGridRecord;
import org.rhq.core.domain.criteria.ResourceGroupCriteria; +import org.rhq.core.domain.resource.ResourceType; import org.rhq.core.domain.resource.group.GroupCategory; import org.rhq.core.domain.resource.group.ResourceGroup; import org.rhq.core.domain.util.PageList; @@ -115,7 +116,24 @@ public class ResourceGroupsDataSource extends RPCDataSource<ResourceGroup> {
@Override public ResourceGroup copyValues(ListGridRecord from) { - return null; // TODO: Implement this method. + Integer idAttrib = from.getAttributeAsInt("id"); + String nameAttrib = from.getAttribute("name"); + String descriptionAttrib = from.getAttribute("description"); + String typeNameAttrib = from.getAttribute("typeName"); + String pluginNameAttrib = from.getAttribute("pluginName"); + ResourceType rt = null; + + ResourceGroup rg = new ResourceGroup(nameAttrib); + rg.setId(idAttrib); + rg.setDescription(descriptionAttrib); + if (null != typeNameAttrib) { + rt = new ResourceType(); + rt.setName(typeNameAttrib); + rt.setPlugin(pluginNameAttrib); + rg.setResourceType(rt); + } + + return rg; }
@Override diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/wizard/GroupCreateStep.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/wizard/GroupCreateStep.java index 96b6017..032cc75 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/wizard/GroupCreateStep.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/wizard/GroupCreateStep.java @@ -52,19 +52,22 @@ public class GroupCreateStep extends AbstractWizardStep {
form = new DynamicForm(); form.setValuesManager(new ValuesManager()); - form.setNumCols(4); + form.setWidth100(); + form.setNumCols(2);
TextItem name = new TextItem("name", "Name"); name.setRequired(true); - - TextItem location = new TextItem("location", "Location"); + name.setWidth(300);
TextAreaItem description = new AutoFitTextAreaItem("description", "Description"); + description.setWidth(300); + + TextItem location = new TextItem("location", "Location"); + location.setWidth(300);
CheckboxItem recursive = new CheckboxItem("recursive", "Recursive");
LinkedHashMap<String, Canvas> options = new LinkedHashMap<String, Canvas>(); - options.put("Mixed", null);
IPickTreeItem typeSelectItem = new IPickTreeItem("type", "Type"); @@ -81,16 +84,25 @@ public class GroupCreateStep extends AbstractWizardStep { options.put("Compatible", form2);
RadioGroupWithComponentsItem kind = new RadioGroupWithComponentsItem("kind", "Group Type", options, form); - kind.setValue("Mixed Resources"); + kind.setValue("Mixed");
- form.setFields(name, location, description, recursive, kind); + form.setFields(name, description, location, recursive, kind);
} return form; }
public boolean nextPage() { - return form.validate(); + boolean valid = form.validate(); + if (valid) { + RadioGroupWithComponentsItem kind = (RadioGroupWithComponentsItem) form.getField("kind"); + if ("Compatible".equals(kind.getSelected())) { + DynamicForm form2 = (DynamicForm) kind.getSelectedComponent(); + valid = (null != form2.getValue("type")); + } + } + + return valid; }
public String getName() { @@ -103,11 +115,16 @@ public class GroupCreateStep extends AbstractWizardStep { group.setLocation(form.getValueAsString("location")); group.setRecursive(form.getValue("recursive") != null ? true : false);
- if (form.getValue("type") != null) { - ResourceType type = new ResourceType(); - type.setId(Integer.parseInt(form.getValueAsString("type"))); - group.setResourceType(type); + RadioGroupWithComponentsItem kind = (RadioGroupWithComponentsItem) form.getField("kind"); + if ("Compatible".equals(kind.getSelected())) { + DynamicForm form2 = (DynamicForm) kind.getSelectedComponent(); + if (null != form2.getValue("type")) { + ResourceType rt = new ResourceType(); + rt.setId(Integer.parseInt(form2.getValueAsString("type"))); + group.setResourceType(rt); + } } + return group; } } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/wizard/GroupCreateWizard.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/wizard/GroupCreateWizard.java index 4c8b074..55d1588 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/wizard/GroupCreateWizard.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/wizard/GroupCreateWizard.java @@ -28,6 +28,7 @@ import java.util.List; import com.google.gwt.user.client.rpc.AsyncCallback; import com.smartgwt.client.widgets.IButton;
+import org.rhq.core.domain.resource.ResourceType; import org.rhq.core.domain.resource.group.ResourceGroup; import org.rhq.enterprise.gui.coregui.client.CoreGUI; import org.rhq.enterprise.gui.coregui.client.components.wizard.AbstractWizard; @@ -68,6 +69,18 @@ public class GroupCreateWizard extends AbstractWizard { return null; // TODO: Implement this method. }
+ /** + * @return only the rt id is set + */ + public ResourceType getCompatibleGroupResourceType() { + ResourceGroup rg = createStep.getGroup(); + ResourceType rt = null; + if (null != rg) { + rt = rg.getResourceType(); + } + return rt; + } + public void cancel() { // TODO: Implement this method. } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/wizard/GroupMembersStep.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/wizard/GroupMembersStep.java index 5f13657..cc79abc 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/wizard/GroupMembersStep.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/wizard/GroupMembersStep.java @@ -26,6 +26,7 @@ import java.util.HashSet;
import com.smartgwt.client.widgets.Canvas;
+import org.rhq.core.domain.resource.ResourceType; import org.rhq.enterprise.gui.coregui.client.components.wizard.AbstractWizardStep; import org.rhq.enterprise.gui.coregui.client.inventory.resource.selection.ResourceSelector;
@@ -34,16 +35,20 @@ import org.rhq.enterprise.gui.coregui.client.inventory.resource.selection.Resour */ public class GroupMembersStep extends AbstractWizardStep {
- private GroupCreateWizard wizard; - private ResourceSelector selector; + private GroupCreateWizard wizard = null; + private ResourceSelector selector = null; + private ResourceType requireType = null;
public GroupMembersStep(GroupCreateWizard wizard) { this.wizard = wizard; }
public Canvas getCanvas() { - if (selector == null) { + ResourceType rt = wizard.getCompatibleGroupResourceType(); + if ((selector == null) || (rt != requireType)) { selector = new ResourceSelector(); + requireType = rt; + selector.setRequireType(rt); } return selector; } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceDatasource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceDatasource.java index af8931b..c0731b8 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceDatasource.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceDatasource.java @@ -98,6 +98,24 @@ public class ResourceDatasource extends RPCDataSource<Resource> {
public void executeFetch(final DSRequest request, final DSResponse response) {
+ ResourceCriteria criteria = getFetchCriteria(request); + + resourceService.findResourcesByCriteria(criteria, new AsyncCallback<PageList<Resource>>() { + public void onFailure(Throwable caught) { + CoreGUI.getErrorHandler().handleError("Failed to fetch resource data", caught); + response.setStatus(RPCResponse.STATUS_FAILURE); + processResponse(request.getRequestId(), response); + } + + public void onSuccess(PageList<Resource> result) { + + dataRetrieved(result, response, request); + } + }); + } + + protected ResourceCriteria getFetchCriteria(final DSRequest request) { + ResourceCriteria criteria = new ResourceCriteria(); criteria.setPageControl(getPageControl(request));
@@ -164,18 +182,7 @@ public class ResourceDatasource extends RPCDataSource<Resource> { criteria.addFilterTagName((String) request.getCriteria().getValues().get("tagName")); }
- resourceService.findResourcesByCriteria(criteria, new AsyncCallback<PageList<Resource>>() { - public void onFailure(Throwable caught) { - CoreGUI.getErrorHandler().handleError("Failed to fetch resource data", caught); - response.setStatus(RPCResponse.STATUS_FAILURE); - processResponse(request.getRequestId(), response); - } - - public void onSuccess(PageList<Resource> result) { - - dataRetrieved(result, response, request); - } - }); + return criteria; }
@Override @@ -221,7 +228,7 @@ public class ResourceDatasource extends RPCDataSource<Resource> { record.setAttribute("id", from.getId()); record.setAttribute(NAME.propertyName(), from.getName()); record.setAttribute(DESCRIPTION.propertyName(), from.getDescription()); - record.setAttribute(TYPE.propertyName(), from.getResourceType().getName()); + record.setAttribute(TYPE.propertyName(), from.getResourceType().getId()); record.setAttribute(PLUGIN.propertyName(), from.getResourceType().getPlugin()); record.setAttribute(CATEGORY.propertyName(), from.getResourceType().getCategory().getDisplayName()); record.setAttribute("icon", from.getResourceType().getCategory().getDisplayName() + "_" diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/selection/ResourceSelector.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/selection/ResourceSelector.java index 1274e14..0d25f38 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/selection/ResourceSelector.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/selection/ResourceSelector.java @@ -18,12 +18,18 @@ */ package org.rhq.enterprise.gui.coregui.client.inventory.resource.selection;
+import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.CATEGORY; +import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.NAME; +import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.PLUGIN; +import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.TYPE; + import java.util.ArrayList; import java.util.Collection;
import com.smartgwt.client.data.AdvancedCriteria; import com.smartgwt.client.data.Criteria; import com.smartgwt.client.data.Criterion; +import com.smartgwt.client.data.DSRequest; import com.smartgwt.client.types.OperatorId; import com.smartgwt.client.widgets.form.DynamicForm; import com.smartgwt.client.widgets.form.fields.IPickTreeItem; @@ -31,7 +37,9 @@ import com.smartgwt.client.widgets.form.fields.SelectItem; import com.smartgwt.client.widgets.form.fields.TextItem; import com.smartgwt.client.widgets.grid.ListGridRecord;
+import org.rhq.core.domain.criteria.ResourceCriteria; import org.rhq.core.domain.resource.Resource; +import org.rhq.core.domain.resource.ResourceType; import org.rhq.enterprise.gui.coregui.client.components.selector.AbstractSelector; import org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDatasource; import org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTypePluginTreeDataSource; @@ -42,18 +50,18 @@ import org.rhq.enterprise.gui.coregui.client.util.RPCDataSource; */ public class ResourceSelector extends AbstractSelector<Resource> {
- private Integer requireTypeId; + private ResourceType requireType;
public ResourceSelector() { super(); }
- public Integer getRequireTypeId() { - return requireTypeId; + public ResourceType getRequireType() { + return requireType; }
- public void setRequireTypeId(Integer requireTypeId) { - this.requireTypeId = requireTypeId; + public void setRequireType(ResourceType requireType) { + this.requireType = requireType; markForRedraw(); }
@@ -70,10 +78,15 @@ public class ResourceSelector extends AbstractSelector<Resource> { typeSelectItem.setEmptyMenuMessage("Loading..."); typeSelectItem.setShowIcons(true);
- if (requireTypeId != null) { - typeSelectItem.setValue(requireTypeId); - typeSelectItem.setDisabled(true); - availableFilterForm.setItems(search, typeSelectItem); + if (requireType != null) { + // TODO: Currently ignore the typeSelectItem widget because we already know the type. + // Alternatively, we could display it disabled but we'd want the type name to be displayed as the + // value. To get this to display the type name I think we need to pre-fetch the type tree here. We could + // potentially optimize typeSelectItem.setValue(requireType.getId()) to build a tree that includes only + // this single type. + //typeSelectItem.setValue(requireType.getId()); + //typeSelectItem.setDisabled(true); + availableFilterForm.setItems(search); } else { SelectItem categorySelect = new SelectItem("category", "Category"); categorySelect.setValueMap("Platform", "Server", "Service"); @@ -91,23 +104,23 @@ public class ResourceSelector extends AbstractSelector<Resource> {
protected Criteria getLatestCriteria(DynamicForm availableFilterForm) { String search = (String) availableFilterForm.getValue("search"); - String type = (String) availableFilterForm.getValue("type"); + String type = availableFilterForm.getValueAsString("type"); String category = (String) availableFilterForm.getValue("category"); ArrayList<Criterion> criteria = new ArrayList<Criterion>(3); if (null != search) { - criteria.add(new Criterion("name", OperatorId.CONTAINS, search)); + criteria.add(new Criterion(NAME.propertyName(), OperatorId.CONTAINS, search)); } if (null != type) { // If type is a number its a typeId, otherwise a plugin name try { Integer.parseInt(type); - criteria.add(new Criterion("type", OperatorId.EQUALS, type)); + criteria.add(new Criterion(TYPE.propertyName(), OperatorId.EQUALS, type)); } catch (NumberFormatException nfe) { - criteria.add(new Criterion("plugin", OperatorId.EQUALS, type)); + criteria.add(new Criterion(PLUGIN.propertyName(), OperatorId.EQUALS, type)); } } if (null != category) { - criteria.add(new Criterion("category", OperatorId.EQUALS, category)); + criteria.add(new Criterion(CATEGORY.propertyName(), OperatorId.EQUALS, category)); } AdvancedCriteria latestCriteria = new AdvancedCriteria(OperatorId.AND, criteria.toArray(new Criterion[criteria .size()])); @@ -127,5 +140,21 @@ public class ResourceSelector extends AbstractSelector<Resource> { } return records; } + + @Override + protected ResourceCriteria getFetchCriteria(final DSRequest request) { + ResourceCriteria result = super.getFetchCriteria(request); + + // additional filters + if (null != requireType) { + result.addFilterResourceTypeId(requireType.getId()); + } + + // additional return data + result.fetchResourceType(true); + + return result; + } + } } diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/index.html b/modules/enterprise/gui/portal-war/src/main/webapp/index.html index c6499a3..156119e 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/index.html +++ b/modules/enterprise/gui/portal-war/src/main/webapp/index.html @@ -1,9 +1,9 @@ -<html> - <head> - <meta http-equiv="Refresh" content="0; URL=/coregui/CoreGUI.html#Dashboard"/> - </head> - <body> - <p>Redirecting to <a href="/coregui/CoreGUI.html#Dashboard">coregui.war</a>...</p> - </body> -</html> - +<html> + <head> + <meta http-equiv="Refresh" content="0; URL=/coregui/CoreGUI.html#Dashboard"/> + </head> + <body> + <p>Redirecting to <a href="/coregui/CoreGUI.html#Dashboard">coregui.war</a>...</p> + </body> +</html> +
commit ab5237ba41268de18da049c127ad1d83a380378b Author: Jay Shaughnessy jshaughn@redhat.com Date: Tue Aug 10 12:18:03 2010 -0400
cosmetic changes only
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/type/ResourceTypePluginTreeDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/type/ResourceTypePluginTreeDataSource.java index 227e783..03a2198 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/type/ResourceTypePluginTreeDataSource.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/type/ResourceTypePluginTreeDataSource.java @@ -22,8 +22,6 @@ import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; import java.util.HashMap; -import java.util.HashSet; -import java.util.ListIterator;
import com.google.gwt.user.client.rpc.AsyncCallback; import com.smartgwt.client.data.DSRequest; @@ -48,7 +46,6 @@ import org.rhq.enterprise.gui.coregui.client.gwt.ResourceTypeGWTServiceAsync; */ public class ResourceTypePluginTreeDataSource extends DataSource {
- private ResourceTypeGWTServiceAsync resourceTypeService = GWTServiceLookup.getResourceTypeGWTService();
public ResourceTypePluginTreeDataSource() { @@ -57,7 +54,6 @@ public class ResourceTypePluginTreeDataSource extends DataSource { setDataProtocol(DSProtocol.CLIENTCUSTOM); setDataFormat(DSDataFormat.CUSTOM);
- DataSourceTextField idField = new DataSourceTextField("id", "ID"); idField.setPrimaryKey(true);
@@ -70,7 +66,6 @@ public class ResourceTypePluginTreeDataSource extends DataSource {
DataSourceTextField resourceTypeField = new DataSourceTextField("category", "Category");
- setFields(idField, parentIdField, resourceNameField, resourceKeyField, resourceTypeField); }
@@ -80,17 +75,16 @@ public class ResourceTypePluginTreeDataSource extends DataSource { // Asume success response.setStatus(0); switch (request.getOperationType()) { - case FETCH: - executeFetch(request, response); - break; - default: - break; + case FETCH: + executeFetch(request, response); + break; + default: + break; }
return request.getData(); }
- protected void executeFetch(final DSRequest request, final DSResponse response) {
String parentIdString = request.getCriteria().getAttributeAsString("parentId"); @@ -98,26 +92,23 @@ public class ResourceTypePluginTreeDataSource extends DataSource { processResponse(request.getRequestId(), response); } else {
- ResourceTypeCriteria criteria = new ResourceTypeCriteria(); criteria.fetchParentResourceTypes(true); criteria.setPageControl(PageControl.getUnlimitedInstance());
- resourceTypeService.findResourceTypesByCriteria(criteria, - new AsyncCallback<PageList<ResourceType>>() { - public void onFailure(Throwable caught) { - CoreGUI.getErrorHandler().handleError("Failed to load resource type tree data", caught); - } - - public void onSuccess(PageList<ResourceType> result) { - response.setData(buildNodes(result)); - processResponse(request.getRequestId(), response); - } - }); + resourceTypeService.findResourceTypesByCriteria(criteria, new AsyncCallback<PageList<ResourceType>>() { + public void onFailure(Throwable caught) { + CoreGUI.getErrorHandler().handleError("Failed to load resource type tree data", caught); + } + + public void onSuccess(PageList<ResourceType> result) { + response.setData(buildNodes(result)); + processResponse(request.getRequestId(), response); + } + }); } }
- public static TreeNode[] buildNodes(PageList<ResourceType> result) {
HashMap<String, PluginTreeNode> pluginNodes = new HashMap<String, PluginTreeNode>(); @@ -127,12 +118,11 @@ public class ResourceTypePluginTreeDataSource extends DataSource { if (type.getParentResourceTypes() == null || type.getParentResourceTypes().isEmpty()) {
PluginTreeNode pluginNode = pluginNodes.get(type.getPlugin()); - if (pluginNode == null) { - pluginNode = new PluginTreeNode(type.getPlugin()); - pluginNodes.put(type.getPlugin(), pluginNode); - nodes.add(pluginNode); - } - + if (pluginNode == null) { + pluginNode = new PluginTreeNode(type.getPlugin()); + pluginNodes.put(type.getPlugin(), pluginNode); + nodes.add(pluginNode); + }
nodes.add(new ResourceTypeTreeNode(type, type.getPlugin())); } else { @@ -152,7 +142,6 @@ public class ResourceTypePluginTreeDataSource extends DataSource { return treeNodes; }
- /** * Returns a prepopulated PageControl based on the provided DSRequest. This will set sort fields, * pagination, but *not* filter fields. @@ -166,7 +155,8 @@ public class ResourceTypePluginTreeDataSource extends DataSource { if (request.getStartRow() == null || request.getEndRow() == null) { pageControl = new PageControl(); } else { - pageControl = PageControl.getExplicitPageControl(request.getStartRow(), request.getEndRow() - request.getStartRow()); + pageControl = PageControl.getExplicitPageControl(request.getStartRow(), request.getEndRow() + - request.getStartRow()); }
// Initialize sorting. @@ -183,7 +173,6 @@ public class ResourceTypePluginTreeDataSource extends DataSource { return pageControl; }
- public static class PluginTreeNode extends TreeNode {
String id; @@ -195,19 +184,22 @@ public class ResourceTypePluginTreeDataSource extends DataSource { setParentID(null);
setAttribute("name", pluginName + " Plugin"); -// setAttribute("plugin",pluginName); + // setAttribute("plugin",pluginName); setIcon("types/plugin_16.png"); // todo doesn't work setEnabled(true); }
@Override public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; + if (this == o) + return true; + if (o == null || getClass() != o.getClass()) + return false;
PluginTreeNode that = (PluginTreeNode) o;
- if (!id.equals(that.id)) return false; + if (!id.equals(that.id)) + return false;
return true; } @@ -245,20 +237,23 @@ public class ResourceTypePluginTreeDataSource extends DataSource { setIsFolder(true); }
- public ResourceType getResourceType() { return resourceType; }
@Override public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; + if (this == o) + return true; + if (o == null || getClass() != o.getClass()) + return false;
ResourceTypeTreeNode that = (ResourceTypeTreeNode) o;
- if (!id.equals(that.id)) return false; - if (parentId != null ? !parentId.equals(that.parentId) : that.parentId != null) return false; + if (!id.equals(that.id)) + return false; + if (parentId != null ? !parentId.equals(that.parentId) : that.parentId != null) + return false;
return true; } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/menu/MenuBarView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/menu/MenuBarView.java index 9d354f4..d761dbd 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/menu/MenuBarView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/menu/MenuBarView.java @@ -18,36 +18,16 @@ */ package org.rhq.enterprise.gui.coregui.client.menu;
-import com.google.gwt.dom.client.Document; import com.google.gwt.event.logical.shared.ValueChangeEvent; import com.google.gwt.event.logical.shared.ValueChangeHandler; import com.google.gwt.user.client.History; -import com.google.gwt.user.client.Window; import com.google.gwt.user.client.ui.Hyperlink; -import com.smartgwt.client.types.ContentsType; -import com.smartgwt.client.types.VerticalAlignment; -import com.smartgwt.client.util.SC; import com.smartgwt.client.widgets.HTMLFlow; import com.smartgwt.client.widgets.Img; -import com.smartgwt.client.widgets.Label; -import com.smartgwt.client.widgets.events.ClickEvent; -import com.smartgwt.client.widgets.events.ClickHandler; -import com.smartgwt.client.widgets.events.DrawEvent; -import com.smartgwt.client.widgets.events.DrawHandler; -import com.smartgwt.client.widgets.events.ShowContextMenuEvent; -import com.smartgwt.client.widgets.events.ShowContextMenuHandler; -import com.smartgwt.client.widgets.layout.HLayout; import com.smartgwt.client.widgets.layout.LayoutSpacer; import com.smartgwt.client.widgets.layout.VLayout; -import com.smartgwt.client.widgets.menu.Menu; -import com.smartgwt.client.widgets.menu.MenuBar; -import com.smartgwt.client.widgets.menu.MenuItem; -import com.smartgwt.client.widgets.menu.MenuItemSeparator; -import com.smartgwt.client.widgets.menu.events.MenuItemClickEvent; import com.smartgwt.client.widgets.toolbar.ToolStrip;
-import org.rhq.enterprise.gui.coregui.client.CoreGUI; -import org.rhq.enterprise.gui.coregui.client.LinkManager; import org.rhq.enterprise.gui.coregui.client.components.AboutModalWindow;
/** @@ -57,13 +37,12 @@ public class MenuBarView extends VLayout {
private AboutModalWindow aboutModalWindow;
- public static final String[] SECTIONS = {"Dashboard", "Inventory", "Reports", "Bundles", "Administration"}; + public static final String[] SECTIONS = { "Dashboard", "Inventory", "Reports", "Bundles", "Administration" };
private String selected = "Dashboard";
private HTMLFlow linksPane;
- protected void onDraw() { super.onDraw();
@@ -81,7 +60,6 @@ public class MenuBarView extends VLayout { } });
- ToolStrip topStrip = new ToolStrip(); topStrip.setHeight(34); topStrip.setWidth100(); @@ -104,16 +82,16 @@ public class MenuBarView extends VLayout {
topStrip.addMember(new LayoutSpacer());
- HLayout helpLayout = new HLayout(); -// Label loggedInAs = new Label("Logged in as " + CoreGUI.getSessionSubject().getName()); -// loggedInAs.setWrap(false); -// loggedInAs.setValign(VerticalAlignment.CENTER); -// helpLayout.addMember(loggedInAs); + //HLayout helpLayout = new HLayout(); + // Label loggedInAs = new Label("Logged in as " + CoreGUI.getSessionSubject().getName()); + // loggedInAs.setWrap(false); + // loggedInAs.setValign(VerticalAlignment.CENTER); + // helpLayout.addMember(loggedInAs); topStrip.addMember(new Hyperlink("Help", "Help")); topStrip.addMember(new Hyperlink("Preferences", "Preferences")); topStrip.addMember(new Hyperlink("Log Out", "LogOut")); -// helpLayout.setLayoutAlign(VerticalAlignment.CENTER); -// topStrip.addMember(helpLayout); + // helpLayout.setLayoutAlign(VerticalAlignment.CENTER); + // topStrip.addMember(helpLayout);
/* DynamicForm links = new DynamicForm(); links.setNumCols(SECTIONS.length * 2); @@ -148,7 +126,7 @@ public class MenuBarView extends VLayout {
private String setupLinks() { StringBuilder headerString = new StringBuilder( - "<table style="height: 34px;" cellpadding="0" cellspacing="0"><tr>"); + "<table style="height: 34px;" cellpadding="0" cellspacing="0"><tr>");
boolean first = true; for (String section : SECTIONS) { @@ -162,7 +140,8 @@ public class MenuBarView extends VLayout { styleClass += "Selected"; }
- headerString.append("<td class="" + styleClass + "" onclick="document.location='#" + section + "'" >"); + headerString.append("<td id="" + section + "" class="" + styleClass + + "" onclick="document.location='#" + section + "'" >"); headerString.append(section); headerString.append("</td>\n");
@@ -174,5 +153,4 @@ public class MenuBarView extends VLayout { return headerString.toString(); }
- } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/RPCDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/RPCDataSource.java index a288517..95436d4 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/RPCDataSource.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/RPCDataSource.java @@ -20,11 +20,6 @@ package org.rhq.enterprise.gui.coregui.client.util;
import java.util.Collection;
-import org.rhq.core.domain.util.PageControl; -import org.rhq.core.domain.util.PageList; -import org.rhq.core.domain.util.PageOrdering; -import org.rhq.enterprise.gui.coregui.client.CoreGUI; - import com.smartgwt.client.data.DSRequest; import com.smartgwt.client.data.DSResponse; import com.smartgwt.client.data.DataSource; @@ -32,6 +27,10 @@ import com.smartgwt.client.types.DSDataFormat; import com.smartgwt.client.types.DSProtocol; import com.smartgwt.client.widgets.grid.ListGridRecord;
+import org.rhq.core.domain.util.PageControl; +import org.rhq.core.domain.util.PageOrdering; +import org.rhq.enterprise.gui.coregui.client.CoreGUI; + /** * Base GWT-RPC oriented DataSource class. * @@ -59,21 +58,21 @@ public abstract class RPCDataSource<T> extends DataSource { DSResponse response = createResponse(request);
switch (request.getOperationType()) { - case FETCH: - executeFetch(request, response); - break; - case ADD: - executeAdd(request, response); - break; - case UPDATE: - executeUpdate(request, response); - break; - case REMOVE: - executeRemove(request, response); - break; - default: - super.transformRequest(request); - break; + case FETCH: + executeFetch(request, response); + break; + case ADD: + executeAdd(request, response); + break; + case UPDATE: + executeUpdate(request, response); + break; + case REMOVE: + executeRemove(request, response); + break; + default: + super.transformRequest(request); + break; } } catch (Throwable t) { CoreGUI.getErrorHandler().handleError("Failure in datasource [" + request.getOperationType() + "]", t); @@ -95,7 +94,8 @@ public abstract class RPCDataSource<T> extends DataSource { if (request.getStartRow() == null || request.getEndRow() == null) { pageControl = new PageControl(); } else { - pageControl = PageControl.getExplicitPageControl(request.getStartRow(), request.getEndRow() - request.getStartRow()); + pageControl = PageControl.getExplicitPageControl(request.getStartRow(), request.getEndRow() + - request.getStartRow()); }
// Initialize sorting. @@ -112,7 +112,6 @@ public abstract class RPCDataSource<T> extends DataSource { return pageControl; }
- public ListGridRecord[] buildRecords(Collection<T> list) { if (list == null) { return null; @@ -126,7 +125,6 @@ public abstract class RPCDataSource<T> extends DataSource { return records; }
- /** * Extensions should implement this method to retrieve data. Paging solutions should use * {@link #getPageControl(com.smartgwt.client.data.DSRequest)}. All implementations should call processResponse() @@ -138,12 +136,10 @@ public abstract class RPCDataSource<T> extends DataSource { */ protected abstract void executeFetch(final DSRequest request, final DSResponse response);
- public abstract T copyValues(ListGridRecord from);
public abstract ListGridRecord copyValues(T from);
- /** * Executed on <code>REMOVE</code> operation. <code>processResponse (requestId, response)</code> * should be called when operation completes (either successful or failure).
commit 622cb7544ac6e28d4557a68e9f57420387d9c5de Author: Jay Shaughnessy jshaughn@redhat.com Date: Tue Aug 10 12:14:32 2010 -0400
cosmetic changes only
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundlesListView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundlesListView.java index 3dc9f4c..8b2726c 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundlesListView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundlesListView.java @@ -18,15 +18,11 @@ */ package org.rhq.enterprise.gui.coregui.client.bundle.list;
-import com.google.gwt.user.client.History; import com.google.gwt.user.client.rpc.AsyncCallback; import com.smartgwt.client.data.Criteria; import com.smartgwt.client.types.ListGridFieldType; -import com.smartgwt.client.types.SelectionAppearance; import com.smartgwt.client.types.SelectionStyle; -import com.smartgwt.client.widgets.grid.CellFormatter; import com.smartgwt.client.widgets.grid.ListGridRecord; -import com.smartgwt.client.widgets.layout.VLayout;
import org.rhq.core.domain.bundle.Bundle; import org.rhq.core.domain.bundle.composite.BundleWithLatestVersionComposite; @@ -63,7 +59,6 @@ public class BundlesListView extends Table {
setHeaderIcon("subsystems/bundle/Bundle_24.png");
- setDataSource(new BundlesWithLatestVersionDataSource());
getListGrid().getField("id").setWidth("60"); @@ -71,27 +66,26 @@ public class BundlesListView extends Table { getListGrid().getField("link").setType(ListGridFieldType.LINK); getListGrid().getField("link").setTarget("_self");
-// getListGrid().getField("name").setCellFormatter(new CellFormatter() { -// public String format(Object o, ListGridRecord listGridRecord, int i, int i1) { -// return "";//<a href="#Bundles/Bundle/" + listGridRecord.getAttribute("id") + "">" + o + "</a>"; -// } -// }); + // getListGrid().getField("name").setCellFormatter(new CellFormatter() { + // public String format(Object o, ListGridRecord listGridRecord, int i, int i1) { + // return "";//<a href="#Bundles/Bundle/" + listGridRecord.getAttribute("id") + "">" + o + "</a>"; + // } + // });
getListGrid().getField("description").setWidth("25%"); getListGrid().getField("latestVersion").setWidth("25%"); getListGrid().getField("versionsCount").setWidth("*");
getListGrid().setSelectionType(SelectionStyle.SIMPLE); -// getListGrid().setSelectionAppearance(SelectionAppearance.CHECKBOX); + // getListGrid().setSelectionAppearance(SelectionAppearance.CHECKBOX);
addTableAction("New", Table.SelectionEnablement.ALWAYS, null, new TableAction() { public void executeAction(ListGridRecord[] selection) { new BundleCreateWizard().startBundleWizard(); - } });
- addTableAction("Delete", Table.SelectionEnablement.ANY, "Delete the selected bundle?", new TableAction() { + addTableAction("Delete", Table.SelectionEnablement.ANY, "Delete the selected bundles?", new TableAction() { public void executeAction(ListGridRecord[] selections) { BundlesWithLatestVersionDataSource ds = (BundlesWithLatestVersionDataSource) getDataSource(); for (ListGridRecord selection : selections) { @@ -148,7 +142,6 @@ public class BundlesListView extends Table { }); }
- public int getMatches() { return this.getListGrid().getTotalRows(); }
commit a5187a89792700e0852b59a679444a5b352bbd11 Author: John Mazzitelli mazz@redhat.com Date: Tue Aug 10 10:21:15 2010 -0400
trivial - remove end-of-line spaces
diff --git a/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml b/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml index 5d47fc1..f36ad4a 100644 --- a/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml +++ b/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml @@ -1539,7 +1539,7 @@ <statement targetDBVendor="postgresql"> ALTER TABLE RHQ_REPO ADD CONSTRAINT RHQ_REPO_PKEY PRIMARY KEY ( ID ) - </statement> + </statement> <statement> ALTER TABLE RHQ_CHANNEL_CONTENT_SRC_MAP RENAME TO RHQ_REPO_CONTENT_SRC_MAP @@ -3065,20 +3065,20 @@ FOREIGN KEY ( DASHBOARD_ID ) REFERENCES RHQ_DASHBOARD ( ID ) </statement> - </schema-directSQL> + </schema-directSQL> </schemaSpec> - + <!-- rhq 3.0.0.final release at this point. --> - + <!-- 2.89 corrects problems in 3.0.0.final *new* installs. The problems it fixes are not present in an upgraded db. As such, ignore any errors. - --> + --> <schemaSpec version="2.89"> <schema-deleteColumn ignoreError="true" table="RHQ_ALERT" column="TRIGGERED_OPERATION" /> <schema-deleteColumn ignoreError="true" table="RHQ_ALERT_DEFINITION" column="operation_def_id" /> - + <schema-alterColumn ignoreError="true" table="RHQ_ADVISORY_CVE" column="LAST_MODIFIED" nullable="false" /> - + <schema-alterColumn ignoreError="true" table="RHQ_TAGGING_BUNDLE_MAP" column="BUNDLE_ID" nullable="false" /> <schema-alterColumn ignoreError="true" table="RHQ_TAGGING_BUNDLE_MAP" column="TAG_ID" nullable="false" /> <schema-alterColumn ignoreError="true" table="RHQ_TAGGING_BUNDLE_VERSION_MAP" column="BUNDLE_VERSION_ID" nullable="false" /> @@ -3090,27 +3090,27 @@ <schema-alterColumn ignoreError="true" table="RHQ_TAGGING_RESOURCE_MAP" column="RESOURCE_ID" nullable="false" /> <schema-alterColumn ignoreError="true" table="RHQ_TAGGING_RESOURCE_MAP" column="TAG_ID" nullable="false" /> <schema-alterColumn ignoreError="true" table="RHQ_TAGGING_RES_GROUP_MAP" column="RESOURCE_GROUP_ID" nullable="false" /> - <schema-alterColumn ignoreError="true" table="RHQ_TAGGING_RES_GROUP_MAP" column="TAG_ID" nullable="false" /> + <schema-alterColumn ignoreError="true" table="RHQ_TAGGING_RES_GROUP_MAP" column="TAG_ID" nullable="false" /> </schemaSpec>
<!-- 2.90 corrects problems in 3.0.0.final upgrade installs. The problems it fixes are not present in a new db. As such, ignore any errors. - --> - <schemaSpec version="2.90"> - <schema-dropSequence ignoreError="true" name="rhq_tag_id_seq" /> + --> + <schemaSpec version="2.90"> + <schema-dropSequence ignoreError="true" name="rhq_tag_id_seq" /> <schema-dropSequence ignoreError="true" name="rhq_advisory_buglist_seq" /> - + <schema-createSequence ignoreError="true" name="RHQ_ADVISORY_BUGLIST_ID_SEQ" initial="10001" /> - + <schema-alterColumn ignoreError="true" table="RHQ_ALERT_NOTIF_LOG" column="SENDER" nullable="TRUE" /> - + <schema-alterColumn ignoreError="true" table="RHQ_BUNDLE_TYPE" column="RESOURCE_TYPE_ID" nullable="FALSE" /> - + <schema-alterColumn ignoreError="true" table="RHQ_ROLE_LDAP_GROUP" column="LDAP_GROUP_NAME" nullable="FALSE" />
<schema-deleteColumn ignoreError="true" table="RHQ_SAVED_SEARCH" column="JPQL_TRANSLATION" /> <schema-alterColumn ignoreError="true" table="RHQ_SAVED_SEARCH" column="NAME" nullable="FALSE" /> - + <schema-directSQL ignoreError="true"> <statement desc="Creating RHQ_SAVED_SEARCH foreign key relation to RHQ_SUBJECT"> ALTER TABLE RHQ_SAVED_SEARCH @@ -3119,7 +3119,7 @@ REFERENCES RHQ_SUBJECT (ID) </statement> </schema-directSQL> - + </schemaSpec>
<schemaSpec version="2.91"> @@ -3132,7 +3132,7 @@ </statement> </schema-directSQL> </schemaSpec> - + <schemaSpec version="2.92"> <!-- if some role previously had CONFIGURE perm (now called CONFIGURE_WRITE), give it the implied perm CONFIGURE_READ so users don't experience an unexpected permission restriction after upgrade --> @@ -3157,14 +3157,14 @@ <statement desc="RESOURCE_GROUP: Make unknown usernames as rhqadmin in tmp modifiedBy column"> UPDATE RHQ_RESOURCE_GROUP SET MODIFIED_BY_VARCHAR = 'rhqadmin' WHERE MODIFIED_BY_VARCHAR IS NULL </statement> - </schema-directSQL> + </schema-directSQL> <schema-deleteColumn table="RHQ_RESOURCE_GROUP" column="MODIFIED_BY" /> <schema-directSQL> <statement desc="RESOURCE_GROUP: Renaming new varchar MODIFIED_BY column"> ALTER TABLE RHQ_RESOURCE_GROUP RENAME COLUMN MODIFIED_BY_VARCHAR TO MODIFIED_BY </statement> - </schema-directSQL> + </schema-directSQL> </schemaSpec>
<schemaSpec version="2.93.2"> @@ -3177,14 +3177,14 @@ <statement desc="RESOURCE: Make unknown usernames as rhqadmin in tmp modifiedBy column"> UPDATE RHQ_RESOURCE SET MODIFIED_BY_VARCHAR = 'rhqadmin' WHERE MODIFIED_BY_VARCHAR IS NULL </statement> - </schema-directSQL> + </schema-directSQL> <schema-deleteColumn table="RHQ_RESOURCE" column="MODIFIED_BY" /> <schema-directSQL> <statement desc="RESOURCE: Renaming new varchar MODIFIED_BY column"> ALTER TABLE RHQ_RESOURCE RENAME COLUMN MODIFIED_BY_VARCHAR TO MODIFIED_BY </statement> - </schema-directSQL> + </schema-directSQL> </schemaSpec>
<schemaSpec version="2.93.3">
commit 7a1accc180497bc215e3e416a0f19c74f6dc1647 Author: John Mazzitelli mazz@redhat.com Date: Tue Aug 10 10:18:39 2010 -0400
bz 622491 - make the db upgrade re-typing of the MODIFIED_BY column more efficient
diff --git a/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml b/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml index 8c404b7..5d47fc1 100644 --- a/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml +++ b/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml @@ -3149,48 +3149,42 @@ <!-- BZ 622491 - 2.93.x - modifiedBy should only be username, not a subject ID and should be size 100 --> <schemaSpec version="2.93.1"> <!-- first do the RHQ_RESOURCE_GROUP table --> - <schema-addColumn table="RHQ_RESOURCE_GROUP" column="TMP_MODIFIED_BY" columnType="VARCHAR2" precision="100"/> + <schema-addColumn table="RHQ_RESOURCE_GROUP" column="MODIFIED_BY_VARCHAR" columnType="VARCHAR2" precision="100"/> <schema-directSQL> <statement desc="RESOURCE_GROUP: Populate the tmp modifiedBy column with existing user names or null if user does not exist"> - UPDATE RHQ_RESOURCE_GROUP AS g SET TMP_MODIFIED_BY = (SELECT NAME FROM RHQ_SUBJECT WHERE ID = g.MODIFIED_BY) + UPDATE RHQ_RESOURCE_GROUP AS g SET MODIFIED_BY_VARCHAR = (SELECT NAME FROM RHQ_SUBJECT WHERE ID = g.MODIFIED_BY) </statement> <statement desc="RESOURCE_GROUP: Make unknown usernames as rhqadmin in tmp modifiedBy column"> - UPDATE RHQ_RESOURCE_GROUP SET TMP_MODIFIED_BY = 'rhqadmin' WHERE TMP_MODIFIED_BY IS NULL - </statement> - <statement desc="RESOURCE_GROUP: Null out IDs from existing modifiedBy column to prepare for conversion to varchar column"> - UPDATE RHQ_RESOURCE_GROUP SET MODIFIED_BY = NULL + UPDATE RHQ_RESOURCE_GROUP SET MODIFIED_BY_VARCHAR = 'rhqadmin' WHERE MODIFIED_BY_VARCHAR IS NULL </statement> </schema-directSQL> - <schema-alterColumn table="RHQ_RESOURCE_GROUP" column="MODIFIED_BY" columnType="VARCHAR2" precision="100" /> + <schema-deleteColumn table="RHQ_RESOURCE_GROUP" column="MODIFIED_BY" /> <schema-directSQL> - <statement desc="RESOURCE_GROUP: Populate the new-typed modifiedBy column with user names from tmp column"> - UPDATE RHQ_RESOURCE_GROUP SET MODIFIED_BY = TMP_MODIFIED_BY + <statement desc="RESOURCE_GROUP: Renaming new varchar MODIFIED_BY column"> + ALTER TABLE RHQ_RESOURCE_GROUP + RENAME COLUMN MODIFIED_BY_VARCHAR TO MODIFIED_BY </statement> </schema-directSQL> - <schema-deleteColumn table="RHQ_RESOURCE_GROUP" column="TMP_MODIFIED_BY" /> </schemaSpec>
<schemaSpec version="2.93.2"> <!-- second do the RHQ_RESOURCE table --> - <schema-addColumn table="RHQ_RESOURCE" column="TMP_MODIFIED_BY" columnType="VARCHAR2" precision="100"/> + <schema-addColumn table="RHQ_RESOURCE" column="MODIFIED_BY_VARCHAR" columnType="VARCHAR2" precision="100"/> <schema-directSQL> <statement desc="RESOURCE: Populate the tmp modifiedBy column with existing user names or null if user does not exist"> - UPDATE RHQ_RESOURCE AS r SET TMP_MODIFIED_BY = (SELECT NAME FROM RHQ_SUBJECT WHERE ID = r.MODIFIED_BY) + UPDATE RHQ_RESOURCE AS r SET MODIFIED_BY_VARCHAR = (SELECT NAME FROM RHQ_SUBJECT WHERE ID = r.MODIFIED_BY) </statement> <statement desc="RESOURCE: Make unknown usernames as rhqadmin in tmp modifiedBy column"> - UPDATE RHQ_RESOURCE SET TMP_MODIFIED_BY = 'rhqadmin' WHERE TMP_MODIFIED_BY IS NULL - </statement> - <statement desc="RESOURCE: Null out IDs from existing modifiedBy column to prepare for conversion to varchar column"> - UPDATE RHQ_RESOURCE SET MODIFIED_BY = NULL + UPDATE RHQ_RESOURCE SET MODIFIED_BY_VARCHAR = 'rhqadmin' WHERE MODIFIED_BY_VARCHAR IS NULL </statement> </schema-directSQL> - <schema-alterColumn table="RHQ_RESOURCE" column="MODIFIED_BY" columnType="VARCHAR2" precision="100" /> + <schema-deleteColumn table="RHQ_RESOURCE" column="MODIFIED_BY" /> <schema-directSQL> - <statement desc="RESOURCE: Populate the new-typed modifiedBy column with user names from tmp column"> - UPDATE RHQ_RESOURCE SET MODIFIED_BY = TMP_MODIFIED_BY + <statement desc="RESOURCE: Renaming new varchar MODIFIED_BY column"> + ALTER TABLE RHQ_RESOURCE + RENAME COLUMN MODIFIED_BY_VARCHAR TO MODIFIED_BY </statement> </schema-directSQL> - <schema-deleteColumn table="RHQ_RESOURCE" column="TMP_MODIFIED_BY" /> </schemaSpec>
<schemaSpec version="2.93.3">
commit b81af62dd724a889d03b1344587f720065ace6f9 Author: Ian Springer ian.springer@redhat.com Date: Mon Aug 9 19:04:14 2010 -0400
finish wiring up #ResourceGroup/10017 bookmark to group detail view; implement group Inventory>Members subtab
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/ResourceGroupListView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/ResourceGroupListView.java index d66a328..f29a064 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/ResourceGroupListView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/ResourceGroupListView.java @@ -32,6 +32,7 @@ import org.rhq.enterprise.gui.coregui.client.components.table.Table; import org.rhq.enterprise.gui.coregui.client.components.table.TableAction; import org.rhq.enterprise.gui.coregui.client.components.wizard.WizardView; import org.rhq.enterprise.gui.coregui.client.inventory.groups.wizard.GroupCreateWizard; +import org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceSearchView;
/** * @author Greg Hinkle diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java index a902bc5..c3d6a43 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java @@ -41,10 +41,12 @@ import org.rhq.enterprise.gui.coregui.client.components.tab.TwoLevelTabSelectedE import org.rhq.enterprise.gui.coregui.client.components.tab.TwoLevelTabSelectedHandler; import org.rhq.enterprise.gui.coregui.client.components.tab.TwoLevelTabSet; import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup; +import org.rhq.enterprise.gui.coregui.client.inventory.groups.detail.inventory.OverviewView; +import org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceSearchView; import org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTypeRepository;
/** - * Right panel of the resource view. + * Right panel of the group view. * * @author Greg Hinkle */ @@ -62,7 +64,6 @@ public class ResourceGroupDetailView extends VLayout implements BookmarkableView private TwoLevelTab alertsTab; private TwoLevelTab configurationTab; private TwoLevelTab eventsTab; - private TwoLevelTab contentTab;
private TwoLevelTabSet topTabSet;
@@ -94,7 +95,7 @@ public class ResourceGroupDetailView extends VLayout implements BookmarkableView monitoringTab.registerSubTabs("Graphs", "Tables", "Traits", "Availability", "Schedules", "Call Time");
inventoryTab = new TwoLevelTab("Inventory", "/images/icons/Inventory_grey_16.png"); - inventoryTab.registerSubTabs("Children", "Connection Settings"); + inventoryTab.registerSubTabs("Overview", "Members", "Connection Settings");
operationsTab = new TwoLevelTab("Operations", "/images/icons/Operation_grey_16.png"); operationsTab.registerSubTabs("History", "Scheduled"); @@ -108,11 +109,8 @@ public class ResourceGroupDetailView extends VLayout implements BookmarkableView eventsTab = new TwoLevelTab("Events", "/images/icons/Events_grey_16.png"); eventsTab.registerSubTabs("History");
- contentTab = new TwoLevelTab("Content", "/images/icons/Content_grey_16.png"); - contentTab.registerSubTabs("Deployed", "New", "Subscriptions", "History"); - topTabSet.setTabs(summaryTab, monitoringTab, inventoryTab, operationsTab, alertsTab, configurationTab, - eventsTab, contentTab); + eventsTab);
topTabSet.addTwoLevelTabSelectedHandler(this);
@@ -124,7 +122,7 @@ public class ResourceGroupDetailView extends VLayout implements BookmarkableView // CoreGUI.addBreadCrumb(getPlace()); }
- public void onResourceSelected(ResourceGroup group) { + public void onGroupSelected(ResourceGroup group) {
this.group = group;
@@ -145,9 +143,9 @@ public class ResourceGroupDetailView extends VLayout implements BookmarkableView // monitoringTab.updateSubTab("Schedules", new FullHTMLPane("/rhq/resource/monitor/schedules-plain.xhtml?id=" + resource.getId())); // monitoringTab.updateSubTab("Call Time", new CallTimeView(resource)); // - // - // inventoryTab.updateSubTab("Children", ResourceSearchView.getChildrenOf(resource.getId())); - // inventoryTab.updateSubTab("Connection Settings", new PluginConfigurationEditView(resource)); // new ConfigurationEditor(resource.getId(), resource.getResourceType().getId(), ConfigurationEditor.ConfigType.plugin)); + inventoryTab.updateSubTab("Overview", new OverviewView()); + inventoryTab.updateSubTab("Members", ResourceSearchView.getMembersOf(this.group.getId())); + // inventoryTab.updateSubTab("Connection Settings", new GroupPluginConfigurationEditView(this.group.getId(), this.group.getResourceType().getId(), ConfigurationEditor.ConfigType.plugin)); // // operationsTab.updateSubTab("History", OperationHistoryView.getResourceHistoryView(resource)); // @@ -237,12 +235,6 @@ public class ResourceGroupDetailView extends VLayout implements BookmarkableView topTabSet.enableTab(eventsTab); }
- if (groupType.getPackageTypes() == null || groupType.getPackageTypes().isEmpty() || !permissions.isContent()) { - topTabSet.disableTab(contentTab); - } else { - topTabSet.enableTab(contentTab); - } - }
public void onTabSelected(TwoLevelTabSelectedEvent tabSelectedEvent) { diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupTopView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupTopView.java index 3aade28..8faaae8 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupTopView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupTopView.java @@ -26,15 +26,17 @@ import com.google.gwt.user.client.rpc.AsyncCallback; import com.smartgwt.client.widgets.Canvas; import com.smartgwt.client.widgets.layout.HLayout;
+import org.rhq.core.domain.criteria.ResourceGroupCriteria; import org.rhq.core.domain.resource.group.ResourceGroup; -import org.rhq.core.domain.resource.group.composite.ClusterFlyweight; +import org.rhq.core.domain.util.PageList; import org.rhq.enterprise.gui.coregui.client.BookmarkableView; import org.rhq.enterprise.gui.coregui.client.CoreGUI; import org.rhq.enterprise.gui.coregui.client.ViewId; import org.rhq.enterprise.gui.coregui.client.ViewPath; import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup; -import org.rhq.enterprise.gui.coregui.client.gwt.ResourceGWTServiceAsync; -import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.ResourceTreeView; +import org.rhq.enterprise.gui.coregui.client.gwt.ResourceGroupGWTServiceAsync; +import org.rhq.enterprise.gui.coregui.client.inventory.resource.InventoryView; +import org.rhq.enterprise.gui.coregui.client.util.message.Message;
/** * @author Greg Hinkle @@ -49,7 +51,7 @@ public class ResourceGroupTopView extends HLayout implements BookmarkableView { private ResourceGroupTreeView treeView; private ResourceGroupDetailView detailView = new ResourceGroupDetailView();
- private ResourceGWTServiceAsync resourceService = GWTServiceLookup.getResourceService(); + private ResourceGroupGWTServiceAsync groupService = GWTServiceLookup.getResourceGroupService();
public ResourceGroupTopView() { @@ -80,42 +82,41 @@ public class ResourceGroupTopView extends HLayout implements BookmarkableView { setContent(detailView);
} -/* - public void setSelectedResource(final int resourceId, final ViewPath view) { - Resource resource = this.treeView.getResource(resourceId); - if (resource != null) { - setSelectedResource(resource, view); + + public void setSelectedGroup(final int groupId, final ViewPath view) { + ResourceGroup group = this.treeView.getGroup(groupId); + if (group != null) { + setSelectedGroup(group, view); } else { - ResourceCriteria criteria = new ResourceCriteria(); - criteria.addFilterId(resourceId); + ResourceGroupCriteria criteria = new ResourceGroupCriteria(); + criteria.addFilterId(groupId); criteria.fetchTags(true); - //criteria.fetchParentResource(true); - resourceService.findResourcesByCriteria(criteria, new AsyncCallback<PageList<Resource>>() { + groupService.findResourceGroupsByCriteria(criteria, new AsyncCallback<PageList<ResourceGroup>>() { public void onFailure(Throwable caught) { - CoreGUI.getMessageCenter().notify(new Message("Resource with id [" + resourceId + + CoreGUI.getMessageCenter().notify(new Message("Group with id [" + groupId + "] does not exist or is not accessible.", Message.Severity.Warning));
CoreGUI.goTo(InventoryView.VIEW_PATH); }
- public void onSuccess(PageList<Resource> result) { + public void onSuccess(PageList<ResourceGroup> result) { if (result.isEmpty()) { //noinspection ThrowableInstanceNeverThrown - onFailure(new Exception("Resource with id [" + resourceId + "] does not exist.")); + onFailure(new Exception("Group with id [" + groupId + "] does not exist.")); } else { - Resource resource = result.get(0); - setSelectedResource(resource, view); + ResourceGroup group = result.get(0); + setSelectedGroup(group, view); } } }); } }
- private void setSelectedResource(Resource resource, ViewPath viewPath) { - this.currentResource = resource; - this.treeView.setSelectedResource(resource, viewPath.getCurrent()); - this.detailView.onResourceSelected(resource); - }*/ + private void setSelectedGroup(ResourceGroup group, ViewPath viewPath) { + this.currentGroup = group; + this.treeView.setSelectedGroup(group.getId()); + this.detailView.onGroupSelected(group); + }
public void setContent(Canvas newContent) { if (contentCanvas.getChildren().length > 0) @@ -134,18 +135,12 @@ public class ResourceGroupTopView extends HLayout implements BookmarkableView {
Integer groupId = Integer.parseInt(viewPath.getCurrent().getPath());
- - - if (currentGroup == null || currentGroup.getId() != groupId) {
-// setSelectedResource(resourceId, viewPath); + setSelectedGroup(groupId, viewPath);
this.treeView.setSelectedGroup(groupId);
- - - viewPath.next();
this.detailView.renderView(viewPath); diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupTreeView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupTreeView.java index ef5406d..bd79780 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupTreeView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupTreeView.java @@ -31,7 +31,10 @@ import com.smartgwt.client.widgets.tree.Tree; import com.smartgwt.client.widgets.tree.TreeGrid; import com.smartgwt.client.widgets.tree.TreeNode;
+import org.rhq.core.domain.criteria.ResourceGroupCriteria; +import org.rhq.core.domain.resource.group.ResourceGroup; import org.rhq.core.domain.resource.group.composite.ClusterFlyweight; +import org.rhq.core.domain.util.PageList; import org.rhq.enterprise.gui.coregui.client.CoreGUI; import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
@@ -40,9 +43,8 @@ import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup; */ public class ResourceGroupTreeView extends VLayout {
- private int groupId; - + private ResourceGroup group; private TreeGrid treeGrid;
public ResourceGroupTreeView() { @@ -79,10 +81,27 @@ public class ResourceGroupTreeView extends VLayout { } });
+ // TODO: Get the group from the ResourceGroupTreeView in case it was already loaded. + ResourceGroupCriteria criteria = new ResourceGroupCriteria(); + criteria.addFilterId(groupId); + criteria.fetchTags(true); + GWTServiceLookup.getResourceGroupService().findResourceGroupsByCriteria(criteria, + new AsyncCallback<PageList<ResourceGroup>>() { + public void onFailure(Throwable caught) { + CoreGUI.getErrorHandler().handleError("Failed to load group", caught); + }
- } + public void onSuccess(PageList<ResourceGroup> result) { + group = result.get(0); + } + });
+ }
+ ResourceGroup getGroup(int groupId) { + // TODO: Get the group from the ResourceGroupTreeView in case it was already loaded. + return this.group; + }
private void loadTree(ClusterFlyweight root) { diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/inventory/OverviewView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/inventory/OverviewView.java new file mode 100644 index 0000000..c5aeb38 --- /dev/null +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/inventory/OverviewView.java @@ -0,0 +1,12 @@ +package org.rhq.enterprise.gui.coregui.client.inventory.groups.detail.inventory; + +import com.smartgwt.client.widgets.layout.VLayout; + +/** + * @author Ian Springer + */ +public class OverviewView extends VLayout { + + // TODO: Group general properties go here. + +} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceDataSourceField.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceDataSourceField.java index 358021d..8b81f4c 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceDataSourceField.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceDataSourceField.java @@ -43,7 +43,7 @@ public enum ResourceDataSourceField { private String propertyName;
/** - * The display name for the field or proeprty + * The display name for the field or property */ private String title;
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceDatasource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceDatasource.java index 49ec0e4..af8931b 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceDatasource.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceDatasource.java @@ -119,6 +119,12 @@ public class ResourceDatasource extends RPCDataSource<Resource> { criteria.addFilterIds(oids); }
+ // Fetch member Resources of the group with the specified id. + if (request.getCriteria().getValues().get("groupId") != null) { + int groupId = Integer.parseInt((String) request.getCriteria().getValues().get("groupId")); + criteria.addFilterImplicitGroupIds(groupId); + } + if (request.getCriteria().getValues().get(NAME.propertyName()) != null) { criteria.addFilterName((String) request.getCriteria().getValues().get(NAME.propertyName())); } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceSearchView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceSearchView.java index 166d26a..1642c64 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceSearchView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceSearchView.java @@ -39,6 +39,8 @@ import com.smartgwt.client.widgets.layout.VLayout; import org.rhq.enterprise.gui.coregui.client.components.table.Table; import org.rhq.enterprise.gui.coregui.client.components.table.TableAction;
+import javax.persistence.Id; + import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.AVAILABILITY; import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.CATEGORY; import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.DESCRIPTION; @@ -167,4 +169,9 @@ public class ResourceSearchView extends Table { public static ResourceSearchView getChildrenOf(int resourceId) { return new ResourceSearchView(new Criteria("parentId", String.valueOf(resourceId)), "Child Resources"); } + + public static ResourceSearchView getMembersOf(int groupId) { + return new ResourceSearchView(new Criteria("groupId", String.valueOf(groupId)), "Member Resources"); + } + } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceView.java index 2f85ae3..e342628 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceView.java @@ -19,7 +19,6 @@ package org.rhq.enterprise.gui.coregui.client.inventory.resource.detail;
import com.google.gwt.user.client.rpc.AsyncCallback; -import com.smartgwt.client.data.Criteria; import com.smartgwt.client.widgets.Canvas; import com.smartgwt.client.widgets.layout.HLayout;
commit f6409557d36ab77f8baa69cb4dc4d11c5fedc39c Author: John Mazzitelli mazz@redhat.com Date: Mon Aug 9 17:17:45 2010 -0400
BZ 622491 - do not have subject ID foreign key in "modifiedBy" columns - we only log usernames this prevents errors when someone deletes a user. change RHQ_RESOURCE and RHQ_RESOURCE_GROUP to have VARCHAR modifiedBy rather than integer. This also fixes db-upgrade so existing data can be upgraded.
diff --git a/modules/core/dbutils/pom.xml b/modules/core/dbutils/pom.xml index 3e129f3..81498dc 100644 --- a/modules/core/dbutils/pom.xml +++ b/modules/core/dbutils/pom.xml @@ -22,7 +22,7 @@
<properties> <scm.module.path>modules/core/dbutils/</scm.module.path> - <db.schema.version>2.92</db.schema.version> + <db.schema.version>2.93.3</db.schema.version> </properties>
<dependencies> diff --git a/modules/core/dbutils/src/main/scripts/dbsetup/cluster-schema.xml b/modules/core/dbutils/src/main/scripts/dbsetup/cluster-schema.xml index e4c6977..161830f 100644 --- a/modules/core/dbutils/src/main/scripts/dbsetup/cluster-schema.xml +++ b/modules/core/dbutils/src/main/scripts/dbsetup/cluster-schema.xml @@ -59,7 +59,7 @@ <table name="RHQ_PARTITION_EVENT"> <column name="ID" default="sequence-only" initial="10001" primarykey="true" required="true" type="INTEGER"/> - <column name="SUBJECT_NAME" required="true" size="255" type="VARCHAR2"/> + <column name="SUBJECT_NAME" required="true" size="100" type="VARCHAR2"/> <column name="CTIME" required="true" type="LONG"/> <column name="EVENT_TYPE" required="true" size="50" type="VARCHAR2"/> <column name="EVENT_DETAIL" required="false" size="512" type="VARCHAR2"/> diff --git a/modules/core/dbutils/src/main/scripts/dbsetup/inventory-schema.xml b/modules/core/dbutils/src/main/scripts/dbsetup/inventory-schema.xml index da048e1..3233d47 100644 --- a/modules/core/dbutils/src/main/scripts/dbsetup/inventory-schema.xml +++ b/modules/core/dbutils/src/main/scripts/dbsetup/inventory-schema.xml @@ -95,7 +95,7 @@ <column name="ITIME" type="LONG"/> <column name="RES_CONFIGURATION_ID" type="INTEGER" references="RHQ_CONFIG"/> <column name="PLUGIN_CONFIGURATION_ID" type="INTEGER" references="RHQ_CONFIG"/> - <column name="MODIFIED_BY" required="false" type="INTEGER"/> + <column name="MODIFIED_BY" required="false" size="100" type="VARCHAR2"/> <column name="LOCATION" required="false" size="100" type="VARCHAR2"/> <column name="PARENT_RESOURCE_ID" type="INTEGER" references="RHQ_RESOURCE"/> <column name="PRODUCT_VERSION_ID" type="INTEGER" references="RHQ_PRD_VER"/> @@ -160,8 +160,7 @@ <!-- Compatible groups only --> <column name="CTIME" type="LONG"/> <column name="MTIME" type="LONG"/> - <column name="MODIFIED_BY" required="false" type="INTEGER"/> - <!-- TODO: Reorder to allow this references="RHQ_SUBJECT" --> + <column name="MODIFIED_BY" required="false" size="100" type="VARCHAR2"/> <column name="RECURSIVE" type="BOOLEAN"/>
<column name="GROUP_DEFINITION_ID" required="false" type="INTEGER" references="RHQ_GROUP_DEF"/> diff --git a/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml b/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml index f3b3106..8c404b7 100644 --- a/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml +++ b/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml @@ -3146,6 +3146,58 @@ </schema-directSQL> </schemaSpec>
+ <!-- BZ 622491 - 2.93.x - modifiedBy should only be username, not a subject ID and should be size 100 --> + <schemaSpec version="2.93.1"> + <!-- first do the RHQ_RESOURCE_GROUP table --> + <schema-addColumn table="RHQ_RESOURCE_GROUP" column="TMP_MODIFIED_BY" columnType="VARCHAR2" precision="100"/> + <schema-directSQL> + <statement desc="RESOURCE_GROUP: Populate the tmp modifiedBy column with existing user names or null if user does not exist"> + UPDATE RHQ_RESOURCE_GROUP AS g SET TMP_MODIFIED_BY = (SELECT NAME FROM RHQ_SUBJECT WHERE ID = g.MODIFIED_BY) + </statement> + <statement desc="RESOURCE_GROUP: Make unknown usernames as rhqadmin in tmp modifiedBy column"> + UPDATE RHQ_RESOURCE_GROUP SET TMP_MODIFIED_BY = 'rhqadmin' WHERE TMP_MODIFIED_BY IS NULL + </statement> + <statement desc="RESOURCE_GROUP: Null out IDs from existing modifiedBy column to prepare for conversion to varchar column"> + UPDATE RHQ_RESOURCE_GROUP SET MODIFIED_BY = NULL + </statement> + </schema-directSQL> + <schema-alterColumn table="RHQ_RESOURCE_GROUP" column="MODIFIED_BY" columnType="VARCHAR2" precision="100" /> + <schema-directSQL> + <statement desc="RESOURCE_GROUP: Populate the new-typed modifiedBy column with user names from tmp column"> + UPDATE RHQ_RESOURCE_GROUP SET MODIFIED_BY = TMP_MODIFIED_BY + </statement> + </schema-directSQL> + <schema-deleteColumn table="RHQ_RESOURCE_GROUP" column="TMP_MODIFIED_BY" /> + </schemaSpec> + + <schemaSpec version="2.93.2"> + <!-- second do the RHQ_RESOURCE table --> + <schema-addColumn table="RHQ_RESOURCE" column="TMP_MODIFIED_BY" columnType="VARCHAR2" precision="100"/> + <schema-directSQL> + <statement desc="RESOURCE: Populate the tmp modifiedBy column with existing user names or null if user does not exist"> + UPDATE RHQ_RESOURCE AS r SET TMP_MODIFIED_BY = (SELECT NAME FROM RHQ_SUBJECT WHERE ID = r.MODIFIED_BY) + </statement> + <statement desc="RESOURCE: Make unknown usernames as rhqadmin in tmp modifiedBy column"> + UPDATE RHQ_RESOURCE SET TMP_MODIFIED_BY = 'rhqadmin' WHERE TMP_MODIFIED_BY IS NULL + </statement> + <statement desc="RESOURCE: Null out IDs from existing modifiedBy column to prepare for conversion to varchar column"> + UPDATE RHQ_RESOURCE SET MODIFIED_BY = NULL + </statement> + </schema-directSQL> + <schema-alterColumn table="RHQ_RESOURCE" column="MODIFIED_BY" columnType="VARCHAR2" precision="100" /> + <schema-directSQL> + <statement desc="RESOURCE: Populate the new-typed modifiedBy column with user names from tmp column"> + UPDATE RHQ_RESOURCE SET MODIFIED_BY = TMP_MODIFIED_BY + </statement> + </schema-directSQL> + <schema-deleteColumn table="RHQ_RESOURCE" column="TMP_MODIFIED_BY" /> + </schemaSpec> + + <schemaSpec version="2.93.3"> + <!-- third, maintain consistency across data model - everywhere else, SUBJECT_NAME is of size 100, make this one 100 too --> + <schema-alterColumn table="RHQ_PARTITION_EVENT" column="SUBJECT_NAME" columnType="VARCHAR2" precision="100" /> + </schemaSpec> + </dbupgrade> </target> </project> diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/Resource.java b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/Resource.java index 8f4e45f..40deb43 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/Resource.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/Resource.java @@ -60,7 +60,6 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable;
import org.rhq.core.domain.alert.AlertDefinition; -import org.rhq.core.domain.auth.Subject; import org.rhq.core.domain.configuration.Configuration; import org.rhq.core.domain.configuration.PluginConfigurationUpdate; import org.rhq.core.domain.configuration.ResourceConfigurationUpdate; @@ -904,9 +903,8 @@ public class Resource implements Comparable<Resource>, Serializable { @Column(name = "ITIME") private Long itime = System.currentTimeMillis(); // time inventory status changed
- @JoinColumn(name = "MODIFIED_BY") - @ManyToOne(fetch = FetchType.LAZY) - private Subject modifiedBy; + @Column(name = "MODIFIED_BY") + private String modifiedBy;
@Column(name = "LOCATION") private String location; @@ -1220,11 +1218,11 @@ public class Resource implements Comparable<Resource>, Serializable { this.mtime = System.currentTimeMillis(); }
- public Subject getModifiedBy() { + public String getModifiedBy() { return this.modifiedBy; }
- public void setModifiedBy(Subject modifiedBy) { + public void setModifiedBy(String modifiedBy) { this.modifiedBy = modifiedBy; }
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/group/Group.java b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/group/Group.java index 082d14d..4a15ff4 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/group/Group.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/group/Group.java @@ -1,37 +1,35 @@ - /* - * RHQ Management Platform - * Copyright (C) 2005-2008 Red Hat, Inc. - * All rights reserved. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License, version 2, as - * published by the Free Software Foundation, and/or the GNU Lesser - * General Public License, version 2.1, also as published by the Free - * Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License and the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License - * and the GNU Lesser General Public License along with this program; - * if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ +/* + * RHQ Management Platform + * Copyright (C) 2005-2008 Red Hat, Inc. + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License, version 2, as + * published by the Free Software Foundation, and/or the GNU Lesser + * General Public License, version 2.1, also as published by the Free + * Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License and the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License + * and the GNU Lesser General Public License along with this program; + * if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ package org.rhq.core.domain.resource.group;
import java.io.Serializable; + import javax.persistence.Column; -import javax.persistence.FetchType; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; import javax.persistence.MappedSuperclass; import javax.persistence.PrePersist; import javax.persistence.PreUpdate; + import org.jetbrains.annotations.NotNull; -import org.rhq.core.domain.auth.Subject;
/** * This is the abstract base class for groups containing either {@link org.rhq.core.domain.resource.Resource}s or groups @@ -58,16 +56,14 @@ public abstract class Group implements Serializable { @Column(name = "MTIME") private Long mtime;
- @JoinColumn(name = "MODIFIED_BY") - @ManyToOne(fetch = FetchType.LAZY) - private Subject modifiedBy; + @Column(name = "MODIFIED_BY") + private String modifiedBy;
/* no-arg constructor required by EJB spec */ protected Group() { }
- public Group(@NotNull - String name) { + public Group(@NotNull String name) { this.name = name; }
@@ -76,8 +72,7 @@ public abstract class Group implements Serializable { return name; }
- public void setName(@NotNull - String name) { + public void setName(@NotNull String name) { this.name = name; }
@@ -113,11 +108,11 @@ public abstract class Group implements Serializable { this.mtime = mtime; }
- public Subject getModifiedBy() { + public String getModifiedBy() { return modifiedBy; }
- public void setModifiedBy(Subject modifiedBy) { + public void setModifiedBy(String modifiedBy) { this.modifiedBy = modifiedBy; }
diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/group/ResourceGroupUIBean.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/group/ResourceGroupUIBean.java index e638691..cb15696 100644 --- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/group/ResourceGroupUIBean.java +++ b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/group/ResourceGroupUIBean.java @@ -114,7 +114,7 @@ public class ResourceGroupUIBean { return this.resourceGroup.getMtime(); }
- public Subject getModifiedBy() { + public String getModifiedBy() { return this.resourceGroup.getModifiedBy(); }
diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/resource/ResourceUIBean.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/resource/ResourceUIBean.java index bc62589..ecc1253 100644 --- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/resource/ResourceUIBean.java +++ b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/resource/ResourceUIBean.java @@ -25,21 +25,20 @@ import java.util.Set;
import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + import org.jboss.seam.ScopeType; import org.jboss.seam.annotations.Name; import org.jboss.seam.annotations.Scope; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable;
import org.rhq.core.domain.auth.Subject; import org.rhq.core.domain.authz.Permission; import org.rhq.core.domain.measurement.AvailabilityType; -import org.rhq.core.domain.measurement.DisplayType; import org.rhq.core.domain.measurement.MeasurementData; import org.rhq.core.domain.measurement.MeasurementDataTrait; import org.rhq.core.domain.resource.InventoryStatus; import org.rhq.core.domain.resource.Resource; -import org.rhq.core.domain.resource.ResourceCategory; import org.rhq.core.domain.resource.ResourceError; import org.rhq.core.domain.resource.ResourceErrorType; import org.rhq.core.domain.resource.ResourceType; @@ -51,7 +50,6 @@ import org.rhq.enterprise.gui.util.EnterpriseFacesContextUtility; import org.rhq.enterprise.server.authz.AuthorizationManagerLocal; import org.rhq.enterprise.server.measurement.AvailabilityManagerLocal; import org.rhq.enterprise.server.measurement.MeasurementDataManagerLocal; -import org.rhq.enterprise.server.measurement.util.MeasurementDataManagerUtility; import org.rhq.enterprise.server.perspective.PerspectiveManagerLocal; import org.rhq.enterprise.server.perspective.Tab; import org.rhq.enterprise.server.resource.ResourceManagerLocal; @@ -172,7 +170,7 @@ public class ResourceUIBean { return this.resource.getMtime(); }
- public Subject getModifiedBy() { + public String getModifiedBy() { return this.resource.getModifiedBy(); }
diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/GroupController.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/GroupController.java index 6f0e89d..63d64ce 100644 --- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/GroupController.java +++ b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/GroupController.java @@ -105,7 +105,7 @@ public abstract class GroupController extends BaseDispatchAction { GroupCategory category = group.getGroupCategory();
log.trace("finding most recent modifier for resource [" + groupId + "]"); - Subject modifier = group.getModifiedBy(); + String modifier = group.getModifiedBy();
// TODO: jmarques - how are we going to do control on ResourceGroups? boolean isControllable = LookupUtil.getOperationManager().isGroupOperationSupported(subject, group.getId()); diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/inventory/view.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/inventory/view.xhtml index 8e997ef..986c01d 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/inventory/view.xhtml +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/inventory/view.xhtml @@ -63,8 +63,7 @@ </h:panelGroup>
<h:panelGroup layout="block"> - <b>Last Modified By: </b> #{ResourceGroupUIBean.modifiedBy.firstName} #{ResourceGroupUIBean.modifiedBy.lastName} - (<a href="mailto:#{ResourceGroupUIBean.modifiedBy.emailAddress}">#{ResourceGroupUIBean.modifiedBy.name}</a>) + <b>Last Modified By: </b> #{ResourceGroupUIBean.modifiedBy} </h:panelGroup>
<h:panelGroup layout="block"> diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/discovery/DiscoveryBossBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/discovery/DiscoveryBossBean.java index 185562a..2773b4c 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/discovery/DiscoveryBossBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/discovery/DiscoveryBossBean.java @@ -370,7 +370,7 @@ public class DiscoveryBossBean implements DiscoveryBossLocal, DiscoveryBossRemot Resource parentResource = this.resourceManager.getResourceById(creator, resource.getParentResource() .getId()); resource.setAgent(parentResource.getAgent()); - resource.setModifiedBy(creator); + resource.setModifiedBy(creator.getName());
// Manually added resources are auto-committed. resource.setInventoryStatus(InventoryStatus.COMMITTED); @@ -746,7 +746,7 @@ public class DiscoveryBossBean implements DiscoveryBossLocal, DiscoveryBossRemot }
resource.setItime(System.currentTimeMillis()); - resource.setModifiedBy(subjectManager.getOverlord()); + resource.setModifiedBy(subjectManager.getOverlord().getName()); for (Resource childResource : resource.getChildResources()) { initAutoDiscoveredResource(childResource, resource); } diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerBean.java index e291c25..b2ed76e 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerBean.java @@ -162,7 +162,7 @@ public class ResourceGroupManagerBean implements ResourceGroupManagerLocal, Reso long time = System.currentTimeMillis(); group.setCtime(time); group.setMtime(time); - group.setModifiedBy(user); + group.setModifiedBy(user.getName());
entityManager.persist(group);
@@ -191,7 +191,7 @@ public class ResourceGroupManagerBean implements ResourceGroupManagerLocal, Reso
long time = System.currentTimeMillis(); group.setMtime(time); - group.setModifiedBy(user); + group.setModifiedBy(user.getName());
ResourceGroup newlyAttachedGroup = entityManager.merge(group); if (changeType == RecursivityChangeType.AddedRecursion) { @@ -341,13 +341,6 @@ public class ResourceGroupManagerBean implements ResourceGroupManagerLocal, Reso }
private void initLazyFields(ResourceGroup group) { - /* - * initialize modifiedBy field, which is now a lazily- loaded relationship to speed up the GroupHub stuff - */ - if (group.getModifiedBy() != null) { - group.getModifiedBy().getId(); - } - group.getAlertDefinitions().size(); }
@@ -1347,7 +1340,6 @@ public class ResourceGroupManagerBean implements ResourceGroupManagerLocal, Reso } else { composite = new ResourceGroupComposite(0L, 0.0, 0L, 0.0, group, facets); } - group.getModifiedBy().getFirstName();
return composite; } diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/DiscoveryTestBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/DiscoveryTestBean.java index 0a46d5a..709b95a 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/DiscoveryTestBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/DiscoveryTestBean.java @@ -257,7 +257,7 @@ public class DiscoveryTestBean implements DiscoveryTestLocal { platform.setAgent(this.coreTest.getTestAgent()); platform.setDescription("test platform created by " + this.getClass().getName()); platform.setLocation("San Pedro Sula, Honduras"); - platform.setModifiedBy(subjectManager.getOverlord()); + platform.setModifiedBy(subjectManager.getOverlord().getName());
//platform.addIP(createTestIp()); String serverName = "BogusServer "; @@ -273,7 +273,7 @@ public class DiscoveryTestBean implements DiscoveryTestLocal { Resource server = new Resource(installPath, name, getTestServerType()); server.setParentResource(platform); server.setDescription("test server created by " + this.getClass().getName()); - server.setModifiedBy(subjectManager.getOverlord()); + server.setModifiedBy(subjectManager.getOverlord().getName());
for (int i = 0; i < servicesPerServer; i++) { String childName = name + " child service " + i; @@ -286,7 +286,7 @@ public class DiscoveryTestBean implements DiscoveryTestLocal { private Resource createTestService(Resource parent, String name) { Resource service = new Resource(name, name, getTestServiceType()); service.setDescription("test service created by " + this.getClass().getName()); - service.setModifiedBy(subjectManager.getOverlord()); + service.setModifiedBy(subjectManager.getOverlord().getName()); return service; }
commit d0eb8c4ecb7efc470b6a562a388b6cd8549194cc Author: Ian Springer ian.springer@redhat.com Date: Mon Aug 9 15:30:54 2010 -0400
add index.html to portal-war that redirects to coregui war (forgot to include this in my commit last Friday); fix potential NPEs in JBossASTomcatConnectorComponent when one of the conn props has a null value
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/index.html b/modules/enterprise/gui/portal-war/src/main/webapp/index.html new file mode 100644 index 0000000..c6499a3 --- /dev/null +++ b/modules/enterprise/gui/portal-war/src/main/webapp/index.html @@ -0,0 +1,9 @@ +<html> + <head> + <meta http-equiv="Refresh" content="0; URL=/coregui/CoreGUI.html#Dashboard"/> + </head> + <body> + <p>Redirecting to <a href="/coregui/CoreGUI.html#Dashboard">coregui.war</a>...</p> + </body> +</html> + diff --git a/modules/plugins/jboss-as/src/main/java/org/rhq/plugins/jbossas/JBossASTomcatConnectorComponent.java b/modules/plugins/jboss-as/src/main/java/org/rhq/plugins/jbossas/JBossASTomcatConnectorComponent.java index 94788e7..0256469 100644 --- a/modules/plugins/jboss-as/src/main/java/org/rhq/plugins/jbossas/JBossASTomcatConnectorComponent.java +++ b/modules/plugins/jboss-as/src/main/java/org/rhq/plugins/jbossas/JBossASTomcatConnectorComponent.java @@ -1,6 +1,6 @@ /* * Jopr Management Platform - * Copyright (C) 2005-2008 Red Hat, Inc. + * Copyright (C) 2005-2010 Red Hat, Inc. * All rights reserved. * * This program is free software; you can redistribute it and/or modify @@ -36,7 +36,7 @@ import org.rhq.core.domain.measurement.MeasurementScheduleRequest; import org.rhq.plugins.jmx.MBeanResourceComponent;
/** - * JON plugin component for representing Tomcat connectors. Much of the functionality is left to the super class, + * RHQ plugin component for representing Tomcat connectors. Much of the functionality is left to the super class, * however the metrics required special handling. * * @author Jason Dobies @@ -113,18 +113,19 @@ public class JBossASTomcatConnectorComponent extends MBeanResourceComponent<JBos String theProperty = property;
Configuration pluginConfiguration = getResourceContext().getPluginConfiguration(); - String address = pluginConfiguration.getSimple(PROPERTY_ADDRESS).getStringValue(); - String port = pluginConfiguration.getSimple(PROPERTY_PORT).getStringValue(); - String schema = pluginConfiguration.getSimple(PROPERTY_SCHEMA).getStringValue(); - String dash = pluginConfiguration.getSimple(PROPERTY_DASH).getStringValue(); + String address = pluginConfiguration.getSimpleValue(PROPERTY_ADDRESS, ""); + String port = pluginConfiguration.getSimpleValue(PROPERTY_PORT, ""); + String schema = pluginConfiguration.getSimpleValue(PROPERTY_SCHEMA, ""); + String dash = pluginConfiguration.getSimpleValue(PROPERTY_DASH, "");
theProperty = theProperty.replace("%address%", address); theProperty = theProperty.replace("%port%", port); theProperty = theProperty.replace("%schema%", schema); theProperty = theProperty.replace("%dash%", dash);
- if (log.isDebugEnabled()) - log.debug("Finding metrics for: " + theProperty); + if (log.isDebugEnabled()) { + log.debug("Finding metrics for [" + theProperty + "]..."); + }
return theProperty; }
commit 0278a042c81c28a4ef19d86dcb2240870831b037 Merge: 9723759... 92ddd5c... Author: Ian Springer ian.springer@redhat.com Date: Mon Aug 9 10:43:39 2010 -0400
Merge branch 'master' of ssh://git.fedorahosted.org/git/rhq/rhq
commit 92ddd5c12dcae2e15ec901a6ce2451d231cd0ae7 Author: Joseph Marques joseph@redhat.com Date: Sun Aug 8 20:41:10 2010 -0400
rename one of the locateProperty methods because they both have the same type erasure
diff --git a/modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/WsConfigurationManagerTest.java b/modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/WsConfigurationManagerTest.java index 0ee5348..53b9c5f 100644 --- a/modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/WsConfigurationManagerTest.java +++ b/modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/WsConfigurationManagerTest.java @@ -134,7 +134,7 @@ public class WsConfigurationManagerTest extends AssertJUnit implements TestPrope return located; }
- private PropertySimple locateProperty(List<PropertySimple> properties, String name) { + private PropertySimple locatePropertySimple(List<PropertySimple> properties, String name) { PropertySimple located = null; if ((properties != null) && (name != null) && (name.trim().length() > 0)) { // List<Entry> list = properties.getEntry(); @@ -150,7 +150,7 @@ public class WsConfigurationManagerTest extends AssertJUnit implements TestPrope }
private PropertySimple getSimple(List<PropertySimple> list, String name) { - Property property = locateProperty(list, name); + Property property = locatePropertySimple(list, name); return (PropertySimple) property; }
commit 66ebfe1fab70d87284d58c0fbe1f05df287b004a Author: Joseph Marques joseph@redhat.com Date: Sun Aug 8 20:36:02 2010 -0400
add newly exposed AlertDefinitionManager remote methods to the WebservicesManagerBean
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/webservices/WebservicesManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/webservices/WebservicesManagerBean.java index c188ffe..e5f2802 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/webservices/WebservicesManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/webservices/WebservicesManagerBean.java @@ -213,6 +213,18 @@ public class WebservicesManagerBean implements WebservicesRemote { return alertDefinitionManager.findAlertDefinitionsByCriteria(subject, criteria); }
+ public int enableAlertDefinitions(Subject subject, Integer[] alertDefinitionIds) { + return alertDefinitionManager.enableAlertDefinitions(subject, alertDefinitionIds); + } + + public int disableAlertDefinitions(Subject subject, Integer[] alertDefinitionIds) { + return alertDefinitionManager.disableAlertDefinitions(subject, alertDefinitionIds); + } + + public int removeAlertDefinitions(Subject subject, Integer[] alertDefinitionIds) { + return alertDefinitionManager.removeAlertDefinitions(subject, alertDefinitionIds); + } + //ALERTDEFINITIONMANAGER: END ----------------------------------
//AVAILABILITYMANAGER: BEGIN ----------------------------------
commit f4cb54aecbdbd4f25ad2326f072a04eb6ccc5092 Author: Joseph Marques joseph@redhat.com Date: Sun Aug 8 18:11:57 2010 -0400
only find enabled alert definitions by default
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/AlertDefinitionCriteria.java b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/AlertDefinitionCriteria.java index 8eb7efd..9ddf148 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/AlertDefinitionCriteria.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/AlertDefinitionCriteria.java @@ -53,7 +53,7 @@ public class AlertDefinitionCriteria extends Criteria { private List<Integer> filterResourceGroupIds; // requires overrides private Boolean filterEnabled; private String filterOperationName; // requires overrides - private Boolean filterDeleted; + private Boolean filterDeleted = false; // find enabled definitions by default
private boolean fetchAlerts; private boolean fetchConditions;
commit 9363b498345b7977798274b27637f8a360f4675d Author: Joseph Marques joseph@redhat.com Date: Sun Aug 8 18:02:10 2010 -0400
move existing enable/disable/delete methods to remote API for AlertDefinitionManager
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/AlertDefinitionManagerLocal.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/AlertDefinitionManagerLocal.java index ec64487..6908301 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/AlertDefinitionManagerLocal.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/AlertDefinitionManagerLocal.java @@ -47,10 +47,6 @@ public interface AlertDefinitionManagerLocal { int createAlertDefinition(Subject subject, AlertDefinition alertDefinition, Integer resourceId) throws InvalidAlertDefinitionException;
- int removeAlertDefinitions(Subject subject, Integer[] alertDefinitionIds); - - int enableAlertDefinitions(Subject subject, Integer[] alertDefinitionIds); - boolean isEnabled(Integer definitionId);
boolean isTemplate(Integer definitionId); @@ -59,8 +55,6 @@ public interface AlertDefinitionManagerLocal {
boolean isResourceAlertDefinition(Integer definitionId);
- int disableAlertDefinitions(Subject subject, Integer[] alertDefinitionIds); - List<AlertDefinition> findAllRecoveryDefinitionsById(Subject subject, Integer alertDefinitionId);
void copyAlertDefinitions(Subject subject, Integer[] alertDefinitionIds); @@ -81,4 +75,10 @@ public interface AlertDefinitionManagerLocal { AlertDefinition getAlertDefinition(Subject subject, int alertDefinitionId);
PageList<AlertDefinition> findAlertDefinitionsByCriteria(Subject subject, AlertDefinitionCriteria criteria); + + int enableAlertDefinitions(Subject subject, Integer[] alertDefinitionIds); + + int disableAlertDefinitions(Subject subject, Integer[] alertDefinitionIds); + + int removeAlertDefinitions(Subject subject, Integer[] alertDefinitionIds); } \ No newline at end of file diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/AlertDefinitionManagerRemote.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/AlertDefinitionManagerRemote.java index b47a4ef..3ed890b 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/AlertDefinitionManagerRemote.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/AlertDefinitionManagerRemote.java @@ -44,4 +44,19 @@ public interface AlertDefinitionManagerRemote { @WebParam(name = "subject") Subject subject, // @WebParam(name = "criteria") AlertDefinitionCriteria criteria);
+ @WebMethod + int enableAlertDefinitions(// + @WebParam(name = "subject") Subject subject, // + @WebParam(name = "alertDefinitionIds") Integer[] alertDefinitionIds); + + @WebMethod + int disableAlertDefinitions(// + @WebParam(name = "subject") Subject subject, // + @WebParam(name = "alertDefinitionIds") Integer[] alertDefinitionIds); + + @WebMethod + int removeAlertDefinitions(// + @WebParam(name = "subject") Subject subject, // + @WebParam(name = "alertDefinitionIds") Integer[] alertDefinitionIds); + }
commit f99b214e185bab099b59590fe03ee7e04bd95693 Author: Jay Shaughnessy jshaughn@redhat.com Date: Sat Aug 7 00:12:21 2010 -0400
[BZ-610859] Fix issue in AS5 plugin discovery component that initializes the log event source with the wrong name. When adding a second log event source it introduces the name mismatch.
diff --git a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ApplicationServerDiscoveryComponent.java b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ApplicationServerDiscoveryComponent.java index 5068f2d..94cad13 100644 --- a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ApplicationServerDiscoveryComponent.java +++ b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ApplicationServerDiscoveryComponent.java @@ -32,18 +32,20 @@ import java.net.URL; import java.net.UnknownHostException; 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.Properties; import java.util.Set; -import java.util.HashMap; -import java.util.Map;
import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.maven.artifact.versioning.ComparableVersion; -import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import org.jboss.on.common.jbossas.JBossASDiscoveryUtils;
import org.rhq.core.domain.configuration.Configuration; import org.rhq.core.domain.configuration.PropertyList; @@ -53,20 +55,18 @@ import org.rhq.core.pluginapi.event.log.LogFileEventResourceComponentHelper; import org.rhq.core.pluginapi.inventory.ClassLoaderFacet; import org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails; import org.rhq.core.pluginapi.inventory.InvalidPluginConfigurationException; +import org.rhq.core.pluginapi.inventory.ManualAddFacet; import org.rhq.core.pluginapi.inventory.ProcessScanResult; import org.rhq.core.pluginapi.inventory.ResourceDiscoveryComponent; import org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext; -import org.rhq.core.pluginapi.inventory.ManualAddFacet; import org.rhq.core.pluginapi.util.FileUtils; import org.rhq.core.system.ProcessInfo; import org.rhq.plugins.jbossas5.helper.JBossInstallationInfo; import org.rhq.plugins.jbossas5.helper.JBossInstanceInfo; -import org.rhq.plugins.jbossas5.helper.JBossProperties; import org.rhq.plugins.jbossas5.helper.JBossProductType; +import org.rhq.plugins.jbossas5.helper.JBossProperties; import org.rhq.plugins.jbossas5.util.JnpConfig;
-import org.jboss.on.common.jbossas.JBossASDiscoveryUtils; - /** * A Resource discovery component for JBoss AS Server Resources, which include the following: * @@ -79,7 +79,7 @@ import org.jboss.on.common.jbossas.JBossASDiscoveryUtils; * @author Mark Spritzler */ public class ApplicationServerDiscoveryComponent implements ResourceDiscoveryComponent, ClassLoaderFacet, - ManualAddFacet { + ManualAddFacet { private static final String CHANGE_ME = "***CHANGE_ME***"; private static final String JBOSS_SERVICE_XML = "conf" + File.separator + "jboss-service.xml"; private static final String JBOSS_NAMING_SERVICE_XML = "deploy" + File.separator + "naming-service.xml"; @@ -98,14 +98,9 @@ public class ApplicationServerDiscoveryComponent implements ResourceDiscoveryCom private static final List<String> CLIENT_JARS = Arrays.asList( // NOTE: The jbossall-client.jar aggregates a whole bunch of other jars from the client dir via its // MANIFEST.MF Class-Path. - "client/jbossall-client.jar", - "client/trove.jar", - "client/javassist.jar", - "common/lib/jboss-security-aspects.jar", - "lib/jboss-managed.jar", - "lib/jboss-metatype.jar", - "lib/jboss-dependency.jar" - ); + "client/jbossall-client.jar", "client/trove.jar", "client/javassist.jar", + "common/lib/jboss-security-aspects.jar", "lib/jboss-managed.jar", "lib/jboss-metatype.jar", + "lib/jboss-dependency.jar");
private static final List<String> AS6_CLIENT_JARS = new ArrayList<String>(CLIENT_JARS); static { @@ -132,8 +127,7 @@ public class ApplicationServerDiscoveryComponent implements ResourceDiscoveryCom }
public DiscoveredResourceDetails discoverResource(Configuration pluginConfig, - ResourceDiscoveryContext discoveryContext) - throws InvalidPluginConfigurationException { + ResourceDiscoveryContext discoveryContext) throws InvalidPluginConfigurationException { // Set default values on any props that are not set. //setPluginConfigurationDefaults(pluginConfiguration);
@@ -152,10 +146,11 @@ public class ApplicationServerDiscoveryComponent implements ResourceDiscoveryCom }
@SuppressWarnings("unchecked") - public List<URL> getAdditionalClasspathUrls(ResourceDiscoveryContext context, DiscoveredResourceDetails details) - throws Exception { + public List<URL> getAdditionalClasspathUrls(ResourceDiscoveryContext context, DiscoveredResourceDetails details) + throws Exception { Configuration pluginConfig = details.getPluginConfiguration(); - String homeDir = pluginConfig.getSimple(ApplicationServerPluginConfigurationProperties.HOME_DIR).getStringValue(); + String homeDir = pluginConfig.getSimple(ApplicationServerPluginConfigurationProperties.HOME_DIR) + .getStringValue();
List<URL> clientJars = new ArrayList<URL>();
@@ -236,8 +231,8 @@ public class ApplicationServerDiscoveryComponent implements ResourceDiscoveryCom jnpURL)); pluginConfiguration.put(new PropertySimple(ApplicationServerPluginConfigurationProperties.HOME_DIR, installHome.getAbsolutePath())); - pluginConfiguration.put(new PropertySimple( - ApplicationServerPluginConfigurationProperties.SERVER_HOME_DIR, configDir)); + pluginConfiguration.put(new PropertySimple(ApplicationServerPluginConfigurationProperties.SERVER_HOME_DIR, + configDir));
// Set the optional props... pluginConfiguration.put(new PropertySimple(ApplicationServerPluginConfigurationProperties.SERVER_NAME, @@ -247,19 +242,17 @@ public class ApplicationServerDiscoveryComponent implements ResourceDiscoveryCom
JBossASDiscoveryUtils.UserInfo userInfo = JBossASDiscoveryUtils.getJmxInvokerUserInfo(configDir); if (userInfo != null) { - pluginConfiguration.put( - new PropertySimple(ApplicationServerPluginConfigurationProperties.PRINCIPAL, - userInfo.getUsername())); - pluginConfiguration.put( - new PropertySimple(ApplicationServerPluginConfigurationProperties.CREDENTIALS, - userInfo.getPassword())); + pluginConfiguration.put(new PropertySimple(ApplicationServerPluginConfigurationProperties.PRINCIPAL, + userInfo.getUsername())); + pluginConfiguration.put(new PropertySimple(ApplicationServerPluginConfigurationProperties.CREDENTIALS, + userInfo.getPassword())); }
String javaHome = processInfo.getEnvironmentVariable(JAVA_HOME_ENV_VAR); if (javaHome == null && log.isDebugEnabled()) { log.warn("Unable to determine the JAVA_HOME environment variable for the JBoss AS process - " + " the Agent is probably running as a user that does not have access to the AS process's " - + " environment."); + + " environment."); } pluginConfiguration.put(new PropertySimple(ApplicationServerPluginConfigurationProperties.JAVA_HOME, javaHome)); @@ -281,15 +274,17 @@ public class ApplicationServerDiscoveryComponent implements ResourceDiscoveryCom try { return new InProcessJBossASDiscovery().discoverInProcessJBossAS(discoveryContext); } catch (Throwable t) { - log.debug("In-process JBoss AS discovery failed - we are probably not running embedded within JBoss AS.", t); + log + .debug("In-process JBoss AS discovery failed - we are probably not running embedded within JBoss AS.", + t); return null; } }
private DiscoveredResourceDetails createResourceDetails(ResourceDiscoveryContext discoveryContext, Configuration pluginConfig, @Nullable ProcessInfo processInfo, JBossInstallationInfo installInfo) { - String serverHomeDir = pluginConfig.getSimple( - ApplicationServerPluginConfigurationProperties.SERVER_HOME_DIR).getStringValue(); + String serverHomeDir = pluginConfig.getSimple(ApplicationServerPluginConfigurationProperties.SERVER_HOME_DIR) + .getStringValue(); File absoluteConfigPath = resolvePathRelativeToHomeDir(pluginConfig, serverHomeDir);
// Canonicalize the config path, so it's consistent no matter how it's entered. @@ -298,8 +293,8 @@ public class ApplicationServerDiscoveryComponent implements ResourceDiscoveryCom // JON: fix for JBNADM-2634 - do not resolve symlinks (ips, 12/18/07) String key = FileUtils.getCanonicalPath(absoluteConfigPath.getPath());
- String bindAddress = pluginConfig.getSimple( - ApplicationServerPluginConfigurationProperties.BIND_ADDRESS).getStringValue(); + String bindAddress = pluginConfig.getSimple(ApplicationServerPluginConfigurationProperties.BIND_ADDRESS) + .getStringValue(); String namingUrl = pluginConfig.getSimple(ApplicationServerPluginConfigurationProperties.NAMING_URL) .getStringValue();
@@ -316,7 +311,7 @@ public class ApplicationServerDiscoveryComponent implements ResourceDiscoveryCom
String description = installInfo.getProductType().DESCRIPTION; File deployDir = new File(absoluteConfigPath, "deploy"); - + File rhqInstallerWar = new File(deployDir, "rhq-installer.war"); File rhqInstallerWarUndeployed = new File(deployDir, "rhq-installer.war.rej"); boolean isRhqServer = rhqInstallerWar.exists() || rhqInstallerWarUndeployed.exists(); @@ -325,13 +320,15 @@ public class ApplicationServerDiscoveryComponent implements ResourceDiscoveryCom // We know this is an RHQ Server. Let's add an event source for its server log file, but disable it by default. configureEventSourceForServerLogFile(pluginConfig); } - String name = formatServerName(bindAddress, namingPort, discoveryContext.getSystemInformation().getHostname(), absoluteConfigPath.getName(), isRhqServer); + String name = formatServerName(bindAddress, namingPort, discoveryContext.getSystemInformation().getHostname(), + absoluteConfigPath.getName(), isRhqServer);
return new DiscoveredResourceDetails(discoveryContext.getResourceType(), key, name, installInfo.getVersion(), description, pluginConfig, processInfo); }
- public String formatServerName(String bindingAddress, String jnpPort, String hostname, String configurationName, boolean isRhq) { + public String formatServerName(String bindingAddress, String jnpPort, String hostname, String configurationName, + boolean isRhq) {
if (isRhq) { return hostname + " RHQ Server"; @@ -359,12 +356,12 @@ public class ApplicationServerDiscoveryComponent implements ResourceDiscoveryCom return hostnameToUse + " " + configurationName; } } - + private void configureEventSourceForServerLogFile(Configuration pluginConfig) { File rhqLogFile = resolvePathRelativeToHomeDir(pluginConfig, "../logs/rhq-server-log4j.log"); if (rhqLogFile.exists() && !rhqLogFile.isDirectory()) { try { - PropertyMap serverLogEventSource = new PropertyMap("serverLog"); + PropertyMap serverLogEventSource = new PropertyMap("logEventSource"); serverLogEventSource.put(new PropertySimple( LogFileEventResourceComponentHelper.LogEventSourcePropertyNames.LOG_FILE_PATH, rhqLogFile .getCanonicalPath())); @@ -426,7 +423,7 @@ public class ApplicationServerDiscoveryComponent implements ResourceDiscoveryCom File logDir = new File(configDir, "log"); File serverLogFile = new File(logDir, "server.log"); if (serverLogFile.exists() && !serverLogFile.isDirectory()) { - PropertyMap serverLogEventSource = new PropertyMap("serverLog"); + PropertyMap serverLogEventSource = new PropertyMap("logEventSource"); serverLogEventSource.put(new PropertySimple( LogFileEventResourceComponentHelper.LogEventSourcePropertyNames.LOG_FILE_PATH, serverLogFile)); serverLogEventSource.put(new PropertySimple( @@ -445,7 +442,7 @@ public class ApplicationServerDiscoveryComponent implements ResourceDiscoveryCom boolean supported = (version.compareTo(minimumVersion) >= 0); if (!supported) { log.debug(productType + " version " + version + " is not supported by this plugin (minimum " + productType - + " version is " + minimumVersion + ") - skipping..."); + + " version is " + minimumVersion + ") - skipping..."); } return supported; } @@ -454,7 +451,8 @@ public class ApplicationServerDiscoveryComponent implements ResourceDiscoveryCom private static File resolvePathRelativeToHomeDir(Configuration pluginConfig, @NotNull String path) { File configDir = new File(path); if (!configDir.isAbsolute()) { - String homeDir = pluginConfig.getSimple(ApplicationServerPluginConfigurationProperties.HOME_DIR).getStringValue(); + String homeDir = pluginConfig.getSimple(ApplicationServerPluginConfigurationProperties.HOME_DIR) + .getStringValue(); configDir = new File(homeDir, path); } return configDir;
commit e964a36a6766596718d0317631a5342688533ae4 Author: Jay Shaughnessy jshaughn@redhat.com Date: Sat Aug 7 00:10:24 2010 -0400
up the mc4j version
diff --git a/.classpath b/.classpath index 35714ec..dc15df6 100644 --- a/.classpath +++ b/.classpath @@ -202,7 +202,7 @@ <classpathentry exported="true" kind="var" path="M2_REPO/javax/faces/jsf-impl/1.2_14/jsf-impl-1.2_14.jar" sourcepath="/M2_REPO/javax/faces/jsf-impl/1.2_14/jsf-impl-1.2_14-sources.jar"/> <classpathentry exported="true" kind="var" path="M2_REPO/javax/el/el-api/1.0/el-api-1.0.jar"/> <classpathentry exported="true" kind="var" path="M2_REPO/com/sun/facelets/jsf-facelets/1.1.15.B1/jsf-facelets-1.1.15.B1.jar" sourcepath="/M2_REPO/com/sun/facelets/jsf-facelets/1.1.15.B1/jsf-facelets-1.1.15.B1-sources.jar"/> - <classpathentry exported="true" kind="var" path="M2_REPO/mc4j/org-mc4j-ems/1.2.13/org-mc4j-ems-1.2.13.jar" sourcepath="/M2_REPO/mc4j/org-mc4j-ems/1.2.13/org-mc4j-ems-1.2.13-sources.jar"/> + <classpathentry exported="true" kind="var" path="M2_REPO/mc4j/org-mc4j-ems/1.2.14/org-mc4j-ems-1.2.14.jar" sourcepath="/M2_REPO/mc4j/org-mc4j-ems/1.2.13/org-mc4j-ems-1.2.13-sources.jar"/> <classpathentry exported="true" kind="var" path="M2_REPO/org/opensymphony/quartz/quartz/1.6.5/quartz-1.6.5.jar" sourcepath="/M2_REPO/org/opensymphony/quartz/quartz/1.6.5/quartz-1.6.5-sources.jar"/> <classpathentry exported="true" kind="var" path="M2_REPO/javax/mail/mail/1.4.2/mail-1.4.2.jar"/> <classpathentry exported="true" kind="var" path="M2_REPO/commons-fileupload/commons-fileupload/1.2/commons-fileupload-1.2.jar"/>
commit c08cbb09014fa0ea01fed9d528d5a5e60c573152 Author: John Mazzitelli mazz@redhat.com Date: Fri Aug 6 17:19:40 2010 -0400
log more information about the bad property so when this happens its easier to trace down where the problem was caused
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/configuration/PropertyList.java b/modules/core/domain/src/main/java/org/rhq/core/domain/configuration/PropertyList.java index 0719c61..ce51bcc 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/configuration/PropertyList.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/configuration/PropertyList.java @@ -146,7 +146,8 @@ public class PropertyList extends Property { }
if (!property.getName().equals(this.memberPropertyName)) { - throw new IllegalStateException("All properties in a PropertyList must have the same name."); + throw new IllegalStateException("All properties in a PropertyList (id=[" + getId() + "], name=[" + getName() + + "]) must have the same name: [" + property.getName() + "] != [" + this.memberPropertyName + "]"); }
getList().add(property);
commit ca6a1a9e6c921dc1bade752bfe3f417377621695 Merge: 5b29f99... 187c15f... Author: Heiko W. Rupp hwr@redhat.com Date: Fri Aug 6 18:56:31 2010 +0200
Merge branch 'master' of ssh://git.fedorahosted.org/git/rhq/rhq
commit 5b29f99f39c53f46cbbc9069f821847cb8f4becd Author: Heiko W. Rupp hwr@redhat.com Date: Fri Aug 6 18:53:57 2010 +0200
BZ-618214 Copy the system wide snmp preferences for fresh migrations of pre RHQ 3 systems to RHQ 3+
diff --git a/modules/core/dbutils/pom.xml b/modules/core/dbutils/pom.xml index 09703ee..3e129f3 100644 --- a/modules/core/dbutils/pom.xml +++ b/modules/core/dbutils/pom.xml @@ -45,6 +45,7 @@ <dependency> <groupId>i18nlog</groupId> <artifactId>i18nlog</artifactId> + <version>${i18nlog.version}</version> </dependency>
<dependency> diff --git a/modules/core/dbutils/src/main/java/org/rhq/core/db/upgrade/CustomAlertSenderUpgradeTask.java b/modules/core/dbutils/src/main/java/org/rhq/core/db/upgrade/CustomAlertSenderUpgradeTask.java index 7ddfad2..89ae85a 100644 --- a/modules/core/dbutils/src/main/java/org/rhq/core/db/upgrade/CustomAlertSenderUpgradeTask.java +++ b/modules/core/dbutils/src/main/java/org/rhq/core/db/upgrade/CustomAlertSenderUpgradeTask.java @@ -71,6 +71,8 @@ public class CustomAlertSenderUpgradeTask implements DatabaseUpgradeTask { upgradeEmailNotifications(); upgradeSNMPNotifications(); upgradeOperationNotifications(); + + upgradeSNMPPreferences(); }
private void upgradeSubjectNotificationLogs() throws SQLException { @@ -281,6 +283,103 @@ public class CustomAlertSenderUpgradeTask implements DatabaseUpgradeTask { } }
+ /** + * Copy the system wide snmp preferences. This happens only on + * a fresh migration from pre RHQ3 and only if the user has + * actually changed the provided defaults. + */ + private void upgradeSNMPPreferences() throws SQLException { + String oldPrefsSQL = "" // + + " SELECT property_key,property_value" + + " FROM RHQ_SYSTEM_CONFIG" + + " WHERE property_key LIKE 'SNMP%'"; + + String[] keyToProp = { // + "SNMP_AGENT_ADDRESS","agentAddress", // + "SNMP_AUTH_PASSPHRASE","authPassphrase", // + "SNMP_AUTH_PROTOCOL","authProtocol", // + "SNMP_COMMUNITY","community",// + "SNMP_CONTEXT_NAME","targetContext",// + "SNMP_ENGINE_ID","engineId",// + "SNMP_ENTERPRISE_OID","enterpriseOid",// + "SNMP_GENERIC_ID","genericId",// + "SNMP_PRIVACY_PROTOCOL","privacyProtocol",// + "SNMP_PRIV_PASSPHRASE","privacyPassphrase",// + "SNMP_SECURITY_NAME","securityName",// + "SNMP_SPECIFIC_ID","specificId",// + "SNMP_TRAP_OID","trapOid",// + "SNMP_VERSION","snmpVersion" + }; + + /* + * Check if there is already a config present. + * Only run the copy on a fresh upgrade from a pre RHQ 3 version. + */ + int configId = getPluginConfigurationId("alert-snmp"); + if (configId!=0) { + System.out.println("Already found a snmp configuration, not copying the old one over."); + return; + } + + // Get the properties from the database + List<Object[]> data = databaseType.executeSelectSql(connection, oldPrefsSQL); + + // check if the user actually did set up the snmp settings in the older version + // If not, don't bother, as the plugin will set up its defaults later on. + for (Object[] next : data) { + String key = (String) next[0]; + if (key.equals("SNMP_VERSION")) { + String val = (String) next[1]; + if (val==null || val.equals("")) { + System.out.println("No SNMP config set in old db version, so not copying"); + return; + } + } + } + + // We have work to do ... + configId = databaseType.getNextSequenceValue(connection, "rhq_config", "id"); + String insertConfigSQL = getInsertConfigSQL(configId); + databaseType.executeSql(connection, insertConfigSQL); + + for (Object[] next : data) { + // find property + String propertyName = null; + for (int i = 0 ; i< keyToProp.length ; i++) { + if (keyToProp[i].equals(next[0])) { + propertyName = keyToProp[i+1]; + break; + } + } + if (propertyName==null) { + System.err.println("Input property " + next[0] + " is not encoded"); + System.err.println("Not copying the SNMP preferences"); + + } + + String propertyValue = (String) next[1]; + + int propertyId = databaseType.getNextSequenceValue(connection, "rhq_config_property", "id"); + String insertPropertySQL = getInsertPropertySQL(propertyId, configId, propertyName, propertyValue); + databaseType.executeSql(connection, insertPropertySQL); + } + } + + int getPluginConfigurationId(String pluginName) throws SQLException { + String getConfigIdSQL = "" // + + " SELECT plugin_config_id " // + + " FROM rhq_plugin" // + + " WHERE name = '" + pluginName + "'"; + List<Object[]> data = databaseType.executeSelectSql(connection, getConfigIdSQL); + + if (data==null || data.size()==0) + return 0; + Object[] idos = data.get(0); + return (Integer)idos[0]; + + } + + private void persist(List<Object[]> data, String propertyName, String sender, String delimiter, boolean bufferWithDelimiter) throws SQLException { int definitionId = -1;
commit 187c15f60aca609f18587382665d060de15a8492 Author: John Mazzitelli mazz@redhat.com Date: Fri Aug 6 03:01:09 2010 -0400
opps, I swapped agent and server addresses by mistake.
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/install/remote/SSHInstallUtility.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/install/remote/SSHInstallUtility.java index 2cc16b6..dd017ab 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/install/remote/SSHInstallUtility.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/install/remote/SSHInstallUtility.java @@ -132,8 +132,8 @@ public class SSHInstallUtility { public AgentInstallInfo installAgent(String parentPath) {
String serverAddress = LookupUtil.getServerManager().getServer().getAddress(); - AgentInstallInfo info = new AgentInstallInfo(parentPath, accessInfo.getUser(), agentVersion, accessInfo - .getHost(), serverAddress); + AgentInstallInfo info = new AgentInstallInfo(parentPath, accessInfo.getUser(), agentVersion, serverAddress, + accessInfo.getHost());
executeCommand("uname -a", "Machine uname", info); executeCommand("java -version", "Java Version Check", info);
commit ea0888854eff323615fe3b9c81efacce49b9c8f9 Author: John Mazzitelli mazz@redhat.com Date: Fri Aug 6 00:53:03 2010 -0400
finish up the remote agent install UI. error messages aren't ideal and can use improvement
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/install/remote/AgentInstallInfo.java b/modules/core/domain/src/main/java/org/rhq/core/domain/install/remote/AgentInstallInfo.java index 055b5f4..5326eaa 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/install/remote/AgentInstallInfo.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/install/remote/AgentInstallInfo.java @@ -49,18 +49,14 @@ public class AgentInstallInfo implements Serializable { public static final int DEFAULT_AGENT_PORT = 16163;
public AgentInstallInfo() { - this(null, null); }
- public AgentInstallInfo(String serverAddress, String agentAddress) { - this.serverAddress = serverAddress; - this.agentAddress = agentAddress; - } - - public AgentInstallInfo(String path, String owner, String version) { + public AgentInstallInfo(String path, String owner, String version, String serverAddress, String agentAddress) { this.path = path; this.owner = owner; this.version = version; + this.serverAddress = serverAddress; + this.agentAddress = agentAddress; }
public String getPath() { @@ -87,6 +83,22 @@ public class AgentInstallInfo implements Serializable { this.version = version; }
+ public String getServerAddress() { + return serverAddress; + } + + public void setServerAddress(String serverAddress) { + this.serverAddress = serverAddress; + } + + public String getAgentAddress() { + return agentAddress; + } + + public void setAgentAddress(String agentAddress) { + this.agentAddress = agentAddress; + } + public void addStep(AgentInstallStep step) { steps.add(step); } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/agent/install/RemoteAgentInstallView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/agent/install/RemoteAgentInstallView.java index 621771f..926fa49 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/agent/install/RemoteAgentInstallView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/agent/install/RemoteAgentInstallView.java @@ -25,11 +25,11 @@ package org.rhq.enterprise.gui.coregui.client.admin.agent.install; import java.util.ArrayList;
import com.google.gwt.user.client.rpc.AsyncCallback; -import com.smartgwt.client.types.Autofit; import com.smartgwt.client.types.ExpansionMode; import com.smartgwt.client.widgets.Canvas; import com.smartgwt.client.widgets.form.DynamicForm; import com.smartgwt.client.widgets.form.fields.ButtonItem; +import com.smartgwt.client.widgets.form.fields.CanvasItem; import com.smartgwt.client.widgets.form.fields.HeaderItem; import com.smartgwt.client.widgets.form.fields.PasswordItem; import com.smartgwt.client.widgets.form.fields.SpacerItem; @@ -59,11 +59,17 @@ public class RemoteAgentInstallView extends VLayout {
private RemoteInstallGWTServiceAsync remoteInstallService = GWTServiceLookup.getRemoteInstallService();
- private DynamicForm form; + private DynamicForm connectionForm; + private DynamicForm buttonsForm; + private ButtonItem installButton; + private ButtonItem startButton; + private ButtonItem stopButton; private VLayout agentInfoLayout;
public RemoteAgentInstallView() { - setMembersMargin(10); + setMembersMargin(1); + setWidth100(); + setHeight100(); }
@Override @@ -71,152 +77,275 @@ public class RemoteAgentInstallView extends VLayout { super.onInit();
addMember(getConnectionForm()); + addMember(getButtons());
agentInfoLayout = new VLayout(); agentInfoLayout.setWidth100(); + agentInfoLayout.setHeight100(); + agentInfoLayout.setMembersMargin(1); addMember(agentInfoLayout);
}
- DynamicForm getConnectionForm() { - - form = new DynamicForm(); - form.setWidth100(); + private DynamicForm getConnectionForm() { + connectionForm = new DynamicForm(); + connectionForm.setWidth100(); + connectionForm.setNumCols(3); + connectionForm.setWrapItemTitles(false); + connectionForm.setColWidths("25%", "50%", "25%"); + connectionForm.setMargin(20);
HeaderItem connectionHeader = new HeaderItem(); connectionHeader.setValue("Connection Information");
TextItem host = new TextItem("host", "Hostname"); host.setRequired(true); + host.setWidth("100%"); + host.setPrompt("The host where the agent is or will be installed"); + host.setColSpan(2); + + TextItem port = new TextItem("port", "Port"); + port.setRequired(false); + port.setWidth("90"); + port.setPrompt("The port the SSH server is listening to. If not specified, the default is 22"); + port.setColSpan(1);
TextItem username = new TextItem("username", "Username"); username.setRequired(true); + username.setWidth("100%"); + username.setPrompt("The name of the user whose credentials are passed to the host via SSH"); + username.setColSpan(2);
PasswordItem password = new PasswordItem("password", "Password"); - // password.setRequired(true); + password.setRequired(false); + password.setWidth("100%"); + password.setPrompt("The credentials that are used to authenticate the user on the host via SSH"); + password.setColSpan(2);
TextItem agentInstallPath = new TextItem("agentInstallPath", "Agent Install Path"); agentInstallPath.setRequired(true); + agentInstallPath.setWidth("100%"); + agentInstallPath + .setPrompt("Where the agent is or will be installed. If you aren't sure where an agent is installed, enter a parent directory and click the 'Find Agent' button to scan that directory and below. If you enter an empty path, common locations are searched on the host for an agent install."); + agentInstallPath.setStartRow(true); + agentInstallPath.setEndRow(false); + + ButtonItem findAgentInstallPathButton = new ButtonItem("findAgentInstallPathButton", "Find Agent"); + findAgentInstallPathButton.setStartRow(false); + findAgentInstallPathButton.setEndRow(true); + findAgentInstallPathButton.addClickHandler(new ClickHandler() { + public void onClick(ClickEvent clickEvent) { + if (connectionForm.validate()) { + findAgentInstallPath(); + } + } + });
- ButtonItem statusCheck = new ButtonItem("updateStatus", "Update Status"); - - final StaticTextItem agentStatus = new StaticTextItem("agentStatus", "Agent Status"); + StaticTextItem agentStatus = new StaticTextItem("agentStatus", "Agent Status"); + agentStatus.setDefaultValue("-Click Update Status Button-"); agentStatus.setRedrawOnChange(true); - - statusCheck.addClickHandler(new ClickHandler() { + agentStatus.setRedrawOnChange(true); + agentStatus.setWidth("100%"); + agentStatus.setStartRow(true); + agentStatus.setEndRow(false); + + ButtonItem statusCheckButton = new ButtonItem("updateStatus", "Update Status"); + statusCheckButton.setStartRow(false); + statusCheckButton.setEndRow(true); + statusCheckButton.addClickHandler(new ClickHandler() { public void onClick(ClickEvent clickEvent) { - if (form.validate()) { + if (connectionForm.validate()) { agentStatusCheck(); } } });
- ButtonItem startButton = new ButtonItem("start", "Start Agent"); + connectionForm.setFields(connectionHeader, host, port, username, password, agentInstallPath, + findAgentInstallPathButton, agentStatus, statusCheckButton); + + return connectionForm; + } + + private DynamicForm getButtons() { + buttonsForm = new DynamicForm(); + buttonsForm.setWidth("75%"); + buttonsForm.setNumCols(4); + buttonsForm.setMargin(20); + buttonsForm.setColWidths("10%", "30%", "30%", "30%"); + + HeaderItem buttonsHeader = new HeaderItem(); + buttonsHeader.setValue("Operations"); + + SpacerItem spacerItem = new SpacerItem(); + spacerItem.setStartRow(true); + spacerItem.setEndRow(false); + + installButton = new ButtonItem("install", "Install Agent"); + installButton.setStartRow(false); + installButton.setEndRow(false); + installButton.setRedrawOnChange(true); + installButton.addClickHandler(new ClickHandler() { + public void onClick(ClickEvent clickEvent) { + if (connectionForm.validate()) { + installAgent(); + } + } + }); + + startButton = new ButtonItem("start", "Start Agent"); + startButton.setStartRow(false); startButton.setEndRow(false); - // startButton.setShowIfCondition(new FormItemIfFunction() { - // public boolean execute(FormItem formItem, Object o, DynamicForm dynamicForm) { - // return form.getValue("agentStatus") != null && !"Agent Not Installed".equals(form.getValue("agentStatus")); - // } - // }); + // startButton.setShowIfCondition(new FormItemIfFunction() { + // public boolean execute(FormItem formItem, Object o, DynamicForm dynamicForm) { + // return form.getValue("agentStatus") != null && !"Agent Not Installed".equals(form.getValue("agentStatus")); + // } + // }); startButton.addClickHandler(new ClickHandler() { public void onClick(ClickEvent clickEvent) { - remoteInstallService.startAgent(getRemoteAccessInfo(), getAgentInstallPath(), - new AsyncCallback<String>() { - public void onFailure(Throwable caught) { - CoreGUI.getErrorHandler().handleError("Failed to start agent", caught); - } - - public void onSuccess(String result) { - CoreGUI.getMessageCenter().notify( - new Message("Agent successfully started.", Message.Severity.Info)); - agentStatusCheck(); - } - }); + if (connectionForm.validate()) { + startAgent(); + } } });
- ButtonItem stopButton = new ButtonItem("stop", "Stop Agent"); + stopButton = new ButtonItem("stop", "Stop Agent"); stopButton.setStartRow(false); - // stopButton.setShowIfCondition(new FormItemIfFunction() { - // public boolean execute(FormItem formItem, Object o, DynamicForm dynamicForm) { - // return form.getValue("agentStatus") != null && !"Agent Not Installed".equals(form.getValue("agentStatus")); - // } - // }); + stopButton.setEndRow(true); stopButton.addClickHandler(new ClickHandler() { public void onClick(ClickEvent clickEvent) { - remoteInstallService.stopAgent(getRemoteAccessInfo(), getAgentInstallPath(), - new AsyncCallback<String>() { - public void onFailure(Throwable caught) { - CoreGUI.getErrorHandler().handleError("Failed to stop agent", caught); - } - - public void onSuccess(String result) { - CoreGUI.getMessageCenter().notify( - new Message("Agent successfully stopped.", Message.Severity.Info)); - agentStatusCheck(); - } - }); + if (connectionForm.validate()) { + stopAgent(); + } } });
- ButtonItem installButton = new ButtonItem("install", "Install Agent"); - installButton.setRedrawOnChange(true); - // installButton.setShowIfCondition(new FormItemIfFunction() { - // public boolean execute(FormItem formItem, Object o, DynamicForm dynamicForm) { - // return form.getValue("agentStatus") != null && "Agent Not Installed".equals(form.getValue("agentStatus")); - // } - // }); + buttonsForm.setFields(buttonsHeader, spacerItem, installButton, startButton, stopButton); + return buttonsForm; + }
- installButton.addClickHandler(new ClickHandler() { - public void onClick(ClickEvent clickEvent) { - remoteInstallService.installAgent(getRemoteAccessInfo(), getAgentInstallPath(), - new AsyncCallback<AgentInstallInfo>() { - public void onFailure(Throwable caught) { - CoreGUI.getErrorHandler().handleError("Failed to install agent", caught); - } - - public void onSuccess(AgentInstallInfo result) { - CoreGUI.getMessageCenter().notify( - new Message("Agent successfully installed.", Message.Severity.Info)); - - for (Canvas child : agentInfoLayout.getChildren()) { - child.destroy(); - } - agentInfoLayout.addMember(buildInstallInfoCanvas(result)); - agentInfoLayout.markForRedraw(); - agentStatusCheck(); - } - }); - } - }); + private void findAgentInstallPath() { + disableButtons(true);
- form.setFields(connectionHeader, host, username, password, agentInstallPath, statusCheck, agentStatus, - new SpacerItem(), startButton, stopButton, new SpacerItem(), installButton, new SpacerItem()); + final String parentPath = getAgentInstallPath();
- return form; + remoteInstallService.findAgentInstallPath(getRemoteAccessInfo(), parentPath, new AsyncCallback<String>() { + public void onFailure(Throwable caught) { + disableButtons(false); + CoreGUI.getErrorHandler().handleError("Error occurred while trying to find agent install path", caught); + } + + public void onSuccess(String result) { + disableButtons(false); + if (result != null) { + connectionForm.setValue("agentInstallPath", result); + } else { + String err; + if (parentPath == null || parentPath.length() == 0) { + err = "Could not find an agent installed when looking in common locations"; + } else { + err = "Could not find an agent installed at or under [" + parentPath + "]"; + } + CoreGUI.getErrorHandler().handleError(err); + } + agentStatusCheck(); + } + }); }
private void agentStatusCheck() { + disableButtons(true); remoteInstallService.agentStatus(getRemoteAccessInfo(), getAgentInstallPath(), new AsyncCallback<String>() { public void onFailure(Throwable caught) { - form.setValue("agentStatus", caught.getMessage()); + disableButtons(false); + connectionForm.setValue("agentStatus", caught.getMessage()); + } + + public void onSuccess(String result) { + disableButtons(false); + connectionForm.setValue("agentStatus", result); + } + }); + } + + private void installAgent() { + disableButtons(true); + + // FOR TESTING WITHOUT DOING A REAL INSTALL - START + // AgentInstallInfo result = new AgentInstallInfo("mypath", "myown", "1.1", "localHOST", "serverHOST"); + // for (int i = 1; i < 20; i++) + // result.addStep(new AgentInstallStep("cmd" + i, "desc" + i, i, "result" + i, i * 10)); + // for (Canvas child : agentInfoLayout.getChildren()) + // child.destroy(); + // buildInstallInfoCanvas(agentInfoLayout, result); + // agentInfoLayout.markForRedraw(); + // disableButtons(false); + // if (true) + // return; + // FOR TESTING WITHOUT DOING A REAL INSTALL - END + + remoteInstallService.installAgent(getRemoteAccessInfo(), getAgentInstallPath(), + new AsyncCallback<AgentInstallInfo>() { + public void onFailure(Throwable caught) { + disableButtons(false); + CoreGUI.getErrorHandler().handleError("Failed to install agent", caught); + } + + public void onSuccess(AgentInstallInfo result) { + disableButtons(false); + CoreGUI.getMessageCenter().notify( + new Message("Agent installation completed", Message.Severity.Info)); + + for (Canvas child : agentInfoLayout.getChildren()) { + child.destroy(); + } + buildInstallInfoCanvas(agentInfoLayout, result); + agentInfoLayout.markForRedraw(); + agentStatusCheck(); + } + }); + } + + private void startAgent() { + disableButtons(true); + remoteInstallService.startAgent(getRemoteAccessInfo(), getAgentInstallPath(), new AsyncCallback<String>() { + public void onFailure(Throwable caught) { + disableButtons(false); + CoreGUI.getErrorHandler().handleError("Failed to start agent", caught); }
public void onSuccess(String result) { - form.setValue("agentStatus", result); + disableButtons(false); + CoreGUI.getMessageCenter().notify(new Message("Agent start results: " + result, Message.Severity.Info)); + agentStatusCheck(); } }); }
- private Canvas buildInstallInfoCanvas(AgentInstallInfo info) { + private void stopAgent() { + disableButtons(true); + remoteInstallService.stopAgent(getRemoteAccessInfo(), getAgentInstallPath(), new AsyncCallback<String>() { + public void onFailure(Throwable caught) { + disableButtons(false); + CoreGUI.getErrorHandler().handleError("Failed to stop agent", caught); + }
- VLayout installInfo = new VLayout(); - installInfo.setWidth100(); + public void onSuccess(String result) { + disableButtons(false); + CoreGUI.getMessageCenter().notify(new Message("Agent stop results: " + result, Message.Severity.Info)); + agentStatusCheck(); + } + }); + }
+ private void buildInstallInfoCanvas(VLayout installInfo, AgentInstallInfo info) { DynamicForm infoForm = new DynamicForm(); + infoForm.setMargin(20); infoForm.setWidth100(); + infoForm.setHeight100(); + HeaderItem infoHeader = new HeaderItem(); infoHeader.setValue("Agent Installation Information"); + StaticTextItem version = new StaticTextItem("version", "Version"); version.setValue(info.getVersion());
@@ -229,9 +358,13 @@ public class RemoteAgentInstallView extends VLayout { StaticTextItem config = new StaticTextItem("config", "Configuration"); config.setValue(info.getConfigurationStartString());
- infoForm.setFields(infoHeader, version, path, owner, config); + CanvasItem listCanvas = new CanvasItem(); + listCanvas.setShowTitle(false); + listCanvas.setColSpan(2);
- installInfo.addMember(infoForm); + VLayout listLayout = new VLayout(0); + listLayout.setWidth100(); + listLayout.setHeight100();
ListGrid listGrid = new ListGrid() { @Override @@ -241,29 +374,25 @@ public class RemoteAgentInstallView extends VLayout { return canvas; } }; - listGrid.setWidth(800); - listGrid.setHeight(500); + listGrid.setWidth100(); + listGrid.setHeight100(); listGrid.setCanExpandRecords(true); listGrid.setExpansionMode(ExpansionMode.DETAIL_FIELD); listGrid.setDetailField("result"); - - listGrid.setAutoFitData(Autofit.VERTICAL); ListGridField step = new ListGridField("description", "Step"); + ListGridField result = new ListGridField("result", "Result"); ListGridField resultCode = new ListGridField("resultCode", "Result Code", 90); ListGridField duration = new ListGridField("duration", "Duration", 90); - - listGrid.setFields(step, resultCode, duration); - + listGrid.setFields(step, result, resultCode, duration); listGrid.setData(getStepRecords(info));
- installInfo.addMember(listGrid); - - for (ListGridRecord rec : listGrid.getRecords()) { - listGrid.expandRecord(rec); - } + listLayout.addMember(listGrid); + listCanvas.setCanvas(listLayout);
- return installInfo; + infoForm.setFields(infoHeader, version, path, owner, config, listCanvas); + installInfo.addMember(infoForm);
+ return; }
private ListGridRecord[] getStepRecords(AgentInstallInfo info) { @@ -272,7 +401,11 @@ public class RemoteAgentInstallView extends VLayout { for (AgentInstallStep step : info.getSteps()) { ListGridRecord rec = new ListGridRecord(); rec.setAttribute("description", step.getDescription()); - rec.setAttribute("result", step.getResult()); + String result = step.getResult(); + if (result == null || result.trim().length() == 0) { + result = "Result code=" + step.getResultCode(); + } + rec.setAttribute("result", result); rec.setAttribute("resultCode", "" + step.getResultCode()); rec.setAttribute("duration", MeasurementConverterClient.format((double) step.getDuration(), MeasurementUnits.MILLISECONDS, true)); @@ -282,15 +415,32 @@ public class RemoteAgentInstallView extends VLayout { return steps.toArray(new ListGridRecord[steps.size()]); }
+ private void disableButtons(boolean disabled) { + installButton.setDisabled(disabled); + startButton.setDisabled(disabled); + stopButton.setDisabled(disabled); + buttonsForm.setDisabled(disabled); + } + private RemoteAccessInfo getRemoteAccessInfo() { - String host = form.getValueAsString("host"); - String username = form.getValueAsString("username"); - String password = form.getValueAsString("password"); - RemoteAccessInfo info = new RemoteAccessInfo(host, username, password); + String host = connectionForm.getValueAsString("host"); + String port = connectionForm.getValueAsString("port"); + String username = connectionForm.getValueAsString("username"); + String password = connectionForm.getValueAsString("password"); + + int portInt; + try { + portInt = Integer.parseInt(port); + } catch (NumberFormatException e) { + portInt = 22; + } + connectionForm.setValue("port", portInt); + + RemoteAccessInfo info = new RemoteAccessInfo(host, portInt, username, password); return info; }
private String getAgentInstallPath() { - return form.getValueAsString("agentInstallPath"); + return connectionForm.getValueAsString("agentInstallPath"); } } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/RemoteInstallGWTServiceImpl.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/RemoteInstallGWTServiceImpl.java index 321cf77..f29598f 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/RemoteInstallGWTServiceImpl.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/RemoteInstallGWTServiceImpl.java @@ -24,6 +24,7 @@ package org.rhq.enterprise.gui.coregui.server.gwt;
import org.rhq.core.domain.install.remote.AgentInstallInfo; import org.rhq.core.domain.install.remote.RemoteAccessInfo; +import org.rhq.core.util.exception.ThrowableUtil; import org.rhq.enterprise.gui.coregui.client.gwt.RemoteInstallGWTService; import org.rhq.enterprise.gui.coregui.server.util.SerialUtility; import org.rhq.enterprise.server.install.remote.RemoteInstallManagerLocal; @@ -38,37 +39,65 @@ public class RemoteInstallGWTServiceImpl extends AbstractGWTServiceImpl implemen private RemoteInstallManagerLocal remoteInstallManager = LookupUtil.getRemoteInstallManager();
public boolean agentInstallCheck(RemoteAccessInfo remoteAccessInfo, String agentInstallPath) { - return SerialUtility.prepare(remoteInstallManager.agentInstallCheck(getSessionSubject(), remoteAccessInfo, - agentInstallPath), "RemoteInstallService.agentInstallCheck"); + try { + return SerialUtility.prepare(remoteInstallManager.agentInstallCheck(getSessionSubject(), remoteAccessInfo, + agentInstallPath), "RemoteInstallService.agentInstallCheck"); + } catch (Exception e) { + throw new RuntimeException(ThrowableUtil.getAllMessages(e)); + } }
public AgentInstallInfo installAgent(RemoteAccessInfo remoteAccessInfo, String parentPath) { - return SerialUtility.prepare(remoteInstallManager.installAgent(getSessionSubject(), remoteAccessInfo, - parentPath), "RemoteInstallService.installAgent"); + try { + return SerialUtility.prepare(remoteInstallManager.installAgent(getSessionSubject(), remoteAccessInfo, + parentPath), "RemoteInstallService.installAgent"); + } catch (Exception e) { + throw new RuntimeException(ThrowableUtil.getAllMessages(e)); + } }
public String startAgent(RemoteAccessInfo remoteAccessInfo, String agentInstallPath) { - return SerialUtility.prepare(remoteInstallManager.startAgent(getSessionSubject(), remoteAccessInfo, - agentInstallPath), "RemoteInstallService.startAgent"); + try { + return SerialUtility.prepare(remoteInstallManager.startAgent(getSessionSubject(), remoteAccessInfo, + agentInstallPath), "RemoteInstallService.startAgent"); + } catch (Exception e) { + throw new RuntimeException(ThrowableUtil.getAllMessages(e)); + } }
public String stopAgent(RemoteAccessInfo remoteAccessInfo, String agentInstallPath) { - return SerialUtility.prepare(remoteInstallManager.stopAgent(getSessionSubject(), remoteAccessInfo, - agentInstallPath), "RemoteInstallService.stopAgent"); + try { + return SerialUtility.prepare(remoteInstallManager.stopAgent(getSessionSubject(), remoteAccessInfo, + agentInstallPath), "RemoteInstallService.stopAgent"); + } catch (Exception e) { + throw new RuntimeException(ThrowableUtil.getAllMessages(e)); + } }
public String agentStatus(RemoteAccessInfo remoteAccessInfo, String agentInstallPath) { - return SerialUtility.prepare(remoteInstallManager.agentStatus(getSessionSubject(), remoteAccessInfo, - agentInstallPath), "RemoteInstallService.agentStatus"); + try { + return SerialUtility.prepare(remoteInstallManager.agentStatus(getSessionSubject(), remoteAccessInfo, + agentInstallPath), "RemoteInstallService.agentStatus"); + } catch (Exception e) { + throw new RuntimeException(ThrowableUtil.getAllMessages(e)); + } }
public String findAgentInstallPath(RemoteAccessInfo remoteAccessInfo, String parentPath) { - return SerialUtility.prepare((remoteInstallManager.findAgentInstallPath(getSessionSubject(), remoteAccessInfo, - parentPath)), "RemoteInstallService.findAgentInstallPath"); + try { + return SerialUtility.prepare((remoteInstallManager.findAgentInstallPath(getSessionSubject(), + remoteAccessInfo, parentPath)), "RemoteInstallService.findAgentInstallPath"); + } catch (Exception e) { + throw new RuntimeException(ThrowableUtil.getAllMessages(e)); + } }
public String[] remotePathDiscover(RemoteAccessInfo remoteAccessInfo, String parentPath) { - return SerialUtility.prepare((remoteInstallManager.remotePathDiscover(getSessionSubject(), remoteAccessInfo, - parentPath)), "RemoteInstallService.remotePathDiscover"); + try { + return SerialUtility.prepare((remoteInstallManager.remotePathDiscover(getSessionSubject(), + remoteAccessInfo, parentPath)), "RemoteInstallService.remotePathDiscover"); + } catch (Exception e) { + throw new RuntimeException(ThrowableUtil.getAllMessages(e)); + } } } diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/install/remote/SSHInstallUtility.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/install/remote/SSHInstallUtility.java index c81b478..2cc16b6 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/install/remote/SSHInstallUtility.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/install/remote/SSHInstallUtility.java @@ -131,7 +131,9 @@ public class SSHInstallUtility {
public AgentInstallInfo installAgent(String parentPath) {
- AgentInstallInfo info = new AgentInstallInfo(parentPath, accessInfo.getUser(), agentVersion); + String serverAddress = LookupUtil.getServerManager().getServer().getAddress(); + AgentInstallInfo info = new AgentInstallInfo(parentPath, accessInfo.getUser(), agentVersion, accessInfo + .getHost(), serverAddress);
executeCommand("uname -a", "Machine uname", info); executeCommand("java -version", "Java Version Check", info); @@ -151,18 +153,16 @@ public class SSHInstallUtility { executeCommand("java -jar '" + parentPath + "/" + agentFile + "' '--install=" + parentPath + "'", "Install Agent", info);
- String serverAddress = LookupUtil.getServerManager().getServer().getAddress(); - log.info("Will start new agent @ [" + accessInfo.getHost() + "] pointing to server @ [" + serverAddress + "]");
String agentScript = parentPath + "/rhq-agent/bin/rhq-agent.sh"; // NOTE: NOT the wrapper script - String properties = new AgentInstallInfo(serverAddress, accessInfo.getHost()).getConfigurationStartString(); + String startStringArgs = info.getConfigurationStartString();
// Tell the script to store a pid file to make the wrapper script work String envCmd1 = "RHQ_AGENT_IN_BACKGROUND='" + parentPath + "/rhq-agent/bin/rhq-agent.pid'"; String envCmd2 = "export RHQ_AGENT_IN_BACKGROUND";
- String startCommand = envCmd1 + " ; " + envCmd2 + " ; nohup '" + agentScript + "' " + properties + " &"; + String startCommand = envCmd1 + " ; " + envCmd2 + " ; nohup '" + agentScript + "' " + startStringArgs + " &"; executeCommand(startCommand, "Start New Agent", info);
return info; @@ -236,7 +236,7 @@ public class SSHInstallUtility { }
private String executeCommand(String command, String description) { - return executeCommand(command, description, new AgentInstallInfo(null, null)); + return executeCommand(command, description, new AgentInstallInfo()); }
private String executeCommand(String command, String description, AgentInstallInfo info) {
commit 972375977f77b3c84da1a835b85537eedb0bc05d Merge: 7e02dc7... 0ffb520... Author: Ian Springer ian.springer@redhat.com Date: Thu Aug 5 23:31:02 2010 -0400
Merge branch 'master' of ssh://git.fedorahosted.org/git/rhq/rhq
commit 0ffb52081be378fcdcbbec84aea534a65969fe2d Author: Jay Shaughnessy jshaughn@redhat.com Date: Thu Aug 5 15:18:07 2010 -0400
[BZ-618659] [BZ-621662] Work around the fact that H2 does not yet support blob update. This amounts to special casing H2 in the PackageVersion handling. Also, update H2 version from 1.1.117 to 1.2.139 to get relevant bug fixes, move to H2's latest db format, and set ourselves up for moving forward again when/if H2 adds blob update support.
diff --git a/modules/core/dbutils/src/main/java/org/rhq/core/db/DatabaseTypeFactory.java b/modules/core/dbutils/src/main/java/org/rhq/core/db/DatabaseTypeFactory.java index 896b396..ef66a51 100644 --- a/modules/core/dbutils/src/main/java/org/rhq/core/db/DatabaseTypeFactory.java +++ b/modules/core/dbutils/src/main/java/org/rhq/core/db/DatabaseTypeFactory.java @@ -172,6 +172,8 @@ public class DatabaseTypeFactory { } else if (db_name.indexOf("h2") != -1) { if (db_version.startsWith("1.1")) { database_type_class = H2v11DatabaseType.class; + } else if (db_version.startsWith("1.2")) { + database_type_class = H2v12DatabaseType.class; } } else if (db_name.indexOf("sql server") != -1) { if (db_version.startsWith("09.00") || db_version.startsWith("9.00")) { // SQL Server 2005 diff --git a/modules/core/dbutils/src/main/java/org/rhq/core/db/H2v12DatabaseType.java b/modules/core/dbutils/src/main/java/org/rhq/core/db/H2v12DatabaseType.java new file mode 100644 index 0000000..42d164b --- /dev/null +++ b/modules/core/dbutils/src/main/java/org/rhq/core/db/H2v12DatabaseType.java @@ -0,0 +1,42 @@ +/* + * RHQ Management Platform + * Copyright (C) 2005-2008 Red Hat, Inc. + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ +package org.rhq.core.db; + +/** + * H2 database version 1.2 which extends the abstract support for H2 database. + * + * @author Joseph Marques + */ +public class H2v12DatabaseType extends H2DatabaseType { + /** + * @see DatabaseType#getName() + */ + @Override + public String getName() { + return H2DatabaseType.VENDOR_NAME + "v1.2"; + } + + /** + * @see DatabaseType#getVersion() + */ + @Override + public String getVersion() { + return "1.2"; + } +} \ No newline at end of file diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerBean.java index 54ccd3f..40c2886 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerBean.java @@ -59,6 +59,7 @@ import org.rhq.core.clientapi.server.content.ContentServiceResponse; import org.rhq.core.clientapi.server.content.DeletePackagesRequest; import org.rhq.core.clientapi.server.content.DeployPackagesRequest; import org.rhq.core.clientapi.server.content.RetrievePackageBitsRequest; +import org.rhq.core.db.DatabaseTypeFactory; import org.rhq.core.domain.auth.Subject; import org.rhq.core.domain.authz.Permission; import org.rhq.core.domain.configuration.Configuration; @@ -1585,10 +1586,15 @@ public class ContentManagerBean implements ContentManagerLocal, ContentManagerRe * @param contentDetails * @return PackageBits ref populated. */ - @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW) private PackageBits loadPackageBits(InputStream packageBitStream, int packageVersionId, String packageName, String packageVersion, PackageBits existingBits, Map<String, String> contentDetails) {
+ // If/When H2 handles blob update/streaming blobs we can get rid of this conditional code + if (DatabaseTypeFactory.isH2(DatabaseTypeFactory.getDefaultDatabaseType())) { + return loadPackageBitsH2(packageBitStream, packageVersionId, packageName, packageVersion, existingBits, + contentDetails); + } + // use existing or instantiate PackageBits instance. PackageBits bits = (null == existingBits) ? initializePackageBits(null) : existingBits;
@@ -1596,7 +1602,7 @@ public class ContentManagerBean implements ContentManagerLocal, ContentManagerRe PackageVersion pv = entityManager.find(PackageVersion.class, packageVersionId);
//associate the two if located. - if (pv != null) {//np check. + if (null != pv) { pv.setPackageBits(bits); entityManager.flush(); } @@ -1607,6 +1613,58 @@ public class ContentManagerBean implements ContentManagerLocal, ContentManagerRe return bits; }
+ private PackageBits loadPackageBitsH2(InputStream packageBitStream, int packageVersionId, String packageName, + String packageVersion, PackageBits existingBits, Map<String, String> contentDetails) { + + PackageBits bits = null; + PackageBitsBlob blob = null; + + // The blob cannot be updated, so we'll need to create a whole new row. + if (null != existingBits) { + blob = entityManager.find(PackageBitsBlob.class, existingBits.getId()); + entityManager.remove(blob); + entityManager.flush(); + } + + // We have to work backwards to avoid constraint violations. PackageBits requires a PackageBitsBlob, + // so create and persist that first, getting the ID + blob = new PackageBitsBlob(); + // just set the blob now, no streaming. The assumption is that H2 (demo) will not be using large blobs + byte[] bytes = StreamUtil.slurp(packageBitStream); + blob.setBits(bytes); + entityManager.persist(blob); + entityManager.flush(); + + // Now create the PackageBits entity and assign the Id and blob. Note, do not persist the + // entity, the row already exists (due to the blob persist above). Just perform and flush the update. + bits = new PackageBits(); + bits.setId(blob.getId()); + bits.setBlob(blob); + entityManager.flush(); + + //locate related packageVersion + PackageVersion pv = entityManager.find(PackageVersion.class, packageVersionId); + + //associate the two if packageVersion exists. + if (null != pv) { + pv.setPackageBits(bits); + entityManager.flush(); + } + + // update contentDetails in needed + if (null != contentDetails) { + contentDetails.put(UPLOAD_FILE_SIZE, String.valueOf(bytes.length)); + try { + contentDetails.put(UPLOAD_SHA256, new MessageDigestGenerator(MessageDigestGenerator.SHA_256) + .calcDigestString(bytes)); + } catch (Exception e) { + throw new RuntimeException("Failed to calculate SHA256 for package bits: ", e); + } + } + + return bits; + } + /** * This creates a new PackageBits entity initialized to EMPTY_BLOB for the associated PackageBitsBlob. * Note that PackageBits and PackageBitsBlob are two entities that *share* the same db row. This is diff --git a/pom.xml b/pom.xml index 2a0db1c..ed621bf 100644 --- a/pom.xml +++ b/pom.xml @@ -87,7 +87,7 @@ <ojdbc5.version>11.2.0.1.0</ojdbc5.version> <ems.version>1.2.14</ems.version> <postgresql.version>8.4-701.jdbc3</postgresql.version> - <h2.version>1.1.117</h2.version> + <h2.version>1.2.139</h2.version> <jtds.version>1.2.2</jtds.version> <richfaces.version>3.3.3.Final</richfaces.version> <jline.version>0.9.94</jline.version>
commit cb5a73bc660ad40b8fca0b4c287b14aa89797237 Author: Greg Hinkle ghinkle@redhat.com Date: Thu Aug 5 17:55:51 2010 -0400
default to summary tab when switch resources to a resource where the current selection is not relevant or allowed
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java index 798d4bc..a40f10a 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java @@ -261,6 +261,10 @@ public class ResourceDetailView extends VLayout implements BookmarkableView, Res }
+ if (topTabSet.getSelectedTab().getDisabled()) { + topTabSet.selectTab(0); + } + }
commit b31ed6d9cb521f384da1bdb1d74245345dba8b85 Author: Greg Hinkle ghinkle@redhat.com Date: Thu Aug 5 17:54:16 2010 -0400
Chop JSF menu from pages loaded with nomenu param (as embedded in jsf
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/menu/menu.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/menu/menu.xhtml index 2c4e779..d331d51 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/menu/menu.xhtml +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/menu/menu.xhtml @@ -8,6 +8,7 @@ xmlns:rich="http://richfaces.ajax4jsf.org/rich" xmlns:a4j="http://richfaces.org/a4j" xmlns:onc="http://jboss.org/on/component%22%3E +<c:if test="${empty param.nomenu}">
<h:form>
@@ -688,5 +689,6 @@ v <rich:menuItem submitMode="none" </a4j:form> </a4j:region>
+</c:if>
</a4j:region>
commit 3b8e5db720d4ade81b52ba4522ce858c45825661 Author: Greg Hinkle ghinkle@redhat.com Date: Tue Aug 3 12:10:47 2010 -0400
Highlight improvement for tables with background graphs
diff --git a/modules/enterprise/gui/coregui/src/main/webapp/CoreGUI.css b/modules/enterprise/gui/coregui/src/main/webapp/CoreGUI.css index d565834..bc48f18 100644 --- a/modules/enterprise/gui/coregui/src/main/webapp/CoreGUI.css +++ b/modules/enterprise/gui/coregui/src/main/webapp/CoreGUI.css @@ -345,3 +345,13 @@ a:hover { padding: 5px; border: 1px solid darkblue; } + + +/* This sets table mouse-over highlights to have an alpha component on browsers that support it. + It particularly helps with tables that have bar charts as a background component. + (e.g. problem metrics or call time) +*/ +.tallCellOver, .tallCellOverDark { + background-color: rgb(230,230,230) !important; /* for browsers that don't like alpha */ + background-color: rgba(230,230,230,0.6) !important; +} \ No newline at end of file
commit 546416b2bb34e9d712e19bc23fc8253daed181a5 Author: Greg Hinkle ghinkle@redhat.com Date: Mon Aug 2 15:46:29 2010 -0400
Event details view to see full log message text or other long event texts
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/event/EventDetailsView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/event/EventDetailsView.java new file mode 100644 index 0000000..13ab506 --- /dev/null +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/event/EventDetailsView.java @@ -0,0 +1,99 @@ +/* + * RHQ Management Platform + * Copyright (C) 2005-2010 Red Hat, Inc. + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License, version 2, as + * published by the Free Software Foundation, and/or the GNU Lesser + * General Public License, version 2.1, also as published by the Free + * Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License and the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License + * and the GNU Lesser General Public License along with this program; + * if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +package org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.event; + +import com.smartgwt.client.types.TitleOrientation; +import com.smartgwt.client.widgets.Window; +import com.smartgwt.client.widgets.form.DynamicForm; +import com.smartgwt.client.widgets.form.fields.StaticTextItem; +import com.smartgwt.client.widgets.form.fields.TextAreaItem; +import com.smartgwt.client.widgets.grid.ListGridRecord; +import com.smartgwt.client.widgets.layout.VLayout; + +/** + * @author Greg Hinkle + */ +public class EventDetailsView extends VLayout { + + + private ListGridRecord eventRecord; + + + public EventDetailsView(ListGridRecord eventRecord) { + this.eventRecord = eventRecord; + } + + @Override + protected void onInit() { + super.onInit(); + + + DynamicForm form = new DynamicForm(); + form.setWidth100(); + form.setHeight100(); + + StaticTextItem id = new StaticTextItem("id","Id"); + id.setValue(eventRecord.getAttribute("id")); + + StaticTextItem severity = new StaticTextItem("severity","Severity"); + severity.setValue(eventRecord.getAttribute("severity")); + + StaticTextItem source = new StaticTextItem("sourceLocation","Source"); + source.setValue(eventRecord.getAttribute("sourceLocation")); + + StaticTextItem timestamp = new StaticTextItem("timestamp","Timestamp"); + timestamp.setValue(eventRecord.getAttribute("timestamp")); + + TextAreaItem detail = new TextAreaItem("detail", "Detail"); + detail.setTitleOrientation(TitleOrientation.TOP); + detail.setColSpan(2); + detail.setWidth("100%"); + detail.setHeight("100%"); + detail.setValue(eventRecord.getAttribute("detail")); + + + form.setItems(id,severity,source,timestamp,detail); + + + + addMember(form); + + } + + public void displayInDialog() { + Window window = new Window(); + window.setTitle("Event Details"); + window.setWidth(800); + window.setHeight(800); + window.setIsModal(true); + window.setShowModalMask(true); + window.setCanDragResize(true); + window.centerInPage(); + window.addItem(this); + window.setDismissOnEscape(true); + window.setDismissOnOutsideClick(true); + window.show(); + window.focus(); + } + +} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/event/EventHistoryView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/event/EventHistoryView.java index 492dc14..a876bfe 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/event/EventHistoryView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/event/EventHistoryView.java @@ -26,8 +26,11 @@ import com.smartgwt.client.data.Criteria; import com.smartgwt.client.widgets.Canvas; import com.smartgwt.client.widgets.grid.CellFormatter; import com.smartgwt.client.widgets.grid.ListGridRecord; +import com.smartgwt.client.widgets.grid.events.CellDoubleClickEvent; +import com.smartgwt.client.widgets.grid.events.CellDoubleClickHandler;
import org.rhq.enterprise.gui.coregui.client.components.table.Table; +import org.rhq.enterprise.gui.coregui.client.components.table.TableAction;
/** * @author Greg Hinkle @@ -40,13 +43,6 @@ public class EventHistoryView extends Table {
setDataSource(new EventDatasource());
- } - - - - @Override - protected void onDraw() { - super.onDraw(); // getListGrid().getField("id").setWidth(60); getListGrid().getField("severity").setWidth(120); getListGrid().getField("severity").setCellFormatter(new CellFormatter() { @@ -55,10 +51,28 @@ public class EventHistoryView extends Table { } });
+ getListGrid().addCellDoubleClickHandler(new CellDoubleClickHandler() { + public void onCellDoubleClick(CellDoubleClickEvent cellDoubleClickEvent) { + // TODO: Implement this method. + showEventDetails(cellDoubleClickEvent.getRecord()); + } + }); + + addTableAction("Details", SelectionEnablement.SINGLE, null, + new TableAction() { + public void executeAction(ListGridRecord[] selection) { + showEventDetails(selection[0]); + } + }); + getListGrid().getField("sourceLocation").setWidth(200); getListGrid().getField("timestamp").setWidth(160); }
+ public static void showEventDetails(ListGridRecord record) { + new EventDetailsView(record).displayInDialog(); + } + public static EventHistoryView createResourceHistoryView(int resourceId) { Criteria criteria = new Criteria(); criteria.addCriteria("resourceId",resourceId);
commit 3cecd4c47e1e9a0dcbc4c0b040bda4b7d4f01248 Author: Greg Hinkle ghinkle@redhat.com Date: Mon Aug 2 15:45:30 2010 -0400
Fix resource tab history reselection (this broke on a change to smartgwt's tab selection api)
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java index 5e113ee..798d4bc 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java @@ -290,7 +290,7 @@ public class ResourceDetailView extends VLayout implements BookmarkableView, Res TwoLevelTab tab = (TwoLevelTab) t;
if (tab.getTitle().equals(tabView.getPath())) { - topTabSet.selectTab(tabView.getPath()); + topTabSet.selectTab(tab); //tabView.getPath());
tab.getLayout().selectTab(subtabView.getPath());
commit 15c1dfd8527df0e88588a9dbb183f9aace21f2b0 Author: Greg Hinkle ghinkle@redhat.com Date: Mon Aug 2 15:44:47 2010 -0400
Point alerts quickview to the reports section
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/Footer.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/Footer.java index 8a6fcc4..334a2aa 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/Footer.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/Footer.java @@ -18,17 +18,13 @@ */ package org.rhq.enterprise.gui.coregui.client;
-import com.google.gwt.core.client.GWT; import com.google.gwt.user.client.History; import com.google.gwt.user.client.Timer; import com.google.gwt.user.client.rpc.AsyncCallback; import com.smartgwt.client.types.VerticalAlignment; -import com.smartgwt.client.widgets.Img; import com.smartgwt.client.widgets.Label; import com.smartgwt.client.widgets.events.ClickEvent; import com.smartgwt.client.widgets.events.ClickHandler; -import com.smartgwt.client.widgets.layout.HLayout; -import com.smartgwt.client.widgets.layout.VLayout; import com.smartgwt.client.widgets.toolbar.ToolStrip; import com.smartgwt.client.widgets.toolbar.ToolStripSeparator;
@@ -112,7 +108,7 @@ public class Footer extends ToolStrip {
addClickHandler(new ClickHandler() { public void onClick(ClickEvent clickEvent) { - History.newItem("Subsystems/Alerts"); + History.newItem("Reports/Inventory/Recent Alerts"); } }); }
commit 43722261cdf985203f6a0fda51e122b4cf8d7f0d Author: Greg Hinkle ghinkle@redhat.com Date: Thu Jul 29 23:51:48 2010 -0400
Fix dashboard history tab reselection
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardsView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardsView.java index 4444d39..a82393c 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardsView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardsView.java @@ -48,7 +48,6 @@ import org.rhq.enterprise.gui.coregui.client.BookmarkableView; import org.rhq.enterprise.gui.coregui.client.CoreGUI; import org.rhq.enterprise.gui.coregui.client.ViewPath; import org.rhq.enterprise.gui.coregui.client.dashboard.portlets.inventory.queue.AutodiscoveryPortlet; -import org.rhq.enterprise.gui.coregui.client.dashboard.portlets.inventory.resource.graph.GraphPortlet; import org.rhq.enterprise.gui.coregui.client.dashboard.portlets.recent.alerts.RecentAlertsPortlet; import org.rhq.enterprise.gui.coregui.client.dashboard.portlets.recent.imported.RecentlyAddedView; import org.rhq.enterprise.gui.coregui.client.dashboard.portlets.summary.InventorySummaryView; @@ -139,7 +138,7 @@ public class DashboardsView extends VLayout implements BookmarkableView {
HLayout buttons = new HLayout(5); buttons.addMember(editButton); - buttons.addMember(newDashboardButton); + buttons.addMember(newDashboardButton);
tabSet.setTabBarControls(buttons);
@@ -149,7 +148,7 @@ public class DashboardsView extends VLayout implements BookmarkableView { History.newItem("Dashboard/" + tabSelectedEvent.getTab().getTitle(), false); selectedDashboardView = (DashboardView) tabSelectedEvent.getTab().getPane(); selectedDashboard = selectedDashboardView.getDashboard(); - selectedDashboardView.setEditMode(editMode); + selectedDashboardView.setEditMode(editMode); } });
@@ -159,7 +158,7 @@ public class DashboardsView extends VLayout implements BookmarkableView { Tab tab = new Tab(dashboard.getName()); tab.setPane(dashboardView); tab.setCanClose(true); - +
tabSet.addTab(tab); if (dashboard.getName().equals(selectedTab)) { @@ -193,7 +192,7 @@ public class DashboardsView extends VLayout implements BookmarkableView { dashboard.setName("Default Dashboard"); dashboard.setColumns(2); dashboard.setColumnWidths("32%", "68%"); - dashboard.getConfiguration().put(new PropertySimple(Dashboard.CFG_BACKGROUND,"#F1F2F3")); + dashboard.getConfiguration().put(new PropertySimple(Dashboard.CFG_BACKGROUND, "#F1F2F3"));
DashboardPortlet summary = new DashboardPortlet("Inventory Summary", InventorySummaryView.KEY, 230); @@ -208,7 +207,7 @@ public class DashboardsView extends VLayout implements BookmarkableView {
DashboardPortlet welcome = new DashboardPortlet("Welcome To RHQ", MessagePortlet.KEY, 180); - welcome.getConfiguration().put(new PropertySimple("message","<h1>Welcome to RHQ</h1>\n" + + welcome.getConfiguration().put(new PropertySimple("message", "<h1>Welcome to RHQ</h1>\n" + "<p>The RHQ project is an abstraction and plug-in based systems management suite that provides " + "extensible and integrated systems management for multiple products and platforms across a set " + "of core features. The project is designed with layered modules that provide a flexible " + @@ -290,12 +289,13 @@ public class DashboardsView extends VLayout implements BookmarkableView { }
- public void renderView(ViewPath viewPath) { if (!viewPath.isEnd()) { selectedTab = viewPath.getCurrent().getPath(); - if (tabSet != null) { - tabSet.selectTab(selectedTab); + for (Tab tab : tabSet.getTabs()) { + if (selectedTab.equals(tab.getTitle())) { + tabSet.selectTab(tab); + } } } }
commit 162744bec791b9dbcff1099cc93bee2cdabc1ebb Author: John Mazzitelli mazz@redhat.com Date: Thu Aug 5 14:30:44 2010 -0400
if you ever call handleError(String), you will get an NPE - fixing it so that doesn't happen
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/ErrorHandler.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/ErrorHandler.java index 6da2f0b..9491b8f 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/ErrorHandler.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/ErrorHandler.java @@ -38,7 +38,10 @@ public class ErrorHandler { Message errorMessage = new Message(message, (t == null) ? null : t.toString(), Message.Severity.Error); CoreGUI.getMessageCenter().notify(errorMessage);
- t.printStackTrace(); + if (t != null) { + t.printStackTrace(); + } + this.errors.add(message); }
commit 7e02dc77ab334709f229f6a82c95a1a73eb6c20a Author: Ian Springer ian.springer@redhat.com Date: Thu Aug 5 12:06:17 2010 -0400
make / redirect to /coregui/CoreGUI.html#Dashboard, rather than /Dashboard.do
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/web.xml b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/web.xml index f560de1..8d69a36 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/web.xml +++ b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/web.xml @@ -505,7 +505,7 @@ </session-config>
<welcome-file-list> - <welcome-file>Dashboard.do</welcome-file> + <welcome-file>index.html</welcome-file> </welcome-file-list>
<error-page>
commit 273fc42aaab1f63d2cca9022ece89a98d02cf07a Author: Joseph Marques joseph@redhat.com Date: Thu Aug 5 10:21:06 2010 -0400
ensure connections are closed after using them
diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/startup/StartupServlet.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/startup/StartupServlet.java index e69e1ff..d0a7092 100644 --- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/startup/StartupServlet.java +++ b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/startup/StartupServlet.java @@ -140,12 +140,21 @@ public class StartupServlet extends HttpServlet {
private void initializeServer() { // Ensure the class is loaded and the dbType is set for our current db + Connection conn = null; try { DataSource ds = LookupUtil.getDataSource(); - Connection conn = ds.getConnection(); + conn = ds.getConnection(); DatabaseTypeFactory.setDefaultDatabaseType(DatabaseTypeFactory.getDatabaseType(conn)); } catch (Exception e) { log("Could not initialize server: ", e); + } finally { + if (conn != null) { + try { + conn.close(); + } catch (Exception e) { + log("Failed to close temporary connection used for server initialization: ", e); + } + } }
// Ensure that this server is registered in the database.
commit 37c8646f95f62683b9a73947422da97386fc5f6c Merge: 04f29c2... 6aeb3ea... Author: Filip Drabek fdrabek@dhcp-lab-136.englab.brq.redhat.com Date: Thu Aug 5 13:55:08 2010 +0200
Merge branch 'master' of ssh://git.fedorahosted.org/git/rhq/rhq
commit 04f29c218de34e2b51686832366fb5be11a2415a Author: Filip Drabek fdrabek@dhcp-lab-136.englab.brq.redhat.com Date: Thu Aug 5 13:54:15 2010 +0200
BZ-618314 - fix of apache tests BZ-618877 - Includes can use absolute path now.
diff --git a/modules/plugins/apache/pom.xml b/modules/plugins/apache/pom.xml index d8b00bc..9f46fc9 100644 --- a/modules/plugins/apache/pom.xml +++ b/modules/plugins/apache/pom.xml @@ -95,18 +95,27 @@ </execution> </executions> </plugin> + + <plugin> + <artifactId>maven-surefire-plugin</artifactId> + <configuration> + <skip>true</skip> + </configuration> + </plugin> </plugins> </build>
<profiles> <profile> <id>integration-tests</id> - <activation> - <property> - <name>maven.test.skip</name> - <value>!true</value> - </property> - </activation> + <!-- + <activation> + <property> + <name>maven.test.skip</name> + <value>!true</value> + </property> + </activation> + -->
<build> <plugins> diff --git a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/augeas/AugeasConfigurationApache.java b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/augeas/AugeasConfigurationApache.java index cb61c0a..3e51757 100644 --- a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/augeas/AugeasConfigurationApache.java +++ b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/augeas/AugeasConfigurationApache.java @@ -101,17 +101,13 @@ public class AugeasConfigurationApache extends PluginDescriptorBasedAugeasConfig }
private void loadIncludes(String expression, List<String> foundIncludes) { - try { - File file = new File(expression); - + try { List<File> files = new ArrayList<File>();
- if (!file.isAbsolute()) { - File serverRootFile = new File(serverRootPath); - files = Glob.match(serverRootFile, expression); - }else - files.add(file); - + File check = new File(expression); + File root = new File(check.isAbsolute() ? Glob.rootPortion(expression) : serverRootPath); + files.addAll(Glob.match(root, expression)); + for (File fl : files){ if (fl.exists()) { foundIncludes.add(fl.getAbsolutePath()); @@ -142,8 +138,7 @@ public class AugeasConfigurationApache extends PluginDescriptorBasedAugeasConfig }
public void loadFiles() { - File root = new File(serverRootPath); - + for (AugeasModuleConfig module : modules) { List<String> includeGlobs = module.getIncludedGlobs();
@@ -154,10 +149,10 @@ public class AugeasConfigurationApache extends PluginDescriptorBasedAugeasConfig ArrayList<File> files = new ArrayList<File>();
for (String incl : includeGlobs) { - if (incl.indexOf(File.separatorChar) == 0) { - files.add(new File(incl)); - } else - files.addAll(Glob.match(root, incl)); + File check = new File(incl); + File root = new File(check.isAbsolute() ? Glob.rootPortion(incl) : serverRootPath); + + files.addAll(Glob.match(root, incl)); }
if (module.getExcludedGlobs() != null) { @@ -185,15 +180,11 @@ public class AugeasConfigurationApache extends PluginDescriptorBasedAugeasConfig
private static List<File> getIncludeFiles(String serverRoot, List<String> foundIncludes) { List<File> ret = new ArrayList<File>(); - File serverRootFile = new File(serverRoot); for (String path : foundIncludes) { - File check = new File(path); - if (check.isAbsolute()) { - ret.add(check); - } else { - for (File f : Glob.match(serverRootFile, path)) { - ret.add(f); - } + File check = new File(path); + File root = new File(check.isAbsolute() ? Glob.rootPortion(path) : serverRoot); + for (File f :Glob.match(root, path)){ + ret.add(f); } }
diff --git a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/augeas/AugeasTreeBuilderApache.java b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/augeas/AugeasTreeBuilderApache.java index 24c2e95..e6454b7 100644 --- a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/augeas/AugeasTreeBuilderApache.java +++ b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/augeas/AugeasTreeBuilderApache.java @@ -70,18 +70,16 @@ public class AugeasTreeBuilderApache implements AugeasTreeBuilder {
AugeasNode rootNode = new ApacheAugeasNode(ApacheAugeasTree.AUGEAS_DATA_PATH + rootPath, tree); tree.setRootNode(rootNode); - File rootFile = new File(apacheConfig.getServerRootPath()); // we need to know which files are related to each glob
for (String inclName : module.getIncludedGlobs()) {
List<File> files = new ArrayList<File>();
- if (inclName.indexOf(File.separatorChar) == 0) { - files.add(new File(inclName)); - } else - files.addAll(Glob.match(rootFile, inclName)); - + File check = new File(inclName); + File root = new File(check.isAbsolute() ? Glob.rootPortion(inclName) : apacheConfig.getServerRootPath()); + files.addAll(Glob.match(root, inclName)); + if (module.getExcludedGlobs() != null) Glob.excludeAll(files, module.getExcludedGlobs());
diff --git a/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/ApacheAugeasTest.java b/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/ApacheAugeasTest.java index 344ab1f..88a050b 100644 --- a/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/ApacheAugeasTest.java +++ b/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/ApacheAugeasTest.java @@ -3,6 +3,8 @@ package org.rhq.plugins.apache; import java.io.File; import java.util.List;
+import net.augeas.Augeas; + import org.rhq.augeas.AugeasProxy; import org.rhq.augeas.node.AugeasNode; import org.rhq.augeas.tree.AugeasTree; @@ -120,4 +122,13 @@ public class ApacheAugeasTest { //test if the updated augeas tree can be mapped to configuration stored at files in "loadconfig" temporary directory testLoadConfig(treeUpdate, container); } + + public boolean isAugeasInstalled(){ + try { + Augeas ag = new Augeas(); + }catch(Throwable e){ + return false; + } + return true; + } } diff --git a/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/ApachePluginTest.java b/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/ApachePluginTest.java index 890aa10..5a6cc7e 100644 --- a/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/ApachePluginTest.java +++ b/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/ApachePluginTest.java @@ -18,18 +18,16 @@ */ package org.rhq.plugins.apache;
-/* + import java.io.File; import java.util.ArrayList; import java.util.Collections; import java.util.HashSet; import java.util.List; import java.util.Set; - import org.testng.annotations.AfterSuite; import org.testng.annotations.BeforeSuite; import org.testng.annotations.Test; - import org.rhq.core.clientapi.server.discovery.InventoryReport; import org.rhq.core.domain.measurement.DataType; import org.rhq.core.domain.measurement.MeasurementData; @@ -43,7 +41,6 @@ import org.rhq.core.pc.plugin.PluginEnvironment; import org.rhq.core.pc.plugin.PluginManager; import org.rhq.core.pluginapi.inventory.ResourceComponent; import org.rhq.core.pluginapi.measurement.MeasurementFacet; -*/
/** * The unit tests for the JON Apache plugin. @@ -53,7 +50,6 @@ import org.rhq.core.pluginapi.measurement.MeasurementFacet; public class ApachePluginTest { private static final String PLUGIN_NAME = "Apache";
- /* @BeforeSuite public void start() { //System.out.println("java.class.path=" + System.getProperty("java.class.path")); @@ -71,6 +67,10 @@ public class ApachePluginTest { container.getInventoryManager().executeServerScanImmediately(); container.getInventoryManager().executeServiceScanImmediately(); ApacheAugeasTest test = new ApacheAugeasTest(); + if (!test.isAugeasInstalled()){ + System.out.println("Augeas is not installed."); + return; + } test.testMapping(container); } catch (Exception e) { e.printStackTrace(); @@ -153,5 +153,4 @@ public class ApachePluginTest { ApachePluginTest pluginTest = new ApachePluginTest(); pluginTest.start(); } - */ -} \ No newline at end of file +}
commit 6aeb3ea5ba9e3320fbb82d1b464708d69b40740b Author: John Mazzitelli mazz@redhat.com Date: Thu Aug 5 04:08:18 2010 -0400
start cleaning up, enhancing remote agent install. have to just pretty up the view, things work, but the UI just has a poor layout. also, the install steps are failing to display, need to fix that too. probably no more than a couple hours work left
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/install/remote/AgentInstallInfo.java b/modules/core/domain/src/main/java/org/rhq/core/domain/install/remote/AgentInstallInfo.java index c40440e..055b5f4 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/install/remote/AgentInstallInfo.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/install/remote/AgentInstallInfo.java @@ -26,6 +26,7 @@ import java.util.List; * @author Greg Hinkle */ public class AgentInstallInfo implements Serializable { + private static final long serialVersionUID = 1L;
private String serverAddress; private String agentAddress; @@ -34,12 +35,10 @@ public class AgentInstallInfo implements Serializable { private String owner; private String version;
- public List<AgentInstallStep> steps = new ArrayList<AgentInstallStep>();
public static final String SETUP_PROP = "rhq.agent.configuration-setup-flag";
- public static final String SERVER_ADDRESS_PROP = "rhq.agent.server.bind-address"; public static final String SERVER_PORT_PROP = "rhq.agent.server.bind-port";
@@ -49,8 +48,8 @@ public class AgentInstallInfo implements Serializable { public static final int DEFAULT_SERVER_PORT = 7080; public static final int DEFAULT_AGENT_PORT = 16163;
- public AgentInstallInfo() { + this(null, null); }
public AgentInstallInfo(String serverAddress, String agentAddress) { @@ -88,7 +87,6 @@ public class AgentInstallInfo implements Serializable { this.version = version; }
- public void addStep(AgentInstallStep step) { steps.add(step); } @@ -97,9 +95,6 @@ public class AgentInstallInfo implements Serializable { return steps; }
- - - public String getConfigurationStartString() { StringBuilder buf = new StringBuilder();
@@ -111,10 +106,9 @@ public class AgentInstallInfo implements Serializable {
buf.append("-D").append(SETUP_PROP).append("=").append("true"); buf.append(" "); - buf.append("-d "); + buf.append("--daemon ");
return buf.toString(); }
- } diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/install/remote/AgentInstallStep.java b/modules/core/domain/src/main/java/org/rhq/core/domain/install/remote/AgentInstallStep.java index 91b1d8e..6d65094 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/install/remote/AgentInstallStep.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/install/remote/AgentInstallStep.java @@ -21,43 +21,57 @@ package org.rhq.core.domain.install.remote; import java.io.Serializable;
/** -* @author Greg Hinkle -*/ + * Encapsulates the results of a SSH command that was issued by the remote agent installer utility. + * + * @author Greg Hinkle + * @author John Mazzitelli + */ public class AgentInstallStep implements Serializable { - int resultCode; - String command; - String description; - String result; - long time; + private static final long serialVersionUID = 1L; + + private String command; + private String description; + private int resultCode; + private String result; + private long duration;
public AgentInstallStep() { }
- public AgentInstallStep(int resultCode, String command, String description, String result, long time) { - this.resultCode = resultCode; + public AgentInstallStep(String command, String description, int resultCode, String result, long duration) { this.command = command; this.description = description; + this.resultCode = resultCode; this.result = result; - this.time = time; + this.duration = duration; }
- public int getResultCode() { - return resultCode; + public String getCommand() { + return command; }
public String getDescription() { return description; }
- public String getCommand() { - return command; + public int getResultCode() { + return resultCode; }
public String getResult() { return result; }
- public long getTime() { - return time; + public long getDuration() { + return duration; } + + @Override + public String toString() { + StringBuilder builder = new StringBuilder(); + builder.append("AgentInstallStep [description=").append(description).append(", result=").append(result).append( + ", resultCode=").append(resultCode).append(", duration=").append(duration).append("]"); + return builder.toString(); + } + } diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/install/remote/RemoteAccessInfo.java b/modules/core/domain/src/main/java/org/rhq/core/domain/install/remote/RemoteAccessInfo.java index 67857ce..b2ab566 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/install/remote/RemoteAccessInfo.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/install/remote/RemoteAccessInfo.java @@ -24,31 +24,32 @@ import java.io.Serializable; * @author Greg Hinkle */ public class RemoteAccessInfo implements Serializable { + private static final long serialVersionUID = 1L;
- private String host, user, pass; - byte[] key; + private String host; + private String user; + private String password; + private byte[] key; private int port = 22;
- public RemoteAccessInfo(String host, String user, byte[] key) { this.host = host; this.user = user; this.key = key; }
- public RemoteAccessInfo(String host, String user, String pass) { - this(host, 22, user, pass); + public RemoteAccessInfo(String host, String user, String password) { + this(host, 22, user, password); }
- public RemoteAccessInfo(String host, int port, String user, String pass) { + public RemoteAccessInfo(String host, int port, String user, String password) { this.host = host; this.port = port; this.user = user; - this.pass = pass; + this.password = password; }
public RemoteAccessInfo() { - }
public String getHost() { @@ -75,12 +76,12 @@ public class RemoteAccessInfo implements Serializable { this.user = user; }
- public String getPass() { - return pass; + public String getPassword() { + return password; }
- public void setPass(String pass) { - this.pass = pass; + public void setPassword(String password) { + this.password = password; }
public byte[] getKey() { diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/agent/install/RemoteAgentInstallView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/agent/install/RemoteAgentInstallView.java index 76c64a2..621771f 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/agent/install/RemoteAgentInstallView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/agent/install/RemoteAgentInstallView.java @@ -27,13 +27,9 @@ import java.util.ArrayList; import com.google.gwt.user.client.rpc.AsyncCallback; import com.smartgwt.client.types.Autofit; import com.smartgwt.client.types.ExpansionMode; -import com.smartgwt.client.types.TitleOrientation; import com.smartgwt.client.widgets.Canvas; import com.smartgwt.client.widgets.form.DynamicForm; -import com.smartgwt.client.widgets.form.FormItemIfFunction; import com.smartgwt.client.widgets.form.fields.ButtonItem; -import com.smartgwt.client.widgets.form.fields.CanvasItem; -import com.smartgwt.client.widgets.form.fields.FormItem; import com.smartgwt.client.widgets.form.fields.HeaderItem; import com.smartgwt.client.widgets.form.fields.PasswordItem; import com.smartgwt.client.widgets.form.fields.SpacerItem; @@ -48,12 +44,12 @@ import com.smartgwt.client.widgets.layout.VLayout;
import org.rhq.core.domain.install.remote.AgentInstallInfo; import org.rhq.core.domain.install.remote.AgentInstallStep; +import org.rhq.core.domain.install.remote.RemoteAccessInfo; import org.rhq.core.domain.measurement.MeasurementConverterClient; import org.rhq.core.domain.measurement.MeasurementUnits; import org.rhq.enterprise.gui.coregui.client.CoreGUI; import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup; import org.rhq.enterprise.gui.coregui.client.gwt.RemoteInstallGWTServiceAsync; -import org.rhq.core.domain.install.remote.RemoteAccessInfo; import org.rhq.enterprise.gui.coregui.client.util.message.Message;
/** @@ -74,17 +70,14 @@ public class RemoteAgentInstallView extends VLayout { protected void onInit() { super.onInit();
- addMember(getConnectionForm());
agentInfoLayout = new VLayout(); agentInfoLayout.setWidth100(); addMember(agentInfoLayout);
- }
- DynamicForm getConnectionForm() {
form = new DynamicForm(); @@ -93,23 +86,23 @@ public class RemoteAgentInstallView extends VLayout { HeaderItem connectionHeader = new HeaderItem(); connectionHeader.setValue("Connection Information");
- TextItem host = new TextItem("host"); + TextItem host = new TextItem("host", "Hostname"); host.setRequired(true);
- TextItem username = new TextItem("username"); + TextItem username = new TextItem("username", "Username"); username.setRequired(true);
- PasswordItem password = new PasswordItem("password"); -// password.setRequired(true); + PasswordItem password = new PasswordItem("password", "Password"); + // password.setRequired(true);
+ TextItem agentInstallPath = new TextItem("agentInstallPath", "Agent Install Path"); + agentInstallPath.setRequired(true);
ButtonItem statusCheck = new ButtonItem("updateStatus", "Update Status");
- final StaticTextItem agentStatus = new StaticTextItem("agentStatus", "Agent Status"); agentStatus.setRedrawOnChange(true);
- statusCheck.addClickHandler(new ClickHandler() { public void onClick(ClickEvent clickEvent) { if (form.validate()) { @@ -118,91 +111,93 @@ public class RemoteAgentInstallView extends VLayout { } });
- ButtonItem startButton = new ButtonItem("start", "Start Agent"); startButton.setEndRow(false); -// startButton.setShowIfCondition(new FormItemIfFunction() { -// public boolean execute(FormItem formItem, Object o, DynamicForm dynamicForm) { -// return form.getValue("agentStatus") != null && !"Agent Not Installed".equals(form.getValue("agentStatus")); -// } -// }); + // startButton.setShowIfCondition(new FormItemIfFunction() { + // public boolean execute(FormItem formItem, Object o, DynamicForm dynamicForm) { + // return form.getValue("agentStatus") != null && !"Agent Not Installed".equals(form.getValue("agentStatus")); + // } + // }); startButton.addClickHandler(new ClickHandler() { public void onClick(ClickEvent clickEvent) { - remoteInstallService.startAgent(getRemoteAccessInfo(), new AsyncCallback<String>() { - public void onFailure(Throwable caught) { - CoreGUI.getErrorHandler().handleError("Failed to start agent", caught); - } - - public void onSuccess(String result) { - CoreGUI.getMessageCenter().notify(new Message("Agent successfully started.", Message.Severity.Info)); - agentStatusCheck(); - } - }); + remoteInstallService.startAgent(getRemoteAccessInfo(), getAgentInstallPath(), + new AsyncCallback<String>() { + public void onFailure(Throwable caught) { + CoreGUI.getErrorHandler().handleError("Failed to start agent", caught); + } + + public void onSuccess(String result) { + CoreGUI.getMessageCenter().notify( + new Message("Agent successfully started.", Message.Severity.Info)); + agentStatusCheck(); + } + }); } });
- ButtonItem stopButton = new ButtonItem("stop", "Stop Agent"); stopButton.setStartRow(false); -// stopButton.setShowIfCondition(new FormItemIfFunction() { -// public boolean execute(FormItem formItem, Object o, DynamicForm dynamicForm) { -// return form.getValue("agentStatus") != null && !"Agent Not Installed".equals(form.getValue("agentStatus")); -// } -// }); + // stopButton.setShowIfCondition(new FormItemIfFunction() { + // public boolean execute(FormItem formItem, Object o, DynamicForm dynamicForm) { + // return form.getValue("agentStatus") != null && !"Agent Not Installed".equals(form.getValue("agentStatus")); + // } + // }); stopButton.addClickHandler(new ClickHandler() { public void onClick(ClickEvent clickEvent) { - remoteInstallService.stopAgent(getRemoteAccessInfo(), new AsyncCallback<String>() { - public void onFailure(Throwable caught) { - CoreGUI.getErrorHandler().handleError("Failed to stop agent", caught); - } - - public void onSuccess(String result) { - CoreGUI.getMessageCenter().notify(new Message("Agent successfully stopped.", Message.Severity.Info)); - agentStatusCheck(); - } - }); + remoteInstallService.stopAgent(getRemoteAccessInfo(), getAgentInstallPath(), + new AsyncCallback<String>() { + public void onFailure(Throwable caught) { + CoreGUI.getErrorHandler().handleError("Failed to stop agent", caught); + } + + public void onSuccess(String result) { + CoreGUI.getMessageCenter().notify( + new Message("Agent successfully stopped.", Message.Severity.Info)); + agentStatusCheck(); + } + }); } });
- ButtonItem installButton = new ButtonItem("install", "Install Agent"); installButton.setRedrawOnChange(true); -// installButton.setShowIfCondition(new FormItemIfFunction() { -// public boolean execute(FormItem formItem, Object o, DynamicForm dynamicForm) { -// return form.getValue("agentStatus") != null && "Agent Not Installed".equals(form.getValue("agentStatus")); -// } -// }); - + // installButton.setShowIfCondition(new FormItemIfFunction() { + // public boolean execute(FormItem formItem, Object o, DynamicForm dynamicForm) { + // return form.getValue("agentStatus") != null && "Agent Not Installed".equals(form.getValue("agentStatus")); + // } + // });
installButton.addClickHandler(new ClickHandler() { public void onClick(ClickEvent clickEvent) { - remoteInstallService.installAgent(getRemoteAccessInfo(), "/tmp/rhqAgent", new AsyncCallback<AgentInstallInfo>() { - public void onFailure(Throwable caught) { - CoreGUI.getErrorHandler().handleError("Failed to install agent", caught); - } + remoteInstallService.installAgent(getRemoteAccessInfo(), getAgentInstallPath(), + new AsyncCallback<AgentInstallInfo>() { + public void onFailure(Throwable caught) { + CoreGUI.getErrorHandler().handleError("Failed to install agent", caught); + }
- public void onSuccess(AgentInstallInfo result) { - CoreGUI.getMessageCenter().notify(new Message("Agent successfully installed.", Message.Severity.Info)); + public void onSuccess(AgentInstallInfo result) { + CoreGUI.getMessageCenter().notify( + new Message("Agent successfully installed.", Message.Severity.Info));
- for (Canvas child : agentInfoLayout.getChildren()) { - child.destroy(); + for (Canvas child : agentInfoLayout.getChildren()) { + child.destroy(); + } + agentInfoLayout.addMember(buildInstallInfoCanvas(result)); + agentInfoLayout.markForRedraw(); + agentStatusCheck(); } - agentInfoLayout.addMember(buildInstallInfoCanvas(result)); - agentInfoLayout.markForRedraw(); - agentStatusCheck(); - } - }); + }); } });
- - form.setFields(connectionHeader, host, username, password, statusCheck, agentStatus, new SpacerItem(), startButton, stopButton, new SpacerItem(), installButton, new SpacerItem()); + form.setFields(connectionHeader, host, username, password, agentInstallPath, statusCheck, agentStatus, + new SpacerItem(), startButton, stopButton, new SpacerItem(), installButton, new SpacerItem());
return form; }
private void agentStatusCheck() { - remoteInstallService.agentStatus(getRemoteAccessInfo(), new AsyncCallback<String>() { + remoteInstallService.agentStatus(getRemoteAccessInfo(), getAgentInstallPath(), new AsyncCallback<String>() { public void onFailure(Throwable caught) { form.setValue("agentStatus", caught.getMessage()); } @@ -213,7 +208,6 @@ public class RemoteAgentInstallView extends VLayout { }); }
- private Canvas buildInstallInfoCanvas(AgentInstallInfo info) {
VLayout installInfo = new VLayout(); @@ -239,7 +233,6 @@ public class RemoteAgentInstallView extends VLayout {
installInfo.addMember(infoForm);
- ListGrid listGrid = new ListGrid() { @Override protected Canvas getExpansionComponent(ListGridRecord record) { @@ -254,18 +247,15 @@ public class RemoteAgentInstallView extends VLayout { listGrid.setExpansionMode(ExpansionMode.DETAIL_FIELD); listGrid.setDetailField("result");
- listGrid.setAutoFitData(Autofit.VERTICAL); ListGridField step = new ListGridField("description", "Step"); ListGridField resultCode = new ListGridField("resultCode", "Result Code", 90); - ListGridField time = new ListGridField("time", "Time", 90); - + ListGridField duration = new ListGridField("duration", "Duration", 90);
- listGrid.setFields(step, resultCode, time); + listGrid.setFields(step, resultCode, duration);
listGrid.setData(getStepRecords(info));
- installInfo.addMember(listGrid);
for (ListGridRecord rec : listGrid.getRecords()) { @@ -284,20 +274,23 @@ public class RemoteAgentInstallView extends VLayout { rec.setAttribute("description", step.getDescription()); rec.setAttribute("result", step.getResult()); rec.setAttribute("resultCode", "" + step.getResultCode()); - rec.setAttribute("time", MeasurementConverterClient.format((double) step.getTime(), MeasurementUnits.MILLISECONDS, true)); + rec.setAttribute("duration", MeasurementConverterClient.format((double) step.getDuration(), + MeasurementUnits.MILLISECONDS, true)); steps.add(rec); }
return steps.toArray(new ListGridRecord[steps.size()]); }
- private RemoteAccessInfo getRemoteAccessInfo() { - RemoteAccessInfo info = new RemoteAccessInfo( - form.getValueAsString("host"), - form.getValueAsString("username"), - form.getValueAsString("password") - ); + String host = form.getValueAsString("host"); + String username = form.getValueAsString("username"); + String password = form.getValueAsString("password"); + RemoteAccessInfo info = new RemoteAccessInfo(host, username, password); return info; } + + private String getAgentInstallPath() { + return form.getValueAsString("agentInstallPath"); + } } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/RemoteInstallGWTService.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/RemoteInstallGWTService.java index d25a9d3..bd76bf9 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/RemoteInstallGWTService.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/RemoteInstallGWTService.java @@ -28,21 +28,25 @@ import org.rhq.core.domain.install.remote.AgentInstallInfo; import org.rhq.core.domain.install.remote.RemoteAccessInfo;
/** + * Provides methods to remotely install, start and stop agents over SSH. + * * @author Greg Hinkle + * @author John Mazzitelli */ public interface RemoteInstallGWTService extends RemoteService {
- // RemoteInstallManagerRemote - AgentInstallInfo agentInstallCheck(RemoteAccessInfo remoteAccessInfo); + // --- RemoteInstallManagerRemote + boolean agentInstallCheck(RemoteAccessInfo remoteAccessInfo, String agentInstallPath);
- AgentInstallInfo installAgent(RemoteAccessInfo remoteAccessInfo, String path); + AgentInstallInfo installAgent(RemoteAccessInfo remoteAccessInfo, String parentPath);
- String[] remotePathDiscover(RemoteAccessInfo remoteAccessInfo, String parentPath); + String startAgent(RemoteAccessInfo remoteAccessInfo, String agentInstallPath);
- String startAgent(RemoteAccessInfo remoteAccessInfo); + String stopAgent(RemoteAccessInfo remoteAccessInfo, String agentInstallPath);
- String stopAgent(RemoteAccessInfo remoteAccessInfo); + String agentStatus(RemoteAccessInfo remoteAccessInfo, String agentInstallPath);
- String agentStatus(RemoteAccessInfo remoteAccessInfo); + String findAgentInstallPath(RemoteAccessInfo remoteAccessInfo, String parentPath);
+ String[] remotePathDiscover(RemoteAccessInfo remoteAccessInfo, String parentPath); } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/RemoteInstallGWTServiceImpl.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/RemoteInstallGWTServiceImpl.java index 1a6af99..321cf77 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/RemoteInstallGWTServiceImpl.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/RemoteInstallGWTServiceImpl.java @@ -33,36 +33,42 @@ import org.rhq.enterprise.server.util.LookupUtil; * @author Greg Hinkle */ public class RemoteInstallGWTServiceImpl extends AbstractGWTServiceImpl implements RemoteInstallGWTService { + private static final long serialVersionUID = 1L;
private RemoteInstallManagerLocal remoteInstallManager = LookupUtil.getRemoteInstallManager();
- public AgentInstallInfo agentInstallCheck(RemoteAccessInfo remoteAccessInfo) { - return SerialUtility.prepare(remoteInstallManager.agentInstallCheck(getSessionSubject(), remoteAccessInfo), - "RemoteInstallService.agentInstallCheck"); + public boolean agentInstallCheck(RemoteAccessInfo remoteAccessInfo, String agentInstallPath) { + return SerialUtility.prepare(remoteInstallManager.agentInstallCheck(getSessionSubject(), remoteAccessInfo, + agentInstallPath), "RemoteInstallService.agentInstallCheck"); }
- public AgentInstallInfo installAgent(RemoteAccessInfo remoteAccessInfo, String path) { - return SerialUtility.prepare(remoteInstallManager.installAgent(getSessionSubject(), remoteAccessInfo, path), - "RemoteInstallService.installAgent"); + public AgentInstallInfo installAgent(RemoteAccessInfo remoteAccessInfo, String parentPath) { + return SerialUtility.prepare(remoteInstallManager.installAgent(getSessionSubject(), remoteAccessInfo, + parentPath), "RemoteInstallService.installAgent"); }
- public String[] remotePathDiscover(RemoteAccessInfo remoteAccessInfo, String parentPath) { - return SerialUtility.prepare((remoteInstallManager.remotePathDiscover(getSessionSubject(), remoteAccessInfo, parentPath)), - "RemoteInstallService.remotePathDiscover"); + public String startAgent(RemoteAccessInfo remoteAccessInfo, String agentInstallPath) { + return SerialUtility.prepare(remoteInstallManager.startAgent(getSessionSubject(), remoteAccessInfo, + agentInstallPath), "RemoteInstallService.startAgent"); + } + + public String stopAgent(RemoteAccessInfo remoteAccessInfo, String agentInstallPath) { + return SerialUtility.prepare(remoteInstallManager.stopAgent(getSessionSubject(), remoteAccessInfo, + agentInstallPath), "RemoteInstallService.stopAgent"); }
- public String startAgent(RemoteAccessInfo remoteAccessInfo) { - return SerialUtility.prepare(remoteInstallManager.startAgent(getSessionSubject(), remoteAccessInfo), - "RemoteInstallService.startAgent"); + public String agentStatus(RemoteAccessInfo remoteAccessInfo, String agentInstallPath) { + return SerialUtility.prepare(remoteInstallManager.agentStatus(getSessionSubject(), remoteAccessInfo, + agentInstallPath), "RemoteInstallService.agentStatus"); }
- public String stopAgent(RemoteAccessInfo remoteAccessInfo) { - return SerialUtility.prepare(remoteInstallManager.stopAgent(getSessionSubject(), remoteAccessInfo), - "RemoteInstallService.stopAgent"); + public String findAgentInstallPath(RemoteAccessInfo remoteAccessInfo, String parentPath) { + return SerialUtility.prepare((remoteInstallManager.findAgentInstallPath(getSessionSubject(), remoteAccessInfo, + parentPath)), "RemoteInstallService.findAgentInstallPath"); }
- public String agentStatus(RemoteAccessInfo remoteAccessInfo) { - return SerialUtility.prepare(remoteInstallManager.agentStatus(getSessionSubject(), remoteAccessInfo), - "RemoteInstallService.agentStatus"); + public String[] remotePathDiscover(RemoteAccessInfo remoteAccessInfo, String parentPath) { + return SerialUtility.prepare((remoteInstallManager.remotePathDiscover(getSessionSubject(), remoteAccessInfo, + parentPath)), "RemoteInstallService.remotePathDiscover"); } } diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/install/remote/RemoteInstallManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/install/remote/RemoteInstallManagerBean.java index 4763ed5..5488e6a 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/install/remote/RemoteInstallManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/install/remote/RemoteInstallManagerBean.java @@ -24,57 +24,95 @@ package org.rhq.enterprise.server.install.remote;
import javax.ejb.Stateless;
+import org.rhq.core.domain.auth.Subject; +import org.rhq.core.domain.authz.Permission; import org.rhq.core.domain.install.remote.AgentInstallInfo; import org.rhq.core.domain.install.remote.RemoteAccessInfo; import org.rhq.enterprise.server.authz.RequiredPermission; -import org.rhq.core.domain.auth.Subject; -import org.rhq.core.domain.authz.Permission;
/** + * Installs, starts and stops remote agents via SSH. + * * @author Greg Hinkle + * @author John Mazzitelli */ @Stateless public class RemoteInstallManagerBean implements RemoteInstallManagerLocal, RemoteInstallManagerRemote {
- @RequiredPermission(Permission.MANAGE_INVENTORY) - public AgentInstallInfo agentInstallCheck(Subject subject, RemoteAccessInfo remoteAccessInfo) { - SSHInstallUtility sshUtil = new SSHInstallUtility(remoteAccessInfo); - - return sshUtil.installAgent(); + public boolean agentInstallCheck(Subject subject, RemoteAccessInfo remoteAccessInfo, String agentInstallPath) { + SSHInstallUtility sshUtil = getSSHConnection(remoteAccessInfo); + try { + return sshUtil.agentInstallCheck(agentInstallPath); + } finally { + sshUtil.disconnect(); + } }
@RequiredPermission(Permission.MANAGE_INVENTORY) - public AgentInstallInfo installAgent(Subject subject, RemoteAccessInfo remoteAccessInfo, String path) { - SSHInstallUtility sshUtil = new SSHInstallUtility(remoteAccessInfo); + public AgentInstallInfo installAgent(Subject subject, RemoteAccessInfo remoteAccessInfo, String parentPath) { + SSHInstallUtility sshUtil = getSSHConnection(remoteAccessInfo); + try { + return sshUtil.installAgent(parentPath); + } finally { + sshUtil.disconnect(); + } + }
- return sshUtil.installAgent(); + @RequiredPermission(Permission.MANAGE_INVENTORY) + public String startAgent(Subject subject, RemoteAccessInfo remoteAccessInfo, String agentInstallPath) { + SSHInstallUtility sshUtil = getSSHConnection(remoteAccessInfo); + try { + return sshUtil.startAgent(agentInstallPath); + } finally { + sshUtil.disconnect(); + } }
@RequiredPermission(Permission.MANAGE_INVENTORY) - public String[] remotePathDiscover(Subject subject, RemoteAccessInfo remoteAccessInfo, String parentPath) { - SSHInstallUtility ssh = new SSHInstallUtility(remoteAccessInfo); - ssh.connect(); - return ssh.pathDiscovery(parentPath); + public String stopAgent(Subject subject, RemoteAccessInfo remoteAccessInfo, String agentInstallPath) { + SSHInstallUtility sshUtil = getSSHConnection(remoteAccessInfo); + try { + return sshUtil.stopAgent(agentInstallPath); + } finally { + sshUtil.disconnect(); + } + } + + public String agentStatus(Subject subject, RemoteAccessInfo remoteAccessInfo, String agentInstallPath) { + SSHInstallUtility sshUtil = getSSHConnection(remoteAccessInfo); + try { + return sshUtil.agentStatus(agentInstallPath); + } finally { + sshUtil.disconnect(); + } }
@RequiredPermission(Permission.MANAGE_INVENTORY) - public String startAgent(Subject subject, RemoteAccessInfo remoteAccessInfo) { - SSHInstallUtility sshUtil = new SSHInstallUtility(remoteAccessInfo); - return sshUtil.agentStart(); + public String findAgentInstallPath(Subject subject, RemoteAccessInfo remoteAccessInfo, String parentPath) { + SSHInstallUtility sshUtil = getSSHConnection(remoteAccessInfo); + try { + return sshUtil.findAgentInstallPath(parentPath); + } finally { + sshUtil.disconnect(); + } }
@RequiredPermission(Permission.MANAGE_INVENTORY) - public String stopAgent(Subject subject, RemoteAccessInfo remoteAccessInfo) { - SSHInstallUtility sshUtil = new SSHInstallUtility(remoteAccessInfo); - return sshUtil.agentStop(); + public String[] remotePathDiscover(Subject subject, RemoteAccessInfo remoteAccessInfo, String parentPath) { + SSHInstallUtility sshUtil = getSSHConnection(remoteAccessInfo); + try { + return sshUtil.pathDiscovery(parentPath); + } finally { + sshUtil.disconnect(); + } }
- public String agentStatus(Subject subject, RemoteAccessInfo remoteAccessInfo) { + private SSHInstallUtility getSSHConnection(RemoteAccessInfo remoteAccessInfo) { if (remoteAccessInfo.getHost() == null) { - return "Enter a host"; + throw new RuntimeException("Enter a host"); } SSHInstallUtility sshUtil = new SSHInstallUtility(remoteAccessInfo); - return sshUtil.agentStatus(); + return sshUtil; } } diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/install/remote/RemoteInstallManagerLocal.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/install/remote/RemoteInstallManagerLocal.java index c50dd52..47329fb 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/install/remote/RemoteInstallManagerLocal.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/install/remote/RemoteInstallManagerLocal.java @@ -24,27 +24,11 @@ package org.rhq.enterprise.server.install.remote;
import javax.ejb.Local;
-import org.rhq.core.domain.auth.Subject; -import org.rhq.core.domain.install.remote.AgentInstallInfo; -import org.rhq.core.domain.install.remote.RemoteAccessInfo; - /** + * Provides an interface to remotely install an RHQ Agent over SSH. + * * @author Greg Hinkle */ @Local -public interface RemoteInstallManagerLocal { - - - AgentInstallInfo agentInstallCheck(Subject subject, RemoteAccessInfo remoteAccessInfo); - - AgentInstallInfo installAgent(Subject subject, RemoteAccessInfo remoteAccessInfo, String path); - - String[] remotePathDiscover(Subject subject, RemoteAccessInfo remoteAccessInfo, String parentPath); - - String startAgent(Subject subject, RemoteAccessInfo remoteAccessInfo); - - String stopAgent(Subject subject, RemoteAccessInfo remoteAccessInfo); - - String agentStatus(Subject subject, RemoteAccessInfo remoteAccessInfo); - +public interface RemoteInstallManagerLocal extends RemoteInstallManagerRemote { } diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/install/remote/RemoteInstallManagerRemote.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/install/remote/RemoteInstallManagerRemote.java index 298f823..9b85f05 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/install/remote/RemoteInstallManagerRemote.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/install/remote/RemoteInstallManagerRemote.java @@ -23,28 +23,135 @@ package org.rhq.enterprise.server.install.remote;
import javax.ejb.Remote; +import javax.jws.WebMethod; +import javax.jws.WebParam; +import javax.jws.WebService; +import javax.jws.soap.SOAPBinding; + +import org.rhq.core.domain.auth.Subject; +import org.rhq.core.domain.install.remote.AgentInstallInfo; +import org.rhq.core.domain.install.remote.RemoteAccessInfo; +import org.rhq.enterprise.server.system.ServerVersion;
/** - * Future Remote API... + * Provides an interface to remotely install an RHQ Agent over SSH. * * @author Greg Hinkle */ +@SOAPBinding(style = SOAPBinding.Style.DOCUMENT) +@WebService(targetNamespace = ServerVersion.namespace) @Remote public interface RemoteInstallManagerRemote { - - /* To Be Updated, commented :-) and Released in next version... + /** + * Checks to see if an agent is installed in the given directory. * - AgentInstallInfo agentInstallCheck(Subject subject, RemoteAccessInfo remoteAccessInfo); + * @param subject the RHQ user making the request + * @param remoteAccessInfo the remote machine information and remote user SSH credentials + * @param agentInstallPath the directory to check + * + * @return true if an agent is installed in the given install path, false if not + */ + @WebMethod + boolean agentInstallCheck( // + @WebParam(name = "subject") Subject subject, // + @WebParam(name = "remoteAccessInfo") RemoteAccessInfo remoteAccessInfo, // + @WebParam(name = "agentInstallPath") String agentInstallPath);
- AgentInstallInfo installAgent(Subject subject, RemoteAccessInfo remoteAccessInfo, String path); + /** + * Installs the agent update binary distribution file to the given parent + * directory. Note that the agent's install directory will be a child of + * the given parent directory, with that child install directory usually + * named "rhq-agent". + * + * @param subject the RHQ user making the request + * @param remoteAccessInfo the remote machine information and remote user SSH credentials + * @param parentPath where the agent install directory will be + * + * @return info containing the results of the installation + */ + @WebMethod + AgentInstallInfo installAgent( // + @WebParam(name = "subject") Subject subject, // + @WebParam(name = "remoteAccessInfo") RemoteAccessInfo remoteAccessInfo, // + @WebParam(name = "parentPath") String parentPath);
- String[] remotePathDiscover(Subject subject, RemoteAccessInfo remoteAccessInfo, String parentPath); + /** + * Starts the agent located in the given installation directory. + * + * @param subject the RHQ user making the request + * @param remoteAccessInfo the remote machine information and remote user SSH credentials + * @param agentInstallPath where the agent is installed + * + * @return results of the start command + */ + @WebMethod + String startAgent( // + @WebParam(name = "subject") Subject subject, // + @WebParam(name = "remoteAccessInfo") RemoteAccessInfo remoteAccessInfo, // + @WebParam(name = "agentInstallPath") String agentInstallPath);
- String startAgent(Subject subject, RemoteAccessInfo remoteAccessInfo); + /** + * Stops the agent located in the given installation directory. + * + * @param subject the RHQ user making the request + * @param remoteAccessInfo the remote machine information and remote user SSH credentials + * @param agentInstallPath where the agent is installed + * + * @return results of the stop command + */ + @WebMethod + String stopAgent( // + @WebParam(name = "subject") Subject subject, // + @WebParam(name = "remoteAccessInfo") RemoteAccessInfo remoteAccessInfo, // + @WebParam(name = "agentInstallPath") String agentInstallPath);
- String stopAgent(Subject subject, RemoteAccessInfo remoteAccessInfo); + /** + * Determines the running status of the agent located in the given installation directory. + * + * @param subject the RHQ user making the request + * @param remoteAccessInfo the remote machine information and remote user SSH credentials + * @param agentInstallPath where the agent is installed + * + * @return results of the status command + */ + @WebMethod + String agentStatus( // + @WebParam(name = "subject") Subject subject, // + @WebParam(name = "remoteAccessInfo") RemoteAccessInfo remoteAccessInfo, // + @WebParam(name = "agentInstallPath") String agentInstallPath);
- String agentStatus(Subject subject, RemoteAccessInfo remoteAccessInfo); - */ + /** + * Given a root parent path to check, this will scan all subdirectories (recursively) + * to try to find where the agent is installed (if it is installed at all). If parentPath + * is null or empty, the more common locations where agents are normally installed will be + * scanned. Returns the path to the first location where an agent is probably installed; + * <code>null</code> is returned if it does not look like the agent is installed anywhere + * under the given parent path (or in any of the common locations, if parent path is null). + * + * @param subject the RHQ user making the request + * @param remoteAccessInfo the remote machine information and remote user SSH credentials + * @param parentPath the parent directory whose children files/directories are scanned + * + * @return the probable location of an installed agent; null if no agent install was found + */ + @WebMethod + String findAgentInstallPath( // + @WebParam(name = "subject") Subject subject, // + @WebParam(name = "remoteAccessInfo") RemoteAccessInfo remoteAccessInfo, // + @WebParam(name = "parentPath") String parentPath);
+ /** + * Returns the given parent directory's child files/directories. + * + * @param subject the RHQ user making the request + * @param remoteAccessInfo the remote machine information and remote user SSH credentials + * @param parentPath the parent directory whose children files/directories are returned + * + * @return names of the parent's child files/directories + */ + @WebMethod + String[] remotePathDiscover( // + @WebParam(name = "subject") Subject subject, // + @WebParam(name = "remoteAccessInfo") RemoteAccessInfo remoteAccessInfo, // + @WebParam(name = "parentPath") String parentPath); } diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/install/remote/SSHInstallUtility.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/install/remote/SSHInstallUtility.java index 3f94c86..c81b478 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/install/remote/SSHInstallUtility.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/install/remote/SSHInstallUtility.java @@ -22,12 +22,11 @@ */ package org.rhq.enterprise.server.install.remote;
-import java.io.BufferedReader; +import java.io.ByteArrayOutputStream; import java.io.File; -import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; -import java.io.ByteArrayOutputStream; +import java.util.Properties;
import com.jcraft.jsch.Channel; import com.jcraft.jsch.ChannelExec; @@ -41,40 +40,46 @@ import org.apache.commons.logging.LogFactory; import org.rhq.core.domain.install.remote.AgentInstallInfo; import org.rhq.core.domain.install.remote.AgentInstallStep; import org.rhq.core.domain.install.remote.RemoteAccessInfo; -import org.rhq.core.util.file.FileUtil; import org.rhq.enterprise.server.util.LookupUtil;
/** + * A utility object that is used to install, start and stop agents remotely over SSH. + * * @author Greg Hinkle + * @author John Mazzitelli */ public class SSHInstallUtility {
- static final int DEFAULT_BUFFER_SIZE = 4096; - static final long TIMEOUT = 10000L; - static final long POLL_TIMEOUT = 1000L; + private static final String RHQ_AGENT_LATEST_VERSION_PROP = "rhq-agent.latest.version"; + private static final int DEFAULT_BUFFER_SIZE = 4096; + private static final int CONNECTION_TIMEOUT = 30000; + private static final long TIMEOUT = 30000L; + private static final long POLL_TIMEOUT = 1000L;
private Log log = LogFactory.getLog(SSHInstallUtility.class);
private RemoteAccessInfo accessInfo; private Session session;
- private String agentDestination = "/tmp/rhqAgent"; // todo: Make configurable - - - private String agentFile = "rhq-enterprise-agent-3.0.0-SNAPSHOT.jar"; // Corrected below - private String agentPath = "/projects/rhq/dev-container/jbossas/server/default/deploy/rhq.ear/rhq-downloads/rhq-agent/" + agentFile; // corrected below - + private String agentFile; + private String agentPath; + private String agentVersion;
public SSHInstallUtility(RemoteAccessInfo accessInfo) { this.accessInfo = accessInfo;
try { File agentBinaryFile = LookupUtil.getAgentManager().getAgentUpdateBinaryFile(); - agentPath = agentBinaryFile.getCanonicalPath(); agentFile = agentBinaryFile.getName(); + agentPath = agentBinaryFile.getCanonicalPath(); + + Properties props = LookupUtil.getAgentManager().getAgentUpdateVersionFileContent(); + agentVersion = props.getProperty(RHQ_AGENT_LATEST_VERSION_PROP); } catch (Exception e) { - // Could not find agent file, leave the default - log.warn("Failed agent binary file lookup", e); + agentVersion = getClass().getPackage().getImplementationVersion(); + agentFile = "rhq-enterprise-agent-" + agentVersion + ".jar"; + agentPath = "/tmp/rhq-agent/" + agentFile; + log.warn("Failed agent binary file lookup - using [" + agentPath + "]", e); }
if (!new File(agentPath).exists()) { @@ -84,32 +89,27 @@ public class SSHInstallUtility { connect(); }
- public void connect() { try { JSch jsch = new JSch();
+ //if (accessInfo.getKey() != null) { + // jsch.addIdentity(...); + //}
-// if (accessInfo.getKey() != null) { - jsch.addIdentity("/Users/ghinkle/.ssh/ghinkleawskey.pem"); - -// } + session = jsch.getSession(accessInfo.getUser(), accessInfo.getHost(), accessInfo.getPort());
- session = jsch.getSession(accessInfo.getUser(), accessInfo.getHost(), 22); // accessInfo.getPort()); - - if (accessInfo.getPass() != null) { - session.setPassword(accessInfo.getPass()); + if (accessInfo.getPassword() != null) { + session.setPassword(accessInfo.getPassword()); }
- java.util.Properties config = new java.util.Properties(); + Properties config = new Properties(); config.put("StrictHostKeyChecking", "no"); session.setConfig(config);
- //session.connect(); - session.connect(30000); // making a connection with timeout. + session.connect(CONNECTION_TIMEOUT); // making a connection with timeout. } catch (JSchException e) { - e.printStackTrace(); - throw new RuntimeException(e); + throw new RuntimeException("Failed SSH connection", e); } }
@@ -117,36 +117,145 @@ public class SSHInstallUtility { session.disconnect(); }
+ public boolean agentInstallCheck(String agentInstallPath) { + String agentWrapperScript = buildAgentWrapperScriptPath(agentInstallPath); + + String value = executeCommand("if [ -f '" + agentWrapperScript + "' ]; then echo "exists"; fi", + "Agent Install Check"); + if (value == null || value.trim().length() == 0) { + return false; + } else { + return true; + } + } + + public AgentInstallInfo installAgent(String parentPath) { + + AgentInstallInfo info = new AgentInstallInfo(parentPath, accessInfo.getUser(), agentVersion); + + executeCommand("uname -a", "Machine uname", info); + executeCommand("java -version", "Java Version Check", info); + executeCommand("mkdir -p '" + parentPath + "'", "Create Agent Install Directory", info); + + log.info("Copying agent binary update distribution file to [" + accessInfo.getHost() + "]..."); + + long start = System.currentTimeMillis(); + boolean fileSent = SSHFileSend.sendFile(session, agentPath, parentPath); + AgentInstallStep scpStep = new AgentInstallStep("ssh copy '" + agentPath + "' -> '" + parentPath + "'", + "Remote copy the agent binary update distribution", 0, fileSent ? "Success" : "Failed", getTimeDiff(start)); + info.addStep(scpStep); + + log.info("Agent binary update distribution file copied"); + + executeCommand("cd '" + parentPath + "'", "Change to install directory", info); + executeCommand("java -jar '" + parentPath + "/" + agentFile + "' '--install=" + parentPath + "'", + "Install Agent", info); + + String serverAddress = LookupUtil.getServerManager().getServer().getAddress(); + + log.info("Will start new agent @ [" + accessInfo.getHost() + "] pointing to server @ [" + serverAddress + "]"); + + String agentScript = parentPath + "/rhq-agent/bin/rhq-agent.sh"; // NOTE: NOT the wrapper script + String properties = new AgentInstallInfo(serverAddress, accessInfo.getHost()).getConfigurationStartString(); + + // Tell the script to store a pid file to make the wrapper script work + String envCmd1 = "RHQ_AGENT_IN_BACKGROUND='" + parentPath + "/rhq-agent/bin/rhq-agent.pid'"; + String envCmd2 = "export RHQ_AGENT_IN_BACKGROUND"; + + String startCommand = envCmd1 + " ; " + envCmd2 + " ; nohup '" + agentScript + "' " + properties + " &"; + executeCommand(startCommand, "Start New Agent", info); + + return info; + } + + public String startAgent(String agentInstallPath) { + String agentWrapperScript = buildAgentWrapperScriptPath(agentInstallPath); + + return executeCommand("'" + agentWrapperScript + "' start", "Agent Start"); + } + + public String stopAgent(String agentInstallPath) { + String agentWrapperScript = buildAgentWrapperScriptPath(agentInstallPath); + + return executeCommand("'" + agentWrapperScript + "' stop", "Agent Stop"); + } + + public String agentStatus(String agentInstallPath) { + String agentWrapperScript = buildAgentWrapperScriptPath(agentInstallPath); + + if (!agentInstallCheck(agentInstallPath)) { + return "Agent Not Installed"; + } + + return executeCommand("'" + agentWrapperScript + "' status", "Agent Status"); + } + + public String findAgentInstallPath(String parentPath) { + if (parentPath == null || parentPath.trim().length() == 0) { + // user doesn't know where the agent might be - let's try to guess + String[] possiblePaths = new String[] { "/opt", "/usr/local", "/usr/share", "/rhq", + "/home/" + accessInfo.getUser() }; + for (String possiblePath : possiblePaths) { + String path = findAgentInstallPath(possiblePath); + if (path != null) { + return path; + } + } + return null; + } + + if (parentPath.endsWith("rhq-agent") || parentPath.endsWith("rhq-agent/")) { + return parentPath; // assume the caller's parent path *is* the agent install path + } + + String full = executeCommand("find '" + parentPath + "' -name rhq-agent -print", "Find Agent Install Path"); + if (full == null || full.trim().length() == 0) { + return null; + } + String[] results = full.split("\n"); + String path = results[0]; + return path; + }
public String[] pathDiscovery(String parentPath) { - String full = executeCommand("ls" + parentPath); + String full = executeCommand("ls -1 '" + parentPath + "'", "Path Discovery"); return full.split("\n"); }
+ private String buildAgentWrapperScriptPath(String agentInstallPath) { + // its possible the caller is giving us the parent install directory, whereas we + // want the child "rhq-agent" directory. Our find method will take care of this + // and return the path we want - if it doesn't, just use the path the user gave us + // and let the chips fall where they may + String foundAgentInstall = findAgentInstallPath(agentInstallPath); + if (foundAgentInstall != null) { + agentInstallPath = foundAgentInstall; + } + String agentWrapperScript = agentInstallPath + "/bin/rhq-agent-wrapper.sh"; + return agentWrapperScript; + }
private String executeCommand(String command, String description) { return executeCommand(command, description, new AgentInstallInfo(null, null)); }
- private String executeCommand(String command, String description, AgentInstallInfo info) { - log.info("Running: " + description); + log.info("Running SSH command [" + description + "]"); long start = System.currentTimeMillis(); String result = null; try { result = executeCommand(command); - info.addStep(new AgentInstallStep(0, command, description, result, (System.currentTimeMillis() - start))); + info.addStep(new AgentInstallStep(command, description, 0, result, getTimeDiff(start))); } catch (ExecuteException e) { - info.addStep(new AgentInstallStep(e.errorCode, command, e.message, description, (System.currentTimeMillis() - start))); + info.addStep(new AgentInstallStep(command, description, e.errorCode, e.getMessage(), getTimeDiff(start))); } - log.info("Result [" + description + "]: " + result); + log.info("Result of SSH command [" + description + "]: " + result); return result; }
- private String executeCommand(String command) { ChannelExec channel = null; - int exitStatus = 0; + int exitStatus = -1;
InputStream is = null; InputStream es = null; @@ -158,46 +267,63 @@ public class SSHInstallUtility { is = channel.getInputStream(); es = channel.getErrStream();
- channel.connect(10000); // connect and execute command + channel.connect(CONNECTION_TIMEOUT); // connect and execute command
String out = read(is, channel); String err = read(es, channel);
- // System.out.println("Output: " + out); + if (log.isTraceEnabled()) { + log.trace("SSH command output: " + out); + } + if (err.length() > 0) { - // System.out.println("Error [" + channel.getExitStatus() + "]: " + err); - if (channel.getExitStatus() != 0) { - throw new ExecuteException(channel.getExitStatus(), err); + exitStatus = channel.getExitStatus(); + + if (log.isTraceEnabled()) { + log.trace("SSH command error [" + exitStatus + "]: " + err); + } + + if (exitStatus != 0) { + throw new ExecuteException(exitStatus, err); } else if (out.length() == 0) { return err; } + } else { + exitStatus = 0; } + return out;
+ } catch (ExecuteException ee) { + throw ee; } catch (Exception e) { - e.printStackTrace(); + throw new ExecuteException(exitStatus, e.toString()); } finally { - try { - is.close(); - } catch (Exception e) { - e.printStackTrace(); + if (is != null) { + try { + is.close(); + } catch (Exception e) { + } } - try { - es.close(); - } catch (Exception e) { - e.printStackTrace(); + + if (es != null) { + try { + es.close(); + } catch (Exception e) { + } }
if (channel != null) { - channel.disconnect(); + try { + channel.disconnect(); + } catch (Exception e) { + log.error("Failed to disconnect", e); + } } } - return "exit: " + exitStatus; }
- - public String read(InputStream is, Channel channel) throws IOException { - // read command output + private String read(InputStream is, Channel channel) throws IOException { byte[] buffer = new byte[DEFAULT_BUFFER_SIZE]; ByteArrayOutputStream bos = new ByteArrayOutputStream(); final long endTime = System.currentTimeMillis() + TIMEOUT; @@ -211,116 +337,33 @@ public class SSHInstallUtility { } } if (channel.isClosed()) { - // int exitStatus = channel.getExitStatus(); - // System.out.println("exit status: " + exitStatus); + if (log.isDebugEnabled()) { + log.debug("SSH reading exit status=" + channel.getExitStatus()); + } break; } try { Thread.sleep(POLL_TIMEOUT); } catch (InterruptedException e) { - e.printStackTrace(); } } return bos.toString(); }
- - public String read2(BufferedReader reader) throws IOException { - StringBuilder buf = new StringBuilder(); - while (true) { - String line = reader.readLine(); - if (line == null) { - break; - } - buf.append(line + "\n"); - } - return buf.toString(); - } - - public String agentStop() { - String agentWrapperScript = agentDestination + "/rhq-agent/bin/rhq-agent-wrapper.sh "; - - return executeCommand(agentWrapperScript + " stop", "Agent Stop"); - } - - public String agentStart() { - String agentWrapperScript = agentDestination + "/rhq-agent/bin/rhq-agent-wrapper.sh "; - - return executeCommand(agentWrapperScript + " start", "Agent Start"); - } - - public String agentStatus() { - String agentWrapperScript = agentDestination + "/rhq-agent/bin/rhq-agent-wrapper.sh "; - - - String value = executeCommand("if [ -f " + agentWrapperScript + " ]; then echo "exists"; fi"); - if (value == null || value.length() == 0) { - return "Agent Not Installed"; - } - - return executeCommand(agentWrapperScript + " status", "Agent Status"); + private long getTimeDiff(long start) { + return System.currentTimeMillis() - start; }
- public AgentInstallInfo installAgent() { - - - AgentInstallInfo info = new AgentInstallInfo(agentDestination, accessInfo.getUser(), "3.0.0-SNAPSHOT"); - - - executeCommand("uname -a", "Machine uname", info); - - executeCommand("java -version", "Java Version Check", info); - - executeCommand("mkdir -p " + agentDestination, "Create Agent Install Directory", info); - - - log.info("Copying Agent Distribution"); - long start = System.currentTimeMillis(); - boolean fileSent = SSHFileSend.sendFile(session, agentPath, agentDestination); - info.addStep(new AgentInstallStep(0, "scp agent-installer", "Remote copy the agent distribution", fileSent ? "Success" : "Failed", (System.currentTimeMillis() - start))); - log.info("Agent Distribution Copied"); - - - executeCommand("cd " + agentDestination, "Change to install directory", info); - - executeCommand("java -jar " + agentDestination + "/" + agentFile + " --install=" + agentDestination, "Install Agent", info); - - - String serverAddress = LookupUtil.getCloudManager().getAllCloudServers().get(0).getAddress(); - - System.out.println("Install an agent at " + accessInfo.getHost() + " point to the server " + serverAddress); - - - AgentInstallInfo agentInfo = new AgentInstallInfo(serverAddress, accessInfo.getHost()); - - String agentScript = agentDestination + "/rhq-agent/bin/rhq-agent.sh "; - String agentWrapperScript = agentDestination + "/rhq-agent/bin/rhq-agent-wrapper.sh "; - - - String properties = agentInfo.getConfigurationStartString(); - - // Tell the script to store a pid file to make the wrapper script work - String pidFileProp = "export RHQ_AGENT_IN_BACKGROUND=" + agentDestination + "/rhq-agent/bin/rhq-agent.pid"; - - String startCommand = pidFileProp + " ; nohup " + agentScript + properties + "&"; - executeCommand(startCommand, "Agent Start With Configuration", info); - - - return info; - } - - - public static class ExecuteException extends RuntimeException { + private static class ExecuteException extends RuntimeException { + private static final long serialVersionUID = 1L; int errorCode; - String message;
public ExecuteException(int errorCode, String message) { + super(message); this.errorCode = errorCode; - this.message = message; } }
- public static void main(String[] args) throws IOException {
String pass = null; @@ -331,19 +374,18 @@ public class SSHInstallUtility {
SSHInstallUtility ssh = new SSHInstallUtility(info);
- System.out.println("Agent status: " + ssh.agentStatus()); - - System.out.println("Set server address: " + ssh.executeCommand("echo '71.162.145.95 ghinkle' >> /etc/hosts")); - - ssh.agentStop(); - - ssh.installAgent(); - - ssh.agentStatus(); - - ssh.agentStop(); - ssh.agentStatus(); - ssh.agentStart(); + String parentPath = "/tmp/new-remote-agent"; + String agentInstallPath = parentPath + "/rhq-agent"; + + System.out.println("Agent status: " + ssh.agentStatus(agentInstallPath)); + System.out.println("Agent stop: " + ssh.stopAgent(agentInstallPath)); + System.out.println("Agent find: " + ssh.findAgentInstallPath(parentPath)); + System.out.println("Agent install: " + ssh.installAgent(parentPath)); + System.out.println("Agent find: " + ssh.findAgentInstallPath(parentPath)); + System.out.println("Agent status: " + ssh.agentStatus(agentInstallPath)); + System.out.println("Agent stop: " + ssh.stopAgent(agentInstallPath)); + System.out.println("Agent status: " + ssh.agentStatus(agentInstallPath)); + System.out.println("Agent start: " + ssh.startAgent(agentInstallPath));
ssh.disconnect(); }
commit 7a2158b5c63e88c3af86f14a745adc5b61d4d9b8 Author: Heiko W. Rupp hwr@redhat.com Date: Wed Aug 4 17:11:09 2010 +0200
Comment out javadoc generation for now, as it breaks with some already defined package-info.java file.
diff --git a/pom.xml b/pom.xml index 19deabe..2a0db1c 100644 --- a/pom.xml +++ b/pom.xml @@ -1097,6 +1097,7 @@ <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jxr-plugin</artifactId> </plugin> +<!-- <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-javadoc-plugin</artifactId> @@ -1105,6 +1106,7 @@ <additionalJOption>-J-Xmx768m</additionalJOption> </configuration> </plugin> +--> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-report-plugin</artifactId>
commit 9d953ef12f55f76a00c0bd4a44397dfca1cb7252 Author: Heiko W. Rupp hwr@redhat.com Date: Wed Aug 4 16:52:30 2010 +0200
Add some more properties for maven site generation and unify some commons-codec and commons-logging versions
diff --git a/modules/core/domain/pom.xml b/modules/core/domain/pom.xml index 1cdaadc..0806490 100644 --- a/modules/core/domain/pom.xml +++ b/modules/core/domain/pom.xml @@ -27,7 +27,7 @@ <jboss-embeddable-ejb3.version>1.0.0.Alpha9</jboss-embeddable-ejb3.version> </properties>
- + <dependencies>
<!-- the notorious util jar --> @@ -52,7 +52,7 @@ <!-- NOTE: The version is defined in the root POM's dependencyManagement section. --> <scope>provided</scope> <!-- by JBossAS --> </dependency> - + <!-- required by PersistenceUtil and EJB3 Embedded --> <dependency> <groupId>hibernate-entitymanager</groupId> @@ -73,8 +73,8 @@ <artifactId>jaxb-api</artifactId> <!-- NOTE: The version is defined in the root POM's dependencyManagement section. --> </dependency> - - <!-- needed for hibernate Instrument task + + <!-- needed for hibernate Instrument task <dependency> <groupId>javassist</groupId> <artifactId>javassist</artifactId> @@ -82,8 +82,8 @@ <scope>runtime</scope> </dependency> --> - - <!-- needed for hibernate Instrument task + + <!-- needed for hibernate Instrument task <dependency> <groupId>commons-logging</groupId> <artifactId>commons-logging</artifactId> @@ -124,7 +124,7 @@ <!-- NOTE: The version is defined in the root POM's dependencyManagement section. --> <scope>test</scope> </dependency> - + <dependency> <groupId>com.h2database</groupId> <artifactId>h2</artifactId> @@ -188,7 +188,7 @@ <dependency> <groupId>commons-codec</groupId> <artifactId>commons-codec</artifactId> - <version>1.4</version> + <version>${commons-codec.version}</version> <scope>test</scope> </dependency>
@@ -239,7 +239,7 @@ <artifactId>smartgwt</artifactId> <version>2.0</version> </dependency>--> - + </dependencies>
<build> @@ -315,7 +315,7 @@ </plugins> </build>
- + <profiles>
<profile> @@ -345,7 +345,7 @@ Instrumentation is useful for various property-level things such as field-level lazy load. Using it turned out not t be a current option since the instrumented class carries with it hibernate imports that we can't put in the domain jar since it's used on the Agent and - in Remote Java Clients. But this worked, so here ya go... + in Remote Java Clients. But this worked, so here ya go... <taskdef name="instrument" classname="org.hibernate.tool.instrument.javassist.InstrumentTask"> @@ -364,13 +364,13 @@ <echo>*** Copying updated files from target${file.separator}classes${file.separator} to ${deployment.dir}${file.separator}...</echo> <copy todir="${deployment.dir}" verbose="${rhq.verbose}"> <fileset dir="target/classes" /> - </copy> + </copy> </tasks> </configuration> <goals> <goal>run</goal> </goals> - </execution> + </execution>
<execution> <id>undeploy</id> @@ -387,13 +387,13 @@ </goals> </execution>
- </executions> + </executions> </plugin>
</plugins> </build> </profile> - + <profile> <id>javadoc</id> <activation> @@ -411,11 +411,11 @@ <executions> <execution> <id>javadoc-domain-api</id> - <phase>compile</phase> + <phase>compile</phase> <goals> <goal>javadoc</goal> </goals> - <configuration> + <configuration> <doctitle>RHQ ${project.version} - Domain</doctitle> <reportOutputDirectory>${javadoc.outputDirectory}</reportOutputDirectory> <destDir>domain</destDir> @@ -436,7 +436,7 @@ </plugins> </build> </profile> - + </profiles>
diff --git a/modules/core/plugin-validator/pom.xml b/modules/core/plugin-validator/pom.xml index dfcdfde..5adfabf 100644 --- a/modules/core/plugin-validator/pom.xml +++ b/modules/core/plugin-validator/pom.xml @@ -1,15 +1,15 @@ <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion> - + <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> <version>4.0.0-SNAPSHOT</version> </parent> - + <groupId>org.rhq</groupId> - <artifactId>rhq-plugin-validator</artifactId> + <artifactId>rhq-plugin-validator</artifactId> <packaging>maven-plugin</packaging> <name>RHQ Plugin Validator Maven 2 Plugin</name>
@@ -20,23 +20,23 @@ <artifactId>rhq-core-domain</artifactId> <version>${project.version}</version> </dependency> - + <dependency> <groupId>org.rhq</groupId> <artifactId>rhq-core-util</artifactId> <version>${project.version}</version> </dependency> - + <dependency> <groupId>org.rhq</groupId> <artifactId>rhq-core-plugin-container</artifactId> <version>${project.version}</version> </dependency> - + <dependency> <groupId>commons-logging</groupId> <artifactId>commons-logging</artifactId> - <version>1.1</version> + <version>${commons-logging.version}</version> </dependency>
<dependency> @@ -50,7 +50,7 @@ <artifactId>maven-project</artifactId> <version>2.0.8</version> </dependency> - + </dependencies> - + </project> diff --git a/modules/helpers/bundleGen/pom.xml b/modules/helpers/bundleGen/pom.xml index 465a9eb..6b1bed8 100644 --- a/modules/helpers/bundleGen/pom.xml +++ b/modules/helpers/bundleGen/pom.xml @@ -60,7 +60,7 @@ <dependency> <groupId>commons-logging</groupId> <artifactId>commons-logging</artifactId> - <version>1.1</version> + <version>${commons-logging.version}</version> </dependency>
<dependency> diff --git a/modules/helpers/pluginGen/pom.xml b/modules/helpers/pluginGen/pom.xml index 940e46d..221ae3e 100644 --- a/modules/helpers/pluginGen/pom.xml +++ b/modules/helpers/pluginGen/pom.xml @@ -77,7 +77,7 @@ <dependency> <groupId>commons-logging</groupId> <artifactId>commons-logging</artifactId> - <version>1.1</version> + <version>${commons-logging.version}</version> </dependency>
<dependency> diff --git a/modules/helpers/pluginGen/src/main/resources/pom.ftl b/modules/helpers/pluginGen/src/main/resources/pom.ftl index eb02eb6..6aa89e9 100644 --- a/modules/helpers/pluginGen/src/main/resources/pom.ftl +++ b/modules/helpers/pluginGen/src/main/resources/pom.ftl @@ -208,7 +208,7 @@ <dependency> <groupId>commons-logging</groupId> <artifactId>commons-logging</artifactId> - <version>1.1</version> + <version>${r"${commons-logging.version}"}</version> </dependency> <dependency> <groupId>org.rhq</groupId> diff --git a/modules/plugins/hadoop/pom.xml b/modules/plugins/hadoop/pom.xml index c75e471..7fc2837 100644 --- a/modules/plugins/hadoop/pom.xml +++ b/modules/plugins/hadoop/pom.xml @@ -128,7 +128,7 @@ <dependency> <groupId>commons-logging</groupId> <artifactId>commons-logging</artifactId> - <version>1.1</version> + <version>${commons-logging.version}</version> </dependency> <dependency> <groupId>org.rhq</groupId> diff --git a/modules/plugins/irc/pom.xml b/modules/plugins/irc/pom.xml index 44a34b9..ab18766 100644 --- a/modules/plugins/irc/pom.xml +++ b/modules/plugins/irc/pom.xml @@ -147,7 +147,7 @@ <dependency> <groupId>commons-logging</groupId> <artifactId>commons-logging</artifactId> - <version>1.1</version> + <version>${commons-logging.version}</version> </dependency> <dependency> <groupId>org.rhq</groupId> diff --git a/modules/plugins/netservices/pom.xml b/modules/plugins/netservices/pom.xml index 67d24a0..9f35dbf 100644 --- a/modules/plugins/netservices/pom.xml +++ b/modules/plugins/netservices/pom.xml @@ -36,7 +36,7 @@ <dependency> <groupId>commons-codec</groupId> <artifactId>commons-codec</artifactId> - <version>1.2</version> + <version>${commons-codec.version}</version> </dependency>
diff --git a/modules/plugins/snmptrapd/pom.xml b/modules/plugins/snmptrapd/pom.xml index 89178cc..93bb45a 100644 --- a/modules/plugins/snmptrapd/pom.xml +++ b/modules/plugins/snmptrapd/pom.xml @@ -4,14 +4,14 @@ <groupId>org.rhq</groupId> <version>4.0.0-SNAPSHOT</version> </parent> - + <modelVersion>4.0.0</modelVersion> - + <groupId>org.rhq</groupId> <artifactId>rhq-snmptrapd-plugin</artifactId> <name>RHQ SnmpTrapd Plugin</name> <description>RHQ SnmpTrapd Plugin</description> - + <scm> <connection>scm:git:ssh://git.fedorahosted.org/git/rhq.git/modules/plugins/snmptrapd</connection> <developerConnection>scm:git:ssh://git.fedorahosted.org/git/rhq.git/modules/plugins/snmptrapd</developerConnection> @@ -20,7 +20,7 @@ <properties> <scm.module.path>modules/plugins/snmptrapd/</scm.module.path> </properties> - + <build> <plugins> <plugin> @@ -30,7 +30,7 @@ <target>1.5</target> </configuration> </plugin> - + <plugin> <artifactId>maven-dependency-plugin</artifactId> <version>2.0</version> @@ -73,11 +73,11 @@ --> </executions> </plugin> - - + + </plugins> </build> - + <profiles> <profile> <id>dev</id> @@ -116,13 +116,13 @@ <id>deploy-jar-meta-inf</id> <phase>package</phase> <configuration> - <tasks> - <property name="deployment.file" location="${rhq.deploymentDir}/${project.build.finalName}.jar" /> + <tasks> + <property name="deployment.file" location="${rhq.deploymentDir}/${project.build.finalName}.jar" /> <echo>*** Updating META-INF dir in ${deployment.file}...</echo> <unjar src="${project.build.directory}/${project.build.finalName}.jar" dest="${project.build.outputDirectory}"> <patternset><include name="META-INF/**" /></patternset> </unjar> - <jar destfile="${deployment.file}" manifest="${project.build.outputDirectory}/META-INF/MANIFEST.MF" update="true"> + <jar destfile="${deployment.file}" manifest="${project.build.outputDirectory}/META-INF/MANIFEST.MF" update="true"> </jar> </tasks> </configuration> @@ -130,7 +130,7 @@ <goal>run</goal> </goals> </execution> - + <execution> <id>undeploy</id> <phase>clean</phase> @@ -155,7 +155,7 @@
</profiles>
- + <dependencies> <dependency> <groupId>org.rhq</groupId> @@ -196,7 +196,7 @@ <dependency> <groupId>commons-logging</groupId> <artifactId>commons-logging</artifactId> - <version>1.1</version> + <version>${commons-logging.version}</version> <scope>provided</scope> </dependency> <dependency> diff --git a/modules/plugins/twitter/pom.xml b/modules/plugins/twitter/pom.xml index c27ee72..a6fdf4f 100644 --- a/modules/plugins/twitter/pom.xml +++ b/modules/plugins/twitter/pom.xml @@ -138,7 +138,7 @@ <dependency> <groupId>commons-logging</groupId> <artifactId>commons-logging</artifactId> - <version>1.1</version> + <version>${commons-logging.version}</version> </dependency> <dependency> <groupId>org.rhq</groupId> diff --git a/pom.xml b/pom.xml index 1708440..19deabe 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ <packaging>pom</packaging>
<name>RHQ</name> - <description>parent POM for all RHQ modules</description> + <description>RHQ is a server management and monitoring suite primarily targeted at JBoss software.</description> <url>http://rhq-project.org/</url> <inceptionYear>2008</inceptionYear>
@@ -27,7 +27,7 @@
<issueManagement> <system>bugzilla</system> - <url>https://bugzilla.redhat.com/</url> + <url>https://bugzilla.redhat.com/browse.cgi?product=RHQ%20Project</url> </issueManagement>
@@ -95,6 +95,7 @@ <quartz.version>1.6.5</quartz.version> <jna.version>3.2.5</jna.version> <twitter4j.version>2.1.2</twitter4j.version> + <commons-codec.version>1.4</commons-codec.version>
<!-- defaults for datasource used by integration tests - @@ -1085,15 +1086,134 @@ </profiles>
- <reporting> - <plugins> - <plugin> - <groupId>org.codehaus.mojo</groupId> - <artifactId>findbugs-maven-plugin</artifactId> - <version>2.3.1</version> - </plugin> - </plugins> - </reporting> + <reporting> + <plugins> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>findbugs-maven-plugin</artifactId> + <version>2.3.1</version> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-jxr-plugin</artifactId> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-javadoc-plugin</artifactId> + <configuration> + <aggregate>true</aggregate> + <additionalJOption>-J-Xmx768m</additionalJOption> + </configuration> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-surefire-report-plugin</artifactId> + </plugin> + </plugins> + </reporting> + + <!-- more properties related to mvn site --> + <licenses> + <license> + <name>GPL</name> + </license> + </licenses> + <developers> + <developer> + <name>Charles Crouch</name> + <timezone>-6</timezone> + </developer> + <developer> + <name>Jason Dobies</name> + <timezone>-5</timezone> + <roles> + <role>retired</role> + </roles> + </developer> + <developer> + <name>Filip Drabeck</name> + <timezone>+1</timezone> + </developer> + <developer> + <name>Greg Hinkle</name> + <timezone>-5</timezone> + </developer> + <developer> + <name>Lukas Krejci</name> + <timezone>+1</timezone> + </developer> + <developer> + <name>Joseph Marques</name> + <url>http://josephmarques.wordpress.com</url> + <timezone>-5</timezone> + </developer> + <developer> + <name>Fady Matar</name> + <timezone>+2</timezone> + <roles> + <role>retired</role> + </roles> + </developer> + <developer> + <name>John 'Mazz' Mazzitelli</name> + <timezone>-5</timezone> + </developer> + <developer> + <name>Simeon Pinder</name> + <timezone>-5</timezone> + </developer> + <developer> + <name>Heiko W. Rupp</name> + <email>hrupp@redhat.com</email> + <url>http://pilhuhn.blogspot.com</url> + <timezone>+1</timezone> + </developer> + <developer> + <name>John Sanda</name> + <timezone>-5</timezone> + </developer> + <developer> + <name>Jessica Sant</name> + <timezone>-5</timezone> + <roles> + <role>retired</role> + </roles> + </developer> + <developer> + <name>Jay Shaughnessy</name> + <timezone>-5</timezone> + </developer> + <developer> + <name>Ian Springer</name> + <timezone>-5</timezone> + </developer> + </developers> + <contributors> + <contributor> + <name>Alex Kiefer</name> + <timezone>+1</timezone> + </contributor> + <contributor> + <name>Rafael Torres Coelho Soares</name> + <timezone>-7</timezone> + </contributor> + </contributors> + <mailingLists> + <mailingList> + <name>User List</name> + <subscribe>https://fedorahosted.org/mailman/listinfo/rhq-users</subscribe> + <unsubscribe>https://fedorahosted.org/mailman/listinfo/rhq-users</unsubscribe> + <post>rhq-users@lists.fedorahosted.org</post> + <archive>https://fedorahosted.org/pipermail/rhq-users/</archive> + </mailingList> + <mailingList> + <name>Developer List</name> + <subscribe>https://fedorahosted.org/mailman/listinfo/rhq-devel</subscribe> + <unsubscribe>https://fedorahosted.org/mailman/listinfo/rhq-devel</unsubscribe> + <post>rhq-devel@lists.fedorahosted.org</post> + <archive>https://fedorahosted.org/pipermail/rhq-devel/</archive> + </mailingList> + </mailingLists>
</project>
commit 22de3f90d81a5ac1a3eadb69a61b40f6b1779e0f Author: Heiko W. Rupp hwr@redhat.com Date: Wed Aug 4 15:25:36 2010 +0200
Use jaxb-impl version from parent pom
diff --git a/modules/enterprise/server/plugins/rhnhosted/pom.xml b/modules/enterprise/server/plugins/rhnhosted/pom.xml index c1187d1..6634e78 100644 --- a/modules/enterprise/server/plugins/rhnhosted/pom.xml +++ b/modules/enterprise/server/plugins/rhnhosted/pom.xml @@ -87,7 +87,7 @@ <dependency> <groupId>com.sun.xml.bind</groupId> <artifactId>jaxb-impl</artifactId> - <version>2.1.3</version> + <version>${jaxb-impl.version}</version> </dependency> </dependencies>
commit a143b2509596a7c354972c94f8e187bc57523b9a Author: Ian Springer ian.springer@redhat.com Date: Tue Aug 3 16:36:31 2010 -0400
upgrade RichFaces from 3.3.3.CR1 to 3.3.3.Final; fix a couple bugs in jdk.sh
diff --git a/etc/dev-utils/jdk.sh b/etc/dev-utils/jdk.sh index 1e387f1..bf8193e 100755 --- a/etc/dev-utils/jdk.sh +++ b/etc/dev-utils/jdk.sh @@ -9,24 +9,23 @@ if [ $# -gt 1 ]; then echo "Usage: jdk n" >&2 echo "(sets JAVA_HOME to the value of the JAVAn_HOME environment variable, if it is defined)" >&2 echo >&2 - echo "For example, jdk 5 sets JAVA_HOME to the value of JAVA5_HOME." >&2 - return -fi - -if [ -z "${JAVA_HOME}" ]; then - echo "ERROR: JAVA_HOME is not defined." >&2 + echo "For example, 'jdk 6' sets JAVA_HOME to the value of JAVA6_HOME." >&2 return fi
export JAVA_HOME echo current JAVA_HOME=${JAVA_HOME} -if [ ! -d "${JAVA_HOME}" ]; then - echo "WARNING: ${JAVA_HOME} does not exist." -elif [ ! -f "${JAVA_HOME}/bin/java" ]; then - echo "WARNING: ${JAVA_HOME}/bin/java does not exist." -fi
if [ $# -eq 0 ]; then + if [ -z "${JAVA_HOME}" ]; then + echo "JAVA_HOME is not defined." >&2 + else + if [ ! -d "${JAVA_HOME}" ]; then + echo "${JAVA_HOME} does not exist." >&2 + elif [ ! -f "${JAVA_HOME}/bin/java" ]; then + echo "${JAVA_HOME}/bin/java does not exist." >&2 + fi + fi return fi
@@ -67,7 +66,8 @@ if [ ! -f "${_NEW_JAVA_HOME}/bin/java" ]; then return fi
+JAVA_HOME=${_NEW_JAVA_HOME} +echo "new JAVA_HOME=${JAVA_HOME}" +"${JAVA_HOME}/bin/java" -version unset _JDK_VERSION _NEW_JAVA_HOME
-JAVA_HOME=${_NEW_JAVA_HOME} -echo "New JAVA_HOME=${JAVA_HOME}" diff --git a/modules/enterprise/gui/base-perspective-jar/pom.xml b/modules/enterprise/gui/base-perspective-jar/pom.xml index c917be9..e09921f 100644 --- a/modules/enterprise/gui/base-perspective-jar/pom.xml +++ b/modules/enterprise/gui/base-perspective-jar/pom.xml @@ -28,7 +28,7 @@ used once it's released. --> <seam.version>2.1.0.SP1</seam.version> <jboss-el.version>1.0_02.CR5</jboss-el.version> - <richfaces.version>3.3.2.SR1</richfaces.version> + <richfaces.version>3.3.3.Final</richfaces.version> </properties>
<dependencyManagement> diff --git a/pom.xml b/pom.xml index 521bc40..1708440 100644 --- a/pom.xml +++ b/pom.xml @@ -89,7 +89,7 @@ <postgresql.version>8.4-701.jdbc3</postgresql.version> <h2.version>1.1.117</h2.version> <jtds.version>1.2.2</jtds.version> - <richfaces.version>3.3.3.CR1</richfaces.version> + <richfaces.version>3.3.3.Final</richfaces.version> <jline.version>0.9.94</jline.version> <sigar.version>1.6.5.132</sigar.version> <quartz.version>1.6.5</quartz.version>
commit 7b884588ee0538748eb34b24cb83fa13fe5026d8 Author: Heiko W. Rupp hwr@redhat.com Date: Tue Aug 3 20:27:41 2010 +0200
Even more channel->repo fallout fixing
diff --git a/modules/plugins/irc/pom.xml b/modules/plugins/irc/pom.xml index def88d2..44a34b9 100644 --- a/modules/plugins/irc/pom.xml +++ b/modules/plugins/irc/pom.xml @@ -11,13 +11,13 @@ <groupId>org.rhq</groupId> <version>4.0.0-SNAPSHOT</version> </parent> - + <groupId>org.rhq</groupId> <artifactId>rhq-irc-plugin</artifactId> <packaging>jar</packaging> - + <name>RHQ IRC Server Plugin</name> - <description>Remote monitoring of IRC repos</description> + <description>Remote monitoring of IRC channels</description>
<build> <plugins> @@ -167,12 +167,12 @@ <version>${project.version}</version> <scope>provided</scope> </dependency> - + <dependency> <groupId>pircbot</groupId> <artifactId>pircbot</artifactId> <version>1.4.2</version> - </dependency> + </dependency> </dependencies>
</project> diff --git a/modules/plugins/irc/src/main/java/org/rhq/plugins/irc/IRCChannelComponent.java b/modules/plugins/irc/src/main/java/org/rhq/plugins/irc/IRCChannelComponent.java new file mode 100644 index 0000000..3475b00 --- /dev/null +++ b/modules/plugins/irc/src/main/java/org/rhq/plugins/irc/IRCChannelComponent.java @@ -0,0 +1,134 @@ +package org.rhq.plugins.irc; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.rhq.core.domain.configuration.Configuration; +import org.rhq.core.domain.event.Event; +import org.rhq.core.domain.event.EventSeverity; +import org.rhq.core.domain.measurement.AvailabilityType; +import org.rhq.core.domain.measurement.MeasurementDataNumeric; +import org.rhq.core.domain.measurement.MeasurementReport; +import org.rhq.core.domain.measurement.MeasurementScheduleRequest; +import org.rhq.core.pluginapi.event.EventContext; +import org.rhq.core.pluginapi.inventory.InvalidPluginConfigurationException; +import org.rhq.core.pluginapi.inventory.ResourceComponent; +import org.rhq.core.pluginapi.inventory.ResourceContext; +import org.rhq.core.pluginapi.measurement.MeasurementFacet; +import org.rhq.core.pluginapi.operation.OperationContext; +import org.rhq.core.pluginapi.operation.OperationFacet; +import org.rhq.core.pluginapi.operation.OperationResult; + +import java.util.Set; +import java.util.concurrent.atomic.AtomicLong; + + +/** + * @author Greg Hinkle + */ +public class IRCChannelComponent implements ResourceComponent<IRCServerComponent>, MeasurementFacet, OperationFacet { + + private final Log log = LogFactory.getLog(this.getClass()); + + + private ResourceContext<IRCServerComponent> context; + private EventContext eventContext; + private String channel; + + private AtomicLong messageCount = new AtomicLong(); + + + + /** + * Return availability of this resource + * + * @see org.rhq.core.pluginapi.inventory.ResourceComponent#getAvailability() + */ + public AvailabilityType getAvailability() { + if (!context.getParentResourceComponent().isInChannel(channel)) { + context.getParentResourceComponent().registerChannel(this); + } + + // TODO supply real implementation + return AvailabilityType.UP; + } + + + /** + * Start the resource connection + * + * @see org.rhq.core.pluginapi.inventory.ResourceComponent#start(org.rhq.core.pluginapi.inventory.ResourceContext) + */ + public void start(ResourceContext<IRCServerComponent> context) throws InvalidPluginConfigurationException, Exception { + this.context = context; + Configuration conf = context.getPluginConfiguration(); + // TODO add code to start the resource / connection to it + channel = conf.getSimple(IRCChannelDiscoveryComponent.CONFIG_CHANNEL).getStringValue(); + + eventContext = context.getEventContext(); + + context.getParentResourceComponent().registerChannel(this); + } + + + /** + * Tear down the rescource connection + * + * @see org.rhq.core.pluginapi.inventory.ResourceComponent#stop() + */ + public void stop() { + + context.getParentResourceComponent().unregisterChannel(this); + + } + + + /** + * Gather measurement data + * + * @see org.rhq.core.pluginapi.measurement.MeasurementFacet#getValues(org.rhq.core.domain.measurement.MeasurementReport, java.util.Set) + */ + public void getValues(MeasurementReport report, Set<MeasurementScheduleRequest> metrics) throws Exception { + + for (MeasurementScheduleRequest req : metrics) { + if (req.getName().equals("users")) { + double count = this.context.getParentResourceComponent().getUserCount(this.getChannel()); + MeasurementDataNumeric res = new MeasurementDataNumeric(req, count); + report.addData(res); + } else if (req.getName().equals("messages")) { + report.addData( new MeasurementDataNumeric(req, Double.valueOf(messageCount.get()))); + } + } + } + + + + /** + * Invokes the passed operation on the managed resource + * + * @param name Name of the operation + * @param params The method parameters + * @return An operation result + * @see org.rhq.core.pluginapi.operation.OperationFacet + */ + public OperationResult invokeOperation(String name, Configuration params) throws Exception { + + OperationResult res = new OperationResult(); + if ("sendMessage".equals(name)) { + String message = params.getSimple("message").getStringValue(); + context.getParentResourceComponent().sendMessage(channel, message); + } + return res; + } + + + public String getChannel() { + return channel; + } + + public void acceptMessage(String sender, String login, String hostname, String message) { + Event event = new Event("message", sender, System.currentTimeMillis(), EventSeverity.INFO, message); + this.eventContext.publishEvent(event); + + this.messageCount.incrementAndGet(); + } +} \ No newline at end of file diff --git a/modules/plugins/irc/src/main/java/org/rhq/plugins/irc/IRCChannelDiscoveryComponent.java b/modules/plugins/irc/src/main/java/org/rhq/plugins/irc/IRCChannelDiscoveryComponent.java new file mode 100644 index 0000000..e5a9a96 --- /dev/null +++ b/modules/plugins/irc/src/main/java/org/rhq/plugins/irc/IRCChannelDiscoveryComponent.java @@ -0,0 +1,53 @@ +package org.rhq.plugins.irc; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.rhq.core.domain.configuration.Configuration; +import org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails; +import org.rhq.core.pluginapi.inventory.ResourceDiscoveryComponent; +import org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext; + +import java.util.HashSet; +import java.util.Set; +import java.util.List; + + +/** + * Discovery class + * @author Greg Hinkle + */ +public class IRCChannelDiscoveryComponent implements ResourceDiscoveryComponent<IRCServerComponent> { + + private final Log log = LogFactory.getLog(this.getClass()); + + public static final String CONFIG_CHANNEL = "channelName"; + + /** + * Run the discovery + */ + public Set<DiscoveredResourceDetails> discoverResources(ResourceDiscoveryContext discoveryContext) throws Exception { + + Set<DiscoveredResourceDetails> discoveredResources = new HashSet<DiscoveredResourceDetails>(); + + List<Configuration> contextPluginConfigurations = discoveryContext.getPluginConfigurations(); + for (Configuration config : contextPluginConfigurations) { + + String channel = config.getSimple(CONFIG_CHANNEL).getStringValue(); + + DiscoveredResourceDetails details = + new DiscoveredResourceDetails( + discoveryContext.getResourceType(), + channel, + "Channel " + channel, + null, null, + config, + null + ); + + discoveredResources.add(details); + } + + return discoveredResources; + + } +} \ No newline at end of file diff --git a/modules/plugins/irc/src/main/java/org/rhq/plugins/irc/IRCRepoComponent.java b/modules/plugins/irc/src/main/java/org/rhq/plugins/irc/IRCRepoComponent.java deleted file mode 100644 index e39968d..0000000 --- a/modules/plugins/irc/src/main/java/org/rhq/plugins/irc/IRCRepoComponent.java +++ /dev/null @@ -1,134 +0,0 @@ -package org.rhq.plugins.irc; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.rhq.core.domain.configuration.Configuration; -import org.rhq.core.domain.event.Event; -import org.rhq.core.domain.event.EventSeverity; -import org.rhq.core.domain.measurement.AvailabilityType; -import org.rhq.core.domain.measurement.MeasurementDataNumeric; -import org.rhq.core.domain.measurement.MeasurementReport; -import org.rhq.core.domain.measurement.MeasurementScheduleRequest; -import org.rhq.core.pluginapi.event.EventContext; -import org.rhq.core.pluginapi.inventory.InvalidPluginConfigurationException; -import org.rhq.core.pluginapi.inventory.ResourceComponent; -import org.rhq.core.pluginapi.inventory.ResourceContext; -import org.rhq.core.pluginapi.measurement.MeasurementFacet; -import org.rhq.core.pluginapi.operation.OperationContext; -import org.rhq.core.pluginapi.operation.OperationFacet; -import org.rhq.core.pluginapi.operation.OperationResult; - -import java.util.Set; -import java.util.concurrent.atomic.AtomicLong; - - -/** - * @author Greg Hinkle - */ -public class IRCRepoComponent implements ResourceComponent<IRCServerComponent>, MeasurementFacet, OperationFacet { - - private final Log log = LogFactory.getLog(this.getClass()); - - - private ResourceContext<IRCServerComponent> context; - private EventContext eventContext; - private String repo; - - private AtomicLong messageCount = new AtomicLong(); - - - - /** - * Return availability of this resource - * - * @see org.rhq.core.pluginapi.inventory.ResourceComponent#getAvailability() - */ - public AvailabilityType getAvailability() { - if (!context.getParentResourceComponent().isInRepo(repo)) { - context.getParentResourceComponent().registerRepo(this); - } - - // TODO supply real implementation - return AvailabilityType.UP; - } - - - /** - * Start the resource connection - * - * @see org.rhq.core.pluginapi.inventory.ResourceComponent#start(org.rhq.core.pluginapi.inventory.ResourceContext) - */ - public void start(ResourceContext<IRCServerComponent> context) throws InvalidPluginConfigurationException, Exception { - this.context = context; - Configuration conf = context.getPluginConfiguration(); - // TODO add code to start the resource / connection to it - repo = conf.getSimple(IRCRepoDiscoveryComponent.CONFIG_REPO).getStringValue(); - - eventContext = context.getEventContext(); - - context.getParentResourceComponent().registerRepo(this); - } - - - /** - * Tear down the rescource connection - * - * @see org.rhq.core.pluginapi.inventory.ResourceComponent#stop() - */ - public void stop() { - - context.getParentResourceComponent().unregisterRepo(this); - - } - - - /** - * Gather measurement data - * - * @see org.rhq.core.pluginapi.measurement.MeasurementFacet#getValues(org.rhq.core.domain.measurement.MeasurementReport, java.util.Set) - */ - public void getValues(MeasurementReport report, Set<MeasurementScheduleRequest> metrics) throws Exception { - - for (MeasurementScheduleRequest req : metrics) { - if (req.getName().equals("users")) { - double count = this.context.getParentResourceComponent().getUserCount(this.getRepo()); - MeasurementDataNumeric res = new MeasurementDataNumeric(req, count); - report.addData(res); - } else if (req.getName().equals("messages")) { - report.addData( new MeasurementDataNumeric(req, Double.valueOf(messageCount.get()))); - } - } - } - - - - /** - * Invokes the passed operation on the managed resource - * - * @param name Name of the operation - * @param params The method parameters - * @return An operation result - * @see org.rhq.core.pluginapi.operation.OperationFacet - */ - public OperationResult invokeOperation(String name, Configuration params) throws Exception { - - OperationResult res = new OperationResult(); - if ("sendMessage".equals(name)) { - String message = params.getSimple("message").getStringValue(); - context.getParentResourceComponent().sendMessage(repo, message); - } - return res; - } - - - public String getRepo() { - return repo; - } - - public void acceptMessage(String sender, String login, String hostname, String message) { - Event event = new Event("message", sender, System.currentTimeMillis(), EventSeverity.INFO, message); - this.eventContext.publishEvent(event); - - this.messageCount.incrementAndGet(); - } -} \ No newline at end of file diff --git a/modules/plugins/irc/src/main/java/org/rhq/plugins/irc/IRCRepoDiscoveryComponent.java b/modules/plugins/irc/src/main/java/org/rhq/plugins/irc/IRCRepoDiscoveryComponent.java deleted file mode 100644 index a1aab8d..0000000 --- a/modules/plugins/irc/src/main/java/org/rhq/plugins/irc/IRCRepoDiscoveryComponent.java +++ /dev/null @@ -1,53 +0,0 @@ -package org.rhq.plugins.irc; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.rhq.core.domain.configuration.Configuration; -import org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails; -import org.rhq.core.pluginapi.inventory.ResourceDiscoveryComponent; -import org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext; - -import java.util.HashSet; -import java.util.Set; -import java.util.List; - - -/** - * Discovery class - * @author Greg Hinkle - */ -public class IRCRepoDiscoveryComponent implements ResourceDiscoveryComponent<IRCServerComponent> { - - private final Log log = LogFactory.getLog(this.getClass()); - - public static final String CONFIG_REPO = "repoName"; - - /** - * Run the discovery - */ - public Set<DiscoveredResourceDetails> discoverResources(ResourceDiscoveryContext discoveryContext) throws Exception { - - Set<DiscoveredResourceDetails> discoveredResources = new HashSet<DiscoveredResourceDetails>(); - - List<Configuration> contextPluginConfigurations = discoveryContext.getPluginConfigurations(); - for (Configuration config : contextPluginConfigurations) { - - String repo = config.getSimple(CONFIG_REPO).getStringValue(); - - DiscoveredResourceDetails details = - new DiscoveredResourceDetails( - discoveryContext.getResourceType(), - repo, - "Repo " + repo, - null, null, - config, - null - ); - - discoveredResources.add(details); - } - - return discoveredResources; - - } -} \ No newline at end of file diff --git a/modules/plugins/irc/src/main/java/org/rhq/plugins/irc/IRCServerComponent.java b/modules/plugins/irc/src/main/java/org/rhq/plugins/irc/IRCServerComponent.java index 2ba1b34..5f169e8 100644 --- a/modules/plugins/irc/src/main/java/org/rhq/plugins/irc/IRCServerComponent.java +++ b/modules/plugins/irc/src/main/java/org/rhq/plugins/irc/IRCServerComponent.java @@ -1,6 +1,5 @@ package org.rhq.plugins.irc;
-import java.util.Set; import java.util.Map; import java.util.HashMap; import java.util.Arrays; @@ -30,14 +29,14 @@ public class IRCServerComponent implements ResourceComponent, OperationFacet {
private Bot bot;
- private Map<String, IRCRepoComponent> repos = new HashMap<String, IRCRepoComponent>(); + private Map<String, IRCChannelComponent> channels = new HashMap<String, IRCChannelComponent>();
private String host; private String port; private String nick; - private List<String> activeRepos; + private List<String> activeChannels;
- private Map<String, RepoInfo> info = new HashMap<String, RepoInfo>(); + private Map<String, ChannelInfo> info = new HashMap<String, ChannelInfo>();
/** @@ -55,7 +54,7 @@ public class IRCServerComponent implements ResourceComponent, OperationFacet { log.warn("Failure to connect to IRC server " + host + " reason: " + e.getMessage()); } } - activeRepos = Arrays.asList(this.bot.getChannels()); + activeChannels = Arrays.asList(this.bot.getChannels());
return this.bot.isConnected() ? AvailabilityType.UP : AvailabilityType.DOWN; } @@ -81,61 +80,61 @@ public class IRCServerComponent implements ResourceComponent, OperationFacet {
}
- public void registerRepo(IRCRepoComponent repoComponent) { - this.repos.put(repoComponent.getRepo(), repoComponent); + public void registerChannel(IRCChannelComponent channelComponent) { + this.channels.put(channelComponent.getChannel(), channelComponent);
- this.bot.joinChannel(repoComponent.getRepo()); - updateRepos(); + this.bot.joinChannel(channelComponent.getChannel()); + updateChannels(); }
- public void unregisterRepo(IRCRepoComponent repoComponent) { - this.bot.partChannel(repoComponent.getRepo()); - this.repos.remove(repoComponent.getRepo()); + public void unregisterChannel(IRCChannelComponent channelComponent) { + this.bot.partChannel(channelComponent.getChannel()); + this.channels.remove(channelComponent.getChannel()); }
- public boolean isInRepo(String repo) { - return activeRepos.contains(repo); + public boolean isInChannel(String channel) { + return activeChannels.contains(channel); }
- public void sendMessage(String repo, String message) { - this.bot.sendMessage(repo, message); + public void sendMessage(String channel, String message) { + this.bot.sendMessage(channel, message); }
public OperationResult invokeOperation(String name, Configuration parameters) throws InterruptedException, Exception { - if (name.equals("listRepos")) { + if (name.equals("listChannels")) { OperationResult result = new OperationResult(); Configuration resultConfig = result.getComplexResults(); - PropertyList repoList = new PropertyList("repoList"); + PropertyList channelList = new PropertyList("channelList");
this.bot.listChannels();
Thread.sleep(5000); // TODO is this long enough... any other way to know when the list is done?
- for (RepoInfo repoInfo : info.values()) { - PropertyMap repoMap = new PropertyMap("repoMap"); - repoMap.put(new PropertySimple("repo", repoInfo.repo)); - repoMap.put(new PropertySimple("userCount", repoInfo.userCount)); - repoMap.put(new PropertySimple("topic", repoInfo.topic)); - repoList.add(repoMap); + for (ChannelInfo channelInfo : info.values()) { + PropertyMap channelMap = new PropertyMap("channelMap"); + channelMap.put(new PropertySimple("channel", channelInfo.channel)); + channelMap.put(new PropertySimple("userCount", channelInfo.userCount)); + channelMap.put(new PropertySimple("topic", channelInfo.topic)); + channelList.add(channelMap); } - resultConfig.put(repoList); + resultConfig.put(channelList); return result; } return null; }
- public int getUserCount(String repo) { - return this.bot.getUsers(repo).length; + public int getUserCount(String channel) { + return this.bot.getUsers(channel).length; }
- public static class RepoInfo { - String repo; + public static class ChannelInfo { + String channel; int userCount; String topic;
- public RepoInfo(String repo, int userCount, String topic) { - this.repo = repo; + public ChannelInfo(String channel, int userCount, String topic) { + this.channel = channel; this.userCount = userCount; this.topic = topic; } @@ -147,19 +146,20 @@ public class IRCServerComponent implements ResourceComponent, OperationFacet { this.setName(nick); }
- protected void onRepoInfo(String repo, int userCount, String topic) { - info.put(repo, new RepoInfo(repo, userCount, topic)); + @Override + protected void onChannelInfo(String channel, int userCount, String topic) { + info.put(channel, new ChannelInfo(channel, userCount, topic)); }
- public void onMessage(String repo, String sender, String login, String hostname, String message) { + public void onMessage(String channel, String sender, String login, String hostname, String message) {
- IRCRepoComponent component = IRCServerComponent.this.repos.get(repo); + IRCChannelComponent component = IRCServerComponent.this.channels.get(channel); if (component != null) { component.acceptMessage(sender, login, hostname, message); }
if (message.contains(getName()) && sender.contains("ghinkle")) { - sendMessage(repo, "monitoring " + repos.size() + " repos"); + sendMessage(channel, "monitoring " + channels.size() + " channels"); } } } @@ -175,8 +175,8 @@ public class IRCServerComponent implements ResourceComponent, OperationFacet { }
- private void updateRepos() { - activeRepos = Arrays.asList(this.bot.getChannels()); + private void updateChannels() { + activeChannels = Arrays.asList(this.bot.getChannels()); }
} \ No newline at end of file diff --git a/modules/plugins/irc/src/main/resources/META-INF/rhq-plugin.xml b/modules/plugins/irc/src/main/resources/META-INF/rhq-plugin.xml index 7376907..f4dcbc5 100644 --- a/modules/plugins/irc/src/main/resources/META-INF/rhq-plugin.xml +++ b/modules/plugins/irc/src/main/resources/META-INF/rhq-plugin.xml @@ -20,11 +20,11 @@ </plugin-configuration>
- <operation name="listRepos" description="List out all repos"> + <operation name="listChannels" description="List out all channels"> <results> - <c:list-property name="repoList"> - <c:map-property name="repoMap"> - <c:simple-property name="repo"/> + <c:list-property name="channelList"> + <c:map-property name="channelMap"> + <c:simple-property name="channel"/> <c:simple-property name="userCount"/> <c:simple-property name="topic"/> </c:map-property> @@ -33,19 +33,19 @@ </operation>
<service - name="IRC Repo" - discovery="IRCRepoDiscoveryComponent" - class="IRCRepoComponent" + name="IRC Channel" + discovery="IRCChannelDiscoveryComponent" + class="IRCChannelComponent" supportsManualAdd="true">
<plugin-configuration> - <c:simple-property name="repoName"/> + <c:simple-property name="channelName"/> </plugin-configuration>
- <operation name="sendMessage" description="Send a message to the repo"> + <operation name="sendMessage" description="Send a message to the channel"> <parameters> - <c:simple-property name="message" description="The message to send to the repo" required="true"/> + <c:simple-property name="message" description="The message to send to the channel" required="true"/> </parameters> </operation>
commit ccd97968320c1142f06ec6e0aa6d72d7a638c1e3 Author: Heiko W. Rupp hwr@redhat.com Date: Tue Aug 3 20:05:39 2010 +0200
More channel->repo fallout fixing
diff --git a/modules/plugins/irc/src/main/java/org/rhq/plugins/irc/IRCServerComponent.java b/modules/plugins/irc/src/main/java/org/rhq/plugins/irc/IRCServerComponent.java index e8176a1..2ba1b34 100644 --- a/modules/plugins/irc/src/main/java/org/rhq/plugins/irc/IRCServerComponent.java +++ b/modules/plugins/irc/src/main/java/org/rhq/plugins/irc/IRCServerComponent.java @@ -1,12 +1,10 @@ package org.rhq.plugins.irc;
-import java.util.HashSet; import java.util.Set; import java.util.Map; import java.util.HashMap; import java.util.Arrays; import java.util.List; -import java.io.IOException;
import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -22,7 +20,6 @@ import org.rhq.core.pluginapi.inventory.ResourceContext; import org.rhq.core.pluginapi.operation.OperationFacet; import org.rhq.core.pluginapi.operation.OperationResult; import org.jibble.pircbot.PircBot; -import org.jibble.pircbot.IrcException;
/** @@ -58,7 +55,7 @@ public class IRCServerComponent implements ResourceComponent, OperationFacet { log.warn("Failure to connect to IRC server " + host + " reason: " + e.getMessage()); } } - activeRepos = Arrays.asList(this.bot.getRepos()); + activeRepos = Arrays.asList(this.bot.getChannels());
return this.bot.isConnected() ? AvailabilityType.UP : AvailabilityType.DOWN; } @@ -87,12 +84,12 @@ public class IRCServerComponent implements ResourceComponent, OperationFacet { public void registerRepo(IRCRepoComponent repoComponent) { this.repos.put(repoComponent.getRepo(), repoComponent);
- this.bot.joinRepo(repoComponent.getRepo()); + this.bot.joinChannel(repoComponent.getRepo()); updateRepos(); }
public void unregisterRepo(IRCRepoComponent repoComponent) { - this.bot.partRepo(repoComponent.getRepo()); + this.bot.partChannel(repoComponent.getRepo()); this.repos.remove(repoComponent.getRepo()); }
@@ -111,7 +108,7 @@ public class IRCServerComponent implements ResourceComponent, OperationFacet { Configuration resultConfig = result.getComplexResults(); PropertyList repoList = new PropertyList("repoList");
- this.bot.listRepos(); + this.bot.listChannels();
Thread.sleep(5000); // TODO is this long enough... any other way to know when the list is done?
@@ -150,7 +147,6 @@ public class IRCServerComponent implements ResourceComponent, OperationFacet { this.setName(nick); }
- @Override protected void onRepoInfo(String repo, int userCount, String topic) { info.put(repo, new RepoInfo(repo, userCount, topic)); } @@ -180,7 +176,7 @@ public class IRCServerComponent implements ResourceComponent, OperationFacet {
private void updateRepos() { - activeRepos = Arrays.asList(this.bot.getRepos()); + activeRepos = Arrays.asList(this.bot.getChannels()); }
} \ No newline at end of file diff --git a/modules/plugins/pom.xml b/modules/plugins/pom.xml index 4d439cf..880254c 100644 --- a/modules/plugins/pom.xml +++ b/modules/plugins/pom.xml @@ -164,6 +164,7 @@
<modules> <module>byteman</module> + <module>irc</module>
<module>iis</module> <module>database</module>
commit 0b56da2b0dc06bdc76552196c541ff8dd22302c5 Author: John Mazzitelli mazz@redhat.com Date: Tue Aug 3 11:43:33 2010 -0400
- taking out iptables and services plugins from eclipse .classpath: iptables plugin is not functional nor compilable. services plugins is half-baked and needs its dependencies reworked so its buildable via maven in a proper way
- making sure EMS is at the 1.2.13 level as well
diff --git a/.classpath b/.classpath index 15da9c3..35714ec 100644 --- a/.classpath +++ b/.classpath @@ -2,9 +2,6 @@ <classpath> <classpathentry kind="src" path="modules/common/jboss-as/src/main/java"/> <classpathentry kind="src" path="modules/plugins/irc/src/main/java"/> - <classpathentry kind="src" path="modules/plugins/services/src/main/java"/> - <classpathentry kind="src" path="modules/plugins/iptables/src/main/java"/> - <classpathentry kind="src" path="modules/plugins/iptables/src/test/java"/> <classpathentry kind="src" path="modules/plugins/hadoop/src/main/java"/> <classpathentry kind="src" path="modules/enterprise/remoting/webservices/src/test/java"/> <classpathentry kind="src" path="modules/common/ant-bundle/src/main/java"/> @@ -205,7 +202,7 @@ <classpathentry exported="true" kind="var" path="M2_REPO/javax/faces/jsf-impl/1.2_14/jsf-impl-1.2_14.jar" sourcepath="/M2_REPO/javax/faces/jsf-impl/1.2_14/jsf-impl-1.2_14-sources.jar"/> <classpathentry exported="true" kind="var" path="M2_REPO/javax/el/el-api/1.0/el-api-1.0.jar"/> <classpathentry exported="true" kind="var" path="M2_REPO/com/sun/facelets/jsf-facelets/1.1.15.B1/jsf-facelets-1.1.15.B1.jar" sourcepath="/M2_REPO/com/sun/facelets/jsf-facelets/1.1.15.B1/jsf-facelets-1.1.15.B1-sources.jar"/> - <classpathentry exported="true" kind="var" path="M2_REPO/mc4j/org-mc4j-ems/1.2.11/org-mc4j-ems-1.2.11.jar" sourcepath="/M2_REPO/mc4j/org-mc4j-ems/1.2.11/org-mc4j-ems-1.2.11-sources.jar"/> + <classpathentry exported="true" kind="var" path="M2_REPO/mc4j/org-mc4j-ems/1.2.13/org-mc4j-ems-1.2.13.jar" sourcepath="/M2_REPO/mc4j/org-mc4j-ems/1.2.13/org-mc4j-ems-1.2.13-sources.jar"/> <classpathentry exported="true" kind="var" path="M2_REPO/org/opensymphony/quartz/quartz/1.6.5/quartz-1.6.5.jar" sourcepath="/M2_REPO/org/opensymphony/quartz/quartz/1.6.5/quartz-1.6.5-sources.jar"/> <classpathentry exported="true" kind="var" path="M2_REPO/javax/mail/mail/1.4.2/mail-1.4.2.jar"/> <classpathentry exported="true" kind="var" path="M2_REPO/commons-fileupload/commons-fileupload/1.2/commons-fileupload-1.2.jar"/>
commit b6b636bdd795c192b4cb5f74ce7fb4a1d2d404e1 Author: John Mazzitelli mazz@redhat.com Date: Tue Aug 3 11:39:34 2010 -0400
looks like a copy-n-paste error - i don't think the services plugin REALLY wants the twitter4j library
diff --git a/modules/plugins/services/pom.xml b/modules/plugins/services/pom.xml index 0f84fe1..f6b8556 100644 --- a/modules/plugins/services/pom.xml +++ b/modules/plugins/services/pom.xml @@ -111,29 +111,6 @@
</executions> </plugin> - <plugin> - <artifactId>maven-dependency-plugin</artifactId> - <version>2.0</version> - <executions> - <execution> - <id>copy-twitter4j-jar</id> - <phase>process-resources</phase> - <goals> - <goal>copy</goal> - </goals> - <configuration> - <artifactItems> - <artifactItem> - <groupId>net.homeip.yusuke</groupId> - <artifactId>twitter4j</artifactId> - <version>2.0.8</version> - </artifactItem> - </artifactItems> - <outputDirectory>${project.build.outputDirectory}/lib</outputDirectory> - </configuration> - </execution> - </executions> - </plugin> </plugins> </build>
commit f0e1602b9f1577774b03022bd7c6c9f191a9ea94 Author: Ian Springer ian.springer@redhat.com Date: Mon Aug 2 18:30:05 2010 -0400
changes to get build running w/ JDK7, including upgrading to EMS 1.2.14, which is compiled w/ "-target 1.5", rather than "-target jsr14" like earlier versions of EMS
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/engine/internal/AbstractConditionCache.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/engine/internal/AbstractConditionCache.java index 74f59f0..9f8726a 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/engine/internal/AbstractConditionCache.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/engine/internal/AbstractConditionCache.java @@ -66,8 +66,8 @@ abstract class AbstractConditionCache { */ cacheElement.setActive(true); // no harm to always set active (though, technically, STATELESS operators don't need it) cachedConditionProducer.sendActivateAlertConditionMessage( - cacheElement.getAlertConditionTriggerId(), timestamp, cacheElement - .convertValueToString(providedValue), extraParams); + cacheElement.getAlertConditionTriggerId(), timestamp, + cacheElement.convertValueToString(providedValue), extraParams);
stats.matched++; } catch (Exception e) { diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/engine/jms/CachedConditionProducerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/engine/jms/CachedConditionProducerBean.java index bc901d4..f74663a 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/engine/jms/CachedConditionProducerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/engine/jms/CachedConditionProducerBean.java @@ -32,7 +32,6 @@ import javax.jms.Session;
import org.rhq.enterprise.server.alert.engine.jms.model.ActiveAlertConditionMessage; import org.rhq.enterprise.server.alert.engine.jms.model.InactiveAlertConditionMessage; -import org.rhq.enterprise.server.alert.engine.model.AbstractCacheElement;
/** * A convenience class that will be used by the AlertConditionCacheManager to send messages to a JMS queue for @@ -54,7 +53,7 @@ public class CachedConditionProducerBean implements CachedConditionProducerLocal private Queue alertConditionQueue;
@TransactionAttribute(TransactionAttributeType.REQUIRES_NEW) - public <T extends AbstractCacheElement<S>, S> void sendActivateAlertConditionMessage(int alertConditionId, + public <S> void sendActivateAlertConditionMessage(int alertConditionId, long timestamp, S value, Object... extraParams) throws JMSException { Connection connection = factory.createConnection(); Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/engine/jms/CachedConditionProducerLocal.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/engine/jms/CachedConditionProducerLocal.java index d2b4fb5..f431dd4 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/engine/jms/CachedConditionProducerLocal.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/engine/jms/CachedConditionProducerLocal.java @@ -33,7 +33,7 @@ public interface CachedConditionProducerLocal { * Send a message to the appropriate JMS destination for processing. This destination handles creating and * persisting entities corresponding to triggered alert conditions. */ - <T extends AbstractCacheElement<S>, S> void sendActivateAlertConditionMessage(int alertConditionId, long timestamp, + <S> void sendActivateAlertConditionMessage(int alertConditionId, long timestamp, S value, Object... extraParams) throws JMSException;
void sendDeactivateAlertConditionMessage(int alertConditionId, long timestamp) throws JMSException; diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/auth/SubjectException.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/auth/SubjectException.java index c4cc491..71856f5 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/auth/SubjectException.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/auth/SubjectException.java @@ -20,6 +20,10 @@ package org.rhq.enterprise.server.auth;
public class SubjectException extends RuntimeException {
+ // Default no-arg constructor required by JAXB + public SubjectException() { + } + public SubjectException(String message) { super(message); } diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationUpdateStillInProgressException.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationUpdateStillInProgressException.java index 775f599..56abd94 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationUpdateStillInProgressException.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationUpdateStillInProgressException.java @@ -31,6 +31,10 @@ import javax.ejb.ApplicationException; public class ConfigurationUpdateStillInProgressException extends RuntimeException { private static final long serialVersionUID = 1L;
+ // Default no-arg constructor required by JAXB + public ConfigurationUpdateStillInProgressException() { + } + public ConfigurationUpdateStillInProgressException(String message) { super(message); } diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/RepoException.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/RepoException.java index 7b9ae57..3ee5c58 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/RepoException.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/RepoException.java @@ -30,6 +30,7 @@ public class RepoException extends ContentException {
private RepoExceptionType type = RepoExceptionType.GENERAL;
+ // Default no-arg constructor required by JAXB public RepoException() { }
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/exception/ScheduleException.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/exception/ScheduleException.java index 4d502bd..cb97f40 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/exception/ScheduleException.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/exception/ScheduleException.java @@ -29,6 +29,10 @@ package org.rhq.enterprise.server.exception; public class ScheduleException extends RuntimeException { private static final long serialVersionUID = 1L;
+ // Default no-arg constructor required by JAXB + public ScheduleException() { + } + public ScheduleException(String message) { super(message); } diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/exception/UnscheduleException.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/exception/UnscheduleException.java index 887998e..1b0f03a 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/exception/UnscheduleException.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/exception/UnscheduleException.java @@ -30,6 +30,10 @@ package org.rhq.enterprise.server.exception; public class UnscheduleException extends RuntimeException { private static final long serialVersionUID = 1L;
+ // Default no-arg constructor required by JAXB + public UnscheduleException() { + } + public UnscheduleException(String message) { super(message); } diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceNotFoundException.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceNotFoundException.java index 6ad8885..7c31d96 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceNotFoundException.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceNotFoundException.java @@ -25,6 +25,10 @@ package org.rhq.enterprise.server.resource; public class ResourceNotFoundException extends RuntimeException { private static final long serialVersionUID = 1L;
+ // Default no-arg constructor required by JAXB + public ResourceNotFoundException() { + } + /** * Create an exception indicating the resource with the specified id was not found. * diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupNotFoundException.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupNotFoundException.java index 66ffa32..0d64c1e 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupNotFoundException.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupNotFoundException.java @@ -21,6 +21,10 @@ package org.rhq.enterprise.server.resource.group; public class ResourceGroupNotFoundException extends RuntimeException { private static final long serialVersionUID = 1L;
+ // Default no-arg constructor required by JAXB + public ResourceGroupNotFoundException() { + } + public ResourceGroupNotFoundException(int groupId) { super("A group with id " + groupId + " does not exist."); } diff --git a/pom.xml b/pom.xml index f3c48ed..521bc40 100644 --- a/pom.xml +++ b/pom.xml @@ -85,7 +85,7 @@ <jsf-api.version>1.2_14</jsf-api.version> <jsf-impl.version>1.2_14</jsf-impl.version> <ojdbc5.version>11.2.0.1.0</ojdbc5.version> - <ems.version>1.2.13</ems.version> + <ems.version>1.2.14</ems.version> <postgresql.version>8.4-701.jdbc3</postgresql.version> <h2.version>1.1.117</h2.version> <jtds.version>1.2.2</jtds.version> @@ -708,6 +708,8 @@ <source>1.6</source> <target>1.6</target> <optimize>false</optimize> + <verbose>true</verbose> + <compilerArgument>-Xlint</compilerArgument> </configuration> </plugin>
commit 5911f8751eeea86072ab6c524a2e7bdc1f58166e Merge: 4ae53d1... cc33d33... Author: John Mazzitelli mazz@redhat.com Date: Mon Aug 2 14:49:33 2010 -0400
Merge branch 'master' into permgen-leak
commit 4ae53d12b5b30aafe5362ad5435b0fbe548962b6 Author: John Mazzitelli mazz@redhat.com Date: Mon Aug 2 13:45:07 2010 -0400
clean up some things that we forgot to clean up at shutdown - to help GC
diff --git a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/PluginContainer.java b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/PluginContainer.java index c9c1d54..081e067 100644 --- a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/PluginContainer.java +++ b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/PluginContainer.java @@ -78,7 +78,7 @@ import org.rhq.core.pluginapi.util.FileUtils; public class PluginContainer implements ContainerService { private static final PluginContainer INSTANCE = new PluginContainer();
- private static final Log log = LogFactory.getLog(PluginContainer.class); + private final Log log = LogFactory.getLog(PluginContainer.class);
// our management interface private PluginContainerMBeanImpl mbean; @@ -303,7 +303,9 @@ public class PluginContainer implements ContainerService { pluginManager.shutdown();
agentServiceListeners.clear(); + agentServiceListeners = new LinkedHashSet<AgentServiceLifecycleListener>(); agentServiceStreamRemoter = null; + agentRegistrar = null;
purgeTmpDirectoryContents();
@@ -321,6 +323,8 @@ public class PluginContainer implements ContainerService { pluginComponentFactory = null; pluginManager = null;
+ configuration = null; + started = false;
log.info("Plugin container is now shutdown.");
commit cc33d336fa0e253f16ff2669375b840b5b32fc96 Merge: cd68889... 724682f... Author: John Sanda jsanda@redhat.com Date: Mon Aug 2 13:17:29 2010 -0400
Merge branch 'master' of ssh://git.fedorahosted.org/git/rhq/rhq
commit cd688890537687233af414fbdf785707a98f8718 Author: John Sanda jsanda@redhat.com Date: Mon Aug 2 13:11:39 2010 -0400
Cleaning up logic in script for resetting connection properties, adding script for apache
I have renamed reset_conn_props.js to reset_jboss_agent_prop.js. Most of the logic in that script has been removed. There was logic for retrieving default values from the default template; however, I discovered through further testing that the snapshot report properties do not even exist in the default template when upgrading 2.2.0 --> 2.3.1. Consequently, I need to simply hard code the properties that need to be added to the plugin configurations.
Adding a similar script for apache to handle properties added in the 2.4.0 release.
diff --git a/etc/cli-scripts/reset_apache_props.js b/etc/cli-scripts/reset_apache_props.js new file mode 100644 index 0000000..becdc50 --- /dev/null +++ b/etc/cli-scripts/reset_apache_props.js @@ -0,0 +1,102 @@ +/* + * RHQ Management Platform + * Copyright (C) 2005-2008 Red Hat, Inc. + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License, version 2, as + * published by the Free Software Foundation, and/or the GNU Lesser + * General Public License, version 2.1, also as published by the Free + * Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License and the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License + * and the GNU Lesser General Public License along with this program; + * if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +/** + * This CLI script resets/restores apache connection properties that are not set to their + * default values during plugin upgrade. This script is only intended to be run once. If + * run subsequent times, the script will reset these properties to their defaults, + * overriding whatever the current values might be. + */ + + +function iterate(iterable, callback) { + var iterator = iterable.iterator(); + while (iterator.hasNext()) { + callback(iterator.next()); + } +} + +function filter(iterable, predicate) { + var matches = java.util.ArrayList(); + iterate(iterable, function(obj) { + if (predicate(obj)) { + matches.add(obj); + } + }); + return matches; +} + +function log(msg) { + println("DEBUG " + msg); +} + +function loadPluginConfiguration(resource) { + log("Loading plugin configuration for " + resource); + return ConfigurationManager.getPluginConfiguration(resource.id); +} + +function findResourcesByTypeAndPlugin(resourceType, plugin) { + var criteria = ResourceCriteria(); + criteria.addFilterResourceTypeName(resourceType); + criteria.addFilterPluginName(plugin); + criteria.fetchResourceType(true); + criteria.fetchPluginConfiguration(true); + criteria.caseSensitive = true; + criteria.strict = true; + + var resources = ResourceManager.findResourcesByCriteria(criteria); + + log("Found " + resources.size() + " " + resourceType + " resources "); + + iterate(resources, function(resource) { + resource.pluginConfiguration = loadPluginConfiguration(resource); + }); + + return resources; +} + +function updatePluginConfigs(resources, applyDefaults) { + iterate(resources, function(resource) { + log("Preparing to update plugin configuration for " + resource) + applyDefaults(resource.pluginConfiguration); + ConfigurationManager.updatePluginConfiguration(resource.id, resource.pluginConfiguration); + log("Updated plugin configuration for " + resource); + }); +} + +functionr resetApachePluginConfigProps() { + var resourceTypeName = 'Apache HTTP Server'; + var pluginName = 'Apache'; + var servers = findResourcesByTypeAndPlugin(resourceTypeName, pluginName); + + updatePluginConfigs(servers, function(pluginConfig) { + pluginConfig.put(PropertySimple('augeasEnabled', 'no')); + pluginConfig.put(PropertySimple('configurationFilesInclusionPatterns', '/etc/httpd/conf/httpd.conf')); + pluginConfig.put(PropertySimple('vhostCreationPolicy', 'vhost-per-file')); + }); +} + +////////////// +// main // +////////////// +resetApachePluginConfigProps(); diff --git a/etc/cli-scripts/reset_conn_props.js b/etc/cli-scripts/reset_conn_props.js deleted file mode 100644 index 274bc5c..0000000 --- a/etc/cli-scripts/reset_conn_props.js +++ /dev/null @@ -1,287 +0,0 @@ -/** - * This is a CLI script to be used for https://bugzilla.redhat.com/show_bug.cgi?id=573034. - * The script resets the snapshot report plugin configuration properties for JBoss servers - * and agents to their default values. This is a one-off script intended only to be run - * once to assign values to required plugin properties that are unset. - * - * NOTE: This script can probably be refactored and generalized a bit to support - * resetting any specified plugin configuration properties to their default values. - * And specifying candidate properties could be done via a callback function to - * allow for arbitrarily complex logic in determining the properties. - */ - -function iterate(iterable, callback) { - var iterator = iterable.iterator(); - while (iterator.hasNext()) { - callback(iterator.next()); - } -} - -function filter(iterable, predicate) { - var matches = java.util.ArrayList(); - iterate(iterable, function(obj) { - if (predicate(obj)) { - matches.add(obj); - } - }); - return matches; -} - -function log(msg) { - println("DEBUG " + msg); -} - -function loadPluginConfiguration(resource) { - log("Loading plugin configuration for " + resource); - return ConfigurationManager.getPluginConfiguration(resource.id); -} - -function loadPluginConfigDef(resourceTypeName, pluginName) { - log("Loading plugin configuration definition for [resourceType=" + resourceTypeName + ", plugin=" + - pluginName + "]"); - var resourceType = ResourceTypeManager.getResourceTypeByNameAndPlugin(resourceTypeName, - pluginName); - - if (resourceType == null) { - throw "Failed to find resource type '" + resourceTypeName + "'"; - } - - configDef = ConfigurationManager.getPluginConfigurationDefinitionForResourceType(resourceType.id); - - if (configDef == null) { - throw "Failed to load plugin configuration for [resourceType=" + resourceTypeName + - ", plugin=" + pluginName + "]"; - } - - return configDef; -} - -function findResourcesByTypeAndPlugin(resourceType, plugin) { - var criteria = ResourceCriteria(); - criteria.addFilterResourceTypeName(resourceType); - criteria.addFilterPluginName(plugin); - criteria.fetchResourceType(true); - criteria.fetchPluginConfiguration(true); - criteria.caseSensitive = true; - criteria.strict = true; - - var resources = ResourceManager.findResourcesByCriteria(criteria); - - log("Found " + resources.size() + " " + resourceType + " resources "); - - iterate(resources, function(resource) { - resource.pluginConfiguration = loadPluginConfiguration(resource); - }); - - return resources; -} - -/** - * This function takes a Configuration object and "flattens" its properties into a list of - * all simple (i.e., PropertySimple) objects contained in the configuration. This includes - * nested properties. The properties are returned as a java.util.List. - * - * param: configuration The Configuration object from which the property list will be built - * - * return: A List object of all PropertySimple objects, including those nested in complex - * properties - */ -function flattenProperties(configuration) { - var simpleProperties = java.util.ArrayList(); - - iterate(configuration.map.values(), function(property) { - if (property instanceof PropertySimple) { - simpleProperties.add(property); - } - else if (property instanceof PropertyList) { - simpleProperties.addAll(flattenPropertyList(property)); - } - }); - - return simpleProperties; -} - -function flattenPropertyList(propertyList) { - var simpleProperties = java.util.ArrayList(); - - iterate(propertyList.list, function(property) { - if (property instanceof PropertySimple) { - simpleProperty.add(property); - } - else if (property instanceof PropertyMap) { - simpleProperties.addAll(flattenPropertyMap(property)); - } - else if (property instanceof PropertyList) { - simpleProperties.addAll(flattenPropertyList(property)); - } - }); - - return simpleProperties; -} - -function flattenPropertyMap(propertyMap) { - var simpleProperties = java.util.ArrayList(); - - iterate(propertyMap.map.values(), function(property) { - if (property instanceof PropertySimple) { - simpleProperties.add(property); - } - else if (property instanceof PropertyMap) { - simpleProperties.addAll(flattenPropertyMap(property)); - } - else if (property instanceof PropertyList) { - simpleProperties.addAll(flattPropertyList(property)); - } - }); - - return simpleProperties; -} - -/** - * Loads the specified default plugin properties for a given plugin configuration definition. - * The defaults are stored in and retrieved from the default template of the plugin - * configuration. - * - * param: pluginConfigDef A ConfigurationDefinition object which is the plugin config def - * from which to retrieve the defaults - * - * param: defaultPropertyNames A java.util.Collection of the property names to include - * - * return: A java.util.Map of the default properties. Property names as strings are mapped - * to the PropertySimple objects. - */ -function loadSnapshotDefaults(pluginConfigDef, defaultPropertyNames) { - var snapshotDefaultsMap = java.util.HashMap(); - var defaults = flattenProperties(pluginConfigDef.defaultTemplate.configuration); - - var isSnapshotProperty = function(property) { - return defaultPropertyNames.contains(property.name); - } - - var snapshotDefaults = filter(defaults, isSnapshotProperty); - - iterate(snapshotDefaults, function(property) { - snapshotDefaultsMap.put(property.name, property); - }); - - return snapshotDefaultsMap; -} - -function getJBossSnapshotPropertyNames() { - var set = java.util.HashSet(); - set.add('snapshotConfigEnabled'); - set.add('snapshotConfigDirectory'); - set.add('snapshotConfigRecursive'); - set.add('snapshotLogEnabled'); - set.add('snapshotLogDirectory'); - set.add('snapshotLogRecursive'); - set.add('snapshotDataEnabled'); - set.add('snapshotDataDirectory'); - set.add('snapshotDataRecursive'); - set.add('snapshotAdditionalFilesEnabled'); - set.add('snapshotAdditionalFilesDirectory'); - set.add('snapshotAdditionalFilesRecursive'); - - return set; -} - -function getAgentSnapshotPropertyNames() { - var set = java.util.HashSet(); - set.add('snapshotConfigEnabled'); - set.add('snapshotLogEnabled'); - set.add('snapshotDataEnabled'); - - return set; -} - -/** - * Resets the values of specified plugin configuration properties back to their default values. - * The configuration is modified locally, in memory and then a request is sent to - * ConfigurationManager. - * - * param: resources The resources whose plugin configurations are to be updated. This is - * expected to be a java.util.Collection. - * - * param: snapshotDefaults: The names of the plugin configuration properties to reset. This - * is expected to be a java.util.Collection. - */ -function resetPluginConfigPropsFromTemplate(pluginConfigDef, resources, snapshotDefaults) { - iterate(resources, function(resource) { - log("Preparing to reset plugin configuration properties for " + resource); - var simpleProperties = flattenProperties(resource.pluginConfiguration); - var snapshotProperties = filter(simpleProperties, function(property) { - return snapshotDefaults.containsKey(property.name); - }); - - iterate(snapshotProperties, function(property) { - var defaultProperty = snapshotDefaults.get(property.name); - property.stringValue = defaultProperty.stringValue; - log("Set property " + property.name + " to " + property.stringValue); - }); - - ConfigurationManager.updatePluginConfiguration(resource.id, resource.pluginConfiguration); - log("Updated plugin configuration for " + resource); - }); -} - -function resetPluginConfigProps(resources, applyDefaults) { - iterate(resources, function(resource) { - applyDefaults(resource.pluginConfiguration); - ConfigurationManager.updatePluginConfiguration(resource.id, resource.pluginConfiguration); - log("Updated plugin configuration for " + resource); - }); -} - -function resetJBossPluginConfigProps() { - var jbossResourceTypeName = 'JBossAS Server'; - var jbossPluginName = 'JBossAS'; - var jbossServers = findResourcesByTypeAndPlugin(jbossResourceTypeName, jbossPluginName); - var jbossPluginConfigDef = loadPluginConfigDef(jbossResourceTypeName, jbossPluginName); - - //resetPluginConfigProps(jbossServers, loadSnapshotDefaults(jbossPluginConfigDef, - // getJBossSnapshotPropertyNames())); - - resetPluginConfigProps(jbossServers, function(pluginConfig) { - pluginConfig.put(PropertySimple('snapshotConfigEnabled', true)); - pluginConfig.put(PropertySimple('snapshotConfigDirectory', 'config')); - pluginConfig.put(PropertySimple('snapshotConfigRecursive', true)); - pluginConfig.put(PropertySimple('snapshotLogEnabled', true)); - pluginConfig.put(PropertySimple('snapshotLogDirectory', 'log')); - pluginConfig.put(PropertySimple('snapshotLogRecursive', false)); - pluginConfig.put(PropertySimple('snapshotDataEnabled', false)); - pluginConfig.put(PropertySimple('snapshotDataDirectory', 'data')); - pluginConfig.put(PropertySimple('snapshotDataRecursive', true)); - - var propertyMap = PropertyMap('snapshotAdditionalFilesMap'); - propertyMap.put(PropertySimple('snapshotAdditionalFilesEnabled', true)); - propertyMap.put(PropertySimple('snapshotAdditionalFilesDirectory', '')); - propertyMap.put(PropertySimple('snapshotAdditionalFilesRecursive', true)); - - var propertyList = PropertyList('snapshotAdditionalFilesList'); - propertyList.list.add(propertyMap); - - pluginConfig.put(propertyList); - }); -} - -function resetAgentPluginConfigProps() { - var agentResourceTypeName = 'RHQ Agent'; - var agentPluginName = 'RHQAgent'; - var agents = findResourcesByTypeAndPlugin(agentResourceTypeName, agentPluginName); - var agentPluginConfigDef = loadPluginConfigDef(agentResourceTypeName, agentPluginName); - - //resetPluginConfigProps(agents, loadSnapshotDefaults(agentPluginConfigDef, - // getAgentSnapshotPropertyNames())); - - resetPluginConfigProps(agents, function(pluginConfig) { - pluginConfig.put(PropertySimple('snapshotConfigEnabled', true)); - pluginConfig.put(PropertySimple('snapshotLogEnabled', true)); - pluginConfig.put(PropertySimple('snapshotDataEnabled', true)); - }); -} - -////////////// -// main // -////////////// -resetJBossPluginConfigProps(); -resetAgentPluginConfigProps(); diff --git a/etc/cli-scripts/reset_jboss_agent_props.js b/etc/cli-scripts/reset_jboss_agent_props.js new file mode 100644 index 0000000..51fdb99 --- /dev/null +++ b/etc/cli-scripts/reset_jboss_agent_props.js @@ -0,0 +1,110 @@ +/** + * This is a CLI script to be used for https://bugzilla.redhat.com/show_bug.cgi?id=573034. + * The script resets/restores the snapshot report plugin configuration properties for JBoss servers + * and agents to their default values. This is a one-off script intended only to be run + * once to assign values to required plugin properties that are unset. Running it subsequent times + * cause the current connection settings for the snapshot report properties to be overridden and + * reset to their default vales + */ + +function iterate(iterable, callback) { + var iterator = iterable.iterator(); + while (iterator.hasNext()) { + callback(iterator.next()); + } +} + +function filter(iterable, predicate) { + var matches = java.util.ArrayList(); + iterate(iterable, function(obj) { + if (predicate(obj)) { + matches.add(obj); + } + }); + return matches; +} + +function log(msg) { + println("DEBUG " + msg); +} + +function loadPluginConfiguration(resource) { + log("Loading plugin configuration for " + resource); + return ConfigurationManager.getPluginConfiguration(resource.id); +} + +function findResourcesByTypeAndPlugin(resourceType, plugin) { + var criteria = ResourceCriteria(); + criteria.addFilterResourceTypeName(resourceType); + criteria.addFilterPluginName(plugin); + criteria.fetchResourceType(true); + criteria.fetchPluginConfiguration(true); + criteria.caseSensitive = true; + criteria.strict = true; + + var resources = ResourceManager.findResourcesByCriteria(criteria); + + log("Found " + resources.size() + " " + resourceType + " resources "); + + iterate(resources, function(resource) { + resource.pluginConfiguration = loadPluginConfiguration(resource); + }); + + return resources; +} + +function updatePluginConfigs(resources, applyDefaults) { + iterate(resources, function(resource) { + log("Preparing to update plugin configuration for " + resource) + applyDefaults(resource.pluginConfiguration); + ConfigurationManager.updatePluginConfiguration(resource.id, resource.pluginConfiguration); + log("Updated plugin configuration for " + resource); + }); +} + +function resetJBossPluginConfigProps() { + var jbossResourceTypeName = 'JBossAS Server'; + var jbossPluginName = 'JBossAS'; + var jbossServers = findResourcesByTypeAndPlugin(jbossResourceTypeName, jbossPluginName); + + updatePluginConfigs(jbossServers, function(pluginConfig) { + pluginConfig.put(PropertySimple('snapshotConfigEnabled', true)); + pluginConfig.put(PropertySimple('snapshotConfigDirectory', 'config')); + pluginConfig.put(PropertySimple('snapshotConfigRecursive', true)); + pluginConfig.put(PropertySimple('snapshotLogEnabled', true)); + pluginConfig.put(PropertySimple('snapshotLogDirectory', 'log')); + pluginConfig.put(PropertySimple('snapshotLogRecursive', false)); + pluginConfig.put(PropertySimple('snapshotDataEnabled', false)); + pluginConfig.put(PropertySimple('snapshotDataDirectory', 'data')); + pluginConfig.put(PropertySimple('snapshotDataRecursive', true)); + + var propertyMap = PropertyMap('snapshotAdditionalFilesMap'); + propertyMap.put(PropertySimple('snapshotAdditionalFilesEnabled', true)); + propertyMap.put(PropertySimple('snapshotAdditionalFilesDirectory', '')); + propertyMap.put(PropertySimple('snapshotAdditionalFilesRecursive', true)); + + var propertyList = PropertyList('snapshotAdditionalFilesList'); + propertyList.list.add(propertyMap); + + pluginConfig.put(propertyList); + }); +} + +function resetAgentPluginConfigProps() { + var agentResourceTypeName = 'RHQ Agent'; + var agentPluginName = 'RHQAgent'; + var agents = findResourcesByTypeAndPlugin(agentResourceTypeName, agentPluginName); + + updatePluginConfigs(agents, function(pluginConfig) { + pluginConfig.put(PropertySimple('snapshotConfigEnabled', true)); + pluginConfig.put(PropertySimple('snapshotLogEnabled', true)); + pluginConfig.put(PropertySimple('snapshotDataEnabled', true)); + }); +} + +////////////// +// main // +////////////// +exec -f +resetJBossPluginConfigProps(); +resetAgentPluginConfigProps();
commit 6afb470d31be3c71c9e16544267d74a45e809da0 Merge: 774ed67... 724682f... Author: John Mazzitelli mazz@redhat.com Date: Mon Aug 2 10:44:24 2010 -0400
Merge branch 'master' into permgen-leak
commit 724682f8e03a5f804774559a97a70298dc402a43 Author: John Mazzitelli mazz@redhat.com Date: Mon Aug 2 10:43:43 2010 -0400
paranoia - we might hit sun bug http://bugs.sun.com/view_bug.do?bug_id=6735255 so we explicitly close the input stream prior to closing the jar file
diff --git a/modules/plugins/jboss-as/src/main/java/org/rhq/plugins/jbossas/JBossASServerComponent.java b/modules/plugins/jboss-as/src/main/java/org/rhq/plugins/jbossas/JBossASServerComponent.java index 4dc7a41..5fac37b 100644 --- a/modules/plugins/jboss-as/src/main/java/org/rhq/plugins/jbossas/JBossASServerComponent.java +++ b/modules/plugins/jboss-as/src/main/java/org/rhq/plugins/jbossas/JBossASServerComponent.java @@ -946,11 +946,12 @@ public class JBossASServerComponent implements MeasurementFacet, OperationFacet, private String getVhostFromWarFile(File warFile) {
JarFile jfile = null; + InputStream is = null; try { jfile = new JarFile(warFile); JarEntry entry = jfile.getJarEntry("WEB-INF/jboss-web.xml"); if (entry != null) { - InputStream is = jfile.getInputStream(entry); + is = jfile.getInputStream(entry); SAXBuilder saxBuilder = new SAXBuilder(); Document doc = saxBuilder.build(is); Element root = doc.getRootElement(); // <jboss-web> @@ -968,12 +969,21 @@ public class JBossASServerComponent implements MeasurementFacet, OperationFacet, } catch (Exception ioe) { log.warn("Exception when getting vhost from war file : " + ioe.getMessage()); } finally { - if (jfile != null) + if (jfile != null) { + if (is != null) { + try { + // see http://bugs.sun.com/view_bug.do?bug_id=6735255 for why we do this + is.close(); + } catch (IOException e) { + log.info("Exception when trying to close the war file stream: " + e.getMessage()); + } + } try { jfile.close(); } catch (IOException e) { log.info("Exception when trying to close the war file: " + e.getMessage()); } + } }
// We're not able to determine a vhost, so return localhost
commit b8685a6877b0fad4e7f9b305db673fd2cab3e2aa Author: Ian Springer ian.springer@redhat.com Date: Mon Aug 2 10:33:46 2010 -0400
add explicit i18nlog dep to poms of modules that depend on it
diff --git a/modules/core/dbutils/pom.xml b/modules/core/dbutils/pom.xml index 8769bfc..09703ee 100644 --- a/modules/core/dbutils/pom.xml +++ b/modules/core/dbutils/pom.xml @@ -43,6 +43,11 @@ </dependency>
<dependency> + <groupId>i18nlog</groupId> + <artifactId>i18nlog</artifactId> + </dependency> + + <dependency> <groupId>postgresql</groupId> <artifactId>postgresql</artifactId> <!-- NOTE: The version is defined in the root POM's dependencyManagement section. --> diff --git a/modules/core/util/pom.xml b/modules/core/util/pom.xml index 405eaed..458c635 100644 --- a/modules/core/util/pom.xml +++ b/modules/core/util/pom.xml @@ -33,6 +33,11 @@ <version>1.0</version> </dependency>
+ <dependency> + <groupId>i18nlog</groupId> + <artifactId>i18nlog</artifactId> + </dependency> + </dependencies>
<build> @@ -125,4 +130,4 @@
</profiles>
-</project> \ No newline at end of file +</project> diff --git a/modules/enterprise/agent/pom.xml b/modules/enterprise/agent/pom.xml index 03f3932..7187dbe 100644 --- a/modules/enterprise/agent/pom.xml +++ b/modules/enterprise/agent/pom.xml @@ -84,6 +84,11 @@ <!-- NOTE: The version is defined in the root POM's dependencyManagement section. --> </dependency>
+ <dependency> + <groupId>i18nlog</groupId> + <artifactId>i18nlog</artifactId> + </dependency> + <!-- TODO: This is a fix for the Javac bug requiring annotations to be available when compiling dependent classes. It is fixed in JDK 6 --> <dependency> diff --git a/modules/enterprise/comm/pom.xml b/modules/enterprise/comm/pom.xml index 93931da..dcd5bed 100644 --- a/modules/enterprise/comm/pom.xml +++ b/modules/enterprise/comm/pom.xml @@ -64,6 +64,11 @@ </dependency>
<dependency> + <groupId>i18nlog</groupId> + <artifactId>i18nlog</artifactId> + </dependency> + + <dependency> <groupId>jboss</groupId> <artifactId>jboss-common</artifactId> <!-- NOTE: The version is defined in the root POM's dependencyManagement section. --> diff --git a/modules/enterprise/gui/installer-war/pom.xml b/modules/enterprise/gui/installer-war/pom.xml index 9a29f14..b3ccdca 100644 --- a/modules/enterprise/gui/installer-war/pom.xml +++ b/modules/enterprise/gui/installer-war/pom.xml @@ -76,6 +76,11 @@ </dependency>
<dependency> + <groupId>i18nlog</groupId> + <artifactId>i18nlog</artifactId> + </dependency> + + <dependency> <groupId>jboss</groupId> <artifactId>jboss-jmx</artifactId> <version>${jboss.version}</version> @@ -103,7 +108,6 @@ <scope>provided</scope> <!-- by JBossAS --> </dependency>
- <dependency> <groupId>javax.servlet</groupId> <artifactId>servlet-api</artifactId> diff --git a/modules/enterprise/gui/portal-war/pom.xml b/modules/enterprise/gui/portal-war/pom.xml index 880cc16..f802053 100644 --- a/modules/enterprise/gui/portal-war/pom.xml +++ b/modules/enterprise/gui/portal-war/pom.xml @@ -149,6 +149,11 @@ </dependency>
<dependency> + <groupId>i18nlog</groupId> + <artifactId>i18nlog</artifactId> + </dependency> + + <dependency> <groupId>javax.el</groupId> <artifactId>el-api</artifactId> <version>${el.version}</version> diff --git a/modules/enterprise/remoting/cli/pom.xml b/modules/enterprise/remoting/cli/pom.xml index 5453a41..b118a9e 100644 --- a/modules/enterprise/remoting/cli/pom.xml +++ b/modules/enterprise/remoting/cli/pom.xml @@ -51,6 +51,11 @@ </dependency>
<dependency> + <groupId>i18nlog</groupId> + <artifactId>i18nlog</artifactId> + </dependency> + + <dependency> <groupId>jline</groupId> <artifactId>jline</artifactId> <version>${jline.version}</version> diff --git a/modules/enterprise/server/jar/pom.xml b/modules/enterprise/server/jar/pom.xml index a897a53..b0b3484 100644 --- a/modules/enterprise/server/jar/pom.xml +++ b/modules/enterprise/server/jar/pom.xml @@ -153,6 +153,11 @@ </dependency>
<dependency> + <groupId>i18nlog</groupId> + <artifactId>i18nlog</artifactId> + </dependency> + + <dependency> <groupId>org.apache.geronimo.specs</groupId> <artifactId>geronimo-javamail_1.3.1_spec</artifactId> <!-- The Sun javamail jar isn't available from a public repo due to licensing issues,
commit d8e467b5ab9fd98bb3196e0a5e6c19a671135dbb Merge: 08ea91d... 0807fc7... Author: Ian Springer ian.springer@redhat.com Date: Mon Aug 2 09:57:08 2010 -0400
Merge branch 'master' of ssh://git.fedorahosted.org/git/rhq/rhq
commit 0807fc7979b0cf42c1e0e5b1a746776221533a08 Author: Joseph Marques joseph@redhat.com Date: Mon Aug 2 01:18:59 2010 -0400
add more plugins to the eclipse build path
diff --git a/.classpath b/.classpath index ac5cafd..15da9c3 100644 --- a/.classpath +++ b/.classpath @@ -1,6 +1,11 @@ <?xml version="1.0" encoding="UTF-8"?> <classpath> <classpathentry kind="src" path="modules/common/jboss-as/src/main/java"/> + <classpathentry kind="src" path="modules/plugins/irc/src/main/java"/> + <classpathentry kind="src" path="modules/plugins/services/src/main/java"/> + <classpathentry kind="src" path="modules/plugins/iptables/src/main/java"/> + <classpathentry kind="src" path="modules/plugins/iptables/src/test/java"/> + <classpathentry kind="src" path="modules/plugins/hadoop/src/main/java"/> <classpathentry kind="src" path="modules/enterprise/remoting/webservices/src/test/java"/> <classpathentry kind="src" path="modules/common/ant-bundle/src/main/java"/> <classpathentry kind="src" path="modules/common/ant-bundle/src/test/java"/>
commit 774ed6788f6d14ec7b14f169b2181fbcf20e5302 Author: John Mazzitelli mazz@redhat.com Date: Sat Jul 31 11:35:10 2010 -0400
BZ 615377 - use a new feature in EMS 1.2.13 that lets us clear the EMS classloader factory cache of classloaders and jar files. we now do this in the jmx plugin lifecycle listener.
diff --git a/modules/plugins/jmx/src/main/java/org/rhq/plugins/jmx/JMXPluginLifecycleListener.java b/modules/plugins/jmx/src/main/java/org/rhq/plugins/jmx/JMXPluginLifecycleListener.java new file mode 100644 index 0000000..3b4984e --- /dev/null +++ b/modules/plugins/jmx/src/main/java/org/rhq/plugins/jmx/JMXPluginLifecycleListener.java @@ -0,0 +1,52 @@ +/* + * RHQ Management Platform + * Copyright (C) 2005-2010 Red Hat, Inc. + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License, version 2, as + * published by the Free Software Foundation, and/or the GNU Lesser + * General Public License, version 2.1, also as published by the Free + * Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License and the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License + * and the GNU Lesser General Public License along with this program; + * if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +package org.rhq.plugins.jmx; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.mc4j.ems.connection.support.classloader.ClassLoaderFactory; + +import org.rhq.core.pluginapi.plugin.PluginContext; +import org.rhq.core.pluginapi.plugin.PluginLifecycleListener; + +public class JMXPluginLifecycleListener implements PluginLifecycleListener { + private final Log log = LogFactory.getLog(JMXPluginLifecycleListener.class); + + @Override + public void initialize(PluginContext context) throws Exception { + // no-op + } + + @Override + public void shutdown() { + // so we do not cause EMS classloaders to leak perm gen, we need to clear + // out all caches from the EMS ClassLoaderFactory + try { + ClassLoaderFactory.clearCaches(); + log.debug("Cleared EMS ClassLoaderFactory caches"); + } catch (Exception e) { + log.error("Failed to clear EMS ClassLoaderFactory caches - perm gen may leak", e); + } + } +} diff --git a/modules/plugins/jmx/src/main/resources/META-INF/rhq-plugin.xml b/modules/plugins/jmx/src/main/resources/META-INF/rhq-plugin.xml index 258caee..2c7ca1d 100644 --- a/modules/plugins/jmx/src/main/resources/META-INF/rhq-plugin.xml +++ b/modules/plugins/jmx/src/main/resources/META-INF/rhq-plugin.xml @@ -4,6 +4,7 @@ displayName="Generic JMX" package="org.rhq.plugins.jmx" description="Supports management of JMX MBean Servers via various remoting systems." + pluginLifecycleListener="JMXPluginLifecycleListener" ampsVersion="2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:xmlns:rhq-plugin" diff --git a/pom.xml b/pom.xml index 306bbff..e743278 100644 --- a/pom.xml +++ b/pom.xml @@ -85,7 +85,7 @@ <jsf-api.version>1.2_14</jsf-api.version> <jsf-impl.version>1.2_14</jsf-impl.version> <ojdbc5.version>11.2.0.1.0</ojdbc5.version> - <ems.version>1.2.11</ems.version> + <ems.version>1.2.13</ems.version> <postgresql.version>8.4-701.jdbc3</postgresql.version> <h2.version>1.1.117</h2.version> <jtds.version>1.2.2</jtds.version>
commit c1e8353c8ef155fe286658694540bf3e69619737 Merge: 433cafa... 69c6da3... Author: John Mazzitelli mazz@redhat.com Date: Sat Jul 31 11:15:09 2010 -0400
Merge branch 'master' into permgen-leak
commit 69c6da3af5ef3a12988836d5a11b5b09e459075c Author: John Mazzitelli mazz@redhat.com Date: Fri Jul 23 11:00:46 2010 -0400
BZ 615377 workaround sun bug http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6727821
diff --git a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/PluginContainer.java b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/PluginContainer.java index d6546a2..c9c1d54 100644 --- a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/PluginContainer.java +++ b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/PluginContainer.java @@ -31,6 +31,8 @@ import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.ReadWriteLock; import java.util.concurrent.locks.ReentrantReadWriteLock;
+import javax.security.auth.login.Configuration; + import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory;
@@ -114,6 +116,11 @@ public class PluginContainer implements ContainerService { }
private PluginContainer() { + // for why we need to do this, see http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6727821 + try { + Configuration.getConfiguration(); + } catch (Throwable t) { + } }
/** @@ -337,6 +344,13 @@ public class PluginContainer implements ContainerService { private void cleanMemory() { Introspector.flushCaches(); LogFactory.releaseAll(); + + // for why we need to do this, see http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6727821 + try { + Configuration.setConfiguration(null); + } catch (Throwable t) { + } + System.gc(); }
@@ -563,4 +577,4 @@ public class PluginContainer implements ContainerService { public boolean isInsideAgent() { return (this.configuration != null && this.configuration.isInsideAgent()); } -} \ No newline at end of file +}
commit 433cafa05dc1871710813875d5c21923f716d9a5 Merge: b13693f... 483a1e8... Author: John Mazzitelli mazz@redhat.com Date: Fri Jul 30 17:44:21 2010 -0400
Merge branch 'master' into permgen-leak
commit f980213a4ce03e528c9d837f9c1e42b7a8d81ec3 Merge: 2cf77a3... 8bbecac... Author: Heiko W. Rupp hwr@redhat.com Date: Fri Jul 30 18:23:45 2010 +0200
Merge branch 'master' of ssh://git.fedorahosted.org/git/rhq/rhq
commit 2cf77a315e93ca36827c35dffbd8c425d77b2e9b Author: Heiko W. Rupp hwr@redhat.com Date: Fri Jul 30 18:22:15 2010 +0200
Wire the autodiscovery of mysql databases. Users still need to provide credentials manually.
diff --git a/modules/plugins/mysql/src/main/java/org/rhq/plugins/mysql/MySqlDiscoveryComponent.java b/modules/plugins/mysql/src/main/java/org/rhq/plugins/mysql/MySqlDiscoveryComponent.java index 4429e7a..f50fbc0 100644 --- a/modules/plugins/mysql/src/main/java/org/rhq/plugins/mysql/MySqlDiscoveryComponent.java +++ b/modules/plugins/mysql/src/main/java/org/rhq/plugins/mysql/MySqlDiscoveryComponent.java @@ -61,6 +61,8 @@ public class MySqlDiscoveryComponent implements ResourceDiscoveryComponent, Manu log.info("Discovered a mysql process: " + result);
ProcessInfo procInfo = result.getProcessInfo(); + + servers.add(createResourceDetails(context,context.getDefaultPluginConfiguration(),procInfo)); }
return servers;
commit 8bbecacb1202740dc31740a8028cdcd8fbefc1c9 Merge: dbd7dc1... 1f72fc3... Author: Jay Shaughnessy jshaughn@redhat.com Date: Fri Jul 30 12:19:31 2010 -0400
Merge branch 'release-3.0.0' into master-jay
Conflicts: modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/WsConfigurationManagerTest.java modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/metadata/ResourceMetadataManagerBean.java
commit 08ea91d04e4c61dfc41295262f2cac7af869d54e Merge: c3a4115... dbd7dc1... Author: Ian Springer ian.springer@redhat.com Date: Fri Jul 30 10:38:32 2010 -0400
Merge branch 'master' of ssh://git.fedorahosted.org/git/rhq/rhq
commit dbd7dc1a375b47eb91075a9404f5f92e8a0f46d0 Merge: 83c59bb... ae4c7c2... Author: Heiko W. Rupp hwr@redhat.com Date: Fri Jul 30 12:27:48 2010 +0200
Merge branch 'master' of ssh://git.fedorahosted.org/git/rhq/rhq
commit ae4c7c25f5ec8987bc54c92d70fc349dc15a76ae Author: Greg Hinkle ghinkle@redhat.com Date: Thu Jul 29 23:17:39 2010 -0400
Fix basics of inventory top view history handling (still need to decide if we like the tree structures)
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/InventoryView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/InventoryView.java index c76ff1c..2e2617e 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/InventoryView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/InventoryView.java @@ -18,11 +18,12 @@ */ package org.rhq.enterprise.gui.coregui.client.inventory.resource;
+import java.util.LinkedHashMap; + +import com.google.gwt.user.client.History; import com.smartgwt.client.data.Criteria; -import com.smartgwt.client.types.ContentsType; import com.smartgwt.client.types.VisibilityMode; import com.smartgwt.client.widgets.Canvas; -import com.smartgwt.client.widgets.HTMLPane; import com.smartgwt.client.widgets.grid.events.SelectionChangedHandler; import com.smartgwt.client.widgets.grid.events.SelectionEvent; import com.smartgwt.client.widgets.layout.HLayout; @@ -39,13 +40,8 @@ import org.rhq.enterprise.gui.coregui.client.BookmarkableView; import org.rhq.enterprise.gui.coregui.client.CoreGUI; import org.rhq.enterprise.gui.coregui.client.ViewId; import org.rhq.enterprise.gui.coregui.client.ViewPath; -import org.rhq.enterprise.gui.coregui.client.admin.agent.install.RemoteAgentInstallView; -import org.rhq.enterprise.gui.coregui.client.admin.roles.RolesView; -import org.rhq.enterprise.gui.coregui.client.admin.users.UsersView; -import org.rhq.enterprise.gui.coregui.client.components.FullHTMLPane; import org.rhq.enterprise.gui.coregui.client.inventory.groups.ResourceGroupListView; import org.rhq.enterprise.gui.coregui.client.inventory.groups.definitions.GroupDefinitionListView; -import org.rhq.enterprise.gui.coregui.client.inventory.resource.discovery.ResourceAutodiscoveryView;
/** * @author Greg Hinkle @@ -54,8 +50,16 @@ public class InventoryView extends HLayout implements BookmarkableView {
public static final String VIEW_PATH = "Inventory";
- private SectionStack sectionStack; + + private ViewId currentSectionViewId; + private ViewId currentPageViewId; + private Canvas contentCanvas; + private Canvas currentContent; + private LinkedHashMap<String, TreeGrid> treeGrids = new LinkedHashMap<String, TreeGrid>(); + + + private SectionStack sectionStack;
@Override protected void onInit() { @@ -74,8 +78,28 @@ public class InventoryView extends HLayout implements BookmarkableView { sectionStack.setWidth(250); sectionStack.setHeight100();
- sectionStack.addSection(buildResourcesSection()); - sectionStack.addSection(buildGroupsSection()); + buildResourcesSection(); + buildGroupsSection(); + + for (final String name : treeGrids.keySet()) { + TreeGrid grid = treeGrids.get(name); + + grid.addSelectionChangedHandler(new SelectionChangedHandler() { + public void onSelectionChanged(SelectionEvent selectionEvent) { + if (selectionEvent.getState()) { + CoreGUI.goTo("Inventory/" + name + "/" + selectionEvent.getRecord().getAttribute("name")); + } + } + }); + + + SectionStackSection section = new SectionStackSection(name); + section.setExpanded(true); + section.addItem(grid); + + sectionStack.addSection(section); + } +
addMember(sectionStack); addMember(contentCanvas); @@ -95,16 +119,24 @@ public class InventoryView extends HLayout implements BookmarkableView { }
private SectionStackSection buildResourcesSection() { - final SectionStackSection section = new SectionStackSection("Inventory"); + final SectionStackSection section = new SectionStackSection("Resources"); section.setExpanded(true);
final TreeNode allResources = new TreeNode("All Resources"); final TreeNode onlyPlatforms = new TreeNode("Platforms"); + onlyPlatforms.setIcon("types/Platform_up_16.png"); + final TreeNode onlyServers = new TreeNode("Servers"); + onlyServers.setIcon("types/Server_up_16.png"); + final TreeNode onlyServices = new TreeNode("Services"); + onlyServices.setIcon("types/Service_up_16.png"); + final TreeNode inventory = new TreeNode("Inventory", allResources, onlyPlatforms, onlyServers, onlyServices);
final TreeNode downServers = new TreeNode("Down Servers"); + downServers.setIcon("types/Server_down_16.png"); + final TreeNode savedSearches = new TreeNode("Saved Searches", downServers);
TreeGrid treeGrid = new TreeGrid(); @@ -112,22 +144,9 @@ public class InventoryView extends HLayout implements BookmarkableView { Tree tree = new Tree(); tree.setRoot(new TreeNode("security", inventory, savedSearches)); treeGrid.setData(tree); - treeGrid.addSelectionChangedHandler(new SelectionChangedHandler() { - public void onSelectionChanged(SelectionEvent selectionEvent) { - if (selectionEvent.getRecord() == allResources) { - setContent(new ResourceSearchView()); - } else if (selectionEvent.getRecord() == onlyPlatforms) { - setContent(new ResourceSearchView(new Criteria(ResourceDataSourceField.CATEGORY.propertyName(), ResourceCategory.PLATFORM.name()))); - } else if (selectionEvent.getRecord() == onlyServers) { - setContent(new ResourceSearchView(new Criteria(ResourceDataSourceField.CATEGORY.propertyName(), ResourceCategory.SERVER.name()))); - } else if (selectionEvent.getRecord() == onlyServices) { - setContent(new ResourceSearchView(new Criteria(ResourceDataSourceField.CATEGORY.propertyName(), ResourceCategory.SERVICE.name()))); - } else if (selectionEvent.getRecord() == downServers) { - setContent(new ResourceSearchView(new Criteria(ResourceDataSourceField.AVAILABILITY.propertyName(), AvailabilityType.DOWN.name()))); - }
- } - }); + treeGrid.getTree().openAll(); + treeGrids.put("Resources", treeGrid);
section.addItem(treeGrid);
@@ -139,11 +158,11 @@ public class InventoryView extends HLayout implements BookmarkableView { section.setExpanded(true);
final TreeNode allGroups = new TreeNode("All Groups"); - final TreeNode onlyCompatible = new TreeNode("Compatible"); - final TreeNode onlyMixed = new TreeNode("Mixed"); + final TreeNode onlyCompatible = new TreeNode("Compatible Groups"); + final TreeNode onlyMixed = new TreeNode("Mixed Groups"); final TreeNode groupGroupDefinitions = new TreeNode("Group Definitions"); final TreeNode inventory = new TreeNode("Inventory", allGroups, onlyCompatible, onlyMixed, - groupGroupDefinitions); + groupGroupDefinitions);
final TreeNode problemGroups = new TreeNode("Problem Groups"); final TreeNode savedSearches = new TreeNode("Saved Searches", problemGroups); @@ -153,86 +172,84 @@ public class InventoryView extends HLayout implements BookmarkableView { Tree tree = new Tree(); tree.setRoot(new TreeNode("clustering", inventory, savedSearches)); treeGrid.setData(tree); - treeGrid.addSelectionChangedHandler(new SelectionChangedHandler() { - public void onSelectionChanged(SelectionEvent selectionEvent) { - HTMLPane pane = new HTMLPane(); - pane.setContentsType(ContentsType.PAGE); - pane.setWidth100(); - pane.setHeight100(); - - String url = null; - if (selectionEvent.getRecord() == allGroups) { - setContent(new ResourceGroupListView()); - } else if (selectionEvent.getRecord() == onlyCompatible) { - setContent(new ResourceGroupListView(new Criteria("category", "compatible"))); - } else if (selectionEvent.getRecord() == onlyMixed) { - setContent(new ResourceGroupListView(new Criteria("category", "mixed"))); - } else if (selectionEvent.getRecord() == groupGroupDefinitions) { - setContent(new GroupDefinitionListView()); - } else if (selectionEvent.getRecord() == problemGroups) { - setContent(new ResourceGroupListView(new Criteria("availability", "down"))); - }
- } - });
+ treeGrid.getTree().openAll(); + treeGrids.put("Groups", treeGrid); section.addItem(treeGrid);
return section; }
public void setContent(Canvas newContent) { - if (contentCanvas.getChildren().length > 0) - contentCanvas.getChildren()[0].destroy(); - newContent.setWidth100(); - newContent.setHeight100(); + + if (contentCanvas.getChildren().length > 0) { + for (Canvas child : contentCanvas.getChildren()) { + child.destroy(); + } + } + contentCanvas.addChild(newContent); contentCanvas.markForRedraw(); + this.currentContent = newContent; }
- private void renderContentView(ViewPath viewPath) {
- ViewId currentSectionViewId = viewPath.getCurrent(); - ViewId currentPageViewId = viewPath.getNext(); + currentSectionViewId = viewPath.getCurrent(); + currentPageViewId = viewPath.getNext();
String section = currentSectionViewId.getPath(); String page = currentPageViewId.getPath();
- Canvas content = null; - if ("Reports".equals(section)) { - - if ("Inventory Summary".equals(page)) { - content = new FullHTMLPane("/rhq/admin/report/resourceInstallReport-body.xhtml"); + if ("Resources".equals(section)) { + + if ("All Resources".equals(page)) { + content = new ResourceSearchView(); + } else if ("Platforms".equals(page)) { + content = new ResourceSearchView(new Criteria(ResourceDataSourceField.CATEGORY.propertyName(), ResourceCategory.PLATFORM.name())); + } else if ("Servers".equals(page)) { + content = new ResourceSearchView(new Criteria(ResourceDataSourceField.CATEGORY.propertyName(), ResourceCategory.SERVER.name())); + } else if ("Services".equals(page)) { + content = new ResourceSearchView(new Criteria(ResourceDataSourceField.CATEGORY.propertyName(), ResourceCategory.SERVICE.name())); + } else if ("Down Servers".equals(page)) { + + Criteria criteria = new Criteria(ResourceDataSourceField.AVAILABILITY.propertyName(), AvailabilityType.DOWN.name()); + criteria.addCriteria(ResourceDataSourceField.CATEGORY.propertyName(), ResourceCategory.SERVER.name()); + content = new ResourceSearchView(criteria); }
- - } else if ("Security".equals(section)) { - - if ("Manage Users".equals(page)) { - content = new UsersView(); - } else if ("Manage Roles".equals(page)) { - content = new RolesView(); - } else if ("Auto Discovery Queue".equals(page)) { - content = new ResourceAutodiscoveryView(); - } else if ("Remote Agent Install".equals(page)) { - content = new RemoteAgentInstallView(); + } else if ("Groups".equals(section)) { + + if ("All Groups".equals(page)) { + content = new ResourceGroupListView(); + } else if ("Compatible Groups".equals(page)) { + content = new ResourceGroupListView(new Criteria("category", "compatible")); + } else if ("Mixed Groups".equals(page)) { + content = new ResourceGroupListView(new Criteria("category", "mixed")); + } else if ("Group Definitions".equals(page)) { + content = new GroupDefinitionListView(); + } else if ("Problem Groups".equals(page)) { + content = new ResourceGroupListView(new Criteria("availability", "down")); } }
- /* for (String name : treeGrids.keySet()) { + for (String name : treeGrids.keySet()) {
TreeGrid treeGrid = treeGrids.get(name); if (name.equals(section)) { - treeGrid.setSelectedPaths(page); + for (TreeNode node : treeGrid.getTree().getAllNodes()) { + if (page.equals(node.getName())) { + treeGrid.selectSingleRecord(node); + } + } } else { treeGrid.deselectAllRecords(); } - }*/ - + }
setContent(content); @@ -245,21 +262,23 @@ public class InventoryView extends HLayout implements BookmarkableView {
}
- public void renderView(ViewPath viewPath) {
-/* if (!viewPath.isCurrent(currentSectionViewId) || !viewPath.isNext(currentPageViewId)) {
if (viewPath.isEnd()) { // Display default view - setContent(defaultView()); + History.newItem("Inventory/Resources/Platforms"); } else { + renderContentView(viewPath); } - } -*/ + } else { + if (this.currentContent instanceof BookmarkableView) { + ((BookmarkableView) this.currentContent).renderView(viewPath.next().next()); + }
+ }
}
commit a0f9e2b954909ce99fa01172199dd3acef6e219f Author: Greg Hinkle ghinkle@redhat.com Date: Thu Jul 29 23:16:50 2010 -0400
Make sure all children are removed when updating view
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/ReportTopView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/ReportTopView.java index 258326d..c3bcddd 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/ReportTopView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/ReportTopView.java @@ -241,8 +241,11 @@ public class ReportTopView extends HLayout implements BookmarkableView {
public void setContent(Canvas newContent) {
- if (contentCanvas.getChildren().length > 0) - contentCanvas.getChildren()[0].destroy(); + if (contentCanvas.getChildren().length > 0) { + for (Canvas child : contentCanvas.getChildren()) { + child.destroy(); + } + }
contentCanvas.addChild(newContent); contentCanvas.markForRedraw();
commit 0a63a1ae2ee61d278ea9f62c7825796d3f81daa2 Author: Greg Hinkle ghinkle@redhat.com Date: Thu Jul 29 21:07:11 2010 -0400
Fix report section history tree reselection
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/ReportTopView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/ReportTopView.java index 4c25c61..258326d 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/ReportTopView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/ReportTopView.java @@ -25,6 +25,7 @@ package org.rhq.enterprise.gui.coregui.client.report;
import java.util.LinkedHashMap;
+import com.google.gwt.http.client.URL; import com.smartgwt.client.types.VisibilityMode; import com.smartgwt.client.widgets.Canvas; import com.smartgwt.client.widgets.HTMLFlow; @@ -100,7 +101,9 @@ public class ReportTopView extends HLayout implements BookmarkableView {
grid.addSelectionChangedHandler(new SelectionChangedHandler() { public void onSelectionChanged(SelectionEvent selectionEvent) { - CoreGUI.goTo("Reports/" + name + "/" + selectionEvent.getRecord().getAttribute("name")); + if (selectionEvent.getState()) { + CoreGUI.goTo("Reports/" + name + "/" + selectionEvent.getRecord().getAttribute("name")); + } } });
@@ -255,6 +258,8 @@ public class ReportTopView extends HLayout implements BookmarkableView { String section = currentSectionViewId.getPath(); String page = currentPageViewId.getPath();
+ page = URL.decode(page); +
Canvas content = null; if ("Inventory".equals(section)) { @@ -325,7 +330,10 @@ public class ReportTopView extends HLayout implements BookmarkableView {
TreeGrid treeGrid = treeGrids.get(name); if (name.equals(section)) { -// treeGrid.setSelectedPaths(page); + TreeNode node = treeGrid.getTree().find(page); + if (node != null) { + treeGrid.selectSingleRecord(node); + } } else { treeGrid.deselectAllRecords(); } @@ -352,6 +360,7 @@ public class ReportTopView extends HLayout implements BookmarkableView { // Display default view setContent(defaultView()); } else { + renderContentView(viewPath); } } else {
commit 257c7680ec31b84d8a1a332cf728480f4a718c16 Author: Greg Hinkle ghinkle@redhat.com Date: Thu Jul 29 17:48:27 2010 -0400
Global operation history view for reports section
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/OperationHistoryDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/OperationHistoryDataSource.java index de4bd1e..c353fdb 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/OperationHistoryDataSource.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/OperationHistoryDataSource.java @@ -20,14 +20,6 @@ package org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.operatio
import java.util.Date;
-import org.rhq.core.domain.criteria.ResourceOperationHistoryCriteria; -import org.rhq.core.domain.operation.ResourceOperationHistory; -import org.rhq.core.domain.util.PageList; -import org.rhq.enterprise.gui.coregui.client.CoreGUI; -import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup; -import org.rhq.enterprise.gui.coregui.client.gwt.OperationGWTServiceAsync; -import org.rhq.enterprise.gui.coregui.client.util.RPCDataSource; - import com.google.gwt.user.client.rpc.AsyncCallback; import com.smartgwt.client.data.DSRequest; import com.smartgwt.client.data.DSResponse; @@ -36,6 +28,14 @@ import com.smartgwt.client.data.fields.DataSourceTextField; import com.smartgwt.client.types.FieldType; import com.smartgwt.client.widgets.grid.ListGridRecord;
+import org.rhq.core.domain.criteria.ResourceOperationHistoryCriteria; +import org.rhq.core.domain.operation.ResourceOperationHistory; +import org.rhq.core.domain.util.PageList; +import org.rhq.enterprise.gui.coregui.client.CoreGUI; +import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup; +import org.rhq.enterprise.gui.coregui.client.gwt.OperationGWTServiceAsync; +import org.rhq.enterprise.gui.coregui.client.util.RPCDataSource; + /** * @author Greg Hinkle */ @@ -107,7 +107,7 @@ public class OperationHistoryDataSource extends RPCDataSource<ResourceOperationH record.setAttribute("operationDefinition", from.getOperationDefinition()); record.setAttribute("operationName", from.getOperationDefinition().getDisplayName()); record.setAttribute("errorMessage", from.getErrorMessage()); - record.setAttribute("status", from.getStatus().getDisplayName()); + record.setAttribute("status", from.getStatus().name()); record.setAttribute("parameters", from.getParameters());
record.setAttribute("entity",from); diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/OperationHistoryView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/OperationHistoryView.java index ad2d156..b537f5d 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/OperationHistoryView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/OperationHistoryView.java @@ -20,8 +20,23 @@ package org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.operatio
import java.util.EnumSet;
+import com.google.gwt.user.client.rpc.AsyncCallback; +import com.smartgwt.client.data.Criteria; +import com.smartgwt.client.widgets.Canvas; +import com.smartgwt.client.widgets.grid.CellFormatter; +import com.smartgwt.client.widgets.grid.ListGridRecord; +import com.smartgwt.client.widgets.grid.events.RecordDoubleClickEvent; +import com.smartgwt.client.widgets.grid.events.RecordDoubleClickHandler; +import com.smartgwt.client.widgets.layout.VLayout; +import com.smartgwt.client.widgets.menu.IMenuButton; +import com.smartgwt.client.widgets.menu.Menu; +import com.smartgwt.client.widgets.menu.MenuItem; +import com.smartgwt.client.widgets.menu.events.ClickHandler; +import com.smartgwt.client.widgets.menu.events.MenuItemClickEvent; + import org.rhq.core.domain.criteria.ResourceOperationHistoryCriteria; import org.rhq.core.domain.operation.OperationDefinition; +import org.rhq.core.domain.operation.OperationRequestStatus; import org.rhq.core.domain.operation.ResourceOperationHistory; import org.rhq.core.domain.resource.Resource; import org.rhq.core.domain.resource.ResourceType; @@ -34,22 +49,6 @@ import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.operation import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.operation.detail.OperationDetailsView; import org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTypeRepository;
-import com.google.gwt.user.client.rpc.AsyncCallback; -import com.smartgwt.client.data.Criteria; -import com.smartgwt.client.widgets.events.DoubleClickEvent; -import com.smartgwt.client.widgets.events.DoubleClickHandler; -import com.smartgwt.client.widgets.grid.CellFormatter; -import com.smartgwt.client.widgets.grid.ListGridRecord; -import com.smartgwt.client.widgets.grid.events.RecordDoubleClickEvent; -import com.smartgwt.client.widgets.grid.events.RecordDoubleClickHandler; -import com.smartgwt.client.widgets.layout.VLayout; -import com.smartgwt.client.widgets.menu.IMenuButton; -import com.smartgwt.client.widgets.menu.Menu; -import com.smartgwt.client.widgets.menu.MenuButton; -import com.smartgwt.client.widgets.menu.MenuItem; -import com.smartgwt.client.widgets.menu.events.ClickHandler; -import com.smartgwt.client.widgets.menu.events.MenuItemClickEvent; - /** * @author Greg Hinkle */ @@ -91,6 +90,31 @@ public class OperationHistoryView extends VLayout { table.getListGrid().getField("id").setWidth(40); table.getListGrid().getField("operationName").setWidth("*"); table.getListGrid().getField("status").setWidth(100); + table.getListGrid().getField("status").setCellFormatter(new CellFormatter() { + public String format(Object o, ListGridRecord listGridRecord, int i, int i1) { + OperationRequestStatus status = OperationRequestStatus.valueOf((String) o); + String icon = ""; + switch (status) { + case INPROGRESS: + break; + case SUCCESS: + icon = "_ok"; + break; + case FAILURE: + icon = "_failed"; + break; + case CANCELED: + icon = "_cancel"; + break; + } + + + return Canvas.imgHTML("subsystems/control/Operation" + icon + "_16.png", 16, 16) + status.getDisplayName(); + } + }); + + + table.getListGrid().getField("startedTime").setWidth(120);
if (this.resource == null) { diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/ReportTopView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/ReportTopView.java index a842474..4c25c61 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/ReportTopView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/ReportTopView.java @@ -47,9 +47,10 @@ import org.rhq.enterprise.gui.coregui.client.admin.users.UsersView; import org.rhq.enterprise.gui.coregui.client.alert.AlertsView; import org.rhq.enterprise.gui.coregui.client.components.FullHTMLPane; import org.rhq.enterprise.gui.coregui.client.dashboard.portlets.platform.PlatformPortletView; +import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.configuration.ConfigurationHistoryView; import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.operation.OperationHistoryView; import org.rhq.enterprise.gui.coregui.client.inventory.resource.discovery.ResourceAutodiscoveryView; -import org.rhq.enterprise.gui.coregui.client.report.tag.TagCloudView; +import org.rhq.enterprise.gui.coregui.client.report.measurement.MeasurementOOBView; import org.rhq.enterprise.gui.coregui.client.report.tag.TaggedView;
/** @@ -261,9 +262,9 @@ public class ReportTopView extends HLayout implements BookmarkableView { if ("Tag Cloud".equals(page)) { content = new TaggedView(); } else if ("Suspect Metrics".equals(page)) { -// todo + content = new MeasurementOOBView(); } else if ("Recent Configuration Changes".equals(page)) { - // todo + content = new ConfigurationHistoryView(); } else if ("Recent Operations".equals(page)) { content = new OperationHistoryView(); } else if ("Recent Alerts".equals(page)) {
commit f60815062de16b61e874b8bac38c9c5d5a452550 Author: Greg Hinkle ghinkle@redhat.com Date: Thu Jul 29 17:47:43 2010 -0400
Global configuration history view and lookup via criteria Configuration detail moved to a dialog
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ConfigurationGWTService.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ConfigurationGWTService.java index cbe4cc9..4010ae0 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ConfigurationGWTService.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ConfigurationGWTService.java @@ -6,6 +6,8 @@ import org.rhq.core.domain.configuration.PluginConfigurationUpdate; import org.rhq.core.domain.configuration.RawConfiguration; import org.rhq.core.domain.configuration.ResourceConfigurationUpdate; import org.rhq.core.domain.configuration.definition.ConfigurationDefinition; +import org.rhq.core.domain.criteria.ResourceConfigurationUpdateCriteria; +import org.rhq.core.domain.util.PageControl; import org.rhq.core.domain.util.PageList; import org.rhq.enterprise.server.configuration.ConfigurationUpdateStillInProgressException;
@@ -23,12 +25,16 @@ public interface ConfigurationGWTService extends RemoteService {
ConfigurationDefinition getResourceConfigurationDefinition(int resourceTypeId);
- PageList<ResourceConfigurationUpdate> findResourceConfigurationUpdates(int resourceId); + PageList<ResourceConfigurationUpdate> findResourceConfigurationUpdates( + Integer resourceId, Long beginDate, Long endDate, boolean suppressOldest, PageControl pc); +
ResourceConfigurationUpdate updateResourceConfiguration(int resourceId, Configuration configuration);
PluginConfigurationUpdate updatePluginConfiguration(int resourceId, Configuration configuration);
+ PageList<ResourceConfigurationUpdate> findResourceConfigurationUpdatesByCriteria(ResourceConfigurationUpdateCriteria criteria); + RawConfiguration dummy(RawConfiguration config);
} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/configuration/ConfigurationHistoryDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/configuration/ConfigurationHistoryDataSource.java index c476bee..6f721b2 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/configuration/ConfigurationHistoryDataSource.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/configuration/ConfigurationHistoryDataSource.java @@ -19,6 +19,8 @@ package org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.configuration;
import org.rhq.core.domain.configuration.ResourceConfigurationUpdate; +import org.rhq.core.domain.criteria.ResourceConfigurationUpdateCriteria; +import org.rhq.core.domain.util.PageControl; import org.rhq.core.domain.util.PageList; import org.rhq.enterprise.gui.coregui.client.CoreGUI; import org.rhq.enterprise.gui.coregui.client.gwt.ConfigurationGWTServiceAsync; @@ -46,21 +48,21 @@ public class ConfigurationHistoryDataSource extends RPCDataSource<ResourceConfig public ConfigurationHistoryDataSource() { super();
- // id, resource, subject, configuration, createdTime, duration, errorMessage, modifiedTime, status - - DataSourceIntegerField idField = new DataSourceIntegerField("id"); idField.setPrimaryKey(true); addField(idField);
- DataSourceTextField submittedField = new DataSourceTextField("createdTime"); + DataSourceTextField resourceField = new DataSourceTextField("resource", "Resource"); + addField(resourceField); + + DataSourceTextField submittedField = new DataSourceTextField("createdTime", "Created"); submittedField.setType(FieldType.DATETIME); addField(submittedField);
- DataSourceTextField statusField = new DataSourceTextField("status"); + DataSourceTextField statusField = new DataSourceTextField("status", "Status"); addField(statusField);
- DataSourceTextField subjectField = new DataSourceTextField("subject"); + DataSourceTextField subjectField = new DataSourceTextField("subject", "Subject"); addField(subjectField);
@@ -69,46 +71,52 @@ public class ConfigurationHistoryDataSource extends RPCDataSource<ResourceConfig @Override protected void executeFetch(final DSRequest request, final DSResponse response) {
- int resourceId = (Integer) request.getCriteria().getValues().get("resourceId"); - - configurationService.findResourceConfigurationUpdates(resourceId, new AsyncCallback<PageList<ResourceConfigurationUpdate>>() { - public void onFailure(Throwable caught) { - CoreGUI.getErrorHandler().handleError("Unable to load configuration history",caught); - response.setStatus(DSResponse.STATUS_FAILURE); - processResponse(request.getRequestId(),response); - } - - public void onSuccess(PageList<ResourceConfigurationUpdate> result) { - response.setData(buildRecords(result)); - response.setTotalRows(result.getTotalSize()); - processResponse(request.getRequestId(), response); - } - }); + ResourceConfigurationUpdateCriteria criteria = new ResourceConfigurationUpdateCriteria(); + criteria.fetchConfiguration(true); + criteria.fetchResource(true); + + criteria.setPageControl(getPageControl(request)); + + if (request.getCriteria().getValues().get("resourceId") != null) { + criteria.addFilterResourceIds((Integer)request.getCriteria().getValues().get("resourceId")); + } + + configurationService.findResourceConfigurationUpdatesByCriteria(criteria, + new AsyncCallback<PageList<ResourceConfigurationUpdate>>() { + public void onFailure(Throwable caught) { + CoreGUI.getErrorHandler().handleError("Unable to load configuration history", caught); + response.setStatus(DSResponse.STATUS_FAILURE); + processResponse(request.getRequestId(), response); + } + + public void onSuccess(PageList<ResourceConfigurationUpdate> result) { + response.setData(buildRecords(result)); + response.setTotalRows(result.getTotalSize()); + processResponse(request.getRequestId(), response); + } + }); }
- - - @Override public ResourceConfigurationUpdate copyValues(ListGridRecord from) { - return null; // TODO: Implement this method. + return null; // TODO: Implement this method. }
@Override public ListGridRecord copyValues(ResourceConfigurationUpdate from) { ListGridRecord record = new ListGridRecord(); record.setAttribute("id", from.getId()); - record.setAttribute("resource",from.getResource()); - record.setAttribute("subject",from.getSubjectName()); + record.setAttribute("resource", from.getResource()); + record.setAttribute("subject", from.getSubjectName()); record.setAttribute("configuration", from.getConfiguration()); - record.setAttribute("createdTime",new Date(from.getCreatedTime())); + record.setAttribute("createdTime", new Date(from.getCreatedTime())); record.setAttribute("duration", from.getDuration()); record.setAttribute("errorMessage", from.getErrorMessage()); record.setAttribute("modifiedTime", new Date(from.getModifiedTime())); - record.setAttribute("status",from.getStatus().name()); + record.setAttribute("status", from.getStatus().name());
- record.setAttribute("entity",from); + record.setAttribute("entity", from); return record; } } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/configuration/ConfigurationHistoryDetailView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/configuration/ConfigurationHistoryDetailView.java index 6d64732..b033a40 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/configuration/ConfigurationHistoryDetailView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/configuration/ConfigurationHistoryDetailView.java @@ -20,6 +20,7 @@ package org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.configur
import java.util.EnumSet;
+import com.smartgwt.client.widgets.Window; import com.smartgwt.client.widgets.layout.Layout;
import org.rhq.core.domain.configuration.Configuration; @@ -61,4 +62,18 @@ public class ConfigurationHistoryDetailView extends Layout { addMember(editor); markForRedraw(); } + + public void displayInDialog() { + + Window window = new Window(); + window.setTitle("Configuration Details"); + window.setWidth(800); + window.setHeight(800); + window.setIsModal(true); + window.setShowModalMask(true); + window.setCanDragResize(true); + window.centerInPage(); + window.addItem(this); + window.show(); + } } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/configuration/ConfigurationHistoryView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/configuration/ConfigurationHistoryView.java index d7ca524..721fd06 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/configuration/ConfigurationHistoryView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/configuration/ConfigurationHistoryView.java @@ -24,15 +24,24 @@ import java.util.EnumSet; import com.smartgwt.client.data.Criteria; import com.smartgwt.client.types.SelectionAppearance; import com.smartgwt.client.types.SelectionStyle; +import com.smartgwt.client.widgets.Canvas; +import com.smartgwt.client.widgets.grid.CellFormatter; +import com.smartgwt.client.widgets.grid.ListGrid; import com.smartgwt.client.widgets.grid.ListGridField; import com.smartgwt.client.widgets.grid.ListGridRecord; +import com.smartgwt.client.widgets.grid.events.CellDoubleClickEvent; +import com.smartgwt.client.widgets.grid.events.CellDoubleClickHandler; import com.smartgwt.client.widgets.grid.events.SelectionChangedHandler; import com.smartgwt.client.widgets.grid.events.SelectionEvent; import com.smartgwt.client.widgets.layout.VLayout;
+import org.rhq.core.domain.configuration.ConfigurationUpdateStatus; import org.rhq.core.domain.configuration.ResourceConfigurationUpdate; import org.rhq.core.domain.configuration.definition.ConfigurationDefinition; +import org.rhq.core.domain.operation.OperationRequestStatus; +import org.rhq.core.domain.resource.Resource; import org.rhq.core.domain.resource.ResourceType; +import org.rhq.enterprise.gui.coregui.client.CoreGUI; import org.rhq.enterprise.gui.coregui.client.components.configuration.ConfigurationComparisonView; import org.rhq.enterprise.gui.coregui.client.components.table.Table; import org.rhq.enterprise.gui.coregui.client.components.table.TableAction; @@ -43,20 +52,22 @@ import org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTyp */ public class ConfigurationHistoryView extends VLayout {
- private int resourceId; + private Integer resourceId;
- ConfigurationHistoryDetailView detailView;
- /** - * Resource list filtered by a given criteria - */ - public ConfigurationHistoryView(final int resourceId) { - this.resourceId = resourceId; - + public ConfigurationHistoryView() { setWidth100(); setHeight100(); setAnimateMembers(true); + + } + + + public ConfigurationHistoryView(final int resourceId) { + this(); + this.resourceId = resourceId; + }
@@ -65,7 +76,9 @@ public class ConfigurationHistoryView extends VLayout { super.onDraw();
Criteria criteria = new Criteria(); - criteria.addCriteria("resourceId", resourceId); + if (resourceId != null) { + criteria.addCriteria("resourceId", (int)resourceId); + }
final ConfigurationHistoryDataSource datasource = new ConfigurationHistoryDataSource(); @@ -75,15 +88,47 @@ public class ConfigurationHistoryView extends VLayout { table.setDataSource(datasource); table.getListGrid().setUseAllDataSourceFields(true);
- ListGridField idField = new ListGridField("id", "ID", 60); - ListGridField createdField = new ListGridField("createdTime", "Timestamp", 200); - ListGridField statusField = new ListGridField("status", "Status", 100); - ListGridField userField = new ListGridField("subject", "User", 150); - table.getListGrid().setFields(idField, createdField, statusField, userField);
- table.getListGrid().setSelectionType(SelectionStyle.SIMPLE); - table.getListGrid().setSelectionAppearance(SelectionAppearance.CHECKBOX); - table.getListGrid().setResizeFieldsInRealTime(true); + ListGrid grid = table.getListGrid(); + + grid.getField("id").setWidth(60); + grid.getField("createdTime").setWidth(200); + + if (resourceId != null) { + grid.hideField("resource"); + } else { + grid.getField("resource").setCellFormatter(new CellFormatter() { + public String format(Object o, ListGridRecord listGridRecord, int i, int i1) { + Resource res = (Resource) o; + return "<a href="#Resource/" + res.getId() + "">" + res.getName() + "</a>"; + } + }); + } + + grid.getField("status").setWidth(100); + grid.getField("status").setCellFormatter(new CellFormatter() { + public String format(Object o, ListGridRecord listGridRecord, int i, int i1) { + ConfigurationUpdateStatus status = ConfigurationUpdateStatus.valueOf((String) o); + String icon = ""; + switch (status) { + case INPROGRESS: + break; + case SUCCESS: + icon = "_ok"; + break; + case FAILURE: + icon = "_failed"; + break; + case NOCHANGE: + break; + } + + return Canvas.imgHTML("subsystems/configure/Configure" + icon + "_16.png", 16, 16) + o; + } + }); + + grid.getField("subject").setWidth(150); +
table.addTableAction("Remove", Table.SelectionEnablement.ANY, @@ -91,6 +136,7 @@ public class ConfigurationHistoryView extends VLayout { new TableAction() { public void executeAction(ListGridRecord[] selection) { // TODO: Implement this method. + CoreGUI.getErrorHandler().handleError("Not implemented"); } });
@@ -106,44 +152,48 @@ public class ConfigurationHistoryView extends VLayout { } });
+ table.getListGrid().addCellDoubleClickHandler(new CellDoubleClickHandler() { + public void onCellDoubleClick(CellDoubleClickEvent cellDoubleClickEvent) { + ListGridRecord record = cellDoubleClickEvent.getRecord(); + showDetails(record); + } + }); + + table.addTableAction("Show Details", Table.SelectionEnablement.SINGLE, null, + new TableAction() { + public void executeAction(ListGridRecord[] selection) { + + ListGridRecord record = selection[0]; + + showDetails(record); + } + });
- table.setShowResizeBar(true); - table.setResizeBarTarget("next"); addMember(table); + }
+ public static void showDetails(ListGridRecord record) { + final ResourceConfigurationUpdate update = (ResourceConfigurationUpdate) record.getAttributeAsObject("entity");
- detailView = new ConfigurationHistoryDetailView(); - detailView.setHeight("70%"); - detailView.hide(); + ResourceTypeRepository.Cache.getInstance().getResourceTypes( + update.getResource().getResourceType().getId(), + EnumSet.of(ResourceTypeRepository.MetadataType.resourceConfigurationDefinition), + new ResourceTypeRepository.TypeLoadedCallback() {
- addMember(detailView); + public void onTypesLoaded(ResourceType type) {
+ ConfigurationDefinition definition = type.getResourceConfigurationDefinition();
- table.getListGrid().addSelectionChangedHandler(new SelectionChangedHandler() { - public void onSelectionChanged(SelectionEvent selectionEvent) { - if (selectionEvent.getState()) { - ListGridRecord record = (ListGridRecord) selectionEvent.getRecord(); - final ResourceConfigurationUpdate update = (ResourceConfigurationUpdate) record.getAttributeAsObject("entity");
- ResourceTypeRepository.Cache.getInstance().getResourceTypes( - update.getResource().getResourceType().getId(), - EnumSet.of(ResourceTypeRepository.MetadataType.resourceConfigurationDefinition), - new ResourceTypeRepository.TypeLoadedCallback() { + ConfigurationHistoryDetailView detailView = new ConfigurationHistoryDetailView();
- public void onTypesLoaded(ResourceType type) { + detailView.setConfiguration(definition, update.getConfiguration());
- ConfigurationDefinition definition = type.getResourceConfigurationDefinition(); + detailView.displayInDialog(); + + } + });
- detailView.setConfiguration(definition, update.getConfiguration()); - detailView.setHeight("75%"); - showMember(detailView); - } - }); - } else { - hideMember(detailView); - } - } - }); }
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ConfigurationGWTServiceImpl.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ConfigurationGWTServiceImpl.java index 83c15b7..487b167 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ConfigurationGWTServiceImpl.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ConfigurationGWTServiceImpl.java @@ -6,6 +6,7 @@ import org.rhq.core.domain.configuration.PluginConfigurationUpdate; import org.rhq.core.domain.configuration.RawConfiguration; import org.rhq.core.domain.configuration.ResourceConfigurationUpdate; import org.rhq.core.domain.configuration.definition.ConfigurationDefinition; +import org.rhq.core.domain.criteria.ResourceConfigurationUpdateCriteria; import org.rhq.core.domain.util.PageControl; import org.rhq.core.domain.util.PageList; import org.rhq.core.domain.util.PageOrdering; @@ -49,14 +50,12 @@ public class ConfigurationGWTServiceImpl extends AbstractGWTServiceImpl implemen return SerialUtility.prepare(definition, "ResourceDefinition"); }
- public PageList<ResourceConfigurationUpdate> findResourceConfigurationUpdates(int resourceId) { - PageList<ResourceConfigurationUpdate> result; + public PageList<ResourceConfigurationUpdate> findResourceConfigurationUpdates( + Integer resourceId, Long beginDate, Long endDate, boolean suppressOldest, PageControl pc) {
- PageControl pc = PageControl.getUnlimitedInstance(); - pc.initDefaultOrderingField("cu.id", PageOrdering.DESC); - - // TODO GH: I'd prefer a criteria based solution here - result = configurationManager.findResourceConfigurationUpdates(getSessionSubject(), resourceId, null, null, false, pc); + PageList<ResourceConfigurationUpdate> result = + configurationManager.findResourceConfigurationUpdates( + getSessionSubject(), resourceId, beginDate, endDate, suppressOldest, pc);
return SerialUtility.prepare(result, "ConfigurationService.findResourceConfigurationUpdates"); } @@ -76,6 +75,14 @@ public class ConfigurationGWTServiceImpl extends AbstractGWTServiceImpl implemen return SerialUtility.prepare(update, "ConfigurationService.updatePluginConfiguration"); }
+ public PageList<ResourceConfigurationUpdate> findResourceConfigurationUpdatesByCriteria(ResourceConfigurationUpdateCriteria criteria) { + PageList<ResourceConfigurationUpdate> updates = + configurationManager.findResourceConfigurationUpdatesByCriteria( + getSessionSubject(), criteria + ); + + return SerialUtility.prepare(updates, "ConfigurationService.findResourceConfigurationUpdatesByCriteria"); + }
public RawConfiguration dummy(RawConfiguration config) { System.out.println(config.getPath());
commit eb013e6250a5f4ba88bebefb41582c5b62e52615 Author: Greg Hinkle ghinkle@redhat.com Date: Thu Jul 29 17:46:28 2010 -0400
Measurement oob history view for reports
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/MeasurementDataGWTService.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/MeasurementDataGWTService.java index d4a4731..cd99ad7 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/MeasurementDataGWTService.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/MeasurementDataGWTService.java @@ -33,6 +33,7 @@ import org.rhq.core.domain.measurement.MeasurementDefinition; import org.rhq.core.domain.measurement.MeasurementSchedule; import org.rhq.core.domain.measurement.calltime.CallTimeDataComposite; import org.rhq.core.domain.measurement.composite.MeasurementDataNumericHighLowComposite; +import org.rhq.core.domain.measurement.composite.MeasurementOOBComposite; import org.rhq.core.domain.util.PageControl; import org.rhq.core.domain.util.PageList;
@@ -55,4 +56,10 @@ public interface MeasurementDataGWTService extends RemoteService { public PageList<MeasurementDefinition> findMeasurementDefinitionsByCriteria(MeasurementDefinitionCriteria criteria);
public PageList<MeasurementSchedule> findMeasurementSchedulesByCriteria(MeasurementScheduleCriteria criteria); + + PageList<MeasurementOOBComposite> getSchedulesWithOOBs(String metricNameFilter, + String resourceNameFilter, String parentNameFilter, PageControl pc); + + PageList<MeasurementOOBComposite> getHighestNOOBsForResource(int resourceId, int n); + } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/measurement/MeasurementOOBDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/measurement/MeasurementOOBDataSource.java new file mode 100644 index 0000000..0df9e99 --- /dev/null +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/measurement/MeasurementOOBDataSource.java @@ -0,0 +1,154 @@ +/* + * RHQ Management Platform + * Copyright (C) 2005-2010 Red Hat, Inc. + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License, version 2, as + * published by the Free Software Foundation, and/or the GNU Lesser + * General Public License, version 2.1, also as published by the Free + * Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License and the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License + * and the GNU Lesser General Public License along with this program; + * if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +package org.rhq.enterprise.gui.coregui.client.report.measurement; + +import java.util.Collection; +import java.util.List; + +import com.google.gwt.user.client.rpc.AsyncCallback; +import com.smartgwt.client.data.DSRequest; +import com.smartgwt.client.data.DSResponse; +import com.smartgwt.client.data.fields.DataSourceLinkField; +import com.smartgwt.client.data.fields.DataSourceTextField; +import com.smartgwt.client.widgets.HTMLFlow; +import com.smartgwt.client.widgets.grid.ListGridRecord; + +import org.rhq.core.domain.measurement.MeasurementConverterClient; +import org.rhq.core.domain.measurement.composite.MeasurementOOBComposite; +import org.rhq.core.domain.util.PageControl; +import org.rhq.core.domain.util.PageList; +import org.rhq.enterprise.gui.coregui.client.CoreGUI; +import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup; +import org.rhq.enterprise.gui.coregui.client.util.RPCDataSource; + +/** + * @author Greg Hinkle + */ +public class MeasurementOOBDataSource extends RPCDataSource<MeasurementOOBComposite> { + + private int maximumFactor = 0; + + public MeasurementOOBDataSource() { + + + DataSourceTextField metricField = new DataSourceTextField("scheduleName","Metric"); + addField(metricField); + + DataSourceTextField resourceField = new DataSourceTextField("resourceName", "Resource"); + addField(resourceField); + + DataSourceTextField parentField = new DataSourceTextField("parentName", "Parent"); + addField(parentField); + + DataSourceTextField bandField = new DataSourceTextField("formattedBaseband", "Band"); + addField(bandField); + + DataSourceTextField outlierField = new DataSourceTextField("formattedOutlier", "Outlier"); + addField(outlierField); + + DataSourceTextField factorField = new DataSourceTextField("factor", "Out of range factor (%)"); + addField(factorField); + + } + + + @Override + protected void executeFetch(final DSRequest request, final DSResponse response) { + + PageControl pc = getPageControl(request); + + GWTServiceLookup.getMeasurementDataService().getSchedulesWithOOBs( + null, null, null, pc, + new AsyncCallback<PageList<MeasurementOOBComposite>>() { + public void onFailure(Throwable caught) { + CoreGUI.getErrorHandler().handleError("Failed to load measurement OOB information",caught); + } + + public void onSuccess(PageList<MeasurementOOBComposite> result) { + response.setData(buildRecords(result)); + response.setTotalRows(result.getTotalSize()); + processResponse(request.getRequestId(), response); + } + } + ); + + } + + @Override + public MeasurementOOBComposite copyValues(ListGridRecord from) { + throw new UnsupportedOperationException("OOBs Read only"); + } + + + @Override + public ListGridRecord[] buildRecords(Collection<MeasurementOOBComposite> list) { + for (MeasurementOOBComposite oob : list) { + if (oob.getFactor() > maximumFactor) + maximumFactor = oob.getFactor(); + } + + return super.buildRecords(list); + } + + @Override + public ListGridRecord copyValues(MeasurementOOBComposite from) { + applyFormatting(from); + + ListGridRecord record = new ListGridRecord(); + + record.setAttribute("scheduleId", from.getScheduleId()); + record.setAttribute("scheduleName", from.getScheduleName()); + record.setAttribute("definitionId", from.getDefinitionId()); + record.setAttribute("resourceId", from.getResourceId()); + record.setAttribute("resourceName", from.getResourceName()); + + record.setAttribute("factor", from.getFactor()); + record.setAttribute("formattedBaseband", from.getFormattedBaseband()); + record.setAttribute("formattedOutlier", from.getFormattedOutlier()); + record.setAttribute("blMin", from.getBlMin()); + record.setAttribute("blMax", from.getBlMax()); + record.setAttribute("parentId", from.getParentId()); + record.setAttribute("parentName", from.getParentName()); + + int factorRankingWidth = (int) (((double)from.getFactor())/ (double)maximumFactor * 100d); + + record.setBackgroundComponent( + new HTMLFlow( + "<div style="width: " + factorRankingWidth + "%; height: 100%; background-color: #A5B391;"> </div>")); + + return record; + + } + + + private void applyFormatting(MeasurementOOBComposite oob) { + oob.setFormattedOutlier(MeasurementConverterClient.format(oob.getOutlier(), oob.getUnits(), true)); + formatBaseband(oob); + } + + private void formatBaseband(MeasurementOOBComposite oob) { + String min = MeasurementConverterClient.format(oob.getBlMin(), oob.getUnits(), true); + String max = MeasurementConverterClient.format(oob.getBlMax(), oob.getUnits(), true); + oob.setFormattedBaseband(min + ", " + max); + } +} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/measurement/MeasurementOOBView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/measurement/MeasurementOOBView.java new file mode 100644 index 0000000..0b16677 --- /dev/null +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/measurement/MeasurementOOBView.java @@ -0,0 +1,61 @@ +/* + * RHQ Management Platform + * Copyright (C) 2005-2010 Red Hat, Inc. + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License, version 2, as + * published by the Free Software Foundation, and/or the GNU Lesser + * General Public License, version 2.1, also as published by the Free + * Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License and the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License + * and the GNU Lesser General Public License along with this program; + * if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +package org.rhq.enterprise.gui.coregui.client.report.measurement; + +import com.smartgwt.client.widgets.grid.CellFormatter; +import com.smartgwt.client.widgets.grid.ListGridRecord; + +import org.rhq.core.domain.resource.Resource; +import org.rhq.enterprise.gui.coregui.client.components.table.Table; + +/** + * @author Greg Hinkle + */ +public class MeasurementOOBView extends Table { + + + public MeasurementOOBView() { + super("Suspect Metrics"); + + + setDataSource(new MeasurementOOBDataSource()); + + getListGrid().setAlternateRecordStyles(false); + + + } + + @Override + protected void onInit() { + super.onInit(); + + + getListGrid().getField("resourceName").setCellFormatter(new CellFormatter() { + public String format(Object o, ListGridRecord listGridRecord, int i, int i1) { + return "<a href="#Resource/" + listGridRecord.getAttribute("resourceId") + "">" + o + "</a>"; + } + }); + + + } +} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/MeasurementDataGWTServiceImpl.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/MeasurementDataGWTServiceImpl.java index 5749dc4..2514bd6 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/MeasurementDataGWTServiceImpl.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/MeasurementDataGWTServiceImpl.java @@ -30,13 +30,16 @@ import org.rhq.core.domain.measurement.MeasurementDefinition; import org.rhq.core.domain.measurement.MeasurementSchedule; import org.rhq.core.domain.measurement.calltime.CallTimeDataComposite; import org.rhq.core.domain.measurement.composite.MeasurementDataNumericHighLowComposite; +import org.rhq.core.domain.measurement.composite.MeasurementOOBComposite; import org.rhq.core.domain.util.PageControl; import org.rhq.core.domain.util.PageList; import org.rhq.enterprise.gui.coregui.client.gwt.MeasurementDataGWTService; import org.rhq.enterprise.gui.coregui.server.util.SerialUtility; import org.rhq.enterprise.server.measurement.CallTimeDataManagerLocal; +import org.rhq.enterprise.server.measurement.MeasurementBaselineManagerLocal; import org.rhq.enterprise.server.measurement.MeasurementDataManagerLocal; import org.rhq.enterprise.server.measurement.MeasurementDefinitionManagerLocal; +import org.rhq.enterprise.server.measurement.MeasurementOOBManagerLocal; import org.rhq.enterprise.server.measurement.MeasurementScheduleManagerLocal; import org.rhq.enterprise.server.util.LookupUtil;
@@ -49,6 +52,7 @@ public class MeasurementDataGWTServiceImpl extends AbstractGWTServiceImpl implem
private MeasurementDataManagerLocal dataManager = LookupUtil.getMeasurementDataManager(); private CallTimeDataManagerLocal callTimeDataManager = LookupUtil.getCallTimeDataManager(); + private MeasurementOOBManagerLocal measurementOOBManager = LookupUtil.getOOBManager();
private MeasurementScheduleManagerLocal scheduleManager = LookupUtil.getMeasurementScheduleManager(); private MeasurementDefinitionManagerLocal definitionManager = LookupUtil.getMeasurementDefinitionManager(); @@ -84,4 +88,25 @@ public class MeasurementDataGWTServiceImpl extends AbstractGWTServiceImpl implem return SerialUtility.prepare(scheduleManager.findSchedulesByCriteria(getSessionSubject(), criteria), "MeasurementDataService.findMeasurementSchedulesByCriteria"); } + + + public PageList<MeasurementOOBComposite> getSchedulesWithOOBs(String metricNameFilter, String resourceNameFilter, String parentNameFilter, PageControl pc) { + return SerialUtility.prepare( + measurementOOBManager.getSchedulesWithOOBs( + getSessionSubject(), + metricNameFilter, + resourceNameFilter, + parentNameFilter, + pc), + "MeasurementDataService.getSchedulesWithOOBs"); + } + + public PageList<MeasurementOOBComposite> getHighestNOOBsForResource(int resourceId, int n) { + return SerialUtility.prepare( + measurementOOBManager.getHighestNOOBsForResource( + getSessionSubject(), + resourceId, + n), + "MeasurementDataService.getHighestNOOBsForResource"); + } }
commit cb605f26aa5ca97754f5518c82fdee35c7265ae5 Author: Greg Hinkle ghinkle@redhat.com Date: Thu Jul 29 17:45:19 2010 -0400
gwt serialization compatibility
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/measurement/composite/MeasurementOOBComposite.java b/modules/core/domain/src/main/java/org/rhq/core/domain/measurement/composite/MeasurementOOBComposite.java index f32c07b..d7cdcef 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/measurement/composite/MeasurementOOBComposite.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/measurement/composite/MeasurementOOBComposite.java @@ -50,6 +50,9 @@ public class MeasurementOOBComposite implements Serializable { private String formattedOutlier; private String formattedBaseband;
+ public MeasurementOOBComposite() { + } + public MeasurementOOBComposite(String resourceName, int resourceId, String scheduleName, int scheduleId, long timestamp, int definitionId, int factor, double blMin, double blMax, MeasurementUnits units, String parentName, Integer parentId) {
commit 9368e87552fb67fb7076295c8cd12ce7aa4d1e30 Author: Greg Hinkle ghinkle@redhat.com Date: Thu Jul 29 17:45:06 2010 -0400
Criteria query support for looking up ResourceConfigurationUpdate's Security fix for null resource history lookup
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/ResourceConfigurationUpdateCriteria.java b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/ResourceConfigurationUpdateCriteria.java new file mode 100644 index 0000000..af4f3b9 --- /dev/null +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/ResourceConfigurationUpdateCriteria.java @@ -0,0 +1,162 @@ +/* + * RHQ Management Platform + * Copyright (C) 2005-2008 Red Hat, Inc. + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License, version 2, as + * published by the Free Software Foundation, and/or the GNU Lesser + * General Public License, version 2.1, also as published by the Free + * Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License and the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License + * and the GNU Lesser General Public License along with this program; + * if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +package org.rhq.core.domain.criteria; + +import java.util.Arrays; +import java.util.List; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlRootElement; + +import org.rhq.core.domain.configuration.ConfigurationUpdateStatus; +import org.rhq.core.domain.configuration.ResourceConfigurationUpdate; +import org.rhq.core.domain.util.PageOrdering; + +/** + * @author Greg Hinkle + */ +@XmlRootElement +@XmlAccessorType(XmlAccessType.FIELD) +@SuppressWarnings("unused") +public class ResourceConfigurationUpdateCriteria extends Criteria { + private static final long serialVersionUID = 1L; + + public static final String SORT_FIELD_CTIME = "ctime"; + public static final String SORT_FIELD_RESOURCE_NAME = "name"; + public static final String SORT_FIELD_STATUS = "status"; + public static final String SORT_FIELD_RESOURCE_ID = "resourceId"; + + private Integer filterId; + private Long filterStartTime; // requires overrides + private Long filterEndTime; // requires overrides + private ConfigurationUpdateStatus filterStatus; + private String filterResourceTypeId; // requires overrides + private String filterResourceTypeName; // requires overrides + private List<Integer> filterResourceIds; // requires overrides + private List<Integer> filterResourceGroupIds; // requires overrides + + private boolean fetchResource; + private boolean fetchGroupConfigurationUpdate; + private boolean fetchConfiguration; + + private PageOrdering sortCtime; + private PageOrdering sortName; // requires sort override + private PageOrdering sortPriority; // requires sort override + private PageOrdering sortResourceId; // requires sort override + + public ResourceConfigurationUpdateCriteria() { + + filterOverrides.put("startTime", "ctime >= ?"); + filterOverrides.put("endTime", "ctime <= ?"); + filterOverrides.put("resourceTypeId", "resource.resourceType.id = ?"); + filterOverrides.put("resourceTypeName", "resource.resourceType.name like ?"); + filterOverrides.put("resourceIds", "resource.id IN ( ? )"); + filterOverrides.put("resourceGroupIds", "resource.id IN " // + + "( SELECT res.id " // + + " FROM ResourceGroup rg " // + + " JOIN rg.explicitResources res " // + + " WHERE rg.id = ? )"); + + sortOverrides.put(SORT_FIELD_RESOURCE_NAME, "resource.name"); + sortOverrides.put(SORT_FIELD_STATUS, "status"); + sortOverrides.put(SORT_FIELD_RESOURCE_ID, "resource.id"); + } + + @Override + public Class getPersistentClass() { + return ResourceConfigurationUpdate.class; + } + + // filters + + public void addFilterId(Integer filterId) { + this.filterId = filterId; + } + + public void addFilterStartTime(Long filterStartTime) { + this.filterStartTime = filterStartTime; + } + + public void addFilterEndTime(Long filterEndTime) { + this.filterEndTime = filterEndTime; + } + + public void addFilterStatus(ConfigurationUpdateStatus status) { + this.filterStatus = status; + } + + public void addFilterResourceTypeId(String filterResourceTypeId) { + this.filterResourceTypeId = filterResourceTypeId; + } + + public void addFilterResourceTypeName(String filterResourceTypeName) { + this.filterResourceTypeName = filterResourceTypeName; + } + + public void addFilterResourceIds(Integer... filterResourceIds) { + this.filterResourceIds = Arrays.asList(filterResourceIds); + } + + public void addFilterResourceGroupIds(Integer... filterResourceGroupIds) { + this.filterResourceGroupIds = Arrays.asList(filterResourceGroupIds); + } + + + // Fetches + + public void fetchResource(boolean fetchResource) { + this.fetchResource = fetchResource; + } + + public void fetchGroupConfigurationUpdate(boolean fetchGroupConfigurationUpdate) { + this.fetchGroupConfigurationUpdate = fetchGroupConfigurationUpdate; + } + + public void fetchConfiguration(boolean configuration) { + this.fetchConfiguration = configuration; + } + + + // Sorts + + public void addSortCtime(PageOrdering sortCtime) { + addSortField(SORT_FIELD_CTIME); + this.sortCtime = sortCtime; + } + + public void addSortResourceName(PageOrdering sortName) { + addSortField(SORT_FIELD_RESOURCE_NAME); + this.sortName = sortName; + } + + public void addSortPriority(PageOrdering sortPriority) { + addSortField(SORT_FIELD_STATUS); + this.sortPriority = sortPriority; + } + + public void addSortResourceId(PageOrdering sortResourceId) { + addSortField(SORT_FIELD_RESOURCE_ID); + this.sortResourceId = sortResourceId; + } +} diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationManagerBean.java index 5f7203a..64c7d3b 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationManagerBean.java @@ -67,6 +67,7 @@ import org.rhq.core.domain.configuration.group.AbstractGroupConfigurationUpdate; import org.rhq.core.domain.configuration.group.GroupPluginConfigurationUpdate; import org.rhq.core.domain.configuration.group.GroupResourceConfigurationUpdate; import org.rhq.core.domain.content.PackageType; +import org.rhq.core.domain.criteria.ResourceConfigurationUpdateCriteria; import org.rhq.core.domain.measurement.AvailabilityType; import org.rhq.core.domain.resource.Agent; import org.rhq.core.domain.resource.Resource; @@ -105,6 +106,8 @@ import org.rhq.enterprise.server.resource.group.ResourceGroupNotFoundException; import org.rhq.enterprise.server.resource.group.ResourceGroupUpdateException; import org.rhq.enterprise.server.scheduler.SchedulerLocal; import org.rhq.enterprise.server.system.ServerVersion; +import org.rhq.enterprise.server.util.CriteriaQueryGenerator; +import org.rhq.enterprise.server.util.CriteriaQueryRunner; import org.rhq.enterprise.server.util.QuartzUtil;
/** @@ -853,7 +856,10 @@ public class ConfigurationManagerBean implements ConfigurationManagerLocal, Conf public PageList<ResourceConfigurationUpdate> findResourceConfigurationUpdates(Subject subject, Integer resourceId, Long beginDate, Long endDate, boolean suppressOldest, PageControl pc) {
- if (!authorizationManager.hasResourcePermission(subject, Permission.CONFIGURE_READ, resourceId)) { + if (resourceId == null && !authorizationManager.isInventoryManager(subject)) { + throw new PermissionException("User[" + subject.getName() + "] Must be an inventory manager to query " + + "without a resource id."); + } else if (!authorizationManager.hasResourcePermission(subject, Permission.CONFIGURE_READ, resourceId)) { throw new PermissionException("User[" + subject.getName() + "] does not have permission to view configuration history for resource[id=" + resourceId + "]"); } @@ -2025,4 +2031,23 @@ public class ConfigurationManagerBean implements ConfigurationManagerLocal, Conf return out; }
+ + + @SuppressWarnings("unchecked") + public PageList<ResourceConfigurationUpdate> findResourceConfigurationUpdatesByCriteria( + Subject subject, ResourceConfigurationUpdateCriteria criteria) { + CriteriaQueryGenerator generator = new CriteriaQueryGenerator(subject, criteria); + if (!authorizationManager.isInventoryManager(subject)) { + generator.setAuthorizationResourceFragment( + CriteriaQueryGenerator.AuthorizationTokenType.RESOURCE, "resource", subject.getId()); + } + + CriteriaQueryRunner<ResourceConfigurationUpdate> queryRunner = + new CriteriaQueryRunner(criteria, generator, entityManager); + + PageList<ResourceConfigurationUpdate> updates = queryRunner.execute(); + + + return updates; + } } diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationManagerLocal.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationManagerLocal.java index 4242153..a82241d 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationManagerLocal.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationManagerLocal.java @@ -39,6 +39,7 @@ import org.rhq.core.domain.configuration.definition.ConfigurationTemplate; import org.rhq.core.domain.configuration.group.AbstractGroupConfigurationUpdate; import org.rhq.core.domain.configuration.group.GroupPluginConfigurationUpdate; import org.rhq.core.domain.configuration.group.GroupResourceConfigurationUpdate; +import org.rhq.core.domain.criteria.ResourceConfigurationUpdateCriteria; import org.rhq.core.domain.resource.Resource; import org.rhq.core.domain.resource.group.ResourceGroup; import org.rhq.core.domain.util.PageControl; @@ -497,4 +498,8 @@ public interface ConfigurationManagerLocal { boolean fromStructured) throws ResourceNotFoundException, TranslationNotSupportedException;
Configuration mergeConfiguration(Configuration config); + + + PageList<ResourceConfigurationUpdate> findResourceConfigurationUpdatesByCriteria( + Subject subject, ResourceConfigurationUpdateCriteria criteria); } \ No newline at end of file
commit c3a411545c18e5efa8b5889416398d8bb8a1b5ae Author: Ian Springer ian.springer@redhat.com Date: Thu Jul 29 15:58:07 2010 -0400
move i18nlog dep from deps section to depMgmt section
diff --git a/pom.xml b/pom.xml index 306bbff..6bc9e4e 100644 --- a/pom.xml +++ b/pom.xml @@ -278,6 +278,12 @@ </dependency>
<dependency> + <groupId>i18nlog</groupId> + <artifactId>i18nlog</artifactId> + <version>${i18nlog.version}</version> + </dependency> + + <dependency> <groupId>javax.xml.bind</groupId> <artifactId>jaxb-api</artifactId> <version>${jaxb-api.version}</version> @@ -420,12 +426,6 @@ <scope>provided</scope> </dependency>
- <dependency> - <groupId>i18nlog</groupId> - <artifactId>i18nlog</artifactId> - <version>${i18nlog.version}</version> - </dependency> - <!-- for the JAXB annotations --> <dependency> <groupId>javax.xml.bind</groupId>
commit 83c59bb8502776784ab83a360130d7b3b961ecd0 Author: Heiko W. Rupp hwr@redhat.com Date: Thu Jul 29 21:52:24 2010 +0200
Cater for Oracle returning -2 and just add 1 item instead
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/CallTimeDataManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/CallTimeDataManagerBean.java index 770ae6e..65bf0e3 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/CallTimeDataManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/CallTimeDataManagerBean.java @@ -330,7 +330,7 @@ public class CallTimeDataManagerBean implements CallTimeDataManagerLocal, CallTi + results[i] + "] for batch command [" + i + "] is less than 0 or greater than 1."); }
- insertedRowCount += results[i]; + insertedRowCount += results[i]==-2 ? 1 : results[i] ; // If Oracle returns -2, just count 1 row }
log.debug("Inserted new call-time data key rows for " + ((insertedRowCount >= 0) ? insertedRowCount : "?") @@ -406,7 +406,7 @@ public class CallTimeDataManagerBean implements CallTimeDataManagerLocal, CallTi + results[i] + "] for batch command [" + i + "] does not equal 1."); }
- insertedRowCount += results[i]; + insertedRowCount += results[i]==-2 ? 1 : results[i] ; // If Oracle returns -2, just count 1 row; }
notifyAlertConditionCacheManager("insertCallTimeDataValues", callTimeDataSet
commit 483a1e8352f7fc0d8ade726a8b045488c4190826 Author: Jay Shaughnessy jshaughn@redhat.com Date: Thu Jul 29 09:10:56 2010 -0400
[BZ 619135] For manual add ensure that component start does not prevent necessary server sync.
diff --git a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/InventoryManager.java b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/InventoryManager.java index 0c86f8f..720d1ab 100644 --- a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/InventoryManager.java +++ b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/InventoryManager.java @@ -283,7 +283,7 @@ public class InventoryManager extends AgentService implements ContainerService, return results; } catch (TimeoutException te) { log.warn("Discovery for Resources of [" + context.getResourceType() + "] has been running for more than " - + timeout + " milliseconds. This may be a plugin bug.", te); + + timeout + " milliseconds. This may be a plugin bug.", te); return null; } catch (BlacklistedException be) { // Discovery did not run, because the ResourceType was blacklisted during a prior discovery scan. @@ -316,8 +316,8 @@ public class InventoryManager extends AgentService implements ContainerService, return result; } catch (TimeoutException te) { log.warn("Manual add of Resource of type [" + context.getResourceType() + "] with plugin configuration [" - + pluginConfig.toString(true) + "] has been running for more than " - + timeout + " milliseconds. This may be a plugin bug.", te); + + pluginConfig.toString(true) + "] has been running for more than " + timeout + + " milliseconds. This may be a plugin bug.", te); return null; } catch (BlacklistedException be) { log.debug(ThrowableUtil.getAllMessages(be)); @@ -601,6 +601,8 @@ public class InventoryManager extends AgentService implements ContainerService, MergeResourceResponse mergeResourceResponse; Resource resource = null; boolean resourceAlreadyExisted = false; + Throwable startError = null; + try { ResourceContainer parentResourceContainer = getResourceContainer(parentResourceId); ResourceComponent parentResourceComponent = parentResourceContainer.getResourceComponent(); @@ -692,7 +694,14 @@ public class InventoryManager extends AgentService implements ContainerService, if (log.isDebugEnabled()) { log.debug("Activating resource [" + resource + "]..."); } - activateResource(resource, resourceContainer, newPluginConfig); + // if it fails to start keep going, we already have the resource in inventory and + // need to coordinate with the server. The new resource will be unavailable but at least + // it will be accessible and editable by the user. Report the start exception at the end. + try { + activateResource(resource, resourceContainer, newPluginConfig); + } catch (Throwable t) { + startError = t; + }
// NOTE: We don't mess with inventory status - that's the server's responsibility.
@@ -708,6 +717,12 @@ public class InventoryManager extends AgentService implements ContainerService, newResources.add(resource); postProcessNewlyCommittedResources(newResources); performServiceScan(resource.getId()); + + if (null != startError) { + throw new PluginContainerException("The resource [" + resource + + "] has been added but could not be started. Verify the supplied configuration values: ", + startError); + } }
// Catch any other RuntimeExceptions or Errors, so the server doesn't have to worry about deserializing or
commit 4e7a5da9176eb3198f2b3497e966352818642a80 Merge: a2addce... 148c25c... Author: John Sanda jsanda@redhat.com Date: Wed Jul 28 16:54:04 2010 -0400
Merge branch 'master' of ssh://git.fedorahosted.org/git/rhq/rhq
commit a2addcee76d260a82fff7faf848773a5932bd803 Author: John Sanda jsanda@redhat.com Date: Wed Jul 28 16:50:02 2010 -0400
[BZ 573034] Updating script to not retrieve defaults from default template
The script originally fetched the default values for connection properties from the default template and used the values from the default template to apply default values to connection properties of resources. This is a nice solution because it is generic and applicable across resource types; however, since 2.3.1 does not have the code changes in the plugin upgrade code, the new properties do not exist in the default template in 2.3.1. Consequently, the values are essentially hard-coded on a per resource type basis.
diff --git a/etc/cli-scripts/reset_conn_props.js b/etc/cli-scripts/reset_conn_props.js index bb2ac46..274bc5c 100644 --- a/etc/cli-scripts/reset_conn_props.js +++ b/etc/cli-scripts/reset_conn_props.js @@ -31,8 +31,13 @@ function log(msg) { println("DEBUG " + msg); }
+function loadPluginConfiguration(resource) { + log("Loading plugin configuration for " + resource); + return ConfigurationManager.getPluginConfiguration(resource.id); +} + function loadPluginConfigDef(resourceTypeName, pluginName) { - log("Loading plugin configuration for [resourceType=" + resourceTypeName + ", plugin=" + + log("Loading plugin configuration definition for [resourceType=" + resourceTypeName + ", plugin=" + pluginName + "]"); var resourceType = ResourceTypeManager.getResourceTypeByNameAndPlugin(resourceTypeName, pluginName); @@ -64,6 +69,10 @@ function findResourcesByTypeAndPlugin(resourceType, plugin) {
log("Found " + resources.size() + " " + resourceType + " resources ");
+ iterate(resources, function(resource) { + resource.pluginConfiguration = loadPluginConfiguration(resource); + }); + return resources; }
@@ -171,7 +180,6 @@ function getJBossSnapshotPropertyNames() { set.add('snapshotDataRecursive'); set.add('snapshotAdditionalFilesEnabled'); set.add('snapshotAdditionalFilesDirectory'); - set.add('snapshotAdditionalFilesRegex'); set.add('snapshotAdditionalFilesRecursive');
return set; @@ -197,7 +205,7 @@ function getAgentSnapshotPropertyNames() { * param: snapshotDefaults: The names of the plugin configuration properties to reset. This * is expected to be a java.util.Collection. */ -function resetPluginConfigProps(resources, snapshotDefaults) { +function resetPluginConfigPropsFromTemplate(pluginConfigDef, resources, snapshotDefaults) { iterate(resources, function(resource) { log("Preparing to reset plugin configuration properties for " + resource); var simpleProperties = flattenProperties(resource.pluginConfiguration); @@ -208,6 +216,7 @@ function resetPluginConfigProps(resources, snapshotDefaults) { iterate(snapshotProperties, function(property) { var defaultProperty = snapshotDefaults.get(property.name); property.stringValue = defaultProperty.stringValue; + log("Set property " + property.name + " to " + property.stringValue); });
ConfigurationManager.updatePluginConfiguration(resource.id, resource.pluginConfiguration); @@ -215,14 +224,44 @@ function resetPluginConfigProps(resources, snapshotDefaults) { }); }
+function resetPluginConfigProps(resources, applyDefaults) { + iterate(resources, function(resource) { + applyDefaults(resource.pluginConfiguration); + ConfigurationManager.updatePluginConfiguration(resource.id, resource.pluginConfiguration); + log("Updated plugin configuration for " + resource); + }); +} + function resetJBossPluginConfigProps() { var jbossResourceTypeName = 'JBossAS Server'; var jbossPluginName = 'JBossAS'; var jbossServers = findResourcesByTypeAndPlugin(jbossResourceTypeName, jbossPluginName); var jbossPluginConfigDef = loadPluginConfigDef(jbossResourceTypeName, jbossPluginName);
- resetPluginConfigProps(jbossServers, loadSnapshotDefaults(jbossPluginConfigDef, - getJBossSnapshotPropertyNames())); + //resetPluginConfigProps(jbossServers, loadSnapshotDefaults(jbossPluginConfigDef, + // getJBossSnapshotPropertyNames())); + + resetPluginConfigProps(jbossServers, function(pluginConfig) { + pluginConfig.put(PropertySimple('snapshotConfigEnabled', true)); + pluginConfig.put(PropertySimple('snapshotConfigDirectory', 'config')); + pluginConfig.put(PropertySimple('snapshotConfigRecursive', true)); + pluginConfig.put(PropertySimple('snapshotLogEnabled', true)); + pluginConfig.put(PropertySimple('snapshotLogDirectory', 'log')); + pluginConfig.put(PropertySimple('snapshotLogRecursive', false)); + pluginConfig.put(PropertySimple('snapshotDataEnabled', false)); + pluginConfig.put(PropertySimple('snapshotDataDirectory', 'data')); + pluginConfig.put(PropertySimple('snapshotDataRecursive', true)); + + var propertyMap = PropertyMap('snapshotAdditionalFilesMap'); + propertyMap.put(PropertySimple('snapshotAdditionalFilesEnabled', true)); + propertyMap.put(PropertySimple('snapshotAdditionalFilesDirectory', '')); + propertyMap.put(PropertySimple('snapshotAdditionalFilesRecursive', true)); + + var propertyList = PropertyList('snapshotAdditionalFilesList'); + propertyList.list.add(propertyMap); + + pluginConfig.put(propertyList); + }); }
function resetAgentPluginConfigProps() { @@ -231,8 +270,14 @@ function resetAgentPluginConfigProps() { var agents = findResourcesByTypeAndPlugin(agentResourceTypeName, agentPluginName); var agentPluginConfigDef = loadPluginConfigDef(agentResourceTypeName, agentPluginName);
- resetPluginConfigProps(agents, loadSnapshotDefaults(agentPluginConfigDef, - getAgentSnapshotPropertyNames())); + //resetPluginConfigProps(agents, loadSnapshotDefaults(agentPluginConfigDef, + // getAgentSnapshotPropertyNames())); + + resetPluginConfigProps(agents, function(pluginConfig) { + pluginConfig.put(PropertySimple('snapshotConfigEnabled', true)); + pluginConfig.put(PropertySimple('snapshotLogEnabled', true)); + pluginConfig.put(PropertySimple('snapshotDataEnabled', true)); + }); }
//////////////
commit 1f72fc36df296aee0f093c012276a520edcc40f6 Author: hudson auto wnstb@yahoo.com Date: Wed Jul 28 15:12:01 2010 -0400
[maven-release-plugin] prepare for next development iteration
diff --git a/modules/common/ant-bundle/pom.xml b/modules/common/ant-bundle/pom.xml index 97ef93b..eda9133 100644 --- a/modules/common/ant-bundle/pom.xml +++ b/modules/common/ant-bundle/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-common-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/common/filetemplate-bundle/pom.xml b/modules/common/filetemplate-bundle/pom.xml index 3b26a39..bc7965b 100644 --- a/modules/common/filetemplate-bundle/pom.xml +++ b/modules/common/filetemplate-bundle/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-common-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/common/jboss-as/pom.xml b/modules/common/jboss-as/pom.xml index 688d5e4..2cf950b 100644 --- a/modules/common/jboss-as/pom.xml +++ b/modules/common/jboss-as/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-common-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/common/pom.xml b/modules/common/pom.xml index 2ddc4af..ee81a94 100644 --- a/modules/common/pom.xml +++ b/modules/common/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/client-api/pom.xml b/modules/core/client-api/pom.xml index a27161b..d177f9e 100644 --- a/modules/core/client-api/pom.xml +++ b/modules/core/client-api/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/comm-api/pom.xml b/modules/core/comm-api/pom.xml index 4589d42..a51f92b 100644 --- a/modules/core/comm-api/pom.xml +++ b/modules/core/comm-api/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/dbutils/pom.xml b/modules/core/dbutils/pom.xml index d7559da..7ff6a10 100644 --- a/modules/core/dbutils/pom.xml +++ b/modules/core/dbutils/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/domain/pom.xml b/modules/core/domain/pom.xml index dc75145..e0ced84 100644 --- a/modules/core/domain/pom.xml +++ b/modules/core/domain/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/gui/pom.xml b/modules/core/gui/pom.xml index b535306..0911918 100644 --- a/modules/core/gui/pom.xml +++ b/modules/core/gui/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/native-system/pom.xml b/modules/core/native-system/pom.xml index f72bc2f..d47d4c8 100644 --- a/modules/core/native-system/pom.xml +++ b/modules/core/native-system/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/plugin-api/pom.xml b/modules/core/plugin-api/pom.xml index 967b21a..e1ce7ef 100644 --- a/modules/core/plugin-api/pom.xml +++ b/modules/core/plugin-api/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/plugin-container/pom.xml b/modules/core/plugin-container/pom.xml index fbab223..2e58102 100644 --- a/modules/core/plugin-container/pom.xml +++ b/modules/core/plugin-container/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/plugin-validator/pom.xml b/modules/core/plugin-validator/pom.xml index 996cd8f..7739177 100644 --- a/modules/core/plugin-validator/pom.xml +++ b/modules/core/plugin-validator/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/plugindoc/pom.xml b/modules/core/plugindoc/pom.xml index 8a95e51..eeb7e81 100644 --- a/modules/core/plugindoc/pom.xml +++ b/modules/core/plugindoc/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/pom.xml b/modules/core/pom.xml index b0c399b..7aad64c 100644 --- a/modules/core/pom.xml +++ b/modules/core/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/util/pom.xml b/modules/core/util/pom.xml index 37bcda5..bc41dc5 100644 --- a/modules/core/util/pom.xml +++ b/modules/core/util/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/agent/pom.xml b/modules/enterprise/agent/pom.xml index 3fc1344..d9f1c1c 100644 --- a/modules/enterprise/agent/pom.xml +++ b/modules/enterprise/agent/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/agentupdate/pom.xml b/modules/enterprise/agentupdate/pom.xml index 127b06f..8942239 100644 --- a/modules/enterprise/agentupdate/pom.xml +++ b/modules/enterprise/agentupdate/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/comm/pom.xml b/modules/enterprise/comm/pom.xml index 9f09ff1..8b9da9c 100644 --- a/modules/enterprise/comm/pom.xml +++ b/modules/enterprise/comm/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/base-perspective-jar/pom.xml b/modules/enterprise/gui/base-perspective-jar/pom.xml index 95b62cd..611eb9d 100644 --- a/modules/enterprise/gui/base-perspective-jar/pom.xml +++ b/modules/enterprise/gui/base-perspective-jar/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/base-perspective-war/pom.xml b/modules/enterprise/gui/base-perspective-war/pom.xml index c1c297f..798a8ca 100644 --- a/modules/enterprise/gui/base-perspective-war/pom.xml +++ b/modules/enterprise/gui/base-perspective-war/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/content_http-war/pom.xml b/modules/enterprise/gui/content_http-war/pom.xml index 6be8d8d..df05645 100644 --- a/modules/enterprise/gui/content_http-war/pom.xml +++ b/modules/enterprise/gui/content_http-war/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-gui-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/coregui/pom.xml b/modules/enterprise/gui/coregui/pom.xml index 709bfe3..acbe21f 100644 --- a/modules/enterprise/gui/coregui/pom.xml +++ b/modules/enterprise/gui/coregui/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/installer-war/pom.xml b/modules/enterprise/gui/installer-war/pom.xml index 8d33ef0..1beadca 100644 --- a/modules/enterprise/gui/installer-war/pom.xml +++ b/modules/enterprise/gui/installer-war/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/pom.xml b/modules/enterprise/gui/pom.xml index bf6a9a4..0c529ba 100644 --- a/modules/enterprise/gui/pom.xml +++ b/modules/enterprise/gui/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/portal-war/pom.xml b/modules/enterprise/gui/portal-war/pom.xml index d9f0c15..a794cd6 100644 --- a/modules/enterprise/gui/portal-war/pom.xml +++ b/modules/enterprise/gui/portal-war/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/webdav-war/pom.xml b/modules/enterprise/gui/webdav-war/pom.xml index 9bdfc91..aa880be 100644 --- a/modules/enterprise/gui/webdav-war/pom.xml +++ b/modules/enterprise/gui/webdav-war/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/pom.xml b/modules/enterprise/pom.xml index 77a5685..3b0dbb8 100644 --- a/modules/enterprise/pom.xml +++ b/modules/enterprise/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/remoting/cli/pom.xml b/modules/enterprise/remoting/cli/pom.xml index dff57e7..05187c7 100644 --- a/modules/enterprise/remoting/cli/pom.xml +++ b/modules/enterprise/remoting/cli/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<artifactId>rhq-remoting-cli</artifactId> diff --git a/modules/enterprise/remoting/client-api/pom.xml b/modules/enterprise/remoting/client-api/pom.xml index 6008df1..e86ef41 100644 --- a/modules/enterprise/remoting/client-api/pom.xml +++ b/modules/enterprise/remoting/client-api/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<artifactId>rhq-remoting-client-api</artifactId> diff --git a/modules/enterprise/remoting/pom.xml b/modules/enterprise/remoting/pom.xml index 68d51c0..910b617 100644 --- a/modules/enterprise/remoting/pom.xml +++ b/modules/enterprise/remoting/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<artifactId>rhq-remoting-parent</artifactId> diff --git a/modules/enterprise/remoting/webservices/pom.xml b/modules/enterprise/remoting/webservices/pom.xml index 444256d..2ea73ee 100644 --- a/modules/enterprise/remoting/webservices/pom.xml +++ b/modules/enterprise/remoting/webservices/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<artifactId>rhq-remoting-webservices</artifactId> diff --git a/modules/enterprise/server/container-lib/pom.xml b/modules/enterprise/server/container-lib/pom.xml index f09e063..2c98817 100644 --- a/modules/enterprise/server/container-lib/pom.xml +++ b/modules/enterprise/server/container-lib/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/container/pom.xml b/modules/enterprise/server/container/pom.xml index b4d2146..3fd11e8 100644 --- a/modules/enterprise/server/container/pom.xml +++ b/modules/enterprise/server/container/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/ear/pom.xml b/modules/enterprise/server/ear/pom.xml index c063211..bf15866 100644 --- a/modules/enterprise/server/ear/pom.xml +++ b/modules/enterprise/server/ear/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/jar/pom.xml b/modules/enterprise/server/jar/pom.xml index ddff575..79fdc38 100644 --- a/modules/enterprise/server/jar/pom.xml +++ b/modules/enterprise/server/jar/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/alert-email/pom.xml b/modules/enterprise/server/plugins/alert-email/pom.xml index ea1eb7b..dd5bc18 100644 --- a/modules/enterprise/server/plugins/alert-email/pom.xml +++ b/modules/enterprise/server/plugins/alert-email/pom.xml @@ -3,7 +3,7 @@ <parent> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent> <modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-irc/pom.xml b/modules/enterprise/server/plugins/alert-irc/pom.xml index 363ac0a..c0973f3 100644 --- a/modules/enterprise/server/plugins/alert-irc/pom.xml +++ b/modules/enterprise/server/plugins/alert-irc/pom.xml @@ -3,7 +3,7 @@ <parent> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent> <modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-microblog/pom.xml b/modules/enterprise/server/plugins/alert-microblog/pom.xml index b4751ba..a62fee8 100644 --- a/modules/enterprise/server/plugins/alert-microblog/pom.xml +++ b/modules/enterprise/server/plugins/alert-microblog/pom.xml @@ -3,7 +3,7 @@ <parent> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent> <modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-mobicents/pom.xml b/modules/enterprise/server/plugins/alert-mobicents/pom.xml index b0a0c3b..3193539 100644 --- a/modules/enterprise/server/plugins/alert-mobicents/pom.xml +++ b/modules/enterprise/server/plugins/alert-mobicents/pom.xml @@ -3,7 +3,7 @@ <parent> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent> <modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-operations/pom.xml b/modules/enterprise/server/plugins/alert-operations/pom.xml index 6d35aed..e69bfbc 100644 --- a/modules/enterprise/server/plugins/alert-operations/pom.xml +++ b/modules/enterprise/server/plugins/alert-operations/pom.xml @@ -2,7 +2,7 @@ <parent> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent> <modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-roles/pom.xml b/modules/enterprise/server/plugins/alert-roles/pom.xml index cbd7334..ca33bb7 100644 --- a/modules/enterprise/server/plugins/alert-roles/pom.xml +++ b/modules/enterprise/server/plugins/alert-roles/pom.xml @@ -3,7 +3,7 @@ <parent> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent> <modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-snmp/pom.xml b/modules/enterprise/server/plugins/alert-snmp/pom.xml index 6398092..af75153 100644 --- a/modules/enterprise/server/plugins/alert-snmp/pom.xml +++ b/modules/enterprise/server/plugins/alert-snmp/pom.xml @@ -3,7 +3,7 @@ <parent> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent> <modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-subject/pom.xml b/modules/enterprise/server/plugins/alert-subject/pom.xml index ebac52c..09839b8 100644 --- a/modules/enterprise/server/plugins/alert-subject/pom.xml +++ b/modules/enterprise/server/plugins/alert-subject/pom.xml @@ -3,7 +3,7 @@ <parent> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent> <modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/ant-bundle/pom.xml b/modules/enterprise/server/plugins/ant-bundle/pom.xml index 30efb5a..73f405e 100644 --- a/modules/enterprise/server/plugins/ant-bundle/pom.xml +++ b/modules/enterprise/server/plugins/ant-bundle/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/cobbler/pom.xml b/modules/enterprise/server/plugins/cobbler/pom.xml index 8464662..4c44f10 100644 --- a/modules/enterprise/server/plugins/cobbler/pom.xml +++ b/modules/enterprise/server/plugins/cobbler/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<modelVersion>4.0.0</modelVersion> diff --git a/modules/enterprise/server/plugins/disk/pom.xml b/modules/enterprise/server/plugins/disk/pom.xml index 40ab2a2..0033d1b 100644 --- a/modules/enterprise/server/plugins/disk/pom.xml +++ b/modules/enterprise/server/plugins/disk/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml b/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml index 0c5fb51..61965f2 100644 --- a/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml +++ b/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/jboss-software/pom.xml b/modules/enterprise/server/plugins/jboss-software/pom.xml index 3f1e165..7451668 100644 --- a/modules/enterprise/server/plugins/jboss-software/pom.xml +++ b/modules/enterprise/server/plugins/jboss-software/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml b/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml index 25917cc..0ac61d3 100644 --- a/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml +++ b/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml @@ -7,7 +7,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/perspectives/core/pom.xml b/modules/enterprise/server/plugins/perspectives/core/pom.xml index 40c066f..5a78451 100644 --- a/modules/enterprise/server/plugins/perspectives/core/pom.xml +++ b/modules/enterprise/server/plugins/perspectives/core/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/pom.xml b/modules/enterprise/server/plugins/pom.xml index 9832288..2b16f4a 100644 --- a/modules/enterprise/server/plugins/pom.xml +++ b/modules/enterprise/server/plugins/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/rhnhosted/pom.xml b/modules/enterprise/server/plugins/rhnhosted/pom.xml index 26e985a..e4ab9b2 100644 --- a/modules/enterprise/server/plugins/rhnhosted/pom.xml +++ b/modules/enterprise/server/plugins/rhnhosted/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/url/pom.xml b/modules/enterprise/server/plugins/url/pom.xml index 14e52de..a6cba32 100644 --- a/modules/enterprise/server/plugins/url/pom.xml +++ b/modules/enterprise/server/plugins/url/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml b/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml index e160aa6..9c7cc74 100644 --- a/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml +++ b/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/yum/pom.xml b/modules/enterprise/server/plugins/yum/pom.xml index 344a215..ebdd3da 100644 --- a/modules/enterprise/server/plugins/yum/pom.xml +++ b/modules/enterprise/server/plugins/yum/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/safe-invoker/pom.xml b/modules/enterprise/server/safe-invoker/pom.xml index bb1abdd..06c8981 100644 --- a/modules/enterprise/server/safe-invoker/pom.xml +++ b/modules/enterprise/server/safe-invoker/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/sars/agent-sar/pom.xml b/modules/enterprise/server/sars/agent-sar/pom.xml index 2458369..aa278b8 100644 --- a/modules/enterprise/server/sars/agent-sar/pom.xml +++ b/modules/enterprise/server/sars/agent-sar/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-sars-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/sars/pom.xml b/modules/enterprise/server/sars/pom.xml index 4ac7f43..0cc2084 100644 --- a/modules/enterprise/server/sars/pom.xml +++ b/modules/enterprise/server/sars/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/xml-schemas/pom.xml b/modules/enterprise/server/xml-schemas/pom.xml index 21ccc78..14738d0 100644 --- a/modules/enterprise/server/xml-schemas/pom.xml +++ b/modules/enterprise/server/xml-schemas/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/helpers/pluginAnnotations/pom.xml b/modules/helpers/pluginAnnotations/pom.xml index 366d1aa..d056f74 100644 --- a/modules/helpers/pluginAnnotations/pom.xml +++ b/modules/helpers/pluginAnnotations/pom.xml @@ -6,7 +6,7 @@ <parent> <groupId>org.rhq.helpers</groupId> <artifactId>rhq-helpers</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq.helpers</groupId> diff --git a/modules/helpers/pluginGen/pom.xml b/modules/helpers/pluginGen/pom.xml index d992e29..28dc9b1 100644 --- a/modules/helpers/pluginGen/pom.xml +++ b/modules/helpers/pluginGen/pom.xml @@ -6,7 +6,7 @@ <parent> <groupId>org.rhq.helpers</groupId> <artifactId>rhq-helpers</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq.helpers</groupId> diff --git a/modules/helpers/pom.xml b/modules/helpers/pom.xml index c5e5ae2..a0721a9 100644 --- a/modules/helpers/pom.xml +++ b/modules/helpers/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq.helpers</groupId> diff --git a/modules/helpers/rtfilter/pom.xml b/modules/helpers/rtfilter/pom.xml index ffac476..5d327ee 100644 --- a/modules/helpers/rtfilter/pom.xml +++ b/modules/helpers/rtfilter/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq.helpers</groupId> <artifactId>rhq-helpers</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/aliases/pom.xml b/modules/plugins/aliases/pom.xml index c475e5e..c37598e 100644 --- a/modules/plugins/aliases/pom.xml +++ b/modules/plugins/aliases/pom.xml @@ -7,7 +7,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/ant-bundle/pom.xml b/modules/plugins/ant-bundle/pom.xml index 5fa4596..cc160c9 100644 --- a/modules/plugins/ant-bundle/pom.xml +++ b/modules/plugins/ant-bundle/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/apache/pom.xml b/modules/plugins/apache/pom.xml index 88db42f..700a6af 100644 --- a/modules/plugins/apache/pom.xml +++ b/modules/plugins/apache/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/augeas/pom.xml b/modules/plugins/augeas/pom.xml index 51580cd..915106a 100644 --- a/modules/plugins/augeas/pom.xml +++ b/modules/plugins/augeas/pom.xml @@ -7,7 +7,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/cobbler/pom.xml b/modules/plugins/cobbler/pom.xml index a140f5d..d920440 100644 --- a/modules/plugins/cobbler/pom.xml +++ b/modules/plugins/cobbler/pom.xml @@ -7,7 +7,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/cron/pom.xml b/modules/plugins/cron/pom.xml index 9119492..d5aaad5 100644 --- a/modules/plugins/cron/pom.xml +++ b/modules/plugins/cron/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/database/pom.xml b/modules/plugins/database/pom.xml index 714ad7a..30889f7 100644 --- a/modules/plugins/database/pom.xml +++ b/modules/plugins/database/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/filetemplate-bundle/pom.xml b/modules/plugins/filetemplate-bundle/pom.xml index e01b311..b79645d 100644 --- a/modules/plugins/filetemplate-bundle/pom.xml +++ b/modules/plugins/filetemplate-bundle/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/grub/pom.xml b/modules/plugins/grub/pom.xml index aef1858..f7cf265 100644 --- a/modules/plugins/grub/pom.xml +++ b/modules/plugins/grub/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/hibernate/pom.xml b/modules/plugins/hibernate/pom.xml index 4f87dfe..acb08ef 100644 --- a/modules/plugins/hibernate/pom.xml +++ b/modules/plugins/hibernate/pom.xml @@ -6,7 +6,7 @@ <groupId>org.rhq</groupId> <!-- Bypass the jopr-plugins-parent which can not have children. It must build after the plugins in order to execute integration tests on them. --> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.jboss.on</groupId> diff --git a/modules/plugins/hosts/pom.xml b/modules/plugins/hosts/pom.xml index 157119f..7dd0fde 100644 --- a/modules/plugins/hosts/pom.xml +++ b/modules/plugins/hosts/pom.xml @@ -7,7 +7,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/hudson/pom.xml b/modules/plugins/hudson/pom.xml index eed10bc..65fa7b8 100644 --- a/modules/plugins/hudson/pom.xml +++ b/modules/plugins/hudson/pom.xml @@ -6,7 +6,7 @@ <parent> <artifactId>rhq-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/iis/pom.xml b/modules/plugins/iis/pom.xml index 9a9c2f0..853c020 100644 --- a/modules/plugins/iis/pom.xml +++ b/modules/plugins/iis/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/jboss-as-5/pom.xml b/modules/plugins/jboss-as-5/pom.xml index befe74c..a0ade77 100644 --- a/modules/plugins/jboss-as-5/pom.xml +++ b/modules/plugins/jboss-as-5/pom.xml @@ -9,7 +9,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.jboss.on</groupId> diff --git a/modules/plugins/jboss-as/pom.xml b/modules/plugins/jboss-as/pom.xml index ac9b3f6..b9ed2b3 100644 --- a/modules/plugins/jboss-as/pom.xml +++ b/modules/plugins/jboss-as/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.jboss.on</groupId> diff --git a/modules/plugins/jboss-cache-v3/pom.xml b/modules/plugins/jboss-cache-v3/pom.xml index 61f4e11..b3846fa 100644 --- a/modules/plugins/jboss-cache-v3/pom.xml +++ b/modules/plugins/jboss-cache-v3/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.jboss.on</groupId> diff --git a/modules/plugins/jboss-cache/pom.xml b/modules/plugins/jboss-cache/pom.xml index 684e8e3..443e524 100644 --- a/modules/plugins/jboss-cache/pom.xml +++ b/modules/plugins/jboss-cache/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.jboss.on</groupId> diff --git a/modules/plugins/jmx/pom.xml b/modules/plugins/jmx/pom.xml index a9874cc..ac9885a 100644 --- a/modules/plugins/jmx/pom.xml +++ b/modules/plugins/jmx/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/mysql/pom.xml b/modules/plugins/mysql/pom.xml index 5a02364..d0c9053 100644 --- a/modules/plugins/mysql/pom.xml +++ b/modules/plugins/mysql/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/netservices/pom.xml b/modules/plugins/netservices/pom.xml index 3d937e7..06ae2ae 100644 --- a/modules/plugins/netservices/pom.xml +++ b/modules/plugins/netservices/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/oracle/pom.xml b/modules/plugins/oracle/pom.xml index e915511..1acdb0f 100644 --- a/modules/plugins/oracle/pom.xml +++ b/modules/plugins/oracle/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/perftest/pom.xml b/modules/plugins/perftest/pom.xml index f65ad5a..39c75da 100644 --- a/modules/plugins/perftest/pom.xml +++ b/modules/plugins/perftest/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/platform/pom.xml b/modules/plugins/platform/pom.xml index aadd8bf..97b83b0 100644 --- a/modules/plugins/platform/pom.xml +++ b/modules/plugins/platform/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/pom.xml b/modules/plugins/pom.xml index f32c52d..85d6105 100644 --- a/modules/plugins/pom.xml +++ b/modules/plugins/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/postfix/pom.xml b/modules/plugins/postfix/pom.xml index 639838b..283ab6a 100644 --- a/modules/plugins/postfix/pom.xml +++ b/modules/plugins/postfix/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/postgres/pom.xml b/modules/plugins/postgres/pom.xml index beb98f2..5a4466c 100644 --- a/modules/plugins/postgres/pom.xml +++ b/modules/plugins/postgres/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/rhq-agent/pom.xml b/modules/plugins/rhq-agent/pom.xml index fdb0991..a190dcd 100644 --- a/modules/plugins/rhq-agent/pom.xml +++ b/modules/plugins/rhq-agent/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/rhq-server/pom.xml b/modules/plugins/rhq-server/pom.xml index 8fb6fee..8f4e675 100644 --- a/modules/plugins/rhq-server/pom.xml +++ b/modules/plugins/rhq-server/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.jboss.on</groupId> diff --git a/modules/plugins/samba/pom.xml b/modules/plugins/samba/pom.xml index 9411143..0d41574 100644 --- a/modules/plugins/samba/pom.xml +++ b/modules/plugins/samba/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/script/pom.xml b/modules/plugins/script/pom.xml index 0ec4d51..7719b14 100644 --- a/modules/plugins/script/pom.xml +++ b/modules/plugins/script/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/snmptrapd/pom.xml b/modules/plugins/snmptrapd/pom.xml index f5106f0..2d9d715 100644 --- a/modules/plugins/snmptrapd/pom.xml +++ b/modules/plugins/snmptrapd/pom.xml @@ -2,7 +2,7 @@ <parent> <artifactId>rhq-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<modelVersion>4.0.0</modelVersion> diff --git a/modules/plugins/sshd/pom.xml b/modules/plugins/sshd/pom.xml index b637f0d..3579496 100644 --- a/modules/plugins/sshd/pom.xml +++ b/modules/plugins/sshd/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/sudoers/pom.xml b/modules/plugins/sudoers/pom.xml index 55c3b49..41df1b8 100644 --- a/modules/plugins/sudoers/pom.xml +++ b/modules/plugins/sudoers/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/tomcat/pom.xml b/modules/plugins/tomcat/pom.xml index 9de8802..205d5b0 100644 --- a/modules/plugins/tomcat/pom.xml +++ b/modules/plugins/tomcat/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.jboss.on</groupId> diff --git a/modules/plugins/twitter/pom.xml b/modules/plugins/twitter/pom.xml index 9ee6ac3..e299efa 100644 --- a/modules/plugins/twitter/pom.xml +++ b/modules/plugins/twitter/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/validate-all-plugins/pom.xml b/modules/plugins/validate-all-plugins/pom.xml index 93e847c..b3d5e87 100644 --- a/modules/plugins/validate-all-plugins/pom.xml +++ b/modules/plugins/validate-all-plugins/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/pom.xml b/modules/pom.xml index a6af192..bc96ae3 100644 --- a/modules/pom.xml +++ b/modules/pom.xml @@ -6,7 +6,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/test-utils/pom.xml b/modules/test-utils/pom.xml index 5b243a9..2235687 100644 --- a/modules/test-utils/pom.xml +++ b/modules/test-utils/pom.xml @@ -4,7 +4,7 @@ <parent> <artifactId>rhq-modules-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent> <artifactId>test-utils</artifactId> <name>RHQ Test Utils</name> diff --git a/pom.xml b/pom.xml index 5e2dc43..7ff85bb 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@
<groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> <packaging>pom</packaging>
<name>RHQ</name>
commit 8fb6059a9db07d40b827ae6358dbfcebcc7fdac9 Author: hudson auto wnstb@yahoo.com Date: Wed Jul 28 15:10:27 2010 -0400
[maven-release-plugin] prepare release RHQ_3_0_0_GA
diff --git a/modules/common/ant-bundle/pom.xml b/modules/common/ant-bundle/pom.xml index eda9133..97ef93b 100644 --- a/modules/common/ant-bundle/pom.xml +++ b/modules/common/ant-bundle/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-common-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/common/filetemplate-bundle/pom.xml b/modules/common/filetemplate-bundle/pom.xml index bc7965b..3b26a39 100644 --- a/modules/common/filetemplate-bundle/pom.xml +++ b/modules/common/filetemplate-bundle/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-common-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/common/jboss-as/pom.xml b/modules/common/jboss-as/pom.xml index 2cf950b..688d5e4 100644 --- a/modules/common/jboss-as/pom.xml +++ b/modules/common/jboss-as/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-common-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/common/pom.xml b/modules/common/pom.xml index ee81a94..2ddc4af 100644 --- a/modules/common/pom.xml +++ b/modules/common/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/client-api/pom.xml b/modules/core/client-api/pom.xml index d177f9e..a27161b 100644 --- a/modules/core/client-api/pom.xml +++ b/modules/core/client-api/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/comm-api/pom.xml b/modules/core/comm-api/pom.xml index a51f92b..4589d42 100644 --- a/modules/core/comm-api/pom.xml +++ b/modules/core/comm-api/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/dbutils/pom.xml b/modules/core/dbutils/pom.xml index 7ff6a10..d7559da 100644 --- a/modules/core/dbutils/pom.xml +++ b/modules/core/dbutils/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/domain/pom.xml b/modules/core/domain/pom.xml index e0ced84..dc75145 100644 --- a/modules/core/domain/pom.xml +++ b/modules/core/domain/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/gui/pom.xml b/modules/core/gui/pom.xml index 0911918..b535306 100644 --- a/modules/core/gui/pom.xml +++ b/modules/core/gui/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/native-system/pom.xml b/modules/core/native-system/pom.xml index d47d4c8..f72bc2f 100644 --- a/modules/core/native-system/pom.xml +++ b/modules/core/native-system/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/plugin-api/pom.xml b/modules/core/plugin-api/pom.xml index e1ce7ef..967b21a 100644 --- a/modules/core/plugin-api/pom.xml +++ b/modules/core/plugin-api/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/plugin-container/pom.xml b/modules/core/plugin-container/pom.xml index 2e58102..fbab223 100644 --- a/modules/core/plugin-container/pom.xml +++ b/modules/core/plugin-container/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/plugin-validator/pom.xml b/modules/core/plugin-validator/pom.xml index 7739177..996cd8f 100644 --- a/modules/core/plugin-validator/pom.xml +++ b/modules/core/plugin-validator/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/plugindoc/pom.xml b/modules/core/plugindoc/pom.xml index eeb7e81..8a95e51 100644 --- a/modules/core/plugindoc/pom.xml +++ b/modules/core/plugindoc/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/pom.xml b/modules/core/pom.xml index 7aad64c..b0c399b 100644 --- a/modules/core/pom.xml +++ b/modules/core/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/util/pom.xml b/modules/core/util/pom.xml index bc41dc5..37bcda5 100644 --- a/modules/core/util/pom.xml +++ b/modules/core/util/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/agent/pom.xml b/modules/enterprise/agent/pom.xml index d9f1c1c..3fc1344 100644 --- a/modules/enterprise/agent/pom.xml +++ b/modules/enterprise/agent/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/agentupdate/pom.xml b/modules/enterprise/agentupdate/pom.xml index 8942239..127b06f 100644 --- a/modules/enterprise/agentupdate/pom.xml +++ b/modules/enterprise/agentupdate/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/comm/pom.xml b/modules/enterprise/comm/pom.xml index 8b9da9c..9f09ff1 100644 --- a/modules/enterprise/comm/pom.xml +++ b/modules/enterprise/comm/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/base-perspective-jar/pom.xml b/modules/enterprise/gui/base-perspective-jar/pom.xml index 611eb9d..95b62cd 100644 --- a/modules/enterprise/gui/base-perspective-jar/pom.xml +++ b/modules/enterprise/gui/base-perspective-jar/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/base-perspective-war/pom.xml b/modules/enterprise/gui/base-perspective-war/pom.xml index 798a8ca..c1c297f 100644 --- a/modules/enterprise/gui/base-perspective-war/pom.xml +++ b/modules/enterprise/gui/base-perspective-war/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/content_http-war/pom.xml b/modules/enterprise/gui/content_http-war/pom.xml index df05645..6be8d8d 100644 --- a/modules/enterprise/gui/content_http-war/pom.xml +++ b/modules/enterprise/gui/content_http-war/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-gui-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/coregui/pom.xml b/modules/enterprise/gui/coregui/pom.xml index acbe21f..709bfe3 100644 --- a/modules/enterprise/gui/coregui/pom.xml +++ b/modules/enterprise/gui/coregui/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/installer-war/pom.xml b/modules/enterprise/gui/installer-war/pom.xml index 1beadca..8d33ef0 100644 --- a/modules/enterprise/gui/installer-war/pom.xml +++ b/modules/enterprise/gui/installer-war/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/pom.xml b/modules/enterprise/gui/pom.xml index 0c529ba..bf6a9a4 100644 --- a/modules/enterprise/gui/pom.xml +++ b/modules/enterprise/gui/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/portal-war/pom.xml b/modules/enterprise/gui/portal-war/pom.xml index a794cd6..d9f0c15 100644 --- a/modules/enterprise/gui/portal-war/pom.xml +++ b/modules/enterprise/gui/portal-war/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/webdav-war/pom.xml b/modules/enterprise/gui/webdav-war/pom.xml index aa880be..9bdfc91 100644 --- a/modules/enterprise/gui/webdav-war/pom.xml +++ b/modules/enterprise/gui/webdav-war/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/pom.xml b/modules/enterprise/pom.xml index 3b0dbb8..77a5685 100644 --- a/modules/enterprise/pom.xml +++ b/modules/enterprise/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/remoting/cli/pom.xml b/modules/enterprise/remoting/cli/pom.xml index 05187c7..dff57e7 100644 --- a/modules/enterprise/remoting/cli/pom.xml +++ b/modules/enterprise/remoting/cli/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<artifactId>rhq-remoting-cli</artifactId> diff --git a/modules/enterprise/remoting/client-api/pom.xml b/modules/enterprise/remoting/client-api/pom.xml index e86ef41..6008df1 100644 --- a/modules/enterprise/remoting/client-api/pom.xml +++ b/modules/enterprise/remoting/client-api/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<artifactId>rhq-remoting-client-api</artifactId> diff --git a/modules/enterprise/remoting/pom.xml b/modules/enterprise/remoting/pom.xml index 910b617..68d51c0 100644 --- a/modules/enterprise/remoting/pom.xml +++ b/modules/enterprise/remoting/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<artifactId>rhq-remoting-parent</artifactId> diff --git a/modules/enterprise/remoting/webservices/pom.xml b/modules/enterprise/remoting/webservices/pom.xml index 2ea73ee..444256d 100644 --- a/modules/enterprise/remoting/webservices/pom.xml +++ b/modules/enterprise/remoting/webservices/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<artifactId>rhq-remoting-webservices</artifactId> diff --git a/modules/enterprise/server/container-lib/pom.xml b/modules/enterprise/server/container-lib/pom.xml index 2c98817..f09e063 100644 --- a/modules/enterprise/server/container-lib/pom.xml +++ b/modules/enterprise/server/container-lib/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/container/pom.xml b/modules/enterprise/server/container/pom.xml index 3fd11e8..b4d2146 100644 --- a/modules/enterprise/server/container/pom.xml +++ b/modules/enterprise/server/container/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/ear/pom.xml b/modules/enterprise/server/ear/pom.xml index bf15866..c063211 100644 --- a/modules/enterprise/server/ear/pom.xml +++ b/modules/enterprise/server/ear/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/jar/pom.xml b/modules/enterprise/server/jar/pom.xml index 79fdc38..ddff575 100644 --- a/modules/enterprise/server/jar/pom.xml +++ b/modules/enterprise/server/jar/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/alert-email/pom.xml b/modules/enterprise/server/plugins/alert-email/pom.xml index dd5bc18..ea1eb7b 100644 --- a/modules/enterprise/server/plugins/alert-email/pom.xml +++ b/modules/enterprise/server/plugins/alert-email/pom.xml @@ -3,7 +3,7 @@ <parent> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent> <modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-irc/pom.xml b/modules/enterprise/server/plugins/alert-irc/pom.xml index c0973f3..363ac0a 100644 --- a/modules/enterprise/server/plugins/alert-irc/pom.xml +++ b/modules/enterprise/server/plugins/alert-irc/pom.xml @@ -3,7 +3,7 @@ <parent> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent> <modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-microblog/pom.xml b/modules/enterprise/server/plugins/alert-microblog/pom.xml index a62fee8..b4751ba 100644 --- a/modules/enterprise/server/plugins/alert-microblog/pom.xml +++ b/modules/enterprise/server/plugins/alert-microblog/pom.xml @@ -3,7 +3,7 @@ <parent> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent> <modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-mobicents/pom.xml b/modules/enterprise/server/plugins/alert-mobicents/pom.xml index 3193539..b0a0c3b 100644 --- a/modules/enterprise/server/plugins/alert-mobicents/pom.xml +++ b/modules/enterprise/server/plugins/alert-mobicents/pom.xml @@ -3,7 +3,7 @@ <parent> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent> <modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-operations/pom.xml b/modules/enterprise/server/plugins/alert-operations/pom.xml index e69bfbc..6d35aed 100644 --- a/modules/enterprise/server/plugins/alert-operations/pom.xml +++ b/modules/enterprise/server/plugins/alert-operations/pom.xml @@ -2,7 +2,7 @@ <parent> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent> <modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-roles/pom.xml b/modules/enterprise/server/plugins/alert-roles/pom.xml index ca33bb7..cbd7334 100644 --- a/modules/enterprise/server/plugins/alert-roles/pom.xml +++ b/modules/enterprise/server/plugins/alert-roles/pom.xml @@ -3,7 +3,7 @@ <parent> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent> <modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-snmp/pom.xml b/modules/enterprise/server/plugins/alert-snmp/pom.xml index af75153..6398092 100644 --- a/modules/enterprise/server/plugins/alert-snmp/pom.xml +++ b/modules/enterprise/server/plugins/alert-snmp/pom.xml @@ -3,7 +3,7 @@ <parent> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent> <modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-subject/pom.xml b/modules/enterprise/server/plugins/alert-subject/pom.xml index 09839b8..ebac52c 100644 --- a/modules/enterprise/server/plugins/alert-subject/pom.xml +++ b/modules/enterprise/server/plugins/alert-subject/pom.xml @@ -3,7 +3,7 @@ <parent> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent> <modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/ant-bundle/pom.xml b/modules/enterprise/server/plugins/ant-bundle/pom.xml index 73f405e..30efb5a 100644 --- a/modules/enterprise/server/plugins/ant-bundle/pom.xml +++ b/modules/enterprise/server/plugins/ant-bundle/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/cobbler/pom.xml b/modules/enterprise/server/plugins/cobbler/pom.xml index 4c44f10..8464662 100644 --- a/modules/enterprise/server/plugins/cobbler/pom.xml +++ b/modules/enterprise/server/plugins/cobbler/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<modelVersion>4.0.0</modelVersion> diff --git a/modules/enterprise/server/plugins/disk/pom.xml b/modules/enterprise/server/plugins/disk/pom.xml index 0033d1b..40ab2a2 100644 --- a/modules/enterprise/server/plugins/disk/pom.xml +++ b/modules/enterprise/server/plugins/disk/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml b/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml index 61965f2..0c5fb51 100644 --- a/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml +++ b/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/jboss-software/pom.xml b/modules/enterprise/server/plugins/jboss-software/pom.xml index 7451668..3f1e165 100644 --- a/modules/enterprise/server/plugins/jboss-software/pom.xml +++ b/modules/enterprise/server/plugins/jboss-software/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml b/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml index 0ac61d3..25917cc 100644 --- a/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml +++ b/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml @@ -7,7 +7,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/perspectives/core/pom.xml b/modules/enterprise/server/plugins/perspectives/core/pom.xml index 5a78451..40c066f 100644 --- a/modules/enterprise/server/plugins/perspectives/core/pom.xml +++ b/modules/enterprise/server/plugins/perspectives/core/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/pom.xml b/modules/enterprise/server/plugins/pom.xml index 2b16f4a..9832288 100644 --- a/modules/enterprise/server/plugins/pom.xml +++ b/modules/enterprise/server/plugins/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/rhnhosted/pom.xml b/modules/enterprise/server/plugins/rhnhosted/pom.xml index e4ab9b2..26e985a 100644 --- a/modules/enterprise/server/plugins/rhnhosted/pom.xml +++ b/modules/enterprise/server/plugins/rhnhosted/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/url/pom.xml b/modules/enterprise/server/plugins/url/pom.xml index a6cba32..14e52de 100644 --- a/modules/enterprise/server/plugins/url/pom.xml +++ b/modules/enterprise/server/plugins/url/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml b/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml index 9c7cc74..e160aa6 100644 --- a/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml +++ b/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/yum/pom.xml b/modules/enterprise/server/plugins/yum/pom.xml index ebdd3da..344a215 100644 --- a/modules/enterprise/server/plugins/yum/pom.xml +++ b/modules/enterprise/server/plugins/yum/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/safe-invoker/pom.xml b/modules/enterprise/server/safe-invoker/pom.xml index 06c8981..bb1abdd 100644 --- a/modules/enterprise/server/safe-invoker/pom.xml +++ b/modules/enterprise/server/safe-invoker/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/sars/agent-sar/pom.xml b/modules/enterprise/server/sars/agent-sar/pom.xml index aa278b8..2458369 100644 --- a/modules/enterprise/server/sars/agent-sar/pom.xml +++ b/modules/enterprise/server/sars/agent-sar/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-sars-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/sars/pom.xml b/modules/enterprise/server/sars/pom.xml index 0cc2084..4ac7f43 100644 --- a/modules/enterprise/server/sars/pom.xml +++ b/modules/enterprise/server/sars/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/xml-schemas/pom.xml b/modules/enterprise/server/xml-schemas/pom.xml index 14738d0..21ccc78 100644 --- a/modules/enterprise/server/xml-schemas/pom.xml +++ b/modules/enterprise/server/xml-schemas/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/helpers/pluginAnnotations/pom.xml b/modules/helpers/pluginAnnotations/pom.xml index d056f74..366d1aa 100644 --- a/modules/helpers/pluginAnnotations/pom.xml +++ b/modules/helpers/pluginAnnotations/pom.xml @@ -6,7 +6,7 @@ <parent> <groupId>org.rhq.helpers</groupId> <artifactId>rhq-helpers</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq.helpers</groupId> diff --git a/modules/helpers/pluginGen/pom.xml b/modules/helpers/pluginGen/pom.xml index 28dc9b1..d992e29 100644 --- a/modules/helpers/pluginGen/pom.xml +++ b/modules/helpers/pluginGen/pom.xml @@ -6,7 +6,7 @@ <parent> <groupId>org.rhq.helpers</groupId> <artifactId>rhq-helpers</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq.helpers</groupId> diff --git a/modules/helpers/pom.xml b/modules/helpers/pom.xml index a0721a9..c5e5ae2 100644 --- a/modules/helpers/pom.xml +++ b/modules/helpers/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq.helpers</groupId> diff --git a/modules/helpers/rtfilter/pom.xml b/modules/helpers/rtfilter/pom.xml index 5d327ee..ffac476 100644 --- a/modules/helpers/rtfilter/pom.xml +++ b/modules/helpers/rtfilter/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq.helpers</groupId> <artifactId>rhq-helpers</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/aliases/pom.xml b/modules/plugins/aliases/pom.xml index c37598e..c475e5e 100644 --- a/modules/plugins/aliases/pom.xml +++ b/modules/plugins/aliases/pom.xml @@ -7,7 +7,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/ant-bundle/pom.xml b/modules/plugins/ant-bundle/pom.xml index cc160c9..5fa4596 100644 --- a/modules/plugins/ant-bundle/pom.xml +++ b/modules/plugins/ant-bundle/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/apache/pom.xml b/modules/plugins/apache/pom.xml index 700a6af..88db42f 100644 --- a/modules/plugins/apache/pom.xml +++ b/modules/plugins/apache/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/augeas/pom.xml b/modules/plugins/augeas/pom.xml index 915106a..51580cd 100644 --- a/modules/plugins/augeas/pom.xml +++ b/modules/plugins/augeas/pom.xml @@ -7,7 +7,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/cobbler/pom.xml b/modules/plugins/cobbler/pom.xml index d920440..a140f5d 100644 --- a/modules/plugins/cobbler/pom.xml +++ b/modules/plugins/cobbler/pom.xml @@ -7,7 +7,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/cron/pom.xml b/modules/plugins/cron/pom.xml index d5aaad5..9119492 100644 --- a/modules/plugins/cron/pom.xml +++ b/modules/plugins/cron/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/database/pom.xml b/modules/plugins/database/pom.xml index 30889f7..714ad7a 100644 --- a/modules/plugins/database/pom.xml +++ b/modules/plugins/database/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/filetemplate-bundle/pom.xml b/modules/plugins/filetemplate-bundle/pom.xml index b79645d..e01b311 100644 --- a/modules/plugins/filetemplate-bundle/pom.xml +++ b/modules/plugins/filetemplate-bundle/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/grub/pom.xml b/modules/plugins/grub/pom.xml index f7cf265..aef1858 100644 --- a/modules/plugins/grub/pom.xml +++ b/modules/plugins/grub/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/hibernate/pom.xml b/modules/plugins/hibernate/pom.xml index acb08ef..4f87dfe 100644 --- a/modules/plugins/hibernate/pom.xml +++ b/modules/plugins/hibernate/pom.xml @@ -6,7 +6,7 @@ <groupId>org.rhq</groupId> <!-- Bypass the jopr-plugins-parent which can not have children. It must build after the plugins in order to execute integration tests on them. --> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.jboss.on</groupId> diff --git a/modules/plugins/hosts/pom.xml b/modules/plugins/hosts/pom.xml index 7dd0fde..157119f 100644 --- a/modules/plugins/hosts/pom.xml +++ b/modules/plugins/hosts/pom.xml @@ -7,7 +7,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/hudson/pom.xml b/modules/plugins/hudson/pom.xml index 65fa7b8..eed10bc 100644 --- a/modules/plugins/hudson/pom.xml +++ b/modules/plugins/hudson/pom.xml @@ -6,7 +6,7 @@ <parent> <artifactId>rhq-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/iis/pom.xml b/modules/plugins/iis/pom.xml index 853c020..9a9c2f0 100644 --- a/modules/plugins/iis/pom.xml +++ b/modules/plugins/iis/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/jboss-as-5/pom.xml b/modules/plugins/jboss-as-5/pom.xml index a0ade77..befe74c 100644 --- a/modules/plugins/jboss-as-5/pom.xml +++ b/modules/plugins/jboss-as-5/pom.xml @@ -9,7 +9,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.jboss.on</groupId> diff --git a/modules/plugins/jboss-as/pom.xml b/modules/plugins/jboss-as/pom.xml index b9ed2b3..ac9b3f6 100644 --- a/modules/plugins/jboss-as/pom.xml +++ b/modules/plugins/jboss-as/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.jboss.on</groupId> diff --git a/modules/plugins/jboss-cache-v3/pom.xml b/modules/plugins/jboss-cache-v3/pom.xml index b3846fa..61f4e11 100644 --- a/modules/plugins/jboss-cache-v3/pom.xml +++ b/modules/plugins/jboss-cache-v3/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.jboss.on</groupId> diff --git a/modules/plugins/jboss-cache/pom.xml b/modules/plugins/jboss-cache/pom.xml index 443e524..684e8e3 100644 --- a/modules/plugins/jboss-cache/pom.xml +++ b/modules/plugins/jboss-cache/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.jboss.on</groupId> diff --git a/modules/plugins/jmx/pom.xml b/modules/plugins/jmx/pom.xml index ac9885a..a9874cc 100644 --- a/modules/plugins/jmx/pom.xml +++ b/modules/plugins/jmx/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/mysql/pom.xml b/modules/plugins/mysql/pom.xml index d0c9053..5a02364 100644 --- a/modules/plugins/mysql/pom.xml +++ b/modules/plugins/mysql/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/netservices/pom.xml b/modules/plugins/netservices/pom.xml index 06ae2ae..3d937e7 100644 --- a/modules/plugins/netservices/pom.xml +++ b/modules/plugins/netservices/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/oracle/pom.xml b/modules/plugins/oracle/pom.xml index 1acdb0f..e915511 100644 --- a/modules/plugins/oracle/pom.xml +++ b/modules/plugins/oracle/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/perftest/pom.xml b/modules/plugins/perftest/pom.xml index 39c75da..f65ad5a 100644 --- a/modules/plugins/perftest/pom.xml +++ b/modules/plugins/perftest/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/platform/pom.xml b/modules/plugins/platform/pom.xml index 97b83b0..aadd8bf 100644 --- a/modules/plugins/platform/pom.xml +++ b/modules/plugins/platform/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/pom.xml b/modules/plugins/pom.xml index 85d6105..f32c52d 100644 --- a/modules/plugins/pom.xml +++ b/modules/plugins/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/postfix/pom.xml b/modules/plugins/postfix/pom.xml index 283ab6a..639838b 100644 --- a/modules/plugins/postfix/pom.xml +++ b/modules/plugins/postfix/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/postgres/pom.xml b/modules/plugins/postgres/pom.xml index 5a4466c..beb98f2 100644 --- a/modules/plugins/postgres/pom.xml +++ b/modules/plugins/postgres/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/rhq-agent/pom.xml b/modules/plugins/rhq-agent/pom.xml index a190dcd..fdb0991 100644 --- a/modules/plugins/rhq-agent/pom.xml +++ b/modules/plugins/rhq-agent/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/rhq-server/pom.xml b/modules/plugins/rhq-server/pom.xml index 8f4e675..8fb6fee 100644 --- a/modules/plugins/rhq-server/pom.xml +++ b/modules/plugins/rhq-server/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.jboss.on</groupId> diff --git a/modules/plugins/samba/pom.xml b/modules/plugins/samba/pom.xml index 0d41574..9411143 100644 --- a/modules/plugins/samba/pom.xml +++ b/modules/plugins/samba/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/script/pom.xml b/modules/plugins/script/pom.xml index 7719b14..0ec4d51 100644 --- a/modules/plugins/script/pom.xml +++ b/modules/plugins/script/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/snmptrapd/pom.xml b/modules/plugins/snmptrapd/pom.xml index 2d9d715..f5106f0 100644 --- a/modules/plugins/snmptrapd/pom.xml +++ b/modules/plugins/snmptrapd/pom.xml @@ -2,7 +2,7 @@ <parent> <artifactId>rhq-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<modelVersion>4.0.0</modelVersion> diff --git a/modules/plugins/sshd/pom.xml b/modules/plugins/sshd/pom.xml index 3579496..b637f0d 100644 --- a/modules/plugins/sshd/pom.xml +++ b/modules/plugins/sshd/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/sudoers/pom.xml b/modules/plugins/sudoers/pom.xml index 41df1b8..55c3b49 100644 --- a/modules/plugins/sudoers/pom.xml +++ b/modules/plugins/sudoers/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/tomcat/pom.xml b/modules/plugins/tomcat/pom.xml index 205d5b0..9de8802 100644 --- a/modules/plugins/tomcat/pom.xml +++ b/modules/plugins/tomcat/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.jboss.on</groupId> diff --git a/modules/plugins/twitter/pom.xml b/modules/plugins/twitter/pom.xml index e299efa..9ee6ac3 100644 --- a/modules/plugins/twitter/pom.xml +++ b/modules/plugins/twitter/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/validate-all-plugins/pom.xml b/modules/plugins/validate-all-plugins/pom.xml index b3d5e87..93e847c 100644 --- a/modules/plugins/validate-all-plugins/pom.xml +++ b/modules/plugins/validate-all-plugins/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/pom.xml b/modules/pom.xml index bc96ae3..a6af192 100644 --- a/modules/pom.xml +++ b/modules/pom.xml @@ -6,7 +6,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/test-utils/pom.xml b/modules/test-utils/pom.xml index 2235687..5b243a9 100644 --- a/modules/test-utils/pom.xml +++ b/modules/test-utils/pom.xml @@ -4,7 +4,7 @@ <parent> <artifactId>rhq-modules-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent> <artifactId>test-utils</artifactId> <name>RHQ Test Utils</name> diff --git a/pom.xml b/pom.xml index 7ff85bb..5e2dc43 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@
<groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> <packaging>pom</packaging>
<name>RHQ</name>
commit 148c25cc279be5f96923c149fc0530512afdb9a0 Author: John Mazzitelli mazz@redhat.com Date: Wed Jul 28 14:24:20 2010 -0400
bz 619138 - add "inventory --sync" command
diff --git a/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/i18n/AgentI18NResourceKeys.java b/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/i18n/AgentI18NResourceKeys.java index 7e621e8..eadb493 100644 --- a/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/i18n/AgentI18NResourceKeys.java +++ b/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/i18n/AgentI18NResourceKeys.java @@ -1922,7 +1922,7 @@ public interface AgentI18NResourceKeys { @I18NMessage("inventory") String INVENTORY = "PromptCommand.inventory";
- @I18NMessage("inventory [--xml] [--export=<file>] [--norecurse]\n\\n" + @I18NMessage("inventory [--sync] [--xml] [--export=<file>] [--norecurse]\n\\n" + "\ [--id=<#>] | --types | <inventory-binary-file>]") String INVENTORY_SYNTAX = "PromptCommand.inventory.syntax";
@@ -1931,6 +1931,9 @@ public interface AgentI18NResourceKeys {
@I18NMessage("This will allow you to view the resources currently in inventory.\n\\n" + "The valid command line arguments are:\n\\n" + + "\ -s, --sync : Purges the agent's inventory and re-syncs it with the server.\n\\n" + + "\ This forces the agent's plugin container to restart.\n\\n" + + "\ All other options are ignored if this is specified.\n\\n" + "\ -e, --export=file : Writes the inventory information to the given file.\n\\n" + "\ If this is not specified, the output will go to the\n\\n" + "\ console window.\n\\n" @@ -1980,6 +1983,15 @@ public interface AgentI18NResourceKeys { + "two are mutually exclusive") String INVENTORY_ID_AND_DUMP_TYPES_SPECIFIED = "PromptCommand.inventory.id-and-dump-types-specified";
+ @I18NMessage("Cannot sync inventory - not currently able to talk to the RHQ Server.") + String INVENTORY_ERROR_NOT_SENDING = "PromptCommand.inventory.error-not-sending"; + + @I18NMessage("Purged the persisted inventory found at [{0}], sync will occur when plugin container restarts") + String INVENTORY_DATA_FILE_DELETED = "PromptCommand.inventory.data-file-deleted"; + + @I18NMessage("Failed to purge the inventory data file [{0}], sync may fail.") + String INVENTORY_DATA_FILE_DELETION_FAILURE = "PromptCommand.inventory.data-file-deletion-failure"; + @I18NMessage("avail") String AVAILABILITY = "PromptCommand.availability";
diff --git a/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/promptcmd/InventoryPromptCommand.java b/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/promptcmd/InventoryPromptCommand.java index cb48f38..661a84a 100644 --- a/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/promptcmd/InventoryPromptCommand.java +++ b/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/promptcmd/InventoryPromptCommand.java @@ -20,11 +20,14 @@ package org.rhq.enterprise.agent.promptcmd;
import gnu.getopt.Getopt; import gnu.getopt.LongOpt; + import java.io.File; import java.io.FileOutputStream; import java.io.PrintWriter; import java.util.Set; + import mazz.i18n.Msg; + import org.rhq.core.clientapi.agent.PluginContainerException; import org.rhq.core.domain.resource.ResourceType; import org.rhq.core.pc.PluginContainer; @@ -34,6 +37,7 @@ import org.rhq.core.pc.util.InventoryPrinter; import org.rhq.enterprise.agent.AgentMain; import org.rhq.enterprise.agent.i18n.AgentI18NFactory; import org.rhq.enterprise.agent.i18n.AgentI18NResourceKeys; +import org.rhq.enterprise.communications.command.client.ClientCommandSender;
/** * Provides a view into the inventory. @@ -92,12 +96,15 @@ public class InventoryPromptCommand implements AgentPromptCommand { boolean dumpTypesOnly = false; Integer id = null; boolean noRecurse = false; + boolean sync = false;
- String sopts = "-e:i:ntx"; - LongOpt[] lopts = { new LongOpt("export", LongOpt.REQUIRED_ARGUMENT, null, 'e'), - new LongOpt("id", LongOpt.REQUIRED_ARGUMENT, null, 'i'), - new LongOpt("norecurse", LongOpt.NO_ARGUMENT, null, 'n'), - new LongOpt("types", LongOpt.NO_ARGUMENT, null, 't'), new LongOpt("xml", LongOpt.NO_ARGUMENT, null, 'x') }; + String sopts = "-se:i:ntx"; + LongOpt[] lopts = { new LongOpt("export", LongOpt.REQUIRED_ARGUMENT, null, 'e'), // + new LongOpt("id", LongOpt.REQUIRED_ARGUMENT, null, 'i'), // + new LongOpt("norecurse", LongOpt.NO_ARGUMENT, null, 'n'), // + new LongOpt("sync", LongOpt.NO_ARGUMENT, null, 's'), // + new LongOpt("types", LongOpt.NO_ARGUMENT, null, 't'), // + new LongOpt("xml", LongOpt.NO_ARGUMENT, null, 'x') };
Getopt getopt = new Getopt(getPromptCommandString(), args, sopts, lopts); int code; @@ -116,6 +123,11 @@ public class InventoryPromptCommand implements AgentPromptCommand { break; }
+ case 's': { + sync = true; + break; + } + case 'e': { exportFile = getopt.getOptarg(); break; @@ -156,6 +168,13 @@ public class InventoryPromptCommand implements AgentPromptCommand { return; }
+ // if being asked to sync, we shutdown the PC, delete inventory.dat and restart PC. + // all other options are ignored + if (sync) { + syncInventory(agent, out); + return; + } + if ((inventoryBinaryFile != null) && dumpTypesOnly) { out.println(MSG.getMsg(AgentI18NResourceKeys.INVENTORY_DUMP_TYPES_AND_BINARY_FILE_SPECIFIED)); out.println(MSG.getMsg(AgentI18NResourceKeys.HELP_SYNTAX_LABEL, getSyntax())); @@ -228,4 +247,40 @@ public class InventoryPromptCommand implements AgentPromptCommand {
return; } + + private void syncInventory(AgentMain agent, PrintWriter out) { + // if the PC is already started, we need to shut it down and restart it after we get the new plugins + boolean recyclePC = agent.isPluginContainerStarted(); + + // make sure our agent is currently in communications with the server + ClientCommandSender clientCommandSender = agent.getClientCommandSender(); + if (clientCommandSender == null || !clientCommandSender.isSending()) { + out.println(MSG.getMsg(AgentI18NResourceKeys.INVENTORY_ERROR_NOT_SENDING)); + return; + } + + // use the PC prompt command to stop the PC - needed because the PC cannot hot-deploy plugins + if (recyclePC) { + executePCCommand(agent, "stop"); + } + + File dataDir = agent.getConfiguration().getPluginContainerConfiguration().getDataDirectory(); + File inventoryDataFile = new File(dataDir, "inventory.dat"); + inventoryDataFile.delete(); + if (!inventoryDataFile.exists()) { + out.println(MSG.getMsg(AgentI18NResourceKeys.INVENTORY_DATA_FILE_DELETED, inventoryDataFile)); + } else { + out.println(MSG.getMsg(AgentI18NResourceKeys.INVENTORY_DATA_FILE_DELETION_FAILURE, inventoryDataFile)); + } + + if (recyclePC) { + executePCCommand(agent, "start"); + } + } + + private void executePCCommand(AgentMain agent, String startOrStop) { + PluginContainerPromptCommand command = new PluginContainerPromptCommand(); + command.execute(agent, new String[] { command.getPromptCommandString(), startOrStop }); + } + } \ No newline at end of file
commit 551ec3b94fd778e1756d827b2aa2ae1530433c44 Merge: ac089af... 94090ca... Author: Ian Springer ian.springer@redhat.com Date: Wed Jul 28 13:58:42 2010 -0400
Merge branch 'release-3.0.0' of ssh://git.fedorahosted.org/git/rhq/rhq into release-3.0.0
commit ac089af2c4b4471876e4b84b9d45169cf7cb9cce Author: Ian Springer ian.springer@redhat.com Date: Wed Jul 28 13:56:56 2010 -0400
Revert "fix so that when the Server moves a Resource to a new parent as a result of that Resource's type's parent type changing, that Resource also gets moved to the new parent in the plugin container's local inventory the next time the PC InventoryManager performs an inventory sync (fix for second half of https://bugzilla.redhat.com/show_bug.cgi?id=618879)"
This reverts commit e60acb24efe12dc9aac8e0b5f708c551c17a6768.
This fix is attached to https://bugzilla.redhat.com/show_bug.cgi?id=618879 as a patch, which we'll most likely apply after JON 2.4 has been released.
diff --git a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/InventoryManager.java b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/InventoryManager.java index 6e9a503..0c86f8f 100644 --- a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/InventoryManager.java +++ b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/InventoryManager.java @@ -237,7 +237,6 @@ public class InventoryManager extends AgentService implements ContainerService, inventoryThreadPoolExecutor.scheduleWithFixedDelay(serviceScanExecutor, configuration .getServiceDiscoveryInitialDelay(), configuration.getServiceDiscoveryPeriod(), TimeUnit.SECONDS); } - } finally { inventoryLock.writeLock().unlock(); } @@ -2258,41 +2257,22 @@ public class InventoryManager extends AgentService implements ContainerService, if (log.isDebugEnabled()) { log.debug("Merging [" + resource + "] into local inventory..."); } - Resource passedResource = resource; // Keep a reference to the passed Resource for debugging purposes. - - ResourceContainer existingResourceContainer = getResourceContainer(resource); - if (existingResourceContainer == null) { - existingResourceContainer = getResourceContainer(resource.getId()); - } - Resource existingResourceViaContainer = (existingResourceContainer != null) ? - existingResourceContainer.getResource() : null; - Resource existingParent = (existingResourceViaContainer != null) ? - existingResourceViaContainer.getParentResource() : null; - - Resource newParent; + Resource passedResource = resource; // always keep a reference to the passed resource + Resource parentResource; if (resource.getParentResource() != null) { ResourceContainer parentResourceContainer = getResourceContainer(resource.getParentResource()); if (parentResourceContainer == null) { parentResourceContainer = getResourceContainer(resource.getParentResource().getId()); } - if (parentResourceContainer != null) { - newParent = parentResourceContainer.getResource(); - } else { - newParent = null; // TODO right thing to do? Or directly return? - } + if (parentResourceContainer != null) + parentResource = parentResourceContainer.getResource(); + else + parentResource = null; // TODO right thing to do? Or directly return? } else { - newParent = null; + parentResource = null; } - - if (newParent != null && existingParent != null && - !matches(newParent, existingParent)) { - // The Server must have moved the Resource to a new parent - remove it from its old parent in our - // local inventory. We'll add - existingParent.removeChildResource(existingResourceViaContainer); - } - - Resource existingResourceViaParent = findMatchingChildResource(resource, newParent); - if (newParent == null && existingResourceViaParent == null) { + Resource existingResource = findMatchingChildResource(resource, parentResource); + if (parentResource == null && existingResource == null) { // This should never happen, but add a check so we'll know if it ever does. log.error("Existing platform [" + this.platform + "] has different Resource type and/or Resource key than " + "platform in Server inventory: " + resource); @@ -2301,31 +2281,31 @@ public class InventoryManager extends AgentService implements ContainerService, boolean pluginConfigUpdated = false; this.inventoryLock.writeLock().lock(); try { - if (existingResourceViaParent != null) { + if (existingResource != null) { // First grab the existing Resource's container, so we can reuse it. - resourceContainer = this.resourceContainers.remove(existingResourceViaParent.getUuid()); + resourceContainer = this.resourceContainers.remove(existingResource.getUuid()); if (resourceContainer != null) { this.resourceContainers.put(resource.getUuid(), resourceContainer); } - if (newParent != null) { + if (parentResource != null) { // It's critical to remove the existing Resource from the parent's child Set if the UUID has // changed (i.e. altering the hashCode of an item in a Set == BAD), so just always remove it. - newParent.removeChildResource(existingResourceViaParent); + parentResource.removeChildResource(existingResource); } // Now merge the new Resource into the existing Resource... - pluginConfigUpdated = mergeResource(resource, existingResourceViaParent); - resource = existingResourceViaParent; + pluginConfigUpdated = mergeResource(resource, existingResource); + resource = existingResource; }
- if (newParent != null) { - newParent.addChildResource(resource); + if (parentResource != null) { + parentResource.addChildResource(resource); } else { this.platform = resource; }
// Replace the stripped-down ResourceType that came from the Server with the full ResourceType - it's // critical to do this before refreshing the state (i.e. calling start on the ResourceComponent) - // and critical to do this before initializing the container (since it's needed for the classloader creation). + // and critical to do this before initializing the container (since its needed for the classloader creation). ResourceType fullResourceType = this.pluginManager.getMetadataManager().getType(resource.getResourceType()); if (fullResourceType == null) { log.error("Unable to merge Resource " + resource + " - its type is unknown - perhaps the [" diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/discovery/DiscoveryBossBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/discovery/DiscoveryBossBean.java index 3d1ddd7..185562a 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/discovery/DiscoveryBossBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/discovery/DiscoveryBossBean.java @@ -622,21 +622,14 @@ public class DiscoveryBossBean implements DiscoveryBossLocal, DiscoveryBossRemot // parent to that type.
if (validParentTypes.contains(resourceParentType)) { - log.debug("Moving " + existingResource + " from old parent " + existingResource.getParentResource() - + " to new parent " + resource.getParentResource() + "..."); if (existingResource.getParentResource() != null) { existingResource.getParentResource().removeChildResource(existingResource); } if (resource.getParentResource() != null) { parentResource = getExistingResource(resource.getParentResource()); parentResource.addChildResource(existingResource); - } existingResource.setParentResource(resource.getParentResource()); - - // IMPORTANT: Update the Resource's mtime, so the Agent will know to update the Resource's parent during - // its inventory sync. - existingResource.setMtime(System.currentTimeMillis()); } else { log.debug("Existing Resource " + existingResource + " has invalid parent type (" + existingResourceParentType + ") and so does plugin-reported Resource " + resource + " (" diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/metadata/ResourceMetadataManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/metadata/ResourceMetadataManagerBean.java index a0b01ac..64e9afd 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/metadata/ResourceMetadataManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/metadata/ResourceMetadataManagerBean.java @@ -843,16 +843,10 @@ public class ResourceMetadataManagerBean implements ResourceMetadataManagerLocal } } if (newParent != null) { - log.debug("Moving " + resource + " from old parent " + resource.getParentResource() + " to new parent " - + newParent + "..."); if (resource.getParentResource() != null) { resource.getParentResource().removeChildResource(resource); } newParent.addChildResource(resource); - - // IMPORTANT: Update the Resource's mtime, so the Agent will know to update the Resource's parent during - // its inventory sync. - resource.setMtime(System.currentTimeMillis()); } else { log.debug("We were unable to move " + resource + " from invalid parent " + resource.getParentResource() + " to a new valid parent with one of the following types: " + newParentTypes);
commit 87316df996bb23032a68861f47639f90b5dda532 Author: Ian Springer ian.springer@redhat.com Date: Wed Jul 28 13:54:35 2010 -0400
a few cosmetic + javadoc changes
diff --git a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/AvailabilityExecutor.java b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/AvailabilityExecutor.java index 04e1fb3..b1e39f8 100644 --- a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/AvailabilityExecutor.java +++ b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/AvailabilityExecutor.java @@ -99,11 +99,12 @@ public class AvailabilityExecutor implements Runnable, Callable<AvailabilityRepo * * <p>This will return <code>null</code> if there is no committed inventory and thus no availability reports should * be sent. This will rarely happen - only if this is a brand new agent whose inventory hasn't been committed yet or - * if the platform and all its children have been deleted (in which case the agent should be uninstalled or the user + * if the platform and all its children have been deleted (in which case the agent should be uninstalled, or the user * will want to re-import the platform). In either case, it will be in rare, corner cases that this will ever return * null, and the condition that caused the null should eventually go away.</p> * - * @return the report containing all the availabilities that need to be sent to the Server + * @return the report containing all the availabilities that need to be sent to the Server, or <code>null</code> if + * there is no committed inventory and thus no availability reports should be sent * * @throws Exception if failed to create and prepare the report */ @@ -153,16 +154,16 @@ public class AvailabilityExecutor implements Runnable, Callable<AvailabilityRepo }
private void checkInventory(Resource resource, AvailabilityReport availabilityReport, boolean reportChangesOnly, - boolean checkChildren, boolean parentIsDown) { + boolean checkChildren, boolean parentIsDown) { // Only report avail for committed Resources - that's all the Server cares about. - if (resource.getInventoryStatus() != InventoryStatus.COMMITTED) { + if (resource.getId() == 0 || resource.getInventoryStatus() != InventoryStatus.COMMITTED) { return; } ResourceContainer resourceContainer = this.inventoryManager.getResourceContainer(resource); // Only report avail for synchronized Resources, otherwise chances are the Server will know nothing of the // Resource. - if (resourceContainer == null || - resourceContainer.getSynchronizationState() != ResourceContainer.SynchronizationState.SYNCHRONIZED) { + if (resourceContainer == null + || resourceContainer.getSynchronizationState() != ResourceContainer.SynchronizationState.SYNCHRONIZED) { return; } AvailabilityFacet resourceComponent; @@ -177,17 +178,17 @@ public class AvailabilityExecutor implements Runnable, Callable<AvailabilityRepo return; }
- AvailabilityType current = null; - - // Find out what the avail was the last time we checked it. - Availability previous = this.inventoryManager.getAvailabilityIfKnown(resource); + // If this is a changed-only report, find out what the avail was the last time we checked it. + Availability previous = (reportChangesOnly) ? this.inventoryManager.getAvailabilityIfKnown(resource) : null;
+ AvailabilityType current; if (parentIsDown) { // If the resource's parent is down, the rules are that the resource and all of the parent's other // descendants, must also be down, so there's no need to even ask the resource component for its // current availability - its current avail is DOWN and that's that. current = AvailabilityType.DOWN; } else { + current = null; try { // if the component is started, ask what its current availability is as of right now; // if it's not started, then assume it's down, and the next time we check,
commit e60acb24efe12dc9aac8e0b5f708c551c17a6768 Author: Ian Springer ian.springer@redhat.com Date: Wed Jul 28 13:11:02 2010 -0400
fix so that when the Server moves a Resource to a new parent as a result of that Resource's type's parent type changing, that Resource also gets moved to the new parent in the plugin container's local inventory the next time the PC InventoryManager performs an inventory sync (fix for second half of https://bugzilla.redhat.com/show_bug.cgi?id=618879)
diff --git a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/InventoryManager.java b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/InventoryManager.java index 0c86f8f..6e9a503 100644 --- a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/InventoryManager.java +++ b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/InventoryManager.java @@ -237,6 +237,7 @@ public class InventoryManager extends AgentService implements ContainerService, inventoryThreadPoolExecutor.scheduleWithFixedDelay(serviceScanExecutor, configuration .getServiceDiscoveryInitialDelay(), configuration.getServiceDiscoveryPeriod(), TimeUnit.SECONDS); } + } finally { inventoryLock.writeLock().unlock(); } @@ -2257,22 +2258,41 @@ public class InventoryManager extends AgentService implements ContainerService, if (log.isDebugEnabled()) { log.debug("Merging [" + resource + "] into local inventory..."); } - Resource passedResource = resource; // always keep a reference to the passed resource - Resource parentResource; + Resource passedResource = resource; // Keep a reference to the passed Resource for debugging purposes. + + ResourceContainer existingResourceContainer = getResourceContainer(resource); + if (existingResourceContainer == null) { + existingResourceContainer = getResourceContainer(resource.getId()); + } + Resource existingResourceViaContainer = (existingResourceContainer != null) ? + existingResourceContainer.getResource() : null; + Resource existingParent = (existingResourceViaContainer != null) ? + existingResourceViaContainer.getParentResource() : null; + + Resource newParent; if (resource.getParentResource() != null) { ResourceContainer parentResourceContainer = getResourceContainer(resource.getParentResource()); if (parentResourceContainer == null) { parentResourceContainer = getResourceContainer(resource.getParentResource().getId()); } - if (parentResourceContainer != null) - parentResource = parentResourceContainer.getResource(); - else - parentResource = null; // TODO right thing to do? Or directly return? + if (parentResourceContainer != null) { + newParent = parentResourceContainer.getResource(); + } else { + newParent = null; // TODO right thing to do? Or directly return? + } } else { - parentResource = null; + newParent = null; } - Resource existingResource = findMatchingChildResource(resource, parentResource); - if (parentResource == null && existingResource == null) { + + if (newParent != null && existingParent != null && + !matches(newParent, existingParent)) { + // The Server must have moved the Resource to a new parent - remove it from its old parent in our + // local inventory. We'll add + existingParent.removeChildResource(existingResourceViaContainer); + } + + Resource existingResourceViaParent = findMatchingChildResource(resource, newParent); + if (newParent == null && existingResourceViaParent == null) { // This should never happen, but add a check so we'll know if it ever does. log.error("Existing platform [" + this.platform + "] has different Resource type and/or Resource key than " + "platform in Server inventory: " + resource); @@ -2281,31 +2301,31 @@ public class InventoryManager extends AgentService implements ContainerService, boolean pluginConfigUpdated = false; this.inventoryLock.writeLock().lock(); try { - if (existingResource != null) { + if (existingResourceViaParent != null) { // First grab the existing Resource's container, so we can reuse it. - resourceContainer = this.resourceContainers.remove(existingResource.getUuid()); + resourceContainer = this.resourceContainers.remove(existingResourceViaParent.getUuid()); if (resourceContainer != null) { this.resourceContainers.put(resource.getUuid(), resourceContainer); } - if (parentResource != null) { + if (newParent != null) { // It's critical to remove the existing Resource from the parent's child Set if the UUID has // changed (i.e. altering the hashCode of an item in a Set == BAD), so just always remove it. - parentResource.removeChildResource(existingResource); + newParent.removeChildResource(existingResourceViaParent); } // Now merge the new Resource into the existing Resource... - pluginConfigUpdated = mergeResource(resource, existingResource); - resource = existingResource; + pluginConfigUpdated = mergeResource(resource, existingResourceViaParent); + resource = existingResourceViaParent; }
- if (parentResource != null) { - parentResource.addChildResource(resource); + if (newParent != null) { + newParent.addChildResource(resource); } else { this.platform = resource; }
// Replace the stripped-down ResourceType that came from the Server with the full ResourceType - it's // critical to do this before refreshing the state (i.e. calling start on the ResourceComponent) - // and critical to do this before initializing the container (since its needed for the classloader creation). + // and critical to do this before initializing the container (since it's needed for the classloader creation). ResourceType fullResourceType = this.pluginManager.getMetadataManager().getType(resource.getResourceType()); if (fullResourceType == null) { log.error("Unable to merge Resource " + resource + " - its type is unknown - perhaps the [" diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/discovery/DiscoveryBossBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/discovery/DiscoveryBossBean.java index 185562a..3d1ddd7 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/discovery/DiscoveryBossBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/discovery/DiscoveryBossBean.java @@ -622,14 +622,21 @@ public class DiscoveryBossBean implements DiscoveryBossLocal, DiscoveryBossRemot // parent to that type.
if (validParentTypes.contains(resourceParentType)) { + log.debug("Moving " + existingResource + " from old parent " + existingResource.getParentResource() + + " to new parent " + resource.getParentResource() + "..."); if (existingResource.getParentResource() != null) { existingResource.getParentResource().removeChildResource(existingResource); } if (resource.getParentResource() != null) { parentResource = getExistingResource(resource.getParentResource()); parentResource.addChildResource(existingResource); + } existingResource.setParentResource(resource.getParentResource()); + + // IMPORTANT: Update the Resource's mtime, so the Agent will know to update the Resource's parent during + // its inventory sync. + existingResource.setMtime(System.currentTimeMillis()); } else { log.debug("Existing Resource " + existingResource + " has invalid parent type (" + existingResourceParentType + ") and so does plugin-reported Resource " + resource + " (" diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/metadata/ResourceMetadataManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/metadata/ResourceMetadataManagerBean.java index 64e9afd..a0b01ac 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/metadata/ResourceMetadataManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/metadata/ResourceMetadataManagerBean.java @@ -843,10 +843,16 @@ public class ResourceMetadataManagerBean implements ResourceMetadataManagerLocal } } if (newParent != null) { + log.debug("Moving " + resource + " from old parent " + resource.getParentResource() + " to new parent " + + newParent + "..."); if (resource.getParentResource() != null) { resource.getParentResource().removeChildResource(resource); } newParent.addChildResource(resource); + + // IMPORTANT: Update the Resource's mtime, so the Agent will know to update the Resource's parent during + // its inventory sync. + resource.setMtime(System.currentTimeMillis()); } else { log.debug("We were unable to move " + resource + " from invalid parent " + resource.getParentResource() + " to a new valid parent with one of the following types: " + newParentTypes);
commit 4f675366f3743d33b8da8b9c73389550d515f162 Merge: c0c02b6... 50a5832... Author: Heiko W. Rupp hwr@redhat.com Date: Wed Jul 28 17:30:44 2010 +0200
Merge branch 'master' of ssh://git.fedorahosted.org/git/rhq/rhq
commit 94090ca72aee2da30fd60dafc11603e8acaa2794 Author: hudson auto wnstb@yahoo.com Date: Tue Jul 27 23:54:37 2010 -0400
[maven-release-plugin] prepare for next development iteration
diff --git a/modules/common/ant-bundle/pom.xml b/modules/common/ant-bundle/pom.xml index 97ef93b..eda9133 100644 --- a/modules/common/ant-bundle/pom.xml +++ b/modules/common/ant-bundle/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-common-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/common/filetemplate-bundle/pom.xml b/modules/common/filetemplate-bundle/pom.xml index 3b26a39..bc7965b 100644 --- a/modules/common/filetemplate-bundle/pom.xml +++ b/modules/common/filetemplate-bundle/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-common-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/common/jboss-as/pom.xml b/modules/common/jboss-as/pom.xml index 688d5e4..2cf950b 100644 --- a/modules/common/jboss-as/pom.xml +++ b/modules/common/jboss-as/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-common-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/common/pom.xml b/modules/common/pom.xml index 2ddc4af..ee81a94 100644 --- a/modules/common/pom.xml +++ b/modules/common/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/client-api/pom.xml b/modules/core/client-api/pom.xml index a27161b..d177f9e 100644 --- a/modules/core/client-api/pom.xml +++ b/modules/core/client-api/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/comm-api/pom.xml b/modules/core/comm-api/pom.xml index 4589d42..a51f92b 100644 --- a/modules/core/comm-api/pom.xml +++ b/modules/core/comm-api/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/dbutils/pom.xml b/modules/core/dbutils/pom.xml index d7559da..7ff6a10 100644 --- a/modules/core/dbutils/pom.xml +++ b/modules/core/dbutils/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/domain/pom.xml b/modules/core/domain/pom.xml index dc75145..e0ced84 100644 --- a/modules/core/domain/pom.xml +++ b/modules/core/domain/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/gui/pom.xml b/modules/core/gui/pom.xml index b535306..0911918 100644 --- a/modules/core/gui/pom.xml +++ b/modules/core/gui/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/native-system/pom.xml b/modules/core/native-system/pom.xml index f72bc2f..d47d4c8 100644 --- a/modules/core/native-system/pom.xml +++ b/modules/core/native-system/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/plugin-api/pom.xml b/modules/core/plugin-api/pom.xml index 967b21a..e1ce7ef 100644 --- a/modules/core/plugin-api/pom.xml +++ b/modules/core/plugin-api/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/plugin-container/pom.xml b/modules/core/plugin-container/pom.xml index fbab223..2e58102 100644 --- a/modules/core/plugin-container/pom.xml +++ b/modules/core/plugin-container/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/plugin-validator/pom.xml b/modules/core/plugin-validator/pom.xml index 996cd8f..7739177 100644 --- a/modules/core/plugin-validator/pom.xml +++ b/modules/core/plugin-validator/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/plugindoc/pom.xml b/modules/core/plugindoc/pom.xml index 8a95e51..eeb7e81 100644 --- a/modules/core/plugindoc/pom.xml +++ b/modules/core/plugindoc/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/pom.xml b/modules/core/pom.xml index b0c399b..7aad64c 100644 --- a/modules/core/pom.xml +++ b/modules/core/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/util/pom.xml b/modules/core/util/pom.xml index 37bcda5..bc41dc5 100644 --- a/modules/core/util/pom.xml +++ b/modules/core/util/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/agent/pom.xml b/modules/enterprise/agent/pom.xml index 3fc1344..d9f1c1c 100644 --- a/modules/enterprise/agent/pom.xml +++ b/modules/enterprise/agent/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/agentupdate/pom.xml b/modules/enterprise/agentupdate/pom.xml index 127b06f..8942239 100644 --- a/modules/enterprise/agentupdate/pom.xml +++ b/modules/enterprise/agentupdate/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/comm/pom.xml b/modules/enterprise/comm/pom.xml index 9f09ff1..8b9da9c 100644 --- a/modules/enterprise/comm/pom.xml +++ b/modules/enterprise/comm/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/base-perspective-jar/pom.xml b/modules/enterprise/gui/base-perspective-jar/pom.xml index 95b62cd..611eb9d 100644 --- a/modules/enterprise/gui/base-perspective-jar/pom.xml +++ b/modules/enterprise/gui/base-perspective-jar/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/base-perspective-war/pom.xml b/modules/enterprise/gui/base-perspective-war/pom.xml index c1c297f..798a8ca 100644 --- a/modules/enterprise/gui/base-perspective-war/pom.xml +++ b/modules/enterprise/gui/base-perspective-war/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/content_http-war/pom.xml b/modules/enterprise/gui/content_http-war/pom.xml index 6be8d8d..df05645 100644 --- a/modules/enterprise/gui/content_http-war/pom.xml +++ b/modules/enterprise/gui/content_http-war/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-gui-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/coregui/pom.xml b/modules/enterprise/gui/coregui/pom.xml index 709bfe3..acbe21f 100644 --- a/modules/enterprise/gui/coregui/pom.xml +++ b/modules/enterprise/gui/coregui/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/installer-war/pom.xml b/modules/enterprise/gui/installer-war/pom.xml index 8d33ef0..1beadca 100644 --- a/modules/enterprise/gui/installer-war/pom.xml +++ b/modules/enterprise/gui/installer-war/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/pom.xml b/modules/enterprise/gui/pom.xml index bf6a9a4..0c529ba 100644 --- a/modules/enterprise/gui/pom.xml +++ b/modules/enterprise/gui/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/portal-war/pom.xml b/modules/enterprise/gui/portal-war/pom.xml index d9f0c15..a794cd6 100644 --- a/modules/enterprise/gui/portal-war/pom.xml +++ b/modules/enterprise/gui/portal-war/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/webdav-war/pom.xml b/modules/enterprise/gui/webdav-war/pom.xml index 9bdfc91..aa880be 100644 --- a/modules/enterprise/gui/webdav-war/pom.xml +++ b/modules/enterprise/gui/webdav-war/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/pom.xml b/modules/enterprise/pom.xml index 77a5685..3b0dbb8 100644 --- a/modules/enterprise/pom.xml +++ b/modules/enterprise/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/remoting/cli/pom.xml b/modules/enterprise/remoting/cli/pom.xml index dff57e7..05187c7 100644 --- a/modules/enterprise/remoting/cli/pom.xml +++ b/modules/enterprise/remoting/cli/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<artifactId>rhq-remoting-cli</artifactId> diff --git a/modules/enterprise/remoting/client-api/pom.xml b/modules/enterprise/remoting/client-api/pom.xml index 6008df1..e86ef41 100644 --- a/modules/enterprise/remoting/client-api/pom.xml +++ b/modules/enterprise/remoting/client-api/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<artifactId>rhq-remoting-client-api</artifactId> diff --git a/modules/enterprise/remoting/pom.xml b/modules/enterprise/remoting/pom.xml index 68d51c0..910b617 100644 --- a/modules/enterprise/remoting/pom.xml +++ b/modules/enterprise/remoting/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<artifactId>rhq-remoting-parent</artifactId> diff --git a/modules/enterprise/remoting/webservices/pom.xml b/modules/enterprise/remoting/webservices/pom.xml index 444256d..2ea73ee 100644 --- a/modules/enterprise/remoting/webservices/pom.xml +++ b/modules/enterprise/remoting/webservices/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<artifactId>rhq-remoting-webservices</artifactId> diff --git a/modules/enterprise/server/container-lib/pom.xml b/modules/enterprise/server/container-lib/pom.xml index f09e063..2c98817 100644 --- a/modules/enterprise/server/container-lib/pom.xml +++ b/modules/enterprise/server/container-lib/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/container/pom.xml b/modules/enterprise/server/container/pom.xml index b4d2146..3fd11e8 100644 --- a/modules/enterprise/server/container/pom.xml +++ b/modules/enterprise/server/container/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/ear/pom.xml b/modules/enterprise/server/ear/pom.xml index c063211..bf15866 100644 --- a/modules/enterprise/server/ear/pom.xml +++ b/modules/enterprise/server/ear/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/jar/pom.xml b/modules/enterprise/server/jar/pom.xml index ddff575..79fdc38 100644 --- a/modules/enterprise/server/jar/pom.xml +++ b/modules/enterprise/server/jar/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/alert-email/pom.xml b/modules/enterprise/server/plugins/alert-email/pom.xml index ea1eb7b..dd5bc18 100644 --- a/modules/enterprise/server/plugins/alert-email/pom.xml +++ b/modules/enterprise/server/plugins/alert-email/pom.xml @@ -3,7 +3,7 @@ <parent> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent> <modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-irc/pom.xml b/modules/enterprise/server/plugins/alert-irc/pom.xml index 363ac0a..c0973f3 100644 --- a/modules/enterprise/server/plugins/alert-irc/pom.xml +++ b/modules/enterprise/server/plugins/alert-irc/pom.xml @@ -3,7 +3,7 @@ <parent> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent> <modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-microblog/pom.xml b/modules/enterprise/server/plugins/alert-microblog/pom.xml index b4751ba..a62fee8 100644 --- a/modules/enterprise/server/plugins/alert-microblog/pom.xml +++ b/modules/enterprise/server/plugins/alert-microblog/pom.xml @@ -3,7 +3,7 @@ <parent> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent> <modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-mobicents/pom.xml b/modules/enterprise/server/plugins/alert-mobicents/pom.xml index b0a0c3b..3193539 100644 --- a/modules/enterprise/server/plugins/alert-mobicents/pom.xml +++ b/modules/enterprise/server/plugins/alert-mobicents/pom.xml @@ -3,7 +3,7 @@ <parent> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent> <modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-operations/pom.xml b/modules/enterprise/server/plugins/alert-operations/pom.xml index 6d35aed..e69bfbc 100644 --- a/modules/enterprise/server/plugins/alert-operations/pom.xml +++ b/modules/enterprise/server/plugins/alert-operations/pom.xml @@ -2,7 +2,7 @@ <parent> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent> <modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-roles/pom.xml b/modules/enterprise/server/plugins/alert-roles/pom.xml index cbd7334..ca33bb7 100644 --- a/modules/enterprise/server/plugins/alert-roles/pom.xml +++ b/modules/enterprise/server/plugins/alert-roles/pom.xml @@ -3,7 +3,7 @@ <parent> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent> <modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-snmp/pom.xml b/modules/enterprise/server/plugins/alert-snmp/pom.xml index 6398092..af75153 100644 --- a/modules/enterprise/server/plugins/alert-snmp/pom.xml +++ b/modules/enterprise/server/plugins/alert-snmp/pom.xml @@ -3,7 +3,7 @@ <parent> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent> <modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-subject/pom.xml b/modules/enterprise/server/plugins/alert-subject/pom.xml index ebac52c..09839b8 100644 --- a/modules/enterprise/server/plugins/alert-subject/pom.xml +++ b/modules/enterprise/server/plugins/alert-subject/pom.xml @@ -3,7 +3,7 @@ <parent> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent> <modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/ant-bundle/pom.xml b/modules/enterprise/server/plugins/ant-bundle/pom.xml index 30efb5a..73f405e 100644 --- a/modules/enterprise/server/plugins/ant-bundle/pom.xml +++ b/modules/enterprise/server/plugins/ant-bundle/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/cobbler/pom.xml b/modules/enterprise/server/plugins/cobbler/pom.xml index 8464662..4c44f10 100644 --- a/modules/enterprise/server/plugins/cobbler/pom.xml +++ b/modules/enterprise/server/plugins/cobbler/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<modelVersion>4.0.0</modelVersion> diff --git a/modules/enterprise/server/plugins/disk/pom.xml b/modules/enterprise/server/plugins/disk/pom.xml index 40ab2a2..0033d1b 100644 --- a/modules/enterprise/server/plugins/disk/pom.xml +++ b/modules/enterprise/server/plugins/disk/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml b/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml index 0c5fb51..61965f2 100644 --- a/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml +++ b/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/jboss-software/pom.xml b/modules/enterprise/server/plugins/jboss-software/pom.xml index 3f1e165..7451668 100644 --- a/modules/enterprise/server/plugins/jboss-software/pom.xml +++ b/modules/enterprise/server/plugins/jboss-software/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml b/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml index 25917cc..0ac61d3 100644 --- a/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml +++ b/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml @@ -7,7 +7,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/perspectives/core/pom.xml b/modules/enterprise/server/plugins/perspectives/core/pom.xml index 40c066f..5a78451 100644 --- a/modules/enterprise/server/plugins/perspectives/core/pom.xml +++ b/modules/enterprise/server/plugins/perspectives/core/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/pom.xml b/modules/enterprise/server/plugins/pom.xml index 9832288..2b16f4a 100644 --- a/modules/enterprise/server/plugins/pom.xml +++ b/modules/enterprise/server/plugins/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/rhnhosted/pom.xml b/modules/enterprise/server/plugins/rhnhosted/pom.xml index 26e985a..e4ab9b2 100644 --- a/modules/enterprise/server/plugins/rhnhosted/pom.xml +++ b/modules/enterprise/server/plugins/rhnhosted/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/url/pom.xml b/modules/enterprise/server/plugins/url/pom.xml index 14e52de..a6cba32 100644 --- a/modules/enterprise/server/plugins/url/pom.xml +++ b/modules/enterprise/server/plugins/url/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml b/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml index e160aa6..9c7cc74 100644 --- a/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml +++ b/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/yum/pom.xml b/modules/enterprise/server/plugins/yum/pom.xml index 344a215..ebdd3da 100644 --- a/modules/enterprise/server/plugins/yum/pom.xml +++ b/modules/enterprise/server/plugins/yum/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/safe-invoker/pom.xml b/modules/enterprise/server/safe-invoker/pom.xml index bb1abdd..06c8981 100644 --- a/modules/enterprise/server/safe-invoker/pom.xml +++ b/modules/enterprise/server/safe-invoker/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/sars/agent-sar/pom.xml b/modules/enterprise/server/sars/agent-sar/pom.xml index 2458369..aa278b8 100644 --- a/modules/enterprise/server/sars/agent-sar/pom.xml +++ b/modules/enterprise/server/sars/agent-sar/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-sars-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/sars/pom.xml b/modules/enterprise/server/sars/pom.xml index 4ac7f43..0cc2084 100644 --- a/modules/enterprise/server/sars/pom.xml +++ b/modules/enterprise/server/sars/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/xml-schemas/pom.xml b/modules/enterprise/server/xml-schemas/pom.xml index 21ccc78..14738d0 100644 --- a/modules/enterprise/server/xml-schemas/pom.xml +++ b/modules/enterprise/server/xml-schemas/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/helpers/pluginAnnotations/pom.xml b/modules/helpers/pluginAnnotations/pom.xml index 366d1aa..d056f74 100644 --- a/modules/helpers/pluginAnnotations/pom.xml +++ b/modules/helpers/pluginAnnotations/pom.xml @@ -6,7 +6,7 @@ <parent> <groupId>org.rhq.helpers</groupId> <artifactId>rhq-helpers</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq.helpers</groupId> diff --git a/modules/helpers/pluginGen/pom.xml b/modules/helpers/pluginGen/pom.xml index d992e29..28dc9b1 100644 --- a/modules/helpers/pluginGen/pom.xml +++ b/modules/helpers/pluginGen/pom.xml @@ -6,7 +6,7 @@ <parent> <groupId>org.rhq.helpers</groupId> <artifactId>rhq-helpers</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq.helpers</groupId> diff --git a/modules/helpers/pom.xml b/modules/helpers/pom.xml index c5e5ae2..a0721a9 100644 --- a/modules/helpers/pom.xml +++ b/modules/helpers/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq.helpers</groupId> diff --git a/modules/helpers/rtfilter/pom.xml b/modules/helpers/rtfilter/pom.xml index ffac476..5d327ee 100644 --- a/modules/helpers/rtfilter/pom.xml +++ b/modules/helpers/rtfilter/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq.helpers</groupId> <artifactId>rhq-helpers</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/aliases/pom.xml b/modules/plugins/aliases/pom.xml index c475e5e..c37598e 100644 --- a/modules/plugins/aliases/pom.xml +++ b/modules/plugins/aliases/pom.xml @@ -7,7 +7,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/ant-bundle/pom.xml b/modules/plugins/ant-bundle/pom.xml index 5fa4596..cc160c9 100644 --- a/modules/plugins/ant-bundle/pom.xml +++ b/modules/plugins/ant-bundle/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/apache/pom.xml b/modules/plugins/apache/pom.xml index 88db42f..700a6af 100644 --- a/modules/plugins/apache/pom.xml +++ b/modules/plugins/apache/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/augeas/pom.xml b/modules/plugins/augeas/pom.xml index 51580cd..915106a 100644 --- a/modules/plugins/augeas/pom.xml +++ b/modules/plugins/augeas/pom.xml @@ -7,7 +7,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/cobbler/pom.xml b/modules/plugins/cobbler/pom.xml index a140f5d..d920440 100644 --- a/modules/plugins/cobbler/pom.xml +++ b/modules/plugins/cobbler/pom.xml @@ -7,7 +7,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/cron/pom.xml b/modules/plugins/cron/pom.xml index 9119492..d5aaad5 100644 --- a/modules/plugins/cron/pom.xml +++ b/modules/plugins/cron/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/database/pom.xml b/modules/plugins/database/pom.xml index 714ad7a..30889f7 100644 --- a/modules/plugins/database/pom.xml +++ b/modules/plugins/database/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/filetemplate-bundle/pom.xml b/modules/plugins/filetemplate-bundle/pom.xml index e01b311..b79645d 100644 --- a/modules/plugins/filetemplate-bundle/pom.xml +++ b/modules/plugins/filetemplate-bundle/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/grub/pom.xml b/modules/plugins/grub/pom.xml index aef1858..f7cf265 100644 --- a/modules/plugins/grub/pom.xml +++ b/modules/plugins/grub/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/hibernate/pom.xml b/modules/plugins/hibernate/pom.xml index 4f87dfe..acb08ef 100644 --- a/modules/plugins/hibernate/pom.xml +++ b/modules/plugins/hibernate/pom.xml @@ -6,7 +6,7 @@ <groupId>org.rhq</groupId> <!-- Bypass the jopr-plugins-parent which can not have children. It must build after the plugins in order to execute integration tests on them. --> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.jboss.on</groupId> diff --git a/modules/plugins/hosts/pom.xml b/modules/plugins/hosts/pom.xml index 157119f..7dd0fde 100644 --- a/modules/plugins/hosts/pom.xml +++ b/modules/plugins/hosts/pom.xml @@ -7,7 +7,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/hudson/pom.xml b/modules/plugins/hudson/pom.xml index eed10bc..65fa7b8 100644 --- a/modules/plugins/hudson/pom.xml +++ b/modules/plugins/hudson/pom.xml @@ -6,7 +6,7 @@ <parent> <artifactId>rhq-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/iis/pom.xml b/modules/plugins/iis/pom.xml index 9a9c2f0..853c020 100644 --- a/modules/plugins/iis/pom.xml +++ b/modules/plugins/iis/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/jboss-as-5/pom.xml b/modules/plugins/jboss-as-5/pom.xml index befe74c..a0ade77 100644 --- a/modules/plugins/jboss-as-5/pom.xml +++ b/modules/plugins/jboss-as-5/pom.xml @@ -9,7 +9,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.jboss.on</groupId> diff --git a/modules/plugins/jboss-as/pom.xml b/modules/plugins/jboss-as/pom.xml index ac9b3f6..b9ed2b3 100644 --- a/modules/plugins/jboss-as/pom.xml +++ b/modules/plugins/jboss-as/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.jboss.on</groupId> diff --git a/modules/plugins/jboss-cache-v3/pom.xml b/modules/plugins/jboss-cache-v3/pom.xml index 61f4e11..b3846fa 100644 --- a/modules/plugins/jboss-cache-v3/pom.xml +++ b/modules/plugins/jboss-cache-v3/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.jboss.on</groupId> diff --git a/modules/plugins/jboss-cache/pom.xml b/modules/plugins/jboss-cache/pom.xml index 684e8e3..443e524 100644 --- a/modules/plugins/jboss-cache/pom.xml +++ b/modules/plugins/jboss-cache/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.jboss.on</groupId> diff --git a/modules/plugins/jmx/pom.xml b/modules/plugins/jmx/pom.xml index a9874cc..ac9885a 100644 --- a/modules/plugins/jmx/pom.xml +++ b/modules/plugins/jmx/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/mysql/pom.xml b/modules/plugins/mysql/pom.xml index 5a02364..d0c9053 100644 --- a/modules/plugins/mysql/pom.xml +++ b/modules/plugins/mysql/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/netservices/pom.xml b/modules/plugins/netservices/pom.xml index 3d937e7..06ae2ae 100644 --- a/modules/plugins/netservices/pom.xml +++ b/modules/plugins/netservices/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/oracle/pom.xml b/modules/plugins/oracle/pom.xml index e915511..1acdb0f 100644 --- a/modules/plugins/oracle/pom.xml +++ b/modules/plugins/oracle/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/perftest/pom.xml b/modules/plugins/perftest/pom.xml index f65ad5a..39c75da 100644 --- a/modules/plugins/perftest/pom.xml +++ b/modules/plugins/perftest/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/platform/pom.xml b/modules/plugins/platform/pom.xml index aadd8bf..97b83b0 100644 --- a/modules/plugins/platform/pom.xml +++ b/modules/plugins/platform/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/pom.xml b/modules/plugins/pom.xml index f32c52d..85d6105 100644 --- a/modules/plugins/pom.xml +++ b/modules/plugins/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/postfix/pom.xml b/modules/plugins/postfix/pom.xml index 639838b..283ab6a 100644 --- a/modules/plugins/postfix/pom.xml +++ b/modules/plugins/postfix/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/postgres/pom.xml b/modules/plugins/postgres/pom.xml index beb98f2..5a4466c 100644 --- a/modules/plugins/postgres/pom.xml +++ b/modules/plugins/postgres/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/rhq-agent/pom.xml b/modules/plugins/rhq-agent/pom.xml index fdb0991..a190dcd 100644 --- a/modules/plugins/rhq-agent/pom.xml +++ b/modules/plugins/rhq-agent/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/rhq-server/pom.xml b/modules/plugins/rhq-server/pom.xml index 8fb6fee..8f4e675 100644 --- a/modules/plugins/rhq-server/pom.xml +++ b/modules/plugins/rhq-server/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.jboss.on</groupId> diff --git a/modules/plugins/samba/pom.xml b/modules/plugins/samba/pom.xml index 9411143..0d41574 100644 --- a/modules/plugins/samba/pom.xml +++ b/modules/plugins/samba/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/script/pom.xml b/modules/plugins/script/pom.xml index 0ec4d51..7719b14 100644 --- a/modules/plugins/script/pom.xml +++ b/modules/plugins/script/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/snmptrapd/pom.xml b/modules/plugins/snmptrapd/pom.xml index f5106f0..2d9d715 100644 --- a/modules/plugins/snmptrapd/pom.xml +++ b/modules/plugins/snmptrapd/pom.xml @@ -2,7 +2,7 @@ <parent> <artifactId>rhq-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<modelVersion>4.0.0</modelVersion> diff --git a/modules/plugins/sshd/pom.xml b/modules/plugins/sshd/pom.xml index b637f0d..3579496 100644 --- a/modules/plugins/sshd/pom.xml +++ b/modules/plugins/sshd/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/sudoers/pom.xml b/modules/plugins/sudoers/pom.xml index 55c3b49..41df1b8 100644 --- a/modules/plugins/sudoers/pom.xml +++ b/modules/plugins/sudoers/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/tomcat/pom.xml b/modules/plugins/tomcat/pom.xml index 9de8802..205d5b0 100644 --- a/modules/plugins/tomcat/pom.xml +++ b/modules/plugins/tomcat/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.jboss.on</groupId> diff --git a/modules/plugins/twitter/pom.xml b/modules/plugins/twitter/pom.xml index 9ee6ac3..e299efa 100644 --- a/modules/plugins/twitter/pom.xml +++ b/modules/plugins/twitter/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/validate-all-plugins/pom.xml b/modules/plugins/validate-all-plugins/pom.xml index 93e847c..b3d5e87 100644 --- a/modules/plugins/validate-all-plugins/pom.xml +++ b/modules/plugins/validate-all-plugins/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/pom.xml b/modules/pom.xml index a6af192..bc96ae3 100644 --- a/modules/pom.xml +++ b/modules/pom.xml @@ -6,7 +6,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/test-utils/pom.xml b/modules/test-utils/pom.xml index 5b243a9..2235687 100644 --- a/modules/test-utils/pom.xml +++ b/modules/test-utils/pom.xml @@ -4,7 +4,7 @@ <parent> <artifactId>rhq-modules-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent> <artifactId>test-utils</artifactId> <name>RHQ Test Utils</name> diff --git a/pom.xml b/pom.xml index 5e2dc43..7ff85bb 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@
<groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> <packaging>pom</packaging>
<name>RHQ</name>
commit be9f9d2e64dcc8538188e8381abb706aa4daab9d Author: hudson auto wnstb@yahoo.com Date: Tue Jul 27 23:53:24 2010 -0400
[maven-release-plugin] prepare release RHQ_3_0_0_GA
diff --git a/modules/common/ant-bundle/pom.xml b/modules/common/ant-bundle/pom.xml index eda9133..97ef93b 100644 --- a/modules/common/ant-bundle/pom.xml +++ b/modules/common/ant-bundle/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-common-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/common/filetemplate-bundle/pom.xml b/modules/common/filetemplate-bundle/pom.xml index bc7965b..3b26a39 100644 --- a/modules/common/filetemplate-bundle/pom.xml +++ b/modules/common/filetemplate-bundle/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-common-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/common/jboss-as/pom.xml b/modules/common/jboss-as/pom.xml index 2cf950b..688d5e4 100644 --- a/modules/common/jboss-as/pom.xml +++ b/modules/common/jboss-as/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-common-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/common/pom.xml b/modules/common/pom.xml index ee81a94..2ddc4af 100644 --- a/modules/common/pom.xml +++ b/modules/common/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/client-api/pom.xml b/modules/core/client-api/pom.xml index d177f9e..a27161b 100644 --- a/modules/core/client-api/pom.xml +++ b/modules/core/client-api/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/comm-api/pom.xml b/modules/core/comm-api/pom.xml index a51f92b..4589d42 100644 --- a/modules/core/comm-api/pom.xml +++ b/modules/core/comm-api/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/dbutils/pom.xml b/modules/core/dbutils/pom.xml index 7ff6a10..d7559da 100644 --- a/modules/core/dbutils/pom.xml +++ b/modules/core/dbutils/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/domain/pom.xml b/modules/core/domain/pom.xml index e0ced84..dc75145 100644 --- a/modules/core/domain/pom.xml +++ b/modules/core/domain/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/gui/pom.xml b/modules/core/gui/pom.xml index 0911918..b535306 100644 --- a/modules/core/gui/pom.xml +++ b/modules/core/gui/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/native-system/pom.xml b/modules/core/native-system/pom.xml index d47d4c8..f72bc2f 100644 --- a/modules/core/native-system/pom.xml +++ b/modules/core/native-system/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/plugin-api/pom.xml b/modules/core/plugin-api/pom.xml index e1ce7ef..967b21a 100644 --- a/modules/core/plugin-api/pom.xml +++ b/modules/core/plugin-api/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/plugin-container/pom.xml b/modules/core/plugin-container/pom.xml index 2e58102..fbab223 100644 --- a/modules/core/plugin-container/pom.xml +++ b/modules/core/plugin-container/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/plugin-validator/pom.xml b/modules/core/plugin-validator/pom.xml index 7739177..996cd8f 100644 --- a/modules/core/plugin-validator/pom.xml +++ b/modules/core/plugin-validator/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/plugindoc/pom.xml b/modules/core/plugindoc/pom.xml index eeb7e81..8a95e51 100644 --- a/modules/core/plugindoc/pom.xml +++ b/modules/core/plugindoc/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/pom.xml b/modules/core/pom.xml index 7aad64c..b0c399b 100644 --- a/modules/core/pom.xml +++ b/modules/core/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/util/pom.xml b/modules/core/util/pom.xml index bc41dc5..37bcda5 100644 --- a/modules/core/util/pom.xml +++ b/modules/core/util/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/agent/pom.xml b/modules/enterprise/agent/pom.xml index d9f1c1c..3fc1344 100644 --- a/modules/enterprise/agent/pom.xml +++ b/modules/enterprise/agent/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/agentupdate/pom.xml b/modules/enterprise/agentupdate/pom.xml index 8942239..127b06f 100644 --- a/modules/enterprise/agentupdate/pom.xml +++ b/modules/enterprise/agentupdate/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/comm/pom.xml b/modules/enterprise/comm/pom.xml index 8b9da9c..9f09ff1 100644 --- a/modules/enterprise/comm/pom.xml +++ b/modules/enterprise/comm/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/base-perspective-jar/pom.xml b/modules/enterprise/gui/base-perspective-jar/pom.xml index 611eb9d..95b62cd 100644 --- a/modules/enterprise/gui/base-perspective-jar/pom.xml +++ b/modules/enterprise/gui/base-perspective-jar/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/base-perspective-war/pom.xml b/modules/enterprise/gui/base-perspective-war/pom.xml index 798a8ca..c1c297f 100644 --- a/modules/enterprise/gui/base-perspective-war/pom.xml +++ b/modules/enterprise/gui/base-perspective-war/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/content_http-war/pom.xml b/modules/enterprise/gui/content_http-war/pom.xml index df05645..6be8d8d 100644 --- a/modules/enterprise/gui/content_http-war/pom.xml +++ b/modules/enterprise/gui/content_http-war/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-gui-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/coregui/pom.xml b/modules/enterprise/gui/coregui/pom.xml index acbe21f..709bfe3 100644 --- a/modules/enterprise/gui/coregui/pom.xml +++ b/modules/enterprise/gui/coregui/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/installer-war/pom.xml b/modules/enterprise/gui/installer-war/pom.xml index 1beadca..8d33ef0 100644 --- a/modules/enterprise/gui/installer-war/pom.xml +++ b/modules/enterprise/gui/installer-war/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/pom.xml b/modules/enterprise/gui/pom.xml index 0c529ba..bf6a9a4 100644 --- a/modules/enterprise/gui/pom.xml +++ b/modules/enterprise/gui/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/portal-war/pom.xml b/modules/enterprise/gui/portal-war/pom.xml index a794cd6..d9f0c15 100644 --- a/modules/enterprise/gui/portal-war/pom.xml +++ b/modules/enterprise/gui/portal-war/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/webdav-war/pom.xml b/modules/enterprise/gui/webdav-war/pom.xml index aa880be..9bdfc91 100644 --- a/modules/enterprise/gui/webdav-war/pom.xml +++ b/modules/enterprise/gui/webdav-war/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/pom.xml b/modules/enterprise/pom.xml index 3b0dbb8..77a5685 100644 --- a/modules/enterprise/pom.xml +++ b/modules/enterprise/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/remoting/cli/pom.xml b/modules/enterprise/remoting/cli/pom.xml index 05187c7..dff57e7 100644 --- a/modules/enterprise/remoting/cli/pom.xml +++ b/modules/enterprise/remoting/cli/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<artifactId>rhq-remoting-cli</artifactId> diff --git a/modules/enterprise/remoting/client-api/pom.xml b/modules/enterprise/remoting/client-api/pom.xml index e86ef41..6008df1 100644 --- a/modules/enterprise/remoting/client-api/pom.xml +++ b/modules/enterprise/remoting/client-api/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<artifactId>rhq-remoting-client-api</artifactId> diff --git a/modules/enterprise/remoting/pom.xml b/modules/enterprise/remoting/pom.xml index 910b617..68d51c0 100644 --- a/modules/enterprise/remoting/pom.xml +++ b/modules/enterprise/remoting/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<artifactId>rhq-remoting-parent</artifactId> diff --git a/modules/enterprise/remoting/webservices/pom.xml b/modules/enterprise/remoting/webservices/pom.xml index 2ea73ee..444256d 100644 --- a/modules/enterprise/remoting/webservices/pom.xml +++ b/modules/enterprise/remoting/webservices/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<artifactId>rhq-remoting-webservices</artifactId> diff --git a/modules/enterprise/server/container-lib/pom.xml b/modules/enterprise/server/container-lib/pom.xml index 2c98817..f09e063 100644 --- a/modules/enterprise/server/container-lib/pom.xml +++ b/modules/enterprise/server/container-lib/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/container/pom.xml b/modules/enterprise/server/container/pom.xml index 3fd11e8..b4d2146 100644 --- a/modules/enterprise/server/container/pom.xml +++ b/modules/enterprise/server/container/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/ear/pom.xml b/modules/enterprise/server/ear/pom.xml index bf15866..c063211 100644 --- a/modules/enterprise/server/ear/pom.xml +++ b/modules/enterprise/server/ear/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/jar/pom.xml b/modules/enterprise/server/jar/pom.xml index 79fdc38..ddff575 100644 --- a/modules/enterprise/server/jar/pom.xml +++ b/modules/enterprise/server/jar/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/alert-email/pom.xml b/modules/enterprise/server/plugins/alert-email/pom.xml index dd5bc18..ea1eb7b 100644 --- a/modules/enterprise/server/plugins/alert-email/pom.xml +++ b/modules/enterprise/server/plugins/alert-email/pom.xml @@ -3,7 +3,7 @@ <parent> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent> <modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-irc/pom.xml b/modules/enterprise/server/plugins/alert-irc/pom.xml index c0973f3..363ac0a 100644 --- a/modules/enterprise/server/plugins/alert-irc/pom.xml +++ b/modules/enterprise/server/plugins/alert-irc/pom.xml @@ -3,7 +3,7 @@ <parent> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent> <modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-microblog/pom.xml b/modules/enterprise/server/plugins/alert-microblog/pom.xml index a62fee8..b4751ba 100644 --- a/modules/enterprise/server/plugins/alert-microblog/pom.xml +++ b/modules/enterprise/server/plugins/alert-microblog/pom.xml @@ -3,7 +3,7 @@ <parent> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent> <modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-mobicents/pom.xml b/modules/enterprise/server/plugins/alert-mobicents/pom.xml index 3193539..b0a0c3b 100644 --- a/modules/enterprise/server/plugins/alert-mobicents/pom.xml +++ b/modules/enterprise/server/plugins/alert-mobicents/pom.xml @@ -3,7 +3,7 @@ <parent> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent> <modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-operations/pom.xml b/modules/enterprise/server/plugins/alert-operations/pom.xml index e69bfbc..6d35aed 100644 --- a/modules/enterprise/server/plugins/alert-operations/pom.xml +++ b/modules/enterprise/server/plugins/alert-operations/pom.xml @@ -2,7 +2,7 @@ <parent> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent> <modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-roles/pom.xml b/modules/enterprise/server/plugins/alert-roles/pom.xml index ca33bb7..cbd7334 100644 --- a/modules/enterprise/server/plugins/alert-roles/pom.xml +++ b/modules/enterprise/server/plugins/alert-roles/pom.xml @@ -3,7 +3,7 @@ <parent> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent> <modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-snmp/pom.xml b/modules/enterprise/server/plugins/alert-snmp/pom.xml index af75153..6398092 100644 --- a/modules/enterprise/server/plugins/alert-snmp/pom.xml +++ b/modules/enterprise/server/plugins/alert-snmp/pom.xml @@ -3,7 +3,7 @@ <parent> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent> <modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-subject/pom.xml b/modules/enterprise/server/plugins/alert-subject/pom.xml index 09839b8..ebac52c 100644 --- a/modules/enterprise/server/plugins/alert-subject/pom.xml +++ b/modules/enterprise/server/plugins/alert-subject/pom.xml @@ -3,7 +3,7 @@ <parent> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent> <modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/ant-bundle/pom.xml b/modules/enterprise/server/plugins/ant-bundle/pom.xml index 73f405e..30efb5a 100644 --- a/modules/enterprise/server/plugins/ant-bundle/pom.xml +++ b/modules/enterprise/server/plugins/ant-bundle/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/cobbler/pom.xml b/modules/enterprise/server/plugins/cobbler/pom.xml index 4c44f10..8464662 100644 --- a/modules/enterprise/server/plugins/cobbler/pom.xml +++ b/modules/enterprise/server/plugins/cobbler/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<modelVersion>4.0.0</modelVersion> diff --git a/modules/enterprise/server/plugins/disk/pom.xml b/modules/enterprise/server/plugins/disk/pom.xml index 0033d1b..40ab2a2 100644 --- a/modules/enterprise/server/plugins/disk/pom.xml +++ b/modules/enterprise/server/plugins/disk/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml b/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml index 61965f2..0c5fb51 100644 --- a/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml +++ b/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/jboss-software/pom.xml b/modules/enterprise/server/plugins/jboss-software/pom.xml index 7451668..3f1e165 100644 --- a/modules/enterprise/server/plugins/jboss-software/pom.xml +++ b/modules/enterprise/server/plugins/jboss-software/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml b/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml index 0ac61d3..25917cc 100644 --- a/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml +++ b/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml @@ -7,7 +7,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/perspectives/core/pom.xml b/modules/enterprise/server/plugins/perspectives/core/pom.xml index 5a78451..40c066f 100644 --- a/modules/enterprise/server/plugins/perspectives/core/pom.xml +++ b/modules/enterprise/server/plugins/perspectives/core/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/pom.xml b/modules/enterprise/server/plugins/pom.xml index 2b16f4a..9832288 100644 --- a/modules/enterprise/server/plugins/pom.xml +++ b/modules/enterprise/server/plugins/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/rhnhosted/pom.xml b/modules/enterprise/server/plugins/rhnhosted/pom.xml index e4ab9b2..26e985a 100644 --- a/modules/enterprise/server/plugins/rhnhosted/pom.xml +++ b/modules/enterprise/server/plugins/rhnhosted/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/url/pom.xml b/modules/enterprise/server/plugins/url/pom.xml index a6cba32..14e52de 100644 --- a/modules/enterprise/server/plugins/url/pom.xml +++ b/modules/enterprise/server/plugins/url/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml b/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml index 9c7cc74..e160aa6 100644 --- a/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml +++ b/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/yum/pom.xml b/modules/enterprise/server/plugins/yum/pom.xml index ebdd3da..344a215 100644 --- a/modules/enterprise/server/plugins/yum/pom.xml +++ b/modules/enterprise/server/plugins/yum/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/safe-invoker/pom.xml b/modules/enterprise/server/safe-invoker/pom.xml index 06c8981..bb1abdd 100644 --- a/modules/enterprise/server/safe-invoker/pom.xml +++ b/modules/enterprise/server/safe-invoker/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/sars/agent-sar/pom.xml b/modules/enterprise/server/sars/agent-sar/pom.xml index aa278b8..2458369 100644 --- a/modules/enterprise/server/sars/agent-sar/pom.xml +++ b/modules/enterprise/server/sars/agent-sar/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-sars-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/sars/pom.xml b/modules/enterprise/server/sars/pom.xml index 0cc2084..4ac7f43 100644 --- a/modules/enterprise/server/sars/pom.xml +++ b/modules/enterprise/server/sars/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/xml-schemas/pom.xml b/modules/enterprise/server/xml-schemas/pom.xml index 14738d0..21ccc78 100644 --- a/modules/enterprise/server/xml-schemas/pom.xml +++ b/modules/enterprise/server/xml-schemas/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/helpers/pluginAnnotations/pom.xml b/modules/helpers/pluginAnnotations/pom.xml index d056f74..366d1aa 100644 --- a/modules/helpers/pluginAnnotations/pom.xml +++ b/modules/helpers/pluginAnnotations/pom.xml @@ -6,7 +6,7 @@ <parent> <groupId>org.rhq.helpers</groupId> <artifactId>rhq-helpers</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq.helpers</groupId> diff --git a/modules/helpers/pluginGen/pom.xml b/modules/helpers/pluginGen/pom.xml index 28dc9b1..d992e29 100644 --- a/modules/helpers/pluginGen/pom.xml +++ b/modules/helpers/pluginGen/pom.xml @@ -6,7 +6,7 @@ <parent> <groupId>org.rhq.helpers</groupId> <artifactId>rhq-helpers</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq.helpers</groupId> diff --git a/modules/helpers/pom.xml b/modules/helpers/pom.xml index a0721a9..c5e5ae2 100644 --- a/modules/helpers/pom.xml +++ b/modules/helpers/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq.helpers</groupId> diff --git a/modules/helpers/rtfilter/pom.xml b/modules/helpers/rtfilter/pom.xml index 5d327ee..ffac476 100644 --- a/modules/helpers/rtfilter/pom.xml +++ b/modules/helpers/rtfilter/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq.helpers</groupId> <artifactId>rhq-helpers</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/aliases/pom.xml b/modules/plugins/aliases/pom.xml index c37598e..c475e5e 100644 --- a/modules/plugins/aliases/pom.xml +++ b/modules/plugins/aliases/pom.xml @@ -7,7 +7,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/ant-bundle/pom.xml b/modules/plugins/ant-bundle/pom.xml index cc160c9..5fa4596 100644 --- a/modules/plugins/ant-bundle/pom.xml +++ b/modules/plugins/ant-bundle/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/apache/pom.xml b/modules/plugins/apache/pom.xml index 700a6af..88db42f 100644 --- a/modules/plugins/apache/pom.xml +++ b/modules/plugins/apache/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/augeas/pom.xml b/modules/plugins/augeas/pom.xml index 915106a..51580cd 100644 --- a/modules/plugins/augeas/pom.xml +++ b/modules/plugins/augeas/pom.xml @@ -7,7 +7,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/cobbler/pom.xml b/modules/plugins/cobbler/pom.xml index d920440..a140f5d 100644 --- a/modules/plugins/cobbler/pom.xml +++ b/modules/plugins/cobbler/pom.xml @@ -7,7 +7,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/cron/pom.xml b/modules/plugins/cron/pom.xml index d5aaad5..9119492 100644 --- a/modules/plugins/cron/pom.xml +++ b/modules/plugins/cron/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/database/pom.xml b/modules/plugins/database/pom.xml index 30889f7..714ad7a 100644 --- a/modules/plugins/database/pom.xml +++ b/modules/plugins/database/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/filetemplate-bundle/pom.xml b/modules/plugins/filetemplate-bundle/pom.xml index b79645d..e01b311 100644 --- a/modules/plugins/filetemplate-bundle/pom.xml +++ b/modules/plugins/filetemplate-bundle/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/grub/pom.xml b/modules/plugins/grub/pom.xml index f7cf265..aef1858 100644 --- a/modules/plugins/grub/pom.xml +++ b/modules/plugins/grub/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/hibernate/pom.xml b/modules/plugins/hibernate/pom.xml index acb08ef..4f87dfe 100644 --- a/modules/plugins/hibernate/pom.xml +++ b/modules/plugins/hibernate/pom.xml @@ -6,7 +6,7 @@ <groupId>org.rhq</groupId> <!-- Bypass the jopr-plugins-parent which can not have children. It must build after the plugins in order to execute integration tests on them. --> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.jboss.on</groupId> diff --git a/modules/plugins/hosts/pom.xml b/modules/plugins/hosts/pom.xml index 7dd0fde..157119f 100644 --- a/modules/plugins/hosts/pom.xml +++ b/modules/plugins/hosts/pom.xml @@ -7,7 +7,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/hudson/pom.xml b/modules/plugins/hudson/pom.xml index 65fa7b8..eed10bc 100644 --- a/modules/plugins/hudson/pom.xml +++ b/modules/plugins/hudson/pom.xml @@ -6,7 +6,7 @@ <parent> <artifactId>rhq-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/iis/pom.xml b/modules/plugins/iis/pom.xml index 853c020..9a9c2f0 100644 --- a/modules/plugins/iis/pom.xml +++ b/modules/plugins/iis/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/jboss-as-5/pom.xml b/modules/plugins/jboss-as-5/pom.xml index a0ade77..befe74c 100644 --- a/modules/plugins/jboss-as-5/pom.xml +++ b/modules/plugins/jboss-as-5/pom.xml @@ -9,7 +9,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.jboss.on</groupId> diff --git a/modules/plugins/jboss-as/pom.xml b/modules/plugins/jboss-as/pom.xml index b9ed2b3..ac9b3f6 100644 --- a/modules/plugins/jboss-as/pom.xml +++ b/modules/plugins/jboss-as/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.jboss.on</groupId> diff --git a/modules/plugins/jboss-cache-v3/pom.xml b/modules/plugins/jboss-cache-v3/pom.xml index b3846fa..61f4e11 100644 --- a/modules/plugins/jboss-cache-v3/pom.xml +++ b/modules/plugins/jboss-cache-v3/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.jboss.on</groupId> diff --git a/modules/plugins/jboss-cache/pom.xml b/modules/plugins/jboss-cache/pom.xml index 443e524..684e8e3 100644 --- a/modules/plugins/jboss-cache/pom.xml +++ b/modules/plugins/jboss-cache/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.jboss.on</groupId> diff --git a/modules/plugins/jmx/pom.xml b/modules/plugins/jmx/pom.xml index ac9885a..a9874cc 100644 --- a/modules/plugins/jmx/pom.xml +++ b/modules/plugins/jmx/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/mysql/pom.xml b/modules/plugins/mysql/pom.xml index d0c9053..5a02364 100644 --- a/modules/plugins/mysql/pom.xml +++ b/modules/plugins/mysql/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/netservices/pom.xml b/modules/plugins/netservices/pom.xml index 06ae2ae..3d937e7 100644 --- a/modules/plugins/netservices/pom.xml +++ b/modules/plugins/netservices/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/oracle/pom.xml b/modules/plugins/oracle/pom.xml index 1acdb0f..e915511 100644 --- a/modules/plugins/oracle/pom.xml +++ b/modules/plugins/oracle/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/perftest/pom.xml b/modules/plugins/perftest/pom.xml index 39c75da..f65ad5a 100644 --- a/modules/plugins/perftest/pom.xml +++ b/modules/plugins/perftest/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/platform/pom.xml b/modules/plugins/platform/pom.xml index 97b83b0..aadd8bf 100644 --- a/modules/plugins/platform/pom.xml +++ b/modules/plugins/platform/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/pom.xml b/modules/plugins/pom.xml index 85d6105..f32c52d 100644 --- a/modules/plugins/pom.xml +++ b/modules/plugins/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/postfix/pom.xml b/modules/plugins/postfix/pom.xml index 283ab6a..639838b 100644 --- a/modules/plugins/postfix/pom.xml +++ b/modules/plugins/postfix/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/postgres/pom.xml b/modules/plugins/postgres/pom.xml index 5a4466c..beb98f2 100644 --- a/modules/plugins/postgres/pom.xml +++ b/modules/plugins/postgres/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/rhq-agent/pom.xml b/modules/plugins/rhq-agent/pom.xml index a190dcd..fdb0991 100644 --- a/modules/plugins/rhq-agent/pom.xml +++ b/modules/plugins/rhq-agent/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/rhq-server/pom.xml b/modules/plugins/rhq-server/pom.xml index 8f4e675..8fb6fee 100644 --- a/modules/plugins/rhq-server/pom.xml +++ b/modules/plugins/rhq-server/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.jboss.on</groupId> diff --git a/modules/plugins/samba/pom.xml b/modules/plugins/samba/pom.xml index 0d41574..9411143 100644 --- a/modules/plugins/samba/pom.xml +++ b/modules/plugins/samba/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/script/pom.xml b/modules/plugins/script/pom.xml index 7719b14..0ec4d51 100644 --- a/modules/plugins/script/pom.xml +++ b/modules/plugins/script/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/snmptrapd/pom.xml b/modules/plugins/snmptrapd/pom.xml index 2d9d715..f5106f0 100644 --- a/modules/plugins/snmptrapd/pom.xml +++ b/modules/plugins/snmptrapd/pom.xml @@ -2,7 +2,7 @@ <parent> <artifactId>rhq-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<modelVersion>4.0.0</modelVersion> diff --git a/modules/plugins/sshd/pom.xml b/modules/plugins/sshd/pom.xml index 3579496..b637f0d 100644 --- a/modules/plugins/sshd/pom.xml +++ b/modules/plugins/sshd/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/sudoers/pom.xml b/modules/plugins/sudoers/pom.xml index 41df1b8..55c3b49 100644 --- a/modules/plugins/sudoers/pom.xml +++ b/modules/plugins/sudoers/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/tomcat/pom.xml b/modules/plugins/tomcat/pom.xml index 205d5b0..9de8802 100644 --- a/modules/plugins/tomcat/pom.xml +++ b/modules/plugins/tomcat/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.jboss.on</groupId> diff --git a/modules/plugins/twitter/pom.xml b/modules/plugins/twitter/pom.xml index e299efa..9ee6ac3 100644 --- a/modules/plugins/twitter/pom.xml +++ b/modules/plugins/twitter/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/validate-all-plugins/pom.xml b/modules/plugins/validate-all-plugins/pom.xml index b3d5e87..93e847c 100644 --- a/modules/plugins/validate-all-plugins/pom.xml +++ b/modules/plugins/validate-all-plugins/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/pom.xml b/modules/pom.xml index bc96ae3..a6af192 100644 --- a/modules/pom.xml +++ b/modules/pom.xml @@ -6,7 +6,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/test-utils/pom.xml b/modules/test-utils/pom.xml index 2235687..5b243a9 100644 --- a/modules/test-utils/pom.xml +++ b/modules/test-utils/pom.xml @@ -4,7 +4,7 @@ <parent> <artifactId>rhq-modules-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent> <artifactId>test-utils</artifactId> <name>RHQ Test Utils</name> diff --git a/pom.xml b/pom.xml index 7ff85bb..5e2dc43 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@
<groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> <packaging>pom</packaging>
<name>RHQ</name>
commit 5cb61cd55e617104661544da182e47d197fdf401 Author: Ian Springer ian.springer@redhat.com Date: Tue Jul 27 23:07:57 2010 -0400
fix so unsynced (invStatus!=COMMITED || id==0) Resources are not included in avail reports sent by the PC (fixes half of https://bugzilla.redhat.com/show_bug.cgi?id=618879)
diff --git a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/AvailabilityExecutor.java b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/AvailabilityExecutor.java index d916bbc..04e1fb3 100644 --- a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/AvailabilityExecutor.java +++ b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/AvailabilityExecutor.java @@ -1,6 +1,6 @@ /* * RHQ Management Platform - * Copyright (C) 2005-2008 Red Hat, Inc. + * Copyright (C) 2005-2010 Red Hat, Inc. * All rights reserved. * * This program is free software; you can redistribute it and/or modify @@ -48,7 +48,8 @@ import org.rhq.core.pluginapi.availability.AvailabilityFacet; * Runs a periodic scan for resource availability. * * @author Greg Hinkle - * @author John Mazzitelli + * @author John Mazzitelli + * @author Ian Springer */ public class AvailabilityExecutor implements Runnable, Callable<AvailabilityReport> { // the get-availability-timeout will rarely, if ever, want to be overridden. It will default to be 5 seconds @@ -94,15 +95,15 @@ public class AvailabilityExecutor implements Runnable, Callable<AvailabilityRepo }
/** - * Returns the availability report that should be sent to the server. + * Returns the availability report that should be sent to the Server. * * <p>This will return <code>null</code> if there is no committed inventory and thus no availability reports should * be sent. This will rarely happen - only if this is a brand new agent whose inventory hasn't been committed yet or * if the platform and all its children have been deleted (in which case the agent should be uninstalled or the user * will want to re-import the platform). In either case, it will be in rare, corner cases that this will ever return - * null and the condition that caused the null should eventually go away.</p> + * null, and the condition that caused the null should eventually go away.</p> * - * @return the report containing all the availabilities that need to be sent to the server + * @return the report containing all the availabilities that need to be sent to the Server * * @throws Exception if failed to create and prepare the report */ @@ -122,13 +123,13 @@ public class AvailabilityExecutor implements Runnable, Callable<AvailabilityRepo long start = System.currentTimeMillis();
checkInventory(inventoryManager.getPlatform(), availabilityReport, - availabilityReport.isChangesOnlyReport(), true); + availabilityReport.isChangesOnlyReport(), true, false);
// In enterprise mode, the server will need at least one resource so it can derive what agent // is sending this report. If the report is empty (meaning, nothing has changed since the last // availability check), let's add the platform record to the report - if (availabilityReport.getResourceAvailability().size() == 0) { - checkInventory(inventoryManager.getPlatform(), availabilityReport, false, false); + if (availabilityReport.getResourceAvailability().isEmpty()) { + checkInventory(inventoryManager.getPlatform(), availabilityReport, false, false, false); }
// if we have non-platform resources in the report, the agent has had @@ -152,103 +153,91 @@ public class AvailabilityExecutor implements Runnable, Callable<AvailabilityRepo }
private void checkInventory(Resource resource, AvailabilityReport availabilityReport, boolean reportChangesOnly, - boolean checkChildren) { + boolean checkChildren, boolean parentIsDown) { + // Only report avail for committed Resources - that's all the Server cares about. + if (resource.getInventoryStatus() != InventoryStatus.COMMITTED) { + return; + } ResourceContainer resourceContainer = this.inventoryManager.getResourceContainer(resource); - AvailabilityFacet resourceComponent = null; - if (resourceContainer != null && resource.getInventoryStatus() == InventoryStatus.COMMITTED) { - try { - resourceComponent = resourceContainer.createResourceComponentProxy(AvailabilityFacet.class, - FacetLockType.NONE, GET_AVAILABILITY_TIMEOUT, true, false); - } catch (PluginContainerException e) { - if (log.isDebugEnabled()) { - log.debug("Could not create resource component proxy for " + resource + " due to " + e); - } + // Only report avail for synchronized Resources, otherwise chances are the Server will know nothing of the + // Resource. + if (resourceContainer == null || + resourceContainer.getSynchronizationState() != ResourceContainer.SynchronizationState.SYNCHRONIZED) { + return; + } + AvailabilityFacet resourceComponent; + try { + resourceComponent = resourceContainer.createResourceComponentProxy(AvailabilityFacet.class, + FacetLockType.NONE, GET_AVAILABILITY_TIMEOUT, true, false); + } catch (PluginContainerException e) { + // TODO (ips): Why aren't we logging this as an error? + if (log.isDebugEnabled()) { + log.debug("Could not create resource component proxy for " + resource + ".", e); } + return; }
- if (resourceComponent != null) { - AvailabilityType current = null; - - // Only report availability for committed resources; don't bother with new, ignored or deleted resources. - if (resource.getInventoryStatus() == InventoryStatus.COMMITTED) { + AvailabilityType current = null;
- // this is what we think the availability is, based on a previous check - Availability previous = this.inventoryManager.getAvailabilityIfKnown(resource); + // Find out what the avail was the last time we checked it. + Availability previous = this.inventoryManager.getAvailabilityIfKnown(resource);
- try { - // if the component is started, ask what its current availability is as of right now - // if its not started, then assume its down, our next time checking we'll see if its - // started and check for real then - otherwise, keep assuming its down (this is for - // the case when a plugin component can't start for whatever reason or is just slow - // to start) + if (parentIsDown) { + // If the resource's parent is down, the rules are that the resource and all of the parent's other + // descendants, must also be down, so there's no need to even ask the resource component for its + // current availability - its current avail is DOWN and that's that. + current = AvailabilityType.DOWN; + } else { + try { + // if the component is started, ask what its current availability is as of right now; + // if it's not started, then assume it's down, and the next time we check, + // we'll see if it's started and check for real then - otherwise, keep assuming it's + // down (this is for the case when a plugin component can't start for whatever reason + // or is just slow to start) + if (resourceContainer.getResourceComponentState() == ResourceComponentState.STARTED) { + current = resourceComponent.getAvailability(); + } else { + this.inventoryManager.activateResource(resource, resourceContainer, false); if (resourceContainer.getResourceComponentState() == ResourceComponentState.STARTED) { current = resourceComponent.getAvailability(); - } else { - this.inventoryManager.activateResource(resource, resourceContainer, false); - if (resourceContainer.getResourceComponentState() == ResourceComponentState.STARTED) { - current = resourceComponent.getAvailability(); - } } - } catch (Throwable t) { - ResourceError resourceError = new ResourceError(resource, ResourceErrorType.AVAILABILITY_CHECK, t, - System.currentTimeMillis()); - this.inventoryManager.sendResourceErrorToServer(resourceError); - // TODO GH: Put errors in report, rather than sending them to the Server separately. - if (log.isDebugEnabled()) { - if (t instanceof TimeoutException) - // no need to log the stack trace for timeouts... - log.debug("Failed to collect availability on resource " + resource + " (call timed out)"); - else - log.debug("Failed to collect availability on resource " + resource, t); - } - } - - if (current == null) { - current = AvailabilityType.DOWN; } - - if (resourceContainer.getSynchronizationState() == ResourceContainer.SynchronizationState.SYNCHRONIZED) { - Availability availability = this.inventoryManager.updateAvailability(resource, current); - - // only add the availability to the report if it changed from its previous state - // if this is the first time we've been executed, reportChangesOnly will be false - // and we will send a full report as our very first report - if ((previous == null) || (previous.getAvailabilityType() != current) || !reportChangesOnly) { - availabilityReport.addAvailability(availability); + } catch (Throwable t) { + ResourceError resourceError = new ResourceError(resource, ResourceErrorType.AVAILABILITY_CHECK, t, + System.currentTimeMillis()); + this.inventoryManager.sendResourceErrorToServer(resourceError); + // TODO GH: Put errors in report, rather than sending them to the Server separately. + if (log.isDebugEnabled()) { + if (t instanceof TimeoutException) { + // no need to log the stack trace for timeouts... + log.debug("Failed to collect availability on " + resource + " (call timed out)"); + } else { + log.debug("Failed to collect availability on " + resource, t); } } } - - if (checkChildren) { - // Wrap in a fresh HashSet to avoid ConcurrentModificationExceptions. - Set<Resource> children = new HashSet<Resource>(resource.getChildResources()); - if (current == AvailabilityType.UP) { - for (Resource child : children) - checkInventory(child, availabilityReport, reportChangesOnly, true); - } else { - for (Resource child : children) - markDown(child, availabilityReport, reportChangesOnly); - } + if (current == null) { + current = AvailabilityType.DOWN; } }
- return; - } - - /** - * Marks the specified Resource and all its descendants as DOWN for the report. - */ - private void markDown(Resource resource, AvailabilityReport availabilityReport, boolean changesOnly) { - Availability previous = this.inventoryManager.getAvailabilityIfKnown(resource); - if (!changesOnly || previous == null || previous.getAvailabilityType() != AvailabilityType.DOWN) { - Availability availability = this.inventoryManager.updateAvailability(resource, AvailabilityType.DOWN); + // Only add the availability to the report if it changed from its previous state. + // If this is the first time we've been executed, reportChangesOnly will be false, + // and we will send a full report as our very first report. + if ((previous == null) || (previous.getAvailabilityType() != current) || !reportChangesOnly) { + Availability availability = this.inventoryManager.updateAvailability(resource, current); availabilityReport.addAvailability(availability); } - // Wrap in a fresh HashSet to avoid ConcurrentModificationExceptions. - Set<Resource> children = new HashSet(resource.getChildResources()); - for (Resource child : children) { - markDown(child, availabilityReport, changesOnly); + + if (checkChildren) { + // Wrap in a fresh HashSet to avoid ConcurrentModificationExceptions. + Set<Resource> children = new HashSet<Resource>(resource.getChildResources()); + for (Resource child : children) { + checkInventory(child, availabilityReport, reportChangesOnly, true, current == AvailabilityType.DOWN); + } } + + return; }
/** @@ -267,4 +256,4 @@ public class AvailabilityExecutor implements Runnable, Callable<AvailabilityRepo void sendChangedOnlyReportNextTime() { this.sendChangedOnlyReport.set(true); } -} \ No newline at end of file +} diff --git a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/ResourceContainer.java b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/ResourceContainer.java index 3d27295..ab8d30e 100644 --- a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/ResourceContainer.java +++ b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/ResourceContainer.java @@ -299,7 +299,7 @@ public class ResourceContainer implements Serializable { * @param daemonThread whether or not the thread used for the invocation should be a daemon thread * @param onlyIfStarted if <code>true</code>, and the component is not started, an exception is thrown * - * @return a proxy that wraps the given component and exposes the given facet interface + * @return a proxy that wraps the given component and exposes the given facet interface; will never be null * * @throws PluginContainerException if the component does not exist or does not implement the interface */
commit 50a583202459274a2f846b85402047506d6f6d84 Merge: ebe40d2... 35851a1... Author: John Sanda jsanda@redhat.com Date: Tue Jul 27 21:48:55 2010 -0400
Merge branch 'master' of ssh://git.fedorahosted.org/git/rhq/rhq
commit ebe40d281993c044317e9004bf1019e485b2611c Author: John Sanda jsanda@redhat.com Date: Tue Jul 27 21:46:56 2010 -0400
[BZ 573034] Updating script so that it works with JON 2.3.1 as well as 2.4.0
diff --git a/etc/cli-scripts/reset_conn_props.js b/etc/cli-scripts/reset_conn_props.js index 95997f2..bb2ac46 100644 --- a/etc/cli-scripts/reset_conn_props.js +++ b/etc/cli-scripts/reset_conn_props.js @@ -55,7 +55,9 @@ function findResourcesByTypeAndPlugin(resourceType, plugin) { var criteria = ResourceCriteria(); criteria.addFilterResourceTypeName(resourceType); criteria.addFilterPluginName(plugin); + criteria.fetchResourceType(true); criteria.fetchPluginConfiguration(true); + criteria.caseSensitive = true; criteria.strict = true;
var resources = ResourceManager.findResourcesByCriteria(criteria);
commit 35851a130156c4cf4bc27dbeda54bb94bc5db450 Author: Joseph Marques joseph@redhat.com Date: Tue Jul 27 21:10:46 2010 -0400
use more reasonable gwt:compile memory defaults, parameterize localWorkers
diff --git a/modules/enterprise/gui/coregui/pom.xml b/modules/enterprise/gui/coregui/pom.xml index 82cddb6..ce9dfca 100644 --- a/modules/enterprise/gui/coregui/pom.xml +++ b/modules/enterprise/gui/coregui/pom.xml @@ -27,7 +27,8 @@
<!-- If this is too much memory to allocate to your gwt:debug process then override this property in in your settings.xml --> - <gwt-plugin.extraJvmArgs>-Xms1024M -Xmx1024M -XX:PermSize=256M -XX:MaxPermSize=256M</gwt-plugin.extraJvmArgs> + <gwt-plugin.extraJvmArgs>-Xms512M -Xmx512M</gwt-plugin.extraJvmArgs> + <gwt-plugin.localWorkers>2</gwt-plugin.localWorkers> </properties>
@@ -235,7 +236,7 @@ <logLevel>INFO</logLevel> <runTarget>http://localhost:7080/coregui/CoreGUI.html</runTarget> <extraJvmArgs>${gwt-plugin.extraJvmArgs}</extraJvmArgs> - <localWorkers>2</localWorkers> + <localWorkers>${gwt-plugin.localWorkers}</localWorkers> <draftCompile>true</draftCompile> <buildOutputDirectory>target/gwtclasses</buildOutputDirectory> <hostedWebapp>target/hostedwar</hostedWebapp>
commit ea96f7924e7f43768ec7a267e3535f2322d9bfc8 Author: Joseph Marques joseph@redhat.com Date: Tue Jul 27 21:06:58 2010 -0400
fix compile error
* add method recently exposed in RoleManagerRemote to fix compile error for WebservicesManagerBean missing interface method implementation
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/webservices/WebservicesManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/webservices/WebservicesManagerBean.java index 1fd9720..c188ffe 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/webservices/WebservicesManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/webservices/WebservicesManagerBean.java @@ -162,7 +162,7 @@ import org.rhq.enterprise.server.util.LookupUtil; */ @Stateless @WebService(endpointInterface = "org.rhq.enterprise.server.webservices.WebservicesRemote", targetNamespace = ServerVersion.namespace) -@XmlSeeAlso( { PropertyDefinition.class, PropertyDefinitionSimple.class, PropertyDefinitionList.class, +@XmlSeeAlso({ PropertyDefinition.class, PropertyDefinitionSimple.class, PropertyDefinitionList.class, PropertyDefinitionMap.class }) public class WebservicesManagerBean implements WebservicesRemote {
@@ -903,6 +903,10 @@ public class WebservicesManagerBean implements WebservicesRemote { roleManager.addSubjectsToRole(subject, roleId, subjectIds); }
+ public void setAssignedSubjectRoles(Subject subject, int subjectId, int[] roleIds) { + roleManager.setAssignedSubjectRoles(subject, subjectId, roleIds); + } + public PageList<Role> findRolesByCriteria(Subject subject, RoleCriteria criteria) { checkParametersPassedIn(subject, criteria); return roleManager.findRolesByCriteria(subject, criteria);
commit cefdf1fd4ad51e29b46587a1cf1fe4dde203852a Author: Joseph Marques joseph@redhat.com Date: Tue Jul 27 21:08:41 2010 -0400
support printing alert condition details for all types of alert definitions
diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/common/monitor/alerts/AlertDefUtil.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/common/monitor/alerts/AlertDefUtil.java index 08551fa..727577e 100644 --- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/common/monitor/alerts/AlertDefUtil.java +++ b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/common/monitor/alerts/AlertDefUtil.java @@ -92,7 +92,17 @@ public final class AlertDefUtil { // first format the LHS of the operator if (category == AlertConditionCategory.CONTROL) { try { - Integer resourceTypeId = cond.getAlertDefinition().getResource().getResourceType().getId(); + AlertDefinitionManagerLocal alertDefinitionManager = LookupUtil.getAlertDefinitionManager(); + Integer alertDefinitionId = cond.getAlertDefinition().getId(); + Integer resourceTypeId = null; + if (alertDefinitionManager.isTemplate(alertDefinitionId)) { + resourceTypeId = cond.getAlertDefinition().getResourceType().getId(); + } else if (alertDefinitionManager.isGroupAlertDefinition(alertDefinitionId)) { + resourceTypeId = cond.getAlertDefinition().getResourceGroup().getResourceType().getId(); + } else { + resourceTypeId = cond.getAlertDefinition().getResource().getResourceType().getId(); + } + String operationName = cond.getName(); OperationManagerLocal operationManager = LookupUtil.getOperationManager();
@@ -110,7 +120,7 @@ public final class AlertDefUtil { textValue.append(cond.getMeasurementDefinition().getDisplayName()); textValue.append(" ("); textValue.append(cond.getOption()); - if (cond.getName()!=null && !cond.getName().equals("")) { + if (cond.getName() != null && !cond.getName().equals("")) { textValue.append("; pattern=["); textValue.append(cond.getName()); textValue.append("]");
commit 38ed2d28ea96e45434c772c15ed6addd0d947c1a Author: Greg Hinkle ghinkle@redhat.com Date: Tue Jul 27 20:20:51 2010 -0400
Fix inventory views for updated ResourceDatasource criterias
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/InventoryView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/InventoryView.java index 8852dfc..c76ff1c 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/InventoryView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/InventoryView.java @@ -32,7 +32,9 @@ import com.smartgwt.client.widgets.tree.Tree; import com.smartgwt.client.widgets.tree.TreeGrid; import com.smartgwt.client.widgets.tree.TreeNode;
+import org.rhq.core.domain.measurement.AvailabilityType; import org.rhq.core.domain.resource.Resource; +import org.rhq.core.domain.resource.ResourceCategory; import org.rhq.enterprise.gui.coregui.client.BookmarkableView; import org.rhq.enterprise.gui.coregui.client.CoreGUI; import org.rhq.enterprise.gui.coregui.client.ViewId; @@ -115,13 +117,13 @@ public class InventoryView extends HLayout implements BookmarkableView { if (selectionEvent.getRecord() == allResources) { setContent(new ResourceSearchView()); } else if (selectionEvent.getRecord() == onlyPlatforms) { - setContent(new ResourceSearchView(new Criteria("category", "platform"))); + setContent(new ResourceSearchView(new Criteria(ResourceDataSourceField.CATEGORY.propertyName(), ResourceCategory.PLATFORM.name()))); } else if (selectionEvent.getRecord() == onlyServers) { - setContent(new ResourceSearchView(new Criteria("category", "server"))); + setContent(new ResourceSearchView(new Criteria(ResourceDataSourceField.CATEGORY.propertyName(), ResourceCategory.SERVER.name()))); } else if (selectionEvent.getRecord() == onlyServices) { - setContent(new ResourceSearchView(new Criteria("category", "service"))); + setContent(new ResourceSearchView(new Criteria(ResourceDataSourceField.CATEGORY.propertyName(), ResourceCategory.SERVICE.name()))); } else if (selectionEvent.getRecord() == downServers) { - setContent(new ResourceSearchView(new Criteria("availability", "down"))); + setContent(new ResourceSearchView(new Criteria(ResourceDataSourceField.AVAILABILITY.propertyName(), AvailabilityType.DOWN.name()))); }
}
commit 8f98335a235c3a8f819d1a3d3a4d72d9ade052a3 Merge: 56081bb... 1fa4fa8... Author: Filip Drabek fdrabek@dhcp-lab-136.englab.brq.redhat.com Date: Tue Jul 27 23:34:05 2010 +0200
Merge branch 'release-3.0.0' of ssh://git.fedorahosted.org/git/rhq/rhq into release-3.0.0
commit 56081bbf57ddb82a7796ac33f5db80a4ed014d20 Author: Filip Drabek fdrabek@dhcp-lab-136.englab.brq.redhat.com Date: Tue Jul 27 23:30:01 2010 +0200
BZ-618230 - absolute path in apache configuration file, breaks discovery.
diff --git a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/parser/ApacheParserImpl.java b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/parser/ApacheParserImpl.java index e54b642..f33f8fd 100644 --- a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/parser/ApacheParserImpl.java +++ b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/parser/ApacheParserImpl.java @@ -42,17 +42,9 @@ public class ApacheParserImpl implements ApacheParser{ }
private List<File> getIncludeFiles(String foundInclude) { - List<File> ret = new ArrayList<File>(); - File serverRootFile = new File(serverRootPath); - File check = new File(foundInclude); - if (check.isAbsolute()) { - ret.add(check); - } else { - for (File f : Glob.match(serverRootFile, foundInclude)) { - ret.add(f); - } - } - - return ret; + File check = new File(foundInclude); + File root = new File(check.isAbsolute() ? Glob.rootPortion(foundInclude) : serverRootPath); + + return Glob.match(root, foundInclude); } } diff --git a/modules/plugins/augeas/src/main/java/org/rhq/augeas/util/Glob.java b/modules/plugins/augeas/src/main/java/org/rhq/augeas/util/Glob.java index 94aea0a..fddf06e 100644 --- a/modules/plugins/augeas/src/main/java/org/rhq/augeas/util/Glob.java +++ b/modules/plugins/augeas/src/main/java/org/rhq/augeas/util/Glob.java @@ -28,6 +28,8 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.Iterator; import java.util.List; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory;
/** * A helper class for easy work with glob patterns. @@ -36,6 +38,8 @@ import java.util.List; */ public class Glob {
+ private static final Log log = LogFactory.getLog(Glob.class); + private Glob() {
} @@ -169,12 +173,17 @@ public class Glob { } }
- private static String rootPortion(String path) { - for (File root : File.listRoots()) { - if (path.startsWith(root.getPath())) { - return root.getPath(); + public static String rootPortion(String path) { + File[] roots = File.listRoots(); + if (roots != null) { + for (File root : roots) { + if (path.startsWith(root.getPath())) { + return root.getPath(); + } } - } + } else { + log.warn("Could not determine file system roots. This is strange."); + }
return ""; }
commit 054ce11b07031a30a00afb04316b4ee5065b6b43 Merge: 6e303ec... 4c30f50... Author: Greg Hinkle ghinkle@redhat.com Date: Tue Jul 27 17:08:30 2010 -0400
Merge branch 'master' of ssh://git.fedorahosted.org/git/rhq/rhq
Conflicts: modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/menu/MenuBarView.java
diff --cc modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java index a8bd44a,396aa0e..a902bc5 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java @@@ -279,11 -255,8 +255,10 @@@ public class ResourceGroupDetailView ex } }
- public void renderView(ViewPath viewPath) { - // TODO: Implement this method. + + Integer groupId = Integer.parseInt(viewPath.getCurrent().getPath()); +
if (viewPath.isEnd()) { // default
commit 6e303ec5c6fa7916b9e83d88f6a7c9e3f6c0b8d0 Author: Greg Hinkle ghinkle@redhat.com Date: Tue Jul 27 16:57:24 2010 -0400
Missing cloud png, report top view cleanup
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/ReportTopView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/ReportTopView.java index 8024902..a842474 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/ReportTopView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/ReportTopView.java @@ -89,8 +89,8 @@ public class ReportTopView extends HLayout implements BookmarkableView {
treeGrids.put("Inventory", buildInventorySection()); - treeGrids.put("Configuration", buildSystemConfigurationSection()); - treeGrids.put("Cluster", buildManagementClusterSection()); +// treeGrids.put("Configuration", buildSystemConfigurationSection()); +// treeGrids.put("Cluster", buildManagementClusterSection()); treeGrids.put("Reports", buildReportsSection());
diff --git a/modules/enterprise/gui/coregui/src/main/webapp/images/global/Cloud_24.png b/modules/enterprise/gui/coregui/src/main/webapp/images/global/Cloud_24.png new file mode 100644 index 0000000..a147dde Binary files /dev/null and b/modules/enterprise/gui/coregui/src/main/webapp/images/global/Cloud_24.png differ
commit 1fa4fa83c8c3a805a04ca35c2c9586e4675bd903 Author: Joseph Marques joseph@redhat.com Date: Tue Jul 27 15:28:50 2010 -0400
BZ-616656: BZ-601189: fix searching and pagination on IE6
For IE6, revert back to a standard h:inputText element instead of the new SearchBar (thus, IE6 will not support search suggestions or saved searches). This eliminates the javascript error bubbling up from the SmartGWT library, which prevents further interaction on the page from succeeding (clicking the go button as well as pagination).
diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/common/tag/FunctionTagLibrary.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/common/tag/FunctionTagLibrary.java index 67b654f..7a5a8d5 100644 --- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/common/tag/FunctionTagLibrary.java +++ b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/common/tag/FunctionTagLibrary.java @@ -27,6 +27,8 @@ import java.util.List; import java.util.Map; import java.util.Set;
+import javax.servlet.http.HttpServletRequest; + import com.sun.facelets.tag.AbstractTagLibrary;
import org.rhq.core.clientapi.util.units.DateFormatter; @@ -443,4 +445,10 @@ public class FunctionTagLibrary extends AbstractTagLibrary { AlertSender sender = alertSenderPluginManager.getAlertSenderForNotification(alertNotification); return sender.previewConfiguration(); } + + public static boolean isIE6() { + HttpServletRequest request = FacesContextUtility.getRequest(); + String userAgent = request.getHeader("User-Agent").toLowerCase(); + return (userAgent.indexOf("msie") != -1 && userAgent.indexOf("6.0") != -1); + } } \ No newline at end of file diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseGroups.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseGroups.xhtml index 3683968..52245bf 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseGroups.xhtml +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseGroups.xhtml @@ -41,6 +41,8 @@ <p/> <h:panelGrid columns="3"> <h:outputText value="Search: " /> + + <c:if test="#{!onf:isIE6()}"> <ui:include src="/rhq/common/searchInterface.xhtml"> <ui:param name="searchButtonId" value="browseGroupsForm:searchButtonJSF" /> <ui:param name="searchSubsystem" value="GROUP" /> @@ -48,7 +50,6 @@ <ui:param name="defaultSavedSearchPatternId" value="#{param.searchId}" /> <ui:param name="subtab" value="${param.subtab}" /> </ui:include> - <a4j:commandButton id="searchButtonJSF" value="GO" reRender="browseGroupsDataTable, browseGroupsDataTableScroller, inventoryBrowserErrorPanel" status="commonStatus" @@ -60,6 +61,22 @@ onclick="applySearchFilter(getElementCrossBrowser('patternField').value);"> <s:defaultAction/> </a4j:commandButton> + </c:if> + + <c:if test="#{onf:isIE6()}"> + <h:inputText style="width: 800px; min-width: 800px;" value="#{BrowseGroupsUIBean.search}"/> + <a4j:commandButton id="searchButtonJSF" value="GO" + reRender="browseGroupsDataTable, browseGroupsDataTableScroller, inventoryBrowserErrorPanel" + status="commonStatus" + actionListener="#{BrowseGroupsUIBean.clearDataModel}" + styleClass="buttonmed" + similarityGroupingId="searchRequest" + requestDelay="50" + ignoreDupResponses="true"> + <s:defaultAction/> + </a4j:commandButton> + </c:if> + </h:panelGrid> <p/>
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseResources.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseResources.xhtml index c7f43c7..dacc5cb 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseResources.xhtml +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseResources.xhtml @@ -41,6 +41,8 @@ <p/> <h:panelGrid columns="3"> <h:outputText value="Search: " /> + + <c:if test="#{!onf:isIE6()}"> <ui:include src="/rhq/common/searchInterface.xhtml"> <ui:param name="searchButtonId" value="browseResourcesForm:searchButtonJSF" /> <ui:param name="searchSubsystem" value="RESOURCE" /> @@ -48,7 +50,6 @@ <ui:param name="defaultSavedSearchPatternId" value="#{param.searchId}" /> <ui:param name="subtab" value="${param.subtab}" /> </ui:include> - <a4j:commandButton id="searchButtonJSF" value="GO" reRender="browseResourcesDataTable, browseResourcesDataTableScroller, inventoryBrowserErrorPanel" status="commonStatus" @@ -60,6 +61,22 @@ onclick="applySearchFilter(getElementCrossBrowser('patternField').value);"> <s:defaultAction/> </a4j:commandButton> + </c:if> + + <c:if test="#{onf:isIE6()}"> + <h:inputText style="width: 800px; min-width: 800px;" value="#{BrowseResourcesUIBean.search}"/> + <a4j:commandButton id="searchButtonJSF" value="GO" + reRender="browseResourcesDataTable, browseResourcesDataTableScroller, inventoryBrowserErrorPanel" + status="commonStatus" + actionListener="#{BrowseResourcesUIBean.clearDataModel}" + styleClass="buttonmed" + similarityGroupingId="searchRequest" + requestDelay="50" + ignoreDupResponses="true"> + <s:defaultAction/> + </a4j:commandButton> + </c:if> + </h:panelGrid> <p/>
commit fb02185b1a48ad560a5dfd9c20ca1415a6d64e62 Author: Greg Hinkle ghinkle@redhat.com Date: Tue Jul 27 13:13:48 2010 -0400
Add missing tagcloud icon
diff --git a/modules/enterprise/gui/coregui/src/main/webapp/images/global/Cloud_16.png b/modules/enterprise/gui/coregui/src/main/webapp/images/global/Cloud_16.png new file mode 100644 index 0000000..e64577c Binary files /dev/null and b/modules/enterprise/gui/coregui/src/main/webapp/images/global/Cloud_16.png differ
commit 2ef1d6aba1a5ebd549293d0d74f7edea84c862f6 Author: Greg Hinkle ghinkle@redhat.com Date: Tue Jul 27 13:12:57 2010 -0400
Some performance tests on the resource tree (Attempts to precache the entire tree)
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/NewResourceTreeDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/NewResourceTreeDataSource.java new file mode 100644 index 0000000..939c519 --- /dev/null +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/NewResourceTreeDataSource.java @@ -0,0 +1,360 @@ +/* + * RHQ Management Platform + * Copyright (C) 2005-2010 Red Hat, Inc. + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License, version 2, as + * published by the Free Software Foundation, and/or the GNU Lesser + * General Public License, version 2.1, also as published by the Free + * Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License and the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License + * and the GNU Lesser General Public License along with this program; + * if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +package org.rhq.enterprise.gui.coregui.client.inventory.resource.detail; + +import java.util.ArrayList; +import java.util.EnumSet; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gwt.user.client.rpc.AsyncCallback; +import com.smartgwt.client.data.DSRequest; +import com.smartgwt.client.data.DSResponse; +import com.smartgwt.client.data.DataSource; +import com.smartgwt.client.data.DataSourceField; +import com.smartgwt.client.data.fields.DataSourceImageField; +import com.smartgwt.client.data.fields.DataSourceTextField; +import com.smartgwt.client.rpc.RPCResponse; +import com.smartgwt.client.types.DSDataFormat; +import com.smartgwt.client.types.DSProtocol; +import com.smartgwt.client.widgets.tree.TreeNode; + +import org.rhq.core.domain.criteria.ResourceCriteria; +import org.rhq.core.domain.measurement.AvailabilityType; +import org.rhq.core.domain.resource.Resource; +import org.rhq.core.domain.resource.ResourceCategory; +import org.rhq.core.domain.resource.ResourceSubCategory; +import org.rhq.core.domain.resource.ResourceType; +import org.rhq.core.domain.util.PageList; +import org.rhq.enterprise.gui.coregui.client.CoreGUI; +import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup; +import org.rhq.enterprise.gui.coregui.client.gwt.ResourceGWTServiceAsync; +import org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTypeRepository; + +/** + * @author Greg Hinkle + */ +public class NewResourceTreeDataSource extends DataSource { + + int rootId; + + private ResourceGWTServiceAsync resourceService = GWTServiceLookup.getResourceService(); + + public NewResourceTreeDataSource() { + setClientOnly(false); + setDataProtocol(DSProtocol.CLIENTCUSTOM); + setDataFormat(DSDataFormat.CUSTOM); + + + this.rootId = rootId; + + DataSourceField idDataField = new DataSourceTextField("id", "ID"); + idDataField.setPrimaryKey(true); + + DataSourceTextField nameDataField = new DataSourceTextField("name", "Name"); + nameDataField.setCanEdit(false); + + DataSourceTextField descriptionDataField = new DataSourceTextField("description", "Description"); + descriptionDataField.setCanEdit(false); + + DataSourceImageField availabilityDataField = new DataSourceImageField("currentAvailability", "Availability"); + descriptionDataField.setCanEdit(false); + + DataSourceTextField parentIdField = new DataSourceTextField("parentId", "Parent ID"); + parentIdField.setForeignKey("id"); + // parentIdField.setRootValue(rootId); + + // DataSourceTextField parentKeyField = new DataSourceTextField("parentKey", "Parent KEY"); + // parentKeyField.setForeignKey("id"); + // parentKeyField.setRootValue(rootId); + + // nameDataField.setType(FieldType.); + + setDropExtraFields(false); + + setFields(idDataField, nameDataField, descriptionDataField, availabilityDataField); + } + + @Override + protected Object transformRequest(DSRequest request) { + String requestId = request.getRequestId(); + DSResponse response = new DSResponse(); + response.setAttribute("clientContext", request.getAttributeAsObject("clientContext")); + // Asume success + response.setStatus(0); + switch (request.getOperationType()) { + case ADD: + //executeAdd(request, response); + break; + case FETCH: + executeFetch(requestId, request, response); + break; + case REMOVE: + //executeRemove(lstRec); + break; + case UPDATE: + //executeAdd(lstRec, false); + break; + + default: + break; + } + + return request.getData(); + } + + + public void executeFetch(final String requestId, final DSRequest request, final DSResponse response) { + final long start = System.currentTimeMillis(); + + String p = request.getCriteria().getAttribute("parentId"); + + ResourceCriteria criteria = new ResourceCriteria(); + + if (p == null) { + System.out.println("DataSourceTree: Loading initial data"); + + criteria.addFilterId(rootId); + + } else { + System.out.println("DataSourceTree: Loading " + p); + + criteria.addFilterParentResourceId(Integer.parseInt(p)); + } + + // The server is already eager fetch resource type + // * criteria.fetchResourceType(true); + + resourceService.findResourcesByCriteria(criteria, new AsyncCallback<PageList<Resource>>() { + public void onFailure(Throwable caught) { + CoreGUI.getErrorHandler().handleError("Failed to load resource data for tree", caught); + response.setStatus(RPCResponse.STATUS_FAILURE); + processResponse(requestId, response); + } + + public void onSuccess(PageList<Resource> result) { + processIncomingData(result, response, requestId); + } + }); + } + + private void processIncomingData(List<Resource> result, final DSResponse response, final String requestId) { + + ResourceTypeRepository.Cache.getInstance().loadResourceTypes(result, + EnumSet.of(ResourceTypeRepository.MetadataType.operations, ResourceTypeRepository.MetadataType.children, ResourceTypeRepository.MetadataType.subCategory), + new ResourceTypeRepository.ResourceTypeLoadedCallback() { + public void onResourceTypeLoaded(List<Resource> result) { +// response.setData(build(result)); + processResponse(requestId, response); + + } + }); + } + + /** + * Construct a set of TreeNodes from a list of resources + * + * @param resources + * @return + */ + public static TreeNode build(int rootId, Map<Integer, Resource> resources) { + Resource root = resources.get(rootId); + + TreeNode rootNode = new ResourceTreeNode(root); + + buildTree(rootNode, root, resources); + + ResourceTreeNode[] records = new ResourceTreeNode[resources.size()]; + for (int x = 0; x < resources.size(); x++) { + Resource res = resources.get(x); + ResourceTreeNode record = new ResourceTreeNode(res); + records[x] = record; + } + + return rootNode; +// return introduceTypeFolders(records); + } + + private static void buildTree(TreeNode parent, Resource parentResource, Map<Integer, Resource> resources) { + + HashMap<ResourceType, TypeTreeNode> types = new HashMap<ResourceType, TypeTreeNode>(); + + + ArrayList<ResourceTreeNode> childNodes = new ArrayList<ResourceTreeNode>(); + + for (Resource res : resources.values()) { + if (res.getParentResource() != null && res.getParentResource().getId() == parentResource.getId()) { + +// parent.setChildren(); + + ResourceTreeNode child = new ResourceTreeNode(res); + + childNodes.add(child); + + buildTree(child, res, resources); + + } + } + + parent.setChildren(childNodes.toArray(new TreeNode[childNodes.size()])); + + } + + + + + private static TreeNode[] introduceTypeFolders(ResourceTreeNode[] nodes) { + ArrayList<TreeNode> built = new ArrayList<TreeNode>(); + HashMap<ResourceSubCategory, CategoryTreeNode> categories = new HashMap<ResourceSubCategory, CategoryTreeNode>(); + HashMap<ResourceType, TypeTreeNode> types = new HashMap<ResourceType, TypeTreeNode>(); + + + for (ResourceTreeNode node : nodes) { + built.add(node); + + if (!types.containsKey(node.getResourceType()) + && node.getResourceType().getCategory() != ResourceCategory.PLATFORM) { + + String parentResourceId = String.valueOf(node.getResource().getParentResource().getId()); + + CategoryTreeNode categoryNode = null; + + if (node.getResourceType().getSubCategory() != null) { + ResourceSubCategory category = node.getResourceType().getSubCategory(); + if (category.getName() != null) { + categoryNode = categories.get(category); + + if (categoryNode == null) { + categoryNode = new CategoryTreeNode(parentResourceId, category); + + categories.put(category, categoryNode); + built.add(categoryNode); + } + } + } + + String parentId = null; + if (categoryNode != null) { + parentId = categoryNode.getAttribute("id"); + } else { + parentId = parentResourceId; + } + + TypeTreeNode typeNode = new TypeTreeNode(parentId, parentResourceId, node.getResourceType().getName()); + built.add(typeNode); + types.put(node.getResourceType(), typeNode); + } + } + + return built.toArray(new TreeNode[built.size()]); + + } + + private static boolean sameTypes(ResourceTreeNode[] nodes) { + ResourceType first = nodes[0].getResourceType(); + for (ResourceTreeNode node : nodes) { + if (!first.equals(node)) { + return false; + } + } + return true; + } + + public static class CategoryTreeNode extends TreeNode { + public CategoryTreeNode(String parentId, ResourceSubCategory category) { + setID(parentId + "__" + category.getName()); + setParentID(parentId); + setName(category.getDisplayName()); + + setAttribute("id", parentId + "__" + category.getName()); + setAttribute("parentId", parentId); + setAttribute("name", category.getDisplayName()); + } + } + + + public static class TypeTreeNode extends TreeNode { + + private TypeTreeNode(String parentId, String parentResourceId, String type) { + setID(parentId + "_" + type); + setParentID(parentId); + + setAttribute("id", parentResourceId + "_" + type); + setAttribute("parentId", parentId); + // setAttribute("parentKey", parentId); + setAttribute("name", type); + } + + } + + public static class ResourceTreeNode extends TreeNode { + + private Resource resource; + + private ResourceTreeNode(Resource resource) { + this.resource = resource; + + String id = String.valueOf(resource.getId()); + String parentId = resource.getParentResource() == null ? null + : (resource.getParentResource().getId() + "_" + resource.getResourceType().getName()); + + // System.out.println(id + " / " + parentId); + + setID(id); + setParentID(parentId); + + + setAttribute("id", id); + setAttribute("parentId", parentId); + + // setAttribute("parentKey", resource.getParentResource() == null ? 0 : (resource.getParentResource().getId() + resource.getResourceType().getName())); + + setAttribute("name", resource.getName()); +// setAttribute("description", resource.getDescription()); + setAttribute( + "currentAvailability", + resource.getCurrentAvailability().getAvailabilityType() == AvailabilityType.UP ? "/images/icons/availability_green_16.png" + : "/images/icons/availability_red_16.png"); + + setIsFolder((resource.getResourceType().getChildResourceTypes() != null && !resource.getResourceType() + .getChildResourceTypes().isEmpty())); + } + + public Resource getResource() { + return resource; + } + + public void setResource(Resource resource) { + this.resource = resource; + } + + public ResourceType getResourceType() { + return resource.getResourceType(); + } + + public String getParentId() { + return getAttribute("parentId"); + } + } +} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/NewResourceTreeView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/NewResourceTreeView.java new file mode 100644 index 0000000..3c72ba7 --- /dev/null +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/NewResourceTreeView.java @@ -0,0 +1,514 @@ +/* + * RHQ Management Platform + * Copyright (C) 2005-2010 Red Hat, Inc. + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ +package org.rhq.enterprise.gui.coregui.client.inventory.resource.detail; + +import java.util.ArrayList; +import java.util.EnumSet; +import java.util.HashMap; +import java.util.List; + +import com.google.gwt.user.client.History; +import com.google.gwt.user.client.rpc.AsyncCallback; +import com.smartgwt.client.types.SelectionStyle; +import com.smartgwt.client.widgets.Window; +import com.smartgwt.client.widgets.events.CloseClickHandler; +import com.smartgwt.client.widgets.events.CloseClientEvent; +import com.smartgwt.client.widgets.grid.events.SelectionChangedHandler; +import com.smartgwt.client.widgets.grid.events.SelectionEvent; +import com.smartgwt.client.widgets.layout.VLayout; +import com.smartgwt.client.widgets.menu.Menu; +import com.smartgwt.client.widgets.menu.MenuItem; +import com.smartgwt.client.widgets.menu.MenuItemSeparator; +import com.smartgwt.client.widgets.menu.events.ClickHandler; +import com.smartgwt.client.widgets.menu.events.MenuItemClickEvent; +import com.smartgwt.client.widgets.tree.Tree; +import com.smartgwt.client.widgets.tree.TreeGrid; +import com.smartgwt.client.widgets.tree.TreeNode; +import com.smartgwt.client.widgets.tree.events.DataArrivedEvent; +import com.smartgwt.client.widgets.tree.events.DataArrivedHandler; +import com.smartgwt.client.widgets.tree.events.NodeContextClickEvent; +import com.smartgwt.client.widgets.tree.events.NodeContextClickHandler; + +import org.rhq.core.domain.configuration.PropertySimple; +import org.rhq.core.domain.criteria.ResourceCriteria; +import org.rhq.core.domain.criteria.ResourceTypeCriteria; +import org.rhq.core.domain.dashboard.Dashboard; +import org.rhq.core.domain.dashboard.DashboardPortlet; +import org.rhq.core.domain.measurement.MeasurementDefinition; +import org.rhq.core.domain.operation.OperationDefinition; +import org.rhq.core.domain.resource.Resource; +import org.rhq.core.domain.resource.ResourceCategory; +import org.rhq.core.domain.resource.ResourceType; +import org.rhq.core.domain.util.PageControl; +import org.rhq.core.domain.util.PageList; +import org.rhq.enterprise.gui.coregui.client.Breadcrumb; +import org.rhq.enterprise.gui.coregui.client.CoreGUI; +import org.rhq.enterprise.gui.coregui.client.ViewId; +import org.rhq.enterprise.gui.coregui.client.ViewPath; +import org.rhq.enterprise.gui.coregui.client.components.configuration.ConfigurationEditor; +import org.rhq.enterprise.gui.coregui.client.dashboard.portlets.inventory.resource.graph.GraphPortlet; +import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup; +import org.rhq.enterprise.gui.coregui.client.gwt.ResourceGWTServiceAsync; +import org.rhq.enterprise.gui.coregui.client.gwt.ResourceTypeGWTServiceAsync; +import org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceSelectListener; +import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.operation.create.OperationCreateWizard; +import org.rhq.enterprise.gui.coregui.client.inventory.resource.factory.ResourceFactoryCreateWizard; +import org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTypeRepository; +import org.rhq.enterprise.gui.coregui.client.util.message.Message; + + +/** + * @author Greg Hinkle + */ +public class NewResourceTreeView extends VLayout { + private Resource selectedResource; + private Resource rootResource; + + private TreeGrid treeGrid; + private Menu contextMenu; + + private ViewId currentViewId; + + private ArrayList<ResourceSelectListener> selectListeners = new ArrayList<ResourceSelectListener>(); + + private boolean initialSelect = false; + + public NewResourceTreeView() { + super(); + + setWidth("250"); + setHeight100(); + + setShowResizeBar(true); + } + + public void onInit() { + + } + + private void buildTree() { + + treeGrid = new CustomResourceTreeGrid(); + + treeGrid.setOpenerImage("resources/dir.png"); + treeGrid.setOpenerIconSize(16); + +// treeGrid.setAutoFetchData(true); + treeGrid.setAnimateFolders(false); + treeGrid.setSelectionType(SelectionStyle.SINGLE); + treeGrid.setShowRollOver(false); + treeGrid.setSortField("name"); + treeGrid.setShowHeader(false); + + treeGrid.setLeaveScrollbarGap(false); + + + contextMenu = new Menu(); + MenuItem item = new MenuItem("Expand node"); + + + treeGrid.addSelectionChangedHandler(new SelectionChangedHandler() { + public void onSelectionChanged(SelectionEvent selectionEvent) { + if (!selectionEvent.isRightButtonDown() && selectionEvent.getState()) { + if (treeGrid.getSelectedRecord() instanceof ResourceTreeDatasource.ResourceTreeNode) { + ResourceTreeDatasource.ResourceTreeNode node = (ResourceTreeDatasource.ResourceTreeNode) treeGrid.getSelectedRecord(); + System.out.println("Resource selected in tree: " + node.getResource()); + + String newToken = "Resource/" + node.getResource().getId(); + String currentToken = History.getToken(); + if (!currentToken.startsWith(newToken)) { + + String ending = currentToken.replaceFirst("^[^\/]*\/[^\/]*", ""); + + History.newItem("Resource/" + node.getResource().getId() + ending); + + } + } + + } + } + }); + + + // This constructs the context menu for the resource at the time of the click. + setContextMenu(contextMenu); + + + treeGrid.addNodeContextClickHandler(new NodeContextClickHandler() { + public void onNodeContextClick(final NodeContextClickEvent event) { + event.getNode(); + event.cancel(); + + if (event.getNode() instanceof ResourceTreeDatasource.TypeTreeNode) { + showContextMenu((ResourceTreeDatasource.TypeTreeNode) event.getNode()); + } else if (event.getNode() instanceof ResourceTreeDatasource.ResourceTreeNode) { + showContextMenu((ResourceTreeDatasource.ResourceTreeNode) event.getNode()); + } + } + }); + } + + + private void showContextMenu(ResourceTreeDatasource.TypeTreeNode node) { + + contextMenu.setItems(new MenuItem(node.getName())); + contextMenu.showContextMenu(); + + } + + private void showContextMenu(final ResourceTreeDatasource.ResourceTreeNode node) { + ResourceTypeRepository.Cache.getInstance().getResourceTypes( + node.getResourceType().getId(), + EnumSet.of(ResourceTypeRepository.MetadataType.operations, ResourceTypeRepository.MetadataType.children, ResourceTypeRepository.MetadataType.subCategory, + ResourceTypeRepository.MetadataType.pluginConfigurationDefinition, ResourceTypeRepository.MetadataType.resourceConfigurationDefinition), + new ResourceTypeRepository.TypeLoadedCallback() { + public void onTypesLoaded(ResourceType type) { + buildResourceContextMenu(node.getResource(), type); + contextMenu.showContextMenu(); + } + }); + } + + + private void buildResourceContextMenu(final Resource resource, final ResourceType resourceType) { + contextMenu.setItems(new MenuItem(resource.getName())); + + contextMenu.addItem(new MenuItem("Type: " + resourceType.getName())); + + + MenuItem editPluginConfiguration = new MenuItem("Plugin Configuration"); + editPluginConfiguration.addClickHandler(new ClickHandler() { + public void onClick(MenuItemClickEvent event) { + int resourceId = resource.getId(); + int resourceTypeId = resourceType.getId(); + + Window configEditor = new Window(); + configEditor.setTitle("Edit " + resource.getName() + " plugin configuration"); + configEditor.setWidth(800); + configEditor.setHeight(800); + configEditor.setIsModal(true); + configEditor.setShowModalMask(true); + configEditor.setCanDragResize(true); + configEditor.centerInPage(); + configEditor.addItem(new ConfigurationEditor(resourceId, resourceTypeId, ConfigurationEditor.ConfigType.plugin)); + configEditor.show(); + + } + }); + editPluginConfiguration.setEnabled(resourceType.getPluginConfigurationDefinition() != null); + contextMenu.addItem(editPluginConfiguration); + + + MenuItem editResourceConfiguration = new MenuItem("Resource Configuration"); + editResourceConfiguration.addClickHandler(new ClickHandler() { + public void onClick(MenuItemClickEvent event) { + int resourceId = resource.getId(); + int resourceTypeId = resourceType.getId(); + + final Window configEditor = new Window(); + configEditor.setTitle("Edit " + resource.getName() + " resource configuration"); + configEditor.setWidth(800); + configEditor.setHeight(800); + configEditor.setIsModal(true); + configEditor.setShowModalMask(true); + configEditor.setCanDragResize(true); + configEditor.setShowResizer(true); + configEditor.centerInPage(); + configEditor.addCloseClickHandler(new CloseClickHandler() { + public void onCloseClick(CloseClientEvent closeClientEvent) { + configEditor.destroy(); + } + }); + configEditor.addItem(new ConfigurationEditor(resourceId, resourceTypeId, ConfigurationEditor.ConfigType.resource)); + configEditor.show(); + + } + }); + editResourceConfiguration.setEnabled(resourceType.getResourceConfigurationDefinition() != null); + contextMenu.addItem(editResourceConfiguration); + + contextMenu.addItem(new MenuItemSeparator()); + + + // Operations Menu + MenuItem operations = new MenuItem("Operations"); + Menu opSubMenu = new Menu(); + for (final OperationDefinition operationDefinition : resourceType.getOperationDefinitions()) { + MenuItem operationItem = new MenuItem(operationDefinition.getDisplayName()); + operationItem.addClickHandler(new ClickHandler() { + public void onClick(MenuItemClickEvent event) { + new OperationCreateWizard(selectedResource, operationDefinition).startOperationWizard(); + } + }); + opSubMenu.addItem(operationItem); + // todo action + } + operations.setEnabled(!resourceType.getOperationDefinitions().isEmpty()); + operations.setSubmenu(opSubMenu); + contextMenu.addItem(operations); + + + contextMenu.addItem(buildMetricsMenu(resourceType)); + + + // Create Menu + MenuItem createChildMenu = new MenuItem("Create Child"); + Menu createChildSubMenu = new Menu(); + for (final ResourceType childType : resourceType.getChildResourceTypes()) { + if (childType.isCreatable()) { + MenuItem createItem = new MenuItem(childType.getName()); + createChildSubMenu.addItem(createItem); + createItem.addClickHandler(new ClickHandler() { + public void onClick(MenuItemClickEvent event) { + ResourceFactoryCreateWizard.showCreateWizard(resource, childType); + } + }); + + } + } + createChildMenu.setSubmenu(createChildSubMenu); + createChildMenu.setEnabled(createChildSubMenu.getItems().length > 0); + contextMenu.addItem(createChildMenu); + + + // Manually Add Menu + MenuItem importChildMenu = new MenuItem("Import"); + Menu importChildSubMenu = new Menu(); + for (ResourceType childType : resourceType.getChildResourceTypes()) { + if (childType.isSupportsManualAdd()) { + importChildSubMenu.addItem(new MenuItem(childType.getName())); + //todo action + } + } + if (resourceType.getCategory() == ResourceCategory.PLATFORM) { + loadManuallyAddServersToPlatforms(importChildSubMenu); + } + importChildMenu.setSubmenu(importChildSubMenu); + importChildMenu.setEnabled(importChildSubMenu.getItems().length > 0); + contextMenu.addItem(importChildMenu); + } + + + private void loadManuallyAddServersToPlatforms(final Menu manuallyAddMenu) { + ResourceTypeGWTServiceAsync rts = GWTServiceLookup.getResourceTypeGWTService(); + + ResourceTypeCriteria criteria = new ResourceTypeCriteria(); + criteria.addFilterSupportsManualAdd(true); + criteria.fetchParentResourceTypes(true); + rts.findResourceTypesByCriteria(criteria, + new AsyncCallback<PageList<ResourceType>>() { + public void onFailure(Throwable caught) { + CoreGUI.getErrorHandler().handleError("Failed to load platform manual add children", caught); + } + + public void onSuccess(PageList<ResourceType> result) { + for (ResourceType type : result) { + if (type.getParentResourceTypes() == null || type.getParentResourceTypes().isEmpty()) { + MenuItem item = new MenuItem(type.getName()); + manuallyAddMenu.addItem(item); + } + } + } + }); + } + + + private MenuItem buildMetricsMenu(final ResourceType type) { + MenuItem measurements = new MenuItem("Measurements"); + final Menu measurementsSubMenu = new Menu(); + + + GWTServiceLookup.getDashboardService().findDashboardsForSubject(new AsyncCallback<List<Dashboard>>() { + public void onFailure(Throwable caught) { + CoreGUI.getErrorHandler().handleError("Failed to load user dashboards", caught); + } + + public void onSuccess(List<Dashboard> result) { + + for (final MeasurementDefinition def : type.getMetricDefinitions()) { + + MenuItem defItem = new MenuItem(def.getDisplayName()); + measurementsSubMenu.addItem(defItem); + Menu defSubItem = new Menu(); + defItem.setSubmenu(defSubItem); + + + for (final Dashboard d : result) { + MenuItem addToDBItem = new MenuItem("Add chart to Dashboard: " + d.getName()); + defSubItem.addItem(addToDBItem); + + addToDBItem.addClickHandler(new ClickHandler() { + public void onClick(MenuItemClickEvent menuItemClickEvent) { + + DashboardPortlet p = new DashboardPortlet(def.getDisplayName() + " Chart", GraphPortlet.KEY, 250); + p.getConfiguration().put(new PropertySimple(GraphPortlet.CFG_RESOURCE_ID, selectedResource.getId())); + p.getConfiguration().put(new PropertySimple(GraphPortlet.CFG_DEFINITION_ID, def.getId())); + + d.addPortlet(p, 0, 0); + + GWTServiceLookup.getDashboardService().storeDashboard(d, new AsyncCallback<Dashboard>() { + public void onFailure(Throwable caught) { + CoreGUI.getErrorHandler().handleError("Failed to save dashboard to server", caught); + } + + public void onSuccess(Dashboard result) { + CoreGUI.getMessageCenter().notify(new Message("Saved dashboard " + result.getName() + " to server", Message.Severity.Info)); + } + }); + + } + }); + + } + + + } + + } + }); + measurements.setSubmenu(measurementsSubMenu); + return measurements; + } + + Resource getResource(int resourceId) { + if (this.treeGrid != null && this.treeGrid.getTree() != null) { + ResourceTreeDatasource.ResourceTreeNode treeNode = + (ResourceTreeDatasource.ResourceTreeNode) this.treeGrid.getTree().findById(String.valueOf(resourceId)); + if (treeNode != null) { + return treeNode.getResource(); + } + } + return null; + } + + private void setRootResource(Resource rootResource) { + this.rootResource = rootResource; + } + + public void setSelectedResource(final Resource selectedResource, final ViewId viewId) { + this.selectedResource = selectedResource; + + TreeNode node = null; + if (treeGrid != null && treeGrid.getTree() != null + && (node = treeGrid.getTree().findById(String.valueOf(selectedResource.getId()))) != null) { + + // This is the case where the tree was previously loaded and we get fired to look at a different + // node in the same tree and just have to switch the selection + + TreeNode[] parents = treeGrid.getTree().getParents(node); + treeGrid.getTree().openFolders(parents); + treeGrid.getTree().openFolder(node); + + treeGrid.deselectAllRecords(); + treeGrid.selectRecord(node); + + + // Update breadcrumbs + viewId.getBreadcrumbs().clear(); + for (int i = parents.length - 1; i >= 0; i--) { + TreeNode n = parents[i]; + adjustBreadcrumb(n, viewId); + } + adjustBreadcrumb(node, viewId); + + CoreGUI.refreshBreadCrumbTrail(); + + } else { + + // Data not yet loaded or a node in a different tree + + final ResourceGWTServiceAsync resourceService = GWTServiceLookup.getResourceService(); + + + resourceService.getPlatformForResource(selectedResource.getId(), new AsyncCallback<Resource>() { + public void onFailure(Throwable caught) { + CoreGUI.getErrorHandler().handleError("adasdf", caught); + } + + public void onSuccess(Resource result) { + rootResource = result; + + ResourceCriteria criteria = new ResourceCriteria(); + criteria.addFilterRootResourceId(rootResource.getId()); + criteria.setPageControl(PageControl.getUnlimitedInstance()); + + resourceService.findResourcesByCriteria(criteria, + new AsyncCallback<PageList<Resource>>() { + public void onFailure(Throwable caught) { + CoreGUI.getErrorHandler().handleError("lkasldf", caught); + } + + public void onSuccess(PageList<Resource> result) { + + loadTree(rootResource.getId(), result); + } + }); + } + }); + + } + } + + private void loadTree(int rootId, PageList<Resource> result) { + if (this.treeGrid != null) { + this.treeGrid.destroy(); + } + this.buildTree(); + + HashMap<Integer,Resource> data = new HashMap<Integer, Resource>(); + for (Resource res : result) { + data.put(res.getId(),res); + } + + Tree tree = new Tree(); + + tree.setRoot(NewResourceTreeDataSource.build(rootId, data)); + treeGrid.setData(tree); + addMember(this.treeGrid); + } + + + private void adjustBreadcrumb(TreeNode node, ViewId viewId) { + if (node instanceof ResourceTreeDatasource.ResourceTreeNode) { + + Resource nr = ((ResourceTreeDatasource.ResourceTreeNode) node).getResource(); + String display = node.getName() + " <span class="subtitle">" + nr.getResourceType().getName() + "</span>"; + String icon = "types/" + nr.getResourceType().getCategory().getDisplayName() + "_up_16.png"; + + + viewId.getBreadcrumbs().add(new Breadcrumb(node.getAttribute("id"), + display, icon, true)); + + } else { + +// if (node.getName() != null) { +// viewId.getBreadcrumbs().add(new Breadcrumb(node.getAttribute("id"), node.getName(), null, true)); +// } + } + } + + + public void addResourceSelectListener(ResourceSelectListener listener) { + this.selectListeners.add(listener); + } + + public void renderView(ViewPath viewPath) { + currentViewId = viewPath.getCurrent(); + } +} \ No newline at end of file diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTreeView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTreeView.java index 701c176..02570b6 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTreeView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTreeView.java @@ -50,6 +50,8 @@ import com.smartgwt.client.util.SC; import com.smartgwt.client.widgets.Window; import com.smartgwt.client.widgets.events.CloseClickHandler; import com.smartgwt.client.widgets.events.CloseClientEvent; +import com.smartgwt.client.widgets.events.ShowContextMenuEvent; +import com.smartgwt.client.widgets.events.ShowContextMenuHandler; import com.smartgwt.client.widgets.grid.events.SelectionChangedHandler; import com.smartgwt.client.widgets.grid.events.SelectionEvent; import com.smartgwt.client.widgets.layout.VLayout; @@ -121,7 +123,7 @@ public class ResourceTreeView extends VLayout {
treeGrid.addSelectionChangedHandler(new SelectionChangedHandler() { public void onSelectionChanged(SelectionEvent selectionEvent) { - if (selectionEvent.getState()) { + if (!selectionEvent.isRightButtonDown() && selectionEvent.getState()) { if (treeGrid.getSelectedRecord() instanceof ResourceTreeDatasource.ResourceTreeNode) { ResourceTreeDatasource.ResourceTreeNode node = (ResourceTreeDatasource.ResourceTreeNode) treeGrid.getSelectedRecord(); System.out.println("Resource selected in tree: " + node.getResource()); @@ -144,9 +146,13 @@ public class ResourceTreeView extends VLayout {
// This constructs the context menu for the resource at the time of the click. setContextMenu(contextMenu); + + + treeGrid.addNodeContextClickHandler(new NodeContextClickHandler() { public void onNodeContextClick(final NodeContextClickEvent event) { event.getNode(); + event.cancel();
if (event.getNode() instanceof ResourceTreeDatasource.TypeTreeNode) { showContextMenu((ResourceTreeDatasource.TypeTreeNode) event.getNode()); @@ -406,6 +412,9 @@ public class ResourceTreeView extends VLayout { if (treeGrid != null && treeGrid.getTree() != null && (node = treeGrid.getTree().findById(String.valueOf(selectedResource.getId()))) != null) {
+ // This is the case where the tree was previously loaded and we get fired to look at a different + // node in the same tree and just have to switch the selection + TreeNode[] parents = treeGrid.getTree().getParents(node); treeGrid.getTree().openFolders(parents); treeGrid.getTree().openFolder(node);
commit 3bf778a65f84daf3e39514cd87ad269558c1257e Author: Greg Hinkle ghinkle@redhat.com Date: Tue Jul 27 13:12:19 2010 -0400
Slim down the selectors in height
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/form/RadioGroupWithComponentsItem.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/form/RadioGroupWithComponentsItem.java index 28830da..f2c02f5 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/form/RadioGroupWithComponentsItem.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/form/RadioGroupWithComponentsItem.java @@ -4,18 +4,23 @@ * All rights reserved. * * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation version 2 of the License. + * it under the terms of the GNU General Public License, version 2, as + * published by the Free Software Foundation, and/or the GNU Lesser + * General Public License, version 2.1, also as published by the Free + * Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU General Public License and the GNU Lesser General Public License + * for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * and the GNU Lesser General Public License along with this program; + * if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + package org.rhq.enterprise.gui.coregui.client.components.form;
import java.util.ArrayList; diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/selector/AbstractSelector.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/selector/AbstractSelector.java index 8b13207..8fc14b0 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/selector/AbstractSelector.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/selector/AbstractSelector.java @@ -102,7 +102,7 @@ public abstract class AbstractSelector<T> extends VLayout {
// LEFT SIDE availableGrid = new ListGrid(); - availableGrid.setHeight(350); + availableGrid.setHeight(300); availableGrid.setCanDragRecordsOut(true); availableGrid.setDragTrackerMode(DragTrackerMode.ICON); availableGrid.setTrackerImage(new ImgProperties("types/Service_up_16.png", 16, 16)); @@ -157,7 +157,7 @@ public abstract class AbstractSelector<T> extends VLayout { // RIGHT SIDE
assignedGrid = new ListGrid(); - assignedGrid.setHeight(350); + assignedGrid.setHeight(300); assignedGrid.setCanReorderRecords(true); assignedGrid.setCanDragRecordsOut(true);
commit 7048f423e2f90def4e4abb13d559940ad0bb796f Author: Greg Hinkle ghinkle@redhat.com Date: Tue Jul 27 13:03:15 2010 -0400
Ability to use <enter> twice on the login form to use autofill values
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LoginView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LoginView.java index c28d77e..d534aca 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LoginView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LoginView.java @@ -26,7 +26,6 @@ import com.google.gwt.event.dom.client.KeyCodes; import com.google.gwt.http.client.Request; import com.google.gwt.http.client.RequestBuilder; import com.google.gwt.http.client.RequestCallback; -import com.google.gwt.http.client.RequestException; import com.google.gwt.http.client.Response; import com.google.gwt.user.client.rpc.AsyncCallback; import com.smartgwt.client.types.Alignment; @@ -102,7 +101,7 @@ public class LoginView extends Canvas { TextItem user = new TextItem("user", "User"); user.setRequired(true); user.setAttribute("autoComplete", "native"); - PasswordItem password = new PasswordItem("password", "Password"); + final PasswordItem password = new PasswordItem("password", "Password"); password.setRequired(true); password.setAttribute("autoComplete", "native");
@@ -110,6 +109,13 @@ public class LoginView extends Canvas { loginButton.setAlign(Alignment.CENTER); loginButton.setColSpan(2);
+ user.addKeyPressHandler(new KeyPressHandler() { + public void onKeyPress(KeyPressEvent event) { + if ((event.getCharacterValue() != null) && (event.getCharacterValue() == KeyCodes.KEY_ENTER)) { + password.focusInItem(); // Work around the form not getting auto-fill values until the field is focused + } + } + }); password.addKeyPressHandler(new KeyPressHandler() { public void onKeyPress(KeyPressEvent event) { if ((event.getCharacterValue() != null) && (event.getCharacterValue() == KeyCodes.KEY_ENTER)) {
commit cdf8afe540f894b61147721f67def6e90a2a004a Author: Greg Hinkle ghinkle@redhat.com Date: Tue Jul 27 12:59:46 2010 -0400
Improve bundle tree reloading so that it doesn't always close the entire tree
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/BundleTopView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/BundleTopView.java index cce46a3..5ea41cf 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/BundleTopView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/BundleTopView.java @@ -93,8 +93,14 @@ public class BundleTopView extends HLayout implements BookmarkableView {
public void renderView(ViewPath viewPath) {
+ if (viewPath.isRefresh()) { + bundleTreeView.refresh(); + } + + bundleTreeView.selectPath(viewPath);
+ if (viewPath.isEnd()) { if (currentNextPath == null && bundlesListView != null) { // refresh @@ -117,6 +123,5 @@ public class BundleTopView extends HLayout implements BookmarkableView { bundleView.renderView(viewPath.next()); } } - bundleTreeView.refresh();//refresh the tree in all cases. } } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/tree/BundleTreeView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/tree/BundleTreeView.java index 3dabe7e..000af5f 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/tree/BundleTreeView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/tree/BundleTreeView.java @@ -46,9 +46,7 @@ public class BundleTreeView extends TreeGrid {
setWidth100(); setHeight100(); - - setWidth100(); - setHeight100(); + setLeaveScrollbarGap(false); // setShowRoot(true); setAutoFetchData(true); setAnimateFolders(false);
commit c650a717ee4a21354d83e34f73f03705b5f72fbf Author: Greg Hinkle ghinkle@redhat.com Date: Tue Jul 27 12:59:14 2010 -0400
Fix selector repackaging
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/SelectBundleStep.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/SelectBundleStep.java index 271ca59..771e51d 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/SelectBundleStep.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/SelectBundleStep.java @@ -25,8 +25,8 @@ import com.smartgwt.client.widgets.Canvas;
import org.rhq.core.domain.bundle.Bundle; import org.rhq.enterprise.gui.coregui.client.bundle.BundleSelector; +import org.rhq.enterprise.gui.coregui.client.components.selector.AbstractSelector; import org.rhq.enterprise.gui.coregui.client.components.wizard.AbstractWizardStep; -import org.rhq.enterprise.gui.coregui.client.inventory.resource.selection.AbstractSelector;
public class SelectBundleStep extends AbstractWizardStep {
commit da32f65506ed18dcdf4d5865b840750d5a18b615 Author: Lukas Krejci lkrejci@redhat.com Date: Tue Jul 27 18:49:43 2010 +0200
BZ 618741 - add the configuration name to the name of the JBoss AS (4 and 5) server resources.
diff --git a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ApplicationServerDiscoveryComponent.java b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ApplicationServerDiscoveryComponent.java index 8ef756d..5068f2d 100644 --- a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ApplicationServerDiscoveryComponent.java +++ b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ApplicationServerDiscoveryComponent.java @@ -316,6 +316,7 @@ public class ApplicationServerDiscoveryComponent implements ResourceDiscoveryCom
String description = installInfo.getProductType().DESCRIPTION; File deployDir = new File(absoluteConfigPath, "deploy"); + File rhqInstallerWar = new File(deployDir, "rhq-installer.war"); File rhqInstallerWarUndeployed = new File(deployDir, "rhq-installer.war.rej"); boolean isRhqServer = rhqInstallerWar.exists() || rhqInstallerWarUndeployed.exists(); @@ -324,13 +325,13 @@ public class ApplicationServerDiscoveryComponent implements ResourceDiscoveryCom // We know this is an RHQ Server. Let's add an event source for its server log file, but disable it by default. configureEventSourceForServerLogFile(pluginConfig); } - String name = formatServerName(bindAddress, namingPort, discoveryContext.getSystemInformation().getHostname(), isRhqServer); + String name = formatServerName(bindAddress, namingPort, discoveryContext.getSystemInformation().getHostname(), absoluteConfigPath.getName(), isRhqServer);
return new DiscoveredResourceDetails(discoveryContext.getResourceType(), key, name, installInfo.getVersion(), description, pluginConfig, processInfo); }
- public String formatServerName(String bindingAddress, String jnpPort, String hostname, boolean isRhq) { + public String formatServerName(String bindingAddress, String jnpPort, String hostname, String configurationName, boolean isRhq) {
if (isRhq) { return hostname + " RHQ Server"; @@ -355,7 +356,7 @@ public class ApplicationServerDiscoveryComponent implements ResourceDiscoveryCom hostnameToUse += ":" + jnpPort; }
- return hostnameToUse; + return hostnameToUse + " " + configurationName; } }
diff --git a/modules/plugins/jboss-as/src/main/java/org/rhq/plugins/jbossas/JBossASDiscoveryComponent.java b/modules/plugins/jboss-as/src/main/java/org/rhq/plugins/jbossas/JBossASDiscoveryComponent.java index 05483e4..78a3330 100644 --- a/modules/plugins/jboss-as/src/main/java/org/rhq/plugins/jbossas/JBossASDiscoveryComponent.java +++ b/modules/plugins/jboss-as/src/main/java/org/rhq/plugins/jbossas/JBossASDiscoveryComponent.java @@ -325,7 +325,7 @@ public class JBossASDiscoveryComponent implements ResourceDiscoveryComponent, Ma } } } - String name = formatServerName(bindingAddress, namingPort, discoveryContext.getSystemInformation().getHostname(), isInServer); + String name = formatServerName(bindingAddress, namingPort, discoveryContext.getSystemInformation().getHostname(), configName, isInServer);
return new DiscoveredResourceDetails(discoveryContext.getResourceType(), key, name, installInfo.getVersion(), description, pluginConfiguration, processInfo); @@ -404,7 +404,7 @@ public class JBossASDiscoveryComponent implements ResourceDiscoveryComponent, Ma setPluginConfigurationDefaults(pluginConfiguration);
String resourceName = formatServerName(bindAddress, jnpPort, - context.getSystemInformation().getHostname(), isRhqServer(configDir)); + context.getSystemInformation().getHostname(), configName, isRhqServer(configDir)); DiscoveredResourceDetails resource = new DiscoveredResourceDetails(context.getResourceType(), configDir .getAbsolutePath(), resourceName, version, "JBoss AS server that the RHQ Plugin Container is running within", pluginConfiguration, null); @@ -420,7 +420,7 @@ public class JBossASDiscoveryComponent implements ResourceDiscoveryComponent, Ma return null; }
- public String formatServerName(String bindingAddress, String jnpPort, String hostname, boolean isRhq) { + public String formatServerName(String bindingAddress, String jnpPort, String hostname, String configurationName, boolean isRhq) {
if (isRhq) { return hostname + " RHQ Server"; @@ -444,7 +444,7 @@ public class JBossASDiscoveryComponent implements ResourceDiscoveryComponent, Ma hostnameToUse += ":" + jnpPort; }
- return hostnameToUse; + return hostnameToUse + " " + configurationName; } }
commit b59013caf09787898c3a5efb863f0dfcf852f8d4 Author: Greg Hinkle ghinkle@redhat.com Date: Tue Jul 27 12:42:18 2010 -0400
Better admin tree L&F
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/AdministrationView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/AdministrationView.java index c2ebe9b..6eead0b 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/AdministrationView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/AdministrationView.java @@ -121,6 +121,7 @@ public class AdministrationView extends HLayout implements BookmarkableView { private TreeGrid buildSecuritySection() {
final TreeGrid securityTreeGrid = new TreeGrid(); + securityTreeGrid.setLeaveScrollbarGap(false); securityTreeGrid.setShowHeader(false);
Tree tree = new Tree(); @@ -151,6 +152,7 @@ public class AdministrationView extends HLayout implements BookmarkableView { private TreeGrid buildManagementClusterSection() {
final TreeGrid mgmtClusterTreeGrid = new TreeGrid(); + mgmtClusterTreeGrid.setLeaveScrollbarGap(false); mgmtClusterTreeGrid.setShowHeader(false);
Tree tree = new Tree(); @@ -174,6 +176,7 @@ public class AdministrationView extends HLayout implements BookmarkableView { private TreeGrid buildSystemConfigurationSection() {
final TreeGrid systemConfigTreeGrid = new TreeGrid(); + systemConfigTreeGrid.setLeaveScrollbarGap(false); systemConfigTreeGrid.setShowHeader(false);
Tree tree = new Tree(); @@ -195,6 +198,7 @@ public class AdministrationView extends HLayout implements BookmarkableView { private TreeGrid buildReportsSection() {
final TreeGrid reportsTreeGrid = new TreeGrid(); + reportsTreeGrid.setLeaveScrollbarGap(false); reportsTreeGrid.setShowHeader(false);
Tree tree = new Tree();
commit 64354925b00bfedb4fbbba1626c942b88e0eaf4c Author: Greg Hinkle ghinkle@redhat.com Date: Tue Jul 27 12:41:47 2010 -0400
Support for tracking refreshes explicitely in the viewpath
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/ViewPath.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/ViewPath.java index 0a1253b..e0b7991 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/ViewPath.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/ViewPath.java @@ -29,6 +29,8 @@ public class ViewPath {
private int index = 0;
+ private boolean refresh = false; + public ViewPath() { }
@@ -84,4 +86,12 @@ public class ViewPath { public int viewsLeft() { return viewPath.size() - index - 1; } + + public boolean isRefresh() { + return refresh; + } + + public void setRefresh(boolean refresh) { + this.refresh = refresh; + } }
commit d18f68e412fb929443b7edc23deeab2473281119 Author: Greg Hinkle ghinkle@redhat.com Date: Tue Jul 27 12:41:27 2010 -0400
Reports top level category tag cloud display, recent alerts, recent operations
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java index 8fb1f0b..7cd621b 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java @@ -53,6 +53,7 @@ import org.rhq.enterprise.gui.coregui.client.inventory.groups.detail.ResourceGro import org.rhq.enterprise.gui.coregui.client.inventory.resource.InventoryView; import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.ResourceView; import org.rhq.enterprise.gui.coregui.client.menu.MenuBarView; +import org.rhq.enterprise.gui.coregui.client.report.ReportTopView; import org.rhq.enterprise.gui.coregui.client.report.tag.TaggedView; import org.rhq.enterprise.gui.coregui.client.util.ErrorHandler; import org.rhq.enterprise.gui.coregui.client.util.message.MessageCenter; @@ -248,6 +249,7 @@ public class CoreGUI implements EntryPoint, ValueChangeHandler<String> { public static void refresh() { currentViewPath = new ViewPath(currentPath);
+ currentViewPath.setRefresh(true); coreGUI.rootCanvas.renderView(currentViewPath);
} @@ -275,6 +277,8 @@ public class CoreGUI implements EntryPoint, ValueChangeHandler<String> { canvas = new TaggedView(); } else if (breadcrumbName.equals("Subsystems")) { canvas = new AlertsView(); + } else if (breadcrumbName.equals("Reports")) { + canvas = new ReportTopView(); } else { canvas = null; } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/ReportTopView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/ReportTopView.java new file mode 100644 index 0000000..8024902 --- /dev/null +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/ReportTopView.java @@ -0,0 +1,370 @@ +/* + * RHQ Management Platform + * Copyright (C) 2005-2010 Red Hat, Inc. + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License, version 2, as + * published by the Free Software Foundation, and/or the GNU Lesser + * General Public License, version 2.1, also as published by the Free + * Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License and the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License + * and the GNU Lesser General Public License along with this program; + * if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +package org.rhq.enterprise.gui.coregui.client.report; + +import java.util.LinkedHashMap; + +import com.smartgwt.client.types.VisibilityMode; +import com.smartgwt.client.widgets.Canvas; +import com.smartgwt.client.widgets.HTMLFlow; +import com.smartgwt.client.widgets.grid.events.SelectionChangedHandler; +import com.smartgwt.client.widgets.grid.events.SelectionEvent; +import com.smartgwt.client.widgets.layout.HLayout; +import com.smartgwt.client.widgets.layout.SectionStack; +import com.smartgwt.client.widgets.layout.SectionStackSection; +import com.smartgwt.client.widgets.tree.Tree; +import com.smartgwt.client.widgets.tree.TreeGrid; +import com.smartgwt.client.widgets.tree.TreeNode; + +import org.rhq.enterprise.gui.coregui.client.BookmarkableView; +import org.rhq.enterprise.gui.coregui.client.CoreGUI; +import org.rhq.enterprise.gui.coregui.client.ViewId; +import org.rhq.enterprise.gui.coregui.client.ViewPath; +import org.rhq.enterprise.gui.coregui.client.admin.agent.install.RemoteAgentInstallView; +import org.rhq.enterprise.gui.coregui.client.admin.roles.RolesView; +import org.rhq.enterprise.gui.coregui.client.admin.users.UsersView; +import org.rhq.enterprise.gui.coregui.client.alert.AlertsView; +import org.rhq.enterprise.gui.coregui.client.components.FullHTMLPane; +import org.rhq.enterprise.gui.coregui.client.dashboard.portlets.platform.PlatformPortletView; +import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.operation.OperationHistoryView; +import org.rhq.enterprise.gui.coregui.client.inventory.resource.discovery.ResourceAutodiscoveryView; +import org.rhq.enterprise.gui.coregui.client.report.tag.TagCloudView; +import org.rhq.enterprise.gui.coregui.client.report.tag.TaggedView; + +/** + * @author Greg Hinkle + */ +public class ReportTopView extends HLayout implements BookmarkableView { + + public static final String VIEW_PATH = "Reports"; + + + private ViewId currentSectionViewId; + private ViewId currentPageViewId; + + + private SectionStack sectionStack; + + private Canvas contentCanvas; + private Canvas currentContent; + private LinkedHashMap<String, TreeGrid> treeGrids = new LinkedHashMap<String, TreeGrid>(); + + @Override + protected void onInit() { + super.onInit(); + + setWidth100(); + setHeight100(); + + contentCanvas = new Canvas(); + contentCanvas.setWidth("*"); + contentCanvas.setHeight100(); + + sectionStack = new SectionStack(); + sectionStack.setShowResizeBar(true); + sectionStack.setVisibilityMode(VisibilityMode.MULTIPLE); + sectionStack.setWidth(250); + sectionStack.setHeight100(); + + + treeGrids.put("Inventory", buildInventorySection()); + treeGrids.put("Configuration", buildSystemConfigurationSection()); + treeGrids.put("Cluster", buildManagementClusterSection()); + treeGrids.put("Reports", buildReportsSection()); + + + for (final String name : treeGrids.keySet()) { + TreeGrid grid = treeGrids.get(name); + + grid.addSelectionChangedHandler(new SelectionChangedHandler() { + public void onSelectionChanged(SelectionEvent selectionEvent) { + CoreGUI.goTo("Reports/" + name + "/" + selectionEvent.getRecord().getAttribute("name")); + } + }); + + + SectionStackSection section = new SectionStackSection(name); + section.setExpanded(true); + section.addItem(grid); + + sectionStack.addSection(section); + } + + + addMember(sectionStack); + addMember(contentCanvas); + + } + + + private HTMLFlow defaultView() { + String contents = "<h1>Reports</h1>\n" + + "This section provides access to global reports."; + HTMLFlow flow = new HTMLFlow(contents); + flow.setPadding(20); + return flow; + } + + + private TreeGrid buildInventorySection() { + + final TreeGrid inventoryTreeGrid = new TreeGrid(); + inventoryTreeGrid.setLeaveScrollbarGap(false); + inventoryTreeGrid.setShowHeader(false); + + Tree tree = new Tree(); + final TreeNode tagCloud = new TreeNode("Tag Cloud"); + tagCloud.setIcon("global/Cloud_16.png"); + + final TreeNode suspectMetrics = new TreeNode("Suspect Metrics"); + suspectMetrics.setIcon("subsystems/monitor/Monitor_failed_16.png"); + + final TreeNode recentConfigurationChanges = new TreeNode("Recent Configuration Changes"); + recentConfigurationChanges.setIcon("subsystems/configure/Configure_16.png"); + + final TreeNode recentOperations = new TreeNode("Recent Operations"); + recentOperations.setIcon("subsystems/control/Operation_16.png"); + + final TreeNode recentAlerts = new TreeNode("Recent Alerts"); + recentAlerts.setIcon("subsystems/alert/Alert_LOW_16.png"); + + final TreeNode alertDefinitions = new TreeNode("Alert Definitions"); + alertDefinitions.setIcon("subsystems/alert/Alerts_16.png"); + + final TreeNode platforms = new TreeNode("Platforms"); + platforms.setIcon("types/Platform_up_16.png"); + + + tree.setRoot(new TreeNode("inventory", + tagCloud, + suspectMetrics, + recentConfigurationChanges, + recentOperations, + recentAlerts, + alertDefinitions, + platforms)); + + inventoryTreeGrid.setData(tree); + + return inventoryTreeGrid; + } + + + private TreeGrid buildManagementClusterSection() { + + final TreeGrid mgmtClusterTreeGrid = new TreeGrid(); + mgmtClusterTreeGrid.setLeaveScrollbarGap(false); + mgmtClusterTreeGrid.setShowHeader(false); + + Tree tree = new Tree(); + final TreeNode manageServersNode = new TreeNode("Servers"); + final TreeNode manageAgentsNode = new TreeNode("Agents"); + final TreeNode manageAffinityGroupsNode = new TreeNode("Affinity Groups"); + final TreeNode managePartitionEventsNode = new TreeNode("Partition Events"); + + tree.setRoot(new TreeNode("clustering", + manageServersNode, + manageAgentsNode, + manageAffinityGroupsNode, + managePartitionEventsNode)); + + mgmtClusterTreeGrid.setData(tree); + + return mgmtClusterTreeGrid; + } + + + private TreeGrid buildSystemConfigurationSection() { + + final TreeGrid systemConfigTreeGrid = new TreeGrid(); + systemConfigTreeGrid.setLeaveScrollbarGap(false); + systemConfigTreeGrid.setShowHeader(false); + + Tree tree = new Tree(); + final TreeNode manageSettings = new TreeNode("System Settings"); + final TreeNode manageTemplates = new TreeNode("Templates"); + final TreeNode manageDownloads = new TreeNode("Downloads"); + final TreeNode manageLicense = new TreeNode("License"); + final TreeNode managePlugins = new TreeNode("Plugins"); + + tree.setRoot(new TreeNode("System Configuration", + manageSettings, manageTemplates, manageDownloads, manageLicense, managePlugins)); + + systemConfigTreeGrid.setData(tree); + + return systemConfigTreeGrid; + } + + + private TreeGrid buildReportsSection() { + + final TreeGrid reportsTreeGrid = new TreeGrid(); + reportsTreeGrid.setLeaveScrollbarGap(false); + reportsTreeGrid.setShowHeader(false); + + Tree tree = new Tree(); + final TreeNode inventorySummaryNode = new TreeNode("Inventory Summary"); + + TreeNode reportsNode = new TreeNode("Reports", inventorySummaryNode); + tree.setRoot(reportsNode); + + reportsTreeGrid.setData(tree); + + return reportsTreeGrid; + } + + + public void setContent(Canvas newContent) { + + if (contentCanvas.getChildren().length > 0) + contentCanvas.getChildren()[0].destroy(); + + contentCanvas.addChild(newContent); + contentCanvas.markForRedraw(); + this.currentContent = newContent; + } + + + private void renderContentView(ViewPath viewPath) { + + currentSectionViewId = viewPath.getCurrent(); + currentPageViewId = viewPath.getNext(); + + String section = currentSectionViewId.getPath(); + String page = currentPageViewId.getPath(); + + + Canvas content = null; + if ("Inventory".equals(section)) { + + if ("Tag Cloud".equals(page)) { + content = new TaggedView(); + } else if ("Suspect Metrics".equals(page)) { +// todo + } else if ("Recent Configuration Changes".equals(page)) { + // todo + } else if ("Recent Operations".equals(page)) { + content = new OperationHistoryView(); + } else if ("Recent Alerts".equals(page)) { + content = new AlertsView(); + } else if ("Alert Definitions".equals(page)) { + //todo + } else if ("Platforms".equals(page)) { + content = new PlatformPortletView(); + } + + + } else if ("Security".equals(section)) { + + if ("Manage Users".equals(page)) { + content = new UsersView(); + } else if ("Manage Roles".equals(page)) { + content = new RolesView(); + } else if ("Auto Discovery Queue".equals(page)) { + content = new ResourceAutodiscoveryView(); + } else if ("Remote Agent Install".equals(page)) { + content = new RemoteAgentInstallView(); + } + } else if ("Configuration".equals(section)) { + + String url = null; + if ("System Settings".equals(page)) { + url = "/admin/config/Config.do?mode=edit"; + } else if ("Templates".equals(page)) { + url = "/admin/config/EditDefaults.do?mode=monitor&viewMode=all"; + } else if ("Downloads".equals(page)) { + url = "/rhq/admin/downloads-body.xhtml"; + } else if ("License".equals(page)) { + url = "/admin/license/LicenseAdmin.do?mode=view"; + } else if ("Plugins".equals(page)) { + url = "/rhq/admin/plugin/plugin-list.xhtml"; + } + url = addQueryStringParam(url, "nomenu=true"); + content = new FullHTMLPane(url); + + + } else if ("Cluster".equals(section)) { + String url = null; + if ("Servers".equals(page)) { + url = "/rhq/ha/listServers.xhtml"; + } else if ("Agents".equals(page)) { + url = "/rhq/ha/listAgents.xhtml"; + } else if ("Affinity Groups".equals(page)) { + url = "/rhq/ha/listAffinityGroups.xhtml"; + } else if ("Partition Events".equals(page)) { + url = "/rhq/ha/listPartitionEvents.xhtml"; + } + url = addQueryStringParam(url, "nomenu=true"); + content = new FullHTMLPane(url); + } + + + for (String name : treeGrids.keySet()) { + + TreeGrid treeGrid = treeGrids.get(name); + if (name.equals(section)) { +// treeGrid.setSelectedPaths(page); + } else { + treeGrid.deselectAllRecords(); + } + } + + + + setContent(content); + + + if (content instanceof BookmarkableView) { + ((BookmarkableView) content).renderView(viewPath.next().next()); + } + + + } + + + public void renderView(ViewPath viewPath) { + + if (!viewPath.isCurrent(currentSectionViewId) || !viewPath.isNext(currentPageViewId)) { + + if (viewPath.isEnd()) { + // Display default view + setContent(defaultView()); + } else { + renderContentView(viewPath); + } + } else { + if (this.currentContent instanceof BookmarkableView) { + ((BookmarkableView) this.currentContent).renderView(viewPath.next().next()); + } + + } + + + } + + private static String addQueryStringParam(String url, String param) { + char separatorChar = (url.indexOf('?') == -1) ? '?' : '&'; + return url + separatorChar + param; + } +} \ No newline at end of file diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/tag/TagCloudView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/tag/TagCloudView.java index 9e183fb..0a78e50 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/tag/TagCloudView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/tag/TagCloudView.java @@ -109,7 +109,7 @@ public class TagCloudView extends VLayout {
int font = (int) ((((double) tag.getTotal()) / (double) max) * (maxFont - minFont)) + minFont;
- buf.append("<a href="#Tag/" + tag.getTag().toString() + "" style="font-size: " + font + "pt; margin: 8px;""); + buf.append("<a href="#Reports/Inventory/Tag Cloud/" + tag.getTag().toString() + "" style="font-size: " + font + "pt; margin: 8px;"");
buf.append(" title="Tag used " + tag.getTotal() + " times"");
commit 1b99ddfec45e3d718937f839fd998ddc118a5d2a Author: Greg Hinkle ghinkle@redhat.com Date: Tue Jul 27 12:40:23 2010 -0400
Role create/edit with working group and subject assignments
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/PermissionEditorView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/PermissionEditorView.java index 123e47d..74b9c34 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/PermissionEditorView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/PermissionEditorView.java @@ -54,11 +54,6 @@ public class PermissionEditorView extends CanvasItem { setCanvas(new SimpleCollapsiblePanel("Permissions", buildForm())); }
- @Override - public Canvas getCanvas() { - System.out.println("ANythinglksjgalksdjfalskdjfalkdjflaksjdfl?"); - return super.getCanvas(); // TODO: Implement this method. - }
public Canvas buildForm() { System.out.println("Building permissions canvas"); diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/RoleEditView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/RoleEditView.java index 523c822..cca86be 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/RoleEditView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/RoleEditView.java @@ -18,14 +18,15 @@ */ package org.rhq.enterprise.gui.coregui.client.admin.roles;
+import org.rhq.core.domain.auth.Subject; import org.rhq.core.domain.authz.Permission; import org.rhq.core.domain.authz.Role; import org.rhq.core.domain.resource.group.ResourceGroup; -import org.rhq.core.domain.util.PageList; import org.rhq.enterprise.gui.coregui.client.CoreGUI; import org.rhq.enterprise.gui.coregui.client.components.HeaderLabel; import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup; import org.rhq.enterprise.gui.coregui.client.inventory.resource.selection.ResourceGroupSelector; +import org.rhq.enterprise.gui.coregui.client.util.message.Message;
import com.google.gwt.user.client.rpc.AsyncCallback; import com.smartgwt.client.data.DSCallback; @@ -34,8 +35,10 @@ import com.smartgwt.client.data.DSResponse; import com.smartgwt.client.data.Record; import com.smartgwt.client.types.DSOperationType; import com.smartgwt.client.types.Overflow; +import com.smartgwt.client.types.TitleOrientation; import com.smartgwt.client.widgets.Canvas; import com.smartgwt.client.widgets.Label; +import com.smartgwt.client.widgets.Window; import com.smartgwt.client.widgets.form.DynamicForm; import com.smartgwt.client.widgets.form.events.SubmitValuesEvent; import com.smartgwt.client.widgets.form.events.SubmitValuesHandler; @@ -67,19 +70,20 @@ public class RoleEditView extends VLayout { private HeaderLabel editLabel; private DynamicForm form; private PermissionEditorView permissionEditorItem; - private CanvasItem selectorItem; + + private CanvasItem groupSelectorItem; private ResourceGroupSelector groupSelector;
+ private CanvasItem subjectSelectorItem; + private RoleSubjectSelector subjectSelector; + + private Window editorWindow; + + public RoleEditView() { super(); setPadding(10); setOverflow(Overflow.AUTO); - } - - @Override - protected void onInit() { - super.onInit(); -
addMember(message);
@@ -91,6 +95,8 @@ public class RoleEditView extends VLayout { private Canvas buildRoleForm() {
this.editCanvas = new VLayout(); + this.editCanvas.setWidth100(); + this.editCanvas.setHeight100();
editLabel = new HeaderLabel("Create User"); // TODO create header css style and set @@ -98,6 +104,8 @@ public class RoleEditView extends VLayout { editCanvas.addMember(editLabel);
form = new DynamicForm(); + form.setWidth100(); + form.setDataSource(RolesDataSource.getInstance());
TextItem idItem = new TextItem("id", "Id"); @@ -108,10 +116,17 @@ public class RoleEditView extends VLayout { permissionEditorItem.setShowTitle(false); permissionEditorItem.setColSpan(2);
- selectorItem = new CanvasItem("groupSelectionCanvas"); + groupSelectorItem = new CanvasItem("groupSelectionCanvas", "Assigned Resource Groups"); + groupSelectorItem.setCanvas(new Label("loading...")); //new RoleResourceGroupSelector(null)); + groupSelectorItem.setTitleOrientation(TitleOrientation.TOP); + groupSelectorItem.setColSpan(2); + + + subjectSelectorItem = new CanvasItem("subjectSelectionCanvas", "Assigned Subjects"); + subjectSelectorItem.setCanvas(new Label("loading...")); //new RoleSubjectSelector(null)); + subjectSelectorItem.setTitleOrientation(TitleOrientation.TOP); + subjectSelectorItem.setColSpan(2);
- selectorItem.setShowTitle(false); - selectorItem.setColSpan(2);
SubmitItem saveButton = new SubmitItem("save", "Save");
@@ -134,7 +149,8 @@ public class RoleEditView extends VLayout { idItem, nameItem, permissionEditorItem, - selectorItem, + groupSelectorItem, + subjectSelectorItem, saveButton, new ResetItem("reset", "Reset"));
editCanvas.addMember(form); @@ -153,19 +169,23 @@ public class RoleEditView extends VLayout { permissionEditorItem.setPermissions((Set<Permission>) record.getAttributeAsObject("permissions"));
groupSelector = new RoleResourceGroupSelector((Collection<ResourceGroup>) record.getAttributeAsObject("resourceGroups")); - selectorItem.setCanvas(groupSelector); + groupSelectorItem.setCanvas(groupSelector); + + + subjectSelector = new RoleSubjectSelector((Collection<Subject>) record.getAttributeAsObject("subjects")); + subjectSelectorItem.setCanvas(subjectSelector);
} catch (Throwable t) { t.printStackTrace(); } - markForRedraw(); +// markForRedraw(); }
public void editNone() { message.show(); editCanvas.hide();
- markForRedraw(); +// markForRedraw(); }
public void editNew() { @@ -174,6 +194,19 @@ public class RoleEditView extends VLayout { form.setSaveOperationType(DSOperationType.ADD);
editLabel.setContents("Create Role"); + + + editorWindow = new Window(); + editorWindow.setTitle("Create Role"); + editorWindow.setWidth(800); + editorWindow.setHeight(800); + editorWindow.setIsModal(true); + editorWindow.setShowModalMask(true); + editorWindow.setCanDragResize(true); + editorWindow.centerInPage(); + editorWindow.addItem(this); + editorWindow.show(); + }
@@ -190,7 +223,7 @@ public class RoleEditView extends VLayout { }
int roleId; - if (roleBeingEdited != null) { + if (roleBeingEdited != null && roleBeingEdited.getId() != null) { roleId = roleBeingEdited.getId(); } else { // new role @@ -202,13 +235,37 @@ public class RoleEditView extends VLayout { roleId, groupIds, new AsyncCallback<Void>() { public void onFailure(Throwable caught) { - CoreGUI.getErrorHandler().handleError("Failed to update role's assigned groups",caught); + CoreGUI.getErrorHandler().handleError("Failed to update role's assigned groups", caught); + } + + public void onSuccess(Void result) { + CoreGUI.getMessageCenter().notify(new Message("Updated assigned groups", Message.Severity.Info)); + } + }); + + HashSet<Integer> selectedSubjects = subjectSelector.getSelection(); + int[] subjectIds = new int[selectedSubjects.size()]; + i = 0; + for (Integer id : selectedSubjects) { + subjectIds[i++] = id; + } + + + GWTServiceLookup.getRoleService().setAssignedSubjects( + roleId, subjectIds, + new AsyncCallback<Void>() { + public void onFailure(Throwable caught) { + CoreGUI.getErrorHandler().handleError("Failed to update role's assigned subjects", caught); }
public void onSuccess(Void result) { - // TODO: Implement this method. + CoreGUI.getMessageCenter().notify(new Message("Updated role assigned subjects", Message.Severity.Info)); } }); + + if (editorWindow != null) { + editorWindow.destroy(); + } } }); } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/RoleSubjectSelector.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/RoleSubjectSelector.java new file mode 100644 index 0000000..4b8e940 --- /dev/null +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/RoleSubjectSelector.java @@ -0,0 +1,83 @@ +/* + * RHQ Management Platform + * Copyright (C) 2005-2010 Red Hat, Inc. + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License, version 2, as + * published by the Free Software Foundation, and/or the GNU Lesser + * General Public License, version 2.1, also as published by the Free + * Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License and the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License + * and the GNU Lesser General Public License along with this program; + * if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +package org.rhq.enterprise.gui.coregui.client.admin.roles; + +import java.util.Collection; + +import com.smartgwt.client.data.Criteria; +import com.smartgwt.client.widgets.form.DynamicForm; +import com.smartgwt.client.widgets.grid.ListGridRecord; + +import org.rhq.core.domain.auth.Subject; +import org.rhq.enterprise.gui.coregui.client.admin.users.UsersDataSource; +import org.rhq.enterprise.gui.coregui.client.components.selector.AbstractSelector; +import org.rhq.enterprise.gui.coregui.client.util.RPCDataSource; + +/** + * @author Greg Hinkle + */ +public class RoleSubjectSelector extends AbstractSelector<Subject> { + + + + public RoleSubjectSelector(Collection<Subject> subjects) { + super(); + if (subjects != null) { + ListGridRecord[] data = (new UsersDataSource()).buildRecords(subjects); + setAssigned(data); + } + } + + + + @Override + protected DynamicForm getAvailableFilterForm() { + return null; // TODO: Implement this method. + } + + @Override + protected RPCDataSource<Subject> getDataSource() { + return new SelectedSubjectsDataSource(); + } + + @Override + protected Criteria getLatestCriteria(DynamicForm availableFilterForm) { + return null; // TODO: Implement this method. + } + + + public class SelectedSubjectsDataSource extends UsersDataSource { + + @Override + public ListGridRecord[] buildRecords(Collection<Subject> subjects) { + ListGridRecord[] records = super.buildRecords(subjects); + for (ListGridRecord record : records) { + if (selection.contains(record.getAttributeAsInt("id"))) { + record.setEnabled(false); + } + } + return records; + } + } + +} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/RolesDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/RolesDataSource.java index 644b02d..5ddbde2 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/RolesDataSource.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/RolesDataSource.java @@ -63,8 +63,7 @@ public class RolesDataSource extends RPCDataSource<Role> { return INSTANCE; }
- private RolesDataSource() { - super("Roles"); + public RolesDataSource() {
DataSourceField idDataField = new DataSourceIntegerField("id", "ID"); idDataField.setPrimaryKey(true); diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/RolesView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/RolesView.java index dc36ee6..7c0f175 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/RolesView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/RolesView.java @@ -18,6 +18,8 @@ */ package org.rhq.enterprise.gui.coregui.client.admin.roles;
+import org.rhq.enterprise.gui.coregui.client.BookmarkableView; +import org.rhq.enterprise.gui.coregui.client.ViewPath; import org.rhq.enterprise.gui.coregui.client.components.table.Table; import org.rhq.enterprise.gui.coregui.client.components.table.TableAction;
@@ -33,7 +35,8 @@ import com.smartgwt.client.widgets.layout.VLayout; /** * @author Greg Hinkle */ -public class RolesView extends VLayout { +public class RolesView extends VLayout implements BookmarkableView { +
@Override @@ -104,17 +107,12 @@ public class RolesView extends VLayout {
RoleEditView editView = new RoleEditView();
- final Window roleEditor = new Window(); - roleEditor.setTitle("Create Role"); - roleEditor.setWidth(800); - roleEditor.setHeight(800); - roleEditor.setIsModal(true); - roleEditor.setShowModalMask(true); - roleEditor.setCanDragResize(true); - roleEditor.centerInPage(); - roleEditor.addItem(editView); - roleEditor.show(); - editView.editNew(); } + + public void renderView(ViewPath viewPath) { + + System.out.println("Display role list"); + + } } \ No newline at end of file
commit 6990d0ed3763c09166b0771429a96cfa9a204010 Author: Greg Hinkle ghinkle@redhat.com Date: Tue Jul 27 11:50:07 2010 -0400
Exposing subject roles assignments fixed bugs in set role groups assignments and set role subject assignments
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/RoleGWTService.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/RoleGWTService.java index 768b8f4..932ceb8 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/RoleGWTService.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/RoleGWTService.java @@ -41,4 +41,6 @@ public interface RoleGWTService extends RemoteService { void setAssignedResourceGroups(int roleId, int[] resourceGroupIds);
void setAssignedSubjects(int roleId, int[] subjectIds); + + void setAssignedSubjectRoles(int subjectId, int[] roleIds); } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/RoleGWTServiceImpl.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/RoleGWTServiceImpl.java index 1414025..87d9132 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/RoleGWTServiceImpl.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/RoleGWTServiceImpl.java @@ -18,6 +18,7 @@ */ package org.rhq.enterprise.gui.coregui.server.gwt;
+import org.rhq.core.domain.auth.Subject; import org.rhq.core.domain.authz.Role; import org.rhq.core.domain.criteria.RoleCriteria; import org.rhq.core.domain.util.PageList; @@ -60,4 +61,9 @@ public class RoleGWTServiceImpl extends AbstractGWTServiceImpl implements RoleGW public void setAssignedSubjects(int roleId, int[] subjectIds) { roleManager.setAssignedSubjects(getSessionSubject(), roleId, subjectIds); } + + + public void setAssignedSubjectRoles(int subjectId, int[] roleIds) { + roleManager.setAssignedSubjectRoles(getSessionSubject(), subjectId, roleIds); + } } \ No newline at end of file diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/authz/RoleManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/authz/RoleManagerBean.java index 30feae3..c53d399 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/authz/RoleManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/authz/RoleManagerBean.java @@ -76,7 +76,7 @@ public class RoleManagerBean implements RoleManagerLocal, RoleManagerRemote { private AlertNotificationManagerLocal alertNotificationManager;
/** - * @see org.rhq.enterprise.server.authz.RoleManagerLocal#findRolesBySubject(Subject,PageControl) + * @see org.rhq.enterprise.server.authz.RoleManagerLocal#findRolesBySubject(int subjectId,PageControl pageControl) */ @SuppressWarnings("unchecked") // the first param, subject, is not the subject making the request, its the subject whose roles are to be returned. @@ -262,6 +262,41 @@ public class RoleManagerBean implements RoleManagerLocal, RoleManagerRemote { return; }
+ + @RequiredPermission(Permission.MANAGE_SECURITY) + public void setAssignedSubjectRoles(Subject subject, int subjectId, int[] roleIds) { + + Subject subjectToModify = subjectManager.getSubjectById(subjectId); // attach it + List<Integer> currentRoles = new ArrayList<Integer>(); + for (Role role : subjectToModify.getRoles()) { + currentRoles.add(role.getId()); + } + + List<Integer> newRoles = ArrayUtils.wrapInList(roleIds); // members needing addition + newRoles.removeAll(currentRoles); + if (newRoles.size() > 0) { + int[] newRoleIds = new int[newRoles.size()]; + int i = 0; + for (Integer id : newRoles) { + newRoleIds[i++] = id; + } + addRolesToSubject(subject, subjectId, newRoleIds); + } + + List<Integer> extraMembers = new ArrayList<Integer>(currentRoles); // members needing removal + extraMembers.removeAll(ArrayUtils.wrapInList(roleIds)); + if (extraMembers.size() > 0) { + int[] extraMemberIds = new int[extraMembers.size()]; + int i = 0; + for (Integer id : extraMembers) { + extraMemberIds[i++] = id; + } + removeRolesFromSubject(subject, subjectId, extraMemberIds); + } + } + + + /** * @see org.rhq.enterprise.server.authz.RoleManagerLocal#getRoleById(Integer) */ @@ -306,7 +341,7 @@ public class RoleManagerBean implements RoleManagerLocal, RoleManagerRemote { }
/** - * @see org.rhq.enterprise.server.authz.RoleManagerRemote#findSubjectsByRole(Subject,Integer,PageControl) + * @see org.rhq.enterprise.server.authz.RoleManagerLocal#findSubjectsByRole(Integer roleId,PageControl pageControl) */ public PageList<Subject> findSubjectsByRole(Subject subject, Integer roleId, PageControl pc) { return findSubjectsByRole(roleId, pc); @@ -464,13 +499,24 @@ public class RoleManagerBean implements RoleManagerLocal, RoleManagerRemote { List<Integer> newMembers = ArrayUtils.wrapInList(groupIds); // members needing addition newMembers.removeAll(currentMembers); if (newMembers.size() > 0) { - addResourceGroupsToRole(subject, roleId, groupIds); + int[] newMemberInts = new int[newMembers.size()]; + int i = 0; + for (Integer id : newMembers) { + newMemberInts[i++] = id; + } + addResourceGroupsToRole(subject, roleId, newMemberInts); }
List<Integer> extraMembers = new ArrayList<Integer>(currentMembers); // members needing removal extraMembers.removeAll(ArrayUtils.wrapInList(groupIds)); if (extraMembers.size() > 0) { - removeResourceGroupsFromRole(subject, roleId, groupIds); + int[] removeMemberInts = new int[extraMembers.size()]; + int i = 0; + for (Integer id : extraMembers) { + removeMemberInts[i++] = id; + } + + removeResourceGroupsFromRole(subject, roleId, removeMemberInts); } }
@@ -520,13 +566,23 @@ public class RoleManagerBean implements RoleManagerLocal, RoleManagerRemote { List<Integer> newMembers = ArrayUtils.wrapInList(subjectIds); // members needing addition newMembers.removeAll(currentMembers); if (newMembers.size() > 0) { - addSubjectsToRole(subject, roleId, subjectIds); + int[] newMemberIds = new int[newMembers.size()]; + int i = 0; + for (Integer id : newMembers) { + newMemberIds[i++] = id; + } + addSubjectsToRole(subject, roleId, newMemberIds); }
List<Integer> extraMembers = new ArrayList<Integer>(currentMembers); // members needing removal extraMembers.removeAll(ArrayUtils.wrapInList(subjectIds)); if (extraMembers.size() > 0) { - removeSubjectsFromRole(subject, roleId, subjectIds); + int[] removeMemberIds = new int[extraMembers.size()]; + int i = 0; + for (Integer id : extraMembers) { + removeMemberIds[i++] = id; + } + removeSubjectsFromRole(subject, roleId, removeMemberIds); } }
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/authz/RoleManagerLocal.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/authz/RoleManagerLocal.java index 3b6e6e2..496d607 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/authz/RoleManagerLocal.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/authz/RoleManagerLocal.java @@ -184,6 +184,9 @@ public interface RoleManagerLocal { */ void removeRolesFromSubject(Subject subject, int subjectId, int[] roleIds);
+ void setAssignedSubjectRoles(Subject subject, int subjectId, int[] roleIds); + + void addSubjectsToRole(Subject subject, int roleId, int[] subjectIds);
void removeSubjectsFromRole(Subject subject, int roleId, int[] subjectIds); diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/authz/RoleManagerRemote.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/authz/RoleManagerRemote.java index e0008cc..4755b36 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/authz/RoleManagerRemote.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/authz/RoleManagerRemote.java @@ -166,6 +166,15 @@ public interface RoleManagerRemote { @WebParam(name = "subjectIds") int[] subjectIds);
/** + * Sets the set of roles assigned to a subject. Requires SECURITY_ADMIN + * @param subject + * @param subjectId + * @param roleIds + */ + @WebMethod + void setAssignedSubjectRoles(Subject subject, int subjectId, int[] roleIds); + + /** * Adds the given resource groups to the given role. * * @param subject The logged in user's subject.
commit c84efa61e275be2e79b37a994bef5d4b9ef35afe Author: Greg Hinkle ghinkle@redhat.com Date: Tue Jul 27 11:48:10 2010 -0400
User create/edit with working role assignments
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/users/SubjectRoleSelector.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/users/SubjectRoleSelector.java new file mode 100644 index 0000000..e554fef --- /dev/null +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/users/SubjectRoleSelector.java @@ -0,0 +1,86 @@ +/* + * RHQ Management Platform + * Copyright (C) 2005-2010 Red Hat, Inc. + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License, version 2, as + * published by the Free Software Foundation, and/or the GNU Lesser + * General Public License, version 2.1, also as published by the Free + * Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License and the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License + * and the GNU Lesser General Public License along with this program; + * if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +package org.rhq.enterprise.gui.coregui.client.admin.users; + +import java.util.Collection; + +import com.smartgwt.client.data.Criteria; +import com.smartgwt.client.widgets.form.DynamicForm; +import com.smartgwt.client.widgets.grid.ListGridRecord; + +import org.rhq.core.domain.authz.Role; +import org.rhq.core.domain.resource.Resource; +import org.rhq.core.domain.resource.group.ResourceGroup; +import org.rhq.enterprise.gui.coregui.client.admin.roles.RolesDataSource; +import org.rhq.enterprise.gui.coregui.client.components.selector.AbstractSelector; +import org.rhq.enterprise.gui.coregui.client.inventory.groups.ResourceGroupsDataSource; +import org.rhq.enterprise.gui.coregui.client.util.RPCDataSource; + +/** + * @author Greg Hinkle + */ +public class SubjectRoleSelector extends AbstractSelector<Role> { + + + public SubjectRoleSelector(Collection<Role> roles) { + super(); + if (roles != null) { + ListGridRecord[] data = (new RolesDataSource()).buildRecords(roles); + setAssigned(data); + } + } + + + + @Override + protected DynamicForm getAvailableFilterForm() { + return null; // TODO: Implement this method. + } + + @Override + protected RPCDataSource<Role> getDataSource() { + return new SelectedRolesDataSource(); + + } + + @Override + protected Criteria getLatestCriteria(DynamicForm availableFilterForm) { + return null; // TODO: Implement this method. + } + + + public class SelectedRolesDataSource extends RolesDataSource { + + @Override + public ListGridRecord[] buildRecords(Collection<Role> roles) { + ListGridRecord[] records = super.buildRecords(roles); + for (ListGridRecord record : records) { + if (selection.contains(record.getAttributeAsInt("id"))) { + record.setEnabled(false); + } + } + return records; + } + } + +} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/users/SubjectRolesEditorItem.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/users/SubjectRolesEditorItem.java index 72fc465..38f0e7a 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/users/SubjectRolesEditorItem.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/users/SubjectRolesEditorItem.java @@ -56,7 +56,7 @@ public class SubjectRolesEditorItem extends CanvasItem { super(name, title); setShowTitle(false); setColSpan(2); - setWidth("90%"); +// setWidth("90%"); setCanvas(new SimpleCollapsiblePanel("Assigned Roles", buildForm())); }
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/users/UserEditView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/users/UserEditView.java index edfddbd..334315b 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/users/UserEditView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/users/UserEditView.java @@ -20,13 +20,25 @@ package org.rhq.enterprise.gui.coregui.client.admin.users;
import org.rhq.core.domain.auth.Subject; import org.rhq.core.domain.authz.Role; +import org.rhq.enterprise.gui.coregui.client.CoreGUI; import org.rhq.enterprise.gui.coregui.client.components.HeaderLabel; +import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup; +import org.rhq.enterprise.gui.coregui.client.util.message.Message;
+import com.google.gwt.user.client.rpc.AsyncCallback; +import com.smartgwt.client.data.DSCallback; +import com.smartgwt.client.data.DSRequest; +import com.smartgwt.client.data.DSResponse; import com.smartgwt.client.data.Record; +import com.smartgwt.client.types.Alignment; import com.smartgwt.client.types.DSOperationType; +import com.smartgwt.client.types.TitleOrientation; import com.smartgwt.client.widgets.Canvas; +import com.smartgwt.client.widgets.IButton; import com.smartgwt.client.widgets.Label; +import com.smartgwt.client.widgets.Window; import com.smartgwt.client.widgets.form.DynamicForm; +import com.smartgwt.client.widgets.form.fields.CanvasItem; import com.smartgwt.client.widgets.form.fields.ResetItem; import com.smartgwt.client.widgets.form.fields.SectionItem; import com.smartgwt.client.widgets.form.fields.SubmitItem; @@ -34,8 +46,10 @@ import com.smartgwt.client.widgets.form.fields.TextItem; import com.smartgwt.client.widgets.form.fields.events.ClickEvent; import com.smartgwt.client.widgets.form.fields.events.ClickHandler; import com.smartgwt.client.widgets.grid.ListGridRecord; +import com.smartgwt.client.widgets.layout.HLayout; import com.smartgwt.client.widgets.layout.VLayout;
+import java.util.HashSet; import java.util.Set;
/** @@ -46,28 +60,33 @@ public class UserEditView extends VLayout {
private Label message = new Label("Select a user to edit...");
- private SubjectRolesEditorItem subjectRolesEditorItem ; +// private SubjectRolesEditorItem subjectRolesEditorItem ;
private VLayout editCanvas; private HeaderLabel editLabel; private DynamicForm form;
+ CanvasItem roleSelectionItem; + private UsersDataSource dataSource;
private Subject subject;
- @Override - protected void onInit() { - super.onInit(); + private Window editorWindow; + private SubjectRoleSelector roleSelector; +
+ public UserEditView() { + dataSource = UsersDataSource.getInstance(); + setWidth100(); setHeight100();
buildSubjectEditor(); - form.hide(); + editCanvas.hide();
addMember(message); - addMember(form); + addMember(editCanvas);
}
@@ -75,6 +94,9 @@ public class UserEditView extends VLayout { form = new DynamicForm(); form.setWidth100();
+ form.setHiliteRequiredFields(true); + form.setRequiredTitleSuffix("* :"); + SectionItem userEditSection = new SectionItem("userEditSection", "Edit User");
@@ -97,43 +119,109 @@ public class UserEditView extends VLayout { // form.setField//s(userEditSection);
- dataSource = UsersDataSource.getInstance();
form.setUseAllDataSourceFields(true); form.setDataSource(dataSource);
- subjectRolesEditorItem = new SubjectRolesEditorItem("rolesEditor","Assigned Roles");
- TextItem departmentItem = new TextItem("department");
+ this.roleSelectionItem = new CanvasItem("selectRoles", "Select Roles"); + this.roleSelectionItem.setTitleOrientation(TitleOrientation.TOP); + this.roleSelectionItem.setColSpan(2); +// roleSelectionItem.setCanvas(new SubjectRoleSelector(null));
- SubmitItem saveButton = new SubmitItem("save", "Save"); + TextItem departmentItem = new TextItem("department"); + departmentItem.setRequired(false); + + + IButton saveButton = new IButton("Save"); + saveButton.addClickHandler(new com.smartgwt.client.widgets.events.ClickHandler() { + public void onClick(com.smartgwt.client.widgets.events.ClickEvent clickEvent) { + if (form.validate()) { + save(); + if (editorWindow != null) { + editorWindow.destroy(); + CoreGUI.refresh(); + } + } + } + });
- saveButton.addClickHandler(new ClickHandler() { - public void onClick(ClickEvent clickEvent) { - form.saveData(); - System.out.println("Save is done"); + IButton resetButton = new IButton("Reset"); + resetButton.addClickHandler(new com.smartgwt.client.widgets.events.ClickHandler() { + public void onClick(com.smartgwt.client.widgets.events.ClickEvent clickEvent) { + form.reset(); } });
+ IButton cancelButton = new IButton("Cancel"); + cancelButton.addClickHandler(new com.smartgwt.client.widgets.events.ClickHandler() { + public void onClick(com.smartgwt.client.widgets.events.ClickEvent clickEvent) { + if (editorWindow != null) { + editorWindow.destroy(); + } else { + form.reset(); + } + } + }); + + HLayout buttonLayout = new HLayout(10); + buttonLayout.setAlign(Alignment.CENTER); + buttonLayout.addMember(saveButton); + buttonLayout.addMember(resetButton); + buttonLayout.addMember(cancelButton); + +
- ResetItem resetButton = new ResetItem("reset", "Reset"); + form.setItems(departmentItem, roleSelectionItem);
- form.setItems(departmentItem, subjectRolesEditorItem, saveButton, resetButton);
- return form; + editCanvas = new VLayout();
+ editCanvas.addMember(form); + editCanvas.addMember(buttonLayout); + + return editCanvas;
}
+ private void save() { + final HashSet<Integer> roles = roleSelector.getSelection(); + form.saveData(new DSCallback() { + public void execute(DSResponse dsResponse, Object o, DSRequest dsRequest) { + + int subjectId = Integer.parseInt(new ListGridRecord(dsRequest.getData()).getAttribute("id")); + + int[] roleIds = new int[roles.size()]; + int i = 0; + for (Integer id : roles) { + roleIds[i++] = id; + } + + GWTServiceLookup.getRoleService().setAssignedSubjectRoles(subjectId, roleIds, + new AsyncCallback<Void>() { + public void onFailure(Throwable caught) { + CoreGUI.getErrorHandler().handleError("Failed to set subject role assignments.",caught); + } + + public void onSuccess(Void result) { + CoreGUI.getMessageCenter().notify(new Message("Succesfully saved new user roles.", Message.Severity.Info)); + } + }); + + } + }); + } +
public void editRecord(Record record) {
- form.getDataSource().getField("username").setCanEdit(record.getAttribute("id") == null); +// form.getDataSource().getField("username").setCanEdit(true );
- subjectRolesEditorItem.setSubject((Subject) record.getAttributeAsObject("entity")); - subjectRolesEditorItem.setRoles((Set<Role>) record.getAttributeAsObject("roles")); + + roleSelector = new SubjectRoleSelector((Set<Role>) record.getAttributeAsObject("roles")); + roleSelectionItem.setCanvas(roleSelector);
try { form.editRecord(record); @@ -141,7 +229,7 @@ public class UserEditView extends VLayout { t.printStackTrace(); } message.hide(); - form.show(); + editCanvas.show(); form.setSaveOperationType(DSOperationType.UPDATE);
markForRedraw(); @@ -149,17 +237,36 @@ public class UserEditView extends VLayout {
public void editNone() { message.show(); - form.hide(); + editCanvas.hide(); markForRedraw(); }
- public void editNew() { - form.getDataSource().getField("username").setCanEdit(true); + private void editNewInternal() { subject = new Subject(); ListGridRecord r = dataSource.copyValues(subject); editRecord(r); +// form.getDataSource().getField("username").setCanEdit(false); form.setSaveOperationType(DSOperationType.ADD);
+ editorWindow = new Window(); + editorWindow.setTitle("Create User"); + editorWindow.setWidth(800); + editorWindow.setHeight(800); + editorWindow.setIsModal(true); + editorWindow.setShowModalMask(true); + editorWindow.setCanDragResize(true); + editorWindow.centerInPage(); + editorWindow.addItem(this); + editorWindow.show(); + + } + + public static void editNew() { + UserEditView editView = new UserEditView(); + editView.editNewInternal(); + + + }
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/users/UsersDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/users/UsersDataSource.java index b76788b..578d2b6 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/users/UsersDataSource.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/users/UsersDataSource.java @@ -70,14 +70,13 @@ public class UsersDataSource extends RPCDataSource<Subject> { }
- private UsersDataSource() { - super("Users"); - + public UsersDataSource() { + DataSourceField idDataField = new DataSourceIntegerField("id", "ID"); idDataField.setPrimaryKey(true); idDataField.setCanEdit(false);
- DataSourceTextField usernameField = new DataSourceTextField("username", "User Name", 100, true); + DataSourceTextField usernameField = new DataSourceTextField("name", "User Name", 100, true);
DataSourceTextField firstName = new DataSourceTextField("firstName", "First Name", 100, true);
@@ -101,11 +100,11 @@ public class UsersDataSource extends RPCDataSource<Subject> { passwordVerify.setValidators(passwordsEqualValidator);
- DataSourceTextField email = new DataSourceTextField("email", "Email Address", 100, true); + DataSourceTextField emailAddress = new DataSourceTextField("emailAddress", "Email Address", 100, true);
- DataSourceTextField phone = new DataSourceTextField("phoneNumber", "Phone"); + DataSourceTextField phone = new DataSourceTextField("phoneNumber", "Phone", 15, false);
- DataSourceTextField department = new DataSourceTextField("department", "Department"); + DataSourceTextField department = new DataSourceTextField("department", "Department", 100, false);
DataSourceField roles = new DataSourceField(); roles.setForeignKey("Roles.id"); @@ -113,7 +112,7 @@ public class UsersDataSource extends RPCDataSource<Subject> { roles.setMultiple(true);
- setFields(idDataField, usernameField, firstName, lastName, password, passwordVerify, phone, email, department); + setFields(idDataField, usernameField, firstName, lastName, password, passwordVerify, phone, emailAddress, department); }
@@ -122,6 +121,7 @@ public class UsersDataSource extends RPCDataSource<Subject> {
SubjectCriteria criteria = new SubjectCriteria(); criteria.setPageControl(getPageControl(request)); + criteria.fetchRoles(true);
subjectService.findSubjectsByCriteria(criteria, new AsyncCallback<PageList<Subject>>() { public void onFailure(Throwable caught) { @@ -158,7 +158,7 @@ public class UsersDataSource extends RPCDataSource<Subject> { public void onFailure(Throwable caught) { // TODO better exceptions so we can set the right validation errors Map<String, String> errors = new HashMap<String, String>(); - errors.put("username", "A user with this name already exists."); + errors.put("name", "A user with this name already exists."); response.setErrors(errors); // CoreGUI.getErrorHandler().handleError("Failed to create role",caught); response.setStatus(RPCResponse.STATUS_VALIDATION_ERROR); @@ -243,13 +243,13 @@ public class UsersDataSource extends RPCDataSource<Subject> { public Subject copyValues(ListGridRecord from) { Subject to = new Subject(); to.setId(from.getAttributeAsInt("id")); - to.setName(from.getAttributeAsString("username")); + to.setName(from.getAttributeAsString("name")); to.setFirstName(from.getAttributeAsString("firstName")); to.setLastName(from.getAttributeAsString("lastName")); to.setFactive(from.getAttributeAsBoolean("factive")); to.setDepartment(from.getAttributeAsString("department")); to.setPhoneNumber(from.getAttributeAsString("phoneNumber")); - to.setEmailAddress(from.getAttributeAsString("email")); + to.setEmailAddress(from.getAttributeAsString("emailAddress"));
to.setRoles((Set<Role>) from.getAttributeAsObject("roles")); return to; @@ -258,13 +258,13 @@ public class UsersDataSource extends RPCDataSource<Subject> { public ListGridRecord copyValues(Subject from) { ListGridRecord to = new ListGridRecord(); to.setAttribute("id", from.getId()); - to.setAttribute("username", from.getName()); + to.setAttribute("name", from.getName()); to.setAttribute("firstName", from.getFirstName()); to.setAttribute("lastName", from.getLastName()); to.setAttribute("factive", from.getFactive()); to.setAttribute("department", from.getDepartment()); to.setAttribute("phoneNumber", from.getPhoneNumber()); - to.setAttribute("email", from.getEmailAddress()); + to.setAttribute("emailAddress", from.getEmailAddress());
to.setAttribute("roles", from.getRoles());
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/users/UsersView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/users/UsersView.java index a574eb2..bc070bf 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/users/UsersView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/users/UsersView.java @@ -59,9 +59,9 @@ public class UsersView extends VLayout { ListGridField idField = new ListGridField("id", "Id", 55); idField.setType(ListGridFieldType.INTEGER);
- ListGridField nameField = new ListGridField("username", "Name", 100); + ListGridField nameField = new ListGridField("name", "User Name", 100);
- ListGridField emailField = new ListGridField("email", "Email Address"); + ListGridField emailField = new ListGridField("emailAddress", "Email Address");
table.getListGrid().setFields(idField, nameField, emailField);
@@ -110,19 +110,7 @@ public class UsersView extends VLayout {
public void createUser() {
- UserEditView editView = new UserEditView();
- final Window roleEditor = new Window(); - roleEditor.setTitle("Create User"); - roleEditor.setWidth(800); - roleEditor.setHeight(800); - roleEditor.setIsModal(true); - roleEditor.setShowModalMask(true); - roleEditor.setCanDragResize(true); - roleEditor.centerInPage(); - roleEditor.addItem(editView); - roleEditor.show(); - - editView.editNew(); + UserEditView.editNew(); } }
commit df86722f3ea043ae0169601b8a4c4a31113d004f Author: Greg Hinkle ghinkle@redhat.com Date: Tue Jul 27 11:17:07 2010 -0400
Moved the abstract selector to the components package as its a generic utility component
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/BundleSelector.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/BundleSelector.java index e1b94f0..aaca7be 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/BundleSelector.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/BundleSelector.java @@ -35,9 +35,9 @@ import org.rhq.core.domain.bundle.Bundle; import org.rhq.core.domain.bundle.BundleType; import org.rhq.enterprise.gui.coregui.client.CoreGUI; import org.rhq.enterprise.gui.coregui.client.bundle.list.BundlesDataSource; +import org.rhq.enterprise.gui.coregui.client.components.selector.AbstractSelector; import org.rhq.enterprise.gui.coregui.client.gwt.BundleGWTServiceAsync; import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup; -import org.rhq.enterprise.gui.coregui.client.inventory.resource.selection.AbstractSelector; import org.rhq.enterprise.gui.coregui.client.util.RPCDataSource;
/** diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/selector/AbstractSelector.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/selector/AbstractSelector.java new file mode 100644 index 0000000..8b13207 --- /dev/null +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/selector/AbstractSelector.java @@ -0,0 +1,286 @@ +/* + * RHQ Management Platform + * Copyright (C) 2005-2010 Red Hat, Inc. + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ +package org.rhq.enterprise.gui.coregui.client.components.selector; + +import java.util.HashSet; + +import com.google.gwt.user.client.Timer; +import com.smartgwt.client.data.Criteria; +import com.smartgwt.client.data.Record; +import com.smartgwt.client.types.DragDataAction; +import com.smartgwt.client.types.DragTrackerMode; +import com.smartgwt.client.types.ListGridFieldType; +import com.smartgwt.client.types.VerticalAlignment; +import com.smartgwt.client.widgets.ImgProperties; +import com.smartgwt.client.widgets.TransferImgButton; +import com.smartgwt.client.widgets.events.ClickEvent; +import com.smartgwt.client.widgets.events.ClickHandler; +import com.smartgwt.client.widgets.events.DoubleClickEvent; +import com.smartgwt.client.widgets.events.DoubleClickHandler; +import com.smartgwt.client.widgets.events.KeyPressEvent; +import com.smartgwt.client.widgets.events.KeyPressHandler; +import com.smartgwt.client.widgets.form.DynamicForm; +import com.smartgwt.client.widgets.form.events.ItemChangedEvent; +import com.smartgwt.client.widgets.form.events.ItemChangedHandler; +import com.smartgwt.client.widgets.grid.ListGrid; +import com.smartgwt.client.widgets.grid.ListGridField; +import com.smartgwt.client.widgets.grid.ListGridRecord; +import com.smartgwt.client.widgets.grid.events.RecordDropEvent; +import com.smartgwt.client.widgets.grid.events.RecordDropHandler; +import com.smartgwt.client.widgets.grid.events.SelectionChangedHandler; +import com.smartgwt.client.widgets.grid.events.SelectionEvent; +import com.smartgwt.client.widgets.layout.HLayout; +import com.smartgwt.client.widgets.layout.VLayout; +import com.smartgwt.client.widgets.layout.VStack; + +import org.rhq.enterprise.gui.coregui.client.util.RPCDataSource; + +/** + * @author Greg Hinkle + */ +public abstract class AbstractSelector<T> extends VLayout { + + protected HashSet<Integer> selection = new HashSet<Integer>(); + + protected ListGridRecord[] initialSelection; + + protected ListGrid availableGrid; + protected ListGrid assignedGrid; + + protected TransferImgButton addButton; + protected TransferImgButton removeButton; + protected TransferImgButton addAllButton; + protected TransferImgButton removeAllButton; + + protected Criteria latestCriteria; + + public AbstractSelector() { + } + + public void setAssigned(ListGridRecord[] assignedRecords) { + initialSelection = assignedRecords; + } + + public HashSet<Integer> getSelection() { + return selection; + } + + protected abstract DynamicForm getAvailableFilterForm(); + + protected abstract RPCDataSource<T> getDataSource(); + + protected abstract Criteria getLatestCriteria(DynamicForm availableFilterForm); + + @Override + protected void onInit() { + super.onInit(); + + final DynamicForm availableFilterForm = getAvailableFilterForm(); + + if (availableFilterForm != null) { + addMember(availableFilterForm); + } + + HLayout hlayout = new HLayout(); + hlayout.setAlign(VerticalAlignment.BOTTOM); + + // LEFT SIDE + availableGrid = new ListGrid(); + availableGrid.setHeight(350); + availableGrid.setCanDragRecordsOut(true); + availableGrid.setDragTrackerMode(DragTrackerMode.ICON); + availableGrid.setTrackerImage(new ImgProperties("types/Service_up_16.png", 16, 16)); + availableGrid.setDragDataAction(DragDataAction.COPY); + availableGrid.setDataSource(getDataSource()); + availableGrid.setFetchDelay(700); + + availableGrid.setAutoFetchData(true); + availableGrid.setFields(new ListGridField("icon", 50), new ListGridField("name")); + + hlayout.addMember(availableGrid); + + if (availableFilterForm != null) { + availableFilterForm.addItemChangedHandler(new ItemChangedHandler() { + public void onItemChanged(ItemChangedEvent itemChangedEvent) { + latestCriteria = getLatestCriteria(availableFilterForm); + + Timer t = new Timer() { + @Override + public void run() { + if (latestCriteria != null) { + Criteria c = latestCriteria; + latestCriteria = null; + availableGrid.fetchData(c); + } + } + }; + t.schedule(500); + } + }); + } + // CENTER BUTTONS + VStack moveButtonStack = new VStack(6); + moveButtonStack.setAlign(VerticalAlignment.CENTER); + moveButtonStack.setWidth(40); + + addButton = new TransferImgButton(TransferImgButton.RIGHT); + addButton.setDisabled(true); + removeButton = new TransferImgButton(TransferImgButton.LEFT); + removeButton.setDisabled(true); + addAllButton = new TransferImgButton(TransferImgButton.RIGHT_ALL); + removeAllButton = new TransferImgButton(TransferImgButton.LEFT_ALL); + removeAllButton.setDisabled(true); + + moveButtonStack.addMember(addButton); + moveButtonStack.addMember(removeButton); + moveButtonStack.addMember(addAllButton); + moveButtonStack.addMember(removeAllButton); + + hlayout.addMember(moveButtonStack); + + // RIGHT SIDE + + assignedGrid = new ListGrid(); + assignedGrid.setHeight(350); + assignedGrid.setCanReorderRecords(true); + assignedGrid.setCanDragRecordsOut(true); + + assignedGrid.setCanAcceptDroppedRecords(true); + ListGridField iconField = new ListGridField("icon", 50); + iconField.setType(ListGridFieldType.ICON); + assignedGrid.setFields(iconField, new ListGridField("name")); + + hlayout.addMember(assignedGrid); + + addButton.addClickHandler(new ClickHandler() { + public void onClick(ClickEvent clickEvent) { + assignedGrid.transferSelectedData(availableGrid); + select(assignedGrid.getSelection()); + updateButtons(); + } + }); + removeButton.addClickHandler(new ClickHandler() { + public void onClick(ClickEvent clickEvent) { + deselect(assignedGrid.getSelection()); + assignedGrid.removeSelectedData(); + updateButtons(); + } + }); + addAllButton.addClickHandler(new ClickHandler() { + public void onClick(ClickEvent clickEvent) { + availableGrid.selectAllRecords(); + assignedGrid.transferSelectedData(availableGrid); + select(availableGrid.getSelection()); + updateButtons(); + } + }); + removeAllButton.addClickHandler(new ClickHandler() { + public void onClick(ClickEvent clickEvent) { + assignedGrid.selectAllRecords(); + deselect(assignedGrid.getSelection()); + assignedGrid.removeSelectedData(); + updateButtons(); + } + }); + + availableGrid.addDoubleClickHandler(new DoubleClickHandler() { + public void onDoubleClick(DoubleClickEvent event) { + assignedGrid.transferSelectedData(availableGrid); + select(assignedGrid.getSelection()); + updateButtons(); + } + }); + + assignedGrid.addDoubleClickHandler(new DoubleClickHandler() { + public void onDoubleClick(DoubleClickEvent event) { + deselect(assignedGrid.getSelection()); + assignedGrid.removeSelectedData(); + updateButtons(); + } + }); + + availableGrid.addSelectionChangedHandler(new SelectionChangedHandler() { + public void onSelectionChanged(SelectionEvent selectionEvent) { + updateButtons(); + } + }); + + assignedGrid.addSelectionChangedHandler(new SelectionChangedHandler() { + public void onSelectionChanged(SelectionEvent selectionEvent) { + updateButtons(); + } + }); + + assignedGrid.addKeyPressHandler(new KeyPressHandler() { + public void onKeyPress(KeyPressEvent event) { + if ("Delete".equals(event.getKeyName())) { + deselect(assignedGrid.getSelection()); + assignedGrid.removeSelectedData(); + } + } + }); + + assignedGrid.addRecordDropHandler(new RecordDropHandler() { + public void onRecordDrop(RecordDropEvent recordDropEvent) { + select(recordDropEvent.getDropRecords()); + } + }); + + if (initialSelection != null) { + assignedGrid.setData(initialSelection); + for (ListGridRecord record : initialSelection) { + selection.add(record.getAttributeAsInt("id")); + } + } + + addMember(hlayout); + + } + + protected void updateButtons() { + addButton.setDisabled(!availableGrid.anySelected() || availableGrid.getTotalRows() == 0); + removeButton.setDisabled(!assignedGrid.anySelected() || assignedGrid.getTotalRows() == 0); + addAllButton.setDisabled(availableGrid.getTotalRows() == 0); + removeAllButton.setDisabled(assignedGrid.getTotalRows() == 0); + } + + protected void select(ListGridRecord[] records) { + availableGrid.deselectAllRecords(); + for (ListGridRecord record : records) { + record.setEnabled(false); + selection.add(record.getAttributeAsInt("id")); + } + } + + protected void deselect(ListGridRecord[] records) { + HashSet<Integer> toRemove = new HashSet<Integer>(); + for (ListGridRecord record : records) { + toRemove.add(record.getAttributeAsInt("id")); + } + selection.removeAll(toRemove); + + for (Integer id : toRemove) { + Record r = availableGrid.getDataAsRecordList().find("id", id); + if (r != null) { + ((ListGridRecord) r).setEnabled(true); + } + } + availableGrid.markForRedraw(); + } +} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/selection/AbstractSelector.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/selection/AbstractSelector.java deleted file mode 100644 index d51fe2a..0000000 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/selection/AbstractSelector.java +++ /dev/null @@ -1,283 +0,0 @@ -/* - * RHQ Management Platform - * Copyright (C) 2005-2010 Red Hat, Inc. - * All rights reserved. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation version 2 of the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ -package org.rhq.enterprise.gui.coregui.client.inventory.resource.selection; - -import java.util.HashSet; - -import com.google.gwt.user.client.Timer; -import com.smartgwt.client.data.Criteria; -import com.smartgwt.client.data.Record; -import com.smartgwt.client.types.DragDataAction; -import com.smartgwt.client.types.DragTrackerMode; -import com.smartgwt.client.types.ListGridFieldType; -import com.smartgwt.client.types.VerticalAlignment; -import com.smartgwt.client.widgets.ImgProperties; -import com.smartgwt.client.widgets.TransferImgButton; -import com.smartgwt.client.widgets.events.ClickEvent; -import com.smartgwt.client.widgets.events.ClickHandler; -import com.smartgwt.client.widgets.events.DoubleClickEvent; -import com.smartgwt.client.widgets.events.DoubleClickHandler; -import com.smartgwt.client.widgets.events.KeyPressEvent; -import com.smartgwt.client.widgets.events.KeyPressHandler; -import com.smartgwt.client.widgets.form.DynamicForm; -import com.smartgwt.client.widgets.form.events.ItemChangedEvent; -import com.smartgwt.client.widgets.form.events.ItemChangedHandler; -import com.smartgwt.client.widgets.grid.ListGrid; -import com.smartgwt.client.widgets.grid.ListGridField; -import com.smartgwt.client.widgets.grid.ListGridRecord; -import com.smartgwt.client.widgets.grid.events.RecordDropEvent; -import com.smartgwt.client.widgets.grid.events.RecordDropHandler; -import com.smartgwt.client.widgets.grid.events.SelectionChangedHandler; -import com.smartgwt.client.widgets.grid.events.SelectionEvent; -import com.smartgwt.client.widgets.layout.HLayout; -import com.smartgwt.client.widgets.layout.VLayout; -import com.smartgwt.client.widgets.layout.VStack; - -import org.rhq.enterprise.gui.coregui.client.util.RPCDataSource; - -/** - * @author Greg Hinkle - */ -public abstract class AbstractSelector<T> extends VLayout { - - protected HashSet<Integer> selection = new HashSet<Integer>(); - - protected ListGridRecord[] initialSelection; - - protected ListGrid availableGrid; - protected ListGrid assignedGrid; - - protected TransferImgButton addButton; - protected TransferImgButton removeButton; - protected TransferImgButton addAllButton; - protected TransferImgButton removeAllButton; - - protected Criteria latestCriteria; - - public AbstractSelector() { - } - - public void setAssigned(ListGridRecord[] assignedRecords) { - initialSelection = assignedRecords; - } - - public HashSet<Integer> getSelection() { - return selection; - } - - protected abstract DynamicForm getAvailableFilterForm(); - - protected abstract RPCDataSource<T> getDataSource(); - - protected abstract Criteria getLatestCriteria(DynamicForm availableFilterForm); - - @Override - protected void onDraw() { - super.onDraw(); - - final DynamicForm availableFilterForm = getAvailableFilterForm(); - - addMember(availableFilterForm); - - HLayout hlayout = new HLayout(); - hlayout.setAlign(VerticalAlignment.BOTTOM); - - // LEFT SIDE - availableGrid = new ListGrid(); - availableGrid.setHeight(350); - availableGrid.setCanDragRecordsOut(true); - availableGrid.setDragTrackerMode(DragTrackerMode.ICON); - availableGrid.setTrackerImage(new ImgProperties("types/Service_up_16.png", 16, 16)); - availableGrid.setDragDataAction(DragDataAction.COPY); - availableGrid.setDataSource(getDataSource()); - availableGrid.setFetchDelay(700); - - availableGrid.setAutoFetchData(true); - availableGrid.setFields(new ListGridField("icon", 50), new ListGridField("name")); - - hlayout.addMember(availableGrid); - - availableFilterForm.addItemChangedHandler(new ItemChangedHandler() { - public void onItemChanged(ItemChangedEvent itemChangedEvent) { - latestCriteria = getLatestCriteria(availableFilterForm); - - Timer t = new Timer() { - @Override - public void run() { - if (latestCriteria != null) { - Criteria c = latestCriteria; - latestCriteria = null; - availableGrid.fetchData(c); - } - } - }; - t.schedule(500); - } - }); - - // CENTER BUTTONS - VStack moveButtonStack = new VStack(6); - moveButtonStack.setAlign(VerticalAlignment.CENTER); - moveButtonStack.setWidth(40); - - addButton = new TransferImgButton(TransferImgButton.RIGHT); - addButton.setDisabled(true); - removeButton = new TransferImgButton(TransferImgButton.LEFT); - removeButton.setDisabled(true); - addAllButton = new TransferImgButton(TransferImgButton.RIGHT_ALL); - removeAllButton = new TransferImgButton(TransferImgButton.LEFT_ALL); - removeAllButton.setDisabled(true); - - moveButtonStack.addMember(addButton); - moveButtonStack.addMember(removeButton); - moveButtonStack.addMember(addAllButton); - moveButtonStack.addMember(removeAllButton); - - hlayout.addMember(moveButtonStack); - - // RIGHT SIDE - - assignedGrid = new ListGrid(); - assignedGrid.setHeight(350); - assignedGrid.setCanReorderRecords(true); - assignedGrid.setCanDragRecordsOut(true); - - assignedGrid.setCanAcceptDroppedRecords(true); - ListGridField iconField = new ListGridField("icon", 50); - iconField.setType(ListGridFieldType.ICON); - assignedGrid.setFields(iconField, new ListGridField("name")); - - hlayout.addMember(assignedGrid); - - addButton.addClickHandler(new ClickHandler() { - public void onClick(ClickEvent clickEvent) { - assignedGrid.transferSelectedData(availableGrid); - select(assignedGrid.getSelection()); - updateButtons(); - } - }); - removeButton.addClickHandler(new ClickHandler() { - public void onClick(ClickEvent clickEvent) { - deselect(assignedGrid.getSelection()); - assignedGrid.removeSelectedData(); - updateButtons(); - } - }); - addAllButton.addClickHandler(new ClickHandler() { - public void onClick(ClickEvent clickEvent) { - availableGrid.selectAllRecords(); - assignedGrid.transferSelectedData(availableGrid); - select(availableGrid.getSelection()); - updateButtons(); - } - }); - removeAllButton.addClickHandler(new ClickHandler() { - public void onClick(ClickEvent clickEvent) { - assignedGrid.selectAllRecords(); - deselect(assignedGrid.getSelection()); - assignedGrid.removeSelectedData(); - updateButtons(); - } - }); - - availableGrid.addDoubleClickHandler(new DoubleClickHandler() { - public void onDoubleClick(DoubleClickEvent event) { - assignedGrid.transferSelectedData(availableGrid); - select(assignedGrid.getSelection()); - updateButtons(); - } - }); - - assignedGrid.addDoubleClickHandler(new DoubleClickHandler() { - public void onDoubleClick(DoubleClickEvent event) { - deselect(assignedGrid.getSelection()); - assignedGrid.removeSelectedData(); - updateButtons(); - } - }); - - availableGrid.addSelectionChangedHandler(new SelectionChangedHandler() { - public void onSelectionChanged(SelectionEvent selectionEvent) { - updateButtons(); - } - }); - - assignedGrid.addSelectionChangedHandler(new SelectionChangedHandler() { - public void onSelectionChanged(SelectionEvent selectionEvent) { - updateButtons(); - } - }); - - assignedGrid.addKeyPressHandler(new KeyPressHandler() { - public void onKeyPress(KeyPressEvent event) { - if ("Delete".equals(event.getKeyName())) { - deselect(assignedGrid.getSelection()); - assignedGrid.removeSelectedData(); - } - } - }); - - assignedGrid.addRecordDropHandler(new RecordDropHandler() { - public void onRecordDrop(RecordDropEvent recordDropEvent) { - select(recordDropEvent.getDropRecords()); - } - }); - - if (initialSelection != null) { - assignedGrid.setData(initialSelection); - for (ListGridRecord record : initialSelection) { - selection.add(record.getAttributeAsInt("id")); - } - } - - addMember(hlayout); - - } - - protected void updateButtons() { - addButton.setDisabled(!availableGrid.anySelected() || availableGrid.getTotalRows() == 0); - removeButton.setDisabled(!assignedGrid.anySelected() || assignedGrid.getTotalRows() == 0); - addAllButton.setDisabled(availableGrid.getTotalRows() == 0); - removeAllButton.setDisabled(assignedGrid.getTotalRows() == 0); - } - - protected void select(ListGridRecord[] records) { - availableGrid.deselectAllRecords(); - for (ListGridRecord record : records) { - record.setEnabled(false); - selection.add(record.getAttributeAsInt("id")); - } - } - - protected void deselect(ListGridRecord[] records) { - HashSet<Integer> toRemove = new HashSet<Integer>(); - for (ListGridRecord record : records) { - toRemove.add(record.getAttributeAsInt("id")); - } - selection.removeAll(toRemove); - - for (Integer id : toRemove) { - Record r = availableGrid.getDataAsRecordList().find("id", id); - if (r != null) { - ((ListGridRecord) r).setEnabled(true); - } - } - availableGrid.markForRedraw(); - } -} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/selection/ResourceGroupSelector.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/selection/ResourceGroupSelector.java index 5c3c007..7731067 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/selection/ResourceGroupSelector.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/selection/ResourceGroupSelector.java @@ -32,6 +32,7 @@ import com.smartgwt.client.widgets.form.fields.TextItem; import com.smartgwt.client.widgets.grid.ListGridRecord;
import org.rhq.core.domain.resource.group.ResourceGroup; +import org.rhq.enterprise.gui.coregui.client.components.selector.AbstractSelector; import org.rhq.enterprise.gui.coregui.client.inventory.groups.ResourceGroupsDataSource; import org.rhq.enterprise.gui.coregui.client.util.RPCDataSource;
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/selection/ResourceSelector.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/selection/ResourceSelector.java index a692a2f..1274e14 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/selection/ResourceSelector.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/selection/ResourceSelector.java @@ -32,6 +32,7 @@ import com.smartgwt.client.widgets.form.fields.TextItem; import com.smartgwt.client.widgets.grid.ListGridRecord;
import org.rhq.core.domain.resource.Resource; +import org.rhq.enterprise.gui.coregui.client.components.selector.AbstractSelector; import org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDatasource; import org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTypePluginTreeDataSource; import org.rhq.enterprise.gui.coregui.client.util.RPCDataSource;
commit 84d3db34645fd839d4d47e2cf4d84b40164d0fdb Author: Greg Hinkle ghinkle@redhat.com Date: Tue Jul 27 11:14:54 2010 -0400
Fix platform view for ResourceDatasoruce changes
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/platform/PlatformPortletView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/platform/PlatformPortletView.java index eb14394..ea30685 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/platform/PlatformPortletView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/platform/PlatformPortletView.java @@ -53,6 +53,7 @@ import org.rhq.enterprise.gui.coregui.client.dashboard.PortletWindow; import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup; import org.rhq.enterprise.gui.coregui.client.gwt.MeasurementDataGWTServiceAsync; import org.rhq.enterprise.gui.coregui.client.gwt.ResourceTypeGWTServiceAsync; +import org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField;
/** * @author Greg Hinkle @@ -70,13 +71,21 @@ public class PlatformPortletView extends ListGrid implements Portlet {
public PlatformPortletView() { + setWidth100(); + setHeight100(); + + prefetch(); + + setShowRecordComponents(true); setShowRecordComponentsByCell(true);
+ setUseAllDataSourceFields(true); + setAutoFitData(Autofit.HORIZONTAL); + setDataSource(new PlatformMetricDataSource(this)); - setInitialCriteria(new Criteria("category", ResourceCategory.PLATFORM.name())); + setInitialCriteria(new Criteria(ResourceDataSourceField.CATEGORY.propertyName(), ResourceCategory.PLATFORM.name()));
- prefetch();
}
@@ -104,9 +113,7 @@ public class PlatformPortletView extends ListGrid implements Portlet {
private void buildUI() {
- setAutoFetchData(true); - setUseAllDataSourceFields(true); - setAutoFitData(Autofit.HORIZONTAL); +
ListGridField nameField = new ListGridField("name", "Name", 250); nameField.setCellFormatter(new CellFormatter() { @@ -126,6 +133,7 @@ public class PlatformPortletView extends ListGrid implements Portlet { hideField("currentAvailability");
+ this.fetchData(new Criteria(ResourceDataSourceField.CATEGORY.propertyName(), ResourceCategory.PLATFORM.name())); }
commit 4c30f50c40e619a5b8c4a08ff2d5d87b1877029d Author: John Sanda jsanda@redhat.com Date: Tue Jul 27 10:49:41 2010 -0400
Fixing typo
diff --git a/etc/cli-scripts/reset_conn_props.js b/etc/cli-scripts/reset_conn_props.js index 4993638..95997f2 100644 --- a/etc/cli-scripts/reset_conn_props.js +++ b/etc/cli-scripts/reset_conn_props.js @@ -52,7 +52,7 @@ function loadPluginConfigDef(resourceTypeName, pluginName) { }
function findResourcesByTypeAndPlugin(resourceType, plugin) { - var critiera = ResourceCriteria(); + var criteria = ResourceCriteria(); criteria.addFilterResourceTypeName(resourceType); criteria.addFilterPluginName(plugin); criteria.fetchPluginConfiguration(true);
commit d02ea18eddc4dcee9f98d22bf9361a0d6cc46ee1 Merge: 91f0e1a... d7f4757... Author: John Sanda jsanda@redhat.com Date: Tue Jul 27 10:48:23 2010 -0400
Merge branch 'master' of ssh://git.fedorahosted.org/git/rhq/rhq
commit 01dcd82e397ad2019489b69d883a89ec1c7341d9 Author: Greg Hinkle ghinkle@redhat.com Date: Tue Jul 27 10:43:18 2010 -0400
Global recent operations view
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/OperationHistoryDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/OperationHistoryDataSource.java index b6f6702..de4bd1e 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/OperationHistoryDataSource.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/OperationHistoryDataSource.java @@ -54,6 +54,9 @@ public class OperationHistoryDataSource extends RPCDataSource<ResourceOperationH DataSourceTextField nameField = new DataSourceTextField("operationName"); addField(nameField);
+ DataSourceTextField resourceField = new DataSourceTextField("resource"); + addField(resourceField); + DataSourceTextField statusField = new DataSourceTextField("status"); addField(statusField);
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/OperationHistoryView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/OperationHistoryView.java index a54d0ac..ad2d156 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/OperationHistoryView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/OperationHistoryView.java @@ -38,6 +38,7 @@ import com.google.gwt.user.client.rpc.AsyncCallback; import com.smartgwt.client.data.Criteria; import com.smartgwt.client.widgets.events.DoubleClickEvent; import com.smartgwt.client.widgets.events.DoubleClickHandler; +import com.smartgwt.client.widgets.grid.CellFormatter; import com.smartgwt.client.widgets.grid.ListGridRecord; import com.smartgwt.client.widgets.grid.events.RecordDoubleClickEvent; import com.smartgwt.client.widgets.grid.events.RecordDoubleClickHandler; @@ -66,6 +67,8 @@ public class OperationHistoryView extends VLayout { }
public OperationHistoryView() { + setWidth100(); + setHeight100(); }
public OperationHistoryView(Resource resource) { @@ -90,12 +93,24 @@ public class OperationHistoryView extends VLayout { table.getListGrid().getField("status").setWidth(100); table.getListGrid().getField("startedTime").setWidth(120);
+ if (this.resource == null) { + table.getListGrid().getField("resource").setWidth(300); + table.getListGrid().getField("resource").setCellFormatter(new CellFormatter() { + public String format(Object o, ListGridRecord listGridRecord, int i, int i1) { + Resource res = (Resource) o; + return "<a href="#Resource/" + res.getId() + "">" + res.getName() + "</a>"; + } + }); + } else { + table.getListGrid().hideField("resource"); + }
table.getListGrid().addRecordDoubleClickHandler(new RecordDoubleClickHandler() { public void onRecordDoubleClick(RecordDoubleClickEvent recordDoubleClickEvent) { ResourceOperationHistory history = (ResourceOperationHistory) recordDoubleClickEvent.getRecord().getAttributeAsObject("entity");
- showDetails(history); } + showDetails(history); + } });
@@ -108,27 +123,29 @@ public class OperationHistoryView extends VLayout { });
- final Menu operationMenu = new Menu(); - ResourceTypeRepository.Cache.getInstance().getResourceTypes( - resource.getResourceType().getId(), - EnumSet.of(ResourceTypeRepository.MetadataType.operations), - new ResourceTypeRepository.TypeLoadedCallback() { - public void onTypesLoaded(ResourceType type) { - for (final OperationDefinition od : type.getOperationDefinitions()) { - MenuItem menuItem = new MenuItem(od.getDisplayName()); - operationMenu.addItem(menuItem); - menuItem.addClickHandler(new ClickHandler() { - public void onClick(MenuItemClickEvent event) { - new OperationCreateWizard(resource, od).startOperationWizard(); - } - }); + if (resource != null) { + final Menu operationMenu = new Menu(); + ResourceTypeRepository.Cache.getInstance().getResourceTypes( + resource.getResourceType().getId(), + EnumSet.of(ResourceTypeRepository.MetadataType.operations), + new ResourceTypeRepository.TypeLoadedCallback() { + public void onTypesLoaded(ResourceType type) { + for (final OperationDefinition od : type.getOperationDefinitions()) { + MenuItem menuItem = new MenuItem(od.getDisplayName()); + operationMenu.addItem(menuItem); + menuItem.addClickHandler(new ClickHandler() { + public void onClick(MenuItemClickEvent event) { + new OperationCreateWizard(resource, od).startOperationWizard(); + } + }); + } } - } - }); + });
- IMenuButton operationsButton = new IMenuButton("Run Operation", operationMenu); - operationsButton.setShowMenuBelow(false); - table.addExtraWidget(operationsButton); + IMenuButton operationsButton = new IMenuButton("Run Operation", operationMenu); + operationsButton.setShowMenuBelow(false); + table.addExtraWidget(operationsButton); + }
addMember(table);
commit c0c02b6a66332cd2c5d0605830ec2e69b59afc61 Author: Heiko W. Rupp hwr@redhat.com Date: Tue Jul 27 14:21:37 2010 +0200
This query is no longer needed
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/Resource.java b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/Resource.java index bae5e26..8f4e45f 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/Resource.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/Resource.java @@ -709,20 +709,6 @@ import org.rhq.core.domain.util.Summary; + " r.parentResource = NULL, " // takes resources out of the hierarchy, so we don't have to change ResourceSyncInfo logic + " r.resourceKey = 'deleted' " // + " WHERE r.id IN (:resourceIds ) "), // - @NamedQuery(name = Resource.QUERY_MARK_RESOURCES_FOR_ASYNC_DELETION, query = "" // - + "UPDATE Resource r " // - + " SET r.inventoryStatus = :status, " // - + " r.agent = NULL, " // - + " r.parentResource = NULL, " // takes resources out of the hierarchy, so we don't have to change ResourceSyncInfo logic - + " r.resourceKey = 'deleted' " // - + " WHERE r.id = :resourceId " // - + " OR r.id IN (SELECT rr.id FROM Resource rr JOIN rr.parentResource p1 WHERE p1.id = :resourceId) " - + " OR r.id IN (SELECT rr.id FROM Resource rr JOIN rr.parentResource.parentResource p2 WHERE p2.id = :resourceId) " - + " OR r.id IN (SELECT rr.id FROM Resource rr JOIN rr.parentResource.parentResource.parentResource p3 WHERE p3.id = :resourceId) " - + " OR r.id IN (SELECT rr.id FROM Resource rr JOIN rr.parentResource.parentResource.parentResource.parentResource p4 WHERE p4.id = :resourceId) " - + " OR r.id IN (SELECT rr.id FROM Resource rr JOIN rr.parentResource.parentResource.parentResource.parentResource.parentResource p5 WHERE p5.id = :resourceId) " - + " OR r.id IN (SELECT rr.id FROM Resource rr JOIN rr.parentResource.parentResource.parentResource.parentResource.parentResource.parentResource p6 WHERE p6.id = :resourceId) " - + " "), // @NamedQuery(name = Resource.QUERY_FIND_RESOURCES_MARKED_FOR_ASYNC_DELETION, query = "" // + "SELECT r.id FROM Resource AS r WHERE r.agent IS NULL"),
@@ -866,7 +852,6 @@ public class Resource implements Comparable<Resource>, Serializable { public static final String QUERY_FIND_DESCENDENTS_BY_TYPE_AND_NAME = "Resource.findDescendentsByTypeAndName"; public static final String QUERY_FIND_DESCENDENTS = "Resource.findDescendents"; public static final String QUERY_MARK_RESOURCES_FOR_ASYNC_DELETION_QUICK = "Resource.markResourcesForAsyncDeletionQuick"; - public static final String QUERY_MARK_RESOURCES_FOR_ASYNC_DELETION = "Resource.markResourcesForAsyncDeletion"; public static final String QUERY_FIND_RESOURCES_MARKED_FOR_ASYNC_DELETION = "Resource.findResourcesMarkedForAsyncDeletion";
public static final String QUERY_RESOURCE_REPORT = "Resource.findResourceReport"; diff --git a/modules/core/domain/src/test/java/org/rhq/core/domain/test/QueriesTest.java b/modules/core/domain/src/test/java/org/rhq/core/domain/test/QueriesTest.java index b1328e9..a60fa33 100644 --- a/modules/core/domain/src/test/java/org/rhq/core/domain/test/QueriesTest.java +++ b/modules/core/domain/src/test/java/org/rhq/core/domain/test/QueriesTest.java @@ -22,7 +22,9 @@ */ package org.rhq.core.domain.test;
+import java.util.ArrayList; import java.util.HashMap; +import java.util.List; import java.util.Map; import java.util.TreeMap;
@@ -149,8 +151,10 @@ public class QueriesTest extends AbstractEJB3Test { tx.begin();
EntityManager entityManager = getEntityManager(); - Query q = entityManager.createNamedQuery(Resource.QUERY_MARK_RESOURCES_FOR_ASYNC_DELETION); - q.setParameter("resourceId", 1); + Query q = entityManager.createNamedQuery(Resource.QUERY_MARK_RESOURCES_FOR_ASYNC_DELETION_QUICK); + List<Integer> ids = new ArrayList<Integer>(); + ids.add(1); + q.setParameter("resourceIds", ids); q.setParameter("status", InventoryStatus.UNINVENTORIED); q.executeUpdate(); }
commit d7f47571f3e41951eb97fd07c5890c59a938d88a Author: John Mazzitelli mazz@redhat.com Date: Mon Jul 26 15:42:16 2010 -0400
check for -1 returned by getSize
diff --git a/modules/enterprise/server/plugins/ant-bundle/src/main/java/org/rhq/enterprise/server/plugins/ant/AntBundleServerPluginComponent.java b/modules/enterprise/server/plugins/ant-bundle/src/main/java/org/rhq/enterprise/server/plugins/ant/AntBundleServerPluginComponent.java index e4bc366..07fcad5 100644 --- a/modules/enterprise/server/plugins/ant-bundle/src/main/java/org/rhq/enterprise/server/plugins/ant/AntBundleServerPluginComponent.java +++ b/modules/enterprise/server/plugins/ant-bundle/src/main/java/org/rhq/enterprise/server/plugins/ant/AntBundleServerPluginComponent.java @@ -174,7 +174,8 @@ public class AntBundleServerPluginComponent implements ServerPluginComponent, Bu public boolean visit(ZipEntry entry, ZipInputStream stream) throws Exception { if (this.recipeName.equalsIgnoreCase(entry.getName())) { // this should be safe downcast, recipes are not that big - ByteArrayOutputStream out = new ByteArrayOutputStream((int) entry.getSize()); + int contentSize = (int) entry.getSize(); + ByteArrayOutputStream out = new ByteArrayOutputStream((contentSize > 0) ? contentSize : 32768); StreamUtil.copy(stream, out, false); this.recipe = new String(out.toByteArray()); out = null; // no need for this anymore, help out GC
commit d1677f06b7640443632869da21cfdb30b1f7e68a Author: hudson auto wnstb@yahoo.com Date: Mon Jul 26 14:20:36 2010 -0400
[maven-release-plugin] prepare for next development iteration
diff --git a/modules/common/ant-bundle/pom.xml b/modules/common/ant-bundle/pom.xml index 97ef93b..eda9133 100644 --- a/modules/common/ant-bundle/pom.xml +++ b/modules/common/ant-bundle/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-common-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/common/filetemplate-bundle/pom.xml b/modules/common/filetemplate-bundle/pom.xml index 3b26a39..bc7965b 100644 --- a/modules/common/filetemplate-bundle/pom.xml +++ b/modules/common/filetemplate-bundle/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-common-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/common/jboss-as/pom.xml b/modules/common/jboss-as/pom.xml index 688d5e4..2cf950b 100644 --- a/modules/common/jboss-as/pom.xml +++ b/modules/common/jboss-as/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-common-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/common/pom.xml b/modules/common/pom.xml index 2ddc4af..ee81a94 100644 --- a/modules/common/pom.xml +++ b/modules/common/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/client-api/pom.xml b/modules/core/client-api/pom.xml index a27161b..d177f9e 100644 --- a/modules/core/client-api/pom.xml +++ b/modules/core/client-api/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/comm-api/pom.xml b/modules/core/comm-api/pom.xml index 4589d42..a51f92b 100644 --- a/modules/core/comm-api/pom.xml +++ b/modules/core/comm-api/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/dbutils/pom.xml b/modules/core/dbutils/pom.xml index d7559da..7ff6a10 100644 --- a/modules/core/dbutils/pom.xml +++ b/modules/core/dbutils/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/domain/pom.xml b/modules/core/domain/pom.xml index dc75145..e0ced84 100644 --- a/modules/core/domain/pom.xml +++ b/modules/core/domain/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/gui/pom.xml b/modules/core/gui/pom.xml index b535306..0911918 100644 --- a/modules/core/gui/pom.xml +++ b/modules/core/gui/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/native-system/pom.xml b/modules/core/native-system/pom.xml index f72bc2f..d47d4c8 100644 --- a/modules/core/native-system/pom.xml +++ b/modules/core/native-system/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/plugin-api/pom.xml b/modules/core/plugin-api/pom.xml index 967b21a..e1ce7ef 100644 --- a/modules/core/plugin-api/pom.xml +++ b/modules/core/plugin-api/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/plugin-container/pom.xml b/modules/core/plugin-container/pom.xml index fbab223..2e58102 100644 --- a/modules/core/plugin-container/pom.xml +++ b/modules/core/plugin-container/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/plugin-validator/pom.xml b/modules/core/plugin-validator/pom.xml index 996cd8f..7739177 100644 --- a/modules/core/plugin-validator/pom.xml +++ b/modules/core/plugin-validator/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/plugindoc/pom.xml b/modules/core/plugindoc/pom.xml index 8a95e51..eeb7e81 100644 --- a/modules/core/plugindoc/pom.xml +++ b/modules/core/plugindoc/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/pom.xml b/modules/core/pom.xml index b0c399b..7aad64c 100644 --- a/modules/core/pom.xml +++ b/modules/core/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/util/pom.xml b/modules/core/util/pom.xml index 37bcda5..bc41dc5 100644 --- a/modules/core/util/pom.xml +++ b/modules/core/util/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/agent/pom.xml b/modules/enterprise/agent/pom.xml index 3fc1344..d9f1c1c 100644 --- a/modules/enterprise/agent/pom.xml +++ b/modules/enterprise/agent/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/agentupdate/pom.xml b/modules/enterprise/agentupdate/pom.xml index 127b06f..8942239 100644 --- a/modules/enterprise/agentupdate/pom.xml +++ b/modules/enterprise/agentupdate/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/comm/pom.xml b/modules/enterprise/comm/pom.xml index 9f09ff1..8b9da9c 100644 --- a/modules/enterprise/comm/pom.xml +++ b/modules/enterprise/comm/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/base-perspective-jar/pom.xml b/modules/enterprise/gui/base-perspective-jar/pom.xml index 95b62cd..611eb9d 100644 --- a/modules/enterprise/gui/base-perspective-jar/pom.xml +++ b/modules/enterprise/gui/base-perspective-jar/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/base-perspective-war/pom.xml b/modules/enterprise/gui/base-perspective-war/pom.xml index c1c297f..798a8ca 100644 --- a/modules/enterprise/gui/base-perspective-war/pom.xml +++ b/modules/enterprise/gui/base-perspective-war/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/content_http-war/pom.xml b/modules/enterprise/gui/content_http-war/pom.xml index 6be8d8d..df05645 100644 --- a/modules/enterprise/gui/content_http-war/pom.xml +++ b/modules/enterprise/gui/content_http-war/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-gui-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/coregui/pom.xml b/modules/enterprise/gui/coregui/pom.xml index 709bfe3..acbe21f 100644 --- a/modules/enterprise/gui/coregui/pom.xml +++ b/modules/enterprise/gui/coregui/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/installer-war/pom.xml b/modules/enterprise/gui/installer-war/pom.xml index 8d33ef0..1beadca 100644 --- a/modules/enterprise/gui/installer-war/pom.xml +++ b/modules/enterprise/gui/installer-war/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/pom.xml b/modules/enterprise/gui/pom.xml index bf6a9a4..0c529ba 100644 --- a/modules/enterprise/gui/pom.xml +++ b/modules/enterprise/gui/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/portal-war/pom.xml b/modules/enterprise/gui/portal-war/pom.xml index d9f0c15..a794cd6 100644 --- a/modules/enterprise/gui/portal-war/pom.xml +++ b/modules/enterprise/gui/portal-war/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/webdav-war/pom.xml b/modules/enterprise/gui/webdav-war/pom.xml index 9bdfc91..aa880be 100644 --- a/modules/enterprise/gui/webdav-war/pom.xml +++ b/modules/enterprise/gui/webdav-war/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/pom.xml b/modules/enterprise/pom.xml index 77a5685..3b0dbb8 100644 --- a/modules/enterprise/pom.xml +++ b/modules/enterprise/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/remoting/cli/pom.xml b/modules/enterprise/remoting/cli/pom.xml index dff57e7..05187c7 100644 --- a/modules/enterprise/remoting/cli/pom.xml +++ b/modules/enterprise/remoting/cli/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<artifactId>rhq-remoting-cli</artifactId> diff --git a/modules/enterprise/remoting/client-api/pom.xml b/modules/enterprise/remoting/client-api/pom.xml index 6008df1..e86ef41 100644 --- a/modules/enterprise/remoting/client-api/pom.xml +++ b/modules/enterprise/remoting/client-api/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<artifactId>rhq-remoting-client-api</artifactId> diff --git a/modules/enterprise/remoting/pom.xml b/modules/enterprise/remoting/pom.xml index 68d51c0..910b617 100644 --- a/modules/enterprise/remoting/pom.xml +++ b/modules/enterprise/remoting/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<artifactId>rhq-remoting-parent</artifactId> diff --git a/modules/enterprise/remoting/webservices/pom.xml b/modules/enterprise/remoting/webservices/pom.xml index 444256d..2ea73ee 100644 --- a/modules/enterprise/remoting/webservices/pom.xml +++ b/modules/enterprise/remoting/webservices/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<artifactId>rhq-remoting-webservices</artifactId> diff --git a/modules/enterprise/server/container-lib/pom.xml b/modules/enterprise/server/container-lib/pom.xml index f09e063..2c98817 100644 --- a/modules/enterprise/server/container-lib/pom.xml +++ b/modules/enterprise/server/container-lib/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/container/pom.xml b/modules/enterprise/server/container/pom.xml index b4d2146..3fd11e8 100644 --- a/modules/enterprise/server/container/pom.xml +++ b/modules/enterprise/server/container/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/ear/pom.xml b/modules/enterprise/server/ear/pom.xml index c063211..bf15866 100644 --- a/modules/enterprise/server/ear/pom.xml +++ b/modules/enterprise/server/ear/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/jar/pom.xml b/modules/enterprise/server/jar/pom.xml index ddff575..79fdc38 100644 --- a/modules/enterprise/server/jar/pom.xml +++ b/modules/enterprise/server/jar/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/alert-email/pom.xml b/modules/enterprise/server/plugins/alert-email/pom.xml index ea1eb7b..dd5bc18 100644 --- a/modules/enterprise/server/plugins/alert-email/pom.xml +++ b/modules/enterprise/server/plugins/alert-email/pom.xml @@ -3,7 +3,7 @@ <parent> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent> <modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-irc/pom.xml b/modules/enterprise/server/plugins/alert-irc/pom.xml index 363ac0a..c0973f3 100644 --- a/modules/enterprise/server/plugins/alert-irc/pom.xml +++ b/modules/enterprise/server/plugins/alert-irc/pom.xml @@ -3,7 +3,7 @@ <parent> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent> <modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-microblog/pom.xml b/modules/enterprise/server/plugins/alert-microblog/pom.xml index b4751ba..a62fee8 100644 --- a/modules/enterprise/server/plugins/alert-microblog/pom.xml +++ b/modules/enterprise/server/plugins/alert-microblog/pom.xml @@ -3,7 +3,7 @@ <parent> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent> <modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-mobicents/pom.xml b/modules/enterprise/server/plugins/alert-mobicents/pom.xml index b0a0c3b..3193539 100644 --- a/modules/enterprise/server/plugins/alert-mobicents/pom.xml +++ b/modules/enterprise/server/plugins/alert-mobicents/pom.xml @@ -3,7 +3,7 @@ <parent> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent> <modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-operations/pom.xml b/modules/enterprise/server/plugins/alert-operations/pom.xml index 6d35aed..e69bfbc 100644 --- a/modules/enterprise/server/plugins/alert-operations/pom.xml +++ b/modules/enterprise/server/plugins/alert-operations/pom.xml @@ -2,7 +2,7 @@ <parent> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent> <modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-roles/pom.xml b/modules/enterprise/server/plugins/alert-roles/pom.xml index cbd7334..ca33bb7 100644 --- a/modules/enterprise/server/plugins/alert-roles/pom.xml +++ b/modules/enterprise/server/plugins/alert-roles/pom.xml @@ -3,7 +3,7 @@ <parent> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent> <modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-snmp/pom.xml b/modules/enterprise/server/plugins/alert-snmp/pom.xml index 6398092..af75153 100644 --- a/modules/enterprise/server/plugins/alert-snmp/pom.xml +++ b/modules/enterprise/server/plugins/alert-snmp/pom.xml @@ -3,7 +3,7 @@ <parent> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent> <modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-subject/pom.xml b/modules/enterprise/server/plugins/alert-subject/pom.xml index ebac52c..09839b8 100644 --- a/modules/enterprise/server/plugins/alert-subject/pom.xml +++ b/modules/enterprise/server/plugins/alert-subject/pom.xml @@ -3,7 +3,7 @@ <parent> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent> <modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/ant-bundle/pom.xml b/modules/enterprise/server/plugins/ant-bundle/pom.xml index 30efb5a..73f405e 100644 --- a/modules/enterprise/server/plugins/ant-bundle/pom.xml +++ b/modules/enterprise/server/plugins/ant-bundle/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/cobbler/pom.xml b/modules/enterprise/server/plugins/cobbler/pom.xml index 8464662..4c44f10 100644 --- a/modules/enterprise/server/plugins/cobbler/pom.xml +++ b/modules/enterprise/server/plugins/cobbler/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<modelVersion>4.0.0</modelVersion> diff --git a/modules/enterprise/server/plugins/disk/pom.xml b/modules/enterprise/server/plugins/disk/pom.xml index 40ab2a2..0033d1b 100644 --- a/modules/enterprise/server/plugins/disk/pom.xml +++ b/modules/enterprise/server/plugins/disk/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml b/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml index 0c5fb51..61965f2 100644 --- a/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml +++ b/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/jboss-software/pom.xml b/modules/enterprise/server/plugins/jboss-software/pom.xml index 3f1e165..7451668 100644 --- a/modules/enterprise/server/plugins/jboss-software/pom.xml +++ b/modules/enterprise/server/plugins/jboss-software/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml b/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml index 25917cc..0ac61d3 100644 --- a/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml +++ b/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml @@ -7,7 +7,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/perspectives/core/pom.xml b/modules/enterprise/server/plugins/perspectives/core/pom.xml index 40c066f..5a78451 100644 --- a/modules/enterprise/server/plugins/perspectives/core/pom.xml +++ b/modules/enterprise/server/plugins/perspectives/core/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/pom.xml b/modules/enterprise/server/plugins/pom.xml index 9832288..2b16f4a 100644 --- a/modules/enterprise/server/plugins/pom.xml +++ b/modules/enterprise/server/plugins/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/rhnhosted/pom.xml b/modules/enterprise/server/plugins/rhnhosted/pom.xml index 26e985a..e4ab9b2 100644 --- a/modules/enterprise/server/plugins/rhnhosted/pom.xml +++ b/modules/enterprise/server/plugins/rhnhosted/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/url/pom.xml b/modules/enterprise/server/plugins/url/pom.xml index 14e52de..a6cba32 100644 --- a/modules/enterprise/server/plugins/url/pom.xml +++ b/modules/enterprise/server/plugins/url/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml b/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml index e160aa6..9c7cc74 100644 --- a/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml +++ b/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/yum/pom.xml b/modules/enterprise/server/plugins/yum/pom.xml index 344a215..ebdd3da 100644 --- a/modules/enterprise/server/plugins/yum/pom.xml +++ b/modules/enterprise/server/plugins/yum/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/safe-invoker/pom.xml b/modules/enterprise/server/safe-invoker/pom.xml index bb1abdd..06c8981 100644 --- a/modules/enterprise/server/safe-invoker/pom.xml +++ b/modules/enterprise/server/safe-invoker/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/sars/agent-sar/pom.xml b/modules/enterprise/server/sars/agent-sar/pom.xml index 2458369..aa278b8 100644 --- a/modules/enterprise/server/sars/agent-sar/pom.xml +++ b/modules/enterprise/server/sars/agent-sar/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-sars-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/sars/pom.xml b/modules/enterprise/server/sars/pom.xml index 4ac7f43..0cc2084 100644 --- a/modules/enterprise/server/sars/pom.xml +++ b/modules/enterprise/server/sars/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/xml-schemas/pom.xml b/modules/enterprise/server/xml-schemas/pom.xml index 21ccc78..14738d0 100644 --- a/modules/enterprise/server/xml-schemas/pom.xml +++ b/modules/enterprise/server/xml-schemas/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/helpers/pluginAnnotations/pom.xml b/modules/helpers/pluginAnnotations/pom.xml index 366d1aa..d056f74 100644 --- a/modules/helpers/pluginAnnotations/pom.xml +++ b/modules/helpers/pluginAnnotations/pom.xml @@ -6,7 +6,7 @@ <parent> <groupId>org.rhq.helpers</groupId> <artifactId>rhq-helpers</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq.helpers</groupId> diff --git a/modules/helpers/pluginGen/pom.xml b/modules/helpers/pluginGen/pom.xml index d992e29..28dc9b1 100644 --- a/modules/helpers/pluginGen/pom.xml +++ b/modules/helpers/pluginGen/pom.xml @@ -6,7 +6,7 @@ <parent> <groupId>org.rhq.helpers</groupId> <artifactId>rhq-helpers</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq.helpers</groupId> diff --git a/modules/helpers/pom.xml b/modules/helpers/pom.xml index c5e5ae2..a0721a9 100644 --- a/modules/helpers/pom.xml +++ b/modules/helpers/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq.helpers</groupId> diff --git a/modules/helpers/rtfilter/pom.xml b/modules/helpers/rtfilter/pom.xml index ffac476..5d327ee 100644 --- a/modules/helpers/rtfilter/pom.xml +++ b/modules/helpers/rtfilter/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq.helpers</groupId> <artifactId>rhq-helpers</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/aliases/pom.xml b/modules/plugins/aliases/pom.xml index c475e5e..c37598e 100644 --- a/modules/plugins/aliases/pom.xml +++ b/modules/plugins/aliases/pom.xml @@ -7,7 +7,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/ant-bundle/pom.xml b/modules/plugins/ant-bundle/pom.xml index 5fa4596..cc160c9 100644 --- a/modules/plugins/ant-bundle/pom.xml +++ b/modules/plugins/ant-bundle/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/apache/pom.xml b/modules/plugins/apache/pom.xml index 88db42f..700a6af 100644 --- a/modules/plugins/apache/pom.xml +++ b/modules/plugins/apache/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/augeas/pom.xml b/modules/plugins/augeas/pom.xml index 51580cd..915106a 100644 --- a/modules/plugins/augeas/pom.xml +++ b/modules/plugins/augeas/pom.xml @@ -7,7 +7,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/cobbler/pom.xml b/modules/plugins/cobbler/pom.xml index a140f5d..d920440 100644 --- a/modules/plugins/cobbler/pom.xml +++ b/modules/plugins/cobbler/pom.xml @@ -7,7 +7,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/cron/pom.xml b/modules/plugins/cron/pom.xml index 9119492..d5aaad5 100644 --- a/modules/plugins/cron/pom.xml +++ b/modules/plugins/cron/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/database/pom.xml b/modules/plugins/database/pom.xml index 714ad7a..30889f7 100644 --- a/modules/plugins/database/pom.xml +++ b/modules/plugins/database/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/filetemplate-bundle/pom.xml b/modules/plugins/filetemplate-bundle/pom.xml index e01b311..b79645d 100644 --- a/modules/plugins/filetemplate-bundle/pom.xml +++ b/modules/plugins/filetemplate-bundle/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/grub/pom.xml b/modules/plugins/grub/pom.xml index aef1858..f7cf265 100644 --- a/modules/plugins/grub/pom.xml +++ b/modules/plugins/grub/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/hibernate/pom.xml b/modules/plugins/hibernate/pom.xml index 4f87dfe..acb08ef 100644 --- a/modules/plugins/hibernate/pom.xml +++ b/modules/plugins/hibernate/pom.xml @@ -6,7 +6,7 @@ <groupId>org.rhq</groupId> <!-- Bypass the jopr-plugins-parent which can not have children. It must build after the plugins in order to execute integration tests on them. --> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.jboss.on</groupId> diff --git a/modules/plugins/hosts/pom.xml b/modules/plugins/hosts/pom.xml index 157119f..7dd0fde 100644 --- a/modules/plugins/hosts/pom.xml +++ b/modules/plugins/hosts/pom.xml @@ -7,7 +7,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/hudson/pom.xml b/modules/plugins/hudson/pom.xml index eed10bc..65fa7b8 100644 --- a/modules/plugins/hudson/pom.xml +++ b/modules/plugins/hudson/pom.xml @@ -6,7 +6,7 @@ <parent> <artifactId>rhq-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/iis/pom.xml b/modules/plugins/iis/pom.xml index 9a9c2f0..853c020 100644 --- a/modules/plugins/iis/pom.xml +++ b/modules/plugins/iis/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/jboss-as-5/pom.xml b/modules/plugins/jboss-as-5/pom.xml index befe74c..a0ade77 100644 --- a/modules/plugins/jboss-as-5/pom.xml +++ b/modules/plugins/jboss-as-5/pom.xml @@ -9,7 +9,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.jboss.on</groupId> diff --git a/modules/plugins/jboss-as/pom.xml b/modules/plugins/jboss-as/pom.xml index ac9b3f6..b9ed2b3 100644 --- a/modules/plugins/jboss-as/pom.xml +++ b/modules/plugins/jboss-as/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.jboss.on</groupId> diff --git a/modules/plugins/jboss-cache-v3/pom.xml b/modules/plugins/jboss-cache-v3/pom.xml index 61f4e11..b3846fa 100644 --- a/modules/plugins/jboss-cache-v3/pom.xml +++ b/modules/plugins/jboss-cache-v3/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.jboss.on</groupId> diff --git a/modules/plugins/jboss-cache/pom.xml b/modules/plugins/jboss-cache/pom.xml index 684e8e3..443e524 100644 --- a/modules/plugins/jboss-cache/pom.xml +++ b/modules/plugins/jboss-cache/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.jboss.on</groupId> diff --git a/modules/plugins/jmx/pom.xml b/modules/plugins/jmx/pom.xml index a9874cc..ac9885a 100644 --- a/modules/plugins/jmx/pom.xml +++ b/modules/plugins/jmx/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/mysql/pom.xml b/modules/plugins/mysql/pom.xml index 5a02364..d0c9053 100644 --- a/modules/plugins/mysql/pom.xml +++ b/modules/plugins/mysql/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/netservices/pom.xml b/modules/plugins/netservices/pom.xml index 3d937e7..06ae2ae 100644 --- a/modules/plugins/netservices/pom.xml +++ b/modules/plugins/netservices/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/oracle/pom.xml b/modules/plugins/oracle/pom.xml index e915511..1acdb0f 100644 --- a/modules/plugins/oracle/pom.xml +++ b/modules/plugins/oracle/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/perftest/pom.xml b/modules/plugins/perftest/pom.xml index f65ad5a..39c75da 100644 --- a/modules/plugins/perftest/pom.xml +++ b/modules/plugins/perftest/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/platform/pom.xml b/modules/plugins/platform/pom.xml index aadd8bf..97b83b0 100644 --- a/modules/plugins/platform/pom.xml +++ b/modules/plugins/platform/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/pom.xml b/modules/plugins/pom.xml index f32c52d..85d6105 100644 --- a/modules/plugins/pom.xml +++ b/modules/plugins/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/postfix/pom.xml b/modules/plugins/postfix/pom.xml index 639838b..283ab6a 100644 --- a/modules/plugins/postfix/pom.xml +++ b/modules/plugins/postfix/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/postgres/pom.xml b/modules/plugins/postgres/pom.xml index beb98f2..5a4466c 100644 --- a/modules/plugins/postgres/pom.xml +++ b/modules/plugins/postgres/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/rhq-agent/pom.xml b/modules/plugins/rhq-agent/pom.xml index fdb0991..a190dcd 100644 --- a/modules/plugins/rhq-agent/pom.xml +++ b/modules/plugins/rhq-agent/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/rhq-server/pom.xml b/modules/plugins/rhq-server/pom.xml index 8fb6fee..8f4e675 100644 --- a/modules/plugins/rhq-server/pom.xml +++ b/modules/plugins/rhq-server/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.jboss.on</groupId> diff --git a/modules/plugins/samba/pom.xml b/modules/plugins/samba/pom.xml index 9411143..0d41574 100644 --- a/modules/plugins/samba/pom.xml +++ b/modules/plugins/samba/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/script/pom.xml b/modules/plugins/script/pom.xml index 0ec4d51..7719b14 100644 --- a/modules/plugins/script/pom.xml +++ b/modules/plugins/script/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/snmptrapd/pom.xml b/modules/plugins/snmptrapd/pom.xml index f5106f0..2d9d715 100644 --- a/modules/plugins/snmptrapd/pom.xml +++ b/modules/plugins/snmptrapd/pom.xml @@ -2,7 +2,7 @@ <parent> <artifactId>rhq-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<modelVersion>4.0.0</modelVersion> diff --git a/modules/plugins/sshd/pom.xml b/modules/plugins/sshd/pom.xml index b637f0d..3579496 100644 --- a/modules/plugins/sshd/pom.xml +++ b/modules/plugins/sshd/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/sudoers/pom.xml b/modules/plugins/sudoers/pom.xml index 55c3b49..41df1b8 100644 --- a/modules/plugins/sudoers/pom.xml +++ b/modules/plugins/sudoers/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/tomcat/pom.xml b/modules/plugins/tomcat/pom.xml index 9de8802..205d5b0 100644 --- a/modules/plugins/tomcat/pom.xml +++ b/modules/plugins/tomcat/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.jboss.on</groupId> diff --git a/modules/plugins/twitter/pom.xml b/modules/plugins/twitter/pom.xml index 9ee6ac3..e299efa 100644 --- a/modules/plugins/twitter/pom.xml +++ b/modules/plugins/twitter/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/validate-all-plugins/pom.xml b/modules/plugins/validate-all-plugins/pom.xml index 93e847c..b3d5e87 100644 --- a/modules/plugins/validate-all-plugins/pom.xml +++ b/modules/plugins/validate-all-plugins/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/pom.xml b/modules/pom.xml index a6af192..bc96ae3 100644 --- a/modules/pom.xml +++ b/modules/pom.xml @@ -6,7 +6,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/test-utils/pom.xml b/modules/test-utils/pom.xml index 5b243a9..2235687 100644 --- a/modules/test-utils/pom.xml +++ b/modules/test-utils/pom.xml @@ -4,7 +4,7 @@ <parent> <artifactId>rhq-modules-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> </parent> <artifactId>test-utils</artifactId> <name>RHQ Test Utils</name> diff --git a/pom.xml b/pom.xml index 5e2dc43..7ff85bb 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@
<groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA</version> + <version>3.0.0-SNAPSHOT</version> <packaging>pom</packaging>
<name>RHQ</name>
commit 2f8ffb1fae72d6006470834f0aaf69028c37cdb7 Author: hudson auto wnstb@yahoo.com Date: Mon Jul 26 14:19:11 2010 -0400
[maven-release-plugin] prepare release RHQ_3_0_0_GA
diff --git a/modules/common/ant-bundle/pom.xml b/modules/common/ant-bundle/pom.xml index eda9133..97ef93b 100644 --- a/modules/common/ant-bundle/pom.xml +++ b/modules/common/ant-bundle/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-common-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/common/filetemplate-bundle/pom.xml b/modules/common/filetemplate-bundle/pom.xml index bc7965b..3b26a39 100644 --- a/modules/common/filetemplate-bundle/pom.xml +++ b/modules/common/filetemplate-bundle/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-common-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/common/jboss-as/pom.xml b/modules/common/jboss-as/pom.xml index 2cf950b..688d5e4 100644 --- a/modules/common/jboss-as/pom.xml +++ b/modules/common/jboss-as/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-common-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/common/pom.xml b/modules/common/pom.xml index ee81a94..2ddc4af 100644 --- a/modules/common/pom.xml +++ b/modules/common/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/client-api/pom.xml b/modules/core/client-api/pom.xml index d177f9e..a27161b 100644 --- a/modules/core/client-api/pom.xml +++ b/modules/core/client-api/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/comm-api/pom.xml b/modules/core/comm-api/pom.xml index a51f92b..4589d42 100644 --- a/modules/core/comm-api/pom.xml +++ b/modules/core/comm-api/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/dbutils/pom.xml b/modules/core/dbutils/pom.xml index 7ff6a10..d7559da 100644 --- a/modules/core/dbutils/pom.xml +++ b/modules/core/dbutils/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/domain/pom.xml b/modules/core/domain/pom.xml index e0ced84..dc75145 100644 --- a/modules/core/domain/pom.xml +++ b/modules/core/domain/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/gui/pom.xml b/modules/core/gui/pom.xml index 0911918..b535306 100644 --- a/modules/core/gui/pom.xml +++ b/modules/core/gui/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/native-system/pom.xml b/modules/core/native-system/pom.xml index d47d4c8..f72bc2f 100644 --- a/modules/core/native-system/pom.xml +++ b/modules/core/native-system/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/plugin-api/pom.xml b/modules/core/plugin-api/pom.xml index e1ce7ef..967b21a 100644 --- a/modules/core/plugin-api/pom.xml +++ b/modules/core/plugin-api/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/plugin-container/pom.xml b/modules/core/plugin-container/pom.xml index 2e58102..fbab223 100644 --- a/modules/core/plugin-container/pom.xml +++ b/modules/core/plugin-container/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/plugin-validator/pom.xml b/modules/core/plugin-validator/pom.xml index 7739177..996cd8f 100644 --- a/modules/core/plugin-validator/pom.xml +++ b/modules/core/plugin-validator/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/plugindoc/pom.xml b/modules/core/plugindoc/pom.xml index eeb7e81..8a95e51 100644 --- a/modules/core/plugindoc/pom.xml +++ b/modules/core/plugindoc/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/pom.xml b/modules/core/pom.xml index 7aad64c..b0c399b 100644 --- a/modules/core/pom.xml +++ b/modules/core/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/util/pom.xml b/modules/core/util/pom.xml index bc41dc5..37bcda5 100644 --- a/modules/core/util/pom.xml +++ b/modules/core/util/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/agent/pom.xml b/modules/enterprise/agent/pom.xml index d9f1c1c..3fc1344 100644 --- a/modules/enterprise/agent/pom.xml +++ b/modules/enterprise/agent/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/agentupdate/pom.xml b/modules/enterprise/agentupdate/pom.xml index 8942239..127b06f 100644 --- a/modules/enterprise/agentupdate/pom.xml +++ b/modules/enterprise/agentupdate/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/comm/pom.xml b/modules/enterprise/comm/pom.xml index 8b9da9c..9f09ff1 100644 --- a/modules/enterprise/comm/pom.xml +++ b/modules/enterprise/comm/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/base-perspective-jar/pom.xml b/modules/enterprise/gui/base-perspective-jar/pom.xml index 611eb9d..95b62cd 100644 --- a/modules/enterprise/gui/base-perspective-jar/pom.xml +++ b/modules/enterprise/gui/base-perspective-jar/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/base-perspective-war/pom.xml b/modules/enterprise/gui/base-perspective-war/pom.xml index 798a8ca..c1c297f 100644 --- a/modules/enterprise/gui/base-perspective-war/pom.xml +++ b/modules/enterprise/gui/base-perspective-war/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/content_http-war/pom.xml b/modules/enterprise/gui/content_http-war/pom.xml index df05645..6be8d8d 100644 --- a/modules/enterprise/gui/content_http-war/pom.xml +++ b/modules/enterprise/gui/content_http-war/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-gui-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/coregui/pom.xml b/modules/enterprise/gui/coregui/pom.xml index acbe21f..709bfe3 100644 --- a/modules/enterprise/gui/coregui/pom.xml +++ b/modules/enterprise/gui/coregui/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/installer-war/pom.xml b/modules/enterprise/gui/installer-war/pom.xml index 1beadca..8d33ef0 100644 --- a/modules/enterprise/gui/installer-war/pom.xml +++ b/modules/enterprise/gui/installer-war/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/pom.xml b/modules/enterprise/gui/pom.xml index 0c529ba..bf6a9a4 100644 --- a/modules/enterprise/gui/pom.xml +++ b/modules/enterprise/gui/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/portal-war/pom.xml b/modules/enterprise/gui/portal-war/pom.xml index a794cd6..d9f0c15 100644 --- a/modules/enterprise/gui/portal-war/pom.xml +++ b/modules/enterprise/gui/portal-war/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/webdav-war/pom.xml b/modules/enterprise/gui/webdav-war/pom.xml index aa880be..9bdfc91 100644 --- a/modules/enterprise/gui/webdav-war/pom.xml +++ b/modules/enterprise/gui/webdav-war/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/pom.xml b/modules/enterprise/pom.xml index 3b0dbb8..77a5685 100644 --- a/modules/enterprise/pom.xml +++ b/modules/enterprise/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/remoting/cli/pom.xml b/modules/enterprise/remoting/cli/pom.xml index 05187c7..dff57e7 100644 --- a/modules/enterprise/remoting/cli/pom.xml +++ b/modules/enterprise/remoting/cli/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<artifactId>rhq-remoting-cli</artifactId> diff --git a/modules/enterprise/remoting/client-api/pom.xml b/modules/enterprise/remoting/client-api/pom.xml index e86ef41..6008df1 100644 --- a/modules/enterprise/remoting/client-api/pom.xml +++ b/modules/enterprise/remoting/client-api/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<artifactId>rhq-remoting-client-api</artifactId> diff --git a/modules/enterprise/remoting/pom.xml b/modules/enterprise/remoting/pom.xml index 910b617..68d51c0 100644 --- a/modules/enterprise/remoting/pom.xml +++ b/modules/enterprise/remoting/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<artifactId>rhq-remoting-parent</artifactId> diff --git a/modules/enterprise/remoting/webservices/pom.xml b/modules/enterprise/remoting/webservices/pom.xml index 2ea73ee..444256d 100644 --- a/modules/enterprise/remoting/webservices/pom.xml +++ b/modules/enterprise/remoting/webservices/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<artifactId>rhq-remoting-webservices</artifactId> diff --git a/modules/enterprise/server/container-lib/pom.xml b/modules/enterprise/server/container-lib/pom.xml index 2c98817..f09e063 100644 --- a/modules/enterprise/server/container-lib/pom.xml +++ b/modules/enterprise/server/container-lib/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/container/pom.xml b/modules/enterprise/server/container/pom.xml index 3fd11e8..b4d2146 100644 --- a/modules/enterprise/server/container/pom.xml +++ b/modules/enterprise/server/container/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/ear/pom.xml b/modules/enterprise/server/ear/pom.xml index bf15866..c063211 100644 --- a/modules/enterprise/server/ear/pom.xml +++ b/modules/enterprise/server/ear/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/jar/pom.xml b/modules/enterprise/server/jar/pom.xml index 79fdc38..ddff575 100644 --- a/modules/enterprise/server/jar/pom.xml +++ b/modules/enterprise/server/jar/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/alert-email/pom.xml b/modules/enterprise/server/plugins/alert-email/pom.xml index dd5bc18..ea1eb7b 100644 --- a/modules/enterprise/server/plugins/alert-email/pom.xml +++ b/modules/enterprise/server/plugins/alert-email/pom.xml @@ -3,7 +3,7 @@ <parent> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent> <modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-irc/pom.xml b/modules/enterprise/server/plugins/alert-irc/pom.xml index c0973f3..363ac0a 100644 --- a/modules/enterprise/server/plugins/alert-irc/pom.xml +++ b/modules/enterprise/server/plugins/alert-irc/pom.xml @@ -3,7 +3,7 @@ <parent> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent> <modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-microblog/pom.xml b/modules/enterprise/server/plugins/alert-microblog/pom.xml index a62fee8..b4751ba 100644 --- a/modules/enterprise/server/plugins/alert-microblog/pom.xml +++ b/modules/enterprise/server/plugins/alert-microblog/pom.xml @@ -3,7 +3,7 @@ <parent> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent> <modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-mobicents/pom.xml b/modules/enterprise/server/plugins/alert-mobicents/pom.xml index 3193539..b0a0c3b 100644 --- a/modules/enterprise/server/plugins/alert-mobicents/pom.xml +++ b/modules/enterprise/server/plugins/alert-mobicents/pom.xml @@ -3,7 +3,7 @@ <parent> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent> <modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-operations/pom.xml b/modules/enterprise/server/plugins/alert-operations/pom.xml index e69bfbc..6d35aed 100644 --- a/modules/enterprise/server/plugins/alert-operations/pom.xml +++ b/modules/enterprise/server/plugins/alert-operations/pom.xml @@ -2,7 +2,7 @@ <parent> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent> <modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-roles/pom.xml b/modules/enterprise/server/plugins/alert-roles/pom.xml index ca33bb7..cbd7334 100644 --- a/modules/enterprise/server/plugins/alert-roles/pom.xml +++ b/modules/enterprise/server/plugins/alert-roles/pom.xml @@ -3,7 +3,7 @@ <parent> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent> <modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-snmp/pom.xml b/modules/enterprise/server/plugins/alert-snmp/pom.xml index af75153..6398092 100644 --- a/modules/enterprise/server/plugins/alert-snmp/pom.xml +++ b/modules/enterprise/server/plugins/alert-snmp/pom.xml @@ -3,7 +3,7 @@ <parent> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent> <modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-subject/pom.xml b/modules/enterprise/server/plugins/alert-subject/pom.xml index 09839b8..ebac52c 100644 --- a/modules/enterprise/server/plugins/alert-subject/pom.xml +++ b/modules/enterprise/server/plugins/alert-subject/pom.xml @@ -3,7 +3,7 @@ <parent> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent> <modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/ant-bundle/pom.xml b/modules/enterprise/server/plugins/ant-bundle/pom.xml index 73f405e..30efb5a 100644 --- a/modules/enterprise/server/plugins/ant-bundle/pom.xml +++ b/modules/enterprise/server/plugins/ant-bundle/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/cobbler/pom.xml b/modules/enterprise/server/plugins/cobbler/pom.xml index 4c44f10..8464662 100644 --- a/modules/enterprise/server/plugins/cobbler/pom.xml +++ b/modules/enterprise/server/plugins/cobbler/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<modelVersion>4.0.0</modelVersion> diff --git a/modules/enterprise/server/plugins/disk/pom.xml b/modules/enterprise/server/plugins/disk/pom.xml index 0033d1b..40ab2a2 100644 --- a/modules/enterprise/server/plugins/disk/pom.xml +++ b/modules/enterprise/server/plugins/disk/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml b/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml index 61965f2..0c5fb51 100644 --- a/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml +++ b/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/jboss-software/pom.xml b/modules/enterprise/server/plugins/jboss-software/pom.xml index 7451668..3f1e165 100644 --- a/modules/enterprise/server/plugins/jboss-software/pom.xml +++ b/modules/enterprise/server/plugins/jboss-software/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml b/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml index 0ac61d3..25917cc 100644 --- a/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml +++ b/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml @@ -7,7 +7,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/perspectives/core/pom.xml b/modules/enterprise/server/plugins/perspectives/core/pom.xml index 5a78451..40c066f 100644 --- a/modules/enterprise/server/plugins/perspectives/core/pom.xml +++ b/modules/enterprise/server/plugins/perspectives/core/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/pom.xml b/modules/enterprise/server/plugins/pom.xml index 2b16f4a..9832288 100644 --- a/modules/enterprise/server/plugins/pom.xml +++ b/modules/enterprise/server/plugins/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/rhnhosted/pom.xml b/modules/enterprise/server/plugins/rhnhosted/pom.xml index e4ab9b2..26e985a 100644 --- a/modules/enterprise/server/plugins/rhnhosted/pom.xml +++ b/modules/enterprise/server/plugins/rhnhosted/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/url/pom.xml b/modules/enterprise/server/plugins/url/pom.xml index a6cba32..14e52de 100644 --- a/modules/enterprise/server/plugins/url/pom.xml +++ b/modules/enterprise/server/plugins/url/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml b/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml index 9c7cc74..e160aa6 100644 --- a/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml +++ b/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/yum/pom.xml b/modules/enterprise/server/plugins/yum/pom.xml index ebdd3da..344a215 100644 --- a/modules/enterprise/server/plugins/yum/pom.xml +++ b/modules/enterprise/server/plugins/yum/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/safe-invoker/pom.xml b/modules/enterprise/server/safe-invoker/pom.xml index 06c8981..bb1abdd 100644 --- a/modules/enterprise/server/safe-invoker/pom.xml +++ b/modules/enterprise/server/safe-invoker/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/sars/agent-sar/pom.xml b/modules/enterprise/server/sars/agent-sar/pom.xml index aa278b8..2458369 100644 --- a/modules/enterprise/server/sars/agent-sar/pom.xml +++ b/modules/enterprise/server/sars/agent-sar/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-sars-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/sars/pom.xml b/modules/enterprise/server/sars/pom.xml index 0cc2084..4ac7f43 100644 --- a/modules/enterprise/server/sars/pom.xml +++ b/modules/enterprise/server/sars/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/xml-schemas/pom.xml b/modules/enterprise/server/xml-schemas/pom.xml index 14738d0..21ccc78 100644 --- a/modules/enterprise/server/xml-schemas/pom.xml +++ b/modules/enterprise/server/xml-schemas/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/helpers/pluginAnnotations/pom.xml b/modules/helpers/pluginAnnotations/pom.xml index d056f74..366d1aa 100644 --- a/modules/helpers/pluginAnnotations/pom.xml +++ b/modules/helpers/pluginAnnotations/pom.xml @@ -6,7 +6,7 @@ <parent> <groupId>org.rhq.helpers</groupId> <artifactId>rhq-helpers</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq.helpers</groupId> diff --git a/modules/helpers/pluginGen/pom.xml b/modules/helpers/pluginGen/pom.xml index 28dc9b1..d992e29 100644 --- a/modules/helpers/pluginGen/pom.xml +++ b/modules/helpers/pluginGen/pom.xml @@ -6,7 +6,7 @@ <parent> <groupId>org.rhq.helpers</groupId> <artifactId>rhq-helpers</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq.helpers</groupId> diff --git a/modules/helpers/pom.xml b/modules/helpers/pom.xml index a0721a9..c5e5ae2 100644 --- a/modules/helpers/pom.xml +++ b/modules/helpers/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq.helpers</groupId> diff --git a/modules/helpers/rtfilter/pom.xml b/modules/helpers/rtfilter/pom.xml index 5d327ee..ffac476 100644 --- a/modules/helpers/rtfilter/pom.xml +++ b/modules/helpers/rtfilter/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq.helpers</groupId> <artifactId>rhq-helpers</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/aliases/pom.xml b/modules/plugins/aliases/pom.xml index c37598e..c475e5e 100644 --- a/modules/plugins/aliases/pom.xml +++ b/modules/plugins/aliases/pom.xml @@ -7,7 +7,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/ant-bundle/pom.xml b/modules/plugins/ant-bundle/pom.xml index cc160c9..5fa4596 100644 --- a/modules/plugins/ant-bundle/pom.xml +++ b/modules/plugins/ant-bundle/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/apache/pom.xml b/modules/plugins/apache/pom.xml index 700a6af..88db42f 100644 --- a/modules/plugins/apache/pom.xml +++ b/modules/plugins/apache/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/augeas/pom.xml b/modules/plugins/augeas/pom.xml index 915106a..51580cd 100644 --- a/modules/plugins/augeas/pom.xml +++ b/modules/plugins/augeas/pom.xml @@ -7,7 +7,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/cobbler/pom.xml b/modules/plugins/cobbler/pom.xml index d920440..a140f5d 100644 --- a/modules/plugins/cobbler/pom.xml +++ b/modules/plugins/cobbler/pom.xml @@ -7,7 +7,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/cron/pom.xml b/modules/plugins/cron/pom.xml index d5aaad5..9119492 100644 --- a/modules/plugins/cron/pom.xml +++ b/modules/plugins/cron/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/database/pom.xml b/modules/plugins/database/pom.xml index 30889f7..714ad7a 100644 --- a/modules/plugins/database/pom.xml +++ b/modules/plugins/database/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/filetemplate-bundle/pom.xml b/modules/plugins/filetemplate-bundle/pom.xml index b79645d..e01b311 100644 --- a/modules/plugins/filetemplate-bundle/pom.xml +++ b/modules/plugins/filetemplate-bundle/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/grub/pom.xml b/modules/plugins/grub/pom.xml index f7cf265..aef1858 100644 --- a/modules/plugins/grub/pom.xml +++ b/modules/plugins/grub/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/hibernate/pom.xml b/modules/plugins/hibernate/pom.xml index acb08ef..4f87dfe 100644 --- a/modules/plugins/hibernate/pom.xml +++ b/modules/plugins/hibernate/pom.xml @@ -6,7 +6,7 @@ <groupId>org.rhq</groupId> <!-- Bypass the jopr-plugins-parent which can not have children. It must build after the plugins in order to execute integration tests on them. --> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.jboss.on</groupId> diff --git a/modules/plugins/hosts/pom.xml b/modules/plugins/hosts/pom.xml index 7dd0fde..157119f 100644 --- a/modules/plugins/hosts/pom.xml +++ b/modules/plugins/hosts/pom.xml @@ -7,7 +7,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/hudson/pom.xml b/modules/plugins/hudson/pom.xml index 65fa7b8..eed10bc 100644 --- a/modules/plugins/hudson/pom.xml +++ b/modules/plugins/hudson/pom.xml @@ -6,7 +6,7 @@ <parent> <artifactId>rhq-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/iis/pom.xml b/modules/plugins/iis/pom.xml index 853c020..9a9c2f0 100644 --- a/modules/plugins/iis/pom.xml +++ b/modules/plugins/iis/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/jboss-as-5/pom.xml b/modules/plugins/jboss-as-5/pom.xml index a0ade77..befe74c 100644 --- a/modules/plugins/jboss-as-5/pom.xml +++ b/modules/plugins/jboss-as-5/pom.xml @@ -9,7 +9,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.jboss.on</groupId> diff --git a/modules/plugins/jboss-as/pom.xml b/modules/plugins/jboss-as/pom.xml index b9ed2b3..ac9b3f6 100644 --- a/modules/plugins/jboss-as/pom.xml +++ b/modules/plugins/jboss-as/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.jboss.on</groupId> diff --git a/modules/plugins/jboss-cache-v3/pom.xml b/modules/plugins/jboss-cache-v3/pom.xml index b3846fa..61f4e11 100644 --- a/modules/plugins/jboss-cache-v3/pom.xml +++ b/modules/plugins/jboss-cache-v3/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.jboss.on</groupId> diff --git a/modules/plugins/jboss-cache/pom.xml b/modules/plugins/jboss-cache/pom.xml index 443e524..684e8e3 100644 --- a/modules/plugins/jboss-cache/pom.xml +++ b/modules/plugins/jboss-cache/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.jboss.on</groupId> diff --git a/modules/plugins/jmx/pom.xml b/modules/plugins/jmx/pom.xml index ac9885a..a9874cc 100644 --- a/modules/plugins/jmx/pom.xml +++ b/modules/plugins/jmx/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/mysql/pom.xml b/modules/plugins/mysql/pom.xml index d0c9053..5a02364 100644 --- a/modules/plugins/mysql/pom.xml +++ b/modules/plugins/mysql/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/netservices/pom.xml b/modules/plugins/netservices/pom.xml index 06ae2ae..3d937e7 100644 --- a/modules/plugins/netservices/pom.xml +++ b/modules/plugins/netservices/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/oracle/pom.xml b/modules/plugins/oracle/pom.xml index 1acdb0f..e915511 100644 --- a/modules/plugins/oracle/pom.xml +++ b/modules/plugins/oracle/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/perftest/pom.xml b/modules/plugins/perftest/pom.xml index 39c75da..f65ad5a 100644 --- a/modules/plugins/perftest/pom.xml +++ b/modules/plugins/perftest/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/platform/pom.xml b/modules/plugins/platform/pom.xml index 97b83b0..aadd8bf 100644 --- a/modules/plugins/platform/pom.xml +++ b/modules/plugins/platform/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/pom.xml b/modules/plugins/pom.xml index 85d6105..f32c52d 100644 --- a/modules/plugins/pom.xml +++ b/modules/plugins/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/postfix/pom.xml b/modules/plugins/postfix/pom.xml index 283ab6a..639838b 100644 --- a/modules/plugins/postfix/pom.xml +++ b/modules/plugins/postfix/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/postgres/pom.xml b/modules/plugins/postgres/pom.xml index 5a4466c..beb98f2 100644 --- a/modules/plugins/postgres/pom.xml +++ b/modules/plugins/postgres/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/rhq-agent/pom.xml b/modules/plugins/rhq-agent/pom.xml index a190dcd..fdb0991 100644 --- a/modules/plugins/rhq-agent/pom.xml +++ b/modules/plugins/rhq-agent/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/rhq-server/pom.xml b/modules/plugins/rhq-server/pom.xml index 8f4e675..8fb6fee 100644 --- a/modules/plugins/rhq-server/pom.xml +++ b/modules/plugins/rhq-server/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.jboss.on</groupId> diff --git a/modules/plugins/samba/pom.xml b/modules/plugins/samba/pom.xml index 0d41574..9411143 100644 --- a/modules/plugins/samba/pom.xml +++ b/modules/plugins/samba/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/script/pom.xml b/modules/plugins/script/pom.xml index 7719b14..0ec4d51 100644 --- a/modules/plugins/script/pom.xml +++ b/modules/plugins/script/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/snmptrapd/pom.xml b/modules/plugins/snmptrapd/pom.xml index 2d9d715..f5106f0 100644 --- a/modules/plugins/snmptrapd/pom.xml +++ b/modules/plugins/snmptrapd/pom.xml @@ -2,7 +2,7 @@ <parent> <artifactId>rhq-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<modelVersion>4.0.0</modelVersion> diff --git a/modules/plugins/sshd/pom.xml b/modules/plugins/sshd/pom.xml index 3579496..b637f0d 100644 --- a/modules/plugins/sshd/pom.xml +++ b/modules/plugins/sshd/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/sudoers/pom.xml b/modules/plugins/sudoers/pom.xml index 41df1b8..55c3b49 100644 --- a/modules/plugins/sudoers/pom.xml +++ b/modules/plugins/sudoers/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/tomcat/pom.xml b/modules/plugins/tomcat/pom.xml index 205d5b0..9de8802 100644 --- a/modules/plugins/tomcat/pom.xml +++ b/modules/plugins/tomcat/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.jboss.on</groupId> diff --git a/modules/plugins/twitter/pom.xml b/modules/plugins/twitter/pom.xml index e299efa..9ee6ac3 100644 --- a/modules/plugins/twitter/pom.xml +++ b/modules/plugins/twitter/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/validate-all-plugins/pom.xml b/modules/plugins/validate-all-plugins/pom.xml index b3d5e87..93e847c 100644 --- a/modules/plugins/validate-all-plugins/pom.xml +++ b/modules/plugins/validate-all-plugins/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/pom.xml b/modules/pom.xml index bc96ae3..a6af192 100644 --- a/modules/pom.xml +++ b/modules/pom.xml @@ -6,7 +6,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/test-utils/pom.xml b/modules/test-utils/pom.xml index 2235687..5b243a9 100644 --- a/modules/test-utils/pom.xml +++ b/modules/test-utils/pom.xml @@ -4,7 +4,7 @@ <parent> <artifactId>rhq-modules-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> </parent> <artifactId>test-utils</artifactId> <name>RHQ Test Utils</name> diff --git a/pom.xml b/pom.xml index 7ff85bb..5e2dc43 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@
<groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA</version> <packaging>pom</packaging>
<name>RHQ</name>
commit fe26d6a1480246d9e9d42b38f3076e1c9cd45c5d Merge: fe24a0b... d3ecc7e... Author: Jay Shaughnessy jshaughn@redhat.com Date: Mon Jul 26 13:25:25 2010 -0400
Merge branch 'master' into master-jay
commit fe24a0b7e6dc3573a90c58e7f6047757ad3160dc Author: Jay Shaughnessy jshaughn@redhat.com Date: Mon Jul 26 10:57:21 2010 -0400
add some minor protection against concurrent repo sync by disabling button while one gui initiated sync is running.
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/content/repo.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/content/repo.xhtml index 7f30b4d..a636bae 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/content/repo.xhtml +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/content/repo.xhtml @@ -193,7 +193,7 @@ <h:commandButton rendered="${mode ne 'edit'}" value="EDIT" action="#{RepoDetailsUIBean.edit}" alt="Edit" styleClass="buttonmed" id="editButton" /> - <h:commandButton rendered="${mode ne 'edit'}" + <h:commandButton rendered="${mode ne 'edit' and not RepoDetailsUIBean.currentlySyncing}" value="SYNCHRONIZE" action="#{RepoDetailsUIBean.sync}" alt="Synchronize" styleClass="buttonmed" id="syncButton" /> <h:commandButton rendered="#{RepoDetailsUIBean.currentlySyncing}"
commit 5efcc6d725c133800b7535a1346e54971adf5f7f Author: Ian Springer ian.springer@redhat.com Date: Mon Jul 26 13:05:24 2010 -0400
disable tests, and publishing of Maven artifacts for enterprise builds
diff --git a/release.sh b/release.sh index 9cb9e06..fd595a2 100644 --- a/release.sh +++ b/release.sh @@ -177,9 +177,11 @@ fi PROJECT_GIT_URL="ssh://${GIT_USERNAME}@git.fedorahosted.org/git/rhq/rhq.git"
MAVEN_ARGS="--settings $MAVEN_SETTINGS_FILE --batch-mode --errors -Penterprise,dist,release" -if [ "$MODE" = "test" ]; then - MAVEN_ARGS="$MAVEN_ARGS -Dmaven.test.skip=true" -fi +# TODO: We may eventually want to reenable tests for production releases. +#if [ "$MODE" = "test" ]; then +# MAVEN_ARGS="$MAVEN_ARGS -Dmaven.test.skip=true" +#fi +MAVEN_ARGS="$MAVEN_ARGS -Dmaven.test.skip=true" if [ "$RELEASE_TYPE" = "enterprise" ]; then MAVEN_ARGS="$MAVEN_ARGS -Dexclude-webdav -Djava5.home=$JAVA5_HOME/jre" fi @@ -193,7 +195,8 @@ if [ -z "$MAVEN_LOCAL_REPO_PURGE_INTERVAL_HOURS" ]; then MAVEN_LOCAL_REPO_PURGE_INTERVAL_HOURS="6" fi
-if [ "$MODE" = "production" ]; then +# TODO: We may eventually want to reenable publishing of enterprise artifacts. +if [ "$MODE" = "production" ] && [ "$RELEASE_TYPE" = "community" ]; then MAVEN_RELEASE_PERFORM_GOAL="deploy" else MAVEN_RELEASE_PERFORM_GOAL="install"
commit 52476886663a8d99b94e1b9e15246fe6ea173c22 Author: Greg Hinkle ghinkle@redhat.com Date: Mon Jul 26 12:28:14 2010 -0400
Fix debug error message due to unsupported clipping model on breadcrumb pane
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/BreadcrumbTrailPane.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/BreadcrumbTrailPane.java index 29377cd..17e9237 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/BreadcrumbTrailPane.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/BreadcrumbTrailPane.java @@ -41,7 +41,7 @@ public class BreadcrumbTrailPane extends ToolStrip { setWidth100(); setMembersMargin(15);
- setOverflow(Overflow.CLIP_V); + setOverflow(Overflow.HIDDEN);
}
commit fb105f6293db80686f723048c9931b1c90889c58 Author: Jay Shaughnessy jshaughn@redhat.com Date: Mon Jul 26 12:23:34 2010 -0400
Commentedt out test class until https://bugzilla.redhat.com/show_bug.cgi?id=618314 gets resolved.
diff --git a/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/ApachePluginTest.java b/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/ApachePluginTest.java index f3ce761..890aa10 100644 --- a/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/ApachePluginTest.java +++ b/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/ApachePluginTest.java @@ -18,6 +18,7 @@ */ package org.rhq.plugins.apache;
+/* import java.io.File; import java.util.ArrayList; import java.util.Collections; @@ -42,6 +43,7 @@ import org.rhq.core.pc.plugin.PluginEnvironment; import org.rhq.core.pc.plugin.PluginManager; import org.rhq.core.pluginapi.inventory.ResourceComponent; import org.rhq.core.pluginapi.measurement.MeasurementFacet; +*/
/** * The unit tests for the JON Apache plugin. @@ -51,6 +53,7 @@ import org.rhq.core.pluginapi.measurement.MeasurementFacet; public class ApachePluginTest { private static final String PLUGIN_NAME = "Apache";
+ /* @BeforeSuite public void start() { //System.out.println("java.class.path=" + System.getProperty("java.class.path")); @@ -150,4 +153,5 @@ public class ApachePluginTest { ApachePluginTest pluginTest = new ApachePluginTest(); pluginTest.start(); } + */ } \ No newline at end of file
commit e38b19c067b0d880f48d257bdea7c6522e089295 Author: Greg Hinkle ghinkle@redhat.com Date: Mon Jul 26 12:22:03 2010 -0400
Fix bug with overlaying one top pane on another
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java index 7dfd9df..8fb1f0b 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java @@ -49,6 +49,7 @@ import org.rhq.enterprise.gui.coregui.client.alert.AlertsView; import org.rhq.enterprise.gui.coregui.client.bundle.BundleTopView; import org.rhq.enterprise.gui.coregui.client.dashboard.DashboardsView; import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup; +import org.rhq.enterprise.gui.coregui.client.inventory.groups.detail.ResourceGroupTopView; import org.rhq.enterprise.gui.coregui.client.inventory.resource.InventoryView; import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.ResourceView; import org.rhq.enterprise.gui.coregui.client.menu.MenuBarView; @@ -262,6 +263,8 @@ public class CoreGUI implements EntryPoint, ValueChangeHandler<String> { canvas = new InventoryView(); } else if (breadcrumbName.equals("Resource")) { canvas = new ResourceView(); + } else if (breadcrumbName.equals("ResourceGroup")) { + canvas = new ResourceGroupTopView(); } else if (breadcrumbName.equals("Dashboard")) { canvas = new DashboardsView(); } else if (breadcrumbName.equals("Bundles")) { @@ -308,9 +311,9 @@ public class CoreGUI implements EntryPoint, ValueChangeHandler<String> {
public static void setContent(Canvas newContent) { Canvas contentCanvas = Canvas.getById(CONTENT_CANVAS_ID); - if (contentCanvas.getChildren().length > 0) - contentCanvas.getChildren()[0].destroy(); - + for (Canvas child : contentCanvas.getChildren()) { + child.destroy(); + } if (newContent != null) { content = newContent; contentCanvas.addChild(newContent);
commit 5e8b7a6ae42e61fe9fe2a617baf473c857a188ef Author: Greg Hinkle ghinkle@redhat.com Date: Mon Jul 26 12:21:41 2010 -0400
Initial resource group tree view work
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java index 4e9f17a..a8bd44a 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java @@ -281,7 +281,9 @@ public class ResourceGroupDetailView extends VLayout implements BookmarkableView
public void renderView(ViewPath viewPath) { - // TODO: Implement this method. + + Integer groupId = Integer.parseInt(viewPath.getCurrent().getPath()); +
if (viewPath.isEnd()) { // default diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupTopView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupTopView.java index 37c492c..3aade28 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupTopView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupTopView.java @@ -22,15 +22,19 @@ */ package org.rhq.enterprise.gui.coregui.client.inventory.groups.detail;
+import com.google.gwt.user.client.rpc.AsyncCallback; import com.smartgwt.client.widgets.Canvas; import com.smartgwt.client.widgets.layout.HLayout;
-import org.rhq.core.domain.resource.Resource; +import org.rhq.core.domain.resource.group.ResourceGroup; +import org.rhq.core.domain.resource.group.composite.ClusterFlyweight; import org.rhq.enterprise.gui.coregui.client.BookmarkableView; +import org.rhq.enterprise.gui.coregui.client.CoreGUI; import org.rhq.enterprise.gui.coregui.client.ViewId; import org.rhq.enterprise.gui.coregui.client.ViewPath; import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup; import org.rhq.enterprise.gui.coregui.client.gwt.ResourceGWTServiceAsync; +import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.ResourceTreeView;
/** * @author Greg Hinkle @@ -39,10 +43,10 @@ public class ResourceGroupTopView extends HLayout implements BookmarkableView {
private Canvas contentCanvas;
- private Resource currentResource; + private ResourceGroup currentGroup; //private Resource resourcePlatform;
-// private ResourceTreeView treeView; + private ResourceGroupTreeView treeView; private ResourceGroupDetailView detailView = new ResourceGroupDetailView();
private ResourceGWTServiceAsync resourceService = GWTServiceLookup.getResourceService(); @@ -60,15 +64,15 @@ public class ResourceGroupTopView extends HLayout implements BookmarkableView { setHeight100();
-// treeView = new ResourceTreeView(); -// addMember(treeView); + treeView = new ResourceGroupTreeView(); + addMember(treeView);
contentCanvas = new Canvas(); addMember(contentCanvas);
// created above -// detailView = new ResourceDetailView(); + detailView = new ResourceGroupDetailView();
// treeView.addResourceSelectListener(detailView);
@@ -128,13 +132,19 @@ public class ResourceGroupTopView extends HLayout implements BookmarkableView { viewPath.getViewPath().add(new ViewId("Overview")); }
- Integer resourceId = Integer.parseInt(viewPath.getCurrent().getPath()); + Integer groupId = Integer.parseInt(viewPath.getCurrent().getPath());
- if (currentResource == null || currentResource.getId() != resourceId) { + + + + if (currentGroup == null || currentGroup.getId() != groupId) {
// setSelectedResource(resourceId, viewPath);
-// this.treeView.renderView(viewPath); + this.treeView.setSelectedGroup(groupId); + + +
viewPath.next();
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupTreeView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupTreeView.java new file mode 100644 index 0000000..ef5406d --- /dev/null +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupTreeView.java @@ -0,0 +1,130 @@ +/* + * RHQ Management Platform + * Copyright (C) 2005-2010 Red Hat, Inc. + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License, version 2, as + * published by the Free Software Foundation, and/or the GNU Lesser + * General Public License, version 2.1, also as published by the Free + * Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License and the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License + * and the GNU Lesser General Public License along with this program; + * if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +package org.rhq.enterprise.gui.coregui.client.inventory.groups.detail; + +import java.util.ArrayList; +import java.util.HashMap; + +import com.google.gwt.user.client.rpc.AsyncCallback; +import com.smartgwt.client.widgets.layout.VLayout; +import com.smartgwt.client.widgets.tree.Tree; +import com.smartgwt.client.widgets.tree.TreeGrid; +import com.smartgwt.client.widgets.tree.TreeNode; + +import org.rhq.core.domain.resource.group.composite.ClusterFlyweight; +import org.rhq.enterprise.gui.coregui.client.CoreGUI; +import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup; + +/** + * @author Greg Hinkle + */ +public class ResourceGroupTreeView extends VLayout { + + + private int groupId; + + private TreeGrid treeGrid; + + public ResourceGroupTreeView() { + setWidth(250); + setHeight100(); + } + + + @Override + protected void onInit() { + super.onInit(); + + + this.treeGrid = new TreeGrid(); + this.treeGrid.setWidth100(); + this.treeGrid.setHeight100(); + treeGrid.setShowRoot(true); + + addMember(this.treeGrid); + + + } + + public void setSelectedGroup(int groupId) { + this.groupId = groupId; + GWTServiceLookup.getClusterService().getClusterTree(groupId, + new AsyncCallback<ClusterFlyweight>() { + public void onFailure(Throwable caught) { + CoreGUI.getErrorHandler().handleError("Failed to load tree", caught); + } + + public void onSuccess(ClusterFlyweight result) { + loadTree(result); + } + }); + + + } + + + + + private void loadTree(ClusterFlyweight root) { + + + TreeNode rootNode = new TreeNode(root.getName()); + + loadTree(rootNode, root); + + Tree tree = new Tree(); + tree.setRoot(rootNode); + + treeGrid.setData(tree); + markForRedraw(); + + } + + public void loadTree(TreeNode parent, ClusterFlyweight parentNode) { + if (!parentNode.getChildren().isEmpty()) { + + ArrayList<TreeNode> childNodes = new ArrayList<TreeNode>(); + + HashMap<Integer,TreeNode> typeNodes = new HashMap<Integer, TreeNode>(); + + + for (ClusterFlyweight child : parentNode.getChildren()) { + + + + + + TreeNode node = new TreeNode(child.getName()); + childNodes.add(node); + + if (child.getChildren().isEmpty()) { + node.setIsFolder(false); + } else { + node.setIsFolder(true); + loadTree(node, child); + } + } + parent.setChildren(childNodes.toArray(new TreeNode[childNodes.size()])); + } + } +}
commit 929c3cd23ad8e2f1bfb8340483b2365af987b038 Author: Jay Shaughnessy jshaughn@redhat.com Date: Mon Jul 26 11:07:24 2010 -0400
Fix compile error in ws test code due to removal of getConfiguration remote.
diff --git a/modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/WsConfigurationManagerTest.java b/modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/WsConfigurationManagerTest.java index 7c80417..0ee5348 100644 --- a/modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/WsConfigurationManagerTest.java +++ b/modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/WsConfigurationManagerTest.java @@ -77,15 +77,6 @@ public class WsConfigurationManagerTest extends AssertJUnit implements TestPrope
// TODO: verify configuration details
- // Test get configuration - Configuration configRetrieved = WEBSERVICE_REMOTE.getConfiguration( - // JaxbConfiguration configRetrieved = - // WEBSERVICE_REMOTE.getConfiguration( - subject, configuration.getId()); - assertNotNull("Configuration was not located.", configRetrieved); - assertEquals("Configuration information was not correct.", configuration.getVersion(), configRetrieved - .getVersion()); - boolean isUpdating = WEBSERVICE_REMOTE.isResourceConfigurationUpdateInProgress(subject, resource.getId()); assertFalse("Config should not be in process of modification.", isUpdating);
@@ -95,7 +86,7 @@ public class WsConfigurationManagerTest extends AssertJUnit implements TestPrope // JaxbConfiguration pluginConfig = // WEBSERVICE_REMOTE.getPluginConfiguration( subject, resource.getId()); - assertNotNull("Configuration was not located.", configRetrieved); + assertNotNull("Configuration was not located.", pluginConfig); assertNotNull("The property definition map should not be null.", pluginConfig.getProperties()); // pluginConfig.getPropertyListOrPropertySimpleOrPropertyMap()); }
commit 0bfff55f068fae0d325b66ce0fc6cd1566542dc8 Author: Heiko W. Rupp hwr@redhat.com Date: Mon Jul 26 13:09:20 2010 +0200
BZ 617718 - follow the OID -> oid change in the last commit as property names are case specific.
diff --git a/modules/enterprise/server/plugins/alert-snmp/src/main/java/org/rhq/enterprise/server/plugins/alertSnmp/SnmpInfo.java b/modules/enterprise/server/plugins/alert-snmp/src/main/java/org/rhq/enterprise/server/plugins/alertSnmp/SnmpInfo.java index ef3af1d..082e706 100644 --- a/modules/enterprise/server/plugins/alert-snmp/src/main/java/org/rhq/enterprise/server/plugins/alertSnmp/SnmpInfo.java +++ b/modules/enterprise/server/plugins/alert-snmp/src/main/java/org/rhq/enterprise/server/plugins/alertSnmp/SnmpInfo.java @@ -32,7 +32,7 @@ public class SnmpInfo { public static SnmpInfo load(Configuration configuration) { String host = configuration.getSimpleValue("host", null); // required String port = configuration.getSimpleValue("port", "162"); - String oid = configuration.getSimpleValue("OID", null); // required + String oid = configuration.getSimpleValue("oid", null); // required
return new SnmpInfo(host, port, oid); } diff --git a/modules/enterprise/server/plugins/alert-snmp/src/main/java/org/rhq/enterprise/server/plugins/alertSnmp/SnmpTrapSender.java b/modules/enterprise/server/plugins/alert-snmp/src/main/java/org/rhq/enterprise/server/plugins/alertSnmp/SnmpTrapSender.java index 2a52279..4389779 100644 --- a/modules/enterprise/server/plugins/alert-snmp/src/main/java/org/rhq/enterprise/server/plugins/alertSnmp/SnmpTrapSender.java +++ b/modules/enterprise/server/plugins/alert-snmp/src/main/java/org/rhq/enterprise/server/plugins/alertSnmp/SnmpTrapSender.java @@ -467,7 +467,7 @@ public class SnmpTrapSender implements PDUFactory { return "SNMP is not enabled."; }
- String baseOid = alertParameters.getSimpleValue("OID",null); + String baseOid = alertParameters.getSimpleValue("oid",null);
// TODO add a request id and a timestamp
commit d3ecc7eacb94dc4d97ee6ff96d3193c1d4f0d2b4 Author: Heiko W. Rupp hwr@pilhuhn.de Date: Sun Jul 25 21:57:04 2010 +0200
BZ 617577 - avoid doing the expensive recursive query again. Also the call to getTree is not needed.
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/Resource.java b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/Resource.java index 52420f4..bae5e26 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/Resource.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/Resource.java @@ -283,7 +283,7 @@ import org.rhq.core.domain.util.Summary; + " JOIN res.currentAvailability a " // + " JOIN res.resourceType rt LEFT JOIN rt.subCategory " // + " WHERE res.parentResource = :parent " // - + " AND rt.id IN ( :resourceTypeIds ) " // + + " AND rt.id IN ( :resourceTypeIds ) " // + " AND res.inventoryStatus = :inventoryStatus GROUP BY res.parentResource, rt"), @NamedQuery(name = Resource.QUERY_FIND_CHILDREN_BY_CATEGORY_AND_INVENTORY_STATUS, query = "" // + "SELECT res " // @@ -451,7 +451,7 @@ import org.rhq.core.domain.util.Summary; + " WHERE rg.id = :groupId " // + " AND res.inventoryStatus = 'COMMITTED' "), @NamedQuery(name = Resource.QUERY_GET_AVAILABLE_RESOURCES_FOR_REPO, query = "" // - + " SELECT res " // + + " SELECT res " // + " FROM Resource AS res " // + " WHERE res.id NOT IN " // + " ( SELECT rc.resource.id " // @@ -702,6 +702,13 @@ import org.rhq.core.domain.util.Summary; + " OR r.id IN (SELECT rr.id FROM Resource rr WHERE rr.parentResource.parentResource.parentResource.parentResource.parentResource.id = :resourceId) " + " OR r.id IN (SELECT rr.id FROM Resource rr WHERE rr.parentResource.parentResource.parentResource.parentResource.parentResource.parentResource.id = :resourceId) " + " "), + @NamedQuery(name = Resource.QUERY_MARK_RESOURCES_FOR_ASYNC_DELETION_QUICK, query = "" // + + "UPDATE Resource r " // + + " SET r.inventoryStatus = :status, " // + + " r.agent = NULL, " // + + " r.parentResource = NULL, " // takes resources out of the hierarchy, so we don't have to change ResourceSyncInfo logic + + " r.resourceKey = 'deleted' " // + + " WHERE r.id IN (:resourceIds ) "), // @NamedQuery(name = Resource.QUERY_MARK_RESOURCES_FOR_ASYNC_DELETION, query = "" // + "UPDATE Resource r " // + " SET r.inventoryStatus = :status, " // @@ -858,6 +865,7 @@ public class Resource implements Comparable<Resource>, Serializable {
public static final String QUERY_FIND_DESCENDENTS_BY_TYPE_AND_NAME = "Resource.findDescendentsByTypeAndName"; public static final String QUERY_FIND_DESCENDENTS = "Resource.findDescendents"; + public static final String QUERY_MARK_RESOURCES_FOR_ASYNC_DELETION_QUICK = "Resource.markResourcesForAsyncDeletionQuick"; public static final String QUERY_MARK_RESOURCES_FOR_ASYNC_DELETION = "Resource.markResourcesForAsyncDeletion"; public static final String QUERY_FIND_RESOURCES_MARKED_FOR_ASYNC_DELETION = "Resource.findResourcesMarkedForAsyncDeletion";
@@ -969,7 +977,7 @@ public class Resource implements Comparable<Resource>, Serializable { @ManyToMany(mappedBy = "implicitResources", fetch = FetchType.LAZY) private Set<ResourceGroup> implicitGroups = new HashSet<ResourceGroup>();
- // bulk delete + // bulk delete @ManyToMany(mappedBy = "explicitResources", fetch = FetchType.LAZY) private Set<ResourceGroup> explicitGroups = new HashSet<ResourceGroup>();
@@ -1209,16 +1217,16 @@ public class Resource implements Comparable<Resource>, Serializable { /** * This method should be called whenever we want the agent to recognize that something about this resource has * changed on the server-side that requires synchronization to take place. - * + * * We don't want to modify the mtime every time this resource is updated/merged; this field has special meaning * to the agent-side representation of this resource in the plugin container; if the server-side mtime is later * than the agent-side, the agent thinks this resource has been modified in some way and will start a workflow that * causes synchronization to happen; however, the agent only cares about specific types of updates to the resource: - * + * * - plugin configuration changes * - measurement schedule updates * - basic fields modified such as name, description, inventory status, etc - * + * * For a list of changes that the agent cares about, see InventoryManager.mergeResource(Resource, Resource) */
@@ -1715,7 +1723,7 @@ public class Resource implements Comparable<Resource>, Serializable { }
public void writeExternalAgent(ObjectOutput out) throws IOException { - // Note that a Resource may have been constructed with id only. Check for uninitialized fields. + // Note that a Resource may have been constructed with id only. Check for uninitialized fields. out.writeInt(id); out.writeUTF(uuid); out.writeUTF((null == resourceKey) ? "" : resourceKey); @@ -1785,7 +1793,7 @@ public class Resource implements Comparable<Resource>, Serializable {
// It is assumed that the object is clean of Hibernate proxies (i.e. HibernateDetachUtility has been run if necessary) public void writeExternalRemote(ObjectOutput out) throws IOException { - // Note that a Resource may have been constructed with id only. Check for uninitialized fields. + // Note that a Resource may have been constructed with id only. Check for uninitialized fields. out.writeInt(id); out.writeUTF(uuid); out.writeUTF(resourceKey); @@ -1805,10 +1813,10 @@ public class Resource implements Comparable<Resource>, Serializable { out.writeObject(resourceConfiguration); out.writeObject(pluginConfiguration); out.writeObject(agent); - // not supplied by remote: alertDefinitions + // not supplied by remote: alertDefinitions // not supplied by remote: resourceConfigurationUpdates // not supplied by remote: pluginConfigurationUpdates - // making a copy reduces chances of ConcurrentModificationException in a thread iterating the original + // making a copy reduces chances of ConcurrentModificationException in a thread iterating the original out.writeObject((null == implicitGroups) ? null : new LinkedHashSet<ResourceGroup>(implicitGroups)); // making a copy reduces chances of ConcurrentModificationException in a thread iterating the original out.writeObject((null == explicitGroups) ? null : new LinkedHashSet<ResourceGroup>(explicitGroups)); @@ -1823,7 +1831,7 @@ public class Resource implements Comparable<Resource>, Serializable { out.writeObject(availability); out.writeObject(currentAvailability); out.writeObject(resourceErrors); - // not supplied by remote: eventSources + // not supplied by remote: eventSources out.writeObject(productVersion); }
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerBean.java index 3687b5e..3dfc87f 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerBean.java @@ -229,7 +229,8 @@ public class ResourceManagerBean implements ResourceManagerLocal, ResourceManage @SuppressWarnings("unchecked") @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW) public List<Integer> uninventoryResource(Subject user, int resourceId) { - Resource resource = resourceManager.getResourceTree(resourceId, true); +// Resource resource = resourceManager.getResourceTree(resourceId, true); + Resource resource = entityManager.find(Resource.class,resourceId); if (resource == null) { log.info("Delete resource not possible, as resource with id [" + resourceId + "] was not found"); return Collections.emptyList(); // Resource not found. TODO give a nice message to the user @@ -293,10 +294,28 @@ public class ResourceManagerBean implements ResourceManagerLocal, ResourceManage i = j; }
- Query markDeletedQuery = entityManager.createNamedQuery(Resource.QUERY_MARK_RESOURCES_FOR_ASYNC_DELETION); - markDeletedQuery.setParameter("resourceId", resourceId); - markDeletedQuery.setParameter("status", InventoryStatus.UNINVENTORIED); - int resourcesDeleted = markDeletedQuery.executeUpdate(); + // QUERY_MARK_RESOURCES_FOR_ASYNC_DELETION is an expensive recursive query + // But luckily we have already (through such a recursive query above) determined the doomed resources +// Query markDeletedQuery = entityManager.createNamedQuery(Resource.QUERY_MARK_RESOURCES_FOR_ASYNC_DELETION); +// markDeletedQuery.setParameter("resourceId", resourceId); +// markDeletedQuery.setParameter("status", InventoryStatus.UNINVENTORIED); +// int resourcesDeleted = markDeletedQuery.executeUpdate(); + + i = 0; + int resourcesDeleted = 0; + while (i < toBeDeletedResourceIds.size()) { + int j = i + 1000; + if (j > toBeDeletedResourceIds.size()) + j = toBeDeletedResourceIds.size(); + List<Integer> idsToDelete = toBeDeletedResourceIds.subList(i, j); + + + Query markDeletedQuery = entityManager.createNamedQuery(Resource.QUERY_MARK_RESOURCES_FOR_ASYNC_DELETION_QUICK); + markDeletedQuery.setParameter("resourceIds", idsToDelete); + markDeletedQuery.setParameter("status", InventoryStatus.UNINVENTORIED); + resourcesDeleted+= markDeletedQuery.executeUpdate(); + i = j; + }
if (resourcesDeleted != toBeDeletedResourceIds.size()) { log.error("Tried to uninventory " + toBeDeletedResourceIds.size()
commit 6e03907d4f26b130f37426e50cdd4df0d111d344 Author: Heiko W. Rupp hwr@pilhuhn.de Date: Sun Jul 25 14:29:57 2010 +0200
BZ 604034 - use a newer version of jaxb impl to avoid issues with maven repos.
diff --git a/pom.xml b/pom.xml index ab4b267..306bbff 100644 --- a/pom.xml +++ b/pom.xml @@ -33,7 +33,7 @@
<properties> <!-- explictly specify a default encoding to avoid relying on the LANG env var being set correctly --> - <project.build.sourceEncoding>ISO-8859-1</project.build.sourceEncoding> + <project.build.sourceEncoding>ISO-8859-1</project.build.sourceEncoding>
<rhq.groupId>org.rhq</rhq.groupId> <rhq.product.name>RHQ</rhq.product.name> @@ -52,7 +52,7 @@ <product.salesEmail>sales@rhq-project.org</product.salesEmail> <product.supportEmail>info@rhq-project.org</product.supportEmail> <product.version>${project.version}</product.version> - <product.helpDocRoot>http://support.rhq-project.org/display/RHQ/</product.helpDocRoot> + <product.helpDocRoot>http://support.rhq-project.org/display/RHQ/</product.helpDocRoot>
<doUpdate>false</doUpdate>
@@ -81,7 +81,7 @@ <hibernate-entitymanager.version>3.2.1.GA</hibernate-entitymanager.version> <i18nlog.version>1.0.10</i18nlog.version> <jaxb-api.version>2.1</jaxb-api.version> - <jaxb-impl.version>2.1.6</jaxb-impl.version> + <jaxb-impl.version>2.1.9</jaxb-impl.version> <jsf-api.version>1.2_14</jsf-api.version> <jsf-impl.version>1.2_14</jsf-impl.version> <ojdbc5.version>11.2.0.1.0</ojdbc5.version>
commit a1ab2bc79180820bfa05ec8284a03830c5c7f0e0 Author: Heiko W. Rupp hwr@pilhuhn.de Date: Sun Jul 25 14:28:49 2010 +0200
Start rewriting to handle blocks of questions.
diff --git a/modules/helpers/bundleGen/src/main/java/org/rhq/helpers/bundleGen/XmlQuestionsReader.java b/modules/helpers/bundleGen/src/main/java/org/rhq/helpers/bundleGen/XmlQuestionsReader.java index 649cbf5..6e72405 100644 --- a/modules/helpers/bundleGen/src/main/java/org/rhq/helpers/bundleGen/XmlQuestionsReader.java +++ b/modules/helpers/bundleGen/src/main/java/org/rhq/helpers/bundleGen/XmlQuestionsReader.java @@ -21,8 +21,11 @@ package org.rhq.helpers.bundleGen; import java.io.BufferedReader; import java.io.FileNotFoundException; import java.io.InputStream; +import java.util.Collections; +import java.util.HashMap; import java.util.Locale; import java.lang.reflect.Method; +import java.util.Map; import java.util.ResourceBundle;
import javax.xml.parsers.DocumentBuilder; @@ -78,100 +81,126 @@ public class XmlQuestionsReader {
Document doc = builder.parse(input); Element root = doc.getDocumentElement(); // <questions> - NodeList questionNodes = root.getChildNodes();// "question" + NodeList questionNodes = root.getChildNodes();// "question|block"
for (int i = 0; i < questionNodes.getLength(); i++ ) { Node node = questionNodes.item(i); if (node instanceof Element) { - Element question = (Element)node; - String prop = question.getAttribute("prop"); - String type = question.getAttribute("type"); - if (type.equals("")) - type="string"; - String aIf = question.getAttribute("if"); // TODO implement - - if (!isValidType(type)) { - System.err.println("Type " + type + " is invalid in " + question ); - return; + String nodeName = node.getNodeName(); + if (nodeName.equals("question")) { + Element question = (Element)node; + String res = handleQuestion(reader,question,lang); + String prop = question.getAttribute("prop"); + String type = question.getAttribute("type"); + fillObject(props,prop,type,res); } - Element text = getElementForLang(question,"text",lang); - NodeList prefillNodes = question.getElementsByTagName("prefill"); - String prefill = null; - if (prefillNodes.getLength()>0) { - prefill = prefillNodes.item(0).getTextContent(); - } - Element helpNode = getElementForLang(question,"help",lang); - String help = null; - if (helpNode!=null) { - help = helpNode.getTextContent(); - } - - boolean isBool = false; - System.out.print(text.getTextContent()); - if ("bool".equals(type)) { - isBool = true; - System.out.print(resourceBundle.getString("yes.no")); - } - if (prefill!=null) { - System.out.print("[" + prefill + "]"); - } - - String answer; - boolean helpRequested = false; - do { - helpRequested = false; - System.out.print(": "); - answer = reader.readLine(); - if (answer.startsWith("?")) { - helpRequested = true; - if (help!=null) { - System.out.println(help); - } - else - System.out.println(resourceBundle.getString("no.help.available")); - } - - } while (helpRequested); - - String setterName = "set" + caps(prop); - Method setter; - if (isBool) - setter = Props.class.getMethod(setterName, Boolean.TYPE); - else - setter = Props.class.getMethod(setterName, String.class); - - if (isBool) { - String yesString = resourceBundle.getString("yes.key"); - if (answer.toLowerCase(Locale.getDefault()).startsWith(yesString)) { - setter.invoke(props, true); - } - } - else if ("string".equals(type)) { - // If only return pressed and we have a prefill, use this. - if (prefill!= null && answer.length()==0) { - setter.invoke(props,prefill); - } - else { - if (!answer.startsWith("\n") && !answer.startsWith("\r") && !(answer.length() == 0)) - setter.invoke(props,answer); - } - } - else { + else if (nodeName.equals("block")) { +// Map res = handleBlock(reader,node,props,lang); // TODO } } + } + } + catch (Exception e ) { + e.printStackTrace(); + } + }
+ private void handleBlock(BufferedReader reader, Node node, Props props, String lang) throws Exception + { + Element block = (Element)node; + String repeat = block.getAttribute("repeat"); + if (repeat==null || repeat.isEmpty()) + repeat="one";
+ int repeatCount = 0;
- } +// for () { +// // first ask the standalone question and decide from there +// Element question = (Element) block.getElementsByTagName("question").item(0); +// +// +// // Now loop over the questions +// NodeList questions = block.getElementsByTagName("question"); +// for (int i = 1; i < questions.getLength(); i++) { +// Node qnode = questions.item(i); +// // handleQuestion(reader,qnode,props,lang); TODO +// } +// } + } + + /** + * Handle <question> elements + * @param reader + * @param question + * @param lang + * @throws Exception + */ + private String handleQuestion(BufferedReader reader, Element question,String lang) throws Exception + { + String type = question.getAttribute("type"); + if (type.equals("")) + type="string"; + + if (!isValidType(type)) { + System.err.println("Type " + type + " is invalid in " + question ); + return null; + } + Element text = getElementForLang(question,"text",lang); + NodeList prefillNodes = question.getElementsByTagName("prefill"); + String prefill = null; + if (prefillNodes.getLength()>0) { + prefill = prefillNodes.item(0).getTextContent(); } - catch (Exception e) { - throw e; + Element helpNode = getElementForLang(question,"help",lang); + String help = null; + if (helpNode!=null) { + help = helpNode.getTextContent(); }
+ System.out.print(text.getTextContent()); + if ("bool".equals(type)) { + System.out.print(resourceBundle.getString("yes.no")); + } + if (prefill!=null) { + System.out.print("[" + prefill + "]"); + } + + String answer; + boolean helpRequested = false; + do { + helpRequested = false; + System.out.print(": "); + answer = reader.readLine(); + if (answer.startsWith("?")) { + helpRequested = true; + if (help!=null) { + System.out.println(help); + } + else + System.out.println(resourceBundle.getString("no.help.available")); + } + + } while (helpRequested); + + if (type.equals("bool")) { + String yesString = resourceBundle.getString("yes.key"); + if (answer.toLowerCase(Locale.getDefault()).startsWith(yesString)) + return Boolean.TRUE.toString(); + else + return Boolean.FALSE.toString(); + } + else { + if (prefill!= null && answer.length()==0) { + return prefill; + } + else + return answer; + } }
+ /** * Search for an element <i>tagWanted</i> within parent. If multiple * elements are present, use the one with the matching <i>lang</i>. @@ -201,6 +230,26 @@ public class XmlQuestionsReader { } return noLang; } + + + private void fillObject(Object target, String prop, String type, String res) throws Exception { + + String setterName = "set" + caps(prop); + Method setter; + Class clazz = target.getClass(); + Method[] methods = clazz.getDeclaredMethods(); + + if ("bool".equals(type)) { + setter = clazz.getMethod(setterName, Boolean.TYPE); + setter.invoke(target, Boolean.valueOf(res)); + } + else { + setter = clazz.getMethod(setterName, String.class); + setter.invoke(target,res); + } + } + + /** * Returns true if the passed type is a valid data type of the properties (not for a single * property). @@ -209,7 +258,7 @@ public class XmlQuestionsReader { */ private boolean isValidType(String type) {
- if ("bool".equals(type) || "string".equals(type) || "resourceCategory".equals(type)) + if ("bool".equals(type) || "string".equals(type)) return true;
return false; diff --git a/modules/helpers/bundleGen/src/main/resources/questions.dtd b/modules/helpers/bundleGen/src/main/resources/questions.dtd index ed3981a..13fe665 100644 --- a/modules/helpers/bundleGen/src/main/resources/questions.dtd +++ b/modules/helpers/bundleGen/src/main/resources/questions.dtd @@ -1,6 +1,6 @@
<!-- root of all evil --> -<!ELEMENT questions (question+)> +<!ELEMENT questions (question|block)+>
<!-- one single question --> <!ELEMENT question (text+, options?, prefill?, help*)> @@ -8,11 +8,18 @@ <!ATTLIST question prop CDATA #REQUIRED type (bool|string) #IMPLIED - if (true|false) #IMPLIED strip (start|end|outer|all) #IMPLIED
+<!-- a block of questions asked together --> +<!-- First a question is displayed to introduce the block --> +<!-- And to check if the remainder should be asked at all --> +<!-- Then questions are asked --> +<!ELEMENT block (question,question+)>
+<!ATTLIST block + repeat (one|multi) #IMPLIED +>
<!-- The text to ask --> <!ELEMENT text (#PCDATA)>
commit c3b143eec4f67612e868a947f370f1dd7bfc7dee Author: John Sanda jsanda@redhat.com Date: Sat Jul 24 21:25:03 2010 -0400
[BZ 617718] Changing property name to lower case since plugin is accessing wrong property name
diff --git a/modules/enterprise/server/plugins/alert-snmp/src/main/resources/META-INF/rhq-serverplugin.xml b/modules/enterprise/server/plugins/alert-snmp/src/main/resources/META-INF/rhq-serverplugin.xml index 6308f86..32ec521 100644 --- a/modules/enterprise/server/plugins/alert-snmp/src/main/resources/META-INF/rhq-serverplugin.xml +++ b/modules/enterprise/server/plugins/alert-snmp/src/main/resources/META-INF/rhq-serverplugin.xml @@ -73,7 +73,7 @@ <alert-configuration> <c:simple-property name="host" type="string" required="true" description="Trap target host"/> <c:simple-property name="port" type="integer" required="false" default="162" description="Trap target port"/> - <c:simple-property name="OID" type="string" required="true" description="OID of the trap sent"/> + <c:simple-property name="oid" type="string" required="true" description="OID of the trap sent"/>
</alert-configuration> </alert-plugin>
commit 853e45e0e7d4723e8eab3eef3cb478c9a5d8ff82 Author: Joseph Marques joseph@redhat.com Date: Fri Jul 23 18:24:35 2010 -0400
BZ-617773: only show resource-level alert definitions in the subsystem view
* resource disambiguator doesn't support mixed results ** it can only disambiguate a list of resource-specific items * thus, change subsystem view to suppress alert templates / group alert definitions
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/alert/AlertDefinition.java b/modules/core/domain/src/main/java/org/rhq/core/domain/alert/AlertDefinition.java index 770c211..23ecc44 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/alert/AlertDefinition.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/alert/AlertDefinition.java @@ -135,7 +135,7 @@ import org.rhq.core.domain.resource.group.ResourceGroup; + " SELECT new org.rhq.core.domain.alert.composite.AlertDefinitionComposite" // + " ( ad, parent.id, parent.name ) " // + " FROM AlertDefinition ad " // - + "LEFT JOIN ad.resource res " // + + " JOIN ad.resource res " // + "LEFT JOIN res.parentResource parent " // /* * as much as i want to (for efficiency of the query [namely roundtrips to the db]) i can't use fetching here @@ -156,7 +156,7 @@ import org.rhq.core.domain.resource.group.ResourceGroup; + " SELECT new org.rhq.core.domain.alert.composite.AlertDefinitionComposite" // + " ( ad, parent.id, parent.name ) " // + " FROM AlertDefinition ad " // - + "LEFT JOIN ad.resource res " // + + " JOIN ad.resource res " // + "LEFT JOIN res.parentResource parent " // /* * as much as i want to (for efficiency of the query [namely roundtrips to the db]) i can't use fetching here
commit 1f9e0e91b5ca6c5be60bf12197e17ec95aac6160 Author: John Mazzitelli mazz@redhat.com Date: Fri Jul 23 14:01:52 2010 -0400
LDAP module needs to be REQUISITE
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/CustomJaasDeploymentService.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/CustomJaasDeploymentService.java index 76977e6..caec439 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/CustomJaasDeploymentService.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/CustomJaasDeploymentService.java @@ -142,7 +142,7 @@ public class CustomJaasDeploymentService implements CustomJaasDeploymentServiceM try { validateLdapOptions(configOptions); ace = new AppConfigurationEntry(LdapLoginModule.class.getName(), - AppConfigurationEntry.LoginModuleControlFlag.SUFFICIENT, configOptions); + AppConfigurationEntry.LoginModuleControlFlag.REQUISITE, configOptions); this.log.info("Enabling RHQ LDAP JAAS Provider"); configEntries.add(ace); } catch (NamingException e) {
commit 0949f2865546081d2c49d503a28f6a0cc2976987 Author: John Mazzitelli mazz@redhat.com Date: Fri Jul 23 13:34:38 2010 -0400
BZ 595482 - add new JDBC login module to prohibit LDAP look if there is already an RHQ principal defined in the database
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/CustomJaasDeploymentService.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/CustomJaasDeploymentService.java index 2c98b0a..76977e6 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/CustomJaasDeploymentService.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/CustomJaasDeploymentService.java @@ -37,8 +37,8 @@ import org.apache.commons.logging.LogFactory;
import org.rhq.enterprise.server.RHQConstants; import org.rhq.enterprise.server.core.jaas.JDBCLoginModule; +import org.rhq.enterprise.server.core.jaas.JDBCPrincipalCheckLoginModule; import org.rhq.enterprise.server.core.jaas.LdapLoginModule; -import org.rhq.enterprise.server.core.jaas.TempSessionLoginModule; import org.rhq.enterprise.server.util.LookupUtil; import org.rhq.enterprise.server.util.security.UntrustedSSLSocketFactory;
@@ -113,6 +113,8 @@ public class CustomJaasDeploymentService implements CustomJaasDeploymentServiceM this.log.info("Enabling RHQ JDBC JAAS Provider"); configEntries.add(ace);
+ /* + * NOT USED ANYMORE // to support the need for authenticating temporary session passwords, add a login module that can do that // we set an empty set of config options, but if we need to, we can store the config items // in the RHQ_config_props table, which would allow the GUI to modify them (just in case we want to add that capability) @@ -122,10 +124,20 @@ public class CustomJaasDeploymentService implements CustomJaasDeploymentServiceM AppConfigurationEntry.LoginModuleControlFlag.SUFFICIENT, new HashMap<String, String>()); this.log.info("Enabled the temporary session login module"); configEntries.add(ace); + * + */
String provider = conf.getProperty(RHQConstants.JAASProvider);
if ((provider != null) && provider.equals(RHQConstants.LDAPJAASProvider)) { + // this is a "gatekeeper" that only allows us to go to LDAP if there is no principal in the DB + configOptions = getJdbcOptions(conf); + ace = new AppConfigurationEntry(JDBCPrincipalCheckLoginModule.class.getName(), + AppConfigurationEntry.LoginModuleControlFlag.REQUISITE, configOptions); + this.log.info("Enabling RHQ JDBC-2 JAAS Provider"); + configEntries.add(ace); + + // this is the LDAP module that checks the LDAP for auth configOptions = getLdapOptions(conf); try { validateLdapOptions(configOptions); diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/jaas/JDBCPrincipalCheckLoginModule.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/jaas/JDBCPrincipalCheckLoginModule.java new file mode 100644 index 0000000..f56747a --- /dev/null +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/jaas/JDBCPrincipalCheckLoginModule.java @@ -0,0 +1,150 @@ +/* + * RHQ Management Platform + * Copyright (C) 2005-2010 Red Hat, Inc. + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ +package org.rhq.enterprise.server.core.jaas; + +import java.security.acl.Group; +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.Map; +import java.util.Properties; + +import javax.naming.InitialContext; +import javax.naming.NamingException; +import javax.security.auth.Subject; +import javax.security.auth.callback.CallbackHandler; +import javax.security.auth.login.FailedLoginException; +import javax.security.auth.login.LoginException; +import javax.sql.DataSource; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +import org.jboss.security.SimpleGroup; +import org.jboss.security.Util; +import org.jboss.security.auth.spi.UsernamePasswordLoginModule; + +import org.rhq.enterprise.server.RHQConstants; + +/** + * A JDBC login module that passes only if there is no principal in the database. + */ + +public class JDBCPrincipalCheckLoginModule extends UsernamePasswordLoginModule { + private Log log = LogFactory.getLog(JDBCPrincipalCheckLoginModule.class); + private String dsJndiName; + private String principalsQuery = "SELECT password FROM RHQ_PRINCIPAL WHERE principal=?"; + + @Override + public void initialize(Subject subj, CallbackHandler handler, Map shared_state, Map opts) { + super.initialize(subj, handler, shared_state, opts); + + dsJndiName = (String) opts.get("dsJndiName"); + if (dsJndiName == null) { + dsJndiName = RHQConstants.DATASOURCE_JNDI_NAME; + } + + Object tmpQuery = opts.get("principalsQuery"); + + if (tmpQuery != null) { + principalsQuery = tmpQuery.toString(); + } + + log.debug("dsJndiName=" + dsJndiName); + log.debug("prinipalsQuery=" + principalsQuery); + } + + private Properties getProperties() { + Properties props = new Properties(); + + props.put("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory"); + props.put("java.naming.provider.url", "jnp://localhost:1099"); + props.put("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces"); + + return props; + } + + /** + * @see org.jboss.security.auth.spi.UsernamePasswordLoginModule#getUsersPassword() + */ + @Override + protected String getUsersPassword() throws LoginException { + String username = getUsername(); + String password = getUsernameAndPassword()[1]; // what did the user enter? + Connection conn = null; + PreparedStatement ps = null; + ResultSet rs = null; + + try { + Properties props = getProperties(); + InitialContext ctx = new InitialContext(props); + DataSource ds = (DataSource) ctx.lookup(dsJndiName); + conn = ds.getConnection(); + + ps = conn.prepareStatement(principalsQuery); + ps.setString(1, username); + rs = ps.executeQuery(); + if (rs.next() == true) { + throw new FailedLoginException("username found in principals - do not continue"); + } + + password = Util.createPasswordHash("MD5", "base64", null, null, password); // return back the string entered by the user as a hash + } catch (NamingException ex) { + throw new LoginException(ex.toString(true)); + } catch (SQLException ex) { + throw new LoginException(ex.toString()); + } finally { + if (rs != null) { + try { + rs.close(); + } catch (Exception e) { + } + } + + if (ps != null) { + try { + ps.close(); + } catch (Exception e) { + } + } + + if (conn != null) { + try { + conn.close(); + } catch (Exception ex) { + } + } + } + + return password; + } + + /** + * @see org.jboss.security.auth.spi.AbstractServerLoginModule#getRoleSets() + */ + @Override + protected Group[] getRoleSets() throws LoginException { + SimpleGroup roles = new SimpleGroup("Roles"); + + //roles.addMember( new SimplePrincipal( "some user" ) ); + Group[] roleSets = { roles }; + return roleSets; + } +} \ No newline at end of file
commit 5a91a74f90333a1efbc8ec69b8b86bab7ae4a919 Author: Greg Hinkle ghinkle@redhat.com Date: Fri Jul 23 12:53:13 2010 -0400
Admin view tree icons
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/AdministrationView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/AdministrationView.java index 20ebafc..c2ebe9b 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/AdministrationView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/AdministrationView.java @@ -125,9 +125,17 @@ public class AdministrationView extends HLayout implements BookmarkableView {
Tree tree = new Tree(); final TreeNode manageUsersNode = new TreeNode("Manage Users"); + manageUsersNode.setIcon("global/User_16.png"); + final TreeNode manageRolesNode = new TreeNode("Manage Roles"); + manageRolesNode.setIcon("global/Role_16.png"); + final TreeNode discoveryQueue = new TreeNode("Auto Discovery Queue"); + discoveryQueue.setIcon("global/Recent_16.png"); + final TreeNode remoteAgentInstall = new TreeNode("Remote Agent Install"); + remoteAgentInstall.setIcon("global/Agent_16.png"); + tree.setRoot(new TreeNode("security", manageUsersNode, manageRolesNode, @@ -277,7 +285,7 @@ public class AdministrationView extends HLayout implements BookmarkableView {
TreeGrid treeGrid = treeGrids.get(name); if (name.equals(section)) { - treeGrid.setSelectedPaths(page); +// treeGrid.setSelectedPaths(page); } else { treeGrid.deselectAllRecords(); } diff --git a/modules/enterprise/gui/coregui/src/main/webapp/images/global/Agent_16.png b/modules/enterprise/gui/coregui/src/main/webapp/images/global/Agent_16.png new file mode 100644 index 0000000..225bde6 Binary files /dev/null and b/modules/enterprise/gui/coregui/src/main/webapp/images/global/Agent_16.png differ diff --git a/modules/enterprise/gui/coregui/src/main/webapp/images/global/Agent_24.png b/modules/enterprise/gui/coregui/src/main/webapp/images/global/Agent_24.png new file mode 100644 index 0000000..61e1d68 Binary files /dev/null and b/modules/enterprise/gui/coregui/src/main/webapp/images/global/Agent_24.png differ diff --git a/modules/enterprise/gui/coregui/src/main/webapp/images/global/Locked_16.png b/modules/enterprise/gui/coregui/src/main/webapp/images/global/Locked_16.png new file mode 100644 index 0000000..e5e3bae Binary files /dev/null and b/modules/enterprise/gui/coregui/src/main/webapp/images/global/Locked_16.png differ diff --git a/modules/enterprise/gui/coregui/src/main/webapp/images/global/Locked_24.png b/modules/enterprise/gui/coregui/src/main/webapp/images/global/Locked_24.png new file mode 100644 index 0000000..c8daa89 Binary files /dev/null and b/modules/enterprise/gui/coregui/src/main/webapp/images/global/Locked_24.png differ diff --git a/modules/enterprise/gui/coregui/src/main/webapp/images/global/Plugin_16.png b/modules/enterprise/gui/coregui/src/main/webapp/images/global/Plugin_16.png new file mode 100644 index 0000000..7e15427 Binary files /dev/null and b/modules/enterprise/gui/coregui/src/main/webapp/images/global/Plugin_16.png differ diff --git a/modules/enterprise/gui/coregui/src/main/webapp/images/global/Plugin_24.png b/modules/enterprise/gui/coregui/src/main/webapp/images/global/Plugin_24.png new file mode 100644 index 0000000..4a31006 Binary files /dev/null and b/modules/enterprise/gui/coregui/src/main/webapp/images/global/Plugin_24.png differ diff --git a/modules/enterprise/gui/coregui/src/main/webapp/images/global/Recent_16.png b/modules/enterprise/gui/coregui/src/main/webapp/images/global/Recent_16.png new file mode 100644 index 0000000..9b75027 Binary files /dev/null and b/modules/enterprise/gui/coregui/src/main/webapp/images/global/Recent_16.png differ diff --git a/modules/enterprise/gui/coregui/src/main/webapp/images/global/Recent_24.png b/modules/enterprise/gui/coregui/src/main/webapp/images/global/Recent_24.png new file mode 100644 index 0000000..39ddbd8 Binary files /dev/null and b/modules/enterprise/gui/coregui/src/main/webapp/images/global/Recent_24.png differ diff --git a/modules/enterprise/gui/coregui/src/main/webapp/images/global/Role_16.png b/modules/enterprise/gui/coregui/src/main/webapp/images/global/Role_16.png new file mode 100644 index 0000000..e10a3b9 Binary files /dev/null and b/modules/enterprise/gui/coregui/src/main/webapp/images/global/Role_16.png differ diff --git a/modules/enterprise/gui/coregui/src/main/webapp/images/global/Unlocked_16.png b/modules/enterprise/gui/coregui/src/main/webapp/images/global/Unlocked_16.png new file mode 100644 index 0000000..4f2e1b1 Binary files /dev/null and b/modules/enterprise/gui/coregui/src/main/webapp/images/global/Unlocked_16.png differ diff --git a/modules/enterprise/gui/coregui/src/main/webapp/images/global/Unlocked_32.png b/modules/enterprise/gui/coregui/src/main/webapp/images/global/Unlocked_32.png new file mode 100644 index 0000000..9d6916f Binary files /dev/null and b/modules/enterprise/gui/coregui/src/main/webapp/images/global/Unlocked_32.png differ diff --git a/modules/enterprise/gui/coregui/src/main/webapp/images/global/User_16.png b/modules/enterprise/gui/coregui/src/main/webapp/images/global/User_16.png new file mode 100644 index 0000000..5dfcada Binary files /dev/null and b/modules/enterprise/gui/coregui/src/main/webapp/images/global/User_16.png differ diff --git a/modules/enterprise/gui/coregui/src/main/webapp/images/global/User_24.png b/modules/enterprise/gui/coregui/src/main/webapp/images/global/User_24.png new file mode 100644 index 0000000..c86cd80 Binary files /dev/null and b/modules/enterprise/gui/coregui/src/main/webapp/images/global/User_24.png differ diff --git a/modules/enterprise/gui/coregui/src/main/webapp/images/global/cloud_24.png b/modules/enterprise/gui/coregui/src/main/webapp/images/global/cloud_24.png new file mode 100644 index 0000000..a147dde Binary files /dev/null and b/modules/enterprise/gui/coregui/src/main/webapp/images/global/cloud_24.png differ
commit 6f028fdaca0e2c698f4fcc013d1e6acba5c817f0 Author: Greg Hinkle ghinkle@redhat.com Date: Fri Jul 23 12:52:11 2010 -0400
Expose "cluster" service features which will be the center of all future group, autogroup and recursive group views
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/group/composite/ClusterFlyweight.java b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/group/composite/ClusterFlyweight.java new file mode 100644 index 0000000..a156804 --- /dev/null +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/group/composite/ClusterFlyweight.java @@ -0,0 +1,99 @@ +/* + * RHQ Management Platform + * Copyright (C) 2005-2010 Red Hat, Inc. + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License, version 2, as + * published by the Free Software Foundation, and/or the GNU Lesser + * General Public License, version 2.1, also as published by the Free + * Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License and the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License + * and the GNU Lesser General Public License along with this program; + * if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +package org.rhq.core.domain.resource.group.composite; + +import java.io.Serializable; +import java.util.List; + +import org.rhq.core.domain.resource.group.ClusterKey; + +/** + * @author Greg Hinkle + */ +public class ClusterFlyweight implements Serializable { + + private int groupId; + + private ClusterKeyFlyweight clusterKey; + + private String name; + + private List<ClusterFlyweight> children; + + private int members; + + public ClusterFlyweight() { + } + + public ClusterFlyweight(int groupId) { + this.groupId = groupId; + } + + public ClusterFlyweight(ClusterKeyFlyweight clusterKey) { + this.clusterKey = clusterKey; + } + + public void addResource(String s) { + if (name == null) { + name = s; + } else if (!name.equals(s)) { + name = "?"; + } + } + + public int getMembers() { + return members; + } + + public void setMembers(int members) { + this.members = members; + } + + public void setChildren(List<ClusterFlyweight> clusterKeyFlyweights) { + this.children = clusterKeyFlyweights; + } + + public int getGroupId() { + return groupId; + } + + public ClusterKeyFlyweight getClusterKey() { + return clusterKey; + } + + public String getName() { + return name; + } + + public List<ClusterFlyweight> getChildren() { + return children; + } + + + + + + + + +} diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/group/composite/ClusterKeyFlyweight.java b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/group/composite/ClusterKeyFlyweight.java new file mode 100644 index 0000000..6d3d488 --- /dev/null +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/group/composite/ClusterKeyFlyweight.java @@ -0,0 +1,62 @@ +/* + * RHQ Management Platform + * Copyright (C) 2005-2010 Red Hat, Inc. + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License, version 2, as + * published by the Free Software Foundation, and/or the GNU Lesser + * General Public License, version 2.1, also as published by the Free + * Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License and the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License + * and the GNU Lesser General Public License along with this program; + * if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +package org.rhq.core.domain.resource.group.composite; + +import java.io.Serializable; + +/** + * @author Greg Hinkle + */ +public class ClusterKeyFlyweight implements Serializable { + + private int resourceTypeId; + private String resourceKey; + + public ClusterKeyFlyweight() { + } + + public ClusterKeyFlyweight(int resourceTypeId, String resourceKey) { + this.resourceTypeId = resourceTypeId; + this.resourceKey = resourceKey; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + ClusterKeyFlyweight node = (ClusterKeyFlyweight) o; + + if (resourceTypeId != node.resourceTypeId) return false; + if (resourceKey != null ? !resourceKey.equals(node.resourceKey) : node.resourceKey != null) return false; + + return true; + } + + @Override + public int hashCode() { + int result = resourceTypeId; + result = 31 * result + (resourceKey != null ? resourceKey.hashCode() : 0); + return result; + } +} \ No newline at end of file diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/cluster/ClusterManagerRemote.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/cluster/ClusterManagerRemote.java new file mode 100644 index 0000000..c052c58 --- /dev/null +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/cluster/ClusterManagerRemote.java @@ -0,0 +1,79 @@ +/* + * RHQ Management Platform + * Copyright (C) 2005-2010 Red Hat, Inc. + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License, version 2, as + * published by the Free Software Foundation, and/or the GNU Lesser + * General Public License, version 2.1, also as published by the Free + * Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License and the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License + * and the GNU Lesser General Public License along with this program; + * if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +package org.rhq.enterprise.server.resource.cluster; + +import java.util.List; + +import javax.ejb.Remote; + +import org.jetbrains.annotations.Nullable; + +import org.rhq.core.domain.auth.Subject; +import org.rhq.core.domain.resource.Resource; +import org.rhq.core.domain.resource.group.ClusterKey; +import org.rhq.core.domain.resource.group.ResourceGroup; +import org.rhq.core.domain.resource.group.composite.ClusterFlyweight; + +/** + * @author Greg Hinkle + */ +@Remote +public interface ClusterManagerRemote { + + /** + * Given a cluster key create a backing group. + * @param clusterKey + * @param addResources If true, the new group will be assigned the current resources defined by the clusterKey. + * Otherwise no resources will be assigned to the new group. + * @throws IllegalArgumentException if a backing group exists for this clusterKey + */ + ResourceGroup createAutoClusterBackingGroup(Subject subject, ClusterKey clusterKey, boolean addResources); + + /** + * Return the backing group for the supplied cluster key. Resource membership will represent the resources + * last set for the group and may not reflect current membership. See {@link #getAutoClusterResources(String)} + * @param clusterKey + * @return The backing group, or null if the key does not have a backing group. + */ + @Nullable + ResourceGroup getAutoClusterBackingGroup(Subject subject, ClusterKey clusterKey); + + /** + * Given a cluster key get the auto cluster resource membership. The membership is always determined + * at call time, regardless of whether a backing group exists. To get the backing group, if it exists, + * for a cluster key then call {@link #getAutoClusterBackingGroup(String)}. + */ + List<Resource> getAutoClusterResources(Subject subject, ClusterKey clusterKey); + + + /** + * Load a fully populated tree view of the "cluster nodes" for a cluster group. These are + * summary nodes and do not contain the actual resources in the group. + * + * @param subject + * @param groupId + * @return + */ + ClusterFlyweight getClusterTree(Subject subject, int groupId); + +}
commit 35ec18e4ddeae903986bf56c453a90907f7a6f6d Author: Greg Hinkle ghinkle@redhat.com Date: Fri Jul 23 12:50:32 2010 -0400
A new build profile that will build just domain,server and coregui (useful for core api development)
diff --git a/modules/pom.xml b/modules/pom.xml index e363555..ef98301 100644 --- a/modules/pom.xml +++ b/modules/pom.xml @@ -72,6 +72,22 @@ </profile>
<profile> + <id>model</id> + <activation> + <property> + <name>model</name> + </property> + </activation> + <modules> + <module>core/domain</module> + <module>enterprise/server/jar</module> + <module>enterprise/gui/coregui</module> + </modules> + </profile> + + + + <profile> <id>plugins</id> <activation> <property>
commit 6b757721e31722740c602563b39ea3e54e5cbefe Author: Greg Hinkle ghinkle@redhat.com Date: Fri Jul 23 12:49:28 2010 -0400
Expose "cluster" service features which will be the center of all future group, autogroup and recursive group views
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml index a3db099..f26acb7 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml @@ -71,5 +71,6 @@ <servlet path="/ContentGWTService" class="org.rhq.enterprise.gui.coregui.server.gwt.ContentGWTServiceImpl"/> <servlet path="/DashboardGWTService" class="org.rhq.enterprise.gui.coregui.server.gwt.DashboardGWTServiceImpl"/> <servlet path="/EventGWTService" class="org.rhq.enterprise.gui.coregui.server.gwt.EventGWTServiceImpl"/> + <servlet path="/ClusterGWTService" class="org.rhq.enterprise.gui.coregui.server.gwt.ClusterGWTServiceImpl"/>
</module> \ No newline at end of file diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ClusterGWTService.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ClusterGWTService.java new file mode 100644 index 0000000..20d32d5 --- /dev/null +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/ClusterGWTService.java @@ -0,0 +1,68 @@ +/* + * RHQ Management Platform + * Copyright (C) 2005-2010 Red Hat, Inc. + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License, version 2, as + * published by the Free Software Foundation, and/or the GNU Lesser + * General Public License, version 2.1, also as published by the Free + * Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License and the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License + * and the GNU Lesser General Public License along with this program; + * if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +package org.rhq.enterprise.gui.coregui.client.gwt; + +import java.util.List; + +import com.google.gwt.user.client.rpc.RemoteService; + +import org.rhq.core.domain.resource.Resource; +import org.rhq.core.domain.resource.group.ClusterKey; +import org.rhq.core.domain.resource.group.ResourceGroup; +import org.rhq.core.domain.resource.group.composite.ClusterFlyweight; + +/** + * @author Greg Hinkle + */ +public interface ClusterGWTService extends RemoteService { + + + /** + * Given a cluster key create a backing group. + * @param clusterKey + * @param addResources If true, the new group will be assigned the current resources defined by the clusterKey. + * Otherwise no resources will be assigned to the new group. + * @throws IllegalArgumentException if a backing group exists for this clusterKey + */ + ResourceGroup createAutoClusterBackingGroup(ClusterKey clusterKey, boolean addResources); + + /** + * Return the backing group for the supplied cluster key. Resource membership will represent the resources + * last set for the group and may not reflect current membership. See {@link #getAutoClusterResources(String)} + * @param clusterKey + * @return The backing group, or null if the key does not have a backing group. + */ + ResourceGroup getAutoClusterBackingGroup(ClusterKey clusterKey); + + /** + * Given a cluster key get the auto cluster resource membership. The membership is always determined + * at call time, regardless of whether a backing group exists. To get the backing group, if it exists, + * for a cluster key then call {@link #getAutoClusterBackingGroup(String)}. + */ + List<Resource> getAutoClusterResources(ClusterKey clusterKey); + + + ClusterFlyweight getClusterTree(int groupId); + + +} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/GWTServiceLookup.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/GWTServiceLookup.java index b0cc8d9..9965430 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/GWTServiceLookup.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/GWTServiceLookup.java @@ -120,6 +120,10 @@ public class GWTServiceLookup { return secure(EventGWTServiceAsync.Util.getInstance()); }
+ public static ClusterGWTServiceAsync getClusterService() { + return secure(ClusterGWTServiceAsync.Util.getInstance()); + } +
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ClusterGWTServiceImpl.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ClusterGWTServiceImpl.java new file mode 100644 index 0000000..f3f8323 --- /dev/null +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/ClusterGWTServiceImpl.java @@ -0,0 +1,69 @@ +/* + * RHQ Management Platform + * Copyright (C) 2005-2010 Red Hat, Inc. + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License, version 2, as + * published by the Free Software Foundation, and/or the GNU Lesser + * General Public License, version 2.1, also as published by the Free + * Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License and the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License + * and the GNU Lesser General Public License along with this program; + * if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +package org.rhq.enterprise.gui.coregui.server.gwt; + +import java.util.List; + +import org.rhq.core.domain.resource.Resource; +import org.rhq.core.domain.resource.group.ClusterKey; +import org.rhq.core.domain.resource.group.ResourceGroup; +import org.rhq.core.domain.resource.group.composite.ClusterFlyweight; +import org.rhq.enterprise.gui.coregui.client.gwt.ClusterGWTService; +import org.rhq.enterprise.gui.coregui.server.util.SerialUtility; +import org.rhq.enterprise.server.resource.cluster.ClusterManagerLocal; +import org.rhq.enterprise.server.util.LookupUtil; + +/** + * @author Greg Hinkle + */ +public class ClusterGWTServiceImpl extends AbstractGWTServiceImpl implements ClusterGWTService { + + + private ClusterManagerLocal clusterManager = LookupUtil.getClusterManager(); + + + public ResourceGroup createAutoClusterBackingGroup(ClusterKey clusterKey, boolean addResources) { + return SerialUtility.prepare( + clusterManager.createAutoClusterBackingGroup(getSessionSubject(), clusterKey, addResources), + "ClusterGWTServiceImpl.createAutoClusterBackingGroup"); + } + + public ResourceGroup getAutoClusterBackingGroup(ClusterKey clusterKey) { + return SerialUtility.prepare( + clusterManager.getAutoClusterBackingGroup(getSessionSubject(), clusterKey), + "ClusterGWTServiceImpl.getAutoClusterBackingGroup"); + } + + public List<Resource> getAutoClusterResources(ClusterKey clusterKey) { + return SerialUtility.prepare( + clusterManager.getAutoClusterResources(getSessionSubject(), clusterKey), + "ClusterGWTServiceImpl.getAutoClusterResources"); + } + + public ClusterFlyweight getClusterTree(int groupId) { + return SerialUtility.prepare( + clusterManager.getClusterTree(getSessionSubject(), groupId), + "ClusterGWTServiceImpl.getClusterTree"); + + } +} diff --git a/modules/enterprise/gui/coregui/src/main/webapp/WEB-INF/web.xml b/modules/enterprise/gui/coregui/src/main/webapp/WEB-INF/web.xml index b89ece9..a86b217 100644 --- a/modules/enterprise/gui/coregui/src/main/webapp/WEB-INF/web.xml +++ b/modules/enterprise/gui/coregui/src/main/webapp/WEB-INF/web.xml @@ -104,6 +104,10 @@ <servlet-name>org.rhq.enterprise.gui.coregui.CoreGUI EventGWTService</servlet-name> <servlet-class>org.rhq.enterprise.gui.coregui.server.gwt.EventGWTServiceImpl</servlet-class> </servlet> + <servlet> + <servlet-name>org.rhq.enterprise.gui.coregui.CoreGUI ClusterGWTService</servlet-name> + <servlet-class>org.rhq.enterprise.gui.coregui.server.gwt.ClusterGWTServiceImpl</servlet-class> + </servlet>
<servlet-mapping> @@ -206,4 +210,8 @@ <servlet-name>org.rhq.enterprise.gui.coregui.CoreGUI EventGWTService</servlet-name> <url-pattern>/org.rhq.enterprise.gui.coregui.CoreGUI/EventGWTService</url-pattern> </servlet-mapping> + <servlet-mapping> + <servlet-name>org.rhq.enterprise.gui.coregui.CoreGUI ClusterGWTService</servlet-name> + <url-pattern>/org.rhq.enterprise.gui.coregui.CoreGUI/ClusterGWTService</url-pattern> + </servlet-mapping> </web-app>
commit c1352afdaef3eb9011c3365c51949ea14e1dc8a1 Author: Greg Hinkle ghinkle@redhat.com Date: Fri Jul 23 12:48:21 2010 -0400
Switch back to future UXD design for top menubar Move user login info to footer
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/Footer.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/Footer.java index 65fc203..8a6fcc4 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/Footer.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/Footer.java @@ -60,7 +60,14 @@ public class Footer extends ToolStrip { protected void onDraw() { super.onDraw();
- addMember(new Label("Welcome to RHQ")); + + Label loggedInAs = new Label("Logged in as " + CoreGUI.getSessionSubject().getName()); + loggedInAs.setWrap(false); + loggedInAs.setMargin(5); + loggedInAs.setValign(VerticalAlignment.CENTER); + + + addMember(loggedInAs); addMember(new ToolStripSeparator());
recentMessage = new MessageCenterView(); diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/menu/DropDownMenuBarView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/menu/DropDownMenuBarView.java new file mode 100644 index 0000000..c98c16d --- /dev/null +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/menu/DropDownMenuBarView.java @@ -0,0 +1,247 @@ +/* + * RHQ Management Platform + * Copyright (C) 2005-2010 Red Hat, Inc. + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License, version 2, as + * published by the Free Software Foundation, and/or the GNU Lesser + * General Public License, version 2.1, also as published by the Free + * Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License and the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License + * and the GNU Lesser General Public License along with this program; + * if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +package org.rhq.enterprise.gui.coregui.client.menu; + +import com.google.gwt.user.client.History; +import com.google.gwt.user.client.Window; +import com.smartgwt.client.widgets.Img; +import com.smartgwt.client.widgets.events.ClickEvent; +import com.smartgwt.client.widgets.events.ClickHandler; +import com.smartgwt.client.widgets.layout.HLayout; +import com.smartgwt.client.widgets.layout.VLayout; +import com.smartgwt.client.widgets.menu.Menu; +import com.smartgwt.client.widgets.menu.MenuBar; +import com.smartgwt.client.widgets.menu.MenuItem; +import com.smartgwt.client.widgets.menu.MenuItemSeparator; +import com.smartgwt.client.widgets.menu.events.MenuItemClickEvent; + +import org.rhq.enterprise.gui.coregui.client.LinkManager; +import org.rhq.enterprise.gui.coregui.client.components.AboutModalWindow; + +/** + * @author Greg Hinkle + */ +public class DropDownMenuBarView extends VLayout { + + private AboutModalWindow aboutModalWindow; + + public DropDownMenuBarView() { + super(5); + setHeight(50); + setWidth100(); + + + } + + + protected void onDraw3() { + super.onDraw(); + + this.aboutModalWindow = new AboutModalWindow(); + + HLayout topBar = new HLayout(); + topBar.setHeight(28); + topBar.setStyleName("topMenuBar"); +// url("./images/cssButton/button_stretch.png") repeat-x scroll 0 0 #DDDDDD +// topBar.setBackgroundImage("[SKIN]/cssButton/button_stretch.png"); +// topBar.setBackgroundRepeat(BkgndRepeat.REPEAT_X); + + + Img logo = new Img("header/rhq_logo_28px.png", 80, 28); + logo.addClickHandler(new com.smartgwt.client.widgets.events.ClickHandler() { + public void onClick(com.smartgwt.client.widgets.events.ClickEvent event) { + DropDownMenuBarView.this.aboutModalWindow.show(); + } + }); + + + topBar.addMember(logo); + + + // Create a menu bar + final MenuBar menu = new MenuBar(); + menu.setHeight(28); + + + + Menu subsystemsMenu = new Menu(); + + subsystemsMenu.setTitle("Subsystems"); + subsystemsMenu.addItem(new EMenuItem("Configuration Changes", LinkManager.getSubsystemConfigurationLink(), "subsystems/configure/Configure_16.png"));//, new LinkCommand("#config")); + subsystemsMenu.addItem(new EMenuItem("Suspect Metrics", LinkManager.getSubsystemSuspectMetricsLink(), "subsystems/monitor/Monitor_failed_16.png"));//, new LinkCommand("#config")); + subsystemsMenu.addItem(new EMenuItem("Operations", LinkManager.getSubsystemOperationHistoryLink(), "subsystems/control/Operation_16.png"));//, new LinkCommand("#config")); + subsystemsMenu.addItem(new EMenuItem("Alerts", LinkManager.getSubsystemAlertHistoryLink(), "subsystems/alert/Alert_HIGH_16.png"));//, new LinkCommand("#config")); + subsystemsMenu.addItem(new EMenuItem("Alert Definitions", LinkManager.getSubsystemAlertDefsLink(), "subsystems/alert/Alerts_16.png"));//, new LinkCommand("#config")); + + + final Menu overviewMenu = new Menu(); + overviewMenu.setTitle("Overview"); + overviewMenu.setStyleName("SimpleMenuBarButton"); + overviewMenu.setBorder("none"); + com.smartgwt.client.widgets.menu.MenuItem subsystemsSubMenuItem = new com.smartgwt.client.widgets.menu.MenuItem("Subsystems"); + subsystemsSubMenuItem.setSubmenu(subsystemsMenu); + overviewMenu.addItem(subsystemsSubMenuItem); + overviewMenu.addItem(new EMenuItem("AutoDiscovery Queue",LinkManager.getAutodiscoveryQueueLink()));//,new LinkCommand("#cofng")); + overviewMenu.addItem(new EMenuItem("Dashboard",LinkManager.getDashboardLink()));//,new LinkCommand("#cofng")); + + + Menu resourcesMenu = new Menu(); + resourcesMenu.setTitle("Resources"); + resourcesMenu.setStyleName("SimpleMenuBarButton"); + resourcesMenu.setBorder("none"); + resourcesMenu.setStyleName("menuBarMenuButton"); + resourcesMenu.addItem(new EMenuItem("All Resources", LinkManager.getHubAllResourcesLink()));//, new LinkCommand("#fsdf")); + resourcesMenu.addItem(new EMenuItem("Platforms", LinkManager.getHubPlatformsLink(),"types/Platform_up_16.png"));//, new LinkCommand("#fsdf")); + resourcesMenu.addItem(new EMenuItem("Servers", LinkManager.getHubServerssLink(), "types/Server_up_16.png"));//, new LinkCommand("#fsdf")); + resourcesMenu.addItem(new EMenuItem("Services", LinkManager.getHubServicesLink(), "types/Service_up_16.png"));//, new LinkCommand("#fsdf")); + resourcesMenu.addItem(new MenuItemSeparator()); + + final FavoritesMenu favoritesMenu = new FavoritesMenu(); + resourcesMenu.addItem(favoritesMenu); + menu.addClickHandler(new ClickHandler() { + public void onClick(ClickEvent clickEvent) { + System.out.println("over here"); + favoritesMenu.refresh(); + } + }); + + Menu groupsMenu = new Menu(); + groupsMenu.setStyleName("menuBarMenuButton"); + groupsMenu.setTitle("Groups"); + groupsMenu.addItem(new EMenuItem("All Groups", LinkManager.getHubAllGroupsLink())); //, new LinkCommand("#sf")); + groupsMenu.addItem(new EMenuItem("Compatible Groups", LinkManager.getHubCompatibleGroupsLink())); //, new LinkCommand("#sf")); + groupsMenu.addItem(new EMenuItem("Mixed Groups", LinkManager.getHubMixedGroupsLink())); //, new LinkCommand("#sf")); + groupsMenu.addItem(new EMenuItem("Group Definitions", LinkManager.getHubGroupDefinitionsLink())); //, new LinkCommand("#sf")); + groupsMenu.addItem(new MenuItemSeparator()); + groupsMenu.addItem(new EMenuItem("New Group", LinkManager.getHubNewGroupLink())); //, new LinkCommand("#sf")); + groupsMenu.addItem(new EMenuItem("New Group Definition", LinkManager.getHubNewGroupDefLink())); //, new LinkCommand("#sf")); + groupsMenu.addItem(new MenuItemSeparator()); +// groupsMenu.addItem(new MenuItem("Favorites")); //, new LinkCommand("#sf")); + + + Menu securityMenu = new Menu(); + securityMenu.setTitle("Security"); + securityMenu.addItem(new EMenuItem("Users",LinkManager.getAdminUsersLink())); + securityMenu.addItem(new EMenuItem("Roles",LinkManager.getAdminRolesLink())); + MenuItem securitySubMenuItem = new MenuItem("Security"); + securitySubMenuItem.setSubmenu(securityMenu); + + + Menu sysConfigMenu = new Menu(); + sysConfigMenu.setTitle("System Configuration"); + sysConfigMenu.addItem(new EMenuItem("Settings",LinkManager.getAdminSysConfigLink())); + sysConfigMenu.addItem(new EMenuItem("Plugins",LinkManager.getAdminPluginsLink())); + sysConfigMenu.addItem(new EMenuItem("Templates",LinkManager.getAdminTemplatesLink())); + MenuItem sysConfigSubMenuItem = new MenuItem("System Configuration"); + sysConfigSubMenuItem.setSubmenu(sysConfigMenu); + + + Menu contentMenu = new Menu(); + contentMenu.setTitle("Content"); + contentMenu.addItem(new EMenuItem("Bundles","#Bundles")); + contentMenu.addItem(new EMenuItem("Content Providers",LinkManager.getAdminContentProvidersLink())); + contentMenu.addItem(new EMenuItem("Content Repositories",LinkManager.getAdminContentReposLink())); + MenuItem contentSubMenuItem = new MenuItem("Content"); + contentSubMenuItem.setSubmenu(contentMenu); + + + Menu haMenu = new Menu(); + haMenu.setTitle("High Availability"); + haMenu.addItem(new EMenuItem("Servers",LinkManager.getHAServersLink())); + haMenu.addItem(new EMenuItem("Agents",LinkManager.getHAAgentsLink())); + haMenu.addItem(new EMenuItem("Affinity Groups",LinkManager.getHAAffinityGroupsLink())); + haMenu.addItem(new EMenuItem("Partition Events",LinkManager.getHAEventsLink())); + MenuItem haSubMentItem = new MenuItem("High Availability"); + haSubMentItem.setSubmenu(haMenu); + + + Menu reportsMenu = new Menu(); + reportsMenu.setTitle("Reports"); + reportsMenu.addItem(new EMenuItem("Resource Version Inventory Report", LinkManager.getReportsInventoryLink())); + MenuItem reportsSubMenuItem = new MenuItem("Reports"); + reportsSubMenuItem.setSubmenu(reportsMenu); + + + Menu adminMenu = new Menu(); + adminMenu.setTitle("Administration"); + adminMenu.addItem(securitySubMenuItem); + adminMenu.addItem(sysConfigSubMenuItem); + adminMenu.addItem(contentSubMenuItem); + adminMenu.addItem(haSubMentItem); + adminMenu.addItem(reportsSubMenuItem); + adminMenu.addItem(new EMenuItem("Downloads", LinkManager.getAdminDownloadsLink())); + adminMenu.addItem(new EMenuItem("License", LinkManager.getAdminLicenseLink())); + + + + + + Menu helpMenu = new Menu(); + helpMenu.setStyleName("menuBarMenuButton"); + helpMenu.setTitle("Help"); + helpMenu.addItem(new EMenuItem("Online Documentation", "http://www.rhq-project.org")); //, new LinkCommand("#sdfs")); + helpMenu.addItem(new EMenuItem("Open a support case", "http://www.rhq-project.org")); //, new LinkCommand("#sdfs")); +// helpMenu.addItem(new MenuItem("About")); //, new LinkCommand("#sdfs")); + + menu.setMenus(overviewMenu, resourcesMenu, groupsMenu, adminMenu, helpMenu); + + + topBar.addMember(menu); + + + addMember(topBar); + addMember(new SearchBarPane()); + + } + + + public static class EMenuItem extends com.smartgwt.client.widgets.menu.MenuItem { + + String link; + + public EMenuItem(String title, String link) { + super(title); + this.link = link; + init(); + } + + public EMenuItem(String title, String link, String icon) { + super(title, icon); + this.link = link; + init(); + } + + private void init() { + addClickHandler(new com.smartgwt.client.widgets.menu.events.ClickHandler() { + public void onClick(MenuItemClickEvent menuItemClickEvent) { + if (link.startsWith("#")) { + History.newItem(link.substring(1)); + } else { + Window.Location.assign(link); + } + } + }); + } + } + +} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/menu/MenuBarView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/menu/MenuBarView.java index 55a7d47..9d354f4 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/menu/MenuBarView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/menu/MenuBarView.java @@ -57,196 +57,16 @@ public class MenuBarView extends VLayout {
private AboutModalWindow aboutModalWindow;
- public static final String[] SECTIONS = {"Dashboard", "Demo", "Inventory", "Bundles", "Administration"}; + public static final String[] SECTIONS = {"Dashboard", "Inventory", "Reports", "Bundles", "Administration"};
private String selected = "Dashboard";
private HTMLFlow linksPane;
- public MenuBarView() { - super(5); - setHeight(50); - setWidth100(); - - - } -
protected void onDraw() { super.onDraw();
- this.aboutModalWindow = new AboutModalWindow(); - - HLayout topBar = new HLayout(); - topBar.setHeight(28); - topBar.setStyleName("topMenuBar"); -// url("./images/cssButton/button_stretch.png") repeat-x scroll 0 0 #DDDDDD -// topBar.setBackgroundImage("[SKIN]/cssButton/button_stretch.png"); -// topBar.setBackgroundRepeat(BkgndRepeat.REPEAT_X); - - - Img logo = new Img("header/rhq_logo_28px.png", 80, 28); - logo.addClickHandler(new com.smartgwt.client.widgets.events.ClickHandler() { - public void onClick(com.smartgwt.client.widgets.events.ClickEvent event) { - MenuBarView.this.aboutModalWindow.show(); - } - }); - - - topBar.addMember(logo); - - - // Create a menu bar - final MenuBar menu = new MenuBar(); - menu.setHeight(28); - - - - Menu subsystemsMenu = new Menu(); - - subsystemsMenu.setTitle("Subsystems"); - subsystemsMenu.addItem(new EMenuItem("Configuration Changes", LinkManager.getSubsystemConfigurationLink(), "subsystems/configure/Configure_16.png"));//, new LinkCommand("#config")); - subsystemsMenu.addItem(new EMenuItem("Suspect Metrics", LinkManager.getSubsystemSuspectMetricsLink(), "subsystems/monitor/Monitor_failed_16.png"));//, new LinkCommand("#config")); - subsystemsMenu.addItem(new EMenuItem("Operations", LinkManager.getSubsystemOperationHistoryLink(), "subsystems/control/Operation_16.png"));//, new LinkCommand("#config")); - subsystemsMenu.addItem(new EMenuItem("Alerts", LinkManager.getSubsystemAlertHistoryLink(), "subsystems/alert/Alert_HIGH_16.png"));//, new LinkCommand("#config")); - subsystemsMenu.addItem(new EMenuItem("Alert Definitions", LinkManager.getSubsystemAlertDefsLink(), "subsystems/alert/Alerts_16.png"));//, new LinkCommand("#config")); - - - final Menu overviewMenu = new Menu(); - overviewMenu.setTitle("Overview"); - overviewMenu.setStyleName("SimpleMenuBarButton"); - overviewMenu.setBorder("none"); - com.smartgwt.client.widgets.menu.MenuItem subsystemsSubMenuItem = new com.smartgwt.client.widgets.menu.MenuItem("Subsystems"); - subsystemsSubMenuItem.setSubmenu(subsystemsMenu); - overviewMenu.addItem(subsystemsSubMenuItem); - overviewMenu.addItem(new EMenuItem("AutoDiscovery Queue",LinkManager.getAutodiscoveryQueueLink()));//,new LinkCommand("#cofng")); - overviewMenu.addItem(new EMenuItem("Dashboard",LinkManager.getDashboardLink()));//,new LinkCommand("#cofng")); - - - Menu resourcesMenu = new Menu(); - resourcesMenu.setTitle("Resources"); - resourcesMenu.setStyleName("SimpleMenuBarButton"); - resourcesMenu.setBorder("none"); - resourcesMenu.setStyleName("menuBarMenuButton"); - resourcesMenu.addItem(new EMenuItem("All Resources", LinkManager.getHubAllResourcesLink()));//, new LinkCommand("#fsdf")); - resourcesMenu.addItem(new EMenuItem("Platforms", LinkManager.getHubPlatformsLink(),"types/Platform_up_16.png"));//, new LinkCommand("#fsdf")); - resourcesMenu.addItem(new EMenuItem("Servers", LinkManager.getHubServerssLink(), "types/Server_up_16.png"));//, new LinkCommand("#fsdf")); - resourcesMenu.addItem(new EMenuItem("Services", LinkManager.getHubServicesLink(), "types/Service_up_16.png"));//, new LinkCommand("#fsdf")); - resourcesMenu.addItem(new MenuItemSeparator()); - - final FavoritesMenu favoritesMenu = new FavoritesMenu(); - resourcesMenu.addItem(favoritesMenu); - menu.addClickHandler(new ClickHandler() { - public void onClick(ClickEvent clickEvent) { - System.out.println("over here"); - favoritesMenu.refresh(); - } - }); - - Menu groupsMenu = new Menu(); - groupsMenu.setStyleName("menuBarMenuButton"); - groupsMenu.setTitle("Groups"); - groupsMenu.addItem(new EMenuItem("All Groups", LinkManager.getHubAllGroupsLink())); //, new LinkCommand("#sf")); - groupsMenu.addItem(new EMenuItem("Compatible Groups", LinkManager.getHubCompatibleGroupsLink())); //, new LinkCommand("#sf")); - groupsMenu.addItem(new EMenuItem("Mixed Groups", LinkManager.getHubMixedGroupsLink())); //, new LinkCommand("#sf")); - groupsMenu.addItem(new EMenuItem("Group Definitions", LinkManager.getHubGroupDefinitionsLink())); //, new LinkCommand("#sf")); - groupsMenu.addItem(new MenuItemSeparator()); - groupsMenu.addItem(new EMenuItem("New Group", LinkManager.getHubNewGroupLink())); //, new LinkCommand("#sf")); - groupsMenu.addItem(new EMenuItem("New Group Definition", LinkManager.getHubNewGroupDefLink())); //, new LinkCommand("#sf")); - groupsMenu.addItem(new MenuItemSeparator()); -// groupsMenu.addItem(new MenuItem("Favorites")); //, new LinkCommand("#sf")); - - - Menu securityMenu = new Menu(); - securityMenu.setTitle("Security"); - securityMenu.addItem(new EMenuItem("Users",LinkManager.getAdminUsersLink())); - securityMenu.addItem(new EMenuItem("Roles",LinkManager.getAdminRolesLink())); - MenuItem securitySubMenuItem = new MenuItem("Security"); - securitySubMenuItem.setSubmenu(securityMenu); - - - Menu sysConfigMenu = new Menu(); - sysConfigMenu.setTitle("System Configuration"); - sysConfigMenu.addItem(new EMenuItem("Settings",LinkManager.getAdminSysConfigLink())); - sysConfigMenu.addItem(new EMenuItem("Plugins",LinkManager.getAdminPluginsLink())); - sysConfigMenu.addItem(new EMenuItem("Templates",LinkManager.getAdminTemplatesLink())); - MenuItem sysConfigSubMenuItem = new MenuItem("System Configuration"); - sysConfigSubMenuItem.setSubmenu(sysConfigMenu); - - - Menu contentMenu = new Menu(); - contentMenu.setTitle("Content"); - contentMenu.addItem(new EMenuItem("Bundles","#Bundles")); - contentMenu.addItem(new EMenuItem("Content Providers",LinkManager.getAdminContentProvidersLink())); - contentMenu.addItem(new EMenuItem("Content Repositories",LinkManager.getAdminContentReposLink())); - MenuItem contentSubMenuItem = new MenuItem("Content"); - contentSubMenuItem.setSubmenu(contentMenu); - - - Menu haMenu = new Menu(); - haMenu.setTitle("High Availability"); - haMenu.addItem(new EMenuItem("Servers",LinkManager.getHAServersLink())); - haMenu.addItem(new EMenuItem("Agents",LinkManager.getHAAgentsLink())); - haMenu.addItem(new EMenuItem("Affinity Groups",LinkManager.getHAAffinityGroupsLink())); - haMenu.addItem(new EMenuItem("Partition Events",LinkManager.getHAEventsLink())); - MenuItem haSubMentItem = new MenuItem("High Availability"); - haSubMentItem.setSubmenu(haMenu); - - - Menu reportsMenu = new Menu(); - reportsMenu.setTitle("Reports"); - reportsMenu.addItem(new EMenuItem("Resource Version Inventory Report", LinkManager.getReportsInventoryLink())); - MenuItem reportsSubMenuItem = new MenuItem("Reports"); - reportsSubMenuItem.setSubmenu(reportsMenu); - - - Menu adminMenu = new Menu(); - adminMenu.setTitle("Administration"); - adminMenu.addItem(securitySubMenuItem); - adminMenu.addItem(sysConfigSubMenuItem); - adminMenu.addItem(contentSubMenuItem); - adminMenu.addItem(haSubMentItem); - adminMenu.addItem(reportsSubMenuItem); - adminMenu.addItem(new EMenuItem("Downloads", LinkManager.getAdminDownloadsLink())); - adminMenu.addItem(new EMenuItem("License", LinkManager.getAdminLicenseLink())); - - - - - - Menu helpMenu = new Menu(); - helpMenu.setStyleName("menuBarMenuButton"); - helpMenu.setTitle("Help"); - helpMenu.addItem(new EMenuItem("Online Documentation", "http://www.rhq-project.org")); //, new LinkCommand("#sdfs")); - helpMenu.addItem(new EMenuItem("Open a support case", "http://www.rhq-project.org")); //, new LinkCommand("#sdfs")); -// helpMenu.addItem(new MenuItem("About")); //, new LinkCommand("#sdfs")); - - menu.setMenus(overviewMenu, resourcesMenu, groupsMenu, adminMenu, helpMenu); - - - topBar.addMember(menu); - - - addMember(topBar); - addMember(new SearchBarPane()); - - } - - protected void onDraw2() { - super.onDraw(); - - HTMLFlow menu = new HTMLFlow(); - menu.setContentsType(ContentsType.PAGE); - menu.setContentsURL("/rhq/common/menu/menu.xhtml"); - addMember(menu); - } - - - // @Override - - protected void onDraw3() { - super.onDraw(); - History.addValueChangeHandler(new ValueChangeHandler<String>() { public void onValueChange(ValueChangeEvent<String> stringValueChangeEvent) { String first = stringValueChangeEvent.getValue().split("/")[0]; @@ -285,15 +105,15 @@ public class MenuBarView extends VLayout { topStrip.addMember(new LayoutSpacer());
HLayout helpLayout = new HLayout(); - Label loggedInAs = new Label("Logged in as " + CoreGUI.getSessionSubject().getName()); - loggedInAs.setWrap(false); - loggedInAs.setValign(VerticalAlignment.CENTER); - helpLayout.addMember(loggedInAs); - helpLayout.addMember(new Hyperlink("Help", "Help")); - helpLayout.addMember(new Hyperlink("Preferences", "Preferences")); - helpLayout.addMember(new Hyperlink("Log Out", "LogOut")); - helpLayout.setLayoutAlign(VerticalAlignment.CENTER); - topStrip.addMember(helpLayout); +// Label loggedInAs = new Label("Logged in as " + CoreGUI.getSessionSubject().getName()); +// loggedInAs.setWrap(false); +// loggedInAs.setValign(VerticalAlignment.CENTER); +// helpLayout.addMember(loggedInAs); + topStrip.addMember(new Hyperlink("Help", "Help")); + topStrip.addMember(new Hyperlink("Preferences", "Preferences")); + topStrip.addMember(new Hyperlink("Log Out", "LogOut")); +// helpLayout.setLayoutAlign(VerticalAlignment.CENTER); +// topStrip.addMember(helpLayout);
/* DynamicForm links = new DynamicForm(); links.setNumCols(SECTIONS.length * 2); @@ -355,33 +175,4 @@ public class MenuBarView extends VLayout { }
- public static class EMenuItem extends com.smartgwt.client.widgets.menu.MenuItem { - - String link; - - public EMenuItem(String title, String link) { - super(title); - this.link = link; - init(); - } - - public EMenuItem(String title, String link, String icon) { - super(title, icon); - this.link = link; - init(); - } - - private void init() { - addClickHandler(new com.smartgwt.client.widgets.menu.events.ClickHandler() { - public void onClick(MenuItemClickEvent menuItemClickEvent) { - if (link.startsWith("#")) { - History.newItem(link.substring(1)); - } else { - Window.Location.assign(link); - } - } - }); - } - } - }
commit e624bee83c605b20d8411d0b44a8d885460b6262 Author: Greg Hinkle ghinkle@redhat.com Date: Fri Jul 23 12:47:12 2010 -0400
Let login form support native browser autocomplete so user/passwords can be saved
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LoginView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LoginView.java index 64d89ca..c28d77e 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LoginView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LoginView.java @@ -98,14 +98,13 @@ public class LoginView extends Canvas { HeaderItem header = new HeaderItem(); header.setValue("RHQ Login");
- + TextItem user = new TextItem("user", "User"); user.setRequired(true); - user.setAttribute("canAutocomplete", true); - user.setAttribute("autoComplete", true); + user.setAttribute("autoComplete", "native"); PasswordItem password = new PasswordItem("password", "Password"); password.setRequired(true); - password.setAttribute("autocomplete", true); + password.setAttribute("autoComplete", "native");
loginButton = new SubmitItem("login", "Login"); loginButton.setAlign(Alignment.CENTER);
commit 94d13c9f83d65c1a9ff8a35a53f5c9e6727e0aa2 Author: Greg Hinkle ghinkle@redhat.com Date: Fri Jul 23 12:46:27 2010 -0400
Moved ClusterKey to the domain module as it will now be part of the public API Expose ClusterFlyweight Tree api
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/cluster/ClusterManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/cluster/ClusterManagerBean.java index 39e6f4a..10611fa 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/cluster/ClusterManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/cluster/ClusterManagerBean.java @@ -18,7 +18,12 @@ */ package org.rhq.enterprise.server.resource.cluster;
+import java.util.ArrayList; +import java.util.HashMap; +import java.util.HashSet; import java.util.List; +import java.util.Map; +import java.util.Set;
import javax.ejb.EJB; import javax.ejb.Stateless; @@ -33,7 +38,10 @@ import org.apache.commons.logging.LogFactory; import org.rhq.core.domain.auth.Subject; import org.rhq.core.domain.resource.Resource; import org.rhq.core.domain.resource.ResourceType; +import org.rhq.core.domain.resource.group.ClusterKey; import org.rhq.core.domain.resource.group.ResourceGroup; +import org.rhq.core.domain.resource.group.composite.ClusterFlyweight; +import org.rhq.core.domain.resource.group.composite.ClusterKeyFlyweight; import org.rhq.enterprise.server.RHQConstants; import org.rhq.enterprise.server.auth.SubjectManagerLocal; import org.rhq.enterprise.server.authz.AuthorizationManagerLocal; @@ -48,7 +56,7 @@ import org.rhq.enterprise.server.resource.group.ResourceGroupUpdateException; * */ @Stateless -public class ClusterManagerBean implements ClusterManagerLocal { +public class ClusterManagerBean implements ClusterManagerLocal, ClusterManagerRemote { private final Log log = LogFactory.getLog(ClusterManagerBean.class);
@PersistenceContext(unitName = RHQConstants.PERSISTENCE_UNIT_NAME) @@ -168,6 +176,75 @@ public class ClusterManagerBean implements ClusterManagerLocal { return rs; }
+ public ClusterFlyweight getClusterTree(Subject subject, int groupId) { + Query query = entityManager.createQuery( + "SELECT r.id, r.resourceType.id, r.parentResource.id, r.resourceKey, r.name, " + + "(SELECT count(r2) FROM Resource r2 join r2.explicitGroups g2 WHERE g2.id = :groupId and r2.id = r.id) " + + "FROM Resource r join r.implicitGroups g " + + "WHERE g.id = :groupId"); + + query.setParameter("groupId", groupId); + List<Object[]> rs = query.getResultList(); + + Map<Integer, List<Object[]>> dataMap = new HashMap<Integer, List<Object[]>>(); + Set<Integer> explicitResources = new HashSet<Integer>(); + + for (Object[] d : rs) { + + Integer parentId = (Integer) d[2]; + List<Object[]> childList = dataMap.get(parentId); + if (childList == null) { + childList = new ArrayList<Object[]>(); + dataMap.put(parentId, childList); + } + childList.add(d); + if ((Long) d[5] > 0) { + explicitResources.add((Integer) d[0]); + } + } + + + ClusterFlyweight key = new ClusterFlyweight(groupId); + + buildTree(groupId, key, explicitResources, dataMap); + + return key; + } + + private void buildTree(int groupId, ClusterFlyweight parent, Set<Integer> parentIds, Map<Integer,List<Object[]>> data) { + + for (Integer parentId : parentIds) { + + Map<ClusterKeyFlyweight, ClusterFlyweight> children = new HashMap<ClusterKeyFlyweight, ClusterFlyweight>(); + Map<ClusterKeyFlyweight, Set<Integer>> members = new HashMap<ClusterKeyFlyweight, Set<Integer>>(); + + if (data.get(parentId) != null) { + for (Object[] child : data.get(parentId)) { + ClusterKeyFlyweight n = new ClusterKeyFlyweight((Integer)child[1], (String)child[3]); + ClusterFlyweight flyweight = children.get(n); + Set<Integer> memberList = members.get(n); + if (flyweight == null) { + flyweight = new ClusterFlyweight(n); + children.put(n, flyweight); + memberList = new HashSet<Integer>(); + members.put(n, memberList); + } + flyweight.addResource((String)child[4]); + memberList.add((Integer) child[0]); + } + } + + parent.setChildren(new ArrayList<ClusterFlyweight>(children.values())); + + + for (ClusterFlyweight child : children.values()) { + buildTree(groupId, child, members.get(child.getClusterKey()), data); + } + } + } + + + private String getClusterKeyQuery(ClusterKey clusterKey) { if (null == clusterKey) return null; diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/cluster/ClusterManagerLocal.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/cluster/ClusterManagerLocal.java index ce11d33..b13b380 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/cluster/ClusterManagerLocal.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/cluster/ClusterManagerLocal.java @@ -26,37 +26,15 @@ import org.jetbrains.annotations.Nullable;
import org.rhq.core.domain.auth.Subject; import org.rhq.core.domain.resource.Resource; +import org.rhq.core.domain.resource.group.ClusterKey; import org.rhq.core.domain.resource.group.ResourceGroup; +import org.rhq.core.domain.resource.group.composite.ClusterFlyweight;
/* * @author Jay Shaughnessy */ @Local -public interface ClusterManagerLocal { +public interface ClusterManagerLocal extends ClusterManagerRemote {
- /** - * Given a cluster key create a backing group. - * @param clusterKey - * @param addResources If true, the new group will be assigned the current resources defined by the clusterKey. - * Otherwise no resources will be assigned to the new group. - * @throws IllegalArgumentException if a backing group exists for this clusterKey - */ - ResourceGroup createAutoClusterBackingGroup(Subject subject, ClusterKey clusterKey, boolean addResources); - - /** - * Return the backing group for the supplied cluster key. Resource membership will represent the resources - * last set for the group and may not reflect current membership. See {@link #getAutoClusterResources(String)} - * @param clusterKey - * @return The backing group, or null if the key does not have a backing group. - */ - @Nullable - ResourceGroup getAutoClusterBackingGroup(Subject subject, ClusterKey clusterKey); - - /** - * Given a cluster key get the auto cluster resource membership. The membership is always determined - * at call time, regardless of whether a backing group exists. To get the backing group, if it exists, - * for a cluster key then call {@link #getAutoClusterBackingGroup(String)}. - */ - List<Resource> getAutoClusterResources(Subject subject, ClusterKey clusterKey);
} diff --git a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/resource/cluster/ClusterManagerBeanTest.java b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/resource/cluster/ClusterManagerBeanTest.java index ec5177d..3729a60 100644 --- a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/resource/cluster/ClusterManagerBeanTest.java +++ b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/resource/cluster/ClusterManagerBeanTest.java @@ -30,6 +30,7 @@ import org.rhq.core.domain.auth.Subject; import org.rhq.core.domain.authz.Permission; import org.rhq.core.domain.authz.Role; import org.rhq.core.domain.resource.Resource; +import org.rhq.core.domain.resource.group.ClusterKey; import org.rhq.core.domain.resource.group.ResourceGroup; import org.rhq.core.domain.util.PageControl; import org.rhq.core.domain.util.PageList;
commit e01dce1066bd008701e7f4cf36db95d5517b0471 Author: Greg Hinkle ghinkle@redhat.com Date: Fri Jul 23 12:45:36 2010 -0400
Moved ClusterKey to the domain module as it will now be part of the public API
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/group/ClusterKey.java b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/group/ClusterKey.java new file mode 100644 index 0000000..e6d5369 --- /dev/null +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/group/ClusterKey.java @@ -0,0 +1,237 @@ +/* + * RHQ Management Platform + * Copyright (C) 2005-2008 Red Hat, Inc. + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ +package org.rhq.core.domain.resource.group; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + + +/** + * A ClusterKey represents an AutoCluster of resources in a Cluster Hierarchy. Given the key it is + * possible to determine specific membership of the AutoCluster at any time. It represents the Cluster + * Root (a Compatible Group) and the hierarchy of resource cluster nodes. Each level of the hierarchy + * represents a resource cluster node defined by a Plugin|ResourceType|ResourceKey tuple.<br/> + * <br/> + * The ClusterKey has the following form: + * <pre> + * Expressed iteratively: + * + * CompatibleGroupId::ResourceTypeId1:ResourceKey1::ResourceTypeId2:ResourceKey2:: ... ::ResourceTypeIdN:ResourceKeyN + * + * Expressed Recursively: + * + * Depth-1 AutoCluster CompatibleGroupId::ResourceTypeId1:ResourceKey1 + * Depth-N AutoCluster <ParentClusterKey>::ResourceTypeIdN:ResourceKeyN + * </pre> + * @author jay shaughnessy + * + */ +public class ClusterKey implements Serializable { + static final String DELIM = ":"; + static final String DELIM_NODE = "::"; + + // Id of the compatible resource group containing the root set of clustered resources. + private int clusterGroupId = 0; + private List<ClusterKey.Node> hierarchy; + private String key = null; + private String namedKey = null; + + + public ClusterKey() { + } + + /** Construct ClusterKey with to-be-defined Hierarcrhy */ + public ClusterKey(int clusterResourceGroupId) { + this.clusterGroupId = clusterResourceGroupId; + this.hierarchy = new ArrayList<ClusterKey.Node>(); + } + + /** Construct ClusterKey for a top level AutoCluster */ + public ClusterKey(int clusterResourceGroupId, int resourceTypeId, String resourceKey) { + this.clusterGroupId = clusterResourceGroupId; + this.hierarchy = new ArrayList<ClusterKey.Node>(); + this.hierarchy.add(new ClusterKey.Node(resourceTypeId, resourceKey)); + } + + /** Construct a new ClusterKey for a child AutoCluster of the provided parentKey*/ + public ClusterKey(ClusterKey parentKey, int childResourceTypeId, String childResourceKey) { + List<ClusterKey.Node> rootClusterNodes = parentKey.getHierarchy(); + + this.clusterGroupId = parentKey.getClusterGroupId(); + this.hierarchy = new ArrayList<ClusterKey.Node>(rootClusterNodes); //.size() + 1); +// Collections.copy(this.hierarchy, rootClusterNodes); + this.hierarchy.add(new ClusterKey.Node(childResourceTypeId, childResourceKey)); + } + + + + public int getClusterGroupId() { + return clusterGroupId; + } + + public List<ClusterKey.Node> getHierarchy() { + return hierarchy; + } + + /** + * Increase depth of hierarchy with new child node. + * @param childResourceTypeId + * @param childResourceKey + * @return The updated hierarchy + */ + public List<ClusterKey.Node> addChildToHierarchy(int childResourceTypeId, String childResourceKey) { + + this.hierarchy.add(new ClusterKey.Node(childResourceTypeId, childResourceKey)); + + return hierarchy; + } + + /** + * @return the depth of the AutoCluster hierarchy. Just another way of getting the hierarchy size. + */ + public int getDepth() { + return hierarchy.size(); + } + + /** + * @param newDepth > 0, keep only the hierarchy up to an including the specified depth. + */ + public void setDepth(int newDepth) { + while ((newDepth > 0) && (this.hierarchy.size() > newDepth)) { + this.hierarchy.remove(this.hierarchy.size() - 1); + } + } + + public String getKey() { + if (null == key) { + StringBuilder b = new StringBuilder(); + b.append(clusterGroupId); + + for (ClusterKey.Node node : hierarchy) { + b.append(DELIM_NODE); + b.append(node.toString()); + } + key = b.toString(); + } + + return key; + } + + /** + * format: see class doc, used delimiters ClusterKey.DELIM_NODE and ClusterKey.DELIM + */ + @Override + public String toString() { + return getKey(); + } + + + public static ClusterKey valueOf(String clusterKey) { + ClusterKey result = null; + + try { + String[] nodes = clusterKey.split(DELIM_NODE); + int groupId = Integer.valueOf(nodes[0]); + + result = new ClusterKey(groupId); + + for (int i = 1; i < nodes.length; ++i) { + String[] nodeInfo = nodes[i].split(DELIM); + + if ((nodeInfo.length != 2) || "".equals(nodeInfo[0].trim()) || "".equals(nodeInfo[1].trim())) { + throw new IllegalArgumentException("Invalid cluster key node: " + nodeInfo); + } + + result.addChildToHierarchy(Integer.valueOf(nodeInfo[0]), nodeInfo[1]); + } + } catch (Exception e) { + result = null; + } + + return result; + } + + /** + * @param clusterKey + * @return The ResourceType id of the resource group this clusterKey defines. + */ + public static int getResourceType(ClusterKey clusterKey) { + List<ClusterKey.Node> nodes = clusterKey.getHierarchy(); + + return nodes.get(nodes.size() - 1).getResourceTypeId(); + } + + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (!(o instanceof ClusterKey)) return false; + + ClusterKey that = (ClusterKey) o; + + if (!getKey().equals(that.getKey())) return false; + + return true; + } + + @Override + public int hashCode() { + return getKey().hashCode(); + } + + /** + * Immutable class representing a node in an AutoCluster hierarchy. The node describes a + * Set of like resources (same type and same resource key). By itself the node lacks any context + * and so typically this class is for use within a ClusterKey, which qualifies the node with + * the root group and constraining node ancestry.. */ + public static class Node implements Serializable { + int resourceTypeId; + String resourceKey; + + public Node(int resourceTypeId, String resourceKey) { + super(); + this.resourceTypeId = resourceTypeId; + this.resourceKey = encode(resourceKey); + } + + public int getResourceTypeId() { + return resourceTypeId; + } + + public String getResourceKey() { + return decode(resourceKey); + } + + /** + * format: resourceTypeId:resourceKey (actual delimiter is ClusterKey.DELIM) + */ + @Override + public String toString() { + return resourceTypeId + DELIM + resourceKey; + } + + private String encode(String info) { + return info.replace(":","%3a"); + } + private String decode(String code) { + return code.replace("%3a", ":"); + } + } +} diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/navigation/group/ResourceGroupTreeContextMenuUIBean.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/navigation/group/ResourceGroupTreeContextMenuUIBean.java index e3da8ca..34fb0a6 100644 --- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/navigation/group/ResourceGroupTreeContextMenuUIBean.java +++ b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/navigation/group/ResourceGroupTreeContextMenuUIBean.java @@ -31,6 +31,7 @@ import org.rhq.core.domain.measurement.DataType; import org.rhq.core.domain.measurement.MeasurementDefinition; import org.rhq.core.domain.operation.OperationDefinition; import org.rhq.core.domain.resource.Resource; +import org.rhq.core.domain.resource.group.ClusterKey; import org.rhq.core.domain.resource.group.ResourceGroup; import org.rhq.core.gui.util.FacesContextUtility; import org.rhq.enterprise.gui.navigation.contextmenu.MenuItemDescriptor; @@ -40,7 +41,6 @@ import org.rhq.enterprise.gui.navigation.contextmenu.TreeContextMenuBase; import org.rhq.enterprise.gui.util.EnterpriseFacesContextUtility; import org.rhq.enterprise.server.measurement.MeasurementDefinitionManagerLocal; import org.rhq.enterprise.server.operation.OperationManagerLocal; -import org.rhq.enterprise.server.resource.cluster.ClusterKey; import org.rhq.enterprise.server.resource.cluster.ClusterManagerLocal; import org.rhq.enterprise.server.resource.group.ResourceGroupManagerLocal; import org.rhq.enterprise.server.util.LookupUtil; diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/navigation/group/ResourceGroupTreeModelUIBean.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/navigation/group/ResourceGroupTreeModelUIBean.java index 66ef285..ef8f7d0 100644 --- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/navigation/group/ResourceGroupTreeModelUIBean.java +++ b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/navigation/group/ResourceGroupTreeModelUIBean.java @@ -30,6 +30,7 @@ import org.apache.commons.logging.LogFactory;
import org.rhq.core.domain.resource.flyweight.AutoGroupCompositeFlyweight; import org.rhq.core.domain.resource.flyweight.ResourceFlyweight; +import org.rhq.core.domain.resource.group.ClusterKey; import org.rhq.core.domain.resource.group.GroupCategory; import org.rhq.core.domain.resource.group.ResourceGroup; import org.rhq.core.domain.util.PageControl; @@ -38,7 +39,6 @@ import org.rhq.enterprise.gui.navigation.resource.ResourceTreeModelUIBean; import org.rhq.enterprise.gui.navigation.resource.ResourceTreeNode; import org.rhq.enterprise.gui.util.EnterpriseFacesContextUtility; import org.rhq.enterprise.server.resource.ResourceManagerLocal; -import org.rhq.enterprise.server.resource.cluster.ClusterKey; import org.rhq.enterprise.server.resource.group.ResourceGroupManagerLocal; import org.rhq.enterprise.server.util.HibernatePerformanceMonitor; import org.rhq.enterprise.server.util.LookupUtil; diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/navigation/group/ResourceGroupTreeNode.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/navigation/group/ResourceGroupTreeNode.java index 3a1e482..8f1003a 100644 --- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/navigation/group/ResourceGroupTreeNode.java +++ b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/navigation/group/ResourceGroupTreeNode.java @@ -20,9 +20,9 @@ package org.rhq.enterprise.gui.navigation.group;
import org.rhq.core.domain.resource.flyweight.AutoGroupCompositeFlyweight; import org.rhq.core.domain.resource.flyweight.ResourceFlyweight; +import org.rhq.core.domain.resource.group.ClusterKey; import org.rhq.core.domain.resource.group.ResourceGroup; import org.rhq.core.util.sort.HumaneStringComparator; -import org.rhq.enterprise.server.resource.cluster.ClusterKey; import org.rhq.enterprise.gui.navigation.resource.ResourceTreeNode; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/navigation/group/ResourceGroupTreeStateAdvisor.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/navigation/group/ResourceGroupTreeStateAdvisor.java index a803b9c..273e7a2 100644 --- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/navigation/group/ResourceGroupTreeStateAdvisor.java +++ b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/navigation/group/ResourceGroupTreeStateAdvisor.java @@ -20,7 +20,6 @@ package org.rhq.enterprise.gui.navigation.group;
import java.io.IOException; import java.util.HashSet; -import java.util.Map; import java.util.Set;
import javax.faces.application.FacesMessage; @@ -35,12 +34,10 @@ import org.richfaces.model.TreeRowKey;
import org.rhq.core.domain.auth.Subject; import org.rhq.core.domain.resource.flyweight.AutoGroupCompositeFlyweight; -import org.rhq.core.domain.resource.group.composite.AutoGroupComposite; +import org.rhq.core.domain.resource.group.ClusterKey; import org.rhq.core.domain.resource.group.ResourceGroup; import org.rhq.core.gui.util.FacesContextUtility; -import org.rhq.enterprise.gui.navigation.resource.ResourceTreeNode; import org.rhq.enterprise.gui.util.EnterpriseFacesContextUtility; -import org.rhq.enterprise.server.resource.cluster.ClusterKey; import org.rhq.enterprise.server.resource.cluster.ClusterManagerLocal; import org.rhq.enterprise.server.resource.group.ResourceGroupManagerLocal; import org.rhq.enterprise.server.util.LookupUtil; diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/cluster/ClusterKey.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/cluster/ClusterKey.java deleted file mode 100644 index c2511be..0000000 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/cluster/ClusterKey.java +++ /dev/null @@ -1,275 +0,0 @@ -/* - * RHQ Management Platform - * Copyright (C) 2005-2008 Red Hat, Inc. - * All rights reserved. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation version 2 of the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ -package org.rhq.enterprise.server.resource.cluster; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import javax.persistence.EntityManager; - -import org.apache.commons.logging.LogFactory; - -import org.rhq.core.domain.resource.ResourceType; -import org.rhq.core.domain.resource.group.ResourceGroup; - -/** - * A ClusterKey represents an AutoCluster of resources in a Cluster Hierarchy. Given the key it is - * possible to determine specific membership of the AutoCluster at any time. It represents the Cluster - * Root (a Compatible Group) and the hierarchy of resource cluster nodes. Each level of the hierarchy - * represents a resource cluster node defined by a Plugin|ResourceType|ResourceKey tuple.<br/> - * <br/> - * The ClusterKey has the following form: - * <pre> - * Expressed iteratively: - * - * CompatibleGroupId::ResourceTypeId1:ResourceKey1::ResourceTypeId2:ResourceKey2:: ... ::ResourceTypeIdN:ResourceKeyN - * - * Expressed Recursively: - * - * Depth-1 AutoCluster CompatibleGroupId::ResourceTypeId1:ResourceKey1 - * Depth-N AutoCluster <ParentClusterKey>::ResourceTypeIdN:ResourceKeyN - * </pre> - * @author jay shaughnessy - * - */ -public class ClusterKey { - static final String DELIM = ":"; - static final String DELIM_NODE = "::"; - - // Id of the compatible resource group containing the root set of clustered resources. - private int clusterGroupId = 0; - private List<ClusterKey.Node> hierarchy; - private String key = null; - private String namedKey = null; - - /** Construct ClusterKey with to-be-defined Hierarcrhy */ - public ClusterKey(int clusterResourceGroupId) { - this.clusterGroupId = clusterResourceGroupId; - this.hierarchy = new ArrayList<ClusterKey.Node>(); - } - - /** Construct ClusterKey for a top level AutoCluster */ - public ClusterKey(int clusterResourceGroupId, int resourceTypeId, String resourceKey) { - this.clusterGroupId = clusterResourceGroupId; - this.hierarchy = new ArrayList<ClusterKey.Node>(); - this.hierarchy.add(new ClusterKey.Node(resourceTypeId, resourceKey)); - } - - /** Construct a new ClusterKey for a child AutoCluster of the provided parentKey*/ - public ClusterKey(ClusterKey parentKey, int childResourceTypeId, String childResourceKey) { - List<ClusterKey.Node> rootClusterNodes = parentKey.getHierarchy(); - - this.clusterGroupId = parentKey.getClusterGroupId(); - this.hierarchy = new ArrayList<ClusterKey.Node>(rootClusterNodes); //.size() + 1); -// Collections.copy(this.hierarchy, rootClusterNodes); - this.hierarchy.add(new ClusterKey.Node(childResourceTypeId, childResourceKey)); - } - - - - public int getClusterGroupId() { - return clusterGroupId; - } - - public List<ClusterKey.Node> getHierarchy() { - return hierarchy; - } - - /** - * Increase depth of hierarchy with new child node. - * @param childResourceTypeId - * @param childResourceKey - * @return The updated hierarchy - */ - public List<ClusterKey.Node> addChildToHierarchy(int childResourceTypeId, String childResourceKey) { - - this.hierarchy.add(new ClusterKey.Node(childResourceTypeId, childResourceKey)); - - return hierarchy; - } - - /** - * @return the depth of the AutoCluster hierarchy. Just another way of getting the hierarchy size. - */ - public int getDepth() { - return hierarchy.size(); - } - - /** - * @param newDepth > 0, keep only the hierarchy up to an including the specified depth. - */ - public void setDepth(int newDepth) { - while ((newDepth > 0) && (this.hierarchy.size() > newDepth)) { - this.hierarchy.remove(this.hierarchy.size() - 1); - } - } - - public String getKey() { - if (null == key) { - StringBuilder b = new StringBuilder(); - b.append(clusterGroupId); - - for (ClusterKey.Node node : hierarchy) { - b.append(DELIM_NODE); - b.append(node.toString()); - } - key = b.toString(); - } - - return key; - } - - /** - * format: see class doc, used delimiters ClusterKey.DELIM_NODE and ClusterKey.DELIM - */ - @Override - public String toString() { - return getKey(); - } - - /** - * format: see class doc, used delimiters ClusterKey.DELIM_NODE and ClusterKey.DELIM. - * ResourceTypeId replaced with Plugin:ResourceTypeName tuple. - */ - public String toNamedString(EntityManager em) { - if (null == namedKey) { - ResourceGroup clusterResourceGroup = em.find(ResourceGroup.class, this.clusterGroupId); - - StringBuilder b = new StringBuilder(); - b.append((null == clusterResourceGroup) ? this.clusterGroupId : clusterResourceGroup.getName()); - - for (ClusterKey.Node node : hierarchy) { - b.append(DELIM_NODE); - b.append(node.toNamedString(em)); - } - namedKey = b.toString(); - } - - return namedKey; - } - - public static ClusterKey valueOf(String clusterKey) { - ClusterKey result = null; - - try { - String[] nodes = clusterKey.split(DELIM_NODE); - int groupId = Integer.valueOf(nodes[0]); - - result = new ClusterKey(groupId); - - for (int i = 1; i < nodes.length; ++i) { - String[] nodeInfo = nodes[i].split(DELIM); - - if ((nodeInfo.length != 2) || "".equals(nodeInfo[0].trim()) || "".equals(nodeInfo[1].trim())) { - throw new IllegalArgumentException("Invalid cluster key node: " + nodeInfo); - } - - result.addChildToHierarchy(Integer.valueOf(nodeInfo[0]), nodeInfo[1]); - } - } catch (Exception e) { - LogFactory.getLog(ClusterKey.class).error("Invalid clusterKey |" + clusterKey + "| encountered: " + e); - result = null; - } - - return result; - } - - /** - * @param clusterKey - * @return The ResourceType id of the resource group this clusterKey defines. - */ - public static int getResourceType(ClusterKey clusterKey) { - List<ClusterKey.Node> nodes = clusterKey.getHierarchy(); - - return nodes.get(nodes.size() - 1).getResourceTypeId(); - } - - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (!(o instanceof ClusterKey)) return false; - - ClusterKey that = (ClusterKey) o; - - if (!getKey().equals(that.getKey())) return false; - - return true; - } - - @Override - public int hashCode() { - return getKey().hashCode(); - } - - /** - * Immutable class representing a node in an AutoCluster hierarchy. The node describes a - * Set of like resources (same type and same resource key). By itself the node lacks any context - * and so typically this class is for use within a ClusterKey, which qualifies the node with - * the root group and constraining node ancestry.. */ - public static class Node { - int resourceTypeId; - String resourceKey; - - public Node(int resourceTypeId, String resourceKey) { - super(); - this.resourceTypeId = resourceTypeId; - this.resourceKey = encode(resourceKey); - } - - public int getResourceTypeId() { - return resourceTypeId; - } - - public String getResourceKey() { - return decode(resourceKey); - } - - /** - * format: resourceTypeId:resourceKey (actual delimiter is ClusterKey.DELIM) - */ - @Override - public String toString() { - return resourceTypeId + DELIM + resourceKey; - } - - /* - * format: resourceTypePlugin:resourceTypeName:resourceKey (actual delimiter is ClusterKey.DELIM) - */ - public String toNamedString(EntityManager em) { - ResourceType resourceType = em.find(ResourceType.class, this.resourceTypeId); - String resourceTypePart = null; - - if (null == resourceType) { - resourceTypePart = this.resourceTypeId + DELIM + this.resourceTypeId; - } else - resourceTypePart = resourceType.getPlugin() + DELIM + resourceType.getName(); - - return resourceTypePart + DELIM + resourceKey; - } - - private String encode(String info) { - return info.replace(":","%3a"); - } - private String decode(String code) { - return code.replace("%3a", ":"); - } - } -}
commit 7ce3f39a8a246e32b1d6183e555b8ec0da051dde Author: Greg Hinkle ghinkle@redhat.com Date: Fri Jul 23 12:44:51 2010 -0400
Don't take over full screen when portal login page is shown (as it'll always be in a gwt container now)
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/common/Login.jsp b/modules/enterprise/gui/portal-war/src/main/webapp/common/Login.jsp index a9b0844..804ee5f 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/common/Login.jsp +++ b/modules/enterprise/gui/portal-war/src/main/webapp/common/Login.jsp @@ -28,8 +28,8 @@ <title><fmt:message key="login.title" /></title> <link rel="stylesheet" href="<html:rewrite page="/css/win.css"/>" type="text/css"> <script language="JavaScript" type="text/javascript"> - if (top != self) - top.location.href = self.document.location; +// if (top != self) +// top.location.href = self.document.location;
var path = "<html:rewrite page="/images/"/>";
commit f14436b69d270a649125a5eb19b266ef4ca13729 Author: Greg Hinkle ghinkle@redhat.com Date: Fri Jul 23 12:44:05 2010 -0400
Add the ability to filter by the root resource... let's us use criteria to load an entire platform or search within one
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/ResourceCriteria.java b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/ResourceCriteria.java index ad52f4c..a332b77 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/ResourceCriteria.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/ResourceCriteria.java @@ -65,6 +65,7 @@ public class ResourceCriteria extends TaggedCriteria { private List<Integer> filterIds; // needs overrides private List<Integer> filterExplicitGroupIds; // requires overrides private List<Integer> filterImplicitGroupIds; // requires overrides + private Integer filterRootResourceId; // requires overrides
private boolean fetchResourceType; private boolean fetchChildResources; @@ -124,6 +125,8 @@ public class ResourceCriteria extends TaggedCriteria { + " FROM Resource ires " // + " JOIN ires.implicitGroups implicitGroup " // + " WHERE implicitGroup.id IN ( ? ) )"); + filterOverrides.put("rootResourceId", + "agent.id = (SELECT r2.agent.id FROM Resource r2 where r2.id = ?)");
sortOverrides.put("resourceTypeName", "resourceType.name"); sortOverrides.put("resourceCategory", "resourceType.category"); @@ -222,6 +225,10 @@ public class ResourceCriteria extends TaggedCriteria { this.filterImplicitGroupIds = Arrays.asList(filterImplicitGroupIds); }
+ public void addFilterRootResourceId(Integer filterRootResourceId) { + this.filterRootResourceId = filterRootResourceId; + } + public void fetchResourceType(boolean fetchResourceType) { this.fetchResourceType = fetchResourceType; }
commit b227633c1d95e870b3de26d0cf622f09b4df64a8 Author: Joseph Marques joseph@redhat.com Date: Fri Jul 23 11:26:29 2010 -0400
BZ-617567: don't use nested forms
* outer details.xhtml was already declaring a form for custom content beans * roles.xhtml / subjects.xhtml, thus, don't need to define their own form
diff --git a/modules/enterprise/server/plugins/alert-roles/src/main/resources/roles.xhtml b/modules/enterprise/server/plugins/alert-roles/src/main/resources/roles.xhtml index 1341fb4..f807414 100644 --- a/modules/enterprise/server/plugins/alert-roles/src/main/resources/roles.xhtml +++ b/modules/enterprise/server/plugins/alert-roles/src/main/resources/roles.xhtml @@ -9,7 +9,6 @@ xmlns:rich="http://richfaces.ajax4jsf.org/rich%22%3E
<body> - <h:form id="rolesForm"> <rich:pickList fastMoveControlsVisible="false" sourceListWidth="200px" targetListWidth="200px" @@ -18,7 +17,6 @@ value="#{rolesBean.currentRoles}"> <f:selectItems value="#{rolesBean.availableRolesMap}" /> </rich:pickList> - </h:form> </body>
</html> \ No newline at end of file diff --git a/modules/enterprise/server/plugins/alert-subject/src/main/resources/subjects.xhtml b/modules/enterprise/server/plugins/alert-subject/src/main/resources/subjects.xhtml index 9994c5c..39d86e8 100644 --- a/modules/enterprise/server/plugins/alert-subject/src/main/resources/subjects.xhtml +++ b/modules/enterprise/server/plugins/alert-subject/src/main/resources/subjects.xhtml @@ -9,7 +9,6 @@ xmlns:rich="http://richfaces.ajax4jsf.org/rich%22%3E
<body> - <h:form id="subjectsForm"> <rich:pickList fastMoveControlsVisible="false" sourceListWidth="200px" targetListWidth="200px" @@ -18,7 +17,6 @@ value="#{subjectsBean.currentSubjects}"> <f:selectItems value="#{subjectsBean.availableSubjectsMap}" /> </rich:pickList> - </h:form> </body>
</html> \ No newline at end of file
commit b13693f2a55c24422be11d38bf23361ed1db3950 Author: John Mazzitelli mazz@redhat.com Date: Fri Jul 23 11:00:46 2010 -0400
BZ 615377 workaround sun bug http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6727821
diff --git a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/PluginContainer.java b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/PluginContainer.java index d6546a2..c9c1d54 100644 --- a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/PluginContainer.java +++ b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/PluginContainer.java @@ -31,6 +31,8 @@ import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.ReadWriteLock; import java.util.concurrent.locks.ReentrantReadWriteLock;
+import javax.security.auth.login.Configuration; + import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory;
@@ -114,6 +116,11 @@ public class PluginContainer implements ContainerService { }
private PluginContainer() { + // for why we need to do this, see http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6727821 + try { + Configuration.getConfiguration(); + } catch (Throwable t) { + } }
/** @@ -337,6 +344,13 @@ public class PluginContainer implements ContainerService { private void cleanMemory() { Introspector.flushCaches(); LogFactory.releaseAll(); + + // for why we need to do this, see http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6727821 + try { + Configuration.setConfiguration(null); + } catch (Throwable t) { + } + System.gc(); }
@@ -563,4 +577,4 @@ public class PluginContainer implements ContainerService { public boolean isInsideAgent() { return (this.configuration != null && this.configuration.isInsideAgent()); } -} \ No newline at end of file +}
commit 8d6b4f8b43d62b7375468b363af0c1841c7d3a05 Author: Lukas Krejci lkrejci@redhat.com Date: Thu Jul 22 18:52:14 2010 +0200
BZ 601744 - backing out the position:relative part of the original fix in main.xhtml. This effectively reverts the page to the state it was before we had the rich:tabPanel, which was eventually removed.
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/entity/layout/main.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/entity/layout/main.xhtml index e249621..aa9f90d 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/entity/layout/main.xhtml +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/entity/layout/main.xhtml @@ -50,7 +50,7 @@ id - the id of the Resource being accessed </div> <div id="centerContent" class="column" style="width: #{100 - UserPreferencesUIBean.leftResourceNavState}%;"> <div id="centerContentWrapper" class="content-right"> - <div style="left: 0; right: 0; height: 100%; position: relative"> + <div style="left: 0; right: 0; height: 100%;"> <ui:insert name="summary"><p>Default Entity Summary</p></ui:insert> <ui:insert name="tabBar"><p>Default Entity TabBar</p></ui:insert> <ui:insert name="content"><p>Default Entity Content</p></ui:insert>
commit 9ed8f96c231bdce5ca78f3b2ea32b7ef5949e2fb Author: Joseph Marques joseph@redhat.com Date: Thu Jul 22 12:20:34 2010 -0400
BZ-617257: windows does not open on IE if name includes whitespace
diff --git a/modules/enterprise/server/plugins/alert-operations/src/main/resources/operations.xhtml b/modules/enterprise/server/plugins/alert-operations/src/main/resources/operations.xhtml index 2eb3f88..0502e73 100644 --- a/modules/enterprise/server/plugins/alert-operations/src/main/resources/operations.xhtml +++ b/modules/enterprise/server/plugins/alert-operations/src/main/resources/operations.xhtml @@ -21,7 +21,7 @@ <h:panelGroup rendered="#{operationsBean.selectionMode eq 'SPECIFIC'}"> <h:inputText value="#{operationsBean.resourceId}" id="resourceId" /> <a href="#" - onclick="window.open('/rhq/inventory/resourcePicker.xhtml?nomenu=true&fieldId=customContentForm:resourceId', 'Pick a resource','width=1000,height=700,scrollbars=yes,toolbar=no,resizable=yes,location=no,status=no,left=100,top=100'); return false;" + onclick="window.open('/rhq/inventory/resourcePicker.xhtml?nomenu=true&fieldId=customContentForm:resourceId', 'ResourcePicker','width=1000,height=700,scrollbars=yes,toolbar=no,resizable=yes,location=no,status=no,left=100,top=100'); return false;" class="buttonmed">Pick</a> </h:panelGroup>
commit 67994d4d27d36390317e91a3e472adc29267a017 Author: Ian Springer ian.springer@redhat.com Date: Thu Jul 22 11:40:07 2010 -0400
fix error in description of snmpAgentPort plugin config prop
diff --git a/modules/plugins/apache/src/main/resources/META-INF/rhq-plugin.xml b/modules/plugins/apache/src/main/resources/META-INF/rhq-plugin.xml index 9119de3..b3f5aa3 100644 --- a/modules/plugins/apache/src/main/resources/META-INF/rhq-plugin.xml +++ b/modules/plugins/apache/src/main/resources/META-INF/rhq-plugin.xml @@ -277,7 +277,7 @@ <c:simple-property name="snmpAgentHost" displayName="SNMP Agent Host" default="127.0.0.1" description="the host name or IP address of the Apache SNMP agent (typically '127.0.0.1')"/> <c:simple-property name="snmpAgentPort" displayName="SNMP Agent Port" type="integer" default="1610" - description="the TCP port of the Apache SNMP agent (typically '1610')"/> + description="the UDP port of the Apache SNMP agent (typically '1610')"/> <c:simple-property name="snmpAgentCommunity" displayName="SNMP Agent Community" default="public" description="the SNMP community of the Apache SNMP agent (typically 'public')"/>
commit f0b6101bf98bac9c3a64a625ba84692770bdb7e0 Author: Heiko W. Rupp hwr@redhat.com Date: Thu Jul 22 11:41:45 2010 +0200
BZ 617131 - roll back the 'channel' -> 'repo' renaming introduced in 29a4fadac497136b7a6360eed0821984baf35c55
diff --git a/modules/plugins/jboss-cache/src/main/java/org/rhq/plugins/jbosscache/JGroupsChannelComponent.java b/modules/plugins/jboss-cache/src/main/java/org/rhq/plugins/jbosscache/JGroupsChannelComponent.java new file mode 100644 index 0000000..4bf06a9 --- /dev/null +++ b/modules/plugins/jboss-cache/src/main/java/org/rhq/plugins/jbosscache/JGroupsChannelComponent.java @@ -0,0 +1,64 @@ +/* + * Jopr Management Platform + * Copyright (C) 2005-2008 Red Hat, Inc. + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License, version 2, as + * published by the Free Software Foundation, and/or the GNU Lesser + * General Public License, version 2.1, also as published by the Free + * Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License and the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License + * and the GNU Lesser General Public License along with this program; + * if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +package org.rhq.plugins.jbosscache; + +import org.rhq.core.domain.measurement.AvailabilityType; +import org.rhq.core.pluginapi.inventory.ResourceComponent; +import org.rhq.core.pluginapi.inventory.ResourceContext; + +/** + * Resource component that deals with JGroups channels + * + * @author Heiko W. Rupp + */ +public class JGroupsChannelComponent implements ResourceComponent<JBossCacheComponent> { + + ResourceContext<JBossCacheComponent> context; + + /** + * This one does not (yet) have an availability of its own, but just follows the + * JBossCache instance it is associated with. + * @see org.rhq.core.pluginapi.inventory.ResourceComponent#getAvailability() + */ + public AvailabilityType getAvailability() { + return context.getParentResourceComponent().getAvailability(); + } + + /* (non-Javadoc) + * @see org.rhq.core.pluginapi.inventory.ResourceComponent#start(org.rhq.core.pluginapi.inventory.ResourceContext) + */ + public void start(ResourceContext<JBossCacheComponent> context) throws Exception { + // TODO Auto-generated method stub + this.context = context; + + } + + /* (non-Javadoc) + * @see org.rhq.core.pluginapi.inventory.ResourceComponent#stop() + */ + public void stop() { + // TODO Auto-generated method stub + + } + +} diff --git a/modules/plugins/jboss-cache/src/main/java/org/rhq/plugins/jbosscache/JGroupsChannelDiscovery.java b/modules/plugins/jboss-cache/src/main/java/org/rhq/plugins/jbosscache/JGroupsChannelDiscovery.java new file mode 100644 index 0000000..ccfb985 --- /dev/null +++ b/modules/plugins/jboss-cache/src/main/java/org/rhq/plugins/jbosscache/JGroupsChannelDiscovery.java @@ -0,0 +1,143 @@ +/* + * Jopr Management Platform + * Copyright (C) 2005-2008 Red Hat, Inc. + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License, version 2, as + * published by the Free Software Foundation, and/or the GNU Lesser + * General Public License, version 2.1, also as published by the Free + * Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License and the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License + * and the GNU Lesser General Public License along with this program; + * if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +package org.rhq.plugins.jbosscache; + +import java.io.File; +import java.io.IOException; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +import javax.management.MalformedObjectNameException; +import javax.management.ObjectName; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.jdom.Document; +import org.jdom.Element; +import org.jdom.JDOMException; +import org.jdom.input.SAXBuilder; +import org.mc4j.ems.connection.EmsConnection; + +import org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails; +import org.rhq.core.pluginapi.inventory.InvalidPluginConfigurationException; +import org.rhq.core.pluginapi.inventory.ResourceDiscoveryComponent; +import org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext; +import org.rhq.plugins.jbossas.util.DeploymentUtility; + +/** + * This component will discover JGroups channels within a JBoss Cache instance. + * The deal here is that we want to have zero or one JGroups channels per cache. + * We will look at the Cache config and see if it contains a + * <attribute name="ClusterConfig"> element. If so, we return a JGroups instance, + * else we return nothing. + * + * @author Heiko W. Rupp + */ +public class JGroupsChannelDiscovery implements ResourceDiscoveryComponent { + + private final Log log = LogFactory.getLog(JGroupsChannelDiscovery.class); + + /* (non-Javadoc) + * @see org.rhq.core.pluginapi.inventory.ResourceDiscoveryComponent#discoverResources(org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext) + */ + public Set<DiscoveredResourceDetails> discoverResources(ResourceDiscoveryContext context) + throws InvalidPluginConfigurationException, Exception { + + JBossCacheComponent parent = (JBossCacheComponent) context.getParentResourceComponent(); + EmsConnection emsConnection = parent.getEmsConnection(); + String resKey = context.getParentResourceContext().getResourceKey(); + File file = DeploymentUtility.getDescriptorFile(emsConnection, resKey); + if (file == null) { + log.warn("File is null for " + resKey); + return null; + } + + boolean found = false; + try { + SAXBuilder builder = new SAXBuilder(); + Document doc = builder.build(file); + + // Get the root element + Element root = doc.getRootElement(); + + // XPath xpath = XPathFactory.newInstance().newXPath(); + // TODO this expression would need to work against non-normalized versions of the name attribute + // XPathExpression xp = xpath + // .compile("/server/mbean[@name='" + resKey + "']/attribute[@name='ClusterConfig']"); + // InputSource inputSource = new InputSource(new FileInputStream(file)); + // NodeList cconfig = (NodeList) xp.evaluate(inputSource, XPathConstants.NODESET); + // if (cconfig != null && cconfig.getLength() > 0) + // found = true; + + // First look for the right mbean of *our* cache - the file may contain more than one + + // TODO move code in helper, as we'll need it later again + // TODO replace the access of 'our' ClusterConfig attribute with an XPath expression + for (Object mbeanObj : root.getChildren("mbean")) { + if (mbeanObj instanceof Element) { + Element mbean = (Element) mbeanObj; + String nameAttrib = mbean.getAttributeValue("name"); + try { + ObjectName on = new ObjectName(nameAttrib); + nameAttrib = on.getCanonicalName(); + } catch (MalformedObjectNameException e) { + log.warn("Can't canonicalize " + nameAttrib); + } + if (nameAttrib.equals(resKey)) { + // our cache instance, look for the right attribute + List children = mbean.getChildren("attribute"); + for (Object childObj : children) { + if (childObj instanceof Element) { + Element child = (Element) childObj; + String name = child.getAttributeValue("name"); + if (name.equals("ClusterConfig")) + found = true; + } + } + } + } + } + } catch (IOException e) { + log.error("IO error occurred while reading file: " + file, e); + } catch (JDOMException e) { + log.error("Parsing error occurred while reading file: " + file, e); + } + + if (found) { + DiscoveredResourceDetails detail = new DiscoveredResourceDetails(context.getResourceType(), // Resource Type + resKey + "jgroupsChannel", // ResourceKey TODO good choice ? + "JGroups channel", // resource name + null, // Version + "JGroups config for parent JBossCache", // description + context.getDefaultPluginConfiguration(), // config + null); // process info + Set<DiscoveredResourceDetails> res = new HashSet<DiscoveredResourceDetails>(1); + res.add(detail); + return res; + } + + return null; + } + +} diff --git a/modules/plugins/jboss-cache/src/main/java/org/rhq/plugins/jbosscache/JGroupsRepoComponent.java b/modules/plugins/jboss-cache/src/main/java/org/rhq/plugins/jbosscache/JGroupsRepoComponent.java deleted file mode 100644 index 85375ac..0000000 --- a/modules/plugins/jboss-cache/src/main/java/org/rhq/plugins/jbosscache/JGroupsRepoComponent.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Jopr Management Platform - * Copyright (C) 2005-2008 Red Hat, Inc. - * All rights reserved. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License, version 2, as - * published by the Free Software Foundation, and/or the GNU Lesser - * General Public License, version 2.1, also as published by the Free - * Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License and the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License - * and the GNU Lesser General Public License along with this program; - * if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -package org.rhq.plugins.jbosscache; - -import org.rhq.core.domain.measurement.AvailabilityType; -import org.rhq.core.pluginapi.inventory.ResourceComponent; -import org.rhq.core.pluginapi.inventory.ResourceContext; - -/** - * Resource component that deals with JGroups repos - * - * @author Heiko W. Rupp - */ -public class JGroupsRepoComponent implements ResourceComponent<JBossCacheComponent> { - - ResourceContext<JBossCacheComponent> context; - - /** - * This one does not (yet) have an availability of its own, but just follows the - * JBossCache instance it is associated with. - * @see org.rhq.core.pluginapi.inventory.ResourceComponent#getAvailability() - */ - public AvailabilityType getAvailability() { - return context.getParentResourceComponent().getAvailability(); - } - - /* (non-Javadoc) - * @see org.rhq.core.pluginapi.inventory.ResourceComponent#start(org.rhq.core.pluginapi.inventory.ResourceContext) - */ - public void start(ResourceContext<JBossCacheComponent> context) throws Exception { - // TODO Auto-generated method stub - this.context = context; - - } - - /* (non-Javadoc) - * @see org.rhq.core.pluginapi.inventory.ResourceComponent#stop() - */ - public void stop() { - // TODO Auto-generated method stub - - } - -} diff --git a/modules/plugins/jboss-cache/src/main/java/org/rhq/plugins/jbosscache/JGroupsRepoDiscovery.java b/modules/plugins/jboss-cache/src/main/java/org/rhq/plugins/jbosscache/JGroupsRepoDiscovery.java deleted file mode 100644 index 3436aa1..0000000 --- a/modules/plugins/jboss-cache/src/main/java/org/rhq/plugins/jbosscache/JGroupsRepoDiscovery.java +++ /dev/null @@ -1,143 +0,0 @@ -/* - * Jopr Management Platform - * Copyright (C) 2005-2008 Red Hat, Inc. - * All rights reserved. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License, version 2, as - * published by the Free Software Foundation, and/or the GNU Lesser - * General Public License, version 2.1, also as published by the Free - * Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License and the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License - * and the GNU Lesser General Public License along with this program; - * if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -package org.rhq.plugins.jbosscache; - -import java.io.File; -import java.io.IOException; -import java.util.HashSet; -import java.util.List; -import java.util.Set; - -import javax.management.MalformedObjectNameException; -import javax.management.ObjectName; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.jdom.Document; -import org.jdom.Element; -import org.jdom.JDOMException; -import org.jdom.input.SAXBuilder; -import org.mc4j.ems.connection.EmsConnection; - -import org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails; -import org.rhq.core.pluginapi.inventory.InvalidPluginConfigurationException; -import org.rhq.core.pluginapi.inventory.ResourceDiscoveryComponent; -import org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext; -import org.rhq.plugins.jbossas.util.DeploymentUtility; - -/** - * This component will discover JGroups repos within a JBoss Cache instance. - * The deal here is that we want to have zero or one JGroups repos per cache. - * We will look at the Cache config and see if it contains a - * <attribute name="ClusterConfig"> element. If so, we return a JGroups instance, - * else we return nothing. - * - * @author Heiko W. Rupp - */ -public class JGroupsRepoDiscovery implements ResourceDiscoveryComponent { - - private final Log log = LogFactory.getLog(JGroupsRepoDiscovery.class); - - /* (non-Javadoc) - * @see org.rhq.core.pluginapi.inventory.ResourceDiscoveryComponent#discoverResources(org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext) - */ - public Set<DiscoveredResourceDetails> discoverResources(ResourceDiscoveryContext context) - throws InvalidPluginConfigurationException, Exception { - - JBossCacheComponent parent = (JBossCacheComponent) context.getParentResourceComponent(); - EmsConnection emsConnection = parent.getEmsConnection(); - String resKey = context.getParentResourceContext().getResourceKey(); - File file = DeploymentUtility.getDescriptorFile(emsConnection, resKey); - if (file == null) { - log.warn("File is null for " + resKey); - return null; - } - - boolean found = false; - try { - SAXBuilder builder = new SAXBuilder(); - Document doc = builder.build(file); - - // Get the root element - Element root = doc.getRootElement(); - - // XPath xpath = XPathFactory.newInstance().newXPath(); - // TODO this expression would need to work against non-normalized versions of the name attribute - // XPathExpression xp = xpath - // .compile("/server/mbean[@name='" + resKey + "']/attribute[@name='ClusterConfig']"); - // InputSource inputSource = new InputSource(new FileInputStream(file)); - // NodeList cconfig = (NodeList) xp.evaluate(inputSource, XPathConstants.NODESET); - // if (cconfig != null && cconfig.getLength() > 0) - // found = true; - - // First look for the right mbean of *our* cache - the file may contain more than one - - // TODO move code in helper, as we'll need it later again - // TODO replace the access of 'our' ClusterConfig attribute with an XPath expression - for (Object mbeanObj : root.getChildren("mbean")) { - if (mbeanObj instanceof Element) { - Element mbean = (Element) mbeanObj; - String nameAttrib = mbean.getAttributeValue("name"); - try { - ObjectName on = new ObjectName(nameAttrib); - nameAttrib = on.getCanonicalName(); - } catch (MalformedObjectNameException e) { - log.warn("Can't canonicalize " + nameAttrib); - } - if (nameAttrib.equals(resKey)) { - // our cache instance, look for the right attribute - List children = mbean.getChildren("attribute"); - for (Object childObj : children) { - if (childObj instanceof Element) { - Element child = (Element) childObj; - String name = child.getAttributeValue("name"); - if (name.equals("ClusterConfig")) - found = true; - } - } - } - } - } - } catch (IOException e) { - log.error("IO error occurred while reading file: " + file, e); - } catch (JDOMException e) { - log.error("Parsing error occurred while reading file: " + file, e); - } - - if (found) { - DiscoveredResourceDetails detail = new DiscoveredResourceDetails(context.getResourceType(), // Resource Type - resKey + "jgroupsRepo", // ResourceKey TODO good choice ? - "JGroups repo", // resource name - null, // Version - "JGroups config for parent JBossCache", // description - context.getDefaultPluginConfiguration(), // config - null); // process info - Set<DiscoveredResourceDetails> res = new HashSet<DiscoveredResourceDetails>(1); - res.add(detail); - return res; - } - - return null; - } - -} diff --git a/modules/plugins/jboss-cache/src/main/resources/META-INF/rhq-plugin.xml b/modules/plugins/jboss-cache/src/main/resources/META-INF/rhq-plugin.xml index fe28e78..2ef0f4f 100644 --- a/modules/plugins/jboss-cache/src/main/resources/META-INF/rhq-plugin.xml +++ b/modules/plugins/jboss-cache/src/main/resources/META-INF/rhq-plugin.xml @@ -16,8 +16,8 @@ discovery="JBossCacheSubsystemDiscovery" description="The JBoss Cache instances on this server" singleton="true" - > - + > + <runs-inside> <parent-resource-type name="JBossAS Server" plugin="JBossAS"/> </runs-inside> @@ -28,28 +28,28 @@ description="Statistics for JBossCache" createDeletePolicy="create-only" > - + <plugin-configuration> <c:simple-property name="objectName" readOnly="true" default="*:cache-interceptor=CacheMgmtInterceptor,*|*:treecache-interceptor=CacheMgmtInterceptor,*"/> <c:simple-property name="isTreeCache" readOnly="true" type="boolean" default="false" description="Is this a TreeCache instance or a POJO Cache"/> </plugin-configuration> - + <operation name="resetStatistics" displayName="Reset Statistics" description="Resets all statistics" /> <operation name="listAssociatedMBeans" displayName="List associated MBeans" description="List all MBeans that form this Cache instance"> <results><c:simple-property name="mbeans"></c:simple-property></results> </operation> - + <metric property=":numberOfNodes" displayName="Number of Nodes" displayType="summary" /> - - <metric property="ActivationInterceptor:activations" displayName="Activations" + + <metric property="ActivationInterceptor:activations" displayName="Activations" description="Number of passivated nodes that have been activated."/> - - <metric property="CacheLoaderInterceptor:cacheLoaderLoads" displayName="Cache Loader Loads" + + <metric property="CacheLoaderInterceptor:cacheLoaderLoads" displayName="Cache Loader Loads" measurementType="trendsup" description="Number of nodes loaded through a cache loader."/> <metric property="CacheLoaderInterceptor:cacheLoaderMisses" displayName="Cache Loader Misses" measurementType="trendsup" description="Number of unsuccessful attempts to load a node through a cache loader."/> - - <metric property="CacheMgmtInterceptor:hits" displayName="Cache Hits" category="performance" + + <metric property="CacheMgmtInterceptor:hits" displayName="Cache Hits" category="performance" measurementType="trendsup" description="Number of successful attribute retrievals."/> <metric property="CacheMgmtInterceptor:misses" displayName="Cache Misses" category="performance" measurementType="trendsup" description="Number of unsuccessful attribute retrievals."/> @@ -57,44 +57,44 @@ description="Ratio of hits to hits and misses. A hit is a get attribute operation that results in an object being returned to the client. The retrieval may be from a cache loader if the entry isn't in the local cache."/> <metric property="CacheMgmtInterceptor:readWriteRatio" displayName="Read-write-ratio" displayType="summary" description="Ratio of read operations to write operations. This is the ratio of cache hits and misses to cache stores."/> - <metric property="CacheMgmtInterceptor:stores" displayName="Cache Stores" category="performance" + <metric property="CacheMgmtInterceptor:stores" displayName="Cache Stores" category="performance" measurementType="trendsup" description="Number of attribute store operations."/> - <metric property="CacheMgmtInterceptor:evictions" displayName="Cache Evictions" category="performance" + <metric property="CacheMgmtInterceptor:evictions" displayName="Cache Evictions" category="performance" measurementType="trendsup" description="Number of node evictions."/> - <metric property="CacheMgmtInterceptor:numberOfAttributes" displayName="Number of Attributes" + <metric property="CacheMgmtInterceptor:numberOfAttributes" displayName="Number of Attributes" category="performance" description="Number of attributes currently cached." /> - <metric property="CacheMgmtInterceptor:numberOfNodes" displayName="Number of Nodes cached" + <metric property="CacheMgmtInterceptor:numberOfNodes" displayName="Number of Nodes cached" category="performance" description="Number of nodes currently cached."/> - <metric property="CacheMgmtInterceptor:elapsedTime" displayName="Elapsed Time" category="utilization" - measurementType="trendsup" description="Number of seconds that the cache has been running." + <metric property="CacheMgmtInterceptor:elapsedTime" displayName="Elapsed Time" category="utilization" + measurementType="trendsup" description="Number of seconds that the cache has been running." units="seconds"/> - <metric property="CacheMgmtInterceptor:timeSinceReset" displayName="Time since reset" category="utilization" - measurementType="trendsup" description="Number of seconds since the cache statistics have been reset." + <metric property="CacheMgmtInterceptor:timeSinceReset" displayName="Time since reset" category="utilization" + measurementType="trendsup" description="Number of seconds since the cache statistics have been reset." units="seconds"/> - <metric property="CacheMgmtInterceptor:averageReadTime" displayName="Average Read Time" category="performance" - description="Average time in milliseconds to retrieve a cache attribute, including unsuccessful attribute retrievals." + <metric property="CacheMgmtInterceptor:averageReadTime" displayName="Average Read Time" category="performance" + description="Average time in milliseconds to retrieve a cache attribute, including unsuccessful attribute retrievals." units="milliseconds"/> - <metric property="CacheMgmtInterceptor:averageWriteTime" displayName="Average Write Time" - category="performance" description="Average time in milliseconds to write a cache attribute." + <metric property="CacheMgmtInterceptor:averageWriteTime" displayName="Average Write Time" + category="performance" description="Average time in milliseconds to write a cache attribute." units="milliseconds"/> - - <metric property="CacheStoreInterceptor:cacheLoaderStores" displayName="Cache Loader Stores" + + <metric property="CacheStoreInterceptor:cacheLoaderStores" displayName="Cache Loader Stores" category="utilization" description="Number of nodes written to the cache loader." measurementType="trendsup" /> - - <metric property="InvalidationInterceptor:invalidations" displayName="Invalidataions" - category="utilization" description="Number of cached nodes that have been invalidated." + + <metric property="InvalidationInterceptor:invalidations" displayName="Invalidataions" + category="utilization" description="Number of cached nodes that have been invalidated." measurementType="trendsup" /> - - <metric property="PassivationInterceptor:passivations" displayName="Passivations" category="utilization" + + <metric property="PassivationInterceptor:passivations" displayName="Passivations" category="utilization" description="Number of cached nodes that have been passivated." measurementType="trendsup"/> - - <metric property="TxInterceptor:prepares" displayName="Tx prepares" - description="Number of transaction prepare operations performed." measurementType="trendsup" /> - <metric property="TxInterceptor:commits" displayName="Tx commits" - description="Number of transaction commit operations performed." measurementType="trendsup" /> - <metric property="TxInterceptor:rollbacks" displayName="Tx rollbacks" - description="Number of transaction rollback operations performed." measurementType="trendsup" /> - + + <metric property="TxInterceptor:prepares" displayName="Tx prepares" + description="Number of transaction prepare operations performed." measurementType="trendsup" /> + <metric property="TxInterceptor:commits" displayName="Tx commits" + description="Number of transaction commit operations performed." measurementType="trendsup" /> + <metric property="TxInterceptor:rollbacks" displayName="Tx rollbacks" + description="Number of transaction rollback operations performed." measurementType="trendsup" /> + <resource-configuration> <c:simple-property name="Flavour" default="treecache" description="Is this going to be a Pojo Cache or a Tree Cache"> @@ -103,7 +103,7 @@ <c:option name="Tree Cache" value="treecache" default="true"/> </c:property-options> </c:simple-property> - <c:simple-property name="TransactionManagerLookupClass" + <c:simple-property name="TransactionManagerLookupClass" default="org.jboss.cache.JBossTransactionManagerLookup" description="What class should be used to get a transaction manager instance"/> <c:simple-property name="IsolationLevel" default="REPEATABLE_READ" @@ -132,39 +132,39 @@ <c:simple-property name="UseReplQueue" type="boolean" default="false" description="Just used for async repl: use a replication queue "/> <c:simple-property name="ReplQueueInterval" type="integer" default="100" - description="Replication interval for replication queue (in ms) "/> + description="Replication interval for replication queue (in ms) "/> <c:simple-property name="ReplQueueMaxElements" type="integer" default="10" description="Max number of elements which trigger replication" /> <c:simple-property name="ClusterName" default="DefaultPartition" description="Name of cluster. Needs to be the same for all clusters, in order to find each other"/> - - <c:simple-property name="FetchStateOnStartup" type="boolean" default="true" + + <c:simple-property name="FetchStateOnStartup" type="boolean" default="true" description="Whether or not to fetch state on joining a cluster"/> - <c:simple-property name="InitialStateRetrievalTimeout" type="long" + <c:simple-property name="InitialStateRetrievalTimeout" type="long" description=" The max amount of time (in milliseconds) we wait until the initial state (ie. the contents of the cache) are retrieved from - existing members in a clustered environment" default="5000"/> + existing members in a clustered environment" default="5000"/> <c:simple-property name="SyncReplTimeout" type="long" default="15000" description="Number of milliseconds to wait until all responses for a synchronous call have been received."/> <c:simple-property name="LockAcquisitionTimeout" type="long" default="10000" description="Max number of milliseconds to wait for a lock acquisition."/> - + </resource-configuration> <help> <![CDATA[ - <p>Please note that the number of possible metrics varies depending on the configuration and flavour of + <p>Please note that the number of possible metrics varies depending on the configuration and flavour of Cache used.</p> ]]> </help> - - <service name="JGroupsRepo" - description="The underlying JGroups repo for this cache instance" - class="JGroupsRepoComponent" - discovery="JGroupsRepoDiscovery"> + + <service name="JGroupsChannel" + description="The underlying JGroups channel for this cache instance" + class="JGroupsChannelComponent" + discovery="JGroupsChannelDiscovery"> </service> </service> - + </server> - + </plugin> \ No newline at end of file
commit 22aba8e0ae4db5d976807ceaa1e051f0a9e92771 Author: Joseph Marques joseph@redhat.com Date: Thu Jul 22 01:23:35 2010 -0400
add the ability to sort the ResourceGroupCriteria object by plugin name
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/ResourceGroupCriteria.java b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/ResourceGroupCriteria.java index 67a66a9..7544422 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/ResourceGroupCriteria.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/ResourceGroupCriteria.java @@ -67,6 +67,7 @@ public class ResourceGroupCriteria extends TaggedCriteria {
private PageOrdering sortName; private PageOrdering sortResourceTypeName; // requires overrides + private PageOrdering sortPluginName; // requires overrides
public ResourceGroupCriteria() { filterOverrides.put("resourceTypeId", "resourceType.id = ?"); @@ -110,7 +111,7 @@ public class ResourceGroupCriteria extends TaggedCriteria { filterOverrides.put("groupDefinitionId", "groupDefinition.id = ?");
sortOverrides.put("resourceTypeName", "resourceType.name"); - + sortOverrides.put("pluginName", "resourceType.plugin"); }
@Override @@ -238,6 +239,11 @@ public class ResourceGroupCriteria extends TaggedCriteria { this.sortResourceTypeName = sortResourceTypeName; }
+ public void addSortPluginName(PageOrdering sortPluginName) { + addSortField("pluginName"); + this.sortPluginName = sortPluginName; + } + /** subclasses should override as necessary */ @Override public boolean isSecurityManagerRequired() {
commit 26c62395c00fd7917693a3a103298428f2f1c86e Author: Joseph Marques joseph@redhat.com Date: Thu Jul 22 01:23:18 2010 -0400
BZ-616634: support criteria-based sorting by nullable path expressions
* for each ordering token, decide whether it's a path expression * if it is, determine if it has at least 3 parts (criteriaAlias + path + leaf) * if it does, add left join for part that precedes the leaf, and generate an alias for this path ** only add the join clause if it doesn't already exist in the generated query * finally, add the order by clause, with the generated path aliases as necessary
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/CriteriaQueryGenerator.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/CriteriaQueryGenerator.java index 6c43b46..3216ec7 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/CriteriaQueryGenerator.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/CriteriaQueryGenerator.java @@ -42,6 +42,7 @@ import org.rhq.core.domain.authz.Permission; import org.rhq.core.domain.criteria.AlertCriteria; import org.rhq.core.domain.criteria.Criteria; import org.rhq.core.domain.criteria.ResourceCriteria; +import org.rhq.core.domain.criteria.ResourceGroupCriteria; import org.rhq.core.domain.criteria.ResourceOperationHistoryCriteria; import org.rhq.core.domain.criteria.SubjectCriteria; import org.rhq.core.domain.operation.OperationRequestStatus; @@ -321,6 +322,58 @@ public final class CriteriaQueryGenerator { results.append(authorizationJoinFragment); }
+ // figure out the 'LEFT JOIN's needed for 'ORDER BY' tokens + PageControl pc = getPageControl(criteria); + List<String> orderingFieldRequiredJoins = new ArrayList<String>(); + List<String> orderingFieldTokens = new ArrayList<String>(); + + for (OrderingField orderingField : pc.getOrderingFields()) { + PageOrdering ordering = orderingField.getOrdering(); + String fieldName = orderingField.getField(); + String override = criteria.getJPQLSortOverride(fieldName); + String suffix = (override == null) ? fieldName : override; + + /* + * do not prefix the alias when: + * + * 1) if the suffix is numerical, which allows usto sort by column ordinal + * 2) if the user wants full control and has explicitly chosen to disable alias prepending + */ + boolean doNotPrefixAlias = isNumber(suffix) || criteria.hasCustomizedSorting(); + String sortFragment = doNotPrefixAlias ? suffix : (alias + "." + suffix); + + int lastDelimiterIndex = sortFragment.lastIndexOf('.'); + if (lastDelimiterIndex == -1) { + // does not require joins, just add the ordering field token directly + orderingFieldTokens.add(sortFragment + " " + ordering); + continue; + } + + int firstDelimiterIndex = sortFragment.indexOf('.'); + if (firstDelimiterIndex == lastDelimiterIndex) { + // only one dot implies its a property/field directly off of the primary alias + // thus, also does not require joins, just add the ordering field token directly + orderingFieldTokens.add(sortFragment + " " + ordering); + continue; + } + + String expressionRoot = sortFragment.substring(0, lastDelimiterIndex); + String expressionLeaf = sortFragment.substring(lastDelimiterIndex + 1); + int expressionRootIndex = orderingFieldRequiredJoins.indexOf(expressionRoot); + + String joinAlias = null; + if (expressionRootIndex == -1) { + // new join + joinAlias = "orderingField" + orderingFieldRequiredJoins.size(); + orderingFieldRequiredJoins.add(expressionRoot); + results.append("LEFT JOIN ").append(expressionRoot).append(" ").append(joinAlias).append(NL); + } else { + joinAlias = "orderingField" + expressionRootIndex; + } + + orderingFieldTokens.add(joinAlias + "." + expressionLeaf + " " + ordering); + } + Map<String, Object> filterFields = getFilterFields(criteria); if (filterFields.size() > 0 || authorizationJoinFragment != null || searchExpressionWhereClause != null) { results.append("WHERE "); @@ -410,36 +463,19 @@ public final class CriteriaQueryGenerator { results.append(NL).append("HAVING ").append(havingClause); }
- // order by clause - PageControl pc = getPageControl(criteria); - + // ordering clause boolean first = true; - for (OrderingField orderingField : pc.getOrderingFields()) { + for (String next : orderingFieldTokens) { if (first) { results.append(NL).append("ORDER BY "); first = false; } else { results.append(", "); } - - String fieldName = orderingField.getField(); - String override = criteria.getJPQLSortOverride(fieldName); - String suffix = (override == null) ? fieldName : override; - - /* - * do not prefix the alias when: - * - * 1) if the suffix is numerical, which allows usto sort by column ordinal - * 2) if the user wants full control and has explicitly chosen to disable alias prepending - */ - boolean doNotPrefixAlias = isNumber(suffix) || criteria.hasCustomizedSorting(); - String sortFragment = doNotPrefixAlias ? suffix : (alias + "." + suffix); - - PageOrdering ordering = orderingField.getOrdering(); - - results.append(sortFragment).append(' ').append(ordering); + results.append(next); } } + results.append(NL);
LOG.debug(results); @@ -532,8 +568,8 @@ public final class CriteriaQueryGenerator {
try { Class<?> entityClass = criteria.getPersistentClass(); - SearchTranslationManager searchManager = new SearchTranslationManager(subject, SearchSubsystem - .get(entityClass)); + SearchTranslationManager searchManager = new SearchTranslationManager(subject, + SearchSubsystem.get(entityClass)); searchManager.setExpression(searchExpression);
// translate first, if there was an error we won't add the dangling 'AND' to the where clause @@ -696,7 +732,8 @@ public final class CriteriaQueryGenerator { //testSubjectCriteria(); //testAlertCriteria(); //testInheritanceCriteria(); - testResourceCriteria(); + //testResourceCriteria(); + testResourceGroupCriteria(); }
public static void testSubjectCriteria() { @@ -747,6 +784,26 @@ public final class CriteriaQueryGenerator { System.out.println(generator.getQueryString(true)); }
+ public static void testResourceGroupCriteria() { + ResourceGroupCriteria groupCriteria = new ResourceGroupCriteria(); + groupCriteria.addSortName(PageOrdering.DESC); + groupCriteria.addSortResourceTypeName(PageOrdering.ASC); + groupCriteria.addSortPluginName(PageOrdering.DESC); + + CriteriaQueryGenerator generator = new CriteriaQueryGenerator(new Subject(), groupCriteria); + System.out.println(generator.getQueryString(false)); + System.out.println(generator.getQueryString(true)); + + PageControl customPC = new PageControl(); + customPC.addDefaultOrderingField("0", PageOrdering.DESC); + customPC.addDefaultOrderingField("name", PageOrdering.DESC); + customPC.addDefaultOrderingField("resourceType.name", PageOrdering.ASC); + groupCriteria.setPageControl(customPC); + + System.out.println(generator.getQueryString(false)); + System.out.println(generator.getQueryString(true)); + } + public static void testResourceCriteria() { ResourceCriteria resourceCriteria = new ResourceCriteria(); resourceCriteria.addFilterResourceCategory(ResourceCategory.SERVER); @@ -758,8 +815,8 @@ public final class CriteriaQueryGenerator {
Subject overlord = LookupUtil.getSubjectManager().getOverlord(); CriteriaQueryGenerator generator = new CriteriaQueryGenerator(overlord, resourceCriteria); - generator.getQueryString(false); - generator.getQueryString(true); + System.out.println(generator.getQueryString(false)); + System.out.println(generator.getQueryString(true)); }
public static PageControl getPageControl(Criteria criteria) {
commit feb80e3201b76fdb3464515d7cf75dd3057155f4 Author: Joseph Marques joseph@redhat.com Date: Wed Jul 21 19:16:06 2010 -0400
fix compiler error concerning type erasure
* the following two methods had the same erasure ** locateProperty(List<Property>, String) ** locateProperty(List<PropertySimple>, String) * renamed the second method to 'locatePropertySimple' * updating calling paths to use new method name
diff --git a/modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/WsConfigurationManagerTest.java b/modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/WsConfigurationManagerTest.java index 7c80417..1384498 100644 --- a/modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/WsConfigurationManagerTest.java +++ b/modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/WsConfigurationManagerTest.java @@ -80,11 +80,11 @@ public class WsConfigurationManagerTest extends AssertJUnit implements TestPrope // Test get configuration Configuration configRetrieved = WEBSERVICE_REMOTE.getConfiguration( // JaxbConfiguration configRetrieved = - // WEBSERVICE_REMOTE.getConfiguration( + // WEBSERVICE_REMOTE.getConfiguration( subject, configuration.getId()); assertNotNull("Configuration was not located.", configRetrieved); - assertEquals("Configuration information was not correct.", configuration.getVersion(), configRetrieved - .getVersion()); + assertEquals("Configuration information was not correct.", configuration.getVersion(), + configRetrieved.getVersion());
boolean isUpdating = WEBSERVICE_REMOTE.isResourceConfigurationUpdateInProgress(subject, resource.getId()); assertFalse("Config should not be in process of modification.", isUpdating); @@ -93,7 +93,7 @@ public class WsConfigurationManagerTest extends AssertJUnit implements TestPrope // Configuration pluginConfig = WEBSERVICE_REMOTE.getPluginConfiguration( WsConfiguration pluginConfig = WEBSERVICE_REMOTE.getPluginConfiguration( // JaxbConfiguration pluginConfig = - // WEBSERVICE_REMOTE.getPluginConfiguration( + // WEBSERVICE_REMOTE.getPluginConfiguration( subject, resource.getId()); assertNotNull("Configuration was not located.", configRetrieved); assertNotNull("The property definition map should not be null.", pluginConfig.getProperties()); @@ -143,7 +143,7 @@ public class WsConfigurationManagerTest extends AssertJUnit implements TestPrope return located; }
- private PropertySimple locateProperty(List<PropertySimple> properties, String name) { + private PropertySimple locatePropertySimple(List<PropertySimple> properties, String name) { PropertySimple located = null; if ((properties != null) && (name != null) && (name.trim().length() > 0)) { // List<Entry> list = properties.getEntry(); @@ -159,7 +159,7 @@ public class WsConfigurationManagerTest extends AssertJUnit implements TestPrope }
private PropertySimple getSimple(List<PropertySimple> list, String name) { - Property property = locateProperty(list, name); + Property property = locatePropertySimple(list, name); return (PropertySimple) property; }
commit a107fd99796ca3ad2d997516a947755d92554289 Author: Joseph Marques joseph@redhat.com Date: Wed Jul 21 19:11:33 2010 -0400
update .classpath file to the latest project dependencies defined by poms
diff --git a/.classpath b/.classpath index a3d9d09..ac5cafd 100644 --- a/.classpath +++ b/.classpath @@ -157,7 +157,7 @@ <accessrule kind="accessible" pattern="com/sun/org/apache/bcel/internal/generic/**"/> </accessrules> </classpathentry> - <classpathentry exported="true" kind="var" path="M2_REPO/i18nlog/i18nlog/1.0.9/i18nlog-1.0.9.jar"/> + <classpathentry exported="true" kind="var" path="M2_REPO/i18nlog/i18nlog/1.0.10/i18nlog-1.0.10.jar"/> <classpathentry exported="true" kind="var" path="M2_REPO/gnu-getopt/getopt/1.0.13/getopt-1.0.13.jar"/> <classpathentry exported="true" kind="var" path="M2_REPO/commons-httpclient/commons-httpclient/3.0.1/commons-httpclient-3.0.1.jar"/> <classpathentry exported="true" kind="var" path="M2_REPO/jboss/jboss-remoting/2.2.2.SP8/jboss-remoting-2.2.2.SP8.jar"/> @@ -202,14 +202,14 @@ <classpathentry exported="true" kind="var" path="M2_REPO/com/sun/facelets/jsf-facelets/1.1.15.B1/jsf-facelets-1.1.15.B1.jar" sourcepath="/M2_REPO/com/sun/facelets/jsf-facelets/1.1.15.B1/jsf-facelets-1.1.15.B1-sources.jar"/> <classpathentry exported="true" kind="var" path="M2_REPO/mc4j/org-mc4j-ems/1.2.11/org-mc4j-ems-1.2.11.jar" sourcepath="/M2_REPO/mc4j/org-mc4j-ems/1.2.11/org-mc4j-ems-1.2.11-sources.jar"/> <classpathentry exported="true" kind="var" path="M2_REPO/org/opensymphony/quartz/quartz/1.6.5/quartz-1.6.5.jar" sourcepath="/M2_REPO/org/opensymphony/quartz/quartz/1.6.5/quartz-1.6.5-sources.jar"/> - <classpathentry exported="true" kind="var" path="M2_REPO/javax/mail/mail/1.3.1/mail-1.3.1.jar"/> + <classpathentry exported="true" kind="var" path="M2_REPO/javax/mail/mail/1.4.2/mail-1.4.2.jar"/> <classpathentry exported="true" kind="var" path="M2_REPO/commons-fileupload/commons-fileupload/1.2/commons-fileupload-1.2.jar"/> <classpathentry exported="true" kind="var" path="M2_REPO/org/richfaces/framework/richfaces-api/3.3.2.SR1/richfaces-api-3.3.2.SR1.jar" sourcepath="/M2_REPO/org/richfaces/framework/richfaces-api/3.1.3.GA/richfaces-api-3.1.3.GA-sources.jar"/> <classpathentry exported="true" kind="var" path="M2_REPO/org/richfaces/framework/richfaces-impl/3.3.2.SR1/richfaces-impl-3.3.2.SR1.jar" sourcepath="/M2_REPO/org/richfaces/framework/richfaces-impl/3.3.0.GA/richfaces-impl-3.3.0.GA-sources.jar"/> <classpathentry exported="true" kind="var" path="M2_REPO/org/richfaces/ui/richfaces-ui/3.3.2.SR1/richfaces-ui-3.3.2.SR1.jar" sourcepath="/M2_REPO/org/richfaces/ui/richfaces-ui/3.3.0.GA/richfaces-ui-3.3.0.GA-sources.jar"/> <classpathentry exported="true" kind="var" path="M2_REPO/postgresql/postgresql/8.4-701.jdbc3/postgresql-8.4-701.jdbc3.jar"/> <classpathentry exported="true" kind="var" path="M2_REPO/jboss/jboss-cache/1.4.1.SP9/jboss-cache-1.4.1.SP9.jar"/> - <classpathentry exported="true" kind="var" path="M2_REPO/org/hyperic/sigar/1.6.3.82/sigar-1.6.3.82.jar" sourcepath="/M2_REPO/org/hyperic/sigar/1.6.3.82/sigar-1.6.3.82-sources.jar"/> + <classpathentry exported="true" kind="var" path="M2_REPO/org/hyperic/sigar/1.6.5.132/sigar-1.6.5.132.jar" sourcepath="/M2_REPO/org/hyperic/sigar/1.6.3.82/sigar-1.6.3.82-sources.jar"/> <classpathentry exported="true" kind="var" path="M2_REPO/org/jboss/transaction/jboss-jta/4.2.3.SP5/jboss-jta-4.2.3.SP5.jar"/> <classpathentry exported="true" kind="var" path="M2_REPO/org/jboss/transaction/jboss-jts-common/4.2.3.SP5/jboss-jts-common-4.2.3.SP5.jar"/> <classpathentry exported="true" kind="var" path="M2_REPO/org/jboss/jbossws-spi/1.1.1.GA/jbossws-spi-1.1.1.GA.jar"/> @@ -218,7 +218,7 @@ <classpathentry exported="true" kind="var" path="M2_REPO/org/apache/maven/maven-plugin-api/2.0.8/maven-plugin-api-2.0.8.jar"/> <classpathentry exported="true" kind="var" path="M2_REPO/org/codehaus/swizzle/swizzle-confluence/1.2.Alpha1/swizzle-confluence-1.2.Alpha1.jar"/> <classpathentry exported="true" kind="var" path="M2_REPO/org/jvnet/inflector/0.7.0/inflector-0.7.0.jar"/> - <classpathentry exported="true" kind="var" path="M2_REPO/net/augeas/augeas/0.0.1/augeas-0.0.1.jar"/> + <classpathentry exported="true" kind="var" path="M2_REPO/net/augeas/augeas/0.0.2/augeas-0.0.2.jar"/> <classpathentry exported="true" kind="var" path="M2_REPO/org/json/json/20080701/json-20080701.jar"/> <classpathentry exported="true" kind="var" path="M2_REPO/net/java/dev/jna/jna/3.2.2/jna-3.2.2.jar"/> <classpathentry exported="true" kind="var" path="M2_REPO/org/freemarker/freemarker/2.3.11/freemarker-2.3.11.jar"/> @@ -237,12 +237,12 @@ <classpathentry exported="true" kind="var" path="M2_REPO/commons-digester/commons-digester/1.8.1/commons-digester-1.8.1.jar"/> <classpathentry exported="true" kind="var" path="M2_REPO/commons-codec/commons-codec/1.4/commons-codec-1.4.jar"/> <classpathentry exported="true" kind="var" path="M2_REPO/pircbot/pircbot/1.4.2/pircbot-1.4.2.jar"/> - <classpathentry exported="true" kind="var" path="M2_REPO/net/homeip/yusuke/twitter4j/2.0.9/twitter4j-2.0.9.jar"/> + <classpathentry exported="true" kind="var" path="M2_REPO/org/twitter4j/twitter4j-core/2.1.2/twitter4j-core-2.1.2.jar"/> <classpathentry exported="true" kind="var" path="M2_REPO/org/jmock/jmock/2.5.1/jmock-2.5.1.jar"/> <classpathentry exported="true" kind="var" path="M2_REPO/org/hamcrest/hamcrest-core/1.1/hamcrest-core-1.1.jar"/> <classpathentry exported="true" kind="var" path="M2_REPO/org/hamcrest/hamcrest-library/1.1/hamcrest-library-1.1.jar"/> <classpathentry exported="true" kind="var" path="M2_REPO/org/antlr/antlr-runtime/3.2/antlr-runtime-3.2.jar"/> - <classpathentry exported="true" kind="lib" path="modules/enterprise/remoting/webservices/target/rhq-remoting-webservices-3.0.0-SNAPSHOT/wsconsume-output"/> + <classpathentry exported="true" kind="lib" path="modules/enterprise/remoting/webservices/target/rhq-remoting-webservices-4.0.0-SNAPSHOT/wsconsume-output"/> <classpathentry exported="true" kind="var" path="M2_REPO/jboss/web/jbossweb/2.0.1.GA/jbossweb-2.0.1.GA.jar"/> <classpathentry exported="true" kind="var" path="M2_REPO/org/libvirt/libvirt/0.4.1/libvirt-0.4.1.jar"/> <classpathentry exported="true" kind="var" path="M2_REPO/org/jboss/byteman/byteman/1.2.1/byteman-1.2.1.jar"/>
commit d6ba7b1ab1a8fe54e3fa65bbfff0b53181e0c020 Merge: 76bbed4... 09963f3... Author: Jay Shaughnessy jshaughn@redhat.com Date: Wed Jul 21 17:39:06 2010 -0400
Merge branch 'release-3.0.0' into release-3.0.0-work
commit 76bbed4c0d1362c83356f0382cd99700b8c07e41 Author: Jay Shaughnessy jshaughn@redhat.com Date: Wed Jul 21 17:37:20 2010 -0400
[bz 616978] extend transactional timeout to compensate for removal of an obsolete type with a large number of doomed resources.
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/metadata/ResourceMetadataManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/metadata/ResourceMetadataManagerBean.java index 1cc1b44..64e9afd 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/metadata/ResourceMetadataManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/metadata/ResourceMetadataManagerBean.java @@ -49,6 +49,8 @@ import javax.sql.DataSource; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory;
+import org.jboss.annotation.ejb.TransactionTimeout; + import org.rhq.core.clientapi.agent.metadata.PluginDependencyGraph; import org.rhq.core.clientapi.agent.metadata.PluginMetadataManager; import org.rhq.core.clientapi.agent.metadata.SubCategoriesMetadataParser; @@ -429,7 +431,7 @@ public class ResourceMetadataManagerBean implements ResourceMetadataManagerLocal return; }
- private void updateTypes(Set<ResourceType> resourceTypes) throws Exception { + private void updateTypes(Set<ResourceType> resourceTypes) throws Exception { // Only process the type if it is a non-runs-inside type (i.e. not a child of some other type X at this same // level in the type hierarchy). runs-inside types which we skip here will get processed at the next level down // when we recursively process type X's children. @@ -462,8 +464,10 @@ public class ResourceMetadataManagerBean implements ResourceMetadataManagerLocal } }
+ // up timeout to 60 minutes in case of large inventories @SuppressWarnings("unchecked") @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW) + @TransactionTimeout(60 * 60) public void removeObsoleteTypesInNewTransaction(String pluginName) { try { Query query = entityManager.createNamedQuery(ResourceType.QUERY_FIND_BY_PLUGIN); @@ -512,8 +516,7 @@ public class ResourceMetadataManagerBean implements ResourceMetadataManagerLocal }
private void removeResourceTypes(Subject overlord, Set<ResourceType> candidateTypes, - Set<ResourceType> typesToBeRemoved) - throws Exception { + Set<ResourceType> typesToBeRemoved) throws Exception { for (ResourceType candidateType : candidateTypes) { // Remove obsolete descendant types first. Set<ResourceType> childTypes = candidateType.getChildResourceTypes(); @@ -533,7 +536,7 @@ public class ResourceMetadataManagerBean implements ResourceMetadataManagerLocal }
private void removeResourceType(Subject overlord, ResourceType existingType) { - log.info("Removing ResourceType [" + toConciseString(existingType) + "]..."); + log.info("Removing ResourceType [" + toConciseString(existingType) + "]...");
if (entityManager.contains(existingType)) { entityManager.refresh(existingType); @@ -635,8 +638,8 @@ public class ResourceMetadataManagerBean implements ResourceMetadataManagerLocal
ResourceType existingType; try { - existingType = resourceTypeManager.getResourceTypeByNameAndPlugin(resourceType.getName(), - resourceType.getPlugin()); + existingType = resourceTypeManager.getResourceTypeByNameAndPlugin(resourceType.getName(), resourceType + .getPlugin()); } catch (NonUniqueResultException nure) { log.debug("Found more than one existing ResourceType for " + resourceType); // TODO: Delete the redundant ResourceTypes to get the DB into a valid state. @@ -701,8 +704,8 @@ public class ResourceMetadataManagerBean implements ResourceMetadataManagerLocal // above already took care of any modifications to the ResourceSubCategories themselves). } else if (newSubCat == null) { if (oldSubCat != null) { - log.debug("Metadata update: Subcategory of ResourceType [" + resourceType.getName() - + "] changed from " + oldSubCat + " to " + newSubCat); + log.debug("Metadata update: Subcategory of ResourceType [" + resourceType.getName() + "] changed from " + + oldSubCat + " to " + newSubCat); existingType.setSubCategory(null); } } else { @@ -762,14 +765,14 @@ public class ResourceMetadataManagerBean implements ResourceMetadataManagerLocal if (log.isDebugEnabled()) { if (existingType != null) { log.debug("Setting parent types on existing type: " + existingType + " to [" - + newType.getParentResourceTypes() + "] - current parent types are [" - + existingType.getParentResourceTypes() + "]..."); + + newType.getParentResourceTypes() + "] - current parent types are [" + + existingType.getParentResourceTypes() + "]..."); } else { - log.debug("Setting parent types on new type: " + newType - + " to [" + newType.getParentResourceTypes() + "]..."); + log.debug("Setting parent types on new type: " + newType + " to [" + newType.getParentResourceTypes() + + "]..."); } } - + Set<ResourceType> newParentTypes = newType.getParentResourceTypes(); newType.setParentResourceTypes(new HashSet<ResourceType>()); Set<ResourceType> originalExistingParentTypes = new HashSet<ResourceType>(); @@ -778,7 +781,7 @@ public class ResourceMetadataManagerBean implements ResourceMetadataManagerLocal } for (ResourceType newParentType : newParentTypes) { try { - boolean isExistingParent = originalExistingParentTypes.remove(newParentType); + boolean isExistingParent = originalExistingParentTypes.remove(newParentType); if (existingType == null || !isExistingParent) { ResourceType realParentType = (ResourceType) entityManager.createNamedQuery( ResourceType.QUERY_FIND_BY_NAME_AND_PLUGIN).setParameter("name", newParentType.getName()) @@ -786,19 +789,19 @@ public class ResourceMetadataManagerBean implements ResourceMetadataManagerLocal ResourceType type = (existingType != null) ? existingType : newType; if (existingType != null) { log.info("Adding ResourceType [" + toConciseString(type) + "] as child of ResourceType [" - + toConciseString(realParentType) + "]..."); + + toConciseString(realParentType) + "]..."); } realParentType.addChildResourceType(type); } } catch (NoResultException nre) { - throw new RuntimeException("Couldn't persist type [" + newType - + "] because parent [" + newParentType + "] wasn't already persisted."); + throw new RuntimeException("Couldn't persist type [" + newType + "] because parent [" + newParentType + + "] wasn't already persisted."); } }
for (ResourceType obsoleteParentType : originalExistingParentTypes) { log.info("Removing type [" + toConciseString(existingType) + "] from parent type [" - + toConciseString(obsoleteParentType) + "]..."); + + toConciseString(obsoleteParentType) + "]..."); obsoleteParentType.removeChildResourceType(existingType); moveResourcesToNewParent(existingType, obsoleteParentType, newParentTypes); } @@ -810,7 +813,8 @@ public class ResourceMetadataManagerBean implements ResourceMetadataManagerLocal return (type != null) ? (type.getPlugin() + ":" + type.getName() + "(id=" + type.getId() + ")") : "null"; }
- private void moveResourcesToNewParent(ResourceType existingType, ResourceType obsoleteParentType, Set<ResourceType> newParentTypes) { + private void moveResourcesToNewParent(ResourceType existingType, ResourceType obsoleteParentType, + Set<ResourceType> newParentTypes) { Subject overlord = subjectManager.getOverlord(); ResourceCriteria criteria = new ResourceCriteria(); criteria.addFilterResourceTypeId(existingType.getId()); @@ -818,8 +822,7 @@ public class ResourceMetadataManagerBean implements ResourceMetadataManagerLocal List<Resource> resources = resourceManager.findResourcesByCriteria(overlord, criteria); for (Resource resource : resources) { Resource newParent = null; - newParentTypes: - for (ResourceType newParentType : newParentTypes) { + newParentTypes: for (ResourceType newParentType : newParentTypes) { Resource ancestorResource = resource.getParentResource(); while (ancestorResource != null) { if (ancestorResource.getResourceType().equals(newParentType)) { @@ -846,7 +849,7 @@ public class ResourceMetadataManagerBean implements ResourceMetadataManagerLocal newParent.addChildResource(resource); } else { log.debug("We were unable to move " + resource + " from invalid parent " + resource.getParentResource() - + " to a new valid parent with one of the following types: " + newParentTypes); + + " to a new valid parent with one of the following types: " + newParentTypes); } } }
commit 09963f393cdfd19d2a54d9b6985259a22aa4ecac Author: John Mazzitelli mazz@redhat.com Date: Wed Jul 21 17:34:03 2010 -0400
BZ 614886 three things one, change view check to CONFIG_READ check for resource two, change view check to *group* CONFIG_READ check three, remove getConfiguration from remote interface
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationManagerBean.java index 99e2d5a..a691bd1 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationManagerBean.java @@ -272,7 +272,7 @@ public class ConfigurationManagerBean implements ConfigurationManagerLocal, Conf throw new NoResultException("Cannot get live configuration for unknown resource [" + resourceId + "]"); }
- if (!authorizationManager.canViewResource(subject, resource.getId())) { + if (!authorizationManager.hasResourcePermission(subject, Permission.CONFIGURE_READ, resource.getId())) { throw new PermissionException("User [" + subject.getName() + "] does not have permission to view resource configuration for [" + resource + "]"); } @@ -1980,7 +1980,7 @@ public class ConfigurationManagerBean implements ConfigurationManagerLocal, Conf GroupResourceConfigurationUpdate update = getGroupResourceConfigurationById(configurationUpdateId);
int groupId = update.getGroup().getId(); - if (authorizationManager.canViewGroup(subject, groupId) == false) { + if (authorizationManager.hasGroupPermission(subject, Permission.CONFIGURE_READ, groupId) == false) { throw new PermissionException("User[" + subject.getName() + "] does not have permission to view group resourceConfiguration[id=" + configurationUpdateId + "]"); } diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationManagerLocal.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationManagerLocal.java index 4242153..6a1c114 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationManagerLocal.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationManagerLocal.java @@ -381,6 +381,8 @@ public interface ConfigurationManagerLocal { */ void checkForTimedOutConfigurationUpdateRequests();
+ public Configuration getConfiguration(Subject subject, int configurationId); + // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! // // The following are shared with the Remote Interface @@ -392,8 +394,6 @@ public interface ConfigurationManagerLocal { public GroupResourceConfigurationUpdate getGroupResourceConfigurationUpdate(Subject subject, int configurationUpdateId);
- public Configuration getConfiguration(Subject subject, int configurationId); - /** * Get the current plugin configuration for the {@link Resource} with the given id, or <code>null</code> if the * resource's plugin configuration is not yet initialized. diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationManagerRemote.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationManagerRemote.java index b25fa9d..b4836c6 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationManagerRemote.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationManagerRemote.java @@ -65,11 +65,6 @@ public interface ConfigurationManagerRemote { @WebParam(name = "subject") Subject subject, // @WebParam(name = "configurationUpdateId") int configurationUpdateId);
- @WebMethod - Configuration getConfiguration( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "configurationId") int configurationId); - /** * Get the current plugin configuration for the {@link Resource} with the given id, or <code>null</code> if the * resource's plugin configuration is not yet initialized.
commit 55ee9efc60ff941d8e838430e8ee9dfe1387174c Merge: f31dda5... 9b1dd9c... Author: Jay Shaughnessy jshaughn@redhat.com Date: Wed Jul 21 17:12:08 2010 -0400
Merge branch 'master' into master-jay
commit f31dda5fb516089f0cb3847699ed8bbc64f6dabf Author: Jay Shaughnessy jshaughn@redhat.com Date: Wed Jul 21 17:07:14 2010 -0400
[bz 616978] remove umbrella transaction from removal of obsolete types, allowing more flexible type removal for large inventories.
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/ResourceType.java b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/ResourceType.java index dbf95c7..8218909 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/ResourceType.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/ResourceType.java @@ -52,7 +52,6 @@ import javax.persistence.OneToOne; import javax.persistence.OrderBy; import javax.persistence.PrePersist; import javax.persistence.PreUpdate; -import javax.persistence.QueryHint; import javax.persistence.SequenceGenerator; import javax.persistence.SqlResultSetMapping; import javax.persistence.Table; @@ -90,11 +89,8 @@ import org.rhq.core.domain.util.Summary; query = "SELECT rt FROM ResourceType AS rt WHERE :parent MEMBER OF rt.parentResourceTypes AND rt.name = :name"),
/* authz'ed queries for ResourceTypeManagerBean */ - @NamedQuery(name = ResourceType.QUERY_FIND_CHILDREN, query = "SELECT res.resourceType " - + "FROM Resource res, IN (res.implicitGroups) g, IN (g.roles) r, IN (r.subjects) s " + "WHERE s = :subject " - + "AND res.parentResource = :parent"), - @NamedQuery(name = ResourceType.QUERY_FIND_CHILDREN_admin, query = "SELECT res.resourceType " - + "FROM Resource res " + "WHERE res.parentResource = :parent"), + @NamedQuery(name = ResourceType.QUERY_FIND_CHILDREN, query = "SELECT rt.childResourceTypes " + + "FROM ResourceType rt WHERE rt.id = :resourceTypeId "), @NamedQuery(name = ResourceType.FIND_CHILDREN_BY_PARENT, query = "SELECT DISTINCT rt FROM ResourceType AS rt " + "JOIN FETCH rt.parentResourceTypes AS pa " + // also fetch parents, as we need them later "WHERE pa IN (:resourceType)"), @@ -251,7 +247,6 @@ public class ResourceType implements Serializable, Comparable<ResourceType> { public static final String QUERY_FIND_BY_ID_WITH_ALL_OPERATIONS = "ResourceType.findByIdWithAllOperations"; public static final String QUERY_FIND_BY_CATEGORY = "ResourceType.findByCategory"; public static final String QUERY_FIND_CHILDREN = "ResourceType.findChildren"; - public static final String QUERY_FIND_CHILDREN_admin = "ResourceType.findChildren_admin"; /** find child resource types for resource :parentResource and category :category */ public static final String QUERY_FIND_CHILDREN_BY_CATEGORY = "ResourceType.findChildrenByCategory"; public static final String QUERY_FIND_CHILDREN_BY_CATEGORY_admin = "ResourceType.findChildrenByCategory_admin"; @@ -322,8 +317,7 @@ public class ResourceType implements Serializable, Comparable<ResourceType> {
@ManyToMany(cascade = CascadeType.PERSIST) // persist so self-injecting plugins work - @JoinTable(name = "RHQ_RESOURCE_TYPE_PARENTS", joinColumns = { @JoinColumn(name = "RESOURCE_TYPE_ID") }, - inverseJoinColumns = { @JoinColumn(name = "PARENT_RESOURCE_TYPE_ID") }) + @JoinTable(name = "RHQ_RESOURCE_TYPE_PARENTS", joinColumns = { @JoinColumn(name = "RESOURCE_TYPE_ID") }, inverseJoinColumns = { @JoinColumn(name = "PARENT_RESOURCE_TYPE_ID") }) @OrderBy //@Cache(usage = CacheConcurrencyStrategy.TRANSACTIONAL) private Set<ResourceType> parentResourceTypes; @@ -818,87 +812,86 @@ public class ResourceType implements Serializable, Comparable<ResourceType> { + this.plugin + /*", parents=" + parents +*/"]"; }
+ /* + TODO: GWT + public void writeExternal(ObjectOutput out) throws IOException { + ExternalizableStrategy.Subsystem strategy = ExternalizableStrategy.getStrategy(); + out.writeChar(strategy.id());
-/* -TODO: GWT - public void writeExternal(ObjectOutput out) throws IOException { - ExternalizableStrategy.Subsystem strategy = ExternalizableStrategy.getStrategy(); - out.writeChar(strategy.id()); - - if (ExternalizableStrategy.Subsystem.REMOTEAPI == strategy) { - writeExternalRemote(out); - } else if (ExternalizableStrategy.Subsystem.REFLECTIVE_SERIALIZATION == strategy) { - EntitySerializer.writeExternalRemote(this, out); - } else { - writeExternalAgent(out); + if (ExternalizableStrategy.Subsystem.REMOTEAPI == strategy) { + writeExternalRemote(out); + } else if (ExternalizableStrategy.Subsystem.REFLECTIVE_SERIALIZATION == strategy) { + EntitySerializer.writeExternalRemote(this, out); + } else { + writeExternalAgent(out); + } } - }
- public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { - char c = in.readChar(); - if (ExternalizableStrategy.Subsystem.REMOTEAPI.id() == c) { - readExternalRemote(in); - } else if (ExternalizableStrategy.Subsystem.REFLECTIVE_SERIALIZATION.id() == c) { - EntitySerializer.readExternalRemote(this, in); - } else { - readExternalAgent(in); + public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { + char c = in.readChar(); + if (ExternalizableStrategy.Subsystem.REMOTEAPI.id() == c) { + readExternalRemote(in); + } else if (ExternalizableStrategy.Subsystem.REFLECTIVE_SERIALIZATION.id() == c) { + EntitySerializer.readExternalRemote(this, in); + } else { + readExternalAgent(in); + } + } + + public void writeExternalAgent(ObjectOutput out) throws IOException { + out.writeUTF(this.name); + out.writeUTF(this.plugin); + } + + public void readExternalAgent(ObjectInput in) throws IOException, ClassNotFoundException { + this.name = in.readUTF(); + this.plugin = in.readUTF(); } - }
- public void writeExternalAgent(ObjectOutput out) throws IOException { - out.writeUTF(this.name); - out.writeUTF(this.plugin); - } - - public void readExternalAgent(ObjectInput in) throws IOException, ClassNotFoundException { - this.name = in.readUTF(); - this.plugin = in.readUTF(); - } - - public void writeExternalRemote(ObjectOutput out) throws IOException { - out.writeInt(this.id); - out.writeUTF(this.name); - out.writeUTF((null == this.description) ? "" : this.description); - out.writeObject(this.category); - out.writeObject(this.creationDataType); - out.writeObject(this.createDeletePolicy); - out.writeBoolean(this.supportsManualAdd); - out.writeBoolean(this.singleton); - out.writeUTF(this.plugin); - out.writeLong(this.ctime); - out.writeLong(this.mtime); - out.writeObject(this.subCategory); - out.writeObject(this.bundleType); - out.writeObject((null == childResourceTypes) ? null : new LinkedHashSet<ResourceType>(childResourceTypes)); - out.writeObject((null == parentResourceTypes) ? null : new LinkedHashSet<ResourceType>(parentResourceTypes)); - out.writeObject(pluginConfigurationDefinition); - out.writeObject(resourceConfigurationDefinition); - out.writeObject((null == metricDefinitions) ? null - : new LinkedHashSet<MeasurementDefinition>(metricDefinitions)); - out.writeObject((null == eventDefinitions) ? null : new LinkedHashSet<EventDefinition>(eventDefinitions)); - out.writeObject((null == operationDefinitions) ? null : new LinkedHashSet<OperationDefinition>( - operationDefinitions)); - out.writeObject((null == processScans) ? null : new LinkedHashSet<ProcessScan>(processScans)); - out.writeObject((null == packageTypes) ? null : new LinkedHashSet<PackageType>(packageTypes)); - out.writeObject((null == subCategories) ? null : new LinkedHashSet<ResourceSubCategory>(subCategories)); - out.writeObject((null == resources) ? null : new LinkedHashSet<Resource>(resources)); - out.writeObject((null == productVersions) ? null : new LinkedHashSet<ProductVersion>(productVersions)); - // not supplied by remote: helpText - } - - public void readExternalRemote(ObjectInput in) throws IOException, ClassNotFoundException { - this.id = in.readInt(); - this.name = in.readUTF(); - this.description = in.readUTF(); - this.category = (ResourceCategory) in.readObject(); - this.creationDataType = (ResourceCreationDataType) in.readObject(); - this.createDeletePolicy = (CreateDeletePolicy) in.readObject(); - this.supportsManualAdd = in.readBoolean(); - this.singleton = in.readBoolean(); - this.plugin = in.readUTF(); - this.ctime = in.readLong(); - this.mtime = in.readLong(); - } -*/ + public void writeExternalRemote(ObjectOutput out) throws IOException { + out.writeInt(this.id); + out.writeUTF(this.name); + out.writeUTF((null == this.description) ? "" : this.description); + out.writeObject(this.category); + out.writeObject(this.creationDataType); + out.writeObject(this.createDeletePolicy); + out.writeBoolean(this.supportsManualAdd); + out.writeBoolean(this.singleton); + out.writeUTF(this.plugin); + out.writeLong(this.ctime); + out.writeLong(this.mtime); + out.writeObject(this.subCategory); + out.writeObject(this.bundleType); + out.writeObject((null == childResourceTypes) ? null : new LinkedHashSet<ResourceType>(childResourceTypes)); + out.writeObject((null == parentResourceTypes) ? null : new LinkedHashSet<ResourceType>(parentResourceTypes)); + out.writeObject(pluginConfigurationDefinition); + out.writeObject(resourceConfigurationDefinition); + out.writeObject((null == metricDefinitions) ? null + : new LinkedHashSet<MeasurementDefinition>(metricDefinitions)); + out.writeObject((null == eventDefinitions) ? null : new LinkedHashSet<EventDefinition>(eventDefinitions)); + out.writeObject((null == operationDefinitions) ? null : new LinkedHashSet<OperationDefinition>( + operationDefinitions)); + out.writeObject((null == processScans) ? null : new LinkedHashSet<ProcessScan>(processScans)); + out.writeObject((null == packageTypes) ? null : new LinkedHashSet<PackageType>(packageTypes)); + out.writeObject((null == subCategories) ? null : new LinkedHashSet<ResourceSubCategory>(subCategories)); + out.writeObject((null == resources) ? null : new LinkedHashSet<Resource>(resources)); + out.writeObject((null == productVersions) ? null : new LinkedHashSet<ProductVersion>(productVersions)); + // not supplied by remote: helpText + } + + public void readExternalRemote(ObjectInput in) throws IOException, ClassNotFoundException { + this.id = in.readInt(); + this.name = in.readUTF(); + this.description = in.readUTF(); + this.category = (ResourceCategory) in.readObject(); + this.creationDataType = (ResourceCreationDataType) in.readObject(); + this.createDeletePolicy = (CreateDeletePolicy) in.readObject(); + this.supportsManualAdd = in.readBoolean(); + this.singleton = in.readBoolean(); + this.plugin = in.readUTF(); + this.ctime = in.readLong(); + this.mtime = in.readLong(); + } + */
} diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceTypeManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceTypeManagerBean.java index 7589096..a2a6ece 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceTypeManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceTypeManagerBean.java @@ -113,14 +113,8 @@ public class ResourceTypeManagerBean implements ResourceTypeManagerLocal, Resour public List<ResourceType> getChildResourceTypes(Subject subject, ResourceType parent) { Query query = null;
- if (authorizationManager.isInventoryManager(subject)) { - query = entityManager.createNamedQuery(ResourceType.QUERY_FIND_CHILDREN_admin); - } else { - query = entityManager.createNamedQuery(ResourceType.QUERY_FIND_CHILDREN); - query.setParameter("subject", subject); - } - - query.setParameter("parent", parent); + query = entityManager.createNamedQuery(ResourceType.QUERY_FIND_CHILDREN); + query.setParameter("resourceTypeId", parent.getId());
List<ResourceType> results = query.getResultList(); return results; diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/metadata/ResourceMetadataManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/metadata/ResourceMetadataManagerBean.java index 1cc1b44..a136561 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/metadata/ResourceMetadataManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/metadata/ResourceMetadataManagerBean.java @@ -284,26 +284,29 @@ public class ResourceMetadataManagerBean implements ResourceMetadataManagerLocal return results; }
+ // Start with no transaction so we can control the transactional boundaries. This is important for a + // few reasons. Registering the plugin and removing obsolete types are perfromed in different, subsequent, + // transactions. The register may update types, and that locks various rows of the database. Those rows + // must be unlocked before obsolete type removal. Type removal executes (resource) bulk delete under the covers, + // and that will deadlock with the rows locked by the type update (at least in oracle) if performed in the same + // transaction. Furthermore, as mentioned, obsolete type removal removes resources of the obsolete type. We + // need to avoid an umbrella transaction for the type removal because large inventories of obsolete resources + // will generate very large transactions. Potentially resulting in timeouts or other issues. @RequiredPermission(Permission.MANAGE_SETTINGS) - public void registerPlugin(Subject whoami, Plugin plugin, PluginDescriptor pluginDescriptor, File pluginFile, + @TransactionAttribute(TransactionAttributeType.NEVER) + public void registerPlugin(Subject subject, Plugin plugin, PluginDescriptor pluginDescriptor, File pluginFile, boolean forceUpdate) throws Exception {
- // Registering the plugin is performed in a new transaction in order to allow the removal - // of obsolete types, in a subsequent transaction. The register may update types, and that - // locks various rows of the database. Those rows must be unlocked before type removal. Type - // removal executes (resource) bulk delete under the covers, in another new trans, and that - // trans will will deadlock with the rows locked by the type update (at least in oracle) if that - // transaction has not been committed. - boolean typesUpdated = resourceMetadataManager.registerPluginInNewTransaction(whoami, plugin, pluginDescriptor, + boolean typesUpdated = resourceMetadataManager.registerPluginTypes(subject, plugin, pluginDescriptor, pluginFile, forceUpdate);
if (typesUpdated) { - resourceMetadataManager.removeObsoleteTypesInNewTransaction(plugin.getName()); + removeObsoleteTypes(subject, plugin.getName()); } }
- @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW) - public boolean registerPluginInNewTransaction(Subject whoami, Plugin plugin, PluginDescriptor pluginDescriptor, + @RequiredPermission(Permission.MANAGE_SETTINGS) + public boolean registerPluginTypes(Subject subject, Plugin plugin, PluginDescriptor pluginDescriptor, File pluginFile, boolean forceUpdate) throws Exception {
// TODO GH: Consider how to remove features from plugins in updates without breaking everything @@ -429,7 +432,7 @@ public class ResourceMetadataManagerBean implements ResourceMetadataManagerLocal return; }
- private void updateTypes(Set<ResourceType> resourceTypes) throws Exception { + private void updateTypes(Set<ResourceType> resourceTypes) throws Exception { // Only process the type if it is a non-runs-inside type (i.e. not a child of some other type X at this same // level in the type hierarchy). runs-inside types which we skip here will get processed at the next level down // when we recursively process type X's children. @@ -462,18 +465,56 @@ public class ResourceMetadataManagerBean implements ResourceMetadataManagerLocal } }
+ // NO TRANSACTION SHOULD BE ACTIVE ON ENTRY + // Start with no transaction so we can control the transactional boundaries. Obsolete type removal removes + // resources of the obsolete type. We need to avoid an umbrella transaction for the type removal because large + // inventories of obsolete resources will generate very large transactions. Potentially resulting in timeouts + // or other issues. + private void removeObsoleteTypes(Subject subject, String pluginName) { + + Set<ResourceType> obsoleteTypes = new HashSet<ResourceType>(); + Set<ResourceType> legitTypes = new HashSet<ResourceType>(); + + try { + resourceMetadataManager.getPluginTypes(subject, pluginName, legitTypes, obsoleteTypes); + + if (!obsoleteTypes.isEmpty()) { + // TODO: Log this at DEBUG instead. + log.info("Removing " + obsoleteTypes.size() + " obsolete types: " + obsoleteTypes + "..."); + removeResourceTypes(subject, obsoleteTypes, new HashSet<ResourceType>(obsoleteTypes)); + } + + // Now it's safe to remove any obsolete subcategories on the legit types. + for (ResourceType legitType : legitTypes) { + ResourceType updateType = PLUGIN_METADATA_MANAGER.getType(legitType.getName(), legitType.getPlugin()); + + // If we've got a type from the descriptor which matches an existing one, + // then let's see if we need to remove any subcategories from the existing one. + if (updateType != null) { + try { + resourceMetadataManager.removeObsoleteSubCategories(subject, updateType, legitType); + } catch (Exception e) { + throw new Exception("Failed to delete obsolete subcategories from " + legitType + ".", e); + } + } + } + } catch (Exception e) { + // Catch all exceptions, so a failure here does not cause the outer tx to rollback. + log.error("Failure during removal of obsolete ResourceTypes and Subcategories.", e); + } + } + + @RequiredPermission(Permission.MANAGE_SETTINGS) @SuppressWarnings("unchecked") - @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW) - public void removeObsoleteTypesInNewTransaction(String pluginName) { + public void getPluginTypes(Subject subject, String pluginName, Set<ResourceType> legitTypes, + Set<ResourceType> obsoleteTypes) { try { Query query = entityManager.createNamedQuery(ResourceType.QUERY_FIND_BY_PLUGIN); query.setParameter("plugin", pluginName); List<ResourceType> existingTypes = query.getResultList();
if (existingTypes != null) { - Set<ResourceType> obsoleteTypes = new HashSet<ResourceType>(); - Set<ResourceType> legitTypes = new HashSet<ResourceType>(); - Subject overlord = subjectManager.getOverlord(); + for (ResourceType existingType : existingTypes) { if (PLUGIN_METADATA_MANAGER.getType(existingType.getName(), existingType.getPlugin()) == null) { // The type is obsolete - (i.e. it's no longer defined by the plugin). @@ -482,28 +523,6 @@ public class ResourceMetadataManagerBean implements ResourceMetadataManagerLocal legitTypes.add(existingType); } } - - if (!obsoleteTypes.isEmpty()) { - // TODO: Log this at DEBUG instead. - log.info("Removing " + obsoleteTypes.size() + " obsolete types: " + obsoleteTypes + "..."); - removeResourceTypes(overlord, obsoleteTypes, new HashSet<ResourceType>(obsoleteTypes)); - } - - // Now it's safe to remove any obsolete subcategories on the legit types. - for (ResourceType legitType : legitTypes) { - ResourceType updateType = PLUGIN_METADATA_MANAGER.getType(legitType.getName(), legitType - .getPlugin()); - - // If we've got a type from the descriptor which matches an existing one, - // then let's see if we need to remove any subcategories from the existing one. - if (updateType != null) { - try { - removeObsoleteSubCategories(updateType, legitType); - } catch (Exception e) { - throw new Exception("Failed to delete obsolete subcategories from " + legitType + ".", e); - } - } - } } } catch (Exception e) { // Catch all exceptions, so a failure here does not cause the outer tx to rollback. @@ -511,19 +530,20 @@ public class ResourceMetadataManagerBean implements ResourceMetadataManagerLocal } }
- private void removeResourceTypes(Subject overlord, Set<ResourceType> candidateTypes, - Set<ResourceType> typesToBeRemoved) - throws Exception { + // NO TRANSACTION SHOULD BE ACTIVE ON ENTRY + private void removeResourceTypes(Subject subject, Set<ResourceType> candidateTypes, + Set<ResourceType> typesToBeRemoved) throws Exception { for (ResourceType candidateType : candidateTypes) { // Remove obsolete descendant types first. - Set<ResourceType> childTypes = candidateType.getChildResourceTypes(); + //Set<ResourceType> childTypes = candidateType.getChildResourceTypes(); + List<ResourceType> childTypes = resourceTypeManager.getChildResourceTypes(subject, candidateType); if (childTypes != null && !childTypes.isEmpty()) { // Wrap child types in new HashSet to avoid ConcurrentModificationExceptions. - removeResourceTypes(overlord, new HashSet<ResourceType>(childTypes), typesToBeRemoved); + removeResourceTypes(subject, new HashSet<ResourceType>(childTypes), typesToBeRemoved); } if (typesToBeRemoved.contains(candidateType)) { try { - removeResourceType(overlord, candidateType); + removeResourceType(subject, candidateType); } catch (Exception e) { throw new Exception("Failed to remove " + candidateType + ".", e); } @@ -532,35 +552,44 @@ public class ResourceMetadataManagerBean implements ResourceMetadataManagerLocal } }
- private void removeResourceType(Subject overlord, ResourceType existingType) { - log.info("Removing ResourceType [" + toConciseString(existingType) + "]..."); - - if (entityManager.contains(existingType)) { - entityManager.refresh(existingType); - } - - // Completely remove the type from the type hierarchy. - removeFromParents(existingType); - removeFromChildren(existingType); - entityManager.merge(existingType); + // NO TRANSACTION SHOULD BE ACTIVE ON ENTRY + private void removeResourceType(Subject subject, ResourceType existingType) { + log.info("Removing ResourceType [" + toConciseString(existingType) + "]...");
// Remove all Resources that are of the type. - List<Resource> resources = existingType.getResources(); + ResourceCriteria c = new ResourceCriteria(); + c.addFilterResourceTypeId(existingType.getId()); + List<Resource> resources = resourceManager.findResourcesByCriteria(subject, c); if (resources != null) { Iterator<Resource> resIter = resources.iterator(); while (resIter.hasNext()) { Resource res = resIter.next(); - List<Integer> deletedIds = resourceManager.uninventoryResource(overlord, res.getId()); + List<Integer> deletedIds = resourceManager.uninventoryResource(subject, res.getId()); // do this out of band because the current transaction is locking rows that due to // updates that may need to get deleted. If you do it here the NewTrans used below // may deadlock with the current transactions locks. for (Integer deletedResourceId : deletedIds) { - resourceManager.uninventoryResourceAsyncWork(overlord, deletedResourceId); + resourceManager.uninventoryResourceAsyncWork(subject, deletedResourceId); } resIter.remove(); } } - entityManager.flush(); + + resourceMetadataManager.completeRemoveResourceType(subject, existingType); + } + + @RequiredPermission(Permission.MANAGE_SETTINGS) + public void completeRemoveResourceType(Subject subject, ResourceType existingType) { + existingType = entityManager.find(ResourceType.class, existingType.getId()); + + if (entityManager.contains(existingType)) { + entityManager.refresh(existingType); + } + + // Completely remove the type from the type hierarchy. + removeFromParents(existingType); + removeFromChildren(existingType); + entityManager.merge(existingType);
// Remove all compatible groups that are of the type. List<ResourceGroup> compatGroups = existingType.getResourceGroups(); @@ -569,7 +598,7 @@ public class ResourceMetadataManagerBean implements ResourceMetadataManagerLocal while (compatGroupIterator.hasNext()) { ResourceGroup compatGroup = compatGroupIterator.next(); try { - resourceGroupManager.deleteResourceGroup(overlord, compatGroup.getId()); + resourceGroupManager.deleteResourceGroup(subject, compatGroup.getId()); } catch (ResourceGroupDeleteException e) { throw new RuntimeException(e); } @@ -623,7 +652,6 @@ public class ResourceMetadataManagerBean implements ResourceMetadataManagerLocal } }
- @SuppressWarnings("unchecked") private void updateType(ResourceType resourceType) { entityManager.flush();
@@ -635,8 +663,8 @@ public class ResourceMetadataManagerBean implements ResourceMetadataManagerLocal
ResourceType existingType; try { - existingType = resourceTypeManager.getResourceTypeByNameAndPlugin(resourceType.getName(), - resourceType.getPlugin()); + existingType = resourceTypeManager.getResourceTypeByNameAndPlugin(resourceType.getName(), resourceType + .getPlugin()); } catch (NonUniqueResultException nure) { log.debug("Found more than one existing ResourceType for " + resourceType); // TODO: Delete the redundant ResourceTypes to get the DB into a valid state. @@ -701,8 +729,8 @@ public class ResourceMetadataManagerBean implements ResourceMetadataManagerLocal // above already took care of any modifications to the ResourceSubCategories themselves). } else if (newSubCat == null) { if (oldSubCat != null) { - log.debug("Metadata update: Subcategory of ResourceType [" + resourceType.getName() - + "] changed from " + oldSubCat + " to " + newSubCat); + log.debug("Metadata update: Subcategory of ResourceType [" + resourceType.getName() + "] changed from " + + oldSubCat + " to " + newSubCat); existingType.setSubCategory(null); } } else { @@ -762,14 +790,14 @@ public class ResourceMetadataManagerBean implements ResourceMetadataManagerLocal if (log.isDebugEnabled()) { if (existingType != null) { log.debug("Setting parent types on existing type: " + existingType + " to [" - + newType.getParentResourceTypes() + "] - current parent types are [" - + existingType.getParentResourceTypes() + "]..."); + + newType.getParentResourceTypes() + "] - current parent types are [" + + existingType.getParentResourceTypes() + "]..."); } else { - log.debug("Setting parent types on new type: " + newType - + " to [" + newType.getParentResourceTypes() + "]..."); + log.debug("Setting parent types on new type: " + newType + " to [" + newType.getParentResourceTypes() + + "]..."); } } - + Set<ResourceType> newParentTypes = newType.getParentResourceTypes(); newType.setParentResourceTypes(new HashSet<ResourceType>()); Set<ResourceType> originalExistingParentTypes = new HashSet<ResourceType>(); @@ -778,7 +806,7 @@ public class ResourceMetadataManagerBean implements ResourceMetadataManagerLocal } for (ResourceType newParentType : newParentTypes) { try { - boolean isExistingParent = originalExistingParentTypes.remove(newParentType); + boolean isExistingParent = originalExistingParentTypes.remove(newParentType); if (existingType == null || !isExistingParent) { ResourceType realParentType = (ResourceType) entityManager.createNamedQuery( ResourceType.QUERY_FIND_BY_NAME_AND_PLUGIN).setParameter("name", newParentType.getName()) @@ -786,19 +814,19 @@ public class ResourceMetadataManagerBean implements ResourceMetadataManagerLocal ResourceType type = (existingType != null) ? existingType : newType; if (existingType != null) { log.info("Adding ResourceType [" + toConciseString(type) + "] as child of ResourceType [" - + toConciseString(realParentType) + "]..."); + + toConciseString(realParentType) + "]..."); } realParentType.addChildResourceType(type); } } catch (NoResultException nre) { - throw new RuntimeException("Couldn't persist type [" + newType - + "] because parent [" + newParentType + "] wasn't already persisted."); + throw new RuntimeException("Couldn't persist type [" + newType + "] because parent [" + newParentType + + "] wasn't already persisted."); } }
for (ResourceType obsoleteParentType : originalExistingParentTypes) { log.info("Removing type [" + toConciseString(existingType) + "] from parent type [" - + toConciseString(obsoleteParentType) + "]..."); + + toConciseString(obsoleteParentType) + "]..."); obsoleteParentType.removeChildResourceType(existingType); moveResourcesToNewParent(existingType, obsoleteParentType, newParentTypes); } @@ -810,7 +838,8 @@ public class ResourceMetadataManagerBean implements ResourceMetadataManagerLocal return (type != null) ? (type.getPlugin() + ":" + type.getName() + "(id=" + type.getId() + ")") : "null"; }
- private void moveResourcesToNewParent(ResourceType existingType, ResourceType obsoleteParentType, Set<ResourceType> newParentTypes) { + private void moveResourcesToNewParent(ResourceType existingType, ResourceType obsoleteParentType, + Set<ResourceType> newParentTypes) { Subject overlord = subjectManager.getOverlord(); ResourceCriteria criteria = new ResourceCriteria(); criteria.addFilterResourceTypeId(existingType.getId()); @@ -818,8 +847,7 @@ public class ResourceMetadataManagerBean implements ResourceMetadataManagerLocal List<Resource> resources = resourceManager.findResourcesByCriteria(overlord, criteria); for (Resource resource : resources) { Resource newParent = null; - newParentTypes: - for (ResourceType newParentType : newParentTypes) { + newParentTypes: for (ResourceType newParentType : newParentTypes) { Resource ancestorResource = resource.getParentResource(); while (ancestorResource != null) { if (ancestorResource.getResourceType().equals(newParentType)) { @@ -846,7 +874,7 @@ public class ResourceMetadataManagerBean implements ResourceMetadataManagerLocal newParent.addChildResource(resource); } else { log.debug("We were unable to move " + resource + " from invalid parent " + resource.getParentResource() - + " to a new valid parent with one of the following types: " + newParentTypes); + + " to a new valid parent with one of the following types: " + newParentTypes); } } } @@ -1326,8 +1354,10 @@ public class ResourceMetadataManagerBean implements ResourceMetadataManagerLocal * @param newType new resource type containing updated definitions * @param existingType old resource type with existing definitions */ - private void removeObsoleteSubCategories(ResourceType newType, ResourceType existingType) { + @RequiredPermission(Permission.MANAGE_SETTINGS) + public void removeObsoleteSubCategories(Subject subject, ResourceType newType, ResourceType existingType) { // Remove all definitions that are in the existing type but not in the new type + existingType = entityManager.find(ResourceType.class, existingType.getId()); List<ResourceSubCategory> removedSubCategories = new ArrayList<ResourceSubCategory>(existingType .getChildSubCategories()); removedSubCategories.removeAll(newType.getChildSubCategories()); diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/metadata/ResourceMetadataManagerLocal.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/metadata/ResourceMetadataManagerLocal.java index 683f287..d25f4cf 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/metadata/ResourceMetadataManagerLocal.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/metadata/ResourceMetadataManagerLocal.java @@ -20,6 +20,7 @@ package org.rhq.enterprise.server.resource.metadata;
import java.io.File; import java.util.List; +import java.util.Set;
import javax.ejb.Local; import javax.persistence.NoResultException; @@ -28,6 +29,7 @@ import org.rhq.core.clientapi.descriptor.plugin.PluginDescriptor; import org.rhq.core.domain.auth.Subject; import org.rhq.core.domain.plugin.Plugin; import org.rhq.core.domain.resource.ResourceCategory; +import org.rhq.core.domain.resource.ResourceType;
/** * Provides functionality surrounding agent plugins and their resource metadata. @@ -44,25 +46,6 @@ public interface ResourceMetadataManagerLocal { void setPluginEnabledFlag(Subject subject, int pluginId, boolean enabled) throws Exception;
/** - * For server-side registration of plugin archives. At server startup or as new plugins are runtime deployed the jar - * will have its descriptor read and parsed and the metadata for the plugin will be updated in the db. - * If you provide a non-null <code>pluginFile</code>, and the plugin is deemed to be new or updated, the content - * of the file will be streamed to the database. Note that if you provide a non-null file, you must ensure - * its MD5 matches that of the file (i.e. this method will not attempt to recompute the file's MD5, it will assume - * the caller has already done that and provided the proper MD5 in <code>plugin</code>). - * <br/><br/> - * NOTE ** This call will register the plugin in a new transaction. - * - * @param plugin The plugin object being deployed - * @param metadata The plugin descriptor file - * @param pluginFile the actual plugin file whose content will be stored in the database (will be ignored if null) - * @param forceUpdate if <code>true</code>, the plugin's types will be updated, even if the plugin hasn't changed since - * the last time it was registered - */ - void registerPlugin(Subject whoami, Plugin plugin, PluginDescriptor metadata, File pluginFile, boolean forceUpdate) - throws Exception; - - /** * Returns the list of all plugins deployed in the server. * * @return list of plugins deployed @@ -82,10 +65,36 @@ public interface ResourceMetadataManagerLocal { */ Plugin getPlugin(String name);
- /** Exists only to have code execute within its own transaction. Not for general consumption. */ - boolean registerPluginInNewTransaction(Subject whoami, Plugin plugin, PluginDescriptor pluginDescriptor, - File pluginFile, boolean forceUpdate) throws Exception; + /** + * For server-side registration of plugin archives. At server startup or as new plugins are runtime deployed the jar + * will have its descriptor read and parsed and the metadata for the plugin will be updated in the db. + * If you provide a non-null <code>pluginFile</code>, and the plugin is deemed to be new or updated, the content + * of the file will be streamed to the database. Note that if you provide a non-null file, you must ensure + * its MD5 matches that of the file (i.e. this method will not attempt to recompute the file's MD5, it will assume + * the caller has already done that and provided the proper MD5 in <code>plugin</code>). + * <br/><br/> + * NOTE ** This call will register the plugin in a new transaction. + * + * @param plugin The plugin object being deployed + * @param metadata The plugin descriptor file + * @param pluginFile the actual plugin file whose content will be stored in the database (will be ignored if null) + * @param forceUpdate if <code>true</code>, the plugin's types will be updated, even if the plugin hasn't changed since + * the last time it was registered + */ + void registerPlugin(Subject subject, Plugin plugin, PluginDescriptor metadata, File pluginFile, boolean forceUpdate) + throws Exception; + + /** Exists only to for transactional boundary reasons. Not for general consumption. */ + boolean registerPluginTypes(Subject subject, Plugin plugin, PluginDescriptor pluginDescriptor, File pluginFile, + boolean forceUpdate) throws Exception; + + /** Exists only to for transactional boundary reasons. Not for general consumption. */ + void removeObsoleteSubCategories(Subject subject, ResourceType newType, ResourceType existingType); + + /** Exists only to for transactional boundary reasons. Not for general consumption. */ + void getPluginTypes(Subject subject, String pluginName, Set<ResourceType> legitTypes, + Set<ResourceType> obsoleteTypes);
- /** Exists only to have code execute within its own transaction. Not for general consumption. */ - void removeObsoleteTypesInNewTransaction(String pluginName); + /** Exists only to for transactional boundary reasons. Not for general consumption. */ + void completeRemoveResourceType(Subject subject, ResourceType existingType); } \ No newline at end of file
commit a004880be5d249296f30cbc82306109bd92136bd Author: Joseph Marques joseph@redhat.com Date: Wed Jul 21 11:59:17 2010 -0400
remove ability to sort by type/plugin columns on group browser
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseGroups.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseGroups.xhtml index 87bb3ee..3683968 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseGroups.xhtml +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseGroups.xhtml @@ -150,9 +150,7 @@
rich:column <f:facet name="header"> - <onc:sortableColumnHeader sort="resourceType.name"> - <h:outputText styleClass="headerText" value="Group Type" /> - </onc:sortableColumnHeader> + <h:outputText styleClass="headerText" value="Group Type" /> </f:facet>
<h:outputText value="#{item.resourceGroup.resourceType.name}" /> @@ -160,9 +158,7 @@
rich:column <f:facet name="header"> - <onc:sortableColumnHeader sort="resourceType.plugin"> - <h:outputText styleClass="headerText" value="Plugin" /> - </onc:sortableColumnHeader> + <h:outputText styleClass="headerText" value="Plugin" /> </f:facet>
<h:outputText value="#{item.resourceGroup.resourceType.plugin}" />
commit 9b1dd9c8b9e9ac9c6671c33cc23099aa91abed30 Author: Ian Springer ian.springer@redhat.com Date: Wed Jul 21 11:19:01 2010 -0400
fix merge error
diff --git a/modules/plugins/augeas/pom.xml b/modules/plugins/augeas/pom.xml index 41d0744..cc1edd1 100644 --- a/modules/plugins/augeas/pom.xml +++ b/modules/plugins/augeas/pom.xml @@ -35,12 +35,8 @@ <version>${project.version}</version> </dependency>
-<<<<<<< HEAD - <dependency> -======= <dependency> ->>>>>>> 24133e9ab787bc2cd88bc8b8d13afadd3d4c2f3d - <groupId>commons-io</groupId> + <groupId>commons-io</groupId> <artifactId>commons-io</artifactId> <version>1.4</version> </dependency>
commit bef80e64b048d548f3c46d9e0cec982cd2303fc1 Merge: 3d0764e... 4cdfaf9... Author: Ian Springer ian.springer@redhat.com Date: Wed Jul 21 09:37:20 2010 -0400
Merge branch 'master' of ssh://git.fedorahosted.org/git/rhq/rhq
commit 1d25a6cec3aa71897ad109ddcad0cade752ae289 Author: Joseph Marques joseph@redhat.com Date: Wed Jul 21 01:39:06 2010 -0400
BZ-616661: keep alert notifications sticky to the definitions that defined them
* was incrementing the definitionId counter before persisting the configuration * stop adding leading/trailing ',' to email-based notifications ** this would only occur when multiple notifications were defined for an alert definition ** if an alert definition would only have email-based notifications, the upgrade did not add the extra ','
diff --git a/modules/core/dbutils/src/main/java/org/rhq/core/db/upgrade/CustomAlertSenderUpgradeTask.java b/modules/core/dbutils/src/main/java/org/rhq/core/db/upgrade/CustomAlertSenderUpgradeTask.java index 52713d4..7ddfad2 100644 --- a/modules/core/dbutils/src/main/java/org/rhq/core/db/upgrade/CustomAlertSenderUpgradeTask.java +++ b/modules/core/dbutils/src/main/java/org/rhq/core/db/upgrade/CustomAlertSenderUpgradeTask.java @@ -289,12 +289,14 @@ public class CustomAlertSenderUpgradeTask implements DatabaseUpgradeTask { int nextDefinitionId = ((Number) next[0]).intValue(); String nextData = String.valueOf(next[1]); if (nextDefinitionId != definitionId) { - definitionId = nextDefinitionId; if (buffer.length() != 0) { // buffer will be 0 the very first time, since definitionId is initially -1 - int configId = persistConfiguration(propertyName, delimiter + buffer.toString() + delimiter); + String bufferedData = bufferWithDelimiter ? (delimiter + buffer.toString() + delimiter) : buffer + .toString(); + int configId = persistConfiguration(propertyName, bufferedData); persistNotification(definitionId, configId, sender); } + definitionId = nextDefinitionId; buffer = new StringBuilder(); // reset for the next definitionId }
commit 4cdfaf9e0d6a4fbf56ed8194ffcaa9ae98735c4f Author: John Mazzitelli mazz@redhat.com Date: Tue Jul 20 18:06:01 2010 -0400
have the agent test the failover list that it gets immediately after registration. If all the servers are unreachable, retry the registration again. Do this indefinitely. Also dump a noisy message on the console telling the user what's happening. This will do two things: 1) tell the user they screwed up their server public endpoints and gives them a chance to fix it via the server GUI 2) lets the agent sit and wait for the server(s) to get their new endpoints - once they do, the agent will "wake up" and continue doing its thing -it will re-register, get the new failover list with the new (correct) endpoints and continue normally
diff --git a/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/AgentMain.java b/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/AgentMain.java index b6ccd8b..d1894cb 100644 --- a/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/AgentMain.java +++ b/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/AgentMain.java @@ -36,7 +36,9 @@ import java.io.StreamTokenizer; import java.lang.management.ManagementFactory; import java.lang.reflect.Method; import java.net.InetAddress; +import java.net.Socket; import java.net.URL; +import java.net.UnknownHostException; import java.util.ArrayList; import java.util.Arrays; import java.util.Date; @@ -1273,6 +1275,7 @@ public class AgentMain { int registrationFailures = 0; final int MAX_ALLOWED_REGISTRATION_FAILURES = 5; boolean hide_loopback_warning = Boolean.getBoolean("rhq.hide-agent-localhost-warning"); + boolean hide_failover_list_warning = false;
while (retry) { try { @@ -1303,7 +1306,7 @@ public class AgentMain { LOG.debug(AgentI18NResourceKeys.AGENT_REGISTRATION_ATTEMPT, request);
if (!hide_loopback_warning) { - if (remote_endpoint.contains("localhost") || remote_endpoint.contains("127.0.0.1")) { + if (remote_endpoint.contains("localhost") || remote_endpoint.contains("127.0.0.")) { String msg_id = AgentI18NResourceKeys.REGISTERING_WITH_LOOPBACK; LOG.warn(msg_id, remote_endpoint); getOut().println(MSG.getMsg(msg_id, remote_endpoint)); @@ -1315,15 +1318,36 @@ public class AgentMain { // delete any old token so request is unauthenticated to get server to accept it agent_config.setAgentSecurityToken(null);
- FailoverListComposite failoverList = null; + FailoverListComposite failover_list = null; try { AgentRegistrationResults results = remote_pojo.registerAgent(request); + failover_list = results.getFailoverList(); + + // Try to do a simple connect to each server in the failover list + // If only some of the servers are unreachable, just keep going; + // the agent will eventually switchover to one of the live servers. + // But if all servers in the list are unreachable, we need to keep retrying hoping + // someone fixes the servers' public endpoints so the agent can reach one or more of them. + List<String> failed = testFailoverList(failover_list); + if (failed.size() > 0) { + if (failed.size() == failover_list.size()) { + retry = true; + retry_interval = 30000L; + if (!hide_failover_list_warning) { + String msg_id = AgentI18NResourceKeys.FAILOVER_LIST_CHECK_FAILED; + LOG.warn(msg_id, failed.size(), failed.toString()); + getOut().println(MSG.getMsg(msg_id, failed.size(), failed.toString())); + getOut().println(); + hide_failover_list_warning = true; // don't bother logging more than once + } + continue; // immediately go back and start the retry + } + } + m_registration = results; got_registered = true; retry = false; token = results.getAgentToken(); - failoverList = results.getFailoverList(); - LOG.info(AgentI18NResourceKeys.AGENT_REGISTRATION_RESULTS, results); } finally { // stores the new one if successful; restores the old one if we failed for some reason to register @@ -1333,25 +1357,25 @@ public class AgentMain { LOG.debug(AgentI18NResourceKeys.NEW_SECURITY_TOKEN, token); }
- storeServerFailoverList(failoverList); - m_serverFailoverList = failoverList; + storeServerFailoverList(failover_list); + m_serverFailoverList = failover_list;
// switch away from the registration server and point this agent to the top of the list // - this is our primary server that we should connect to // note that if we are already pointing to the one at the head of the failover list, // we don't have to failover to another server; the current one is the one we already want - if (failoverList.hasNext()) { + if (failover_list.hasNext()) { String currentAddress = agent_config.getServerBindAddress(); int currentPort = agent_config.getServerBindPort(); String currentTransport = agent_config.getServerTransport(); - ServerEntry nextServer = failoverList.peek(); + ServerEntry nextServer = failover_list.peek();
if (currentAddress.equals(nextServer.address) && currentPort == (SecurityUtil.isTransportSecure(currentTransport) ? nextServer.securePort : nextServer.port)) { // we are already pointing to the primary server, so all we have to do is // call next to move the index to the next in the list for when we have to failover in the future - nextServer = failoverList.next(); + nextServer = failover_list.next();
// [mazz] I don't think we need to do this here anymore - with the addition of // the remote communicator's initialize callback, this connect request @@ -2503,6 +2527,51 @@ public class AgentMain { }
/** + * Given a failover list, this makes very rudimentary connection attempts to each server to see if + * this agent can at least reach the server endpoints. If an endpoint cannot be reached, + * a warning is logged. + * + * @param failoverList the list of servers this agent will potentially need to talk to. + * @return the servers that failed to be connected to + */ + private List<String> testFailoverList(FailoverListComposite failoverList) { + List<String> failedServers = new ArrayList<String>(0); + + if (failoverList != null) { + for (int i = 0; i < failoverList.size(); i++) { + ServerEntry server = failoverList.get(i); + Socket socket = null; + try { + socket = new Socket(server.address, server.port); + } catch (UnknownHostException e) { + LOG.error(AgentI18NResourceKeys.FAILOVER_LIST_UNKNOWN_HOST, server.address); + } catch (IOException e) { + try { + socket = new Socket(server.address, server.securePort); + } catch (UnknownHostException e1) { + LOG.error(AgentI18NResourceKeys.FAILOVER_LIST_UNKNOWN_HOST, server.address); + } catch (IOException e1) { + String err = ThrowableUtil.getAllMessages(e1); + LOG.warn(AgentI18NResourceKeys.FAILOVER_LIST_UNREACHABLE_HOST, server.address, server.port, + server.securePort, err); + } + } finally { + if (socket != null) { + try { + socket.close(); + } catch (Exception e) { + } + } else { + failedServers.add(server.toString()); + } + } + } + } + + return failedServers; + } + + /** * Given a failover list, this will persist it so the agent can recover it if the agent itself fails. * If this method fails to persist the list, an error is logged but otherwise this method * returns normally. @@ -2539,7 +2608,7 @@ public class AgentMain { .getAllMessages(e)); }
- // let's be kind to the user - if any server address is "localhost" or "127.0.0.1" + // let's be kind to the user - if any server address is "localhost" or "127.0.0.#" // or starts with "localhost." (such as localhost.localdomain) then we should output a // warning to let the user know that that probably isn't what they want. // In cases when someone is demo'ing/testing/developing, and they don't want to see this, provide @@ -2550,7 +2619,7 @@ public class AgentMain { for (int i = 0; i < numServers; i++) { ServerEntry server = failoverList.get(i); String addr = (server.address != null) ? server.address : ""; - if ("localhost".equals(addr) || "127.0.0.1".equals(addr) || addr.startsWith("localhost.")) { + if ("localhost".equals(addr) || addr.startsWith("127.0.0.") || addr.startsWith("localhost.")) { LOG.warn(AgentI18NResourceKeys.FAILOVER_LIST_HAS_LOCALHOST, server.address); getOut().println(MSG.getMsg(AgentI18NResourceKeys.FAILOVER_LIST_HAS_LOCALHOST, server.address)); break; // just show the warning once diff --git a/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/i18n/AgentI18NResourceKeys.java b/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/i18n/AgentI18NResourceKeys.java index de3acca..7e621e8 100644 --- a/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/i18n/AgentI18NResourceKeys.java +++ b/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/i18n/AgentI18NResourceKeys.java @@ -236,6 +236,21 @@ public interface AgentI18NResourceKeys { @I18NMessage("Failed to download an updated server failover list. Cause: {0}") String FAILOVER_LIST_DOWNLOAD_FAILURE = "AgentMain.failover-list-download-failure";
+ @I18NMessage("Failover list has an unknown host [{0}]") + String FAILOVER_LIST_UNKNOWN_HOST = "AgentMain.failover-list-unknown-host"; + + @I18NMessage("Failover list has an unreachable host [{0}] (tested ports [{1,number,#}] and [{2,number,#}]). Cause: {3}") + String FAILOVER_LIST_UNREACHABLE_HOST = "AgentMain.failover-list-unreachable-host"; + + @I18NMessage("!!! There are [{0}] servers that are potentially unreachable by this agent.\n\\n" + + "Please double check all public endpoints of your servers and ensure\n\\n" + + "they are all reachable by this agent. The failed server endpoints are:\n\\n" // + + "{1}\n\\n" // + + "See the Administration > High Availability > Servers in the server GUI\n\\n" + + "to change the public endpoint of a server.\n\\n" + + "THIS AGENT WILL WAIT UNTIL ONE OF ITS SERVERS BECOMES REACHABLE!") + String FAILOVER_LIST_CHECK_FAILED = "AgentMain.failover-list-check-failed"; + @I18NMessage("The prompt input reader returned null. EOF?") String INPUT_EOF = "AgentMain.input-eof";
commit e34d07b12622b278aedef07e5c0752c4acdfd1fe Merge: d454338... bc83892... Author: Jay Shaughnessy jshaughn@redhat.com Date: Tue Jul 20 17:15:34 2010 -0400
Merge branch 'release-3.0.0' into release-3.0.0-work
commit d454338af878eb9490814548b665e567abcc0a21 Author: Jay Shaughnessy jshaughn@redhat.com Date: Tue Jul 20 17:08:25 2010 -0400
[bz 616395] reduce the default # of threads used for plugin deployment to 1 (from 5) in rhq-server.properties. This is to remove the frequent deadlocks we see during upgrade. Further work on meta-data update is needed to remove the contention. When done this should be upped again.
diff --git a/modules/enterprise/server/container/src/main/scripts/rhq-container.build.xml b/modules/enterprise/server/container/src/main/scripts/rhq-container.build.xml index 238f6d2..477f62f 100644 --- a/modules/enterprise/server/container/src/main/scripts/rhq-container.build.xml +++ b/modules/enterprise/server/container/src/main/scripts/rhq-container.build.xml @@ -472,7 +472,8 @@ rhq.server.startup.pooledinvoker.rmiport=7445 rhq.server.startup.ajp.port=9009 rhq.server.startup.unifiedinvoker.port=5446 rhq.server.startup.aspectdeployer.bind-port=4873 -rhq.server.plugin-deployer-threads=5 +# It is not recommended to increase this value +rhq.server.plugin-deployer-threads=1
# Cluster configuration # The cluster service has been disabled in 1.1. It will be revisited when we look at cluster management support.
commit bc83892683c0cdbf4277de773b984f46b1a54047 Author: Ian Springer ian.springer@redhat.com Date: Tue Jul 20 14:13:57 2010 -0400
Revert "fix so vertical scrolling of right content div on resource/group pages works correctly in IE7 (https://bugzilla.redhat.com/show_bug.cgi?id=601744)"
This reverts commit 070e9611ebcdfc678c4ddee886c067592edd5e8e.
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/css/win.css b/modules/enterprise/gui/portal-war/src/main/webapp/css/win.css index f0c4fda..e6ad8cc 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/css/win.css +++ b/modules/enterprise/gui/portal-war/src/main/webapp/css/win.css @@ -2321,14 +2321,15 @@ ul.radio-group .unspecified { .content-left { width: 100%; height: 100%; - background-color: #FFFFFF; + background-color: #ffffff; overflow: auto; }
-.content-right { +.content-right { + left: 6px; right: 0; - width: 100%; - height: 100%; + height: 100%; + margin-left: 6px; overflow: auto; }
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/entity/layout/main.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/entity/layout/main.xhtml index c4ade43..e249621 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/entity/layout/main.xhtml +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/entity/layout/main.xhtml @@ -43,14 +43,14 @@ id - the id of the Resource being accessed <div id="contentParent"> <!--<![endif]--> <div id="leftContent" class="column" style="width: #{UserPreferencesUIBean.leftResourceNavState}%"> - <div id="leftContentWrapper" class="content-left" style="position: relative"> + <div id="leftContentWrapper" class="content-left"> <ui:insert name="nav"><p>Default Entity Navigation</p></ui:insert>
</div> </div> - <div id="centerContent" class="column" style="width: #{100 - UserPreferencesUIBean.leftResourceNavState}%"> - <div id="centerContentWrapper" class="content-right" style="position: relative"> - <div style="left: 0; right: 0; height: 100%"> + <div id="centerContent" class="column" style="width: #{100 - UserPreferencesUIBean.leftResourceNavState}%;"> + <div id="centerContentWrapper" class="content-right"> + <div style="left: 0; right: 0; height: 100%; position: relative"> <ui:insert name="summary"><p>Default Entity Summary</p></ui:insert> <ui:insert name="tabBar"><p>Default Entity TabBar</p></ui:insert> <ui:insert name="content"><p>Default Entity Content</p></ui:insert> @@ -68,7 +68,7 @@ id - the id of the Resource being accessed </a4j:form> </a4j:region>
- <script language="JavaScript" type="text/javascript"> + <script language="JavaScript" type="text/JavaScript"> <!--
function recalcContentSizes() { @@ -85,7 +85,7 @@ id - the id of the Resource being accessed //this has to be computed AFTER we change the parent's width above to accomodate //for the change of the left width caused by it. var rightWidth = body.getDimensions().width - left.getDimensions().width; - rightWrapper.style.width = (rightWidth) + 'px'; + rightWrapper.style.width = (rightWidth - 6) + 'px'; //6 - the margin defined by the content-right css class }
commit a774a02f24f889aa8ae65b0cae7cf21609ba6eb7 Author: Jay Shaughnessy jshaughn@redhat.com Date: Tue Jul 20 14:12:59 2010 -0400
Fix merge problem (btw, we need to get our IJ/Eclipse formatting in better sync)
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java index 4e9f17a..396aa0e 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupDetailView.java @@ -28,7 +28,6 @@ import com.smartgwt.client.widgets.layout.VLayout; import com.smartgwt.client.widgets.tab.Tab;
import org.rhq.core.domain.authz.Permission; -import org.rhq.core.domain.resource.Resource; import org.rhq.core.domain.resource.ResourceType; import org.rhq.core.domain.resource.composite.ResourcePermission; import org.rhq.core.domain.resource.group.GroupCategory; @@ -37,25 +36,11 @@ import org.rhq.enterprise.gui.coregui.client.BookmarkableView; import org.rhq.enterprise.gui.coregui.client.CoreGUI; import org.rhq.enterprise.gui.coregui.client.ViewId; import org.rhq.enterprise.gui.coregui.client.ViewPath; -import org.rhq.enterprise.gui.coregui.client.alert.definitions.AlertDefinitionsView; -import org.rhq.enterprise.gui.coregui.client.components.FullHTMLPane; import org.rhq.enterprise.gui.coregui.client.components.tab.TwoLevelTab; import org.rhq.enterprise.gui.coregui.client.components.tab.TwoLevelTabSelectedEvent; import org.rhq.enterprise.gui.coregui.client.components.tab.TwoLevelTabSelectedHandler; import org.rhq.enterprise.gui.coregui.client.components.tab.TwoLevelTabSet; import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup; -import org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceSearchView; -import org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceSelectListener; -import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.ResourceTitleBar; -import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.alert.ResourceAlertHistoryView; -import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.configuration.ConfigurationHistoryView; -import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.configuration.ResourceConfigurationEditView; -import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.event.EventHistoryView; -import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.inventory.PluginConfigurationEditView; -import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.monitoring.GraphListView; -import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.monitoring.calltime.CallTimeView; -import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.operation.OperationHistoryView; -import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.overview.ResourceOverviewView; import org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTypeRepository;
/** @@ -86,8 +71,6 @@ public class ResourceGroupDetailView extends VLayout implements BookmarkableView private ViewId tabView; private ViewId subtabView;
- - @Override protected void onDraw() { super.onDraw(); @@ -95,7 +78,6 @@ public class ResourceGroupDetailView extends VLayout implements BookmarkableView setWidth100(); setHeight100();
- // The Tabs section
topTabSet = new TwoLevelTabSet(); @@ -129,8 +111,8 @@ public class ResourceGroupDetailView extends VLayout implements BookmarkableView contentTab = new TwoLevelTab("Content", "/images/icons/Content_grey_16.png"); contentTab.registerSubTabs("Deployed", "New", "Subscriptions", "History");
- topTabSet.setTabs(summaryTab, monitoringTab, inventoryTab, operationsTab, alertsTab, configurationTab, eventsTab, contentTab); - + topTabSet.setTabs(summaryTab, monitoringTab, inventoryTab, operationsTab, alertsTab, configurationTab, + eventsTab, contentTab);
topTabSet.addTwoLevelTabSelectedHandler(this);
@@ -139,7 +121,7 @@ public class ResourceGroupDetailView extends VLayout implements BookmarkableView
addMember(topTabSet);
-// CoreGUI.addBreadCrumb(getPlace()); + // CoreGUI.addBreadCrumb(getPlace()); }
public void onResourceSelected(ResourceGroup group) { @@ -152,80 +134,75 @@ public class ResourceGroupDetailView extends VLayout implements BookmarkableView
// TODO all of the tabs
-// FullHTMLPane timelinePane = new FullHTMLPane("/rhq/resource/summary/timeline-plain.xhtml?id=" + resource.getId()); -// summaryTab.updateSubTab("Overview", new ResourceOverviewView(resource)); -// summaryTab.updateSubTab("Timeline", timelinePane); - - -// monitoringTab.updateSubTab("Graphs", new GraphListView(resource)); // new FullHTMLPane("/rhq/common/monitor/graphs.xhtml?id=" + resource.getId())); -// monitoringTab.updateSubTab("Tables", new FullHTMLPane("/rhq/common/monitor/tables-plain.xhtml?id=" + resource.getId())); -// monitoringTab.updateSubTab("Traits", new FullHTMLPane("/rhq/resource/monitor/traits-plain.xhtml?id=" + resource.getId())); -// monitoringTab.updateSubTab("Availability", new FullHTMLPane("/rhq/resource/monitor/availabilityHistory-plain.xhtml?id=" + resource.getId())); -// monitoringTab.updateSubTab("Schedules", new FullHTMLPane("/rhq/resource/monitor/schedules-plain.xhtml?id=" + resource.getId())); -// monitoringTab.updateSubTab("Call Time", new CallTimeView(resource)); -// -// -// inventoryTab.updateSubTab("Children", ResourceSearchView.getChildrenOf(resource.getId())); -// inventoryTab.updateSubTab("Connection Settings", new PluginConfigurationEditView(resource)); // new ConfigurationEditor(resource.getId(), resource.getResourceType().getId(), ConfigurationEditor.ConfigType.plugin)); -// -// operationsTab.updateSubTab("History", OperationHistoryView.getResourceHistoryView(resource)); -// -// configurationTab.updateSubTab("Current", new ResourceConfigurationEditView(resource)); -// configurationTab.updateSubTab("History", ConfigurationHistoryView.getHistoryOf(resource.getId())); -// -// alertsTab.updateSubTab("History", new ResourceAlertHistoryView(resource.getId())); -// alertsTab.updateSubTab("Definitions", AlertDefinitionsView.getResourceView(resource)); -// -// eventsTab.updateSubTab("History", EventHistoryView.createResourceHistoryView(resource.getId())); //new FullHTMLPane("/rhq/common/events/history-plain.xhtml?id=" + resource.getId())); -// -// contentTab.updateSubTab("Deployed", new FullHTMLPane("/rhq/resource/content/view-plain.xhtml?id=" + resource.getId())); -// contentTab.updateSubTab("New", new FullHTMLPane("/rhq/resource/content/deploy-plain.xhtml?id=" + resource.getId())); -// contentTab.updateSubTab("Subscriptions", new FullHTMLPane("/rhq/resource/content/subscription-plain.xhtml?id=" + resource.getId())); -// contentTab.updateSubTab("History", new FullHTMLPane("/rhq/resource/content/history-plain.xhtml?id=" + resource.getId())); - - -// topTabSet.setSelectedTab(selectedTab); + // FullHTMLPane timelinePane = new FullHTMLPane("/rhq/resource/summary/timeline-plain.xhtml?id=" + resource.getId()); + // summaryTab.updateSubTab("Overview", new ResourceOverviewView(resource)); + // summaryTab.updateSubTab("Timeline", timelinePane); + + // monitoringTab.updateSubTab("Graphs", new GraphListView(resource)); // new FullHTMLPane("/rhq/common/monitor/graphs.xhtml?id=" + resource.getId())); + // monitoringTab.updateSubTab("Tables", new FullHTMLPane("/rhq/common/monitor/tables-plain.xhtml?id=" + resource.getId())); + // monitoringTab.updateSubTab("Traits", new FullHTMLPane("/rhq/resource/monitor/traits-plain.xhtml?id=" + resource.getId())); + // monitoringTab.updateSubTab("Availability", new FullHTMLPane("/rhq/resource/monitor/availabilityHistory-plain.xhtml?id=" + resource.getId())); + // monitoringTab.updateSubTab("Schedules", new FullHTMLPane("/rhq/resource/monitor/schedules-plain.xhtml?id=" + resource.getId())); + // monitoringTab.updateSubTab("Call Time", new CallTimeView(resource)); + // + // + // inventoryTab.updateSubTab("Children", ResourceSearchView.getChildrenOf(resource.getId())); + // inventoryTab.updateSubTab("Connection Settings", new PluginConfigurationEditView(resource)); // new ConfigurationEditor(resource.getId(), resource.getResourceType().getId(), ConfigurationEditor.ConfigType.plugin)); + // + // operationsTab.updateSubTab("History", OperationHistoryView.getResourceHistoryView(resource)); + // + // configurationTab.updateSubTab("Current", new ResourceConfigurationEditView(resource)); + // configurationTab.updateSubTab("History", ConfigurationHistoryView.getHistoryOf(resource.getId())); + // + // alertsTab.updateSubTab("History", new ResourceAlertHistoryView(resource.getId())); + // alertsTab.updateSubTab("Definitions", AlertDefinitionsView.getResourceView(resource)); + // + // eventsTab.updateSubTab("History", EventHistoryView.createResourceHistoryView(resource.getId())); //new FullHTMLPane("/rhq/common/events/history-plain.xhtml?id=" + resource.getId())); + // + // contentTab.updateSubTab("Deployed", new FullHTMLPane("/rhq/resource/content/view-plain.xhtml?id=" + resource.getId())); + // contentTab.updateSubTab("New", new FullHTMLPane("/rhq/resource/content/deploy-plain.xhtml?id=" + resource.getId())); + // contentTab.updateSubTab("Subscriptions", new FullHTMLPane("/rhq/resource/content/subscription-plain.xhtml?id=" + resource.getId())); + // contentTab.updateSubTab("History", new FullHTMLPane("/rhq/resource/content/history-plain.xhtml?id=" + resource.getId())); + + // topTabSet.setSelectedTab(selectedTab);
updateTabStatus();
topTabSet.markForRedraw(); }
- private void updateTabStatus() { // Go and get the type with all needed metadata // and then get the permissions for this resource
if (group.getGroupCategory() == GroupCategory.COMPATIBLE) { ResourceType groupType = group.getResourceType(); - ResourceTypeRepository.Cache.getInstance().getResourceTypes(groupType.getId(), - EnumSet.of(ResourceTypeRepository.MetadataType.content, - ResourceTypeRepository.MetadataType.operations, - ResourceTypeRepository.MetadataType.events, - ResourceTypeRepository.MetadataType.resourceConfigurationDefinition), + ResourceTypeRepository.Cache.getInstance().getResourceTypes( + groupType.getId(), + EnumSet.of(ResourceTypeRepository.MetadataType.content, ResourceTypeRepository.MetadataType.operations, + ResourceTypeRepository.MetadataType.events, + ResourceTypeRepository.MetadataType.resourceConfigurationDefinition), new ResourceTypeRepository.TypeLoadedCallback() { public void onTypesLoaded(ResourceType type) {
ResourceGroupDetailView.this.groupType = type;
- GWTServiceLookup.getAuthorizationService(). - getImplicitGroupPermissions(ResourceGroupDetailView.this.group.getId(), - new AsyncCallback<Set<Permission>>() { - public void onFailure(Throwable caught) { - CoreGUI.getErrorHandler().handleError("Failed to load group permissions", caught); - } - - public void onSuccess(Set<Permission> result) { - ResourceGroupDetailView.this.permissions = new ResourcePermission(result); - completeTabUpdate(); - } - }); + GWTServiceLookup.getAuthorizationService().getImplicitGroupPermissions( + ResourceGroupDetailView.this.group.getId(), new AsyncCallback<Set<Permission>>() { + public void onFailure(Throwable caught) { + CoreGUI.getErrorHandler().handleError("Failed to load group permissions", caught); + } + + public void onSuccess(Set<Permission> result) { + ResourceGroupDetailView.this.permissions = new ResourcePermission(result); + completeTabUpdate(); + } + }); } }); } }
- private void completeTabUpdate() {
if (!permissions.isMeasure()) { @@ -234,26 +211,27 @@ public class ResourceGroupDetailView extends VLayout implements BookmarkableView topTabSet.enableTab(monitoringTab); }
- if (groupType.getOperationDefinitions() == null || groupType.getOperationDefinitions().isEmpty() || !permissions.isControl()) { + if (groupType.getOperationDefinitions() == null || groupType.getOperationDefinitions().isEmpty() + || !permissions.isControl()) { topTabSet.disableTab(operationsTab); } else { topTabSet.enableTab(operationsTab); }
- if (!permissions.isAlert()) { topTabSet.disableTab(alertsTab); } else { topTabSet.enableTab(alertsTab); }
- if (groupType.getResourceConfigurationDefinition() == null || !permissions.isConfigure()) { + if (groupType.getResourceConfigurationDefinition() == null || !permissions.isConfigureRead()) { topTabSet.disableTab(configurationTab); } else { topTabSet.enableTab(configurationTab); }
- if (groupType.getEventDefinitions() == null || groupType.getEventDefinitions().isEmpty() || !permissions.isMeasure()) { + if (groupType.getEventDefinitions() == null || groupType.getEventDefinitions().isEmpty() + || !permissions.isMeasure()) { topTabSet.enableTab(eventsTab); } else { topTabSet.enableTab(eventsTab); @@ -265,13 +243,11 @@ public class ResourceGroupDetailView extends VLayout implements BookmarkableView topTabSet.enableTab(contentTab); }
- }
- public void onTabSelected(TwoLevelTabSelectedEvent tabSelectedEvent) { String tabPath = "/" + tabSelectedEvent.getId() + "/" + tabSelectedEvent.getSubTabId(); -// System.out.println("TAB: " + currentView.getPath() + tabPath); + // System.out.println("TAB: " + currentView.getPath() + tabPath);
if (group != null) { String path = "ResourceGroup/" + group.getId() + tabPath; @@ -279,7 +255,6 @@ public class ResourceGroupDetailView extends VLayout implements BookmarkableView } }
- public void renderView(ViewPath viewPath) { // TODO: Implement this method.
@@ -299,14 +274,11 @@ public class ResourceGroupDetailView extends VLayout implements BookmarkableView
tab.getLayout().selectTab(subtabView.getPath());
- }
}
- }
- } } \ No newline at end of file
commit 27ec0c3bbf507b42f32c532064ccc8fdde483ad0 Merge: 13f415c... 48dc31b... Author: Ian Springer ian.springer@redhat.com Date: Tue Jul 20 13:53:38 2010 -0400
Merge branch 'release-3.0.0' of ssh://git.fedorahosted.org/git/rhq/rhq into release-3.0.0
commit 13f415ca210fea4f228aaa5f7022e43c506d331c Author: Ian Springer ian.springer@redhat.com Date: Tue Jul 20 13:52:06 2010 -0400
fix NPE that occurred when trying to view a group configuration update (https://bugzilla.redhat.com/show_bug.cgi?id=614886)
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationManagerBean.java index 5f7203a..99e2d5a 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationManagerBean.java @@ -1,6 +1,6 @@ /* * RHQ Management Platform - * Copyright (C) 2005-2008 Red Hat, Inc. + * Copyright (C) 2005-2010 Red Hat, Inc. * All rights reserved. * * This program is free software; you can redistribute it and/or modify @@ -1739,7 +1739,7 @@ public class ConfigurationManagerBean implements ConfigurationManagerLocal, Conf public Map<Integer, Configuration> getResourceConfigurationMapForGroupUpdate(Subject subject, Integer groupResourceConfigurationUpdateId) { // this method will perform the CONFIGURE_READ security check for us, no need to keep reference to result - getGroupPluginConfigurationUpdate(subject, groupResourceConfigurationUpdateId); + getGroupResourceConfigurationUpdate(subject, groupResourceConfigurationUpdateId);
Tuple<String, Object> groupIdParameter = new Tuple<String, Object>("groupConfigurationUpdateId", groupResourceConfigurationUpdateId);
commit 48dc31be4c50301c53a1c77aa9b629466588ab0e Merge: 54931b5... e0075fb... Author: John Sanda jsanda@redhat.com Date: Tue Jul 20 13:33:17 2010 -0400
Merge branch 'release-3.0.0' of ssh://git.fedorahosted.org/git/rhq/rhq into release-3.0.0
commit 54931b509fcb42b50bf39436d08fe59edc6a3c1c Author: John Sanda jsanda@redhat.com Date: Tue Jul 20 13:32:16 2010 -0400
Fixing unit test failures
diff --git a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/configuration/ConfigurationManagerBeanUnitTest.java b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/configuration/ConfigurationManagerBeanUnitTest.java index 2bd80c5..bb71777 100644 --- a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/configuration/ConfigurationManagerBeanUnitTest.java +++ b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/configuration/ConfigurationManagerBeanUnitTest.java @@ -23,10 +23,13 @@
package org.rhq.enterprise.server.configuration;
+import static org.rhq.core.domain.authz.Permission.CONFIGURE_READ; +import static org.rhq.core.domain.authz.Permission.CONFIGURE_WRITE; import static org.rhq.test.AssertUtils.*; import static org.rhq.core.domain.configuration.ConfigurationUpdateStatus.*; import static org.testng.Assert.*;
+import org.rhq.core.domain.authz.Permission; import org.rhq.core.util.exception.ThrowableUtil; import org.rhq.test.JMockTest; import org.rhq.test.jmock.PropertyMatcher; @@ -123,6 +126,9 @@ public class ConfigurationManagerBeanUnitTest extends JMockTest { expectedUpdate.getConfiguration(), expectedUpdate.getResource().getId());
context.checking(new Expectations() {{ + oneOf(authorizationMgr).hasResourcePermission(fixture.subject, CONFIGURE_WRITE, fixture.resourceId); + will(returnValue(true)); + allowing(entityMgr).find(Resource.class, fixture.resourceId); will(returnValue(fixture.resource));
oneOf(configurationMgrLocal).persistNewResourceConfigurationUpdateHistory(fixture.subject, @@ -159,6 +165,9 @@ public class ConfigurationManagerBeanUnitTest extends JMockTest { context.checking(new Expectations() {{ allowing(entityMgr).find(Resource.class, fixture.resourceId); will(returnValue(fixture.resource));
+ oneOf(authorizationMgr).hasResourcePermission(fixture.subject, CONFIGURE_WRITE, fixture.resourceId); + will(returnValue(true)); + oneOf(configurationMgrLocal).persistNewResourceConfigurationUpdateHistory(fixture.subject, fixture.resourceId, fixture.configuration, INPROGRESS, fixture.subject.getName(), fixture.isPartOfGroupUpdate); @@ -255,7 +264,11 @@ public class ConfigurationManagerBeanUnitTest extends JMockTest { final Sequence configUdpate = context.sequence("structured-config-update");
context.checking(new Expectations() {{ - allowing(authorizationMgr).canViewResource(fixture.subject, fixture.resourceId); will(returnValue(true)); + oneOf(authorizationMgr).canViewResource(fixture.subject, fixture.resourceId); + will(returnValue(true)); + + oneOf(authorizationMgr).hasResourcePermission(fixture.subject, CONFIGURE_WRITE, fixture.resourceId); + will(returnValue(true));
allowing(entityMgr).find(Resource.class, fixture.resourceId); will(returnValue(fixture.resource));
@@ -303,6 +316,12 @@ public class ConfigurationManagerBeanUnitTest extends JMockTest { final Sequence configUdpate = context.sequence("raw-config-update");
context.checking(new Expectations() {{ + oneOf(authorizationMgr).hasResourcePermission(fixture.subject, CONFIGURE_READ, fixture.resourceId); + will(returnValue(true)); + + oneOf(authorizationMgr).hasResourcePermission(fixture.subject, CONFIGURE_WRITE, fixture.resourceId); + will(returnValue(true)); + allowing(entityMgr).find(Resource.class, fixture.resourceId); will(returnValue(fixture.resource));
allowing(authorizationMgr).canViewResource(fixture.subject, fixture.resourceId); will(returnValue(true)); @@ -346,6 +365,9 @@ public class ConfigurationManagerBeanUnitTest extends JMockTest {
context.checking(new Expectations() {{ allowing(entityMgr).find(Resource.class, fixture.resourceId); will(returnValue(fixture.resource)); + + oneOf(authorizationMgr).hasResourcePermission(fixture.subject, CONFIGURE_WRITE, fixture.resourceId); + will(returnValue(true));
oneOf(configurationMgrLocal).persistNewResourceConfigurationUpdateHistory(fixture.subject, fixture.resourceId, fixture.configuration, INPROGRESS, fixture.subject.getName(), fixture.isPartOfGroupUpdate); @@ -375,10 +397,11 @@ public class ConfigurationManagerBeanUnitTest extends JMockTest { context.checking(new Expectations() {{ allowing(entityMgr).find(Resource.class, fixture.resourceId); will(returnValue(fixture.resource));
- oneOf(authorizationMgr).canViewResource(fixture.subject, fixture.resourceId); will(returnValue(true)); - allowing(agentMgr).getAgentClient(fixture.resource.getAgent()); will(returnValue(agentClient));
+ oneOf(authorizationMgr).hasResourcePermission(fixture.subject, CONFIGURE_READ, fixture.resourceId); + will(returnValue(true)); + allowing(agentClient).getConfigurationAgentService(); will(returnValue(configAgentService));
oneOf(configAgentService).merge(fixture.configuration, fixture.resourceId, FROM_STRUCTURED); @@ -406,7 +429,8 @@ public class ConfigurationManagerBeanUnitTest extends JMockTest { context.checking(new Expectations() {{ allowing(entityMgr).find(Resource.class, fixture.resourceId); will(returnValue(fixture.resource));
- oneOf(authorizationMgr).canViewResource(fixture.subject, fixture.resourceId); will(returnValue(true)); + oneOf(authorizationMgr).hasResourcePermission(fixture.subject, CONFIGURE_READ, fixture.resourceId); + will(returnValue(true));
allowing(agentMgr).getAgentClient(fixture.resource.getAgent()); will(returnValue(agentClient));
commit 070e9611ebcdfc678c4ddee886c067592edd5e8e Author: Ian Springer ian.springer@redhat.com Date: Tue Jul 20 13:30:21 2010 -0400
fix so vertical scrolling of right content div on resource/group pages works correctly in IE7 (https://bugzilla.redhat.com/show_bug.cgi?id=601744)
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/css/win.css b/modules/enterprise/gui/portal-war/src/main/webapp/css/win.css index e6ad8cc..f0c4fda 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/css/win.css +++ b/modules/enterprise/gui/portal-war/src/main/webapp/css/win.css @@ -2321,15 +2321,14 @@ ul.radio-group .unspecified { .content-left { width: 100%; height: 100%; - background-color: #ffffff; + background-color: #FFFFFF; overflow: auto; }
-.content-right { - left: 6px; +.content-right { right: 0; - height: 100%; - margin-left: 6px; + width: 100%; + height: 100%; overflow: auto; }
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/entity/layout/main.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/entity/layout/main.xhtml index e249621..c4ade43 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/entity/layout/main.xhtml +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/entity/layout/main.xhtml @@ -43,14 +43,14 @@ id - the id of the Resource being accessed <div id="contentParent"> <!--<![endif]--> <div id="leftContent" class="column" style="width: #{UserPreferencesUIBean.leftResourceNavState}%"> - <div id="leftContentWrapper" class="content-left"> + <div id="leftContentWrapper" class="content-left" style="position: relative"> <ui:insert name="nav"><p>Default Entity Navigation</p></ui:insert>
</div> </div> - <div id="centerContent" class="column" style="width: #{100 - UserPreferencesUIBean.leftResourceNavState}%;"> - <div id="centerContentWrapper" class="content-right"> - <div style="left: 0; right: 0; height: 100%; position: relative"> + <div id="centerContent" class="column" style="width: #{100 - UserPreferencesUIBean.leftResourceNavState}%"> + <div id="centerContentWrapper" class="content-right" style="position: relative"> + <div style="left: 0; right: 0; height: 100%"> <ui:insert name="summary"><p>Default Entity Summary</p></ui:insert> <ui:insert name="tabBar"><p>Default Entity TabBar</p></ui:insert> <ui:insert name="content"><p>Default Entity Content</p></ui:insert> @@ -68,7 +68,7 @@ id - the id of the Resource being accessed </a4j:form> </a4j:region>
- <script language="JavaScript" type="text/JavaScript"> + <script language="JavaScript" type="text/javascript"> <!--
function recalcContentSizes() { @@ -85,7 +85,7 @@ id - the id of the Resource being accessed //this has to be computed AFTER we change the parent's width above to accomodate //for the change of the left width caused by it. var rightWidth = body.getDimensions().width - left.getDimensions().width; - rightWrapper.style.width = (rightWidth - 6) + 'px'; //6 - the margin defined by the content-right css class + rightWrapper.style.width = (rightWidth) + 'px'; }
commit e0075fbf05954ead36fe462ea4d510a744898d0a Author: Joseph Marques joseph@redhat.com Date: Tue Jul 20 13:04:10 2010 -0400
BZ-616465: remove beginning/trailing commas around email-based notifications
diff --git a/modules/core/dbutils/src/main/java/org/rhq/core/db/upgrade/CustomAlertSenderUpgradeTask.java b/modules/core/dbutils/src/main/java/org/rhq/core/db/upgrade/CustomAlertSenderUpgradeTask.java index 7dc1a4d..52713d4 100644 --- a/modules/core/dbutils/src/main/java/org/rhq/core/db/upgrade/CustomAlertSenderUpgradeTask.java +++ b/modules/core/dbutils/src/main/java/org/rhq/core/db/upgrade/CustomAlertSenderUpgradeTask.java @@ -208,7 +208,7 @@ public class CustomAlertSenderUpgradeTask implements DatabaseUpgradeTask { String propertyName = "subjectId"; String senderName = "System Users";
- persist(data, propertyName, senderName, "|"); + persist(data, propertyName, senderName, "|", true); }
private void upgradeRoleNotifications() throws SQLException { @@ -223,7 +223,7 @@ public class CustomAlertSenderUpgradeTask implements DatabaseUpgradeTask { String propertyName = "roleId"; String senderName = "System Roles";
- persist(data, propertyName, senderName, "|"); + persist(data, propertyName, senderName, "|", true); }
private void upgradeEmailNotifications() throws SQLException { @@ -238,7 +238,7 @@ public class CustomAlertSenderUpgradeTask implements DatabaseUpgradeTask { String propertyName = "emailAddress"; String senderName = "Direct Emails";
- persist(data, propertyName, senderName, ","); + persist(data, propertyName, senderName, ",", false); }
private void upgradeSNMPNotifications() throws SQLException { @@ -281,7 +281,8 @@ public class CustomAlertSenderUpgradeTask implements DatabaseUpgradeTask { } }
- private void persist(List<Object[]> data, String propertyName, String sender, String delimiter) throws SQLException { + private void persist(List<Object[]> data, String propertyName, String sender, String delimiter, + boolean bufferWithDelimiter) throws SQLException { int definitionId = -1; StringBuilder buffer = new StringBuilder(); for (Object[] next : data) { @@ -307,7 +308,8 @@ public class CustomAlertSenderUpgradeTask implements DatabaseUpgradeTask { if (buffer.length() != 0) { // always add <delimiter> to both side of the buffer -- this will enable searches for data // using the JPQL fragment notification.configuration.value = <delimiter><data><delimiter>' - int configId = persistConfiguration(propertyName, delimiter + buffer.toString() + delimiter); + String bufferedData = bufferWithDelimiter ? (delimiter + buffer.toString() + delimiter) : buffer.toString(); + int configId = persistConfiguration(propertyName, bufferedData); persistNotification(definitionId, configId, sender); } }
commit c4228063c198191b9a4ba2fe0e9a1a0cd53abe28 Merge: 4d7a0dc... 4b8e7d1... Author: Jay Shaughnessy jshaughn@redhat.com Date: Tue Jul 20 11:54:22 2010 -0400
Merge branch 'release-3.0.0-jay' into master-jay
Conflicts: modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/SearchGUI.java modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/menu/MenuBarView.java modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/common/paging/PagedListDataModel.java modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/alert/notification/details.xhtml modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationManagerBean.java modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/discovery/DiscoveryBossBean.java modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/AbstractSearchAssistant.java modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/GroupSearchAssistant.java modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/ResourceSearchAssistant.java modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/AbstractSearchTranslator.java modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/GroupSearchTranslator.java modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/ResourceSearchTranslator.java modules/plugins/apache/src/test/java/org/rhq/plugins/apache/ApacheAugeasTest.java modules/plugins/apache/src/test/java/org/rhq/plugins/apache/ApacheAugeasUtil.java modules/plugins/apache/src/test/java/org/rhq/plugins/apache/ApacheTestConstants.java modules/plugins/apache/src/test/java/org/rhq/plugins/apache/Components.java modules/plugins/apache/src/test/java/org/rhq/plugins/apache/UnitTestException.java modules/plugins/apache/src/test/java/org/rhq/plugins/apache/helper/LensFilter.java modules/plugins/apache/src/test/java/org/rhq/plugins/apache/helper/LensHelper.java modules/plugins/apache/src/test/java/org/rhq/plugins/apache/util/ApacheConfigurationUtil.java modules/plugins/apache/src/test/java/org/rhq/plugins/apache/util/StandAloneContainer.java modules/plugins/apache/src/test/resources/httpd.aug modules/plugins/apache/src/test/resources/httpd.conf modules/plugins/apache/src/test/resources/nested.conf modules/plugins/apache/src/test/resources/updateconfig/httpd.aug modules/plugins/apache/src/test/resources/updateconfig/nested.conf
diff --cc modules/core/dbutils/pom.xml index 31e3e0a,7ff6a10..8769bfc --- a/modules/core/dbutils/pom.xml +++ b/modules/core/dbutils/pom.xml @@@ -22,7 -22,7 +22,7 @@@
<properties> <scm.module.path>modules/core/dbutils/</scm.module.path> -- <db.schema.version>2.91</db.schema.version> ++ <db.schema.version>2.92</db.schema.version> </properties>
<dependencies> diff --cc modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml index 7071839,951d972..f3b3106 --- a/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml +++ b/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml @@@ -3111,18 -3070,18 +3121,31 @@@ </schema-directSQL>
</schemaSpec> + <schemaSpec version="2.91"> + <schema-directSQL> + <statement desc="Add end time index on call time data to speed up purges"> + CREATE INDEX RHQ_CT_DA_VA_END_TIM_IDX ON RHQ_CALLTIME_DATA_VALUE (end_time) + </statement> + <statement desc="Add index on measurement definition numeric type"> + CREATE INDEX RHQ_METRIC_DEF_NT_IDX ON RHQ_MEASUREMENT_DEF (numeric_type) + </statement> + </schema-directSQL> + </schemaSpec> + ++ <schemaSpec version="2.92"> + <!-- if some role previously had CONFIGURE perm (now called CONFIGURE_WRITE), give it the implied perm + CONFIGURE_READ so users don't experience an unexpected permission restriction after upgrade --> + <schema-directSQL> + <statement desc="Upgrading configuration permissions"> + INSERT INTO RHQ_PERMISSION (ROLE_ID, OPERATION) + SELECT PERM.ROLE_ID, 13 + FROM RHQ_PERMISSION PERM + WHERE PERM.OPERATION = 11 + </statement> + </schema-directSQL> + </schemaSpec> ++ </dbupgrade> </target> </project> diff --cc modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/SearchGUI.java index 8ecfde5,5526b3d..42600a5 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/SearchGUI.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/SearchGUI.java @@@ -64,11 -64,11 +64,10 @@@ public class SearchGUI implements Entry
public static void checkLoginStatus() {
- if (detectIe6()) { - forceIe6Hacks(); + if (CoreGUI.detectIe6()) { + CoreGUI.forceIe6Hacks(); }
-- RequestBuilder b = new RequestBuilder(RequestBuilder.GET, "/sessionAccess"); try { b.setCallback(new RequestCallback() { @@@ -141,8 -141,8 +140,6 @@@ return searchBar; }
-- -- /** * Detects IE6. * <p/> @@@ -150,20 -150,20 +147,20 @@@ * js libraries on the same page at the same time as gwt. */ public static native boolean detectIe6() /*-{ -- if (typeof $doc.body.style.maxHeight != "undefined") -- return(false); -- else -- return(true); --}-*/; ++ if (typeof $doc.body.style.maxHeight != "undefined") ++ return(false); ++ else ++ return(true); ++ }-*/;
public static native void forceIe6Hacks() /*-{ -- $wnd.XMLHttpRequestBackup = $wnd.XMLHttpRequest; -- $wnd.XMLHttpRequest = null; --}-*/; ++ $wnd.XMLHttpRequestBackup = $wnd.XMLHttpRequest; ++ $wnd.XMLHttpRequest = null; ++ }-*/;
public static native void unforceIe6Hacks() /*-{ -- $wnd.XMLHttpRequest = $wnd.XMLHttpRequestBackup; -- $wnd.XMLHttpRequestBackup = null; --}-*/; ++ $wnd.XMLHttpRequest = $wnd.XMLHttpRequestBackup; ++ $wnd.XMLHttpRequestBackup = null; ++ }-*/;
} diff --cc modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/menu/MenuBarView.java index 55a7d47,9992897..35b2acb --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/menu/MenuBarView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/menu/MenuBarView.java @@@ -18,7 -18,7 +18,6 @@@ */ package org.rhq.enterprise.gui.coregui.client.menu;
--import com.google.gwt.dom.client.Document; import com.google.gwt.event.logical.shared.ValueChangeEvent; import com.google.gwt.event.logical.shared.ValueChangeHandler; import com.google.gwt.user.client.History; @@@ -26,16 -26,16 +25,11 @@@ import com.google.gwt.user.client.Windo import com.google.gwt.user.client.ui.Hyperlink; import com.smartgwt.client.types.ContentsType; import com.smartgwt.client.types.VerticalAlignment; --import com.smartgwt.client.util.SC; import com.smartgwt.client.widgets.HTMLFlow; import com.smartgwt.client.widgets.Img; import com.smartgwt.client.widgets.Label; import com.smartgwt.client.widgets.events.ClickEvent; import com.smartgwt.client.widgets.events.ClickHandler; --import com.smartgwt.client.widgets.events.DrawEvent; --import com.smartgwt.client.widgets.events.DrawHandler; --import com.smartgwt.client.widgets.events.ShowContextMenuEvent; --import com.smartgwt.client.widgets.events.ShowContextMenuHandler; import com.smartgwt.client.widgets.layout.HLayout; import com.smartgwt.client.widgets.layout.LayoutSpacer; import com.smartgwt.client.widgets.layout.VLayout; @@@ -57,7 -57,7 +51,7 @@@ public class MenuBarView extends VLayou
private AboutModalWindow aboutModalWindow;
-- public static final String[] SECTIONS = {"Dashboard", "Demo", "Inventory", "Bundles", "Administration"}; ++ public static final String[] SECTIONS = { "Dashboard", "Demo", "Inventory", "Bundles", "Administration" };
private String selected = "Dashboard";
@@@ -68,10 -68,10 +62,8 @@@ setHeight(50); setWidth100();
-- }
-- protected void onDraw() { super.onDraw();
@@@ -80,10 -80,11 +72,9 @@@ - HLayout topBar = new HLayout(); topBar.setHeight(28); topBar.setStyleName("topMenuBar"); --// url("./images/cssButton/button_stretch.png") repeat-x scroll 0 0 #DDDDDD --// topBar.setBackgroundImage("[SKIN]/cssButton/button_stretch.png"); --// topBar.setBackgroundRepeat(BkgndRepeat.REPEAT_X); -- ++ // url("./images/cssButton/button_stretch.png") repeat-x scroll 0 0 #DDDDDD ++ // topBar.setBackgroundImage("[SKIN]/cssButton/button_stretch.png"); ++ // topBar.setBackgroundRepeat(BkgndRepeat.REPEAT_X);
Img logo = new Img("header/rhq_logo_28px.png", 80, 28); logo.addClickHandler(new com.smartgwt.client.widgets.events.ClickHandler() { @@@ -92,36 -93,36 +83,36 @@@ } });
-- topBar.addMember(logo);
-- // Create a menu bar final MenuBar menu = new MenuBar(); menu.setHeight(28);
-- -- Menu subsystemsMenu = new Menu();
subsystemsMenu.setTitle("Subsystems"); -- subsystemsMenu.addItem(new EMenuItem("Configuration Changes", LinkManager.getSubsystemConfigurationLink(), "subsystems/configure/Configure_16.png"));//, new LinkCommand("#config")); -- subsystemsMenu.addItem(new EMenuItem("Suspect Metrics", LinkManager.getSubsystemSuspectMetricsLink(), "subsystems/monitor/Monitor_failed_16.png"));//, new LinkCommand("#config")); -- subsystemsMenu.addItem(new EMenuItem("Operations", LinkManager.getSubsystemOperationHistoryLink(), "subsystems/control/Operation_16.png"));//, new LinkCommand("#config")); -- subsystemsMenu.addItem(new EMenuItem("Alerts", LinkManager.getSubsystemAlertHistoryLink(), "subsystems/alert/Alert_HIGH_16.png"));//, new LinkCommand("#config")); -- subsystemsMenu.addItem(new EMenuItem("Alert Definitions", LinkManager.getSubsystemAlertDefsLink(), "subsystems/alert/Alerts_16.png"));//, new LinkCommand("#config")); -- ++ subsystemsMenu.addItem(new EMenuItem("Configuration Changes", LinkManager.getSubsystemConfigurationLink(), ++ "subsystems/configure/Configure_16.png"));//, new LinkCommand("#config")); ++ subsystemsMenu.addItem(new EMenuItem("Suspect Metrics", LinkManager.getSubsystemSuspectMetricsLink(), ++ "subsystems/monitor/Monitor_failed_16.png"));//, new LinkCommand("#config")); ++ subsystemsMenu.addItem(new EMenuItem("Operations", LinkManager.getSubsystemOperationHistoryLink(), ++ "subsystems/control/Operation_16.png"));//, new LinkCommand("#config")); ++ subsystemsMenu.addItem(new EMenuItem("Alerts", LinkManager.getSubsystemAlertHistoryLink(), ++ "subsystems/alert/Alert_HIGH_16.png"));//, new LinkCommand("#config")); ++ subsystemsMenu.addItem(new EMenuItem("Alert Definitions", LinkManager.getSubsystemAlertDefsLink(), ++ "subsystems/alert/Alerts_16.png"));//, new LinkCommand("#config"));
final Menu overviewMenu = new Menu(); overviewMenu.setTitle("Overview"); overviewMenu.setStyleName("SimpleMenuBarButton"); overviewMenu.setBorder("none"); -- com.smartgwt.client.widgets.menu.MenuItem subsystemsSubMenuItem = new com.smartgwt.client.widgets.menu.MenuItem("Subsystems"); ++ com.smartgwt.client.widgets.menu.MenuItem subsystemsSubMenuItem = new com.smartgwt.client.widgets.menu.MenuItem( ++ "Subsystems"); subsystemsSubMenuItem.setSubmenu(subsystemsMenu); overviewMenu.addItem(subsystemsSubMenuItem); -- overviewMenu.addItem(new EMenuItem("AutoDiscovery Queue",LinkManager.getAutodiscoveryQueueLink()));//,new LinkCommand("#cofng")); -- overviewMenu.addItem(new EMenuItem("Dashboard",LinkManager.getDashboardLink()));//,new LinkCommand("#cofng")); -- ++ overviewMenu.addItem(new EMenuItem("AutoDiscovery Queue", LinkManager.getAutodiscoveryQueueLink()));//,new LinkCommand("#cofng")); ++ overviewMenu.addItem(new EMenuItem("Dashboard", LinkManager.getDashboardLink()));//,new LinkCommand("#cofng"));
Menu resourcesMenu = new Menu(); resourcesMenu.setTitle("Resources"); @@@ -129,7 -130,7 +120,8 @@@ resourcesMenu.setBorder("none"); resourcesMenu.setStyleName("menuBarMenuButton"); resourcesMenu.addItem(new EMenuItem("All Resources", LinkManager.getHubAllResourcesLink()));//, new LinkCommand("#fsdf")); -- resourcesMenu.addItem(new EMenuItem("Platforms", LinkManager.getHubPlatformsLink(),"types/Platform_up_16.png"));//, new LinkCommand("#fsdf")); ++ resourcesMenu ++ .addItem(new EMenuItem("Platforms", LinkManager.getHubPlatformsLink(), "types/Platform_up_16.png"));//, new LinkCommand("#fsdf")); resourcesMenu.addItem(new EMenuItem("Servers", LinkManager.getHubServerssLink(), "types/Server_up_16.png"));//, new LinkCommand("#fsdf")); resourcesMenu.addItem(new EMenuItem("Services", LinkManager.getHubServicesLink(), "types/Service_up_16.png"));//, new LinkCommand("#fsdf")); resourcesMenu.addItem(new MenuItemSeparator()); @@@ -154,52 -155,52 +146,46 @@@ groupsMenu.addItem(new EMenuItem("New Group", LinkManager.getHubNewGroupLink())); //, new LinkCommand("#sf")); groupsMenu.addItem(new EMenuItem("New Group Definition", LinkManager.getHubNewGroupDefLink())); //, new LinkCommand("#sf")); groupsMenu.addItem(new MenuItemSeparator()); --// groupsMenu.addItem(new MenuItem("Favorites")); //, new LinkCommand("#sf")); -- ++ // groupsMenu.addItem(new MenuItem("Favorites")); //, new LinkCommand("#sf"));
Menu securityMenu = new Menu(); securityMenu.setTitle("Security"); -- securityMenu.addItem(new EMenuItem("Users",LinkManager.getAdminUsersLink())); -- securityMenu.addItem(new EMenuItem("Roles",LinkManager.getAdminRolesLink())); ++ securityMenu.addItem(new EMenuItem("Users", LinkManager.getAdminUsersLink())); ++ securityMenu.addItem(new EMenuItem("Roles", LinkManager.getAdminRolesLink())); MenuItem securitySubMenuItem = new MenuItem("Security"); securitySubMenuItem.setSubmenu(securityMenu);
-- Menu sysConfigMenu = new Menu(); sysConfigMenu.setTitle("System Configuration"); -- sysConfigMenu.addItem(new EMenuItem("Settings",LinkManager.getAdminSysConfigLink())); -- sysConfigMenu.addItem(new EMenuItem("Plugins",LinkManager.getAdminPluginsLink())); -- sysConfigMenu.addItem(new EMenuItem("Templates",LinkManager.getAdminTemplatesLink())); ++ sysConfigMenu.addItem(new EMenuItem("Settings", LinkManager.getAdminSysConfigLink())); ++ sysConfigMenu.addItem(new EMenuItem("Plugins", LinkManager.getAdminPluginsLink())); ++ sysConfigMenu.addItem(new EMenuItem("Templates", LinkManager.getAdminTemplatesLink())); MenuItem sysConfigSubMenuItem = new MenuItem("System Configuration"); sysConfigSubMenuItem.setSubmenu(sysConfigMenu);
-- Menu contentMenu = new Menu(); contentMenu.setTitle("Content"); -- contentMenu.addItem(new EMenuItem("Bundles","#Bundles")); -- contentMenu.addItem(new EMenuItem("Content Providers",LinkManager.getAdminContentProvidersLink())); -- contentMenu.addItem(new EMenuItem("Content Repositories",LinkManager.getAdminContentReposLink())); ++ contentMenu.addItem(new EMenuItem("Bundles", "#Bundles")); ++ contentMenu.addItem(new EMenuItem("Content Providers", LinkManager.getAdminContentProvidersLink())); ++ contentMenu.addItem(new EMenuItem("Content Repositories", LinkManager.getAdminContentReposLink())); MenuItem contentSubMenuItem = new MenuItem("Content"); contentSubMenuItem.setSubmenu(contentMenu);
-- Menu haMenu = new Menu(); haMenu.setTitle("High Availability"); -- haMenu.addItem(new EMenuItem("Servers",LinkManager.getHAServersLink())); -- haMenu.addItem(new EMenuItem("Agents",LinkManager.getHAAgentsLink())); -- haMenu.addItem(new EMenuItem("Affinity Groups",LinkManager.getHAAffinityGroupsLink())); -- haMenu.addItem(new EMenuItem("Partition Events",LinkManager.getHAEventsLink())); ++ haMenu.addItem(new EMenuItem("Servers", LinkManager.getHAServersLink())); ++ haMenu.addItem(new EMenuItem("Agents", LinkManager.getHAAgentsLink())); ++ haMenu.addItem(new EMenuItem("Affinity Groups", LinkManager.getHAAffinityGroupsLink())); ++ haMenu.addItem(new EMenuItem("Partition Events", LinkManager.getHAEventsLink())); MenuItem haSubMentItem = new MenuItem("High Availability"); haSubMentItem.setSubmenu(haMenu);
-- Menu reportsMenu = new Menu(); reportsMenu.setTitle("Reports"); reportsMenu.addItem(new EMenuItem("Resource Version Inventory Report", LinkManager.getReportsInventoryLink())); MenuItem reportsSubMenuItem = new MenuItem("Reports"); reportsSubMenuItem.setSubmenu(reportsMenu);
-- Menu adminMenu = new Menu(); adminMenu.setTitle("Administration"); adminMenu.addItem(securitySubMenuItem); @@@ -210,23 -211,23 +196,17 @@@ adminMenu.addItem(new EMenuItem("Downloads", LinkManager.getAdminDownloadsLink())); adminMenu.addItem(new EMenuItem("License", LinkManager.getAdminLicenseLink()));
-- -- -- -- Menu helpMenu = new Menu(); helpMenu.setStyleName("menuBarMenuButton"); helpMenu.setTitle("Help"); helpMenu.addItem(new EMenuItem("Online Documentation", "http://www.rhq-project.org")); //, new LinkCommand("#sdfs")); helpMenu.addItem(new EMenuItem("Open a support case", "http://www.rhq-project.org")); //, new LinkCommand("#sdfs")); --// helpMenu.addItem(new MenuItem("About")); //, new LinkCommand("#sdfs")); ++ // helpMenu.addItem(new MenuItem("About")); //, new LinkCommand("#sdfs"));
menu.setMenus(overviewMenu, resourcesMenu, groupsMenu, adminMenu, helpMenu);
-- topBar.addMember(menu);
-- addMember(topBar); addMember(new SearchBarPane());
@@@ -241,7 -242,7 +221,6 @@@ addMember(menu); }
-- // @Override
protected void onDraw3() { @@@ -261,7 -262,7 +240,6 @@@ } });
-- ToolStrip topStrip = new ToolStrip(); topStrip.setHeight(34); topStrip.setWidth100(); @@@ -328,7 -329,7 +306,7 @@@
private String setupLinks() { StringBuilder headerString = new StringBuilder( -- "<table style="height: 34px;" cellpadding="0" cellspacing="0"><tr>"); ++ "<table style="height: 34px;" cellpadding="0" cellspacing="0"><tr>");
boolean first = true; for (String section : SECTIONS) { @@@ -354,7 -355,7 +332,6 @@@ return headerString.toString(); }
-- public static class EMenuItem extends com.smartgwt.client.widgets.menu.MenuItem {
String link;
commit e395447b05a549f9771dcc1f2a362dc86c284210 Author: Joseph Marques joseph@redhat.com Date: Tue Jul 20 11:22:23 2010 -0400
BZ-616465: fix delimiter for email-based alert notifications
diff --git a/modules/core/dbutils/src/main/java/org/rhq/core/db/upgrade/CustomAlertSenderUpgradeTask.java b/modules/core/dbutils/src/main/java/org/rhq/core/db/upgrade/CustomAlertSenderUpgradeTask.java index 1bddef4..7dc1a4d 100644 --- a/modules/core/dbutils/src/main/java/org/rhq/core/db/upgrade/CustomAlertSenderUpgradeTask.java +++ b/modules/core/dbutils/src/main/java/org/rhq/core/db/upgrade/CustomAlertSenderUpgradeTask.java @@ -208,7 +208,7 @@ public class CustomAlertSenderUpgradeTask implements DatabaseUpgradeTask { String propertyName = "subjectId"; String senderName = "System Users";
- persist(data, propertyName, senderName); + persist(data, propertyName, senderName, "|"); }
private void upgradeRoleNotifications() throws SQLException { @@ -223,7 +223,7 @@ public class CustomAlertSenderUpgradeTask implements DatabaseUpgradeTask { String propertyName = "roleId"; String senderName = "System Roles";
- persist(data, propertyName, senderName); + persist(data, propertyName, senderName, "|"); }
private void upgradeEmailNotifications() throws SQLException { @@ -238,7 +238,7 @@ public class CustomAlertSenderUpgradeTask implements DatabaseUpgradeTask { String propertyName = "emailAddress"; String senderName = "Direct Emails";
- persist(data, propertyName, senderName); + persist(data, propertyName, senderName, ","); }
private void upgradeSNMPNotifications() throws SQLException { @@ -281,7 +281,7 @@ public class CustomAlertSenderUpgradeTask implements DatabaseUpgradeTask { } }
- private void persist(List<Object[]> data, String propertyName, String sender) throws SQLException { + private void persist(List<Object[]> data, String propertyName, String sender, String delimiter) throws SQLException { int definitionId = -1; StringBuilder buffer = new StringBuilder(); for (Object[] next : data) { @@ -291,23 +291,23 @@ public class CustomAlertSenderUpgradeTask implements DatabaseUpgradeTask { definitionId = nextDefinitionId; if (buffer.length() != 0) { // buffer will be 0 the very first time, since definitionId is initially -1 - int configId = persistConfiguration(propertyName, "|" + buffer.toString() + "|"); + int configId = persistConfiguration(propertyName, delimiter + buffer.toString() + delimiter); persistNotification(definitionId, configId, sender); } buffer = new StringBuilder(); // reset for the next definitionId }
if (buffer.length() != 0) { - // elements are already in the list, always add '|' separator between them - buffer.append('|'); + // elements are already in the list, always add <delimiter> between them + buffer.append(delimiter); } buffer.append(nextData); }
if (buffer.length() != 0) { - // always add '|' separator to both side of the buffer - // this will enable searches for data using the JPQL fragment notification.configuration.value = '|<data>|' - int configId = persistConfiguration(propertyName, "|" + buffer.toString() + "|"); + // always add <delimiter> to both side of the buffer -- this will enable searches for data + // using the JPQL fragment notification.configuration.value = <delimiter><data><delimiter>' + int configId = persistConfiguration(propertyName, delimiter + buffer.toString() + delimiter); persistNotification(definitionId, configId, sender); } }
commit 95018277d65928258f606e526952f9e4bdcb5399 Author: Jay Shaughnessy jshaughn@redhat.com Date: Fri Jul 16 11:35:59 2010 -0400
Up the timeout for upload servlet session
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/FileUploadServlet.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/FileUploadServlet.java index 32b1ddc..2c8e514 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/FileUploadServlet.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/FileUploadServlet.java @@ -33,6 +33,7 @@ import javax.servlet.ServletOutputStream; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpSession;
import org.apache.commons.fileupload.FileItem; import org.apache.commons.fileupload.FileUploadException; @@ -51,9 +52,17 @@ import org.rhq.enterprise.server.util.LookupUtil; public class FileUploadServlet extends HttpServlet { private static final long serialVersionUID = 1L;
+ /* The number of seconds the session can remain inactive. The default is 600 (10 minutes). + * It may take longer than 10 minutes to upload a large file, so we'll increase... + */ + private static final int MAX_INACTIVE_INTERVAL = 60 * 60; + @Override protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
+ HttpSession session = req.getSession(); + session.setMaxInactiveInterval(MAX_INACTIVE_INTERVAL); + if (ServletFileUpload.isMultipartContent(req)) {
DiskFileItemFactory fileItemFactory = new DiskFileItemFactory();
commit 4b8e7d151a964386044ed4efb37c0dba0e646bd1 Merge: 67fe77e... c487acd... Author: Jay Shaughnessy jshaughn@redhat.com Date: Tue Jul 20 10:47:45 2010 -0400
Merge branch 'release-3.0.0' into release-3.0.0-jay
commit c487acda658988f3016e2e4ec71ec03261bf50fd Author: Joseph Marques joseph@redhat.com Date: Tue Jul 20 09:30:50 2010 -0400
BZ-616400: fix alert notification log custom upgrade task
diff --git a/modules/core/dbutils/src/main/java/org/rhq/core/db/upgrade/CustomAlertSenderUpgradeTask.java b/modules/core/dbutils/src/main/java/org/rhq/core/db/upgrade/CustomAlertSenderUpgradeTask.java index 4e2f328..1bddef4 100644 --- a/modules/core/dbutils/src/main/java/org/rhq/core/db/upgrade/CustomAlertSenderUpgradeTask.java +++ b/modules/core/dbutils/src/main/java/org/rhq/core/db/upgrade/CustomAlertSenderUpgradeTask.java @@ -76,12 +76,12 @@ public class CustomAlertSenderUpgradeTask implements DatabaseUpgradeTask { private void upgradeSubjectNotificationLogs() throws SQLException { /* * alert.alertNotificationLog.sender = "System Users" - * alert.alertNotificationLog.result_state = "DEFERRED_EMAIL" + * alert.alertNotificationLog.result_state = "UNKNOWN" // success-failure is unknown for existing alerts * alert.alertNotificationLog.message = "Sending to subjects: [<alert.alertNotificationLog.subjects>]" */ String field = "notif.subjects"; String message = concat("'Sending to subjects: '", field); - String insertSQL = getNotificationLogConversionSQL("'System Users'", "'DEFERRED_EMAIL'", message, field); + String insertSQL = getNotificationLogConversionSQL("'System Users'", "'UNKNOWN'", message, field); System.out.println("Executing: " + insertSQL); databaseType.executeSql(connection, insertSQL); } @@ -89,12 +89,12 @@ public class CustomAlertSenderUpgradeTask implements DatabaseUpgradeTask { private void upgradeRoleNotificationLogs() throws SQLException { /* * alert.alertNotificationLog.sender = "System Roles" - * alert.alertNotificationLog.result_state = "DEFERRED_EMAIL" + * alert.alertNotificationLog.result_state = "UNKNOWN" // success-failure is unknown for existing alerts * alert.alertNotificationLog.message = "Sending to roles: [<alert.alertNotificationLog.roles>]" */ String field = "notif.roles"; String message = concat("'Sending to roles: '", field); - String insertSQL = getNotificationLogConversionSQL("'System Roles'", "'DEFERRED_EMAIL'", message, field); + String insertSQL = getNotificationLogConversionSQL("'System Roles'", "'UNKNOWN'", message, field); System.out.println("Executing: " + insertSQL); databaseType.executeSql(connection, insertSQL); } @@ -102,12 +102,12 @@ public class CustomAlertSenderUpgradeTask implements DatabaseUpgradeTask { private void upgradeEmailNotificationLogs() throws SQLException { /* * alert.alertNotificationLog.sender = "Direct Emails" - * alert.alertNotificationLog.result_state = "DEFERRED_EMAIL" + * alert.alertNotificationLog.result_state = "UNKNOWN" // success-failure is unknown for existing alerts * alert.alertNotificationLog.message = "Sending to subjects: [<alert.alertNotificationLog.emails>]" */ String field = "notif.emails"; String message = concat("'Sending to addresses: '", field); - String insertSQL = getNotificationLogConversionSQL("'Direct Emails'", "'DEFERRED_EMAIL'", message, field); + String insertSQL = getNotificationLogConversionSQL("'Direct Emails'", "'UNKNOWN'", message, field); System.out.println("Executing: " + insertSQL); databaseType.executeSql(connection, insertSQL); }
commit 67fe77e638ef6bfb394b81476eaefc2830364199 Author: Jay Shaughnessy jshaughn@redhat.com Date: Mon Jul 19 18:01:44 2010 -0400
[BZ 611456] Change the way PackageBits is handled to ensure lazy load of the blob. This involves extracting the Lob into its own entity to put in place a mapping that Hibernate will honor for Lazy fetch.
diff --git a/modules/core/domain/pom.xml b/modules/core/domain/pom.xml index e0ced84..6d55f5e 100644 --- a/modules/core/domain/pom.xml +++ b/modules/core/domain/pom.xml @@ -37,12 +37,13 @@ <version>${project.version}</version> </dependency>
- <!-- required by PersistenceUtil --> + <!-- required by PersistenceUtil (provided by AS) --> + <!-- required also by hibernate Instrument task. (but use compile scope for this) --> <dependency> <groupId>hibernate</groupId> <artifactId>hibernate3</artifactId> <!-- NOTE: The version is defined in the root POM's dependencyManagement section. --> - <scope>provided</scope> <!-- by JBossAS --> + <scope>compile</scope> </dependency>
<dependency> @@ -51,7 +52,7 @@ <!-- NOTE: The version is defined in the root POM's dependencyManagement section. --> <scope>provided</scope> <!-- by JBossAS --> </dependency> - + <!-- required by PersistenceUtil and EJB3 Embedded --> <dependency> <groupId>hibernate-entitymanager</groupId> @@ -72,6 +73,23 @@ <artifactId>jaxb-api</artifactId> <!-- NOTE: The version is defined in the root POM's dependencyManagement section. --> </dependency> + + <!-- needed for hibernate Instrument task + <dependency> + <groupId>javassist</groupId> + <artifactId>javassist</artifactId> + <version>${jboss-javassist.version}</version> + <scope>runtime</scope> + </dependency> + --> + + <!-- needed for hibernate Instrument task + <dependency> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + <scope>runtime</scope> + </dependency> + -->
<!-- needed if you want to use the logging JDBC wrapper <dependency> @@ -94,6 +112,13 @@ <!--================ Test Deps ================-->
<dependency> + <groupId>javassist</groupId> + <artifactId>javassist</artifactId> + <version>${jboss-javassist.version}</version> + <scope>test</scope> + </dependency> + + <dependency> <groupId>postgresql</groupId> <artifactId>postgresql</artifactId> <!-- NOTE: The version is defined in the root POM's dependencyManagement section. --> @@ -175,13 +200,6 @@ </dependency>
<dependency> - <groupId>jboss</groupId> - <artifactId>javassist</artifactId> - <version>3.4.ga</version> - <scope>test</scope> - </dependency> - - <dependency> <groupId>oswego-concurrent</groupId> <artifactId>concurrent</artifactId> <version>1.3.4</version> @@ -222,10 +240,8 @@ <version>2.0</version> </dependency>-->
- </dependencies>
- <build>
<finalName>rhq-core-domain-ejb3</finalName> @@ -249,7 +265,6 @@
<plugins>
- <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>gwt-maven-plugin</artifactId> @@ -317,26 +332,45 @@ <plugins>
<plugin> - <artifactId>maven-antrun-plugin</artifactId> - <version>1.1</version> - <executions> + <artifactId>maven-antrun-plugin</artifactId> + <version>1.1</version> + <executions>
<execution> - <id>deploy</id> - <phase>compile</phase> + <phase>process-classes</phase> <configuration> - <tasks> - <property name="deployment.dir" location="${rhq.deploymentDir}" /> - <echo>*** Copying updated files from target${file.separator}classes${file.separator} to ${deployment.dir}${file.separator}...</echo> - <copy todir="${deployment.dir}" verbose="${rhq.verbose}"> - <fileset dir="target/classes" /> - </copy> - </tasks> + <tasks> + <!-- don't instrument... + I'm leaving this here as an example of how to apply Hibernate Instrumentation to a class. + Instrumentation is useful for various property-level things such as field-level lazy load. + Using it turned out not t be a current option since the instrumented class carries with + it hibernate imports that we can't put in the domain jar since it's used on the Agent and + in Remote Java Clients. But this worked, so here ya go... + <taskdef + name="instrument" + classname="org.hibernate.tool.instrument.javassist.InstrumentTask"> + <classpath> + <path refid="maven.runtime.classpath" /> + <path refid="maven.plugin.classpath" /> + </classpath> + </taskdef> + <instrument verbose="true"> + <fileset dir="${project.build.outputDirectory}"> + <include name="**/domain/**/PackageBits.class" /> + </fileset> + </instrument> + --> + <property name="deployment.dir" location="${rhq.deploymentDir}" /> + <echo>*** Copying updated files from target${file.separator}classes${file.separator} to ${deployment.dir}${file.separator}...</echo> + <copy todir="${deployment.dir}" verbose="${rhq.verbose}"> + <fileset dir="target/classes" /> + </copy> + </tasks> </configuration> <goals> - <goal>run</goal> + <goal>run</goal> </goals> - </execution> + </execution>
<execution> <id>undeploy</id> @@ -353,7 +387,7 @@ </goals> </execution>
- </executions> + </executions> </plugin>
</plugins> diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/content/PackageBits.java b/modules/core/domain/src/main/java/org/rhq/core/domain/content/PackageBits.java index 17ad568..5cc2ff9 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/content/PackageBits.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/content/PackageBits.java @@ -24,17 +24,14 @@ package org.rhq.core.domain.content;
import java.io.Serializable;
-import javax.persistence.Basic; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.FetchType; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; import javax.persistence.Id; -import javax.persistence.Lob; +import javax.persistence.JoinColumn; import javax.persistence.NamedQueries; import javax.persistence.NamedQuery; -import javax.persistence.SequenceGenerator; +import javax.persistence.OneToOne; import javax.persistence.Table; import javax.xml.bind.annotation.XmlTransient;
@@ -42,22 +39,25 @@ import javax.xml.bind.annotation.XmlTransient; * Contains the actual package contents ("the bits") for a particular {@link PackageVersion}. * * @author John Mazzitelli + * @author Jay Shaughnessy */ @Entity @NamedQueries( { - @NamedQuery(name = PackageBits.QUERY_PACKAGE_BITS_LOADED_STATUS_PACKAGE_VERSION_ID, query = "SELECT new org.rhq.core.domain.content.composite.LoadedPackageBitsComposite( " - + " pv.id, " - + " pv.fileName, " + @NamedQuery(name = PackageBits.QUERY_PACKAGE_BITS_LOADED_STATUS_PACKAGE_VERSION_ID, query = "" // + + " SELECT new org.rhq.core.domain.content.composite.LoadedPackageBitsComposite( " // + + " pv.id, " // + + " pv.fileName, " // + " pv.packageBits.id, " - + " (SELECT count(pb.id) FROM pv.packageBits pb WHERE pb.bits IS NOT NULL) " - + " ) " - + " FROM PackageVersion pv " + " WHERE pv.id = :id "), + + " (SELECT count(pb.id) FROM pv.packageBits pb WHERE pb.blob.bits IS NOT NULL) " // + + " ) " // + + " FROM PackageVersion pv " + " WHERE pv.id = :id "),
// deletes orphaned package bits - that is, if they have no associated package version - @NamedQuery(name = PackageBits.DELETE_IF_NO_PACKAGE_VERSION, query = "DELETE PackageBits AS pb " - + " WHERE pb.id NOT IN ( SELECT pv.packageBits.id " + " FROM PackageVersion pv " + @NamedQuery(name = PackageBits.DELETE_IF_NO_PACKAGE_VERSION, query = "" // + + " DELETE PackageBits AS pb " // + + " WHERE pb.id NOT IN ( SELECT pv.packageBits.id " // + + " FROM PackageVersion pv " // + " WHERE pv.packageBits IS NOT NULL ) ") }) -@SequenceGenerator(name = "SEQ", sequenceName = "RHQ_PACKAGE_BITS_ID_SEQ") @Table(name = PackageBits.TABLE_NAME) public class PackageBits implements Serializable { public static final String TABLE_NAME = "RHQ_PACKAGE_BITS"; @@ -65,18 +65,30 @@ public class PackageBits implements Serializable { public static final String QUERY_PACKAGE_BITS_LOADED_STATUS_PACKAGE_VERSION_ID = "PackageBits.isLoaded"; public static final String DELETE_IF_NO_PACKAGE_VERSION = "PackageBits.deleteIfNoPackageVersion";
+ /** + * Can be used as initial contents for a PackageVersion's PackageBits whenever a predictable non-null + * value is required. Use as an initial value for the PackageBits.blob.bits. The value will + * typically be replaced with the actual streamed content bits...<br> + * Note: This is a String and not a byte[] because gwt can't handle String.getBytes(). + */ + public static final String EMPTY_BLOB = "EmptyBlob"; + private static final long serialVersionUID = 1L;
+ // Note that the persistance for this table is done through the PackageBitsBlob entity to avoid + // constraint violations. @Column(name = "ID", nullable = false) - @GeneratedValue(strategy = GenerationType.AUTO, generator = "SEQ") @Id private int id;
- @Lob - @Basic(fetch = FetchType.LAZY) - @Column(name = "BITS", nullable = true) + // To get lazy load semantics for the Lob field we would need to instrument the class. We can't do that + // because it introduces hibernate class dependencies into the domain jar. As a workaround, we access + // the Lob through a required relational mapping *to ourself*. + // Note: To get Lazy load on xxxToOne mappings "optional=false" must be declared! + @JoinColumn(name = "ID", referencedColumnName = "ID", nullable = false) + @OneToOne(optional = false, fetch = FetchType.LAZY) @XmlTransient - private byte[] bits; + private PackageBitsBlob blob;
public PackageBits() { // for JPA use @@ -91,24 +103,21 @@ public class PackageBits implements Serializable { }
/** - * The actual content of the package ("the bits"). If the package content is not stored in the database, this will - * return <code>null</code>. In this case, the content is probably stored somewhere else on a local file system. - * When <code>null</code> is returned, it is assumed that who ever needs the content can know where to find it based - * on the {@link PackageVersion} details. + * @return the blob wrapper. This is never null although the actual bits (PackageBitsBlob.getBits()) can be null. * * For large file contents, you should use ContentManager.updateBlobStream() to write and * ContentManager.writeBlobOutToStream() to read/direct file contents into as no byte[] is used. */ @XmlTransient - public byte[] getBits() { - return bits; + public PackageBitsBlob getBlob() { + return blob; }
- /** For large file contents, you should use ContentManager.updateBlobStream() to write and - * ContentManager.writeBlobOutToStream() to read/direct file contents into as no byte[] is used. - * + /** + * For large file contents, you should use ContentManager.updateBlobStream() to write and + * ContentManager.writeBlobOutToStream() to stream the binary bits and avoid a byte[]. */ - public void setBits(byte[] bits) { - this.bits = bits; + public void setBlob(PackageBitsBlob blob) { + this.blob = blob; } } \ No newline at end of file diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/content/PackageBitsBlob.java b/modules/core/domain/src/main/java/org/rhq/core/domain/content/PackageBitsBlob.java new file mode 100644 index 0000000..4252e97 --- /dev/null +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/content/PackageBitsBlob.java @@ -0,0 +1,107 @@ +/* + * RHQ Management Platform + * Copyright (C) 2005-2008 Red Hat, Inc. + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License, version 2, as + * published by the Free Software Foundation, and/or the GNU Lesser + * General Public License, version 2.1, also as published by the Free + * Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License and the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License + * and the GNU Lesser General Public License along with this program; + * if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +package org.rhq.core.domain.content; + +import java.io.Serializable; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Lob; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.xml.bind.annotation.XmlTransient; + +/** + * The actual Lob contents for a PackageBits entity. Note that PackageBits and PackageBitsBlob are two + * entities that *share* the same db row. This is done to allow for Lazy load semantics on the Lob. Hibernate + * does not honor field-level Lazy load on a Lob (or any field) unless the entity class is instrumented. + * We can't use that approach because it introduces Hibernate imports into the domain class, and that violates our + * restriction of exposing hibernate classes to the Agent and Remote clients. As a workaround we pull the Lob into + * its own entity and access it through a relational mapping. Note that the entities share the same Id since they + * share the same physical row. The row is persisted via this class and as such the sequence is declared here. Creating + * this entity first allows us to satisfy the required 1-1 mapping in {@link PackageBits}. + * <br> + * Related Links: + * <br>http://docs.jboss.org/hibernate/stable/core/reference/en/html/performance.ht... + * <br>http://community.jboss.org/wiki/Someexplanationsonlazyloadingone-to-one + * <br>http://docs.jboss.org/hibernate/stable/annotations/reference/en/html_single/... + * <br>http://community.jboss.org/wiki/AShortPrimerOnFetchingStrategies + * <br>http://docs.codehaus.org/display/MAVENUSER/Howto+instrument+domain+model+cla... + * + * @author Jay Shaughnessy + */ +@Entity +@SequenceGenerator(name = "SEQ", sequenceName = "RHQ_PACKAGE_BITS_ID_SEQ") +@Table(name = PackageBits.TABLE_NAME) +public class PackageBitsBlob implements Serializable { + public static final String TABLE_NAME = "RHQ_PACKAGE_BITS"; + + private static final long serialVersionUID = 1L; + + @Column(name = "ID", nullable = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "SEQ") + @Id + private int id; + + @Lob + @Column(name = "BITS") + @XmlTransient + private byte[] bits; + + public PackageBitsBlob() { + // for JPA use + } + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + /** + * The actual content of the package ("the bits"). If the package content is not stored in the database, this will + * return <code>null</code>. In this case, the content is probably stored somewhere else on a local file system. + * When <code>null</code> is returned, it is assumed that who ever needs the content can know where to find it based + * on the {@link PackageVersion} details. + * + * For large file contents, you should use ContentManager.updateBlobStream() to write and + * ContentManager.writeBlobOutToStream() to read/direct file contents into as no byte[] is used. + */ + @XmlTransient + public byte[] getBits() { + return bits; + } + + /** + * For large file contents, you should use ContentManager.updateBlobStream() to write and + * ContentManager.writeBlobOutToStream() to stream the binary bits and avoid a byte[]. + */ + public void setBits(byte[] bits) { + this.bits = bits; + } +} \ No newline at end of file diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/content/PackageVersion.java b/modules/core/domain/src/main/java/org/rhq/core/domain/content/PackageVersion.java index 6db423a..f05b36c 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/content/PackageVersion.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/content/PackageVersion.java @@ -39,6 +39,7 @@ import javax.persistence.OneToMany; import javax.persistence.OneToOne; import javax.persistence.SequenceGenerator; import javax.persistence.Table; +import javax.xml.bind.annotation.XmlTransient;
import org.hibernate.annotations.NamedQueries; import org.hibernate.annotations.NamedQuery; @@ -177,7 +178,7 @@ import org.rhq.core.domain.resource.ProductVersion; + " AND pv.repoPackageVersions IS EMPTY " + " AND pv.installedPackages IS EMPTY " + " AND pv.installedPackageHistory IS EMPTY " - + " AND pb.bits IS NULL "), + + " AND pb.blob.bits IS NULL "), @NamedQuery(name = PackageVersion.QUERY_FIND_COMPOSITE_BY_ID, query = "SELECT new org.rhq.core.domain.content.composite.PackageVersionComposite( " + " pv, " + " pv.generalPackage.packageType.name, " @@ -186,7 +187,7 @@ import org.rhq.core.domain.resource.ProductVersion; + " pv.architecture.name, " + " pv.generalPackage.classification, " + " pv.packageBits.id, " - + " (SELECT count(pb.id) FROM pv.packageBits pb WHERE pb.bits IS NOT NULL) " + + " (SELECT count(pb.id) FROM pv.packageBits pb WHERE pb.blob.bits IS NOT NULL) " + " ) " + " FROM PackageVersion pv WHERE pv.id = :id "), @NamedQuery(name = PackageVersion.QUERY_FIND_COMPOSITE_BY_ID_WITH_PROPS, query = "SELECT new org.rhq.core.domain.content.composite.PackageVersionComposite( " @@ -198,7 +199,7 @@ import org.rhq.core.domain.resource.ProductVersion; + " pv.architecture.name, " + " pv.generalPackage.classification, " + " pv.packageBits.id, " - + " (SELECT count(pb.id) FROM pv.packageBits pb WHERE pb.bits IS NOT NULL) " + + " (SELECT count(pb.id) FROM pv.packageBits pb WHERE pb.blob.bits IS NOT NULL) " + " ) " + " FROM PackageVersion pv WHERE pv.id = :id"), @NamedQuery(name = PackageVersion.QUERY_FIND_COMPOSITES_BY_IDS, query = "SELECT new org.rhq.core.domain.content.composite.PackageVersionComposite( " @@ -343,8 +344,10 @@ public class PackageVersion implements Serializable { @OneToMany(mappedBy = "packageVersion", fetch = FetchType.LAZY) private Set<InstalledPackageHistory> installedPackageHistory;
+ // No longer use cascade PERSIST on this. We'll associate it manually due to intracacies in blob handling @JoinColumn(name = "PACKAGE_BITS_ID", referencedColumnName = "ID", nullable = true) - @OneToOne(cascade = { CascadeType.REMOVE, CascadeType.PERSIST }, fetch = FetchType.LAZY) + @OneToOne(cascade = { CascadeType.REMOVE }, fetch = FetchType.LAZY) + @XmlTransient private PackageBits packageBits; // do NOT eager load this - is has the BLOB contents of the package
@OneToMany(mappedBy = "packageVersion", cascade = { CascadeType.REMOVE }, fetch = FetchType.LAZY) @@ -654,6 +657,7 @@ public class PackageVersion implements Serializable { * of an entity manager session. If you do, this will load in the {@link PackageBits} object which potentially will * load the entire package's contents in memory (and thus, if large enough, will cause an OutOfMemoryError). */ + @XmlTransient public PackageBits getPackageBits() { return packageBits; } diff --git a/modules/core/domain/src/test/java/org/rhq/core/domain/content/test/PackageVersionContentSourceTest.java b/modules/core/domain/src/test/java/org/rhq/core/domain/content/test/PackageVersionContentSourceTest.java index 59cc693..0903628 100644 --- a/modules/core/domain/src/test/java/org/rhq/core/domain/content/test/PackageVersionContentSourceTest.java +++ b/modules/core/domain/src/test/java/org/rhq/core/domain/content/test/PackageVersionContentSourceTest.java @@ -37,6 +37,7 @@ import org.rhq.core.domain.content.ContentSource; import org.rhq.core.domain.content.ContentSourceType; import org.rhq.core.domain.content.Package; import org.rhq.core.domain.content.PackageBits; +import org.rhq.core.domain.content.PackageBitsBlob; import org.rhq.core.domain.content.PackageType; import org.rhq.core.domain.content.PackageVersion; import org.rhq.core.domain.content.PackageVersionContentSource; @@ -240,7 +241,7 @@ public class PackageVersionContentSourceTest extends AbstractEJB3Test { Architecture arch = new Architecture("testPVCSInsertArch"); PackageType pt = new PackageType("testPVCSInsertPT", resource.getResourceType()); Package pkg = new Package("testPVCSInsertPackage", pt); - PackageBits bits = new PackageBits(); + PackageBits bits = createPackageBits(em); PackageVersion pv = new PackageVersion(pkg, "version", arch); ContentSourceType cst = new ContentSourceType("testPVCSContentSourceType"); ContentSource cs = new ContentSource("testPVCSContentSource", cst); @@ -254,8 +255,8 @@ public class PackageVersionContentSourceTest extends AbstractEJB3Test { pvConfig.put(new PropertySimple("pvConfig1", "pvConfig1Value")); pv.setExtraProperties(pvConfig);
- bits.setBits("testDeleteOrphanedPV".getBytes()); - pv.setPackageBits(bits); // this will cascade on persist + bits.getBlob().setBits("testDeleteOrphanedPV".getBytes()); + pv.setPackageBits(bits);
em.persist(rt); em.persist(resource); @@ -289,7 +290,7 @@ public class PackageVersionContentSourceTest extends AbstractEJB3Test { em.close(); assert findBits != null : "The bits did not cascade-persist for some reason"; assert findBits.getId() > 0 : "The package bits did not cascade-persist for some reason!"; - assert new String(bits.getBits()).equals(new String(findBits.getBits())); + assert new String(bits.getBlob().getBits()).equals(new String(findBits.getBlob().getBits()));
em = getEntityManager(); q = em.createNamedQuery(PackageVersion.DELETE_IF_NO_CONTENT_SOURCES_OR_REPOS); @@ -309,4 +310,25 @@ public class PackageVersionContentSourceTest extends AbstractEJB3Test { getTransactionManager().rollback(); } } + + private PackageBits createPackageBits(EntityManager em) { + PackageBits bits = null; + PackageBitsBlob blob = null; + + // We have to work backwards to avoid constraint violations. PackageBits requires a PackageBitsBlob, + // so create and persist that first, getting the ID + blob = new PackageBitsBlob(); + em.persist(blob); + + // Now create the PackageBits entity and assign the Id and blob. Note, do not persist the + // entity, the row already exists. Just perform and flush the update. + bits = new PackageBits(); + bits.setId(blob.getId()); + bits.setBlob(blob); + em.flush(); + + // return the new PackageBits and associated PackageBitsBlob + return bits; + } + } \ No newline at end of file diff --git a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/content/ContentManager.java b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/content/ContentManager.java index f92face..5fdcb4e 100644 --- a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/content/ContentManager.java +++ b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/content/ContentManager.java @@ -265,7 +265,7 @@ public class ContentManager extends AgentService implements ContainerService, Co ContentContextImpl contextImpl = (ContentContextImpl) context; // this has to be of this type, we gave it to the plugin ContentServerService serverService = getContentServerService();
- //we need to load the content to server before we will start download the content + // we need to load the content to server before we will start download the content // it is because of timeout on remoteStreams serverService.preLoadRemoteContent(contextImpl.getResourceId(), packageDetailsKey);
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerBean.java index 2c01712..11d69e9 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerBean.java @@ -71,6 +71,7 @@ import org.rhq.core.domain.content.InstalledPackageHistory; import org.rhq.core.domain.content.InstalledPackageHistoryStatus; import org.rhq.core.domain.content.Package; import org.rhq.core.domain.content.PackageBits; +import org.rhq.core.domain.content.PackageBitsBlob; import org.rhq.core.domain.content.PackageDetailsKey; import org.rhq.core.domain.content.PackageInstallationStep; import org.rhq.core.domain.content.PackageType; @@ -808,12 +809,13 @@ public class ContentManagerBean implements ContentManagerLocal, ContentManagerRe try { InstalledPackage installedPackage = entityManager.find(InstalledPackage.class, installedPackageId); PackageBits bits = installedPackage.getPackageVersion().getPackageBits(); - if (bits == null || bits.getBits().length == 0) { + if (bits == null || bits.getBlob().getBits().length == 0) { long start = System.currentTimeMillis(); retrieveBitsFromResource(user, resourceId, installedPackageId);
bits = installedPackage.getPackageVersion().getPackageBits(); - while ((bits == null || bits.getBits() == null) && (System.currentTimeMillis() - start < 30000)) { + while ((bits == null || bits.getBlob().getBits() == null) + && (System.currentTimeMillis() - start < 30000)) { try { Thread.sleep(2000); } catch (InterruptedException e) { @@ -830,13 +832,12 @@ public class ContentManagerBean implements ContentManagerLocal, ContentManagerRe
}
- return bits.getBits(); + return bits.getBlob().getBits(); } catch (Exception e) { throw new RuntimeException("Unable to retrieve package bits for resource: " + resourceId + " and package: " + installedPackageId + " before timeout.");
} - }
public List<DeployPackageStep> translateInstallationSteps(int resourceId, ResourcePackageDetails packageDetails) @@ -917,11 +918,7 @@ public class ContentManagerBean implements ContentManagerLocal, ContentManagerRe try { log.debug("Saving content for response: " + response);
- PackageBits packageBits = new PackageBits(); - entityManager.persist(packageBits); - - packageVersion.setPackageBits(packageBits); - entityManager.flush(); // push the new package bits row to the DB + PackageBits packageBits = initializePackageBits(null);
// Could use the following, but only on jdk6 as builds // @since 1.6 @@ -947,8 +944,8 @@ public class ContentManagerBean implements ContentManagerLocal, ContentManagerRe } bits = loadPackageBits(bitStream, packageVersion.getId(), pkgName, packageVersion.getVersion(), bits, null); - entityManager.merge(bits);
+ entityManager.merge(bits); } finally {
if (ps != null) { @@ -1504,6 +1501,7 @@ public class ContentManagerBean implements ContentManagerLocal, ContentManagerRe * as the agent side discovery mechanism, and passes in additional parameters available * when file has been uploaded via the UI. */ + @SuppressWarnings("unchecked") public PackageVersion getUploadedPackageVersion(String packageName, int packageTypeId, String version, int architectureId, InputStream packageBitStream, Map<String, String> packageUploadDetails, int newResourceTypeId) { @@ -1570,6 +1568,7 @@ public class ContentManagerBean implements ContentManagerLocal, ContentManagerRe packageVersion.setMD5(packageUploadDetails.get(ContentManagerBean.UPLOAD_MD5)); packageVersion.setSHA256(packageUploadDetails.get(ContentManagerBean.UPLOAD_SHA256)); } + entityManager.merge(packageVersion); entityManager.flush();
@@ -1586,40 +1585,69 @@ public class ContentManagerBean implements ContentManagerLocal, ContentManagerRe */ @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW) private PackageBits loadPackageBits(InputStream packageBitStream, int packageVersionId, String packageName, - String packageVersion, PackageBits existingPkgBits, Map<String, String> contentDetails) { - PackageBits bits = null; + String packageVersion, PackageBits existingBits, Map<String, String> contentDetails) {
- //use or instantiate PackageBits instance. - if (existingPkgBits == null) { - bits = new PackageBits(); - entityManager.persist(bits); - } else { - bits = existingPkgBits; - } + // use existing or instantiate PackageBits instance. + PackageBits bits = (null == existingBits) ? initializePackageBits(null) : existingBits;
//locate related packageVersion PackageVersion pv = entityManager.find(PackageVersion.class, packageVersionId);
- //associate the two if located + //associate the two if located. if (pv != null) {//np check. pv.setPackageBits(bits); entityManager.flush(); }
- bits = entityManager.find(PackageBits.class, bits.getId()); - //write data from stream into db using Hibernate Blob mechanism updateBlobStream(packageBitStream, bits, contentDetails);
return bits; }
+ /** + * This creates a new PackageBits entity initialized to EMPTY_BLOB for the associated PackageBitsBlob. + * Note that PackageBits and PackageBitsBlob are two entities that *share* the same db row. This is + * done to allow for Lazy load semantics on the Lob. Hibernate does not honor field-level Lazy load + * on a Lob unless the entity class is instrumented. We can't usethat approach because it introduces + * hibernate imports into the domain class, and that violates our restriction of exposing hibernate + * classes to the Agent and Remote clients. + * + * @return + */ + private PackageBits initializePackageBits(PackageBits bits) { + if (null == bits) { + PackageBitsBlob blob = null; + + // We have to work backwards to avoid constraint violations. PackageBits requires a PackageBitsBlob, + // so create and persist that first, getting the ID + blob = new PackageBitsBlob(); + blob.setBits(PackageBits.EMPTY_BLOB.getBytes()); + entityManager.persist(blob); + + // Now create the PackageBits entity and assign the Id and blob. Note, do not persist the + // entity, the row already exists. Just perform and flush the update. + bits = new PackageBits(); + bits.setId(blob.getId()); + bits.setBlob(blob); + } else { + PackageBitsBlob blob = entityManager.find(PackageBitsBlob.class, bits.getId()); + // don't bother testing for null, that may pull a large blob, just make sure it's not null + blob.setBits(PackageBits.EMPTY_BLOB.getBytes()); + } + + // write to the db and return the new PackageBits and associated PackageBitsBlob + entityManager.flush(); + return bits; + } + /** Takes an input stream and copies it into the PackageBits table using Hibernate * Blob mechanism with PreparedStatements. As all content into Bits are not stored as type OID, t * * @param stream * @param contentDetails Map to store content details in used in PackageVersioning */ + @SuppressWarnings("unused") public void updateBlobStream(InputStream stream, PackageBits bits, Map<String, String> contentDetails) {
//TODO: are there any db specific limits that we should check/verify here before stuffing @@ -1628,29 +1656,18 @@ public class ContentManagerBean implements ContentManagerLocal, ContentManagerRe if (stream == null) { return; // no stream content to update. } - if (bits == null) { - bits = new PackageBits(); - }
- //persist to db if not already - if (bits.getId() <= 0) { - entityManager.persist(bits); - } + bits = initializePackageBits(bits);
- //locate the existing PackageBits instance + //locate the existing PackageBitsBlob instance bits = entityManager.find(PackageBits.class, bits.getId()); - - ///initialize Bits field so non-empty. - bits.setBits(new String("a").getBytes()); - entityManager.merge(bits); - entityManager.flush(); + PackageBitsBlob blob = bits.getBlob();
//Create prepared statements to work with Blobs and hibernate. Connection conn = null; PreparedStatement ps = null; PreparedStatement ps2 = null; try { - conn = dataSource.getConnection();
//we are loading the PackageBits saved in the previous step @@ -1663,7 +1680,7 @@ public class ContentManagerBean implements ContentManagerLocal, ContentManagerRe
//We can not create a blob directly because BlobImpl from Hibernate is not acceptable //for oracle and Connection.createBlob is not working on postgres. - //This blob will be not empty because we saved there a bytes from String("a"). + //This blob will be not empty because we saved there PackageBits.EMPTY_BLOB Blob blb = rs.getBlob(1);
//copy the stream to the Blob @@ -1721,45 +1738,11 @@ public class ContentManagerBean implements ContentManagerLocal, ContentManagerRe } }
+ // not sure this merge (or others like it in this file are necessary... entityManager.merge(bits); entityManager.flush(); }
- /**Writes the contents of a the Blob out to the stream passed in. - * - * @param stream non null stream where contents to be written to. - */ - public void writeBlobOutToStream(OutputStream stream, PackageBits bits, boolean closeStreams) { - - if (stream == null) { - return; // no locate to write to - } - if ((bits == null) || (bits.getId() <= 0)) { - //then PackageBits instance passed in is insufficiently initialized. - log.warn("PackageBits insufficiently initialized. No data to write out."); - return; - } - try { - //open connection - Connection conn = dataSource.getConnection(); - - //prepared statement for retrieval of Blob.bits - PreparedStatement ps = conn - .prepareStatement("SELECT BITS FROM " + PackageBits.TABLE_NAME + " WHERE ID = ?"); - ps.setInt(1, bits.getId()); - ResultSet results = ps.executeQuery(); - if (results.next()) { - //retrieve the Blob - Blob blob = results.getBlob(1); - //now copy the contents to the stream passed in - StreamUtil.copy(blob.getBinaryStream(), stream, closeStreams); - } - } catch (Exception ex) { - log.error("An error occurred while writing Blob contents out to stream :" + ex.getMessage()); - ex.printStackTrace(); - } - } - /** Functions same as StreamUtil.copy(), but calculates SHA hash and file size and write it to * the Map<String,String> passed in. * @@ -1818,4 +1801,41 @@ public class ContentManagerBean implements ContentManagerLocal, ContentManagerRe return numBytesCopied; }
+ /** For Testing only<br><br> + * + * Writes the contents of a the Blob out to the stream passed in. + * + * @param stream non null stream where contents to be written to. + */ + public void writeBlobOutToStream(OutputStream stream, PackageBits bits, boolean closeStreams) { + + if (stream == null) { + return; // no locate to write to + } + if ((bits == null) || (bits.getId() <= 0)) { + //then PackageBits instance passed in is insufficiently initialized. + log.warn("PackageBits insufficiently initialized. No data to write out."); + return; + } + try { + //open connection + Connection conn = dataSource.getConnection(); + + //prepared statement for retrieval of Blob.bits + PreparedStatement ps = conn + .prepareStatement("SELECT BITS FROM " + PackageBits.TABLE_NAME + " WHERE ID = ?"); + ps.setInt(1, bits.getId()); + ResultSet results = ps.executeQuery(); + if (results.next()) { + //retrieve the Blob + Blob blob = results.getBlob(1); + //now copy the contents to the stream passed in + StreamUtil.copy(blob.getBinaryStream(), stream, closeStreams); + } + } catch (Exception ex) { + log.error("An error occurred while writing Blob contents out to stream :" + ex.getMessage()); + ex.printStackTrace(); + } + } + } \ No newline at end of file diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerLocal.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerLocal.java index 0b0e5a5..f4387ce 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerLocal.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerLocal.java @@ -345,6 +345,9 @@ public interface ContentManagerLocal { */ InstalledPackage getBackingPackageForResource(Subject subject, int resourceId);
+ /** + * @see {@link ContentManagerRemote#getPackageBytes(Subject, int, int) + */ byte[] getPackageBytes(Subject user, int resourceId, int installedPackageId);
void writeBlobOutToStream(OutputStream stream, PackageBits bits, boolean closeStreams); diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerRemote.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerRemote.java index 1b28633..087b5bf 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerRemote.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerRemote.java @@ -159,6 +159,13 @@ public interface ContentManagerRemote { @WebParam(name = "subject") Subject subject, // @WebParam(name = "resourceId") int resourceId);
+ /** + * This can be a dangerous call for large packages as the entire package will attempt to be loaded. + * @param user + * @param resourceId + * @param installedPackageId + * @return the package bytes + */ @WebMethod byte[] getPackageBytes(@WebParam(name = "subject") Subject user, @WebParam(name = "resourceId") int resourceId, @WebParam(name = "installedPackageId") int installedPackageId); diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentSourceManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentSourceManagerBean.java index c57932c..4160793 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentSourceManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentSourceManagerBean.java @@ -52,8 +52,10 @@ import javax.sql.DataSource;
import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; + import org.jboss.annotation.ejb.TransactionTimeout; import org.jboss.util.StringPropertyReplacer; + import org.rhq.core.domain.auth.Subject; import org.rhq.core.domain.authz.Permission; import org.rhq.core.domain.content.Advisory; @@ -70,6 +72,7 @@ import org.rhq.core.domain.content.DistributionType; import org.rhq.core.domain.content.DownloadMode; import org.rhq.core.domain.content.Package; import org.rhq.core.domain.content.PackageBits; +import org.rhq.core.domain.content.PackageBitsBlob; import org.rhq.core.domain.content.PackageDetailsKey; import org.rhq.core.domain.content.PackageType; import org.rhq.core.domain.content.PackageVersion; @@ -379,6 +382,7 @@ public class ContentSourceManagerBean implements ContentSourceManagerLocal { query.setParameter("id", contentSourceId); countQuery.setParameter("id", contentSourceId);
+ @SuppressWarnings("unchecked") List<Repo> results = query.getResultList(); long count = (Long) countQuery.getSingleResult();
@@ -788,7 +792,7 @@ public class ContentSourceManagerBean implements ContentSourceManagerLocal { throw new RuntimeException(t); } } - + @RequiredPermission(Permission.MANAGE_INVENTORY) @TransactionAttribute(TransactionAttributeType.REQUIRED) @TransactionTimeout(90 * 60) @@ -831,23 +835,18 @@ public class ContentSourceManagerBean implements ContentSourceManagerLocal { PreparedStatement ps = null; PreparedStatement ps2 = null; try { - packageBits = new PackageBits(); - //we need to save not null value so that we can in next step load the value as a Blob - packageBits.setBits(new String("a").getBytes()); - entityManager.persist(packageBits); + packageBits = createPackageBits(pk.getContentSource().getDownloadMode() == DownloadMode.DATABASE);
PackageVersion pv = entityManager.find(PackageVersion.class, packageVersionId); - pv.setPackageBits(packageBits); - - entityManager.flush(); // push the new package bits row to the DB + pv.setPackageBits(packageBits); // associate the entities + entityManager.flush(); // may not be necessary
if (pk.getContentSource().getDownloadMode() == DownloadMode.DATABASE) { - - // bitsStream = null; conn = dataSource.getConnection(); - //we are loading the PackageBits saved in the previous step - //we need to lock the row which will be updated so we are using FOR UPDATE - ps = conn.prepareStatement("SELECT BITS FROM " + PackageBits.TABLE_NAME + " WHERE ID = ? FOR UPDATE"); + // The blob has been initialized to EMPTY_BLOB already by createPackageBits... + // we need to lock the row which will be updated so we are using FOR UPDATE + ps = conn.prepareStatement("SELECT BITS FROM " + PackageBits.TABLE_NAME + + " WHERE ID = ? FOR UPDATE"); ps.setInt(1, packageBits.getId()); ResultSet rs = ps.executeQuery(); if (rs != null) { @@ -858,12 +857,13 @@ public class ContentSourceManagerBean implements ContentSourceManagerLocal { Blob blb = rs.getBlob(1);
StreamUtil.copy(bitsStream, blb.setBinaryStream(1), true); - ps2 = conn.prepareStatement("UPDATE " + PackageBits.TABLE_NAME + " SET bits = ? where id = ?"); + ps2 = conn.prepareStatement("UPDATE " + PackageBits.TABLE_NAME + + " SET bits = ? where id = ?"); ps2.setBlob(1, blb); ps2.setInt(2, packageBits.getId()); if (ps2.execute()) { throw new Exception("Did not download the package bits to the DB for "); - } + } ps2.close(); } } @@ -947,17 +947,50 @@ public class ContentSourceManagerBean implements ContentSourceManagerLocal { return packageBits; }
- private InputStream preloadPackageBits(PackageVersionContentSource pvcs) throws Exception{ + /** + * This creates a new PackageBits entity initialized to EMPTY_BLOB for the associated PackageBitsBlob. + * Note that PackageBits and PackageBitsBlob are two entities that *share* the same db row. This is + * done to allow for Lazy load semantics on the Lob. Hibernate does not honor field-level Lazy load + * on a Lob unless the entity class is instrumented. We can't usethat approach because it introduces + * hibernate imports into the domain class, and that violates our restriction of exposing hibernate + * classes to the Agent and Remote clients. + * + * @return + */ + private PackageBits createPackageBits(boolean initialize) { + PackageBits bits = null; + PackageBitsBlob blob = null; + + // We have to work backwards to avoid constraint violations. PackageBits requires a PackageBitsBlob, + // so create and persist that first, getting the ID + blob = new PackageBitsBlob(); + if (initialize) { + blob.setBits(PackageBits.EMPTY_BLOB.getBytes()); + } + entityManager.persist(blob); + + // Now create the PackageBits entity and assign the Id and blob. Note, do not persist the + // entity, the row already exists. Just perform and flush the update. + bits = new PackageBits(); + bits.setId(blob.getId()); + bits.setBlob(blob); + entityManager.flush(); + + // return the new PackageBits and associated PackageBitsBlob + return bits; + } + + private InputStream preloadPackageBits(PackageVersionContentSource pvcs) throws Exception { PackageVersionContentSourcePK pk = pvcs.getPackageVersionContentSourcePK(); - int contentSourceId = pk.getContentSource().getId(); + int contentSourceId = pk.getContentSource().getId(); int packageVersionId = pk.getPackageVersion().getId(); String packageVersionLocation = pvcs.getLocation(); - + ContentServerPluginContainer pc = ContentManagerHelper.getPluginContainer(); InputStream bitsStream = pc.getAdapterManager().loadPackageBits(contentSourceId, packageVersionLocation); - + PackageVersion pv = entityManager.find(PackageVersion.class, packageVersionId); - + switch (pk.getContentSource().getDownloadMode()) { case NEVER: { return null; // no-op, our content source was told to never download package bits @@ -971,7 +1004,7 @@ public class ContentSourceManagerBean implements ContentSourceManagerLocal { OutputStream tempStream = new BufferedOutputStream(new FileOutputStream(tempFile)); StreamUtil.copy(bitsStream, tempStream, true); InputStream inp = new BufferedInputStream(new FileInputStream(tempFile)); - return inp; + return inp; }
case FILESYSTEM: { @@ -989,8 +1022,8 @@ public class ContentSourceManagerBean implements ContentSourceManagerLocal { String actualMD5 = MessageDigestGenerator.getDigestString(outputFile); if (!expectedMD5.trim().toLowerCase().equals(actualMD5.toLowerCase())) { log.error("Already have package bits for [" + pv + "] located at [" + outputFile - + "] but the MD5 hashcodes do not match. Expected MD5=[" + expectedMD5 - + "], Actual MD5=[" + actualMD5 + "] - redownloading package"); + + "] but the MD5 hashcodes do not match. Expected MD5=[" + expectedMD5 + "], Actual MD5=[" + + actualMD5 + "] - redownloading package"); download = true; } else { log.info("Asked to download package bits but we already have it at [" + outputFile @@ -1011,65 +1044,63 @@ public class ContentSourceManagerBean implements ContentSourceManagerLocal { throw new IllegalStateException(" Unknown download mode - this is a bug, please report it: " + pvcs); } } - + return null; } - + + // TODO: Just noticing that this method seems pretty redundant with + // downloadPackageBits(Subject subject, PackageVersionContentSource pvcs) and should probably be + // refactored. Also *** the transactional decls below are not being honored because the method + // is not being called through the Local, so not establishing a new transactional context. @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW) @TransactionTimeout(40 * 60) - private PackageBits preparePackageBits(Subject subject,InputStream bitsStream, PackageVersionContentSource pvcs) { + private PackageBits preparePackageBits(Subject subject, InputStream bitsStream, PackageVersionContentSource pvcs) { PackageVersionContentSourcePK pk = pvcs.getPackageVersionContentSourcePK(); int contentSourceId = pk.getContentSource().getId(); int packageVersionId = pk.getPackageVersion().getId(); - String packageVersionLocation = pvcs.getLocation(); + String packageVersionLocation = pvcs.getLocation();
PackageBits packageBits = null;
try { - + Connection conn = null; PreparedStatement ps = null; PreparedStatement ps2 = null; try { - packageBits = new PackageBits(); - - entityManager.persist(packageBits); + packageBits = createPackageBits(pk.getContentSource().getDownloadMode() == DownloadMode.DATABASE);
PackageVersion pv = entityManager.find(PackageVersion.class, packageVersionId); - pv.setPackageBits(packageBits); - - entityManager.flush(); // push the new package bits row to the DB + pv.setPackageBits(packageBits); // associate entities + entityManager.flush(); // not sure this is necessary
if (pk.getContentSource().getDownloadMode() == DownloadMode.DATABASE) { packageBits = entityManager.find(PackageBits.class, packageBits.getId()); - //we need to save not null value so that we can in next step load the value as a Blob - // packageBits.setBits(new String("a").getBytes()); - packageBits.setBits(new String("a").getBytes()); - entityManager.merge(packageBits); - entityManager.flush(); - + conn = dataSource.getConnection(); //we are loading the PackageBits saved in the previous step //we need to lock the row which will be updated so we are using FOR UPDATE - ps = conn.prepareStatement("SELECT BITS FROM " + PackageBits.TABLE_NAME + " WHERE ID = ? FOR UPDATE"); + ps = conn.prepareStatement("SELECT BITS FROM " + PackageBits.TABLE_NAME + + " WHERE ID = ? FOR UPDATE"); ps.setInt(1, packageBits.getId()); ResultSet rs = ps.executeQuery(); if (rs != null) { while (rs.next()) { - + //We can not create a blob directly because BlobImpl from Hibernate is not acceptable //for oracle and Connection.createBlob is not working on postgres. //This blob will be not empty because we saved there a bytes from String("a"). Blob blb = rs.getBlob(1); - + StreamUtil.copy(bitsStream, blb.setBinaryStream(1), false); bitsStream.close(); - ps2 = conn.prepareStatement("UPDATE " + PackageBits.TABLE_NAME + " SET bits = ? where id = ?"); + ps2 = conn.prepareStatement("UPDATE " + PackageBits.TABLE_NAME + + " SET bits = ? where id = ?"); ps2.setBlob(1, blb); ps2.setInt(2, packageBits.getId()); if (ps2.execute()) { throw new Exception("Did not download the package bits to the DB for "); - } + } ps2.close(); } } @@ -1088,7 +1119,7 @@ public class ContentSourceManagerBean implements ContentSourceManagerLocal { + "] on content source [" + contentSourceId + "]"); } } - + if (ps2 != null) { try { ps2.close(); @@ -1132,7 +1163,6 @@ public class ContentSourceManagerBean implements ContentSourceManagerLocal { return contentProviderManager.synchronizeContentProvider(contentSourceId); }
- @SuppressWarnings("unchecked") public ContentSourceSyncResults persistContentSourceSyncResults(ContentSourceSyncResults results) { ContentManagerHelper helper = new ContentManagerHelper(entityManager); Query q = entityManager.createNamedQuery(ContentSourceSyncResults.QUERY_GET_INPROGRESS_BY_CONTENT_SOURCE_ID); @@ -1314,7 +1344,6 @@ public class ContentSourceManagerBean implements ContentSourceManagerLocal { return syncResults; }
- @SuppressWarnings("unchecked") @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW) public RepoSyncResults _mergeAdvisorySyncReportADD(ContentSource contentSource, AdvisorySyncReport report, RepoSyncResults syncResults, StringBuilder progress) { @@ -1511,7 +1540,6 @@ public class ContentSourceManagerBean implements ContentSourceManagerLocal { return syncResults; }
- @SuppressWarnings("unchecked") @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW) public RepoSyncResults _mergePackageSyncReportADD(ContentSource contentSource, Repo repo, Collection<ContentProviderPackageDetails> newPackages, @@ -1827,7 +1855,6 @@ public class ContentSourceManagerBean implements ContentSourceManagerLocal { return syncResults; }
- @SuppressWarnings("unchecked") @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW) public RepoSyncResults _mergeDistributionSyncReportADD(ContentSource contentSource, DistributionSyncReport report, RepoSyncResults syncResults, StringBuilder progress) { @@ -1940,11 +1967,11 @@ public class ContentSourceManagerBean implements ContentSourceManagerLocal { @TransactionTimeout(45 * 60) public long outputPackageVersionBitsRangeGivenResource(int resourceId, PackageDetailsKey packageDetailsKey, OutputStream outputStream, long startByte, long endByte) { - if (startByte < 0) { + if (startByte < 0L) { throw new IllegalArgumentException("startByte[" + startByte + "] < 0"); }
- if ((endByte > -1) && (endByte < startByte)) { + if ((endByte > -1L) && (endByte < startByte)) { throw new IllegalArgumentException("endByte[" + endByte + "] < startByte[" + startByte + "]"); }
@@ -1994,7 +2021,8 @@ public class ContentSourceManagerBean implements ContentSourceManagerLocal { packageVersion.getId()); }
- public boolean downloadPackageBits(int resourceId, PackageDetailsKey packageDetailsKey){ + @SuppressWarnings( { "unchecked", "unused" }) + public boolean downloadPackageBits(int resourceId, PackageDetailsKey packageDetailsKey) { Query query = entityManager.createNamedQuery(PackageVersion.QUERY_FIND_ID_BY_PACKAGE_DETAILS_KEY_AND_RES_ID); query.setParameter("packageName", packageDetailsKey.getName()); query.setParameter("packageTypeName", packageDetailsKey.getPackageTypeName()); @@ -2056,18 +2084,18 @@ public class ContentSourceManagerBean implements ContentSourceManagerLocal {
pvcs = pvcss.get(0);
- try { - // Make it a true EJB call so we suspend our tx and get a new tx. - // This way, we start with a fresh tx timeout when downloading and this - // won't affect the time we are in in this method's tx (I hope that's how it works). - // This is because this method itself may take a long time to send the data to the output stream - // and we don't want out tx timing out due to the time it takes downloading. - InputStream stream = preloadPackageBits(pvcs); - PackageBits bits = null; - bits = preparePackageBits(subjectManager.getOverlord(),stream, pvcs); - }catch(Exception e){ - return false; - } + try { + // Make it a true EJB call so we suspend our tx and get a new tx. + // This way, we start with a fresh tx timeout when downloading and this + // won't affect the time we are in in this method's tx (I hope that's how it works). + // This is because this method itself may take a long time to send the data to the output stream + // and we don't want out tx timing out due to the time it takes downloading. + InputStream stream = preloadPackageBits(pvcs); + PackageBits bits = null; + bits = preparePackageBits(subjectManager.getOverlord(), stream, pvcs); + } catch (Exception e) { + return false; + } } return true; } @@ -2179,16 +2207,16 @@ public class ContentSourceManagerBean implements ContentSourceManagerLocal { results.next(); Blob blob = results.getBlob(1);
- long bytesRetrieved=0; - if (endByte < 0) { - if (startByte == 0) { + long bytesRetrieved = 0L; + if (endByte < 0L) { + if (startByte == 0L) { bytesRetrieved = StreamUtil.copy(blob.getBinaryStream(), outputStream, false); } - } else { - long length = (endByte - startByte) + 1; + } else { + long length = (endByte - startByte) + 1; //InputStream stream = blob.getBinaryStream(startByte, length); // JDK 6 api InputStream stream = blob.getBinaryStream(); - bytesRetrieved = StreamUtil.copy(stream, outputStream, startByte , length); + bytesRetrieved = StreamUtil.copy(stream, outputStream, startByte, length); } log.debug("Retrieved and sent [" + bytesRetrieved + "] bytes for [" + packageDetailsKey + "]"); ps.close(); @@ -2210,8 +2238,8 @@ public class ContentSourceManagerBean implements ContentSourceManagerLocal {
// the magic happens here - outputStream is probably a remote stream down to the agent long bytesRetrieved; - if (endByte < 0) { - if (startByte > 0) { + if (endByte < 0L) { + if (startByte > 0L) { bitsStream.skip(startByte); } bytesRetrieved = StreamUtil.copy(bitsStream, outputStream, false); @@ -2404,7 +2432,7 @@ public class ContentSourceManagerBean implements ContentSourceManagerLocal { @TransactionTimeout(45 * 60) public long outputDistributionFileBits(DistributionFile distFile, OutputStream outputStream) {
- long numBytes = 0; + long numBytes = 0L; InputStream bitStream = null; try { Distribution dist = distFile.getDistribution(); @@ -2429,4 +2457,3 @@ public class ContentSourceManagerBean implements ContentSourceManagerLocal { return numBytes; } } - diff --git a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/content/test/ContentUIManagerBeanTest.java b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/content/test/ContentUIManagerBeanTest.java index 3160074..54cfb67 100644 --- a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/content/test/ContentUIManagerBeanTest.java +++ b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/content/test/ContentUIManagerBeanTest.java @@ -24,20 +24,18 @@ import java.io.FileOutputStream;
import javax.persistence.EntityManager;
-import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test;
import org.rhq.core.domain.content.Architecture; import org.rhq.core.domain.content.Package; import org.rhq.core.domain.content.PackageBits; +import org.rhq.core.domain.content.PackageBitsBlob; import org.rhq.core.domain.content.PackageType; import org.rhq.core.domain.content.PackageVersion; import org.rhq.core.domain.content.composite.LoadedPackageBitsComposite; import org.rhq.core.domain.resource.Resource; import org.rhq.core.util.MessageDigestGenerator; -import org.rhq.enterprise.server.auth.SubjectManagerLocal; import org.rhq.enterprise.server.content.ContentManagerLocal; import org.rhq.enterprise.server.content.ContentUIManagerLocal; import org.rhq.enterprise.server.test.AbstractEJB3Test; @@ -54,10 +52,7 @@ public class ContentUIManagerBeanTest extends AbstractEJB3Test {
private static final boolean ENABLE_TESTS = true;
- private final Log log = LogFactory.getLog(this.getClass()); - private ContentUIManagerLocal contentUIManager; - private SubjectManagerLocal subjectManager; private ContentManagerLocal contentManager;
// Setup -------------------------------------------- @@ -65,7 +60,6 @@ public class ContentUIManagerBeanTest extends AbstractEJB3Test { @BeforeClass public void setupBeforeClass() throws Exception { contentUIManager = LookupUtil.getContentUIManager(); - subjectManager = LookupUtil.getSubjectManager(); contentManager = LookupUtil.getContentManager(); }
@@ -100,8 +94,7 @@ public class ContentUIManagerBeanTest extends AbstractEJB3Test { assert !composite.isPackageBitsInDatabase();
// pretend we loaded the bits, but we stored them somewhere other then the DB - PackageBits packageBits = new PackageBits(); - em.persist(packageBits); + PackageBits packageBits = createPackageBits(em); pkgVer.setPackageBits(packageBits); pkgVer = em.merge(pkgVer); em.flush(); @@ -117,12 +110,13 @@ public class ContentUIManagerBeanTest extends AbstractEJB3Test { // let's make sure there really is no data in the DB packageBits = em.find(PackageBits.class, packageBits.getId()); assert packageBits != null; - assert packageBits.getBits() == null; + assert packageBits.getBlob().getBits() == null;
// now lets store some bits in the DB final String DATA = "testPackageBits data"; - packageBits.setBits(DATA.getBytes()); - em.merge(packageBits); + PackageBitsBlob packageBitsBlob = em.find(PackageBitsBlob.class, packageBits.getId()); + packageBitsBlob.setBits(DATA.getBytes()); + em.merge(packageBitsBlob); em.flush();
// test that the bits are available and stored in the DB @@ -136,7 +130,7 @@ public class ContentUIManagerBeanTest extends AbstractEJB3Test { // let's make sure the data really is in the DB packageBits = em.find(PackageBits.class, packageBits.getId()); assert packageBits != null; - assert DATA.equals(new String(packageBits.getBits())); + assert DATA.equals(new String(packageBits.getBlob().getBits()));
//////////////////////////////////////////////////// // create another package version and test with that @@ -162,8 +156,7 @@ public class ContentUIManagerBeanTest extends AbstractEJB3Test { assert !composite.isPackageBitsInDatabase();
// pretend we loaded the bits, but we stored them somewhere other then the DB - PackageBits packageBits2 = new PackageBits(); - em.persist(packageBits2); + PackageBits packageBits2 = createPackageBits(em); pkgVer2.setPackageBits(packageBits2); pkgVer2 = em.merge(pkgVer2); em.flush(); @@ -187,12 +180,12 @@ public class ContentUIManagerBeanTest extends AbstractEJB3Test { // let's make sure there really is no data in the DB packageBits2 = em.find(PackageBits.class, packageBits2.getId()); assert packageBits2 != null; - assert packageBits2.getBits() == null; + assert packageBits2.getBlob().getBits() == null;
// now lets store some bits in the DB final String DATA2 = "testPackageBits more data"; - packageBits2.setBits(DATA2.getBytes()); - em.merge(packageBits2); + packageBits2.getBlob().setBits(DATA2.getBytes()); + em.merge(packageBits2.getBlob()); em.flush();
// make sure the query still gets the right answer for the first pkgVer @@ -214,7 +207,7 @@ public class ContentUIManagerBeanTest extends AbstractEJB3Test { // let's make sure the data really is in the DB packageBits2 = em.find(PackageBits.class, packageBits2.getId()); assert packageBits2 != null; - assert DATA2.equals(new String(packageBits2.getBits())); + assert DATA2.equals(new String(packageBits2.getBlob().getBits())); } catch (Throwable t) { t.printStackTrace(); throw t; @@ -252,8 +245,7 @@ public class ContentUIManagerBeanTest extends AbstractEJB3Test { assert !composite.isPackageBitsInDatabase();
// pretend we loaded the bits, but we stored them somewhere other then the DB - PackageBits packageBits = new PackageBits(); - em.persist(packageBits); + PackageBits packageBits = createPackageBits(em); pkgVer.setPackageBits(packageBits); pkgVer = em.merge(pkgVer); em.flush(); @@ -269,7 +261,7 @@ public class ContentUIManagerBeanTest extends AbstractEJB3Test { // let's make sure there really is no data in the DB packageBits = em.find(PackageBits.class, packageBits.getId()); assert packageBits != null; - assert packageBits.getBits() == null; + assert packageBits.getBlob().getBits() == null;
// now lets store some bits in the DB using PreparedStatements and BLOB mechanism // to simulate large file transfers where streaming is used instead of reading entire @@ -311,4 +303,25 @@ public class ContentUIManagerBeanTest extends AbstractEJB3Test { getTransactionManager().rollback(); } } + + private PackageBits createPackageBits(EntityManager em) { + PackageBits bits = null; + PackageBitsBlob blob = null; + + // We have to work backwards to avoid constraint violations. PackageBits requires a PackageBitsBlob, + // so create and persist that first, getting the ID + blob = new PackageBitsBlob(); + em.persist(blob); + + // Now create the PackageBits entity and assign the Id and blob. Note, do not persist the + // entity, the row already exists. Just perform and flush the update. + bits = new PackageBits(); + bits.setId(blob.getId()); + bits.setBlob(blob); + em.flush(); + + // return the new PackageBits and associated PackageBitsBlob + return bits; + } + } \ No newline at end of file
commit 61d7e502e70484583f3fc3da22cb308e8486870a Author: Ian Springer ian.springer@redhat.com Date: Mon Jul 19 17:55:30 2010 -0400
mask values of type="password" props in HTML source on both group resource config and group plugin config pages (fix for https://bugzilla.redhat.com/show_bug.cgi?id=601892)
diff --git a/modules/core/gui/src/main/java/org/rhq/core/gui/configuration/propset/ConfigurationSet.java b/modules/core/gui/src/main/java/org/rhq/core/gui/configuration/propset/ConfigurationSet.java index c7bd28e..d84aa14 100644 --- a/modules/core/gui/src/main/java/org/rhq/core/gui/configuration/propset/ConfigurationSet.java +++ b/modules/core/gui/src/main/java/org/rhq/core/gui/configuration/propset/ConfigurationSet.java @@ -1,6 +1,6 @@ /* * RHQ Management Platform - * Copyright (C) 2005-2008 Red Hat, Inc. + * Copyright (C) 2005-2010 Red Hat, Inc. * All rights reserved. * * This program is free software; you can redistribute it and/or modify @@ -33,6 +33,7 @@ import org.rhq.core.domain.configuration.definition.PropertyDefinition; import org.rhq.core.domain.configuration.definition.PropertyDefinitionList; import org.rhq.core.domain.configuration.definition.PropertyDefinitionMap; import org.rhq.core.domain.configuration.definition.PropertyDefinitionSimple; +import org.rhq.core.gui.configuration.ConfigurationMaskingUtility;
/** * @author Ian Springer @@ -90,6 +91,20 @@ public class ConfigurationSet { return groupConfiguration; }
+ public void mask() { + for (ConfigurationSetMember member : this.members) { + ConfigurationMaskingUtility.maskConfiguration(member.getConfiguration(), this.configurationDefinition); + } + ConfigurationMaskingUtility.maskConfiguration(this.groupConfiguration, this.configurationDefinition); + } + + public void unmask() { + for (ConfigurationSetMember member : this.members) { + ConfigurationMaskingUtility.unmaskConfiguration(member.getConfiguration(), this.configurationDefinition); + } + ConfigurationMaskingUtility.unmaskConfiguration(this.groupConfiguration, this.configurationDefinition); + } + private static void calculateGroupProperty(PropertyDefinition propertyDefinition, List<AbstractPropertyMap> sourceParentPropertyMaps, AbstractPropertyMap targetParentPropertyMap) { if (propertyDefinition instanceof PropertyDefinitionSimple) { diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/configuration/group/AbstractGroupResourceConfigurationUIBean.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/configuration/group/AbstractGroupResourceConfigurationUIBean.java index de3c7b9..57e575c 100644 --- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/configuration/group/AbstractGroupResourceConfigurationUIBean.java +++ b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/configuration/group/AbstractGroupResourceConfigurationUIBean.java @@ -1,6 +1,6 @@ /* * RHQ Management Platform - * Copyright (C) 2005-2008 Red Hat, Inc. + * Copyright (C) 2005-2010 Red Hat, Inc. * All rights reserved. * * This program is free software; you can redistribute it and/or modify @@ -84,6 +84,7 @@ public abstract class AbstractGroupResourceConfigurationUIBean { } else { this.configurationSet = GroupResourceConfigurationUtility.buildConfigurationSet( EnterpriseFacesContextUtility.getSubject(), this.group, this.resourceConfigurations); + this.configurationSet.mask(); } return; } diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/configuration/group/EditGroupResourceConfigurationUIBean.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/configuration/group/EditGroupResourceConfigurationUIBean.java index 8a5c6ae..1ba9b78 100644 --- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/configuration/group/EditGroupResourceConfigurationUIBean.java +++ b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/configuration/group/EditGroupResourceConfigurationUIBean.java @@ -1,6 +1,6 @@ /* * RHQ Management Platform - * Copyright (C) 2005-2008 Red Hat, Inc. + * Copyright (C) 2005-2010 Red Hat, Inc. * All rights reserved. * * This program is free software; you can redistribute it and/or modify @@ -63,10 +63,12 @@ public class EditGroupResourceConfigurationUIBean extends AbstractGroupResourceC * Agents. This gets called when user clicks the SAVE button. */ public void updateConfigurations() { - String viewId = null; + String viewId; try { // TODO: See if there's some way for the config renderer to handle calling applyGroupConfiguration(), // so the managed bean doesn't have to worry about doing it. + getConfigurationSet().unmask(); + getConfigurationSet().applyGroupConfiguration(); getConfigurationManager().scheduleGroupResourceConfigurationUpdate( EnterpriseFacesContextUtility.getSubject(), getGroup().getId(), getResourceConfigurations()); diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/group/AbstractGroupPluginConfigurationUIBean.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/group/AbstractGroupPluginConfigurationUIBean.java index 4d8d6ee..fc142bf 100644 --- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/group/AbstractGroupPluginConfigurationUIBean.java +++ b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/group/AbstractGroupPluginConfigurationUIBean.java @@ -1,6 +1,6 @@ /* * RHQ Management Platform - * Copyright (C) 2005-2008 Red Hat, Inc. + * Copyright (C) 2005-2010 Red Hat, Inc. * All rights reserved. * * This program is free software; you can redistribute it and/or modify @@ -69,6 +69,7 @@ public abstract class AbstractGroupPluginConfigurationUIBean { } this.configurationSet = GroupPluginConfigurationUtility.buildConfigurationSet(EnterpriseFacesContextUtility .getSubject(), this.group, this.pluginConfigurations); + this.configurationSet.mask(); return; }
diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/group/EditGroupPluginConfigurationUIBean.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/group/EditGroupPluginConfigurationUIBean.java index 030f336..d1f874a 100644 --- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/group/EditGroupPluginConfigurationUIBean.java +++ b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/group/EditGroupPluginConfigurationUIBean.java @@ -1,6 +1,6 @@ /* * RHQ Management Platform - * Copyright (C) 2005-2008 Red Hat, Inc. + * Copyright (C) 2005-2010 Red Hat, Inc. * All rights reserved. * * This program is free software; you can redistribute it and/or modify @@ -65,6 +65,7 @@ public class EditGroupPluginConfigurationUIBean extends AbstractGroupPluginConfi try { // TODO: See if there's some way for the config renderer to handle calling applyGroupConfiguration(), // so the managed bean doesn't have to worry about doing it. + getConfigurationSet().unmask(); getConfigurationSet().applyGroupConfiguration(); getConfigurationManager().scheduleGroupPluginConfigurationUpdate( EnterpriseFacesContextUtility.getSubject(), getGroup().getId(), getPluginConfigurations());
commit 273b5adbddf03b97fbe3601c150f46d8eb2b3f7c Author: Simeon Pinder spinder@redhat.com Date: Mon Jul 19 17:30:03 2010 -0400
updating WS version string to indicate remote model/interface changes.
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/ServerVersion.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/ServerVersion.java index e2db512..e8114aa 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/ServerVersion.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/ServerVersion.java @@ -43,7 +43,7 @@ public class ServerVersion implements Serializable { private String build;
//This value must be set by build system just before Build Time. - public static final String namespace = "http://www.rhq-project.org/2.3/2009/9/Webservices.xsd"; + public static final String namespace = "http://www.rhq-project.org/2.4/2010/7/Webservices.xsd";
// private final String namespace = "@ws-namespace@";
commit 63d9c78d672d3830d6d98399cbe1f9525665126f Author: Joseph Marques joseph@redhat.com Date: Mon Jul 19 17:29:16 2010 -0400
BZ-616233: use MODIFY_RESOURCE to protect edit of group plugin config
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/inventory/view-connection.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/inventory/view-connection.xhtml index 3f4de40..08b2eae 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/inventory/view-connection.xhtml +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/inventory/view-connection.xhtml @@ -29,7 +29,7 @@ <h:panelGrid columns="2" styleClass="buttons-table" columnClasses="button-cell"> <h:commandButton value="EDIT" action="#{ViewGroupPluginConfigurationUIBean.edit}" title="Edit this Compatible Group Configuration" - rendered="${ResourceGroupUIBean.permissions.configure}" + rendered="${ResourceGroupUIBean.permissions.inventory}" styleClass="buttonmed"/> <h:commandButton value="VIEW HISTORY" action="#{ViewGroupConnectionPropertyHistoryUIBean.begin}" title="View History for Group Connection Property Updates" styleClass="buttonmed"/> @@ -48,7 +48,7 @@ <h:panelGrid columns="2" styleClass="buttons-table" columnClasses="button-cell"> <h:commandButton value="EDIT" action="#{ViewGroupPluginConfigurationUIBean.edit}" title="Edit this Compatible Group Configuration" - rendered="${ResourceGroupUIBean.permissions.configure}" + rendered="${ResourceGroupUIBean.permissions.inventory}" styleClass="buttonmed"/> <h:commandButton value="VIEW HISTORY" action="#{ViewGroupConnectionPropertyHistoryUIBean.begin}" title="View History for Group Connection Property Updates" styleClass="buttonmed"/>
commit 166ca107283f7cda30c7b8223c1555c054415ed1 Author: Joseph Marques joseph@redhat.com Date: Mon Jul 19 15:20:27 2010 -0400
use db-upgrade properly
diff --git a/modules/core/dbutils/pom.xml b/modules/core/dbutils/pom.xml index ccc3b31..7ff6a10 100644 --- a/modules/core/dbutils/pom.xml +++ b/modules/core/dbutils/pom.xml @@ -22,7 +22,7 @@
<properties> <scm.module.path>modules/core/dbutils/</scm.module.path> - <db.schema.version>2.90</db.schema.version> + <db.schema.version>2.91</db.schema.version> </properties>
<dependencies> diff --git a/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml b/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml index 5a92c0c..951d972 100644 --- a/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml +++ b/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml @@ -3074,10 +3074,12 @@ <!-- if some role previously had CONFIGURE perm (now called CONFIGURE_WRITE), give it the implied perm CONFIGURE_READ so users don't experience an unexpected permission restriction after upgrade --> <schema-directSQL> - INSERT INTO RHQ_PERMISSION (ROLE_ID, OPERATION) - SELECT PERM.ROLE_ID, 13 - FROM RHQ_PERMISSION PERM - WHERE PERM.OPERATION = 11 + <statement desc="Upgrading configuration permissions"> + INSERT INTO RHQ_PERMISSION (ROLE_ID, OPERATION) + SELECT PERM.ROLE_ID, 13 + FROM RHQ_PERMISSION PERM + WHERE PERM.OPERATION = 11 + </statement> </schema-directSQL> </schemaSpec> </dbupgrade>
commit 0c772ee3660ad349147e267bb1f95ff5211f39bc Author: Joseph Marques joseph@redhat.com Date: Mon Jul 19 14:55:13 2010 -0400
this default error handling for value-completion is obsolete, removing it
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/AbstractSearchAssistant.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/AbstractSearchAssistant.java index 6ba0c9c..5209c26 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/AbstractSearchAssistant.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/AbstractSearchAssistant.java @@ -14,6 +14,7 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory;
import org.rhq.core.domain.auth.Subject; +import org.rhq.enterprise.server.search.SearchExpressionException; import org.rhq.enterprise.server.util.LookupUtil;
public abstract class AbstractSearchAssistant implements SearchAssistant { @@ -67,20 +68,13 @@ public abstract class AbstractSearchAssistant implements SearchAssistant {
public List<String> getParameters(String context, String filter) { if (getParameterizedContexts().contains(context) == false) { - throw new IllegalArgumentException("context[" + context + throw new SearchExpressionException("context[" + context + "] is not parameterized, no completions available"); } return Collections.emptyList(); }
public List<String> getValues(String context, String param, String filter) { - if (getSimpleContexts().contains(context) && param != null) { - throw new IllegalArgumentException("context[" + context + "] is simple, param[" + param - + "] can not be handled"); - } - if (getParameterizedContexts().contains(context) && param == null) { - throw new IllegalArgumentException("context[" + context + "] is parameterized, param must not be null"); - } return Collections.emptyList(); }
commit d4280e5e51f66d56d480802607898f4219471a85 Merge: 6eafe39... d487e39... Author: Joseph Marques joseph@redhat.com Date: Mon Jul 19 13:22:30 2010 -0400
Merge branch 'release-3.0.0' into config-permissions
commit d487e3959c4e6f0860816a3900b3caf253752962 Author: Joseph Marques joseph@redhat.com Date: Mon Jul 19 12:46:29 2010 -0400
BZ-615017: fix QueryException when using connection-based search terms
* remove duplicate 'AND' token from the generated query
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/ResourceSearchTranslator.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/ResourceSearchTranslator.java index cfdb156..b28bfb3 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/ResourceSearchTranslator.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/ResourceSearchTranslator.java @@ -79,7 +79,7 @@ public class ResourceSearchTranslator extends AbstractSearchTranslator { + " WHERE simpleDefinition = definition " // only provide translations for simple properties + " AND simpleDefinition.type <> 'PASSWORD' " // do not allow searching by hidden/password fields + " AND property = simple " // join to simple for filter by 'stringValue' attribute - + " AND " + conditionallyAddAuthzFragment(getConfigAuthzFragment()) // + + conditionallyAddAuthzFragment(getConfigAuthzFragment()) // + " AND " + getJPQLForString("definition.name", RHQLComparisonOperator.EQUALS, param) // + " AND " + getJPQLForString("simple.stringValue", op, filter));
commit 9c2972b0e0abdfb4a89870a22a17a80ea01f9aa2 Author: Joseph Marques joseph@redhat.com Date: Mon Jul 19 10:44:41 2010 -0400
BZ-610228: pretty up SearchBar error messages
diff --git a/modules/core/util/src/main/java/org/rhq/core/util/exception/ThrowableUtil.java b/modules/core/util/src/main/java/org/rhq/core/util/exception/ThrowableUtil.java index e29daf1..c21e3c2 100644 --- a/modules/core/util/src/main/java/org/rhq/core/util/exception/ThrowableUtil.java +++ b/modules/core/util/src/main/java/org/rhq/core/util/exception/ThrowableUtil.java @@ -1,25 +1,25 @@ - /* - * RHQ Management Platform - * Copyright (C) 2005-2008 Red Hat, Inc. - * All rights reserved. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License, version 2, as - * published by the Free Software Foundation, and/or the GNU Lesser - * General Public License, version 2.1, also as published by the Free - * Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License and the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License - * and the GNU Lesser General Public License along with this program; - * if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ +/* + * RHQ Management Platform + * Copyright (C) 2005-2008 Red Hat, Inc. + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License, version 2, as + * published by the Free Software Foundation, and/or the GNU Lesser + * General Public License, version 2.1, also as published by the Free + * Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License and the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License + * and the GNU Lesser General Public License along with this program; + * if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ package org.rhq.core.util.exception;
import java.io.ByteArrayOutputStream; @@ -226,10 +226,16 @@ public class ThrowableUtil { return getAllSqlExceptionMessagesArray(t, true); }
- public static String getStackAsString(Throwable t) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); t.printStackTrace(new PrintStream(baos)); return baos.toString(); } + + public static String getRootMessage(Throwable t) { + while ((t.getCause() != null) && (t != t.getCause())) { + t = t.getCause(); + } + return t.getMessage(); + } } \ No newline at end of file diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/browse/BrowseGroupsUIBean.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/browse/BrowseGroupsUIBean.java index 382e5e7..345f3de 100644 --- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/browse/BrowseGroupsUIBean.java +++ b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/browse/BrowseGroupsUIBean.java @@ -14,6 +14,7 @@ import org.rhq.core.domain.util.PageControl; import org.rhq.core.domain.util.PageList; import org.rhq.core.gui.util.FacesContextUtility; import org.rhq.core.gui.util.StringUtility; +import org.rhq.core.util.exception.ThrowableUtil; import org.rhq.enterprise.gui.common.framework.PagedDataTableUIBean; import org.rhq.enterprise.gui.common.paging.PageControlView; import org.rhq.enterprise.gui.common.paging.PagedListDataModel; @@ -82,7 +83,7 @@ public class BrowseGroupsUIBean extends PagedDataTableUIBean { return results; } catch (Throwable t) { FacesContextUtility.addMessage(FacesMessage.SEVERITY_ERROR, "Failed to fetch results: " - + t.getMessage()); + + ThrowableUtil.getRootMessage(t)); return new PageList<ResourceGroupComposite>(pc); } } diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/browse/BrowseResourcesUIBean.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/browse/BrowseResourcesUIBean.java index be5a302..f927357 100644 --- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/browse/BrowseResourcesUIBean.java +++ b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/browse/BrowseResourcesUIBean.java @@ -15,6 +15,7 @@ import org.rhq.core.domain.util.PageList; import org.rhq.core.gui.util.FacesContextUtility; import org.rhq.core.gui.util.StringUtility; import org.rhq.core.util.IntExtractor; +import org.rhq.core.util.exception.ThrowableUtil; import org.rhq.enterprise.gui.common.framework.PagedDataTableUIBean; import org.rhq.enterprise.gui.common.paging.PageControlView; import org.rhq.enterprise.gui.common.paging.ResourceNameDisambiguatingPagedListDataModel; @@ -94,7 +95,7 @@ public class BrowseResourcesUIBean extends PagedDataTableUIBean { return results; } catch (Throwable t) { FacesContextUtility.addMessage(FacesMessage.SEVERITY_ERROR, "Failed to fetch results: " - + t.getMessage()); + + ThrowableUtil.getRootMessage(t)); return new PageList<ResourceComposite>(pc); } } diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/AbstractSearchTranslator.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/AbstractSearchTranslator.java index 54ccae2..1848192 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/AbstractSearchTranslator.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/AbstractSearchTranslator.java @@ -1,6 +1,7 @@ package org.rhq.enterprise.server.search.translation;
import org.rhq.core.domain.auth.Subject; +import org.rhq.enterprise.server.search.SearchExpressionException; import org.rhq.enterprise.server.search.translation.antlr.RHQLComparisonOperator; import org.rhq.enterprise.server.util.LookupUtil;
@@ -43,7 +44,7 @@ public abstract class AbstractSearchTranslator implements SearchTranslator { return fragment + operator.getDefaultTranslation() + getEnum(enumClass, value, useOrdinal);
} else { - throw new IllegalArgumentException("Unsupported operator " + operator); + throw new SearchExpressionException("Unsupported operator " + operator); } }
@@ -58,7 +59,7 @@ public abstract class AbstractSearchTranslator implements SearchTranslator { } } } - throw new IllegalArgumentException("No enum of type '" + enumClass.getSimpleName() + "' with name matching '" + throw new SearchExpressionException("No enum of type '" + enumClass.getSimpleName() + "' with name matching '" + value + "'"); }
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/GroupSearchTranslator.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/GroupSearchTranslator.java index 781e581..5f87ed7 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/GroupSearchTranslator.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/GroupSearchTranslator.java @@ -4,6 +4,7 @@ import static org.rhq.enterprise.server.search.common.SearchQueryGenerationUtili
import org.rhq.core.domain.auth.Subject; import org.rhq.core.domain.resource.ResourceCategory; +import org.rhq.enterprise.server.search.SearchExpressionException; import org.rhq.enterprise.server.search.translation.antlr.RHQLAdvancedTerm; import org.rhq.enterprise.server.search.translation.antlr.RHQLComparisonOperator; import org.rhq.enterprise.server.search.translation.jpql.SearchFragment; @@ -65,9 +66,9 @@ public class GroupSearchTranslator extends AbstractSearchTranslator {
} else { if (param == null) { - throw new IllegalArgumentException("No search fragment available for " + path); + throw new SearchExpressionException("No search fragment available for " + path); } else { - throw new IllegalArgumentException("No search fragment available for " + path + "[" + param + "]"); + throw new SearchExpressionException("No search fragment available for " + path + "[" + param + "]"); } } } diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/ResourceSearchTranslator.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/ResourceSearchTranslator.java index bece19d..cfdb156 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/ResourceSearchTranslator.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/ResourceSearchTranslator.java @@ -7,6 +7,7 @@ import org.rhq.core.domain.auth.Subject; import org.rhq.core.domain.measurement.AvailabilityType; import org.rhq.core.domain.resource.ResourceCategory; import org.rhq.core.domain.search.assist.AlertSearchAssistParam; +import org.rhq.enterprise.server.search.SearchExpressionException; import org.rhq.enterprise.server.search.translation.antlr.RHQLAdvancedTerm; import org.rhq.enterprise.server.search.translation.antlr.RHQLComparisonOperator; import org.rhq.enterprise.server.search.translation.jpql.SearchFragment; @@ -96,9 +97,9 @@ public class ResourceSearchTranslator extends AbstractSearchTranslator {
} else { if (param == null) { - throw new IllegalArgumentException("No search fragment available for " + path); + throw new SearchExpressionException("No search fragment available for " + path); } else { - throw new IllegalArgumentException("No search fragment available for " + path + "[" + param + "]"); + throw new SearchExpressionException("No search fragment available for " + path + "[" + param + "]"); } } } diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/CriteriaQueryGenerator.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/CriteriaQueryGenerator.java index 78885b0..6c43b46 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/CriteriaQueryGenerator.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/CriteriaQueryGenerator.java @@ -544,6 +544,10 @@ public final class CriteriaQueryGenerator { } } catch (SearchExpressionException see) { throw see; // bubble up to the top + } catch (RuntimeException re) { + LOG.error("Could not get JPQL translation for '" + searchExpression + "': " + + ThrowableUtil.getAllMessages(re, true)); + throw re; // don't wrap exceptions that are already RuntimeExceptions in another RuntimeException } catch (Exception e) { LOG.error("Could not get JPQL translation for '" + searchExpression + "': " + ThrowableUtil.getAllMessages(e, true));
commit c043ed77936cd2a3e03a608383755093191eb5b6 Author: Joseph Marques joseph@redhat.com Date: Mon Jul 19 10:43:04 2010 -0400
BZ-615952: ensure old alertNotification/Log rows are removed during upgrade
diff --git a/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml b/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml index 1cfda87..536932e 100644 --- a/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml +++ b/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml @@ -2096,9 +2096,16 @@ <!-- turn first-class notification data into configuration objects for custom alert senders --> <schema-alterColumn table="RHQ_ALERT_NOTIFICATION" column="NOTIFICATION_TYPE" nullable="TRUE" /> <schema-javaTask className="CustomAlertSenderUpgradeTask" /> + <!-- the old alert notification rows won't have SENDER_NAME set, remove them --> <schema-directSQL> <statement desc="Removing obsolete alert notifications"> - DELETE FROM RHQ_ALERT_NOTIFICATION WHERE NOTIFICATION_TYPE IS NOT NULL + DELETE FROM RHQ_ALERT_NOTIFICATION WHERE SENDER_NAME IS NULL + </statement> + </schema-directSQL> + <!-- the old alert notification log rows won't have SENDER set, remove them --> + <schema-directSQL> + <statement desc="Removing obsolete alert notification logs"> + DELETE FROM RHQ_ALERT_NOTIF_LOG WHERE SENDER IS NULL </statement> </schema-directSQL> <schema-deleteColumn table="RHQ_ALERT_NOTIFICATION" column="NOTIFICATION_TYPE" />
commit 5480942d169a44b52969fc8b1c32ab72daf3fef4 Author: Filip Drabek fdrabek@dhcp-lab-136.englab.brq.redhat.com Date: Mon Jul 19 16:19:09 2010 +0200
[apache] tests will use xerces XMLSerializer.
diff --git a/modules/plugins/apache/pom.xml b/modules/plugins/apache/pom.xml index b4f9208..700a6af 100644 --- a/modules/plugins/apache/pom.xml +++ b/modules/plugins/apache/pom.xml @@ -57,6 +57,14 @@ <version>${sigar.version}</version> <scope>provided</scope> </dependency> + + <dependency> + <groupId>xerces</groupId> + <artifactId>xercesImpl</artifactId> + <version>2.8.1</version> + <scope>test</scope> + </dependency> + </dependencies>
<build> diff --git a/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/util/ApacheConfigurationUtil.java b/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/util/ApacheConfigurationUtil.java index 06a9f71..8a0c75c 100644 --- a/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/util/ApacheConfigurationUtil.java +++ b/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/util/ApacheConfigurationUtil.java @@ -29,8 +29,7 @@ import org.w3c.dom.Element; import org.w3c.dom.NamedNodeMap; import org.w3c.dom.Node; import org.w3c.dom.NodeList; - -import com.sun.org.apache.xml.internal.serialize.XMLSerializer; +import org.apache.xml.serialize.XMLSerializer;
/** * @@ -170,7 +169,6 @@ public class ApacheConfigurationUtil { return prop; }
- @SuppressWarnings("restriction") private static void saveXML(Document document,String fileName) throws UnitTestException{ try { File file = new File(fileName);
commit 6eafe393c583fdc260868248a69a827211c5195a Author: Joseph Marques joseph@redhat.com Date: Mon Jul 19 02:25:21 2010 -0400
BZ-614886: respect authz when displaying configUpdates in subsystem view
* only show config update rows that reference resources with CONFIGURE_READ perm
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/configuration/ResourceConfigurationUpdate.java b/modules/core/domain/src/main/java/org/rhq/core/domain/configuration/ResourceConfigurationUpdate.java index cf3186f..e0a2460 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/configuration/ResourceConfigurationUpdate.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/configuration/ResourceConfigurationUpdate.java @@ -117,8 +117,8 @@ import org.rhq.core.domain.resource.Resource; + " JOIN cu.resource res " // + "LEFT JOIN res.parentResource parent " // + " WHERE res.id IN ( SELECT rr.id FROM Resource rr " // - + " JOIN rr.implicitGroups g JOIN g.roles r JOIN r.subjects s " // - + " WHERE s.id = :subjectId ) " // + + " JOIN rr.implicitGroups g JOIN g.roles r JOIN r.subjects s JOIN r.permissions perm " // + + " WHERE s.id = :subjectId AND perm = 13 ) " // + " AND (cu.modifiedTime <> (SELECT MIN(icu.modifiedTime) " // + " FROM ResourceConfigurationUpdate icu " // + " WHERE icu.resource.id = res.id))" //
commit 2bcb6f216b47999fd85b1f1b136cdb188dc81c30 Author: Joseph Marques joseph@redhat.com Date: Mon Jul 19 01:29:00 2010 -0400
BZ-614886: finally, perform necessary upgrade tasks so users see no upgrade impact
* if some role previously had CONFIGURE perm (now called CONFIGURE_WRITE), give it the implied perm CONFIGURE_READ so users don't experience an unexpected permission restriction after upgrade
diff --git a/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml b/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml index 1cfda87..4298ca5 100644 --- a/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml +++ b/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml @@ -3063,6 +3063,16 @@ </schema-directSQL>
</schemaSpec> + <schemaSpec version="2.91"> + <!-- if some role previously had CONFIGURE perm (now called CONFIGURE_WRITE), give it the implied perm + CONFIGURE_READ so users don't experience an unexpected permission restriction after upgrade --> + <schema-directSQL> + INSERT INTO RHQ_PERMISSION (ROLE_ID, OPERATION) + SELECT PERM.ROLE_ID, 13 + FROM RHQ_PERMISSION PERM + WHERE PERM.OPERATION = 11 + </schema-directSQL> + </schemaSpec> </dbupgrade> </target> </project>
commit 5c5877e4f6c8ae0770e65cc5482a33a4bf75f17b Author: Joseph Marques joseph@redhat.com Date: Mon Jul 19 01:03:37 2010 -0400
BZ-614886: fix all callpaths originating from existing UI to respect configuration authorization
----- security changes in resource-specific facelets -----
resource/summary/overview.xhtml configData: !!MISSING!! -> ResourceUIBean.permissions.configureRead
resource/configuration/view.xhtml configData: !!MISSING!! -> ResourceUIBean.permissions.configureRead editButtons: ResourceUIBean.permissions.configure -> ResourceUIBean.permissions.configureWrite added error message if user doesn't have read permission on the resource
resource/configuration/edit.xhtml configData: !!MISSING!! -> ResourceUIBean.permissions.configureRead editButtons: ResourceUIBean.permissions.configure -> ResourceUIBean.permissions.configureWrite added error message if user doesn't have read permission on the resource
resource/configuration/history.xhtml configData: !!MISSING!! -> ResourceUIBean.permissions.configureRead editButtons: ResourceUIBean.permissions.configure -> ResourceUIBean.permissions.configureWrite added error message if user doesn't have read permission on the resource
resource/configuration/raw.xhtml (included from other protected pages) ResourceUIBean.permissions.configure -> ResourceUIBean.permissions.configureWrite
resource/configuration/structured.xhtml (included from other protected pages) ResourceUIBean.permissions.configure -> ResourceUIBean.permissions.configureWrite
----- security changes in resource-specific jsf managed beans -----
resource/configuration/view.xhtml -> ResourceConfigurationViewer getLatestResourceConfigurationUpdate(subject, resourceId, fromStructured) canViewResource -> hasResourcePermission(CONFIGURE_READ) isResourceConfigurationUpdateInProgress(subject, resourceId) canViewResource -> hasResourcePermission(CONFIGURE_READ)
resource/configuration/edit.xhtml -> ResourceConfigurationEditor translateResourceConfiguration(subject, resourceId, configuration, fromStructured) canViewResource -> hasResourcePermission(CONFIGURE_READ) updateStructuredOrRawConfiguration(subject, resourceId, configuration, fromStructured) !!MISSING!! -> hasResourcePermission(CONFIGURE_WRITE) updateResourceConfiguration(subject, resourceId, configuration, fromStructured) !!MISSING!! -> hasResourcePermission(CONFIGURE_WRITE)
resource/configuration/history.xhtml -> GetLatestConfigurationUpdateUIBean getLatestResourceConfigurationUpdate(subject, resourceId, fromStructured) already secured as part of resource/configuration/view.xhtml work
resource/configuration/history.xhtml -> ListConfigurationUpdateUIBean updateStructuredOrRawConfiguration(subject, resourceId, configuration, fromStructured) already secured as part of resource/configuration/edit.xhtml work updateResourceConfiguration(subject, resourceId, configuration, fromStructured) already secured as part of resource/configuration/edit.xhtml work purgeResourceConfigurationUpdate(subject, configurationUpdateId, purgeInProgress) this method was already correctly using CONFIGURE_WRITE permission findResourceConfigurationUpdates(subject, resourceId, beginDate, endDate, suppressOldest, pc) !!MISSING!! -> hasResourcePermission(CONFIGURE_READ)
resource/configuration/history.xhtml -> ViewResourceConfigurationUpdateUIBean translateResourceConfiguration(subject, resourceId, configuration, fromStructured) already secured as part of resource/configuration/edit.xhtml work updateStructuredOrRawConfiguration(subject, resourceId, configuration, fromStructured) already secured as part of resource/configuration/edit.xhtml work updateResourceConfiguration(subject, resourceId, configuration, fromStructured) already secured as part of resource/configuration/edit.xhtml work getLatestResourceConfigurationUpdate(subject, resourceId, fromStructured) already secured as part of resource/configuration/view.xhtml work
----- security changes in group-specific facelets -----
group/configuration/viewCurrent.xhtml configData: !!MISSING!! -> ResourceUIBean.permissions.configureRead editButtons: ResourceUIBean.permissions.configure -> ResourceUIBean.permissions.configureWrite added error message if user doesn't have read permission on the resource
group/configuration/editCurrent.xhtml configData: !!MISSING!! -> ResourceUIBean.permissions.configureRead save/reset/cancel buttons: ResourceUIBean.permissions.configure -> ResourceUIBean.permissions.configureWrite added error message if user doesn't have read permission on the resource
group/configuration/history.xhtml configData: !!MISSING!! -> ResourceUIBean.permissions.configureRead deleteButton: !!MISSING!! -> ResourceUIBean.permissions.configureWrite added error message if user doesn't have read permission on the resource
----- security changes in group-specific jsf managed beans -----
group/configuration/viewCurrent.xhtml -> ViewGroupResourceConfigurationUIBean getResourceConfigurationsForCompatibleGroup(subject, groupId) !!MISSING!! -> hasResourcePermission(CONFIGURE_READ)
group/configuration/editCurrent.xhtml -> EditGroupResourceConfigurationUIBean scheduleGroupResourceConfigurationUpdate(subject, groupId, map(resourceId, config)) already secured correctly CONFIGURE_WRITE, no changes necessary
group/configuration/history.xhtml -> GroupResourceConfigurationHistoryUIBean deleteGroupResourceConfigurationUpdates(subject, groupId, groupConfigUpdateIds) already secured correctly CONFIGURE_WRITE, no changes necessary findGroupResourceConfigurationUpdates(groupId, pc) !!MISSING!! - added subject it to interface, then added hasGroupPermission(CONFIGURE_READ)
group/configuration/history.xhtml -> GroupResourceConfigurationHistoryDetailsUIBean getResourceConfigurationMapForGroupUpdate(groupConfigUpdateId) !!MISSING!! - added subject it to interface add call into getGroupPluginConfigurationUpdate(subject, groupConfigurationUpdateId) canViewGroup -> hasGroupPermission(CONFIGURE_READ) findResourceConfigurationUpdateCompositesByParentId(groupConfigUpdateId) !!MISSING!! - added subject it to interface add call into into getGroupPluginConfigurationUpdate(subject, groupConfigurationUpdateId) already secured as part of group/configuration/history.xhtml work
diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/configuration/group/GroupResourceConfigurationHistoryDetailsUIBean.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/configuration/group/GroupResourceConfigurationHistoryDetailsUIBean.java index 9575f4f..8a29d06 100644 --- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/configuration/group/GroupResourceConfigurationHistoryDetailsUIBean.java +++ b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/configuration/group/GroupResourceConfigurationHistoryDetailsUIBean.java @@ -66,8 +66,8 @@ public class GroupResourceConfigurationHistoryDetailsUIBean extends PagedDataTab ResourceGroup group = EnterpriseFacesContextUtility.getResourceGroup(); int groupResourceConfigurationUpdateId = getGroupResourceConfigurationUpdateId();
- this.resourceConfigurations = this.configurationManager - .getResourceConfigurationMapForGroupUpdate(groupResourceConfigurationUpdateId); + this.resourceConfigurations = this.configurationManager.getResourceConfigurationMapForGroupUpdate( + getSubject(), groupResourceConfigurationUpdateId); this.configurationSet = GroupResourceConfigurationUtility.buildConfigurationSet(subject, group, resourceConfigurations); } @@ -89,7 +89,8 @@ public class GroupResourceConfigurationHistoryDetailsUIBean extends PagedDataTab public PageList<ConfigurationUpdateComposite> fetchPage(PageControl pc) { int groupResourceConfigurationUpdateId = getGroupResourceConfigurationUpdateId(); PageList<ConfigurationUpdateComposite> childUpdates = configurationManager - .findResourceConfigurationUpdateCompositesByParentId(groupResourceConfigurationUpdateId, pc); + .findResourceConfigurationUpdateCompositesByParentId(getSubject(), groupResourceConfigurationUpdateId, + pc);
return childUpdates; } diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/configuration/group/GroupResourceConfigurationHistoryUIBean.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/configuration/group/GroupResourceConfigurationHistoryUIBean.java index 1201b33..86fedc7 100644 --- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/configuration/group/GroupResourceConfigurationHistoryUIBean.java +++ b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/configuration/group/GroupResourceConfigurationHistoryUIBean.java @@ -77,7 +77,7 @@ public class GroupResourceConfigurationHistoryUIBean extends PagedDataTableUIBea
@Override public PageList<GroupResourceConfigurationUpdate> fetchPage(PageControl pc) { - return configurationManager.findGroupResourceConfigurationUpdates(getResourceGroup().getId(), + return configurationManager.findGroupResourceConfigurationUpdates(getSubject(), getResourceGroup().getId(), pc); } } diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/configuration/resource/ResourceConfigurationViewer.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/configuration/resource/ResourceConfigurationViewer.java index 0645fb8..a02cfe1 100644 --- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/configuration/resource/ResourceConfigurationViewer.java +++ b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/configuration/resource/ResourceConfigurationViewer.java @@ -23,9 +23,24 @@
package org.rhq.enterprise.gui.configuration.resource;
+import java.io.File; +import java.io.IOException; +import java.io.OutputStream; +import java.util.Collection; +import java.util.Collections; +import java.util.Map; +import java.util.TreeMap; + +import javax.faces.application.FacesMessage; +import javax.faces.event.ValueChangeEvent; +import javax.servlet.http.HttpServletResponse; + import org.jboss.seam.ScopeType; -import org.jboss.seam.annotations.*; -import org.jboss.seam.annotations.web.RequestParameter; +import org.jboss.seam.annotations.In; +import org.jboss.seam.annotations.Name; +import org.jboss.seam.annotations.Out; +import org.jboss.seam.annotations.Scope; + import org.rhq.core.domain.auth.Subject; import org.rhq.core.domain.configuration.AbstractResourceConfigurationUpdate; import org.rhq.core.domain.configuration.Configuration; @@ -39,14 +54,6 @@ import org.rhq.enterprise.gui.util.EnterpriseFacesContextUtility; import org.rhq.enterprise.server.configuration.ConfigurationManagerLocal; import org.rhq.enterprise.server.util.LookupUtil;
-import javax.faces.application.FacesMessage; -import javax.faces.event.ValueChangeEvent; -import javax.servlet.http.HttpServletResponse; -import java.io.File; -import java.io.IOException; -import java.io.OutputStream; -import java.util.*; - @Name("configurationViewer") @Scope(ScopeType.PAGE) public class ResourceConfigurationViewer { @@ -89,30 +96,34 @@ public class ResourceConfigurationViewer { * </p> */ public void initialize() { - resourceId = FacesContextUtility.getRequiredRequestParameter("id", Integer.class); - - loadResourceConfigurationDefinition(); - - if (resourceConfigurationDefinition == null) { - FacesContextUtility.addMessage(FacesMessage.SEVERITY_WARN, - "This resource does not expose a configuration."); - return; - } + try { + resourceId = FacesContextUtility.getRequiredRequestParameter("id", Integer.class);
- loadResourceConfiguration(); + loadResourceConfigurationDefinition();
- if (resourceConfiguration == null) { - FacesContextUtility.addMessage(FacesMessage.SEVERITY_WARN, - "This resource's configuration has not yet been initialized."); - return; - } + if (resourceConfigurationDefinition == null) { + FacesContextUtility.addMessage(FacesMessage.SEVERITY_WARN, + "This resource does not expose a configuration."); + return; + }
- initRawConfigDirectories(); - initMode(); + loadResourceConfiguration();
- initialized = true; + if (resourceConfiguration == null) { + FacesContextUtility.addMessage(FacesMessage.SEVERITY_WARN, + "This resource's configuration has not yet been initialized."); + return; + } + + initRawConfigDirectories(); + initMode();
- doInitialization(); + initialized = true; + + doInitialization(); + } catch (Throwable t) { + FacesContextUtility.addMessage(FacesMessage.SEVERITY_ERROR, t.getMessage()); + } }
protected void doInitialization() { @@ -124,7 +135,7 @@ public class ResourceConfigurationViewer { ConfigurationManagerLocal configurationManager = LookupUtil.getConfigurationManager();
resourceConfigurationDefinition = configurationManager.getResourceConfigurationDefinitionForResourceType( - loggedInUser.getSubject(), resourceTypeId); + loggedInUser.getSubject(), resourceTypeId); }
private void loadResourceConfiguration() { @@ -132,8 +143,8 @@ public class ResourceConfigurationViewer {
ConfigurationManagerLocal configurationManager = LookupUtil.getConfigurationManager();
- AbstractResourceConfigurationUpdate configurationUpdate = - configurationManager.getLatestResourceConfigurationUpdate(subject, resourceId); + AbstractResourceConfigurationUpdate configurationUpdate = configurationManager + .getLatestResourceConfigurationUpdate(subject, resourceId); resourceConfiguration = (configurationUpdate != null) ? configurationUpdate.getConfiguration() : null;
if (resourceConfiguration != null) { @@ -145,8 +156,7 @@ public class ResourceConfigurationViewer { protected void initRawConfigDirectories() { if (isRawSupported() || isStructuredAndRawSupported()) { initConfigDirectories(); - } - else { + } else { rawConfigDirectories = Collections.emptyList(); } } @@ -185,13 +195,11 @@ public class ResourceConfigurationViewer { private void initMode() { if (isStructuredSupported()) { mode = STRUCTURED_MODE; - } - else if (isRawMode()) { + } else if (isRawMode()) { mode = RAW_MODE; - } - else { // else structured and raw is supported and (at least for now) we will just start - mode = STRUCTURED_MODE; // the user off in structured mode. We may at some later point want to add logic - // to remember what mode the user should start in. + } else { // else structured and raw is supported and (at least for now) we will just start + mode = STRUCTURED_MODE; // the user off in structured mode. We may at some later point want to add logic + // to remember what mode the user should start in. } }
@@ -223,7 +231,7 @@ public class ResourceConfigurationViewer { // however this property is read and its value applied to the modalEditor component before the mode is updated. // // jsanda - 02/10/2010 - + return isRawSupported() || isStructuredAndRawSupported(); }
@@ -253,8 +261,7 @@ public class ResourceConfigurationViewer { public void setSelectedTab(String tab) { if (tab.equals("structuredTab")) { mode = STRUCTURED_MODE; - } - else { + } else { mode = RAW_MODE; } } @@ -263,8 +270,7 @@ public class ResourceConfigurationViewer { if (event.getNewValue().equals("rawTab")) { mode = RAW_MODE; changeToRawTab(); - } - else if (event.getNewValue().equals("structuredTab")) { + } else if (event.getNewValue().equals("structuredTab")) { mode = STRUCTURED_MODE; changeToStructuredTab(); } @@ -314,9 +320,8 @@ public class ResourceConfigurationViewer { FacesContextUtility.getFacesContext().responseComplete();
return null; - } - catch (IOException e) { -// log.error("Failed to complete download request for " + getCurrentPath(), e); + } catch (IOException e) { + // log.error("Failed to complete download request for " + getCurrentPath(), e); throw new RuntimeException(e); } } @@ -328,5 +333,5 @@ public class ResourceConfigurationViewer { public String getModalEditorContents() { return selectedRawUIBean.getContents(); } - + } diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/configuration/editCurrent.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/configuration/editCurrent.xhtml index 251abd2..129ea66 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/configuration/editCurrent.xhtml +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/configuration/editCurrent.xhtml @@ -17,16 +17,23 @@
<ui:composition template="/rhq/group/layout/main.xhtml">
- <ui:param name="pageTitle" value="Edit Current Configuration for Compatible Group '#{EditGroupResourceConfigurationUIBean.group.name}'"/> + <ui:param name="pageTitle" value="Edit Current Configuration for Compatible Group '#{ResourceGroupUIBean.name}'"/> <ui:param name="selectedTabName" value="Configuration.Current"/> <ui:define name="content">
+ <h:outputText rendered="#{not ResourceGroupUIBean.permissions.configureRead}" + value="You do not have permissions to view configuration data for this group" /> + <h:form id="configSetForm" onsubmit="prepareInputsForSubmission(this)" - rendered="#{EditGroupResourceConfigurationUIBean.configurationSet ne null}"> + rendered="#{ResourceGroupUIBean.permissions.configureRead and EditGroupResourceConfigurationUIBean.configurationSet ne null}"> + + <h:outputText rendered="#{not ResourceGroupUIBean.permissions.configureWrite}" + value="You do not have permissions to change the configuration of this group"/>
<input type="hidden" name="groupId" value="#{param.groupId}"/>
- <h:panelGrid columns="3" styleClass="buttons-table" columnClasses="button-cell"> + <h:panelGrid columns="3" styleClass="buttons-table" columnClasses="button-cell" + rendered="${ResourceGroupUIBean.permissions.configureWrite}"> <h:commandButton type="submit" action="#{EditGroupResourceConfigurationUIBean.updateConfigurations}" value="SAVE" title="Click to Save Changes" styleClass="buttonmed"/> @@ -42,14 +49,13 @@
<a4j:region selfRendered="false"> <a4j:outputPanel layout="block" ajaxRendered="true" keepTransient="true"> - <onc:configSet id="rhq_configSet" configurationSet="#{EditGroupResourceConfigurationUIBean.configurationSet}"/> - </a4j:outputPanel> </a4j:region>
- <h:panelGrid columns="3" styleClass="buttons-table" columnClasses="button-cell"> + <h:panelGrid columns="3" styleClass="buttons-table" columnClasses="button-cell" + rendered="${ResourceGroupUIBean.permissions.configureWrite}"> <h:commandButton type="submit" action="#{EditGroupResourceConfigurationUIBean.updateConfigurations}" value="SAVE" title="Click to Save Changes" styleClass="buttonmed"/> diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/configuration/history.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/configuration/history.xhtml index fb98381..ab0b103 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/configuration/history.xhtml +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/configuration/history.xhtml @@ -20,7 +20,10 @@ <ui:param name="selectedTabName" value="Configuration.History"/> <ui:define name="content">
- <h:form id="historyForm"> + <h:outputText rendered="#{not ResourceGroupUIBean.permissions.configureRead}" + value="You do not have permissions to view configuration data for this group" /> + + <h:form id="historyForm" rendered="#{ResourceGroupUIBean.permissions.configureRead}"> <input type="hidden" name="groupId" value="#{param.groupId}"/> <input type="hidden" name="arcuId" value="#{param.arcuId}"/> <input type="hidden" name="mode" value="#{param.mode}"/> @@ -133,6 +136,7 @@ rich:columnGroup <rich:column colspan="7" width="100%"> <onc:selectCommandButton action="#{GroupResourceConfigurationHistoryUIBean.deleteSelectedUpdates}" + rendered="${ResourceGroupUIBean.permissions.configureWrite}" value="DELETE SELECTED" target="selectedUpdates" styleClass="on-pager-button buttonsmall" />
@@ -149,7 +153,7 @@ </rich:panel> </h:form>
- <rich:panel rendered="#{param.mode eq 'group' and not empty param.arcuId}"> + <rich:panel rendered="#{ResourceGroupUIBean.permissions.configureRead and param.mode eq 'group' and not empty param.arcuId}"> <f:facet name="header"> <h:outputText value="Group Configuration Update Request"/> </f:facet> @@ -168,7 +172,7 @@ </h:form> </rich:panel>
- <rich:panel rendered="#{param.mode eq 'details' and not empty param.arcuId}"> + <rich:panel rendered="#{ResourceGroupUIBean.permissions.configureRead and param.mode eq 'details' and not empty param.arcuId}"> <f:facet name="header"> <h:outputText value="Individual Resource Configuration Updates"/> </f:facet> diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/configuration/viewCurrent.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/configuration/viewCurrent.xhtml index 2b405c3..c158192 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/configuration/viewCurrent.xhtml +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/configuration/viewCurrent.xhtml @@ -16,38 +16,41 @@
<ui:composition template="/rhq/group/layout/main.xhtml">
- <ui:param name="pageTitle" value="View Current Configuration for Compatible Group '#{ViewGroupResourceConfigurationUIBean.group.name}'"/> + <ui:param name="pageTitle" value="View Current Configuration for Compatible Group '#{ResourceGroupUIBean.name}'"/> <ui:param name="selectedTabName" value="Configuration.Current"/> <ui:define name="content">
- <h:form id="configSetForm" rendered="#{ViewGroupResourceConfigurationUIBean.configurationSet ne null}"> + <h:outputText rendered="#{not ResourceGroupUIBean.permissions.configureRead}" + value="You do not have permissions to view configuration data for this group" /> + + <h:form id="configSetForm" rendered="#{ResourceGroupUIBean.permissions.configureRead and ViewGroupResourceConfigurationUIBean.configurationSet ne null}">
<input type="hidden" name="groupId" value="#{ViewGroupResourceConfigurationUIBean.group.id}" />
- <h:outputText rendered="#{not ResourceGroupUIBean.permissions.configure}" value="You do not have permissions to change the configuration of this group"/> + <h:outputText rendered="#{not ResourceGroupUIBean.permissions.configureWrite}" + value="You do not have permissions to change the configuration of this group"/>
+ <!-- edit button at top of config --> <h:panelGrid columns="1" styleClass="buttons-table" columnClasses="button-cell"> <h:commandButton value="EDIT" action="#{ViewGroupResourceConfigurationUIBean.edit}" title="Edit this Compatible Group Configuration" - rendered="${ResourceGroupUIBean.permissions.configure}" + rendered="${ResourceGroupUIBean.permissions.configureWrite}" styleClass="buttonmed"/> </h:panelGrid>
<a4j:region selfRendered="false"> <a4j:outputPanel layout="block" ajaxRendered="true" keepTransient="true"> - <onc:configSet id="rhq_configSet" configurationSet="#{ViewGroupResourceConfigurationUIBean.configurationSet}" readOnly="true"/> - </a4j:outputPanel> </a4j:region>
- + <!-- edit button at bottom of config --> <h:panelGrid columns="1" styleClass="buttons-table" columnClasses="button-cell"> <h:commandButton value="EDIT" action="#{ViewGroupResourceConfigurationUIBean.edit}" title="Edit this Compatible Group Configuration" - rendered="${ResourceGroupUIBean.permissions.configure}" + rendered="${ResourceGroupUIBean.permissions.configureWrite}" styleClass="buttonmed"/> </h:panelGrid>
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/configuration/edit.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/configuration/edit.xhtml index 9aafddc..39b1281 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/configuration/edit.xhtml +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/configuration/edit.xhtml @@ -26,14 +26,25 @@ THIS TEXT WILL BE REMOVED.
<ui:define name="content">
- <h:panelGroup layout="block" styleClass="InfoBlock" - rendered="#{configurationEditor.updateInProgress}"> - <b>${msg['note']}</b> ${msg['resource.config.Current.updateInProgress']} - </h:panelGroup> + ui:remove + Don't need outputText here, because configurationViewer appears to ALWAYS load before ResourceUIBean, which + means the authorization checks the SLSB do will bubbled up to it. So the strategy here will be to allow + configurationViewer.initialize to be called, which will throw the PermissionException and add a FacesMessage. + <h:outputText rendered="#{not ResourceUIBean.permissions.configureRead}" + value="You do not have permissions to view configuration data for this resource" /> + </ui:remove>
<h:form id="editResourceConfigurationForm" onsubmit="prepareInputsForSubmission(this)" - rendered="#{configurationEditor.initialized}"> + rendered="#{ResourceUIBean.permissions.configureRead and configurationEditor.initialized}"> + + <h:outputText rendered="#{not ResourceUIBean.permissions.configureWrite}" + value="You do not have permissions to edit configuration data for this resource" /> + + <h:panelGroup layout="block" styleClass="InfoBlock" + rendered="#{configurationEditor.updateInProgress}"> + <b>${msg['note']}</b> ${msg['resource.config.Current.updateInProgress']} + </h:panelGroup>
<input type="hidden" name="id" value="#{ResourceUIBean.id}"/>
@@ -48,7 +59,7 @@ THIS TEXT WILL BE REMOVED. action="#{configurationEditor.updateConfiguration}" title="Click to Save Changes" styleClass="buttonmed" - rendered="${ResourceUIBean.permissions.configure}"/> + rendered="${ResourceUIBean.permissions.configureWrite}"/> <s:button id="upperCancelButton" value="Cancel" view="view.xhtml" @@ -77,7 +88,7 @@ THIS TEXT WILL BE REMOVED. action="#{configurationEditor.updateConfiguration}" title="Click to Save Changes" styleClass="buttonmed" - rendered="${ResourceUIBean.permissions.configure}"/> + rendered="${ResourceUIBean.permissions.configureWrite}"/> <s:button id="lowerCancelButton" value="Cancel" view="view.xhtml" diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/configuration/history.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/configuration/history.xhtml index ac824f8..640e35d 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/configuration/history.xhtml +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/configuration/history.xhtml @@ -20,12 +20,16 @@ <ui:param name="selectedTabName" value="Configuration.History"/> <ui:define name="content">
-<ui:param name="latestConfig" value="#{GetLatestConfigurationUpdateUIBean.latestConfigurationUpdate}"/> +<h:outputText rendered="#{not ResourceUIBean.permissions.configureRead}" + value="You do not have permissions to view configuration data for this resource" />
-<h:form id="historyForm"> +<h:form id="historyForm" + rendered="#{ResourceUIBean.permissions.configureRead}"> <input type="hidden" name="id" value="${ResourceUIBean.id}"/>
rich:panel + <ui:param name="latestConfig" value="#{GetLatestConfigurationUpdateUIBean.latestConfigurationUpdate}"/> + <f:facet name="header">Current Configuration:</f:facet> <table> <tr> @@ -89,7 +93,7 @@ <onc:paginationControl id="ConfigurationHistory"/> </f:facet>
- <rich:column rendered="#{ResourceUIBean.permissions.configure}"> + <rich:column rendered="#{ResourceUIBean.permissions.configureWrite}"> <f:facet name="header"> <onc:allSelect target="selectedItems"/> </f:facet> @@ -184,18 +188,18 @@
<f:facet name="footer"> rich:columnGroup - <rich:column colspan="#{ResourceUIBean.permissions.configure ? 7 : 6}" width="100%"> + <rich:column colspan="#{ResourceUIBean.permissions.configureWrite ? 7 : 6}" width="100%"> <onc:selectCommandButton action="#{ListConfigurationUpdateUIBean.delete}" value="DELETE SELECTED" target="selectedItems" styleClass="on-pager-button buttonsmall" - rendered="${ResourceUIBean.permissions.configure}"/> + rendered="${ResourceUIBean.permissions.configureWrite}"/> <onc:selectCommandButton action="#{ListConfigurationUpdateUIBean.compare}" value="COMPARE SELECTED" low="2" high="2" target="selectedItems" styleClass="on-pager-button buttonsmall" rendered="false"/> <onc:selectCommandButton action="#{ListConfigurationUpdateUIBean.rollback}" value="ROLLBACK TO SELECTED" high="1" target="selectedItems" styleClass="on-pager-button buttonsmall" - rendered="${ResourceUIBean.permissions.configure}"/> + rendered="${ResourceUIBean.permissions.configureWrite}"/>
<ui:param name="paginationDataTableName" value="configurationUpdateDataTable"/> <ui:param name="paginationDataModel" value="#{configurationUpdateDataModel}"/> @@ -213,7 +217,7 @@ </rich:panel> </h:form>
-<rich:panel rendered="#{!empty param.configId}"> +<rich:panel rendered="#{ResourceUIBean.permissions.configureRead and !empty param.configId}">
<f:facet name="header"> <h:outputText value="Selected Configuration (#{param.configId})"/> diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/configuration/raw.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/configuration/raw.xhtml index b22194e..9bee981 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/configuration/raw.xhtml +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/configuration/raw.xhtml @@ -32,7 +32,7 @@ </c:choose>
<h:outputText value=" #{messages.nopermissionedit}" - rendered="#{!ResourceUIBean.permissions.configure}"/> + rendered="#{!ResourceUIBean.permissions.configureWrite}"/>
<h:panelGrid columns="2" styleClass="raw-outer-table" diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/configuration/structured.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/configuration/structured.xhtml index 49ff1b0..d162d6f 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/configuration/structured.xhtml +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/configuration/structured.xhtml @@ -14,7 +14,7 @@ </c:if>
<h:outputText value=" #{messages.nopermissionedit}" - rendered="#{!ResourceUIBean.permissions.configure}"/> + rendered="#{!ResourceUIBean.permissions.configureWrite}"/>
<onc:config configurationDefinition="#{resourceConfigurationDefinition}" diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/configuration/view.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/configuration/view.xhtml index 7a40797..a64a078 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/configuration/view.xhtml +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/configuration/view.xhtml @@ -28,12 +28,22 @@ THIS TEXT WILL BE REMOVED.
<ui:define name="content">
- <h:panelGroup layout="block" styleClass="InfoBlock" - rendered="#{configurationViewer.updateInProgress}"> - <b>${msg['note']}</b> ${msg['resource.config.Current.updateInProgress']} - </h:panelGroup> - - <h:form id="viewResourceConfigurationForm" rendered="#{configurationViewer.initialized}"> + ui:remove + Don't need outputText here, because configurationViewer appears to ALWAYS load before ResourceUIBean, which + means the authorization checks the SLSB do will bubbled up to it. So the strategy here will be to allow + configurationViewer.initialize to be called, which will throw the PermissionException and add a FacesMessage. + <h:outputText rendered="#{not ResourceUIBean.permissions.configureRead}" + value="You do not have permissions to view configuration data for this resource" /> + </ui:remove> + + <h:form id="viewResourceConfigurationForm" + rendered="#{ResourceUIBean.permissions.configureRead and configurationViewer.initialized}"> + + <h:panelGroup layout="block" styleClass="InfoBlock" + rendered="#{configurationViewer.updateInProgress}"> + <b>${msg['note']}</b> ${msg['resource.config.Current.updateInProgress']} + </h:panelGroup> + <input type="hidden" name="id" value="#{ResourceUIBean.id}"/>
<h:panelGrid columns="2" style="width:100%"> @@ -43,7 +53,7 @@ THIS TEXT WILL BE REMOVED. value="Edit" view="edit.xhtml" styleClass="buttonmed" - rendered="#{!configurationViewer.updateInProgress}"> + rendered="#{ResourceUIBean.permissions.configureWrite and !configurationViewer.updateInProgress}"> <f:param name="id" value="#{ResourceUIBean.id}"/> <f:param name="tab" value="#{configurationViewer.selectedTab}"/> </s:button> @@ -61,7 +71,7 @@ THIS TEXT WILL BE REMOVED. value="Edit" view="edit.xhtml" styleClass="buttonmed" - rendered="#{!configurationViewer.updateInProgress}"> + rendered="#{ResourceUIBean.permissions.configureWrite and !configurationViewer.updateInProgress}"> <f:param name="id" value="#{ResourceUIBean.id}"/> <f:param name="tab" value="#{configurationViewer.selectedTab}"/> </s:button> diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/summary/overview.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/summary/overview.xhtml index 2a27139..53c59f9 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/summary/overview.xhtml +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/summary/overview.xhtml @@ -41,12 +41,14 @@ </td>
<td width="50%" valign="top" nowrap="nowrap"> - <ui:include src="/rhq/resource/summary/table/recentConfigUpdates.xhtml" - rendered="#{ResourceUIBean.facets.configuration}" /> - <br /> - <rich:separator lineType="beveled" - width="50%" height="3px" - style="align: center;" /> + <c:if test="#{ResourceUIBean.permissions.configureRead}"> + <ui:include src="/rhq/resource/summary/table/recentConfigUpdates.xhtml" + rendered="#{ResourceUIBean.facets.configuration}" /> + <br /> + <rich:separator lineType="beveled" + width="50%" height="3px" + style="align: center;" /> + </c:if>
<ui:include src="/rhq/resource/summary/table/recentOperations.xhtml" rendered="#{ResourceUIBean.facets.operation}" /> diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationManagerBean.java index bc2321c..5f7203a 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationManagerBean.java @@ -321,7 +321,7 @@ public class ConfigurationManagerBean implements ConfigurationManagerLocal, Conf } }
- if (!authorizationManager.canViewResource(subject, resource.getId())) { + if (!authorizationManager.hasResourcePermission(subject, Permission.CONFIGURE_READ, resource.getId())) { throw new PermissionException("User [" + subject.getName() + "] does not have permission to view resource configuration for [" + resource + "]"); } @@ -443,7 +443,8 @@ public class ConfigurationManagerBean implements ConfigurationManagerLocal, Conf Query query = entityManager.createNamedQuery(ResourceConfigurationUpdate.QUERY_FIND_LATEST_BY_RESOURCE_ID); query.setParameter("resourceId", resourceId); ResourceConfigurationUpdate latestConfigUpdate = (ResourceConfigurationUpdate) query.getSingleResult(); - if (!authorizationManager.canViewResource(subject, latestConfigUpdate.getResource().getId())) { + if (!authorizationManager.hasResourcePermission(subject, Permission.CONFIGURE_READ, latestConfigUpdate + .getResource().getId())) { throw new PermissionException("User [" + subject.getName() + "] does not have permission to view Resource configuration for [" + latestConfigUpdate.getResource() + "]"); @@ -522,6 +523,12 @@ public class ConfigurationManagerBean implements ConfigurationManagerLocal, Conf
public Map<Integer, Configuration> getResourceConfigurationsForCompatibleGroup(Subject subject, int groupId) throws ConfigurationUpdateStillInProgressException, Exception { + + if (authorizationManager.hasGroupPermission(subject, Permission.CONFIGURE_READ, groupId) == false) { + throw new PermissionException("User[name=" + subject.getName() + + "] does not have permission to view configuration for group[id=" + groupId + "]"); + } + // The below call will also handle the check to see if the subject has perms to view the group. ResourceGroupComposite groupComposite = this.resourceGroupManager.getResourceGroupComposite(subject, groupId);
@@ -846,6 +853,11 @@ public class ConfigurationManagerBean implements ConfigurationManagerLocal, Conf public PageList<ResourceConfigurationUpdate> findResourceConfigurationUpdates(Subject subject, Integer resourceId, Long beginDate, Long endDate, boolean suppressOldest, PageControl pc) {
+ if (!authorizationManager.hasResourcePermission(subject, Permission.CONFIGURE_READ, resourceId)) { + throw new PermissionException("User[" + subject.getName() + + "] does not have permission to view configuration history for resource[id=" + resourceId + "]"); + } + // TODO (ips, 04/01/10): Our id's are not guaranteed to be sequential, because our sequences are configured to // pre-create and cache blocks of 10 sequence id's, so it may be better to order by // "cu.createdTime", rather than "cu.id". @@ -987,6 +999,11 @@ public class ConfigurationManagerBean implements ConfigurationManagerLocal, Conf Configuration newConfiguration, boolean fromStructured) throws ResourceNotFoundException, ConfigurationUpdateStillInProgressException {
+ if (authorizationManager.hasResourcePermission(subject, Permission.CONFIGURE_WRITE, resourceId) == false) { + throw new PermissionException("User[name=" + subject.getName() + + "] does not have the permission to update configuration for resource[id=" + resourceId + "]"); + } + Configuration configToUpdate = newConfiguration;
if (isStructuredAndRawSupported(resourceId)) { @@ -1062,6 +1079,11 @@ public class ConfigurationManagerBean implements ConfigurationManagerLocal, Conf + "whether the structured or raw was updated."); }
+ if (authorizationManager.hasResourcePermission(subject, Permission.CONFIGURE_WRITE, resourceId) == false) { + throw new PermissionException("User[name=" + subject.getName() + + "] does not have the permission to update configuration for resource[id=" + resourceId + "]"); + } + // must do this in a separate transaction so it is committed prior to sending the agent request // (consider synchronizing to avoid the condition where someone calls this method twice quickly // in two different txs which would put two updates in INPROGRESS and cause havoc) @@ -1650,8 +1672,11 @@ public class ConfigurationManagerBean implements ConfigurationManagerLocal, Conf }
@SuppressWarnings("unchecked") - public PageList<ConfigurationUpdateComposite> findResourceConfigurationUpdateCompositesByParentId( + public PageList<ConfigurationUpdateComposite> findResourceConfigurationUpdateCompositesByParentId(Subject subject, int configurationUpdateId, PageControl pageControl) { + // will perform CONFIGURE_READ security check for us, no need to save the + getGroupResourceConfigurationUpdate(subject, configurationUpdateId); + pageControl.initDefaultOrderingField("cu.modifiedTime");
Query query = PersistenceUtility.createQueryWithOrderBy(entityManager, @@ -1711,8 +1736,11 @@ public class ConfigurationManagerBean implements ConfigurationManagerLocal, Conf }
@SuppressWarnings("unchecked") - public Map<Integer, Configuration> getResourceConfigurationMapForGroupUpdate( + public Map<Integer, Configuration> getResourceConfigurationMapForGroupUpdate(Subject subject, Integer groupResourceConfigurationUpdateId) { + // this method will perform the CONFIGURE_READ security check for us, no need to keep reference to result + getGroupPluginConfigurationUpdate(subject, groupResourceConfigurationUpdateId); + Tuple<String, Object> groupIdParameter = new Tuple<String, Object>("groupConfigurationUpdateId", groupResourceConfigurationUpdateId); return executeGetConfigurationMapQuery(Configuration.QUERY_GET_RESOURCE_CONFIG_MAP_BY_GROUP_UPDATE_ID, 100, @@ -1786,7 +1814,13 @@ public class ConfigurationManagerBean implements ConfigurationManagerLocal, Conf }
@SuppressWarnings("unchecked") - public PageList<GroupResourceConfigurationUpdate> findGroupResourceConfigurationUpdates(int groupId, PageControl pc) { + public PageList<GroupResourceConfigurationUpdate> findGroupResourceConfigurationUpdates(Subject subject, + int groupId, PageControl pc) { + if (authorizationManager.hasGroupPermission(subject, Permission.CONFIGURE_READ, groupId) == false) { + throw new PermissionException("User[name=" + subject.getName() + + "] does not have permission to view configuration for group[id=" + groupId + "]"); + } + pc.initDefaultOrderingField("modifiedTime", PageOrdering.DESC);
Query query = PersistenceUtility.createQueryWithOrderBy(entityManager, @@ -1933,7 +1967,7 @@ public class ConfigurationManagerBean implements ConfigurationManagerLocal, Conf GroupPluginConfigurationUpdate update = getGroupPluginConfigurationById(configurationUpdateId);
int groupId = update.getGroup().getId(); - if (authorizationManager.canViewGroup(subject, groupId) == false) { + if (authorizationManager.hasGroupPermission(subject, Permission.CONFIGURE_READ, groupId) == false) { throw new PermissionException("User[" + subject.getName() + "] does not have permission to view group resourceConfiguration[id=" + configurationUpdateId + "]"); } @@ -1968,7 +2002,7 @@ public class ConfigurationManagerBean implements ConfigurationManagerLocal, Conf throw new NoResultException("Cannot get live configuration for unknown resource [" + resourceId + "]"); }
- if (!authorizationManager.canViewResource(subject, resource.getId())) { + if (!authorizationManager.hasResourcePermission(subject, Permission.CONFIGURE_READ, resource.getId())) { throw new PermissionException("User [" + subject.getName() + "] does not have permission to view resource configuration for [" + resource + "]"); } diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationManagerLocal.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationManagerLocal.java index 01adabe..4242153 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationManagerLocal.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationManagerLocal.java @@ -306,7 +306,7 @@ public interface ConfigurationManagerLocal { PageList<ConfigurationUpdateComposite> findPluginConfigurationUpdateCompositesByParentId(int configurationUpdateId, PageControl pageControl);
- PageList<ConfigurationUpdateComposite> findResourceConfigurationUpdateCompositesByParentId( + PageList<ConfigurationUpdateComposite> findResourceConfigurationUpdateCompositesByParentId(Subject subject, int configurationUpdateId, PageControl pageControl);
PageList<Integer> findPluginConfigurationUpdatesByParentId(int configurationUpdateId, PageControl pageControl); @@ -320,7 +320,8 @@ public interface ConfigurationManagerLocal {
PageList<GroupPluginConfigurationUpdate> findGroupPluginConfigurationUpdates(int groupId, PageControl pc);
- PageList<GroupResourceConfigurationUpdate> findGroupResourceConfigurationUpdates(int groupId, PageControl pc); + PageList<GroupResourceConfigurationUpdate> findGroupResourceConfigurationUpdates(Subject subject, int groupId, + PageControl pc);
ConfigurationUpdateStatus updateGroupPluginConfigurationUpdateStatus(int groupPluginConfigurationUpdateId, String errorMessages); @@ -345,7 +346,8 @@ public interface ConfigurationManagerLocal {
GroupResourceConfigurationUpdate getGroupResourceConfigurationById(int configurationUpdateId);
- Map<Integer, Configuration> getResourceConfigurationMapForGroupUpdate(Integer groupResourceConfigurationUpdateId); + Map<Integer, Configuration> getResourceConfigurationMapForGroupUpdate(Subject subject, + Integer groupResourceConfigurationUpdateId);
Map<Integer, Configuration> getResourceConfigurationMapForCompatibleGroup(ResourceGroup compatibleGroup);
commit c09481313e95c91d65c758117ff2bbe03b5e9eac Author: Joseph Marques joseph@redhat.com Date: Sun Jul 18 22:45:03 2010 -0400
BZ-614886: update view/edit role page to accomodate new read/write config permissions
* new layout for permissions we may eventually want to have separate read/write bits * new properties in ApplicationResources.properties for i18n * use javascript to keep the read/write bits in "sync" ** if config-write is checked, also check config-read ** if config-read is unckeched, also uncheck config-write * update the RoleManagerBean to ensure config-read is added when config-write is selected ** this will mostly be for remote callers, since our UI already uses javascript to handle this more intuitively
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp-filtered/WEB-INF/classes/ApplicationResources.properties b/modules/enterprise/gui/portal-war/src/main/webapp-filtered/WEB-INF/classes/ApplicationResources.properties index d72193e..be7826c 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp-filtered/WEB-INF/classes/ApplicationResources.properties +++ b/modules/enterprise/gui/portal-war/src/main/webapp-filtered/WEB-INF/classes/ApplicationResources.properties @@ -300,7 +300,11 @@ admin.role.props.100=Please limit the description to 100 characters admin.role.perms.PermissionsTab=Permissions admin.role.perms.GlobalPermissions=Global Permissions admin.role.perms.ResourcePermissions=Resource Permissions +admin.role.perms.SubsystemPermissions=Subsystem Permissions admin.role.perms.Authorized=Authorized? +admin.role.perms.Read=Read? +admin.role.perms.Write=Write? +admin.role.perms.NotApplicable=N/A admin.role.perms.perm.MANAGE_SECURITY=Manage security (users/roles) admin.role.perms.perm.MANAGE_SECURITY.warning=This permission implicitly grants (and explicitly forces selection of) all other permissions admin.role.perms.perm.MANAGE_INVENTORY=Manage inventory (resources/groups) diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/admin/role/RolePermissionsForm.jsp b/modules/enterprise/gui/portal-war/src/main/webapp/admin/role/RolePermissionsForm.jsp index 2d00e33..105448a 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/admin/role/RolePermissionsForm.jsp +++ b/modules/enterprise/gui/portal-war/src/main/webapp/admin/role/RolePermissionsForm.jsp @@ -19,7 +19,7 @@ <html:img page="/images/spacer.gif" width="175" height="1" border="0"/><br> <fmt:message key="admin.role.perms.GlobalPermissions"/></td>
- <td width="300px" class="ListHeaderInactive"><div align="center"> + <td width="150px" class="ListHeaderInactive" colspan="2"><div align="center"> <html:img page="/images/spacer.gif" width="50" height="1" border="0"/><br> <fmt:message key="admin.role.perms.Authorized"/></div></td> </tr> @@ -37,15 +37,15 @@ <c:when test="${mode eq 'view'}"> <c:choose> <c:when test="${rolePermissions['MANAGE_SECURITY']}"> - <td align="center" class="ListCell"><html:img page="/images/permission_enabled.gif" width="11" height="11" border="0"/></td> + <td align="center" class="ListCell" colspan="2"><html:img page="/images/permission_enabled.gif" width="11" height="11" border="0"/></td> </c:when> <c:otherwise> - <td align="center" class="ListCell"><html:img page="/images/permission_disabled.gif" width="11" height="11" border="0"/></td> + <td align="center" class="ListCell" colspan="2"><html:img page="/images/permission_disabled.gif" width="11" height="11" border="0"/></td> </c:otherwise> </c:choose> </c:when> <c:otherwise> - <td align="center" class="ListCellCheckboxSelected"><html:multibox property="p" value="MANAGE_SECURITY" onclick="ToggleAll(this)"/></td> + <td align="center" class="ListCellCheckboxSelected" colspan="2"><html:multibox property="p" value="MANAGE_SECURITY" onclick="ToggleAll(this)"/></td> </c:otherwise> </c:choose> </tr> @@ -58,15 +58,15 @@ <c:when test="${mode eq 'view'}"> <c:choose> <c:when test="${rolePermissions['MANAGE_INVENTORY']}"> - <td align="center" class="ListCell"><html:img page="/images/permission_enabled.gif" width="11" height="11" border="0"/></td> + <td align="center" class="ListCell" colspan="2"><html:img page="/images/permission_enabled.gif" width="11" height="11" border="0"/></td> </c:when> <c:otherwise> - <td align="center" class="ListCell"><html:img page="/images/permission_disabled.gif" width="11" height="11" border="0"/></td> + <td align="center" class="ListCell" colspan="2"><html:img page="/images/permission_disabled.gif" width="11" height="11" border="0"/></td> </c:otherwise> </c:choose> </c:when> <c:otherwise> - <td align="center" class="ListCellCheckboxSelected"><html:multibox property="p" value="MANAGE_INVENTORY" onclick="ToggleSelection(this, 'MANAGE_SECURITY')"/></td> + <td align="center" class="ListCellCheckboxSelected" colspan="2"><html:multibox property="p" value="MANAGE_INVENTORY" onclick="ToggleSelection(this, 'MANAGE_SECURITY')"/></td> </c:otherwise> </c:choose> </tr> @@ -79,15 +79,15 @@ <c:when test="${mode eq 'view'}"> <c:choose> <c:when test="${rolePermissions['MANAGE_SETTINGS']}"> - <td align="center" class="ListCell"><html:img page="/images/permission_enabled.gif" width="11" height="11" border="0"/></td> + <td align="center" class="ListCell" colspan="2"><html:img page="/images/permission_enabled.gif" width="11" height="11" border="0"/></td> </c:when> <c:otherwise> - <td align="center" class="ListCell"><html:img page="/images/permission_disabled.gif" width="11" height="11" border="0"/></td> + <td align="center" class="ListCell" colspan="2"><html:img page="/images/permission_disabled.gif" width="11" height="11" border="0"/></td> </c:otherwise> </c:choose> </c:when> <c:otherwise> - <td align="center" class="ListCellCheckboxSelected"><html:multibox property="p" value="MANAGE_SETTINGS" onclick="ToggleSelection(this, 'MANAGE_SECURITY')"/></td> + <td align="center" class="ListCellCheckboxSelected" colspan="2"><html:multibox property="p" value="MANAGE_SETTINGS" onclick="ToggleSelection(this, 'MANAGE_SECURITY')"/></td> </c:otherwise> </c:choose> </tr> @@ -100,15 +100,15 @@ <c:when test="${mode eq 'view'}"> <c:choose> <c:when test="${rolePermissions['MANAGE_BUNDLE']}"> - <td align="center" class="ListCell"><html:img page="/images/permission_enabled.gif" width="11" height="11" border="0"/></td> + <td align="center" class="ListCell" colspan="2"><html:img page="/images/permission_enabled.gif" width="11" height="11" border="0"/></td> </c:when> <c:otherwise> - <td align="center" class="ListCell"><html:img page="/images/permission_disabled.gif" width="11" height="11" border="0"/></td> + <td align="center" class="ListCell" colspan="2"><html:img page="/images/permission_disabled.gif" width="11" height="11" border="0"/></td> </c:otherwise> </c:choose> </c:when> <c:otherwise> - <td align="center" class="ListCellCheckboxSelected"><html:multibox property="p" value="MANAGE_BUNDLE" onclick="ToggleSelection(this, 'MANAGE_BUNDLE')"/></td> + <td align="center" class="ListCellCheckboxSelected" colspan="2"><html:multibox property="p" value="MANAGE_BUNDLE" onclick="ToggleSelection(this, 'MANAGE_BUNDLE')"/></td> </c:otherwise> </c:choose> </tr> @@ -121,7 +121,7 @@ <html:img page="/images/spacer.gif" width="175" height="1" border="0"/><br> <fmt:message key="admin.role.perms.ResourcePermissions"/></td>
- <td class="ListHeaderInactive" nowrap="nowrap"><div align="center"> + <td class="ListHeaderInactive" nowrap="nowrap" colspan="2"><div align="center"> <html:img page="/images/spacer.gif" width="50" height="1" border="0"/><br> <fmt:message key="admin.role.perms.Authorized"/></div></td> </tr> @@ -136,15 +136,15 @@ <c:when test="${mode eq 'view'}"> <c:choose> <c:when test="${rolePermissions['MODIFY_RESOURCE']}"> - <td align="center" class="ListCell"><html:img page="/images/permission_enabled.gif" width="11" height="11" border="0"/></td> + <td align="center" class="ListCell" colspan="2"><html:img page="/images/permission_enabled.gif" width="11" height="11" border="0"/></td> </c:when> <c:otherwise> - <td align="center" class="ListCell"><html:img page="/images/permission_disabled.gif" width="11" height="11" border="0"/></td> + <td align="center" class="ListCell" colspan="2"><html:img page="/images/permission_disabled.gif" width="11" height="11" border="0"/></td> </c:otherwise> </c:choose> </c:when> <c:otherwise> - <td align="center" class="ListCellCheckboxSelected"><html:multibox property="p" value="MODIFY_RESOURCE" onclick="ToggleSelection(this, 'MANAGE_SECURITY')"/></td> + <td align="center" class="ListCellCheckboxSelected" colspan="2"><html:multibox property="p" value="MODIFY_RESOURCE" onclick="ToggleSelection(this, 'MANAGE_SECURITY')"/></td> </c:otherwise> </c:choose> </tr> @@ -157,15 +157,15 @@ <c:when test="${mode eq 'view'}"> <c:choose> <c:when test="${rolePermissions['DELETE_RESOURCE']}"> - <td align="center" class="ListCell"><html:img page="/images/permission_enabled.gif" width="11" height="11" border="0"/></td> + <td align="center" class="ListCell" colspan="2"><html:img page="/images/permission_enabled.gif" width="11" height="11" border="0"/></td> </c:when> <c:otherwise> - <td align="center" class="ListCell"><html:img page="/images/permission_disabled.gif" width="11" height="11" border="0"/></td> + <td align="center" class="ListCell" colspan="2"><html:img page="/images/permission_disabled.gif" width="11" height="11" border="0"/></td> </c:otherwise> </c:choose> </c:when> <c:otherwise> - <td align="center" class="ListCellCheckboxSelected"><html:multibox property="p" value="DELETE_RESOURCE" onclick="ToggleSelection(this, 'MANAGE_SECURITY')"/></td> + <td align="center" class="ListCellCheckboxSelected" colspan="2"><html:multibox property="p" value="DELETE_RESOURCE" onclick="ToggleSelection(this, 'MANAGE_SECURITY')"/></td> </c:otherwise> </c:choose> </tr> @@ -178,19 +178,34 @@ <c:when test="${mode eq 'view'}"> <c:choose> <c:when test="${rolePermissions['CREATE_CHILD_RESOURCES']}"> - <td align="center" class="ListCell"><html:img page="/images/permission_enabled.gif" width="11" height="11" border="0"/></td> + <td align="center" class="ListCell" colspan="2"><html:img page="/images/permission_enabled.gif" width="11" height="11" border="0"/></td> </c:when> <c:otherwise> - <td align="center" class="ListCell"><html:img page="/images/permission_disabled.gif" width="11" height="11" border="0"/></td> + <td align="center" class="ListCell" colspan="2"><html:img page="/images/permission_disabled.gif" width="11" height="11" border="0"/></td> </c:otherwise> </c:choose> </c:when> <c:otherwise> - <td align="center" class="ListCellCheckboxSelected"><html:multibox property="p" value="CREATE_CHILD_RESOURCES" onclick="ToggleSelection(this, 'MANAGE_SECURITY')"/></td> + <td align="center" class="ListCellCheckboxSelected" colspan="2"><html:multibox property="p" value="CREATE_CHILD_RESOURCES" onclick="ToggleSelection(this, 'MANAGE_SECURITY')"/></td> </c:otherwise> </c:choose> </tr>
+ <!-- THE SUBSYSTEM PERMISSIONS HEADER ROW --> + <tr class="ListHeader"> + <td class="ListHeaderInactive"> + <html:img page="/images/spacer.gif" width="175" height="1" border="0"/><br> + <fmt:message key="admin.role.perms.SubsystemPermissions"/></td> + + <td class="ListHeaderInactive" nowrap="nowrap"><div align="center"> + <html:img page="/images/spacer.gif" width="25" height="1" border="0"/><br> + <fmt:message key="admin.role.perms.Read"/></div></td> + + <td class="ListHeaderInactive" nowrap="nowrap"><div align="center"> + <html:img page="/images/spacer.gif" width="25" height="1" border="0"/><br> + <fmt:message key="admin.role.perms.Write"/></div></td> + </tr> + <!-- MANAGE_ALERTS --> <tr class="ListRow"> <td class="ListCell"><b><fmt:message key="admin.role.perms.perm.MANAGE_ALERTS"/></b></td> @@ -199,14 +214,17 @@ <c:when test="${mode eq 'view'}"> <c:choose> <c:when test="${rolePermissions['MANAGE_ALERTS']}"> + <td align="center" class="ListCell"><fmt:message key="admin.role.perms.NotApplicable"/></td> <td align="center" class="ListCell"><html:img page="/images/permission_enabled.gif" width="11" height="11" border="0"/></td> </c:when> <c:otherwise> + <td align="center" class="ListCell"><fmt:message key="admin.role.perms.NotApplicable"/></td> <td align="center" class="ListCell"><html:img page="/images/permission_disabled.gif" width="11" height="11" border="0"/></td> </c:otherwise> </c:choose> </c:when> <c:otherwise> + <td align="center" class="ListCellCheckboxSelected"><fmt:message key="admin.role.perms.NotApplicable"/></td> <td align="center" class="ListCellCheckboxSelected"><html:multibox property="p" value="MANAGE_ALERTS" onclick="ToggleSelection(this, 'MANAGE_SECURITY')"/></td> </c:otherwise> </c:choose> @@ -220,14 +238,17 @@ <c:when test="${mode eq 'view'}"> <c:choose> <c:when test="${rolePermissions['MANAGE_MEASUREMENTS']}"> + <td align="center" class="ListCell"><fmt:message key="admin.role.perms.NotApplicable"/></td> <td align="center" class="ListCell"><html:img page="/images/permission_enabled.gif" width="11" height="11" border="0"/></td> </c:when> <c:otherwise> + <td align="center" class="ListCell"><fmt:message key="admin.role.perms.NotApplicable"/></td> <td align="center" class="ListCell"><html:img page="/images/permission_disabled.gif" width="11" height="11" border="0"/></td> </c:otherwise> </c:choose> </c:when> <c:otherwise> + <td align="center" class="ListCellCheckboxSelected"><fmt:message key="admin.role.perms.NotApplicable"/></td> <td align="center" class="ListCellCheckboxSelected"><html:multibox property="p" value="MANAGE_MEASUREMENTS" onclick="ToggleSelection(this, 'MANAGE_SECURITY')"/></td> </c:otherwise> </c:choose> @@ -241,14 +262,17 @@ <c:when test="${mode eq 'view'}"> <c:choose> <c:when test="${rolePermissions['MANAGE_CONTENT']}"> + <td align="center" class="ListCell"><fmt:message key="admin.role.perms.NotApplicable"/></td> <td align="center" class="ListCell"><html:img page="/images/permission_enabled.gif" width="11" height="11" border="0"/></td> </c:when> <c:otherwise> + <td align="center" class="ListCell"><fmt:message key="admin.role.perms.NotApplicable"/></td> <td align="center" class="ListCell"><html:img page="/images/permission_disabled.gif" width="11" height="11" border="0"/></td> </c:otherwise> </c:choose> </c:when> <c:otherwise> + <td align="center" class="ListCellCheckboxSelected"><fmt:message key="admin.role.perms.NotApplicable"/></td> <td align="center" class="ListCellCheckboxSelected"><html:multibox property="p" value="MANAGE_CONTENT" onclick="ToggleSelection(this, 'MANAGE_SECURITY')"/></td> </c:otherwise> </c:choose> @@ -262,14 +286,17 @@ <c:when test="${mode eq 'view'}"> <c:choose> <c:when test="${rolePermissions['CONTROL']}"> + <td align="center" class="ListCell"><fmt:message key="admin.role.perms.NotApplicable"/></td> <td align="center" class="ListCell"><html:img page="/images/permission_enabled.gif" width="11" height="11" border="0"/></td> </c:when> <c:otherwise> + <td align="center" class="ListCell"><fmt:message key="admin.role.perms.NotApplicable"/></td> <td align="center" class="ListCell"><html:img page="/images/permission_disabled.gif" width="11" height="11" border="0"/></td> </c:otherwise> </c:choose> </c:when> <c:otherwise> + <td align="center" class="ListCellCheckboxSelected"><fmt:message key="admin.role.perms.NotApplicable"/></td> <td align="center" class="ListCellCheckboxSelected"><html:multibox property="p" value="CONTROL" onclick="ToggleSelection(this, 'MANAGE_SECURITY')"/></td> </c:otherwise> </c:choose> @@ -282,7 +309,15 @@ <c:choose> <c:when test="${mode eq 'view'}"> <c:choose> - <c:when test="${rolePermissions['CONFIGURE']}"> + <c:when test="${rolePermissions['CONFIGURE_READ']}"> + <td align="center" class="ListCell"><html:img page="/images/permission_enabled.gif" width="11" height="11" border="0"/></td> + </c:when> + <c:otherwise> + <td align="center" class="ListCell"><html:img page="/images/permission_disabled.gif" width="11" height="11" border="0"/></td> + </c:otherwise> + </c:choose> + <c:choose> + <c:when test="${rolePermissions['CONFIGURE_WRITE']}"> <td align="center" class="ListCell"><html:img page="/images/permission_enabled.gif" width="11" height="11" border="0"/></td> </c:when> <c:otherwise> @@ -291,7 +326,8 @@ </c:choose> </c:when> <c:otherwise> - <td align="center" class="ListCellCheckboxSelected"><html:multibox property="p" value="CONFIGURE" onclick="ToggleSelection(this, 'MANAGE_SECURITY')"/></td> + <td align="center" class="ListCellCheckboxSelected"><html:multibox property="p" value="CONFIGURE_READ" onclick="ToggleSelection(this, 'MANAGE_SECURITY'); ToggleSelectionState(this, 'CONFIGURE_WRITE', 0)"/></td> + <td align="center" class="ListCellCheckboxSelected"><html:multibox property="p" value="CONFIGURE_WRITE" onclick="ToggleSelection(this, 'MANAGE_SECURITY'); ToggleSelectionState(this, 'CONFIGURE_READ', 1)"/></td> </c:otherwise> </c:choose> </tr> @@ -301,10 +337,10 @@ <c:if test="${mode eq edit || mode eq new}"> <script language="JavaScript" src="<html:rewrite page="/js/adminEditRole_checkAll.js"/>"></script> <tr class="ListRow"> - <td colspan="2">**<fmt:message key="admin.role.perms.perm.MANAGE_SECURITY.warning"/></td> + <td colspan="3">**<fmt:message key="admin.role.perms.perm.MANAGE_SECURITY.warning"/></td> </tr> </c:if>
</table>
-<!-- / --> +<!-- / --> \ No newline at end of file diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/js/adminEditRole_checkAll.js b/modules/enterprise/gui/portal-war/src/main/webapp/js/adminEditRole_checkAll.js index b81be15..6db14f6 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/js/adminEditRole_checkAll.js +++ b/modules/enterprise/gui/portal-war/src/main/webapp/js/adminEditRole_checkAll.js @@ -11,14 +11,32 @@ function ToggleSelection(e, depends) { var len = uList.elements.length; for (var i = 0; i < len; i++) { - var e = uList.elements[i]; - if (e.getAttribute("type")=="checkbox" && e.getAttribute("value")==depends) { - e.checked = false; + var elt = uList.elements[i]; + if (elt.getAttribute("type")=="checkbox" && elt.getAttribute("value")==depends) { + elt.checked = false; } } } }
+function ToggleSelectionState(e, depends, state) { + if (isIE) + e = event.srcElement; + + var form = e.form; + var uList = e.form; + var len = uList.elements.length; + + for (var i = 0; i < len; i++) { + var elt = uList.elements[i]; + if (elt.getAttribute("type")=="checkbox" && elt.getAttribute("value")==depends) { + if (e.checked == state) { + elt.checked = e.checked; + } + } + } +} + function ToggleAll(e) { if (isIE) e = event.srcElement; @@ -55,4 +73,3 @@ function ClearAll(e) { } } /*-- END adminEditRole_checkAll.js --*/ - diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/authz/RoleManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/authz/RoleManagerBean.java index bcf6daf..4f5aa4d 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/authz/RoleManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/authz/RoleManagerBean.java @@ -482,6 +482,13 @@ public class RoleManagerBean implements RoleManagerLocal, RoleManagerRemote { if (role.getPermissions().contains(Permission.MANAGE_SECURITY)) { role.getPermissions().addAll(Arrays.asList(Permission.values())); } + + /* + * write-access implies read-access + */ + if ((role.getPermissions().contains(Permission.CONFIGURE_WRITE))) { + role.getPermissions().add(Permission.CONFIGURE_READ); + } }
public PageList<Role> findSubjectAssignedRoles(Subject subject, int subjectId, PageControl pc) {
commit c1472c2fa4cc5c3c05321961bfd63408d7b8f08a Author: Joseph Marques joseph@redhat.com Date: Sun Jul 18 18:06:03 2010 -0400
BZ-614886: add secondary permission for configuration subsystem
part 1 - new enum
* rename CONFIGURE perm to CONFIGURE_WRITE ** rename action is safe because permissions are persisted using ordinals, not string names * add new CONFIGURE_READ permission ** must be added to the end of the enum, becuase permissions are persisted using ordinals
part 2 - update code paths
* update code paths previously using CONFIGURE perm to now use CONFIGURE_WRITE * for ResourceDetailView, change logic to show tab if user has config-read perm on resource
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/authz/Permission.java b/modules/core/domain/src/main/java/org/rhq/core/domain/authz/Permission.java index f1f6cca..e20d15b 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/authz/Permission.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/authz/Permission.java @@ -94,13 +94,19 @@ public enum Permission { CONTROL(Target.RESOURCE),
/** - * can C/U/D resource config (e.g. reconfiguring JBoss to listen for jnp on port 1199) + * can C/U/D resource config (e.g. reconfiguring JBoss to listen for jnp on port 1199); + * having this permission implies having @link {@link #CONFIGURE_READ} */ - CONFIGURE(Target.RESOURCE), + CONFIGURE_WRITE(Target.RESOURCE),
/* ========== New Bundle Global Permission ========== */
- MANAGE_BUNDLE(Target.GLOBAL); + MANAGE_BUNDLE(Target.GLOBAL), + + /** + * can read resource configu, but can not necessarily C/U/D unless @link {@link #CONFIGURE_WRITE} is also possessed + */ + CONFIGURE_READ(Target.RESOURCE);
/** * The target that a permission applies to. diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/Resource.java b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/Resource.java index 269e4d3..52420f4 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/Resource.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/Resource.java @@ -569,7 +569,8 @@ import org.rhq.core.domain.util.Summary; + " (SELECT count(p) FROM res.implicitGroups g JOIN g.roles r JOIN r.subjects s JOIN r.permissions p WHERE s = :subject AND p = 4), " // we want MODIFY_RESOURCE (4), not VIEW_RESOURCE (3) + " (SELECT count(p) FROM res.implicitGroups g JOIN g.roles r JOIN r.subjects s JOIN r.permissions p WHERE s = :subject AND p = 10), " // we want CONTROL, 10 + " (SELECT count(p) FROM res.implicitGroups g JOIN g.roles r JOIN r.subjects s JOIN r.permissions p WHERE s = :subject AND p = 7), " // we want MANAGE_ALERTS, 7 - + " (SELECT count(p) FROM res.implicitGroups g JOIN g.roles r JOIN r.subjects s JOIN r.permissions p WHERE s = :subject AND p = 11), " // we want CONFIGURE, 11 + + " (SELECT count(p) FROM res.implicitGroups g JOIN g.roles r JOIN r.subjects s JOIN r.permissions p WHERE s = :subject AND p = 13), " // we want CONFIGURE_READ, 13 + + " (SELECT count(p) FROM res.implicitGroups g JOIN g.roles r JOIN r.subjects s JOIN r.permissions p WHERE s = :subject AND p = 11), " // we want CONFIGURE_WRITE, 11 + " (SELECT count(p) FROM res.implicitGroups g JOIN g.roles r JOIN r.subjects s JOIN r.permissions p WHERE s = :subject AND p = 9), " // we want MANAGE_CONTENT, 9 + " (SELECT count(p) FROM res.implicitGroups g JOIN g.roles r JOIN r.subjects s JOIN r.permissions p WHERE s = :subject AND p = 6), " // we want CREATE_CHILD_RESOURCES, 6 + " (SELECT count(p) FROM res.implicitGroups g JOIN g.roles r JOIN r.subjects s JOIN r.permissions p WHERE s = :subject AND p = 5)) " // we want DELETE_RESOURCES, 5 @@ -590,7 +591,8 @@ import org.rhq.core.domain.util.Summary; + " (SELECT count(p) FROM res.implicitGroups g JOIN g.roles r JOIN r.subjects s JOIN r.permissions p WHERE s = :subject AND p = 4), " // we want MODIFY_RESOURCE (4), not VIEW_RESOURCE (3) + " (SELECT count(p) FROM res.implicitGroups g JOIN g.roles r JOIN r.subjects s JOIN r.permissions p WHERE s = :subject AND p = 10), " // we want CONTROL, 10 + " (SELECT count(p) FROM res.implicitGroups g JOIN g.roles r JOIN r.subjects s JOIN r.permissions p WHERE s = :subject AND p = 7), " // we want MANAGE_ALERTS, 7 - + " (SELECT count(p) FROM res.implicitGroups g JOIN g.roles r JOIN r.subjects s JOIN r.permissions p WHERE s = :subject AND p = 11), " // we want CONFIGURE, 11 + + " (SELECT count(p) FROM res.implicitGroups g JOIN g.roles r JOIN r.subjects s JOIN r.permissions p WHERE s = :subject AND p = 13), " // we want CONFIGURE_READ, 13 + + " (SELECT count(p) FROM res.implicitGroups g JOIN g.roles r JOIN r.subjects s JOIN r.permissions p WHERE s = :subject AND p = 11), " // we want CONFIGURE_WRITE, 11 + " (SELECT count(p) FROM res.implicitGroups g JOIN g.roles r JOIN r.subjects s JOIN r.permissions p WHERE s = :subject AND p = 9), " // we want MANAGE_CONTENT, 9 + " (SELECT count(p) FROM res.implicitGroups g JOIN g.roles r JOIN r.subjects s JOIN r.permissions p WHERE s = :subject AND p = 6), " // we want CREATE_CHILD_RESOURCES, 6 + " (SELECT count(p) FROM res.implicitGroups g JOIN g.roles r JOIN r.subjects s JOIN r.permissions p WHERE s = :subject AND p = 5)) " // we want DELETE_RESOURCES, 5 diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/composite/ResourceComposite.java b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/composite/ResourceComposite.java index aa4f1aa..96745a8 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/composite/ResourceComposite.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/composite/ResourceComposite.java @@ -74,22 +74,22 @@ public class ResourceComposite implements Serializable { * Provides specified permissions - used for non-admin queries. */ public ResourceComposite(Resource resource, AvailabilityType availability, Number measure, Number inventory, - Number control, Number alert, Number configure, Number content, Number createChildResources, - Number deleteResources) { + Number control, Number alert, Number configureRead, Number configureWrite, Number content, + Number createChildResources, Number deleteResources) { this(resource, null, availability, new ResourcePermission(measure.intValue() > 0, inventory.intValue() > 0, - control.intValue() > 0, alert.intValue() > 0, configure.intValue() > 0, content.intValue() > 0, - createChildResources.intValue() > 0, deleteResources.intValue() > 0)); + control.intValue() > 0, alert.intValue() > 0, configureRead.intValue() > 0, configureWrite.intValue() > 0, + content.intValue() > 0, createChildResources.intValue() > 0, deleteResources.intValue() > 0)); }
/** * Provides specified permissions - used for non-admin queries. */ public ResourceComposite(Resource resource, Resource parent, AvailabilityType availability, Number measure, - Number inventory, Number control, Number alert, Number configure, Number content, Number createChildResources, - Number deleteResources) { + Number inventory, Number control, Number alert, Number configureRead, Number configureWrite, Number content, + Number createChildResources, Number deleteResources) { this(resource, parent, availability, new ResourcePermission(measure.intValue() > 0, inventory.intValue() > 0, - control.intValue() > 0, alert.intValue() > 0, configure.intValue() > 0, content.intValue() > 0, - createChildResources.intValue() > 0, deleteResources.intValue() > 0)); + control.intValue() > 0, alert.intValue() > 0, configureRead.intValue() > 0, configureWrite.intValue() > 0, + content.intValue() > 0, createChildResources.intValue() > 0, deleteResources.intValue() > 0)); }
/** diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/composite/ResourcePermission.java b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/composite/ResourcePermission.java index e064482..ee8e8a8 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/composite/ResourcePermission.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/composite/ResourcePermission.java @@ -1,29 +1,29 @@ - /* - * RHQ Management Platform - * Copyright (C) 2005-2008 Red Hat, Inc. - * All rights reserved. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License, version 2, as - * published by the Free Software Foundation, and/or the GNU Lesser - * General Public License, version 2.1, also as published by the Free - * Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License and the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License - * and the GNU Lesser General Public License along with this program; - * if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ +/* + * RHQ Management Platform + * Copyright (C) 2005-2008 Red Hat, Inc. + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License, version 2, as + * published by the Free Software Foundation, and/or the GNU Lesser + * General Public License, version 2.1, also as published by the Free + * Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License and the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License + * and the GNU Lesser General Public License along with this program; + * if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ package org.rhq.core.domain.resource.composite;
-import java.util.Set; import java.io.Serializable; +import java.util.Set;
import org.rhq.core.domain.authz.Permission;
@@ -43,7 +43,9 @@ public class ResourcePermission implements Serializable {
private boolean alert;
- private boolean configure; + private boolean configureRead; + + private boolean configureWrite;
private boolean content;
@@ -55,26 +57,40 @@ public class ResourcePermission implements Serializable { * All permissions */ public ResourcePermission() { - this(true, true, true, true, true, true, true, true); + this(true, true, true, true, true, true, true, true, true); }
- public ResourcePermission(boolean measure, boolean inventory, boolean control, boolean alert, boolean configure, - boolean content, boolean createChildResources, boolean deleteResource) { + public ResourcePermission(// + boolean measure, // + boolean inventory, // + boolean control, // + boolean alert, // + boolean configureRead, // + boolean configureWrite, // + boolean content, // + boolean createChildResources,// + boolean deleteResource) { this.measure = measure; this.inventory = inventory; this.control = control; this.alert = alert; - this.configure = configure; + this.configureRead = configureRead; + this.configureWrite = configureWrite; this.content = content; this.createChildResources = createChildResources; this.deleteResource = deleteResource; }
public ResourcePermission(Set<Permission> permissions) { - this(permissions.contains(Permission.MANAGE_MEASUREMENTS), permissions.contains(Permission.MODIFY_RESOURCE), - permissions.contains(Permission.CONTROL), permissions.contains(Permission.MANAGE_ALERTS), permissions - .contains(Permission.CONFIGURE), permissions.contains(Permission.MANAGE_CONTENT), permissions - .contains(Permission.CREATE_CHILD_RESOURCES), permissions.contains(Permission.DELETE_RESOURCE)); + this(permissions.contains(Permission.MANAGE_MEASUREMENTS),// + permissions.contains(Permission.MODIFY_RESOURCE),// + permissions.contains(Permission.CONTROL), // + permissions.contains(Permission.MANAGE_ALERTS), // + permissions.contains(Permission.CONFIGURE_READ), // + permissions.contains(Permission.CONFIGURE_WRITE), // + permissions.contains(Permission.MANAGE_CONTENT), // + permissions.contains(Permission.CREATE_CHILD_RESOURCES),// + permissions.contains(Permission.DELETE_RESOURCE)); }
public boolean isMeasure() { @@ -93,8 +109,12 @@ public class ResourcePermission implements Serializable { return alert; }
- public boolean isConfigure() { - return configure; + public boolean isConfigureRead() { + return configureRead; + } + + public boolean isConfigureWrite() { + return configureWrite; }
public boolean isContent() { @@ -116,7 +136,8 @@ public class ResourcePermission implements Serializable { "inventory: " + inventory + ", " + // "control: " + control + ", " + // "alert: " + alert + ", " + // - "configure: " + configure + ", " + // + "configure-read: " + configureRead + ", " + // + "configure-write: " + configureWrite + ", " + // "content: " + content + ", " + // "createChildResources: " + createChildResources + ", " + // "deleteResource: " + deleteResource + // diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java index cdf3025..7e07dad 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java @@ -241,7 +241,7 @@ public class ResourceDetailView extends VLayout implements BookmarkableView, Res topTabSet.enableTab(alertsTab); }
- if (type.getResourceConfigurationDefinition() == null || !permissions.isConfigure()) { + if (type.getResourceConfigurationDefinition() == null || !permissions.isConfigureRead()) { topTabSet.disableTab(configurationTab); } else { topTabSet.enableTab(configurationTab); diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationManagerBean.java index c0add68..bc2321c 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationManagerBean.java @@ -927,7 +927,7 @@ public class ConfigurationManagerBean implements ConfigurationManagerLocal, Conf
// make sure the user has the proper permissions to do this Resource resource = doomedRequest.getResource(); - if (!authorizationManager.hasResourcePermission(subject, Permission.CONFIGURE, resource.getId())) { + if (!authorizationManager.hasResourcePermission(subject, Permission.CONFIGURE_WRITE, resource.getId())) { throw new PermissionException("User [" + subject.getName() + "] does not have permission to purge a plugin configuration update audit trail for resource [" + resource + "]"); @@ -957,7 +957,7 @@ public class ConfigurationManagerBean implements ConfigurationManagerLocal, Conf
// make sure the user has the proper permissions to do this Resource resource = doomedRequest.getResource(); - if (!authorizationManager.hasResourcePermission(subject, Permission.CONFIGURE, resource.getId())) { + if (!authorizationManager.hasResourcePermission(subject, Permission.CONFIGURE_WRITE, resource.getId())) { throw new PermissionException("User [" + subject.getName() + "] does not have permission to purge a configuration update audit trail for resource [" + resource + "]"); @@ -1131,7 +1131,7 @@ public class ConfigurationManagerBean implements ConfigurationManagerLocal, Conf Resource resource = resourceManager.getResourceById(subject, resourceId);
// make sure the user has the proper permissions to do this - if (!authorizationManager.hasResourcePermission(subject, Permission.CONFIGURE, resource.getId())) { + if (!authorizationManager.hasResourcePermission(subject, Permission.CONFIGURE_WRITE, resource.getId())) { throw new PermissionException("User [" + subject.getName() + "] does not have permission to modify configuration for resource [" + resource + "]"); } @@ -1536,7 +1536,7 @@ public class ConfigurationManagerBean implements ConfigurationManagerLocal, Conf
ResourceGroup group = getCompatibleGroupIfAuthorized(subject, compatibleGroupId);
- if (!authorizationManager.hasGroupPermission(subject, Permission.CONFIGURE, group.getId())) { + if (!authorizationManager.hasGroupPermission(subject, Permission.CONFIGURE_WRITE, group.getId())) { throw new PermissionException("User [" + subject.getName() + "] does not have permission " + "to modify Resource configurations for members of group [" + group + "]."); } @@ -1859,10 +1859,10 @@ public class ConfigurationManagerBean implements ConfigurationManagerLocal, Conf public int deleteGroupResourceConfigurationUpdates(Subject subject, Integer resourceGroupId, Integer[] groupResourceConfigurationUpdateIds) {
- if (authorizationManager.hasGroupPermission(subject, Permission.CONFIGURE, resourceGroupId) == false) { + if (authorizationManager.hasGroupPermission(subject, Permission.CONFIGURE_WRITE, resourceGroupId) == false) { log.error(subject + " attempted to delete " + groupResourceConfigurationUpdateIds.length + " group resource configuration updates for ResourceGroup[id" + resourceGroupId - + "], but did not have the " + Permission.CONFIGURE.name() + " permission for this group"); + + "], but did not have the " + Permission.CONFIGURE_WRITE.name() + " permission for this group"); return 0; }
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerBean.java index a40368a..3687b5e 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerBean.java @@ -2058,6 +2058,7 @@ public class ResourceManagerBean implements ResourceManagerLocal, ResourceManage Resource parent = next.getParentResource(); ResourceComposite composite = new ResourceComposite(next, parent, availType); composite.setResourceFacets(typeManager.getResourceFacets(next.getResourceType().getId())); + // TODO: jmarques: need to set resource permissions here, or alter criteria projection to include it results.add(composite); }
diff --git a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/authz/test/AuthorizationManagerBeanTest.java b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/authz/test/AuthorizationManagerBeanTest.java index a663b72..2afafb7 100644 --- a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/authz/test/AuthorizationManagerBeanTest.java +++ b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/authz/test/AuthorizationManagerBeanTest.java @@ -144,7 +144,7 @@ public class AuthorizationManagerBeanTest extends AbstractEJB3Test {
/* setup permissions */ testRole1.getPermissions().add(Permission.CONTROL); - testRole2.getPermissions().add(Permission.CONFIGURE); + testRole2.getPermissions().add(Permission.CONFIGURE_WRITE); em.merge(testRole1); em.merge(testRole2); em.flush(); @@ -186,7 +186,7 @@ public class AuthorizationManagerBeanTest extends AbstractEJB3Test { ResourceGroup testGroup1 = SessionTestHelper.createNewMixedGroupForRole(em, testRole1, "testGroup1", false);
/* setup permissions */ - Set<Permission> someMixedPermissions = EnumSet.of(Permission.CONFIGURE, Permission.CONTROL, + Set<Permission> someMixedPermissions = EnumSet.of(Permission.CONFIGURE_WRITE, Permission.CONTROL, Permission.MANAGE_SECURITY); testRole1.getPermissions().addAll(someMixedPermissions); em.merge(testRole1); @@ -230,7 +230,7 @@ public class AuthorizationManagerBeanTest extends AbstractEJB3Test { em.merge(testRole1); em.flush();
- Set<Permission> otherMixedPermissions = EnumSet.of(Permission.CONFIGURE, Permission.MANAGE_INVENTORY, + Set<Permission> otherMixedPermissions = EnumSet.of(Permission.CONFIGURE_WRITE, Permission.MANAGE_INVENTORY, Permission.MANAGE_SECURITY); testRole2.getPermissions().addAll(otherMixedPermissions); em.merge(testRole2); @@ -283,7 +283,7 @@ public class AuthorizationManagerBeanTest extends AbstractEJB3Test { em.flush();
/* setup permissions */ - Set<Permission> someMixedPermissions = EnumSet.of(Permission.CONFIGURE, Permission.CONTROL, + Set<Permission> someMixedPermissions = EnumSet.of(Permission.CONFIGURE_WRITE, Permission.CONTROL, Permission.MANAGE_SECURITY); testRole1.getPermissions().addAll(someMixedPermissions); em.merge(testRole1); @@ -336,7 +336,7 @@ public class AuthorizationManagerBeanTest extends AbstractEJB3Test { em.flush();
/* setup permissions */ - Set<Permission> someMixedPermissions = EnumSet.of(Permission.CONFIGURE, Permission.CONTROL, + Set<Permission> someMixedPermissions = EnumSet.of(Permission.CONFIGURE_WRITE, Permission.CONTROL, Permission.MANAGE_SECURITY); testRole1.getPermissions().addAll(someMixedPermissions); em.merge(testRole1); @@ -394,13 +394,10 @@ public class AuthorizationManagerBeanTest extends AbstractEJB3Test {
List<Integer> resourceIds = Arrays.asList(r1.getId(), r2.getId());
- assertTrue( - "The subject should have permission to view the resources", - authorizationManager.canViewResources(subject, resourceIds) - ); + assertTrue("The subject should have permission to view the resources", authorizationManager + .canViewResources(subject, resourceIds));
- } - finally { + } finally { getTransactionManager().rollback(); } } @@ -431,10 +428,8 @@ public class AuthorizationManagerBeanTest extends AbstractEJB3Test {
assertTrue( "The subject should have permission to view the resources in different groups since the subject is in roles for those groups", - authorizationManager.canViewResources(subject, resourceIds) - ); - } - finally { + authorizationManager.canViewResources(subject, resourceIds)); + } finally { getTransactionManager().rollback(); } } @@ -461,13 +456,10 @@ public class AuthorizationManagerBeanTest extends AbstractEJB3Test {
List<Integer> resourceIds = Arrays.asList(r1.getId(), r2.getId());
- assertFalse( - "The subject should not have permission to view the resources", - authorizationManager.canViewResources(subjectNotInRole, resourceIds) - ); + assertFalse("The subject should not have permission to view the resources", authorizationManager + .canViewResources(subjectNotInRole, resourceIds));
- } - finally { + } finally { getTransactionManager().rollback(); } } @@ -542,7 +534,7 @@ public class AuthorizationManagerBeanTest extends AbstractEJB3Test { em.flush();
/* setup permissions */ - Set<Permission> somePermissions = EnumSet.of(Permission.CONFIGURE); + Set<Permission> somePermissions = EnumSet.of(Permission.CONFIGURE_WRITE); Set<Permission> otherPermissions = EnumSet.of(Permission.CONTROL); testRole1.getPermissions().addAll(somePermissions); testRole2.getPermissions().addAll(otherPermissions); @@ -739,7 +731,7 @@ public class AuthorizationManagerBeanTest extends AbstractEJB3Test { em.flush();
/* setup permissions */ - Set<Permission> somePermissions = EnumSet.of(Permission.CONFIGURE, Permission.CONTROL, + Set<Permission> somePermissions = EnumSet.of(Permission.CONFIGURE_WRITE, Permission.CONTROL, Permission.MANAGE_INVENTORY); Set<Permission> otherPermissions = EnumSet.of(Permission.CONTROL, Permission.MANAGE_SECURITY, Permission.MANAGE_INVENTORY);
commit 4d7a0dc85dfc350dd1a45a0b7371319fb75cb2de Merge: 7f76427... f08e735... Author: Heiko W. Rupp hwr@pilhuhn.de Date: Sun Jul 18 20:50:52 2010 +0200
Merge branch 'master' of ssh://git.fedorahosted.org/git/rhq/rhq
commit 3e720b2bab8c4752c4b3585138b32a0396063edc Author: Joseph Marques joseph@redhat.com Date: Sat Jul 17 15:12:17 2010 -0400
BZ-615245: only set the sender columns to NON-NULL after the CustomAlertSenderUpgradeTask completes
diff --git a/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml b/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml index 6cf784d..1cfda87 100644 --- a/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml +++ b/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml @@ -2061,7 +2061,6 @@ </schemaSpec> <schemaSpec version="2.70.1"> <schema-addColumn table="RHQ_ALERT_NOTIFICATION" column="SENDER_NAME" precision="100" columnType="VARCHAR2" /> - <schema-alterColumn table="RHQ_ALERT_NOTIFICATION" column="SENDER_NAME" nullable="FALSE" /> <schema-addColumn table="RHQ_ALERT_NOTIFICATION" column="SENDER_CONFIG_ID" columnType="INTEGER" /> <schema-addColumn table="RHQ_ALERT_NOTIFICATION" column="EXTRA_CONFIG_ID" columnType="INTEGER" /> <schema-directSQL> @@ -2083,7 +2082,6 @@ </schemaSpec> <schemaSpec version="2.70.2"> <schema-addColumn table="RHQ_ALERT_NOTIF_LOG" column="SENDER" columnType="VARCHAR2" precision="100" /> - <schema-alterColumn table="RHQ_ALERT_NOTIF_LOG" column="SENDER" nullable="FALSE" /> <schema-addColumn table="RHQ_ALERT_NOTIF_LOG" column="RESULT_STATE" columnType="VARCHAR2" precision="20" /> <schema-addColumn table="RHQ_ALERT_NOTIF_LOG" column="MESSAGE" columnType="VARCHAR2" precision="4000" /> </schemaSpec> @@ -2128,6 +2126,11 @@ </statement> </schema-directSQL> </schemaSpec> + <schemaSpec version="2.70.8"> + <!-- only set the sender columns to NON-NULL after the CustomAlertSenderUpgradeTask completes --> + <schema-alterColumn table="RHQ_ALERT_NOTIFICATION" column="SENDER_NAME" nullable="FALSE" /> + <schema-alterColumn table="RHQ_ALERT_NOTIF_LOG" column="SENDER" nullable="FALSE" /> + </schemaSpec>
<!-- RHQ Advisory Representation --> <schemaSpec version="2.71">
commit 99b4ba233eb532f3982c29710043884eca1ae22d Author: Joseph Marques joseph@redhat.com Date: Sat Jul 17 10:16:09 2010 -0400
BZ-615619: properly activate the saved search when selected from the suggestions
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestTextBox_v3.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestTextBox_v3.java index c14127b..5ac3651 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestTextBox_v3.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestTextBox_v3.java @@ -64,6 +64,7 @@ import org.rhq.core.domain.search.SearchSuggestion.Kind; import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup; import org.rhq.enterprise.gui.coregui.client.gwt.SearchGWTServiceAsync; import org.rhq.enterprise.gui.coregui.client.search.SearchBar; +import org.rhq.enterprise.gui.coregui.client.search.SearchLogger;
public class SuggestTextBox_v3 extends Composite implements HasText, HasAllFocusHandlers, HasValue<String>, HasSelectionHandlers<Suggestion> { @@ -697,7 +698,6 @@ public class SuggestTextBox_v3 extends Composite implements HasText, HasAllFocus
protected void complete(Suggestion suggestion, int cursorPosition) { SearchSuggestion searchSuggestion = extraSearchSuggestion(suggestion); - String completion = suggestion.getReplacementString(); String currentText = getText().toLowerCase();
if (searchBar.welcomeMessage.equals(currentText)) { @@ -705,35 +705,40 @@ public class SuggestTextBox_v3 extends Composite implements HasText, HasAllFocus return; }
- int previousWhitespaceIndex = cursorPosition; - if (cursorPosition != 0) { - while (--previousWhitespaceIndex > 0) { - if (currentText.charAt(previousWhitespaceIndex) == ' ') { - previousWhitespaceIndex++; // put index right after found whitespace - break; + if (searchSuggestion.getKind() == SearchSuggestion.Kind.GlobalSavedSearch + || searchSuggestion.getKind() == SearchSuggestion.Kind.UserSavedSearch) { + // execute saved searches immediately, since they presumably constitute complete expressions + SearchLogger.debug("selected '" + searchSuggestion.getLabel() + "' saved search suggestion"); + searchBar.activateSavedSearch(searchSuggestion.getValue()); + } else { + // selecting a simple suggestion or advanced suggestion + + int previousWhitespaceIndex = cursorPosition; + if (cursorPosition != 0) { + while (--previousWhitespaceIndex > 0) { + if (currentText.charAt(previousWhitespaceIndex) == ' ') { + previousWhitespaceIndex++; // put index right after found whitespace + break; + } } } - }
- int futureWhitespaceIndex = cursorPosition; - while (futureWhitespaceIndex < currentText.length()) { - if (currentText.charAt(futureWhitespaceIndex) == ' ') { - break; + int futureWhitespaceIndex = cursorPosition; + while (futureWhitespaceIndex < currentText.length()) { + if (currentText.charAt(futureWhitespaceIndex) == ' ') { + break; + } + futureWhitespaceIndex++; } - futureWhitespaceIndex++; - }
- String before = getText().substring(0, previousWhitespaceIndex); - String after = getText().substring(futureWhitespaceIndex); - setValue(before + completion + after, true); - currentCursorPosition = before.length() + completion.length(); - getTextBox().setCursorPos(currentCursorPosition); + String before = getText().substring(0, previousWhitespaceIndex); + String completion = suggestion.getReplacementString(); + String after = getText().substring(futureWhitespaceIndex); + + setValue(before + completion + after, true); + currentCursorPosition = before.length() + completion.length(); + getTextBox().setCursorPos(currentCursorPosition);
- if (searchSuggestion.getKind() == SearchSuggestion.Kind.GlobalSavedSearch - || searchSuggestion.getKind() == SearchSuggestion.Kind.UserSavedSearch) { - // execute saved searches immediately, since they presumably constitute complete expressions - searchBar.activateSavedSearch(searchSuggestion.getLabel()); - } else { showSuggestions(); } } diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java index 9a7d352..4afb3e7 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java @@ -588,7 +588,7 @@ public class SearchAssistManager { if (next.getResultCount() != null) { label += " (" + next.getResultCount() + ")"; } - String value = next.getPattern(); + String value = next.getName(); int index = next.getName().toLowerCase().indexOf(expression); SearchSuggestion suggestion = new SearchSuggestion(Kind.UserSavedSearch, label, value, index, expression .length()); @@ -615,7 +615,10 @@ public class SearchAssistManager { List<SearchSuggestion> results = new ArrayList<SearchSuggestion>(); for (SavedSearch next : savedSearchResults) { String label = next.getName(); - String value = next.getPattern(); + if (next.getResultCount() != null) { + label += " (" + next.getResultCount() + ")"; + } + String value = next.getName(); int index = next.getName().toLowerCase().indexOf(expression); SearchSuggestion suggestion = new SearchSuggestion(Kind.GlobalSavedSearch, label, value, index, expression .length());
commit fc948cc2c388053a1cba610db8c25a2c949714b9 Author: Joseph Marques joseph@redhat.com Date: Sat Jul 17 09:19:20 2010 -0400
BZ-615351: respect user's authorization when display suggestions
* only suggest resource-configuration property names for those resources which the logged in user has CONFIGURE permission on * only return resource results whose configuration-specific search terms respect the aforementioned rule
-----
In order to make the query-translation routines aware of authorization, the logged in user had to be passed to the concrete implementer of AbstractSearchTranslator. Since the translator is an implementation detail hidden behind the CriteriaQueryGenerator, the logged in user thus had to be passed to the generator as well. In the future, when more subsystems implement the search interfaces, they will automatically have this additional contextual data available to them for advanced authz-based filtering of suggestions and/or results.
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/AlertDefinitionManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/AlertDefinitionManagerBean.java index a48cd85..0a2f201 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/AlertDefinitionManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/AlertDefinitionManagerBean.java @@ -682,7 +682,7 @@ public class AlertDefinitionManagerBean implements AlertDefinitionManagerLocal,
@SuppressWarnings("unchecked") public PageList<AlertDefinition> findAlertDefinitionsByCriteria(Subject subject, AlertDefinitionCriteria criteria) { - CriteriaQueryGenerator generator = new CriteriaQueryGenerator(criteria); + CriteriaQueryGenerator generator = new CriteriaQueryGenerator(subject, criteria); if (authorizationManager.isInventoryManager(subject) == false) { generator.setAuthorizationResourceFragment(CriteriaQueryGenerator.AuthorizationTokenType.RESOURCE, subject .getId()); diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/AlertManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/AlertManagerBean.java index 108e2d5..b4454ed 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/AlertManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/AlertManagerBean.java @@ -1015,7 +1015,7 @@ public class AlertManagerBean implements AlertManagerLocal, AlertManagerRemote {
@SuppressWarnings("unchecked") public PageList<Alert> findAlertsByCriteria(Subject subject, AlertCriteria criteria) { - CriteriaQueryGenerator generator = new CriteriaQueryGenerator(criteria); + CriteriaQueryGenerator generator = new CriteriaQueryGenerator(subject, criteria); if (!authorizationManager.isInventoryManager(subject)) { generator.setAuthorizationResourceFragment(CriteriaQueryGenerator.AuthorizationTokenType.RESOURCE, "alertDefinition.resource", subject.getId()); diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/auth/SubjectManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/auth/SubjectManagerBean.java index 17be000..4e1a53d 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/auth/SubjectManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/auth/SubjectManagerBean.java @@ -636,7 +636,8 @@ public class SubjectManagerBean implements SubjectManagerLocal, SubjectManagerRe
@SuppressWarnings("unchecked") public PageList<Subject> findSubjectsByCriteria(Subject subject, SubjectCriteria criteria) { - CriteriaQueryGenerator generator = new CriteriaQueryGenerator(criteria); + CriteriaQueryGenerator generator = new CriteriaQueryGenerator(subject, criteria); + ;
CriteriaQueryRunner<Subject> queryRunner = new CriteriaQueryRunner(criteria, generator, entityManager); return queryRunner.execute(); diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/authz/RoleManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/authz/RoleManagerBean.java index 30feae3..bcf6daf 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/authz/RoleManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/authz/RoleManagerBean.java @@ -587,7 +587,8 @@ public class RoleManagerBean implements RoleManagerLocal, RoleManagerRemote { + "] requires SecurityManager permission for requested query criteria."); }
- CriteriaQueryGenerator generator = new CriteriaQueryGenerator(criteria); + CriteriaQueryGenerator generator = new CriteriaQueryGenerator(subject, criteria); + ;
CriteriaQueryRunner<Role> queryRunner = new CriteriaQueryRunner(criteria, generator, entityManager); return queryRunner.execute(); diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerBean.java index 5cf8205..e6fc90c 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerBean.java @@ -1131,7 +1131,8 @@ public class BundleManagerBean implements BundleManagerLocal, BundleManagerRemot
public PageList<BundleDeployment> findBundleDeploymentsByCriteria(Subject subject, BundleDeploymentCriteria criteria) {
- CriteriaQueryGenerator generator = new CriteriaQueryGenerator(criteria); + CriteriaQueryGenerator generator = new CriteriaQueryGenerator(subject, criteria); + ;
CriteriaQueryRunner<BundleDeployment> queryRunner = new CriteriaQueryRunner<BundleDeployment>(criteria, generator, entityManager); @@ -1140,7 +1141,8 @@ public class BundleManagerBean implements BundleManagerLocal, BundleManagerRemot
public PageList<BundleDestination> findBundleDestinationsByCriteria(Subject subject, BundleDestinationCriteria criteria) { - CriteriaQueryGenerator generator = new CriteriaQueryGenerator(criteria); + CriteriaQueryGenerator generator = new CriteriaQueryGenerator(subject, criteria); + ;
CriteriaQueryRunner<BundleDestination> queryRunner = new CriteriaQueryRunner<BundleDestination>(criteria, generator, entityManager); @@ -1150,7 +1152,8 @@ public class BundleManagerBean implements BundleManagerLocal, BundleManagerRemot public PageList<BundleResourceDeployment> findBundleResourceDeploymentsByCriteria(Subject subject, BundleResourceDeploymentCriteria criteria) {
- CriteriaQueryGenerator generator = new CriteriaQueryGenerator(criteria); + CriteriaQueryGenerator generator = new CriteriaQueryGenerator(subject, criteria); + ; if (!authorizationManager.isInventoryManager(subject)) { if (criteria.isInventoryManagerRequired()) { // TODO: MANAGE_INVENTORY was too restrictive as a bundle manager could not then @@ -1171,7 +1174,8 @@ public class BundleManagerBean implements BundleManagerLocal, BundleManagerRemot }
public PageList<BundleVersion> findBundleVersionsByCriteria(Subject subject, BundleVersionCriteria criteria) { - CriteriaQueryGenerator generator = new CriteriaQueryGenerator(criteria); + CriteriaQueryGenerator generator = new CriteriaQueryGenerator(subject, criteria); + ;
CriteriaQueryRunner<BundleVersion> queryRunner = new CriteriaQueryRunner<BundleVersion>(criteria, generator, entityManager); @@ -1179,7 +1183,8 @@ public class BundleManagerBean implements BundleManagerLocal, BundleManagerRemot }
public PageList<BundleFile> findBundleFilesByCriteria(Subject subject, BundleFileCriteria criteria) { - CriteriaQueryGenerator generator = new CriteriaQueryGenerator(criteria); + CriteriaQueryGenerator generator = new CriteriaQueryGenerator(subject, criteria); + ;
CriteriaQueryRunner<BundleFile> queryRunner = new CriteriaQueryRunner<BundleFile>(criteria, generator, entityManager); @@ -1187,7 +1192,8 @@ public class BundleManagerBean implements BundleManagerLocal, BundleManagerRemot }
public PageList<Bundle> findBundlesByCriteria(Subject subject, BundleCriteria criteria) { - CriteriaQueryGenerator generator = new CriteriaQueryGenerator(criteria); + CriteriaQueryGenerator generator = new CriteriaQueryGenerator(subject, criteria); + ;
CriteriaQueryRunner<Bundle> queryRunner = new CriteriaQueryRunner<Bundle>(criteria, generator, entityManager); return queryRunner.execute(); @@ -1196,7 +1202,7 @@ public class BundleManagerBean implements BundleManagerLocal, BundleManagerRemot public PageList<BundleWithLatestVersionComposite> findBundlesWithLatestVersionCompositesByCriteria(Subject subject, BundleCriteria criteria) {
- CriteriaQueryGenerator generator = new CriteriaQueryGenerator(criteria); + CriteriaQueryGenerator generator = new CriteriaQueryGenerator(subject, criteria); String replacementSelectList = "" + " new org.rhq.core.domain.bundle.composite.BundleWithLatestVersionComposite( " + " bundle.id," diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerBean.java index 2c01712..e24663d 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerBean.java @@ -1445,7 +1445,8 @@ public class ContentManagerBean implements ContentManagerLocal, ContentManagerRe @SuppressWarnings("unchecked") public PageList<InstalledPackage> findInstalledPackagesByCriteria(Subject subject, InstalledPackageCriteria criteria) {
- CriteriaQueryGenerator generator = new CriteriaQueryGenerator(criteria); + CriteriaQueryGenerator generator = new CriteriaQueryGenerator(subject, criteria); + ;
if (!authorizationManager.isInventoryManager(subject)) { // Ensure we limit to packages installed to viewable resources @@ -1473,7 +1474,8 @@ public class ContentManagerBean implements ContentManagerLocal, ContentManagerRe } }
- CriteriaQueryGenerator generator = new CriteriaQueryGenerator(criteria); + CriteriaQueryGenerator generator = new CriteriaQueryGenerator(subject, criteria); + ;
CriteriaQueryRunner<PackageVersion> queryRunner = new CriteriaQueryRunner(criteria, generator, entityManager);
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/RepoManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/RepoManagerBean.java index 740a6d8..7492655 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/RepoManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/RepoManagerBean.java @@ -589,7 +589,8 @@ public class RepoManagerBean implements RepoManagerLocal, RepoManagerRemote { RepoContentSource repoContentSourceMapping = repo.addContentSource(contentSource); entityManager.persist(repoContentSourceMapping); } - Set<PackageVersion> alreadyAssociatedPackageVersions = new HashSet<PackageVersion>(repo.getPackageVersions()); + Set<PackageVersion> alreadyAssociatedPackageVersions = new HashSet<PackageVersion>(repo + .getPackageVersions());
// Automatically associate all of the content source's package versions with this repo, // but *skip* over the ones that are already linked to this repo from a previous association. @@ -767,7 +768,8 @@ public class RepoManagerBean implements RepoManagerLocal, RepoManagerRemote { @SuppressWarnings("unchecked") @RequiredPermission(Permission.MANAGE_INVENTORY) public PageList<Repo> findReposByCriteria(Subject subject, RepoCriteria criteria) { - CriteriaQueryGenerator generator = new CriteriaQueryGenerator(criteria); + CriteriaQueryGenerator generator = new CriteriaQueryGenerator(subject, criteria); + ;
CriteriaQueryRunner<Repo> queryRunner = new CriteriaQueryRunner(criteria, generator, entityManager); return queryRunner.execute(); @@ -782,7 +784,8 @@ public class RepoManagerBean implements RepoManagerLocal, RepoManagerRemote { throw new IllegalArgumentException("Illegal filterResourceId: " + repoId); }
- CriteriaQueryGenerator generator = new CriteriaQueryGenerator(criteria); + CriteriaQueryGenerator generator = new CriteriaQueryGenerator(subject, criteria); + ;
CriteriaQueryRunner<PackageVersion> queryRunner = new CriteriaQueryRunner(criteria, generator, entityManager);
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/event/EventManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/event/EventManagerBean.java index 8f89095..443625f 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/event/EventManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/event/EventManagerBean.java @@ -317,7 +317,8 @@ public class EventManagerBean implements EventManagerLocal, EventManagerRemote { * where N is the number of events between 'begin' and 'end'. if the severity buckets are computed in a single * query, the wire load would only be K integers, where K is the bucketCount. */ - CriteriaQueryGenerator generator = new CriteriaQueryGenerator(criteria); + CriteriaQueryGenerator generator = new CriteriaQueryGenerator(subject, criteria); + ; String replacementSelectList = " event.severity, event.timestamp "; generator.alterProjection(replacementSelectList);
@@ -395,7 +396,8 @@ public class EventManagerBean implements EventManagerLocal, EventManagerRemote { }
public PageList<EventComposite> findEventCompositesByCriteria(Subject subject, EventCriteria criteria) { - CriteriaQueryGenerator generator = new CriteriaQueryGenerator(criteria); + CriteriaQueryGenerator generator = new CriteriaQueryGenerator(subject, criteria); + ; String replacementSelectList = "" // + " new org.rhq.core.domain.event.composite.EventComposite( " // + " event.detail," // @@ -422,7 +424,8 @@ public class EventManagerBean implements EventManagerLocal, EventManagerRemote {
@SuppressWarnings("unchecked") public PageList<Event> findEventsByCriteria(Subject subject, EventCriteria criteria) { - CriteriaQueryGenerator generator = new CriteriaQueryGenerator(criteria); + CriteriaQueryGenerator generator = new CriteriaQueryGenerator(subject, criteria); + ; if (authorizationManager.isInventoryManager(subject) == false) { generator.setAuthorizationResourceFragment(CriteriaQueryGenerator.AuthorizationTokenType.RESOURCE, "source.resource", subject.getId()); diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/CallTimeDataManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/CallTimeDataManagerBean.java index 08f3418..770ae6e 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/CallTimeDataManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/CallTimeDataManagerBean.java @@ -212,7 +212,8 @@ public class CallTimeDataManagerBean implements CallTimeDataManagerLocal, CallTi criteria.addFilterAutoGroupResourceTypeId(context.resourceTypeId); }
- CriteriaQueryGenerator generator = new CriteriaQueryGenerator(criteria); + CriteriaQueryGenerator generator = new CriteriaQueryGenerator(subject, criteria); + ; String replacementSelectList = "" // + " new org.rhq.core.domain.measurement.calltime.CallTimeDataComposite( " // + " calltimedatavalue.key.callDestination, " // @@ -411,10 +412,10 @@ public class CallTimeDataManagerBean implements CallTimeDataManagerLocal, CallTi notifyAlertConditionCacheManager("insertCallTimeDataValues", callTimeDataSet .toArray(new CallTimeData[callTimeDataSet.size()]));
- if (insertedRowCount>0) { + if (insertedRowCount > 0) { MeasurementMonitor.getMBean().incrementCalltimeValuesInserted(insertedRowCount);
- log.debug("Inserted " + insertedRowCount + " call-time data value rows."); + log.debug("Inserted " + insertedRowCount + " call-time data value rows."); }
} catch (SQLException e) { diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementDefinitionManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementDefinitionManagerBean.java index f7fddc7..8a21886 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementDefinitionManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementDefinitionManagerBean.java @@ -137,7 +137,8 @@ public class MeasurementDefinitionManagerBean implements MeasurementDefinitionMa @SuppressWarnings("unchecked") public PageList<MeasurementDefinition> findMeasurementDefinitionsByCriteria(Subject subject, MeasurementDefinitionCriteria criteria) { - CriteriaQueryGenerator generator = new CriteriaQueryGenerator(criteria); + CriteriaQueryGenerator generator = new CriteriaQueryGenerator(subject, criteria); + ;
CriteriaQueryRunner<MeasurementDefinition> queryRunner = new CriteriaQueryRunner(criteria, generator, entityManager); diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementScheduleManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementScheduleManagerBean.java index dc1395e..bebf8a4 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementScheduleManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementScheduleManagerBean.java @@ -651,6 +651,7 @@ public class MeasurementScheduleManagerBean implements MeasurementScheduleManage
try { CriteriaQueryGenerator generator = new CriteriaQueryGenerator(criteria); + ; generator.alterProjection("resource.id"); String resourceSubQuery = generator.getParameterReplacedQuery(false);
@@ -705,7 +706,8 @@ public class MeasurementScheduleManagerBean implements MeasurementScheduleManage } criteria.addFilterDefinitionIds(ArrayUtils.wrapInArray(measurementDefinitionIds));
- CriteriaQueryGenerator generator = new CriteriaQueryGenerator(criteria); + CriteriaQueryGenerator generator = new CriteriaQueryGenerator(subject, criteria); + ; generator.alterProjection("measurementschedule.id"); String measurementScheduleSubQuery = generator.getParameterReplacedQuery(false);
@@ -1211,7 +1213,8 @@ public class MeasurementScheduleManagerBean implements MeasurementScheduleManage criteria.setPageControl(pc); // for primary return list, use passed PageControl
// get the core definitions - CriteriaQueryGenerator generator = new CriteriaQueryGenerator(criteria); + CriteriaQueryGenerator generator = new CriteriaQueryGenerator(subject, criteria); + ; generator.alterProjection(" distinct measurementschedule.definition "); CriteriaQueryRunner<MeasurementDefinition> queryRunner = new CriteriaQueryRunner(criteria, generator, entityManager); @@ -1296,7 +1299,8 @@ public class MeasurementScheduleManagerBean implements MeasurementScheduleManage
@SuppressWarnings("unchecked") public PageList<MeasurementSchedule> findSchedulesByCriteria(Subject subject, MeasurementScheduleCriteria criteria) { - CriteriaQueryGenerator generator = new CriteriaQueryGenerator(criteria); + CriteriaQueryGenerator generator = new CriteriaQueryGenerator(subject, criteria); + ; if (authorizationManager.isInventoryManager(subject) == false) { generator.setAuthorizationResourceFragment(CriteriaQueryGenerator.AuthorizationTokenType.RESOURCE, subject .getId()); diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/operation/OperationManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/operation/OperationManagerBean.java index d47601b..022811b 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/operation/OperationManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/operation/OperationManagerBean.java @@ -1789,7 +1789,8 @@ public class OperationManagerBean implements OperationManagerLocal, OperationMan @SuppressWarnings("unchecked") public List<OperationDefinition> findOperationDefinitionsByCriteria(Subject subject, OperationDefinitionCriteria criteria) { - CriteriaQueryGenerator generator = new CriteriaQueryGenerator(criteria); + CriteriaQueryGenerator generator = new CriteriaQueryGenerator(subject, criteria); + ;
CriteriaQueryRunner<OperationDefinition> queryRunner = new CriteriaQueryRunner(criteria, generator, entityManager); @@ -1799,7 +1800,8 @@ public class OperationManagerBean implements OperationManagerLocal, OperationMan @SuppressWarnings("unchecked") public PageList<ResourceOperationHistory> findResourceOperationHistoriesByCriteria(Subject subject, ResourceOperationHistoryCriteria criteria) { - CriteriaQueryGenerator generator = new CriteriaQueryGenerator(criteria); + CriteriaQueryGenerator generator = new CriteriaQueryGenerator(subject, criteria); + ; if (authorizationManager.isInventoryManager(subject) == false) { generator.setAuthorizationResourceFragment(CriteriaQueryGenerator.AuthorizationTokenType.RESOURCE, subject .getId()); @@ -1813,7 +1815,8 @@ public class OperationManagerBean implements OperationManagerLocal, OperationMan @SuppressWarnings("unchecked") public PageList<GroupOperationHistory> findGroupOperationHistoriesByCriteria(Subject subject, GroupOperationHistoryCriteria criteria) { - CriteriaQueryGenerator generator = new CriteriaQueryGenerator(criteria); + CriteriaQueryGenerator generator = new CriteriaQueryGenerator(subject, criteria); + ; if (authorizationManager.isInventoryManager(subject) == false) { generator.setAuthorizationResourceFragment(CriteriaQueryGenerator.AuthorizationTokenType.GROUP, subject .getId()); diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerBean.java index be85557..a40368a 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerBean.java @@ -2067,7 +2067,8 @@ public class ResourceManagerBean implements ResourceManagerLocal, ResourceManage
@SuppressWarnings("unchecked") public PageList<Resource> findResourcesByCriteria(Subject subject, ResourceCriteria criteria) { - CriteriaQueryGenerator generator = new CriteriaQueryGenerator(criteria); + CriteriaQueryGenerator generator = new CriteriaQueryGenerator(subject, criteria); + ; if (authorizationManager.isInventoryManager(subject) == false) { if (criteria.isInventoryManagerRequired()) { throw new PermissionException("Subject [" + subject.getName() diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceTypeManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceTypeManagerBean.java index 7937f4d..7589096 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceTypeManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceTypeManagerBean.java @@ -420,7 +420,8 @@ public class ResourceTypeManagerBean implements ResourceTypeManagerLocal, Resour
@SuppressWarnings("unchecked") public PageList<ResourceType> findResourceTypesByCriteria(Subject subject, ResourceTypeCriteria criteria) { - CriteriaQueryGenerator generator = new CriteriaQueryGenerator(criteria); + CriteriaQueryGenerator generator = new CriteriaQueryGenerator(subject, criteria); + ;
CriteriaQueryRunner<ResourceType> queryRunner = new CriteriaQueryRunner(criteria, generator, entityManager); return queryRunner.execute(); diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerBean.java index 8e33ca1..e291c25 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerBean.java @@ -992,7 +992,8 @@ public class ResourceGroupManagerBean implements ResourceGroupManagerLocal, Reso */ public PageList<ResourceGroupComposite> findResourceGroupCompositesByCriteria(Subject subject, ResourceGroupCriteria criteria) { - CriteriaQueryGenerator generator = new CriteriaQueryGenerator(criteria); + CriteriaQueryGenerator generator = new CriteriaQueryGenerator(subject, criteria); + ; String replacementSelectList = "" + " new org.rhq.core.domain.resource.group.composite.ResourceGroupComposite( " + " ( SELECT COUNT(avail) FROM resourcegroup.explicitResources res JOIN res.currentAvailability avail ) AS explicitCount," @@ -1398,7 +1399,8 @@ public class ResourceGroupManagerBean implements ResourceGroupManagerLocal, Reso
@SuppressWarnings("unchecked") public PageList<ResourceGroup> findResourceGroupsByCriteria(Subject subject, ResourceGroupCriteria criteria) { - CriteriaQueryGenerator generator = new CriteriaQueryGenerator(criteria); + CriteriaQueryGenerator generator = new CriteriaQueryGenerator(subject, criteria); + ;
if (criteria.isSecurityManagerRequired() && !authorizationManager.hasGlobalPermission(subject, Permission.MANAGE_SECURITY)) { diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/definition/GroupDefinitionManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/definition/GroupDefinitionManagerBean.java index 5570738..905688b 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/definition/GroupDefinitionManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/definition/GroupDefinitionManagerBean.java @@ -407,7 +407,8 @@ public class GroupDefinitionManagerBean implements GroupDefinitionManagerLocal {
public PageList<GroupDefinition> findGroupDefinitionsByCriteria(Subject subject, ResourceGroupDefinitionCriteria criteria) { - CriteriaQueryGenerator generator = new CriteriaQueryGenerator(criteria); + CriteriaQueryGenerator generator = new CriteriaQueryGenerator(subject, criteria); + ; if (authorizationManager.isInventoryManager(subject) == false) { if (criteria.isInventoryManagerRequired()) { throw new PermissionException("Subject [" + subject.getName() diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/SavedSearchManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/SavedSearchManagerBean.java index c8cf5f4..d08fefb 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/SavedSearchManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/SavedSearchManagerBean.java @@ -85,7 +85,8 @@ public class SavedSearchManagerBean implements SavedSearchManagerLocal /* local }
public PageList<SavedSearch> findSavedSearchesByCriteria(Subject subject, SavedSearchCriteria criteria) { - CriteriaQueryGenerator generator = new CriteriaQueryGenerator(criteria); + CriteriaQueryGenerator generator = new CriteriaQueryGenerator(subject, criteria); + ;
if (!authorizationManager.isInventoryManager(subject)) { generator.setAuthorizationCustomConditionFragment("(subject.id=" + subject.getId() + " OR global=true)"); diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/ResourceSearchAssistant.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/ResourceSearchAssistant.java index 95295d0..f315405 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/ResourceSearchAssistant.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/ResourceSearchAssistant.java @@ -83,7 +83,7 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant { + " AND simpleDefinition.type <> 'PASSWORD' " // do not suggest hidden/password property types + conditionallyAddJPQLString("definition.name", filter) // + conditionallyAddJPQLString("type.category", tab) // - + conditionallyAddAuthzFragment(getAuthzFragment()) // + + conditionallyAddAuthzFragment(getConfigAuthzFragment()) // + " ORDER BY definition.name ");
} else if (context.equals("trait")) { @@ -174,7 +174,7 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant { + conditionallyAddJPQLString("property.name", param) // + conditionallyAddJPQLString("property.stringValue", filter) // + conditionallyAddJPQLString("res.resourceType.category", tab) // - + conditionallyAddAuthzFragment(getAuthzFragment()) // + + conditionallyAddAuthzFragment(getConfigAuthzFragment()) // + " ORDER BY simple.stringValue ");
} else if (context.equals("trait")) { @@ -196,6 +196,18 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant { } }
+ private String getConfigAuthzFragment() { + return "res.id IN " // + + "(SELECT ires.id " // + + " FROM Resource ires " // + + " JOIN ires.implicitGroups igroup " // + + " JOIN igroup.roles irole " // + + " JOIN irole.subjects isubject " // + + " JOIN irole.permissions iperm " // + + " WHERE isubject.id = " + getSubjectId() // + + " AND iperm = 11)"; + } + private String getAuthzFragment() { return "res.id IN " // + "(SELECT ires.id " // diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchTranslationManager.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchTranslationManager.java index 855d89d..04a1e32 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchTranslationManager.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchTranslationManager.java @@ -9,6 +9,7 @@ import org.antlr.runtime.CommonTokenStream; import org.antlr.runtime.Token; import org.antlr.runtime.tree.CommonTree;
+import org.rhq.core.domain.auth.Subject; import org.rhq.core.domain.search.SearchSubsystem; import org.rhq.enterprise.server.search.RHQLLexer; import org.rhq.enterprise.server.search.RHQLParser; @@ -24,7 +25,6 @@ import org.rhq.enterprise.server.search.translation.antlr.RHQLTerm; import org.rhq.enterprise.server.search.translation.antlr.RHQLTreeOperator; import org.rhq.enterprise.server.search.translation.jpql.SearchFragment; import org.rhq.enterprise.server.search.translation.jpql.SearchFragmentType; -import org.rhq.enterprise.server.util.LookupUtil;
public class SearchTranslationManager {
@@ -40,7 +40,10 @@ public class SearchTranslationManager { private String entity; private String alias;
- public SearchTranslationManager(SearchSubsystem context) { + private Subject subject; + + public SearchTranslationManager(Subject subject, SearchSubsystem context) { + this.subject = subject; this.context = context; this.entity = this.context.getEntityClass().getSimpleName(); this.alias = this.entity.toLowerCase(); @@ -54,9 +57,8 @@ public class SearchTranslationManager { } this.expression = expression;
- this.translator = SearchTranslatorFactory.getTranslator(this.context); - this.assistant = SearchAssistantFactory - .getAssistant(LookupUtil.getSubjectManager().getOverlord(), this.context); + this.translator = SearchTranslatorFactory.getTranslator(subject, this.context); + this.assistant = SearchAssistantFactory.getAssistant(subject, this.context);
ANTLRStringStream input = new ANTLRStringStream(this.expression); // Create an input character stream from standard in this.lexer = new RHQLLexer(input); // Create an echoLexer that feeds from that stream diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/AbstractSearchTranslator.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/AbstractSearchTranslator.java index 79f14ee..54ccae2 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/AbstractSearchTranslator.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/AbstractSearchTranslator.java @@ -1,9 +1,35 @@ package org.rhq.enterprise.server.search.translation;
+import org.rhq.core.domain.auth.Subject; import org.rhq.enterprise.server.search.translation.antlr.RHQLComparisonOperator; +import org.rhq.enterprise.server.util.LookupUtil;
public abstract class AbstractSearchTranslator implements SearchTranslator {
+ private int subjectId; + private boolean requiresAuthorizationFragment; + + public AbstractSearchTranslator(Subject subject) { + this.subjectId = subject.getId(); + this.requiresAuthorizationFragment = !LookupUtil.getAuthorizationManager().isInventoryManager(subject); + } + + public int getSubjectId() { + return subjectId; + } + + public boolean requiresAuthorizationFragment() { + return requiresAuthorizationFragment; + } + + protected final String conditionallyAddAuthzFragment(String fragment) { + if (requiresAuthorizationFragment == false) { + return ""; + } + + return " AND " + fragment; + } + protected String getJPQLForEnum(String fragment, RHQLComparisonOperator operator, String value, Class<? extends Enum<?>> enumClass, boolean useOrdinal) { if (operator == RHQLComparisonOperator.NULL || // diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/GroupSearchTranslator.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/GroupSearchTranslator.java index 0a2e0f1..781e581 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/GroupSearchTranslator.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/GroupSearchTranslator.java @@ -2,6 +2,7 @@ package org.rhq.enterprise.server.search.translation;
import static org.rhq.enterprise.server.search.common.SearchQueryGenerationUtility.getJPQLForString;
+import org.rhq.core.domain.auth.Subject; import org.rhq.core.domain.resource.ResourceCategory; import org.rhq.enterprise.server.search.translation.antlr.RHQLAdvancedTerm; import org.rhq.enterprise.server.search.translation.antlr.RHQLComparisonOperator; @@ -10,6 +11,10 @@ import org.rhq.enterprise.server.search.translation.jpql.SearchFragmentType;
public class GroupSearchTranslator extends AbstractSearchTranslator {
+ public GroupSearchTranslator(Subject subject) { + super(subject); + } + public SearchFragment getSearchFragment(String alias, RHQLAdvancedTerm term) { String path = term.getPath(); RHQLComparisonOperator op = term.getOperator(); diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/ResourceSearchTranslator.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/ResourceSearchTranslator.java index dfe53ec..bece19d 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/ResourceSearchTranslator.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/ResourceSearchTranslator.java @@ -3,6 +3,7 @@ package org.rhq.enterprise.server.search.translation; import static org.rhq.enterprise.server.search.common.SearchQueryGenerationUtility.getJPQLForString;
import org.rhq.core.domain.alert.AlertPriority; +import org.rhq.core.domain.auth.Subject; import org.rhq.core.domain.measurement.AvailabilityType; import org.rhq.core.domain.resource.ResourceCategory; import org.rhq.core.domain.search.assist.AlertSearchAssistParam; @@ -13,6 +14,10 @@ import org.rhq.enterprise.server.search.translation.jpql.SearchFragmentType;
public class ResourceSearchTranslator extends AbstractSearchTranslator {
+ public ResourceSearchTranslator(Subject subject) { + super(subject); + } + public SearchFragment getSearchFragment(String alias, RHQLAdvancedTerm term) { String path = term.getPath(); RHQLComparisonOperator op = term.getOperator(); @@ -73,6 +78,7 @@ public class ResourceSearchTranslator extends AbstractSearchTranslator { + " WHERE simpleDefinition = definition " // only provide translations for simple properties + " AND simpleDefinition.type <> 'PASSWORD' " // do not allow searching by hidden/password fields + " AND property = simple " // join to simple for filter by 'stringValue' attribute + + " AND " + conditionallyAddAuthzFragment(getConfigAuthzFragment()) // + " AND " + getJPQLForString("definition.name", RHQLComparisonOperator.EQUALS, param) // + " AND " + getJPQLForString("simple.stringValue", op, filter));
@@ -96,4 +102,17 @@ public class ResourceSearchTranslator extends AbstractSearchTranslator { } } } + + private String getConfigAuthzFragment() { + return "res.id IN " // + + "(SELECT ires.id " // + + " FROM Resource ires " // + + " JOIN ires.implicitGroups igroup " // + + " JOIN igroup.roles irole " // + + " JOIN irole.subjects isubject " // + + " JOIN irole.permissions iperm " // + + " WHERE isubject.id = " + getSubjectId() // + + " AND iperm = 11)"; + } + } diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/SearchTranslatorFactory.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/SearchTranslatorFactory.java index 10ad8f5..16661c1 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/SearchTranslatorFactory.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/SearchTranslatorFactory.java @@ -1,5 +1,6 @@ package org.rhq.enterprise.server.search.translation;
+import org.rhq.core.domain.auth.Subject; import org.rhq.core.domain.search.SearchSubsystem;
public class SearchTranslatorFactory { @@ -7,11 +8,11 @@ public class SearchTranslatorFactory { // force use of static methods only }
- public static SearchTranslator getTranslator(SearchSubsystem searchContext) { + public static SearchTranslator getTranslator(Subject subject, SearchSubsystem searchContext) { if (searchContext == SearchSubsystem.RESOURCE) { - return new ResourceSearchTranslator(); + return new ResourceSearchTranslator(subject); } else if (searchContext == SearchSubsystem.GROUP) { - return new GroupSearchTranslator(); + return new GroupSearchTranslator(subject); } throw new IllegalArgumentException("No SearchTranslator found for SearchContext[" + searchContext + "]"); } diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/tagging/TagManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/tagging/TagManagerBean.java index c432e2e..a66166f 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/tagging/TagManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/tagging/TagManagerBean.java @@ -68,17 +68,16 @@ public class TagManagerBean implements TagManagerLocal, TagManagerRemote { @EJB private AuthorizationManagerLocal authorizationManager;
- public PageList<Tag> findTagsByCriteria(Subject subject, TagCriteria criteria) {
- CriteriaQueryGenerator generator = new CriteriaQueryGenerator(criteria); + CriteriaQueryGenerator generator = new CriteriaQueryGenerator(subject, criteria); + ;
CriteriaQueryRunner<Tag> queryRunner = new CriteriaQueryRunner<Tag>(criteria, generator, entityManager);
return queryRunner.execute(); }
- public Set<Tag> addTags(Subject subject, Set<Tag> tags) { Set<Tag> results = new HashSet<Tag>();
@@ -108,7 +107,6 @@ public class TagManagerBean implements TagManagerLocal, TagManagerRemote { } }
- public void updateResourceTags(Subject subject, int resourceId, Set<Tag> tags) { if (!authorizationManager.hasResourcePermission(subject, Permission.MODIFY_RESOURCE, resourceId)) { throw new PermissionException("You do not have permission to modify resource"); @@ -123,8 +121,6 @@ public class TagManagerBean implements TagManagerLocal, TagManagerRemote { tag.removeResource(resource); }
- - for (Tag tag : definedTags) { tag.addResource(resource); } @@ -144,7 +140,6 @@ public class TagManagerBean implements TagManagerLocal, TagManagerRemote { tag.removeResourceGroup(group); }
- for (Tag tag : definedTags) { tag.addResourceGroup(group); } @@ -163,7 +158,6 @@ public class TagManagerBean implements TagManagerLocal, TagManagerRemote { tag.removeBundle(bundle); }
- for (Tag tag : definedTags) { tag.addBundle(bundle); } @@ -182,7 +176,6 @@ public class TagManagerBean implements TagManagerLocal, TagManagerRemote { tag.removeBundleVersion(bundleVersion); }
- for (Tag tag : definedTags) { tag.addBundleVersion(bundleVersion); } @@ -206,8 +199,6 @@ public class TagManagerBean implements TagManagerLocal, TagManagerRemote { } }
- - @RequiredPermission(Permission.MANAGE_INVENTORY) // todo verify public void updateBundleDestinationTags(Subject subject, int bundleDestinationId, Set<Tag> tags) { @@ -226,7 +217,6 @@ public class TagManagerBean implements TagManagerLocal, TagManagerRemote { } }
- public PageList<TagReportComposite> findTagReportCompositesByCriteria(Subject subject, TagCriteria tagCriteria) { // TODO criteria stuff
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/CriteriaQueryGenerator.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/CriteriaQueryGenerator.java index a1b809f..78885b0 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/CriteriaQueryGenerator.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/CriteriaQueryGenerator.java @@ -37,6 +37,7 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.hibernate.annotations.IndexColumn;
+import org.rhq.core.domain.auth.Subject; import org.rhq.core.domain.authz.Permission; import org.rhq.core.domain.criteria.AlertCriteria; import org.rhq.core.domain.criteria.Criteria; @@ -72,6 +73,7 @@ public final class CriteriaQueryGenerator { private Criteria criteria; private String searchExpressionWhereClause;
+ private Subject subject; private String authorizationJoinFragment; private String authorizationPermsFragment; private String authorizationCustomConditionFragment; @@ -95,6 +97,11 @@ public final class CriteriaQueryGenerator { }
public CriteriaQueryGenerator(Criteria criteria) { + this(LookupUtil.getSubjectManager().getOverlord(), criteria); + } + + public CriteriaQueryGenerator(Subject subject, Criteria criteria) { + this.subject = subject; this.criteria = criteria; this.className = criteria.getPersistentClass().getSimpleName(); this.alias = this.criteria.getAlias(); @@ -525,7 +532,8 @@ public final class CriteriaQueryGenerator {
try { Class<?> entityClass = criteria.getPersistentClass(); - SearchTranslationManager searchManager = new SearchTranslationManager(SearchSubsystem.get(entityClass)); + SearchTranslationManager searchManager = new SearchTranslationManager(subject, SearchSubsystem + .get(entityClass)); searchManager.setExpression(searchExpression);
// translate first, if there was an error we won't add the dangling 'AND' to the where clause @@ -694,7 +702,8 @@ public final class CriteriaQueryGenerator { subjectCriteria.fetchRoles(true); subjectCriteria.addSortName(PageOrdering.ASC);
- CriteriaQueryGenerator subjectGenerator = new CriteriaQueryGenerator(subjectCriteria); + Subject overlord = LookupUtil.getSubjectManager().getOverlord(); + CriteriaQueryGenerator subjectGenerator = new CriteriaQueryGenerator(overlord, subjectCriteria); System.out.println(subjectGenerator.getQueryString(false)); System.out.println(subjectGenerator.getQueryString(true)); } @@ -713,7 +722,8 @@ public final class CriteriaQueryGenerator { alertCriteria.setFiltersOptional(true); //alertCriteria.setCaseSensitive(false);
- CriteriaQueryGenerator generator = new CriteriaQueryGenerator(alertCriteria); + Subject overlord = LookupUtil.getSubjectManager().getOverlord(); + CriteriaQueryGenerator generator = new CriteriaQueryGenerator(overlord, alertCriteria); System.out.println(generator.getQueryString(false)); System.out.println(generator.getQueryString(true));
@@ -727,7 +737,8 @@ public final class CriteriaQueryGenerator { historyCriteria.addFilterResourceIds(1); historyCriteria.addFilterStatus(OperationRequestStatus.FAILURE);
- CriteriaQueryGenerator generator = new CriteriaQueryGenerator(historyCriteria); + Subject overlord = LookupUtil.getSubjectManager().getOverlord(); + CriteriaQueryGenerator generator = new CriteriaQueryGenerator(overlord, historyCriteria); System.out.println(generator.getQueryString(false)); System.out.println(generator.getQueryString(true)); } @@ -741,7 +752,8 @@ public final class CriteriaQueryGenerator { resourceCriteria.setCaseSensitive(true); resourceCriteria.setFiltersOptional(true);
- CriteriaQueryGenerator generator = new CriteriaQueryGenerator(resourceCriteria); + Subject overlord = LookupUtil.getSubjectManager().getOverlord(); + CriteriaQueryGenerator generator = new CriteriaQueryGenerator(overlord, resourceCriteria); generator.getQueryString(false); generator.getQueryString(true); }
commit 7f7642718af571e381c9812adb26d67db2680f50 Author: Heiko W. Rupp hwr@pilhuhn.de Date: Fri Jul 16 22:45:04 2010 +0200
Put translations directly in the questions file. This makes it easier to stay consistent and also to only have partial questions translated.
diff --git a/modules/helpers/bundleGen/src/main/java/org/rhq/helpers/bundleGen/XmlQuestionsReader.java b/modules/helpers/bundleGen/src/main/java/org/rhq/helpers/bundleGen/XmlQuestionsReader.java index e47da34..649cbf5 100644 --- a/modules/helpers/bundleGen/src/main/java/org/rhq/helpers/bundleGen/XmlQuestionsReader.java +++ b/modules/helpers/bundleGen/src/main/java/org/rhq/helpers/bundleGen/XmlQuestionsReader.java @@ -71,12 +71,7 @@ public class XmlQuestionsReader { DocumentBuilder builder = factory.newDocumentBuilder(); Class<? extends XmlQuestionsReader> clazz = getClass(); String lang = Locale.getDefault().getLanguage(); - InputStream input = clazz.getResourceAsStream("/"+baseName + "_" + lang + ".xml"); - if (input==null) { - log.debug("No localized version of " + baseName + " found, locale=" + lang); - log.debug("Now trying " + baseName); - input = clazz.getResourceAsStream("/"+baseName +".xml" ); - } + InputStream input = clazz.getResourceAsStream("/"+baseName +".xml" ); if (input == null) { throw new FileNotFoundException("Input file [" + baseName + "] not found"); } @@ -99,16 +94,16 @@ public class XmlQuestionsReader { System.err.println("Type " + type + " is invalid in " + question ); return; } - Element text = (Element) question.getElementsByTagName("text").item(0); + Element text = getElementForLang(question,"text",lang); NodeList prefillNodes = question.getElementsByTagName("prefill"); String prefill = null; if (prefillNodes.getLength()>0) { prefill = prefillNodes.item(0).getTextContent(); } - NodeList helpNodes = question.getElementsByTagName("help"); + Element helpNode = getElementForLang(question,"help",lang); String help = null; - if (helpNodes.getLength()>0) { - help = helpNodes.item(0).getTextContent(); + if (helpNode!=null) { + help = helpNode.getTextContent(); }
boolean isBool = false; @@ -178,6 +173,35 @@ public class XmlQuestionsReader { }
/** + * Search for an element <i>tagWanted</i> within parent. If multiple + * elements are present, use the one with the matching <i>lang</i>. + * If no matching element is present, use one without a <i>lang</i> + * attribute + * @param parent containing element + * @param tagWanted the tag to search for + * @param lang the desired language version + * @return an element or null if not found + */ + Element getElementForLang(Element parent, String tagWanted, String lang) { + NodeList elements = parent.getElementsByTagName(tagWanted); + if (elements==null || elements.getLength()==0) + return null; + + Element noLang = (Element) elements.item(0); + + for (int i = 0; i < elements.getLength(); i++) { + Element ele = (Element) elements.item(i); + String attr = ele.getAttribute("lang"); + if (attr==null || attr.isEmpty()) { + noLang = ele; + } + else if (attr.equals(lang)) { + return ele; + } + } + return noLang; + } + /** * Returns true if the passed type is a valid data type of the properties (not for a single * property). * @param type A type as string diff --git a/modules/helpers/bundleGen/src/main/resources/bundleQuestions.xml b/modules/helpers/bundleGen/src/main/resources/bundleQuestions.xml index 94b5c14..2dcb856 100644 --- a/modules/helpers/bundleGen/src/main/resources/bundleQuestions.xml +++ b/modules/helpers/bundleGen/src/main/resources/bundleQuestions.xml @@ -1,28 +1,35 @@ <?xml version="1.0" ?> -<!-- DOCTYPE questions SYSTEM "questions.dtd"--> +<!-- DOCTYPE questions SYSTEM "questions.dtd" --> <questions> <question prop="project"> <text>Please give the project name</text> + <text lang="de">Bitte geben Sie den Projektnamen an</text> <prefill>myProject</prefill> </question> <question prop="bundleName"> <text>Please give the bundle name</text> + <text lang="de">Bitte geben Sie den Namen des Bundles an</text> </question> <question prop="bundleVersion"> <text>Please specify the bundle version</text> + <text lang="de">Bite spezifizieren Sie die Version des Bundles</text> <prefill>1.0</prefill> </question> <question prop="bundleDescription"> <text>Please describe your bundle</text> + <text lang="de">Bitte beschreiben Sie Ihr Bundle</text> </question> <question prop="bundleFile"> <text>Please give the name (only) of your bundle content file</text> + <text lang="de">Bitte geben Sie (nur) den Namen der Datei mit dem Bundle-Inhalt an.</text> </question> <question prop="contentDir"> <text>Please give the directory (only) of your bundle content file</text> + <text lang="de">Bitte geben Sie (nur) das Verzeichnis mit der Datei mit dem Bundle-Inhalt an.</text> </question> <question prop="replacePattern"> <text>Please give a patten of files to replace templates</text> + <text lang="de">Bitte geben Sie ein Datei-Muster fÃŒr Ersetzungen an</text> <help>E.g. *.jsp</help> </question> </questions> \ No newline at end of file diff --git a/modules/helpers/bundleGen/src/main/resources/bundleQuestions_de.xml b/modules/helpers/bundleGen/src/main/resources/bundleQuestions_de.xml deleted file mode 100644 index 41deb9c..0000000 --- a/modules/helpers/bundleGen/src/main/resources/bundleQuestions_de.xml +++ /dev/null @@ -1,28 +0,0 @@ -<?xml version="1.0" ?> -<!-- DOCTYPE questions SYSTEM "questions.dtd"--> -<questions> - <question prop="project"> - <text>Bitte geben Sie den Projektnamen an</text> - <prefill>myProject</prefill> - </question> - <question prop="bundleName"> - <text>Bitte geben Sie den Namen des Bundles an</text> - </question> - <question prop="bundleVersion"> - <text>Bite spezifizieren Sie die Version des Bundles</text> - <prefill>1.0</prefill> - </question> - <question prop="bundleDescription"> - <text>Bitte beschreiben Sie Ihr Bundle</text> - </question> - <question prop="bundleFile"> - <text>Bitte geben Sie (nur) den Namen der Datei mit dem Bundle-Inhalt an.</text> - </question> - <question prop="contentDir"> - <text>Bitte geben Sie (nur) das Verzeichnis mit der Datei mit dem Bundle-Inhalt an.</text> - </question> - <question prop="replacePattern"> - <text>Bitte geben Sie ein Datei-Muster fÃŒr Ersetzungen an</text> - <help>Z.B. *.jsp</help> - </question> -</questions> \ No newline at end of file diff --git a/modules/helpers/bundleGen/src/main/resources/questions.dtd b/modules/helpers/bundleGen/src/main/resources/questions.dtd index aa6ad32..ed3981a 100644 --- a/modules/helpers/bundleGen/src/main/resources/questions.dtd +++ b/modules/helpers/bundleGen/src/main/resources/questions.dtd @@ -3,7 +3,7 @@ <!ELEMENT questions (question+)>
<!-- one single question --> -<!ELEMENT question (text, options?, prefill?, help?)> +<!ELEMENT question (text+, options?, prefill?, help*)>
<!ATTLIST question prop CDATA #REQUIRED @@ -17,6 +17,10 @@ <!-- The text to ask --> <!ELEMENT text (#PCDATA)>
+<!ATTLIST text + lang (en|fr|pt|de|es) #IMPLIED +> + <!-- The expected return type --> <!ELEMENT type (#PCDATA)>
@@ -30,7 +34,10 @@ <!ELEMENT prefill (#PCDATA)>
<!-- A help text for this specific question that - gives more infomation about the feateure. + gives more information about the feature. Can span multiple lines --> <!ELEMENT help (#PCDATA)>
+<!ATTLIST text + lang (en|fr|pt|de|es) #IMPLIED +>
commit f08e73541ffdd6412e636ce3ad0adcee77543fa0 Author: Greg Hinkle ghinkle@redhat.com Date: Fri Jul 16 16:15:26 2010 -0400
Seriously remove hard-coded user.agent from master... really need to make this a build property
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml index 14ca590..a3db099 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml @@ -38,7 +38,7 @@ <!-- limit builds to your preferred browser -->
<!-- Safari --> - <set-property name="user.agent" value="safari"/> + <!-- <set-property name="user.agent" value="safari"/> -->
<!-- Firefox 3 --> <!--<set-property name="user.agent" value="gecko1_8"/>-->
commit 1bc7e54d2ea1c2a0bfb4381929f70ba63b8a8d7d Author: Joseph Marques joseph@redhat.com Date: Fri Jul 16 10:43:44 2010 -0400
user must be able to view resource in order to see plugin configuration
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationManagerBean.java index 2e6198d..c0add68 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationManagerBean.java @@ -886,6 +886,11 @@ public class ConfigurationManagerBean implements ConfigurationManagerLocal, Conf public PluginConfigurationUpdate getPluginConfigurationUpdate(Subject subject, int configurationUpdateId) { PluginConfigurationUpdate update = entityManager.find(PluginConfigurationUpdate.class, configurationUpdateId);
+ if (!authorizationManager.canViewResource(subject, update.getResource().getId())) { + throw new PermissionException("User [" + subject.getName() + + "] does not have permission to view plugin configuration update for [" + update.getResource() + "]"); + } + update.getConfiguration(); // this is EAGER loaded, so this really doesn't do anything
return update;
commit 1020ac708d39a850b562952bc986a291fff03c1e Author: Filip Drabek fdrabek@dhcp-lab-136.englab.brq.redhat.com Date: Fri Jul 16 16:18:53 2010 +0200
Apache Unit tests update.
diff --git a/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/ApacheAugeasTest.java b/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/ApacheAugeasTest.java new file mode 100644 index 0000000..36dd675 --- /dev/null +++ b/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/ApacheAugeasTest.java @@ -0,0 +1,123 @@ +package org.rhq.plugins.apache; + +import java.io.File; +import java.util.List; + +import org.rhq.augeas.AugeasProxy; +import org.rhq.augeas.node.AugeasNode; +import org.rhq.augeas.tree.AugeasTree; +import org.rhq.core.domain.configuration.Configuration; +import org.rhq.core.domain.configuration.definition.ConfigurationDefinition; +import org.rhq.core.pc.PluginContainer; +import org.rhq.plugins.apache.augeas.AugeasConfigurationApache; +import org.rhq.plugins.apache.mapping.ApacheAugeasMapping; +import org.rhq.plugins.apache.util.ApacheConfigurationUtil; +import org.rhq.plugins.apache.util.AugeasNodeSearch; + +public class ApacheAugeasTest { + + /** + * Tests if all included configuration files were loaded. + * @return + */ + public void testFiles(AugeasProxy augeas){ + System.out.println("Test if all included cofiguration files was discovered and loaded."); + AugeasConfigurationApache config = (AugeasConfigurationApache)augeas.getConfiguration(); + List<File> configFiles = config.getAllConfigurationFiles(); + + /* + * There are three files one main file one which is included from main file and one which is included from + * included file and which is declared in IfModule. All of them must be discovered. + */ + boolean found=false; + for (File confFile : configFiles){ + found = false; + for (String fileName : ApacheTestConstants.CONFIG_FILE_NAMES){ + if (!confFile.getName().equals(fileName)) + found= true; + } + assert found; + } + } + /** + * Tests mapping of augeas tree to configuration and back. + * @param cont + * @throws Exception + */ + public void testMapping(PluginContainer cont){ + ApacheAugeasUtil apacheUtil = new ApacheAugeasUtil(); + try{ + //copy all configuration files to temporary folder + String path = apacheUtil.prepareConfigFiles(); + //loading of augeas from temporary folder + AugeasProxy proxy = apacheUtil.initAugeas(path+File.separator+ApacheTestConstants.ROOT_CONFIG_FILE_NAME, path, path); + AugeasTree tree = proxy.getAugeasTree(ApacheTestConstants.MODULE_NAME, true); + + testLoadConfig(tree, cont); + testSaveConfig(cont); + apacheUtil.cleanConfigFiles(); + }catch(Exception e){ + e.printStackTrace(); + apacheUtil.cleanConfigFiles(); + } + } + /** + * Tests mapping of augeas tree to rhq configuration. + * @param tree + * @param container + * @throws Exception + */ + public void testLoadConfig(AugeasTree tree,PluginContainer container)throws Exception{ + System.out.println("Test mapping of augeas tree to rhq configuration."); + ApacheConfigurationUtil util = new ApacheConfigurationUtil(); + for (Components component : Components.values()){ + //get nodes for each component + List<AugeasNode> nodes = component.getAllNodes(tree); + for (int i=0;i<nodes.size();i++){ + String key = AugeasNodeSearch.getNodeKey(nodes.get(i), tree.getRootNode()); + Configuration config = ApacheConfigurationUtil.componentToConfiguration(container, component, key, tree); + //load configuration for related component and augeas node from tempfolder + Configuration conf = util.loadConfiguration(ApacheTestConstants.getConfigFilesPathForLoad()+ + File.separator+component.getComponentName()+String.valueOf(i)); + assert config.equals(conf); + } + } + } + + /** + * Tests mapping of rhq configuration to augeas tree. + * + * @param container + * @throws Exception + */ + public void testSaveConfig(PluginContainer container)throws Exception{ + System.out.println("Test mapping of rhq configuration to augeas tree."); + ApacheAugeasUtil apacheUtil = new ApacheAugeasUtil(); + //load augeas tree from temporary folder + String path = ApacheTestConstants.getApacheConfigFilesPath(); + AugeasProxy proxy = apacheUtil.initAugeas(path+ApacheTestConstants.ROOT_CONFIG_FILE_NAME, path, path); + AugeasTree tree = proxy.getAugeasTree(ApacheTestConstants.MODULE_NAME, true); + //load augeas tree from temporary folder "updateconfig" + String pathUpdate = ApacheTestConstants.getApacheConfigFilesPathForUpdate(); + AugeasProxy proxyUpdate = apacheUtil.initAugeas(pathUpdate+ApacheTestConstants.ROOT_CONFIG_FILE_NAME, pathUpdate, pathUpdate); + AugeasTree treeUpdate = proxyUpdate.getAugeasTree(ApacheTestConstants.MODULE_NAME, true); + + for (Components component : Components.values()){ + List<AugeasNode> nodes = component.getAllNodes(tree); + ConfigurationDefinition configDef = ApacheConfigurationUtil.getConfigurationDefinition(container, component); + + for (int i=0;i<nodes.size();i++){ + //load component from first tree - transfare that tree to configuration - and update second tree with that configuration + String key = AugeasNodeSearch.getNodeKey(nodes.get(i), tree.getRootNode()); + Configuration config = ApacheConfigurationUtil.componentToConfiguration(container, component, key, tree); + AugeasNode updateNode = AugeasNodeSearch.findNodeById(treeUpdate.getRootNode(), key); + + ApacheAugeasMapping mapping = new ApacheAugeasMapping(treeUpdate); + mapping.updateAugeas(updateNode, config, configDef); + } + } + treeUpdate.save(); + //test if the updated augeas tree can be mapped to configuration stored at files in "loadconfig" temporary directory + testLoadConfig(treeUpdate, container); + } +} diff --git a/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/ApacheAugeasUtil.java b/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/ApacheAugeasUtil.java new file mode 100644 index 0000000..1c2c6a5 --- /dev/null +++ b/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/ApacheAugeasUtil.java @@ -0,0 +1,172 @@ +package org.rhq.plugins.apache; + +import java.io.File; +import java.util.ArrayList; +import java.util.List; + +import org.rhq.augeas.AugeasProxy; +import org.rhq.augeas.node.AugeasNode; +import org.rhq.augeas.tree.AugeasTree; +import org.rhq.core.domain.configuration.Configuration; +import org.rhq.core.domain.configuration.PropertySimple; +import org.rhq.core.pc.PluginContainer; +import org.rhq.plugins.apache.augeas.AugeasConfigurationApache; +import org.rhq.plugins.apache.augeas.AugeasTreeBuilderApache; +import org.rhq.plugins.apache.helper.LensHelper; +import org.rhq.plugins.apache.util.ApacheConfigurationUtil; +import org.rhq.plugins.apache.util.AugeasNodeSearch; + +public class ApacheAugeasUtil { + + /** + * Loads augeas. + * @param configFilePath + * @param serverRootPath + * @param lensPath + * @return + */ + public AugeasProxy initAugeas(String configFilePath,String serverRootPath,String lensPath){ + Configuration configuration = new Configuration(); + configuration.put(new PropertySimple("configurationFilesInclusionPatterns",configFilePath)); + configuration.put(new PropertySimple("augeasModuleName", ApacheTestConstants.MODULE_NAME)); + configuration.put(new PropertySimple(ApacheTestConstants.PLUGIN_CONFIG_PROP_SERVER_ROOT,serverRootPath)); + + AugeasConfigurationApache conf = new AugeasConfigurationApache(lensPath,configuration); + AugeasTreeBuilderApache builder = new AugeasTreeBuilderApache(); + AugeasProxy augeas = new AugeasProxy(conf,builder); + + augeas.load(); + + return augeas; + } + + /** + * This method will create a new temporary directory and copy there all configuration files. + * @return + * @throws UnitTestException + */ + public String prepareConfigFiles() { + String tempDirPath=null; + try { + + File tempDirectory = LensHelper.createTempDir(ApacheTestConstants.TEMP_CONFIG_FILE_DIRECTORY); + if (!tempDirectory.exists()) + tempDirectory.createNewFile(); + //copy the apache configuration files to temp folder + tempDirPath = tempDirectory.getAbsolutePath()+File.separatorChar; + copyFiles(ApacheTestConstants.FILES_TO_LOAD, "", tempDirectory); + + File updateDir = new File(tempDirectory,ApacheTestConstants.TEST_FILE_APACHE_CONFIG_FOLDER); + if (!updateDir.exists()){ + updateDir.mkdir(); + updateDir.createNewFile(); + } + //copy the apache configuration files to temp folder "updateconfig" + copyFiles(ApacheTestConstants.FILES_TO_LOAD, ApacheTestConstants.TEST_FILE_APACHE_CONFIG_FOLDER, tempDirectory); + + File loadDir = new File(tempDirectory,ApacheTestConstants.TEST_FILE_CONFIG_FOLDER); + if (!loadDir.exists()){ + loadDir.mkdir(); + loadDir.createNewFile(); + } + //copy xml files with rhq configuration to loadconfig + for(Components component : Components.values()){ + copyFiles(component.getConfigurationFiles().toArray(new String[0]), ApacheTestConstants.TEST_FILE_CONFIG_FOLDER, tempDirectory); + } + + ApacheTestConstants.TEMP_FILES_PATH=tempDirectory.getAbsolutePath(); + + }catch (Exception e){ + e.printStackTrace(); + } + + return tempDirPath; + } + + public void cleanConfigFiles(){ + try { + + File tempDirectory = new File(ApacheTestConstants.getApacheConfigFilesPath()); + if (!tempDirectory.exists()) + return; + + deleteFiles(ApacheTestConstants.FILES_TO_LOAD, "", tempDirectory); + + File updateDir = new File(tempDirectory,ApacheTestConstants.TEST_FILE_APACHE_CONFIG_FOLDER); + if (updateDir.exists()){ + deleteFiles(ApacheTestConstants.FILES_TO_LOAD, ApacheTestConstants.TEST_FILE_APACHE_CONFIG_FOLDER, tempDirectory); + updateDir.delete(); + } + File loadDir = new File(tempDirectory,ApacheTestConstants.TEST_FILE_CONFIG_FOLDER); + if (loadDir.exists()) + { + for(Components component : Components.values()){ + deleteFiles(component.getConfigurationFiles().toArray(new String[0]), ApacheTestConstants.TEST_FILE_CONFIG_FOLDER, tempDirectory); + } + loadDir.delete(); + } + + tempDirectory.delete(); + }catch (Exception e){ + e.printStackTrace(); + } + } + public void copyFiles(String[] files,String folder,File destination) throws Exception{ + for (String fileName : files){ + String path=null; + + if (folder.equals("")) + path = fileName; + else + path = folder+File.separator+fileName; + + File configFile = LensHelper.cpFileFromPluginToTemp(this.getClass().getClassLoader(),destination, path); + if (!configFile.exists()) + throw new UnitTestException("Creation of temporary configuration file failed."); + } + } + + public void deleteFiles(String[] files,String folder,File destination) throws Exception{ + for (String fileName : files){ + String path=null; + + if (folder.equals("")) + path = fileName; + else + path = folder+File.separator+fileName; + + File configFile = new File(destination,path);; + if (configFile.exists()) + configFile.delete(); + } + } + /** + * Method for searching all components in ageasTree which returns List of keys which identify the component. + * @param parentNodeNames + * @param componentName + * @param tree + * @return + */ + public List<String> loadComponent(String[] parentNodeNames,String componentName,AugeasTree tree){ + List<String> paramsString = new ArrayList<String>(); + List<AugeasNode> nodes = AugeasNodeSearch.searchNode(parentNodeNames, componentName, tree.getRootNode()); + for (AugeasNode node : nodes){ + paramsString.add(AugeasNodeSearch.getNodeKey(node, tree.getRootNode())); + } + return paramsString; + } + + public void saveFiles(AugeasTree tree,PluginContainer container) throws Exception{ + for (Components component : Components.values()){ + String name = component.getComponentName(); + List<AugeasNode> nodes = component.getAllNodes(tree); + for (int i=0;i<nodes.size();i++){ + String key = AugeasNodeSearch.getNodeKey(nodes.get(i), tree.getRootNode()); + //PATH TO THE CONFIG FILES + String fileName = name+String.valueOf(i); + Configuration config = ApacheConfigurationUtil.componentToConfiguration(container, component, key, tree); + ApacheConfigurationUtil.saveConfiguration(config, fileName); + } + } + } +} diff --git a/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/ApachePluginTest.java b/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/ApachePluginTest.java index a1a42c1..f3ce761 100644 --- a/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/ApachePluginTest.java +++ b/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/ApachePluginTest.java @@ -63,7 +63,12 @@ public class ApachePluginTest {
pcConfig.setInsideAgent(false); PluginContainer.getInstance().setConfiguration(pcConfig); - PluginContainer.getInstance().initialize(); + PluginContainer container = PluginContainer.getInstance(); + container.initialize(); + container.getInventoryManager().executeServerScanImmediately(); + container.getInventoryManager().executeServiceScanImmediately(); + ApacheAugeasTest test = new ApacheAugeasTest(); + test.testMapping(container); } catch (Exception e) { e.printStackTrace(); } diff --git a/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/ApacheTestConstants.java b/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/ApacheTestConstants.java new file mode 100644 index 0000000..5f79b42 --- /dev/null +++ b/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/ApacheTestConstants.java @@ -0,0 +1,47 @@ +package org.rhq.plugins.apache; + +import java.io.File; + +public class ApacheTestConstants { + + public static final String MODULE_NAME="Httpd"; + public static final String PLUGIN_NAME="Apache"; + public static final String LENS_NAME="httpd.aug"; + public static final String TEMP_CONFIG_FILE_DIRECTORY = "HttpdTest"; + public static final String CONFIG_FILE_NAMES [] = { + "httpd.conf", + "included.conf", + "nested.conf"}; + public static final String FILES_TO_LOAD [] = { + "httpd.conf", + "included.conf", + "nested.conf", + "httpd.aug"}; + public static final String ROOT_CONFIG_FILE_NAME = "httpd.conf"; + public static final String PLUGIN_CONFIG_PROP_SERVER_ROOT = "serverRoot"; + public static final String TEST_FILE_CONFIG_FOLDER="loadconfig"; + public static final String TEST_FILE_APACHE_CONFIG_FOLDER="updateconfig"; + public static String TEMP_FILES_PATH; + + /** + * Path to folder containing rhq configuration in xml files. + * @return + */ + public static String getConfigFilesPathForLoad(){ + return TEMP_FILES_PATH+File.separator+TEST_FILE_CONFIG_FOLDER+File.separator; + } + /** + * Path to folder containing apache configuration in "loadconfig" folder + * @return + */ + public static String getApacheConfigFilesPathForUpdate(){ + return TEMP_FILES_PATH+File.separator+TEST_FILE_APACHE_CONFIG_FOLDER+File.separator; + } + /** + * Path to temporary folder where are/will be stored all config files. + * @return + */ + public static String getApacheConfigFilesPath(){ + return TEMP_FILES_PATH+File.separator; + } +} diff --git a/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/Components.java b/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/Components.java new file mode 100644 index 0000000..7335806 --- /dev/null +++ b/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/Components.java @@ -0,0 +1,125 @@ +package org.rhq.plugins.apache; + +import java.util.ArrayList; +import java.util.List; + +import org.rhq.augeas.node.AugeasNode; +import org.rhq.augeas.tree.AugeasTree; +import org.rhq.plugins.apache.util.AugeasNodeSearch; + +/** + * Enum of all components in Apache plugin. + * @author fdrabek + * + */ +public enum Components { + + IFMODULE{ + public String getComponentName(){ + return "IfModule"; + } + public String[] getPossParentNodeName(){ + String [] parentNames = new String[2]; + parentNames[0]="<IfModule"; + parentNames[1]="<VirtualHost"; + return parentNames; + } + public String getNodeName(){ + return "<IfModule"; + } + public List<AugeasNode> getAllNodes(AugeasTree tree){ + return AugeasNodeSearch.searchNode(IFMODULE.getPossParentNodeName(), IFMODULE.getNodeName(), tree.getRootNode()); + } + public List<String> getConfigurationFiles(){ + List<String> list = new ArrayList<String>(); + list.add("IfModule0"); + list.add("IfModule1"); + return list; + } + }, + + IFMODULE_DIRECTORY{ + public String getComponentName(){ + return "IfModule Parameters"; + } + public String[] getPossParentNodeName(){ + String [] parentNames = new String[1]; + parentNames[0]="<IfModule"; + return parentNames; + } + public String getNodeName(){ + return "<IfModule"; + } + public List<AugeasNode> getAllNodes(AugeasTree tree){ + List<AugeasNode> nodes = DIRECTORY.getAllNodes(tree); + List<AugeasNode> ifModNodes = new ArrayList<AugeasNode>(); + for (AugeasNode node : nodes){ + List<AugeasNode> tempNodes = AugeasNodeSearch.searchNode(IFMODULE_DIRECTORY.getPossParentNodeName(), IFMODULE_DIRECTORY.getNodeName(), node); + if (tempNodes != null) + ifModNodes.addAll(tempNodes); + } + return ifModNodes; + + } + + public List<String> getConfigurationFiles(){ + List<String> list = new ArrayList<String>(); + list.add("IfModule Parameters0"); + return list; + } + }, + + DIRECTORY{ + public String getComponentName(){ + return "Directory"; + } + public String[] getPossParentNodeName(){ + String [] parentNames = new String[2]; + parentNames[0]="<IfModule"; + parentNames[1]="<VirtualHost"; + return parentNames; + } + public String getNodeName(){ + return "<Directory"; + } + public List<AugeasNode> getAllNodes(AugeasTree tree){ + return AugeasNodeSearch.searchNode(DIRECTORY.getPossParentNodeName(), DIRECTORY.getNodeName(), tree.getRootNode()); + } + + public List<String> getConfigurationFiles(){ + List<String> list = new ArrayList<String>(); + list.add("Directory0"); + list.add("Directory1"); + list.add("Directory2"); + return list; + } + }, + + VIRTUALHOST{ + public String getComponentName(){ + return "Apache Virtual Host"; + } + public String[] getPossParentNodeName(){ + String [] parentNames = new String[0]; + return parentNames; + } + public String getNodeName(){ + return "<VirtualHost"; + } + public List<AugeasNode> getAllNodes(AugeasTree tree){ + return tree.getRootNode().getChildByLabel("<VirtualHost"); + } + + public List<String> getConfigurationFiles(){ + List<String> list = new ArrayList<String>(); + list.add("Apache Virtual Host0"); + return list; + } + }; + + public abstract String getComponentName(); + public abstract String[] getPossParentNodeName(); + public abstract String getNodeName(); + public abstract List<AugeasNode> getAllNodes(AugeasTree tree); + public abstract List<String> getConfigurationFiles(); +} diff --git a/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/UnitTestException.java b/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/UnitTestException.java new file mode 100644 index 0000000..bc94e85 --- /dev/null +++ b/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/UnitTestException.java @@ -0,0 +1,21 @@ +package org.rhq.plugins.apache; + +public class UnitTestException extends Exception{ + + public UnitTestException(){ + super(); + } + + public UnitTestException(String text){ + super(text); + } + + public UnitTestException(Exception e){ + super(e); + } + + public UnitTestException(String message,Throwable cause){ + super(message,cause); + } + +} diff --git a/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/helper/LensFilter.java b/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/helper/LensFilter.java new file mode 100644 index 0000000..1cbb28c --- /dev/null +++ b/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/helper/LensFilter.java @@ -0,0 +1,23 @@ +package org.rhq.plugins.apache.helper; + +import java.io.File; +import java.io.FileFilter; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +public class LensFilter implements FileFilter{ + private Pattern pattern; + + public LensFilter(String name){ + pattern = Pattern.compile(name+".*"); + } + + public boolean accept(File pathname) { + String name = pathname.getName(); + Matcher match = pattern.matcher(name); + if (match.matches()) + return true; + + return false; + } +} \ No newline at end of file diff --git a/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/helper/LensHelper.java b/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/helper/LensHelper.java new file mode 100644 index 0000000..567c0ae --- /dev/null +++ b/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/helper/LensHelper.java @@ -0,0 +1,109 @@ +/* + * RHQ Management Platform + * Copyright (C) 2005-2009 Red Hat, Inc. + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License, version 2, as + * published by the Free Software Foundation, and/or the GNU Lesser + * General Public License, version 2.1, also as published by the Free + * Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License and the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License + * and the GNU Lesser General Public License along with this program; + * if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +package org.rhq.plugins.apache.helper; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; + +public class LensHelper { + public static final String TEMP_DIRECTORY = "java.io.tmpdir"; + public static final String TEMP_FILE_SUFFIX = ".aug"; + + + public static String getLensPath(String param) throws IOException,Exception{ + String lensPath=null; + + if (param.indexOf(File.separatorChar)==-1){ + + }else + lensPath = param; + return lensPath; + + } + + public static void copyFile(InputStream in,File destination) throws Exception{ + + if (!destination.canWrite()) + throw new Exception("Creating of temporary file for lens failed. Destination file " + + destination.getAbsolutePath()+" is not accessible."); + + OutputStream out = new FileOutputStream(destination); + + byte[] buf = new byte[1024]; + int length; + + while ((length = in.read(buf)) > 0) { + out.write(buf, 0, length); + } + + in.close(); + out.close(); + + } + + public static File createTempDir(String name) throws IOException{ + + String tempDir = (String)System.getProperties().get(TEMP_DIRECTORY); + + File tempDirectory = new File(tempDir); + File [] lens = tempDirectory.listFiles(new LensFilter(name)); + + File lensDirectory; + + if (lens.length==0){ + File tempFile = File.createTempFile(name, ""); + String nm = tempFile.getName(); + tempFile.delete(); + lensDirectory = new File(tempDirectory,nm); + lensDirectory.mkdir(); + lensDirectory.deleteOnExit(); + }else{ + lensDirectory = lens[0]; + } + + return lensDirectory; + + } + + public static String getTempDirectoryPath(){ + return (String)System.getProperties().get(TEMP_DIRECTORY); + } + + public static File cpFileFromPluginToTemp(ClassLoader loader,File tempDirectory,String fileName) throws IOException,Exception{ + + File destinationFile = new File(tempDirectory,fileName); + if (!destinationFile.exists()) + { + destinationFile.createNewFile(); + + InputStream input = loader.getResourceAsStream(fileName); + copyFile(input, destinationFile); + } + + return destinationFile; + } + +} \ No newline at end of file diff --git a/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/util/ApacheConfigurationUtil.java b/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/util/ApacheConfigurationUtil.java new file mode 100644 index 0000000..6f82046 --- /dev/null +++ b/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/util/ApacheConfigurationUtil.java @@ -0,0 +1,230 @@ +package org.rhq.plugins.apache.util; + +import java.io.File; +import java.util.Collection; +import java.util.List; +import java.util.Map; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; + +import org.rhq.augeas.node.AugeasNode; +import org.rhq.augeas.tree.AugeasTree; +import org.rhq.core.clientapi.agent.metadata.PluginMetadataManager; +import org.rhq.core.domain.configuration.Configuration; +import org.rhq.core.domain.configuration.Property; +import org.rhq.core.domain.configuration.PropertyList; +import org.rhq.core.domain.configuration.PropertyMap; +import org.rhq.core.domain.configuration.PropertySimple; +import org.rhq.core.domain.configuration.definition.ConfigurationDefinition; +import org.rhq.core.domain.resource.ResourceType; +import org.rhq.core.pc.PluginContainer; +import org.rhq.core.pc.plugin.PluginManager; +import org.rhq.plugins.apache.ApacheTestConstants; +import org.rhq.plugins.apache.Components; +import org.rhq.plugins.apache.UnitTestException; +import org.rhq.plugins.apache.mapping.ApacheAugeasMapping; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.NamedNodeMap; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; + +import com.sun.org.apache.xml.internal.serialize.XMLSerializer; + +/** + * + * @author Filip Drabek + * + */ + +public class ApacheConfigurationUtil { + + public static final String SIMPLE_TAG_NAME = "simple"; + public static final String LIST_TAG_NAME = "list"; + public static final String MAP_TAG_NAME = "map"; + public static final String ROOT_ELEMENT = "configuration"; + public static final String NAME_ATTRIBUTE = "name"; + + private Document loadXML(String file) throws UnitTestException{ + Document document= null; + try { + File xmlFile = new File(file); + if (!xmlFile.exists()) + throw new UnitTestException("Configuration file not found."); + + DocumentBuilderFactory factory = + DocumentBuilderFactory.newInstance(); + DocumentBuilder loader = factory.newDocumentBuilder(); + + document = loader.parse(file); + + }catch(Exception e){ + throw new UnitTestException("Loading of xml file failed.",e); + } + + return document; + } + + public static void saveConfiguration(Configuration config,String fileName) throws UnitTestException{ + try { + Collection<Property> properties = config.getProperties(); + DocumentBuilderFactory dbfac = DocumentBuilderFactory.newInstance(); + DocumentBuilder docBuilder = dbfac.newDocumentBuilder(); + Document doc = docBuilder.newDocument(); + Element element = doc.createElement(ROOT_ELEMENT); + + for (Property property : properties){ + element.appendChild(configurationToDom(property,doc)); + } + doc.appendChild(element); + saveXML(doc,fileName); + + }catch(Exception e){ + throw new UnitTestException(e); + } + } + + + private static Element configurationToDom(Property prop,Document doc){ + Element element = null; + if (prop instanceof PropertySimple){ + element = doc.createElement(SIMPLE_TAG_NAME); + element.appendChild(doc.createTextNode(((PropertySimple) prop).getStringValue())); + } + + if (prop instanceof PropertyList){ + PropertyList list = (PropertyList) prop; + element = doc.createElement(LIST_TAG_NAME); + List<Property> propertyList = list.getList(); + for (Property property : propertyList){ + element.appendChild(configurationToDom(property,doc)); + } + } + + if (prop instanceof PropertyMap){ + PropertyMap map = (PropertyMap) prop; + element = doc.createElement(MAP_TAG_NAME); + Map<String,Property> propertyMap = map.getMap(); + for (Property property : propertyMap.values()){ + element.appendChild(configurationToDom(property,doc)); + } + } + + fillElement(element,prop); + return element; + } + + private static void fillElement(Element element,Property prop){ + element.setAttribute(NAME_ATTRIBUTE, prop.getName()); + } + + public Configuration loadConfiguration(String fileName) throws UnitTestException{ + Document document = loadXML(fileName); + NodeList nodeList = document.getElementsByTagName(ROOT_ELEMENT); + if (nodeList.getLength()!=1) + throw new UnitTestException("Configuration file's " + fileName+ " format is not valid."); + + Node rootElement = nodeList.item(0); + Configuration configuration = new Configuration(); + NodeList childNodes = rootElement.getChildNodes(); + for (int i=0;i<childNodes.getLength();i++){ + configuration.put(domToConfiguration(childNodes.item(i))); + } + return configuration; + } + + private Property domToConfiguration(Node node){ + String nodeName = node.getNodeName(); + NamedNodeMap attrMap = node.getAttributes(); + Node attrNode = attrMap.getNamedItem(NAME_ATTRIBUTE); + String propertyName = attrNode.getNodeValue(); + + Property prop = null; + + if (nodeName.equals(SIMPLE_TAG_NAME)){ + PropertySimple propertySimple = new PropertySimple(propertyName,null); + String value = node.getTextContent(); + propertySimple.setStringValue(value); + prop = propertySimple; + } + + if (nodeName.equals(LIST_TAG_NAME)){ + PropertyList propertyList = new PropertyList(propertyName); + NodeList list = node.getChildNodes(); + for (int i=0;i<list.getLength();i++) { + propertyList.add(domToConfiguration(list.item(i))); + } + prop = propertyList; + } + + if (nodeName.equals(MAP_TAG_NAME)){ + PropertyMap propertyMap = new PropertyMap(propertyName); + NodeList list = node.getChildNodes(); + for (int i=0;i<list.getLength();i++){ + propertyMap.put(domToConfiguration(list.item(i))); + } + prop = propertyMap; + } + + return prop; + } + + @SuppressWarnings("restriction") + private static void saveXML(Document document,String fileName) throws UnitTestException{ + try { + File file = new File(fileName); + if (!file.exists()) + file.createNewFile(); + + XMLSerializer serializer = new XMLSerializer(); + serializer.setOutputCharStream( + new java.io.FileWriter(fileName)); + serializer.serialize(document); + }catch(Exception e){ + throw new UnitTestException("Saving of xml file failed",e); + } + } + + public static void printConfiguration(Property prop){ + if (prop instanceof PropertySimple){ + System.out.println(" SimpleProperty name="+prop.getName()+" value="+((PropertySimple)prop).getStringValue()); + } + + if (prop instanceof PropertyList){ + PropertyList list = (PropertyList) prop; + System.out.println("PropertyList name="+list.getName()); + for (Property property : list.getList()){ + printConfiguration(property); + } + } + + if (prop instanceof PropertyMap){ + PropertyMap map = (PropertyMap) prop; + System.out.println(" PropertyMap name="+map.getName()); + Map<String,Property> propertyMap = map.getMap(); + for (Property property : propertyMap.values()){ + printConfiguration(property); + } + } + } + + + public static ConfigurationDefinition getConfigurationDefinition(PluginContainer container,Components component){ + PluginManager pluginManager = container.getPluginManager(); + PluginMetadataManager pluginMetadataManager = pluginManager.getMetadataManager(); + + ResourceType type = pluginMetadataManager.getType(component.getComponentName(), ApacheTestConstants.PLUGIN_NAME); + ConfigurationDefinition configDef = type.getResourceConfigurationDefinition(); + return configDef; + } + + + public static Configuration componentToConfiguration(PluginContainer container,Components component,String key,AugeasTree tree) throws UnitTestException{ + ConfigurationDefinition def = getConfigurationDefinition(container,component); + AugeasNode node = AugeasNodeSearch.findNodeById(tree.getRootNode(), key); + ApacheAugeasMapping map = new ApacheAugeasMapping(tree); + Configuration config = map.updateConfiguration(node, def); + return config; + } +} diff --git a/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/util/StandAloneContainer.java b/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/util/StandAloneContainer.java new file mode 100644 index 0000000..8d8ed5e --- /dev/null +++ b/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/util/StandAloneContainer.java @@ -0,0 +1,75 @@ +package org.rhq.plugins.apache.util; + +import java.io.File; + +import org.rhq.augeas.tree.AugeasTree; +import org.rhq.core.clientapi.agent.PluginContainerException; +import org.rhq.core.domain.resource.Resource; +import org.rhq.core.pc.PluginContainer; +import org.rhq.core.pc.PluginContainerConfiguration; +import org.rhq.core.pc.inventory.InventoryManager; +import org.rhq.core.pc.inventory.ResourceContainer; +import org.rhq.core.pc.plugin.FileSystemPluginFinder; +import org.rhq.core.pc.util.ComponentUtil; +import org.rhq.core.pc.util.FacetLockType; + +public class StandAloneContainer { + + public PluginContainer getContainer(AugeasTree tree,String pluginPath){ + PluginContainer container=null; + try { + container = PluginContainer.getInstance(); + File pluginDir = new File(pluginPath); + PluginContainerConfiguration config = new PluginContainerConfiguration(); + config.setPluginFinder(new FileSystemPluginFinder(pluginDir)); + config.setPluginDirectory(pluginDir); + + container.setConfiguration(config); + container.initialize(); + container.getInventoryManager().executeServerScanImmediately(); + container.getInventoryManager().executeServiceScanImmediately(); + + return container; + + }catch(Exception e){ + e.printStackTrace(); + if (container!=null) + container.shutdown(); + } + return null; + } + + + + public static <T> T getComponent(int resourceId, Class<T> facetInterface, FacetLockType lockType, + long timeout, boolean daemonThread, boolean onlyIfStarted) throws PluginContainerException { + InventoryManager inventoryManager = PluginContainer.getInstance().getInventoryManager(); + ResourceContainer resourceContainer = inventoryManager.getResourceContainer(resourceId); + if (resourceContainer == null) { + throw new PluginContainerException("Resource component container could not be retrieved for resource: " + + resourceId); + } + return resourceContainer.createResourceComponentProxy(facetInterface, lockType, timeout, daemonThread, onlyIfStarted); + } + + public static <T> Object getComponentProxy(Resource res,Class<T> facetInterface) throws Exception { + ClassLoader currenContextClassLoader = Thread.currentThread() + .getContextClassLoader(); + try { + Resource asResource = res; + ClassLoader cl = PluginContainer.getInstance().getPluginComponentFactory(). + getResourceClassloader(asResource); + + Class<?> resourceSpecificFacetInterface = Class.forName( + facetInterface.getName(), true, cl); + + Thread.currentThread().setContextClassLoader(cl); + + return ComponentUtil.getComponent(asResource.getId(),resourceSpecificFacetInterface, + FacetLockType.WRITE, 30000, true, true); + } finally { + Thread.currentThread().setContextClassLoader( + currenContextClassLoader); + } + } +} diff --git a/modules/plugins/apache/src/test/resources/httpd.aug b/modules/plugins/apache/src/test/resources/httpd.aug new file mode 100644 index 0000000..12c3205 --- /dev/null +++ b/modules/plugins/apache/src/test/resources/httpd.aug @@ -0,0 +1,58 @@ +module Httpd = + autoload xfm + +(* Helpers *) + +(* Newlines can be escaped. *) +let sep = del /([ \t]+(\\\\\n)?)+/ " " +let eol = del /([ \t]*(\\\\\n)?)*\n/ "\n" + let del_str (s:string) = del s s +let ws = /[ \t]*/ +let alnum = /[a-zA-Z0-9_]+/ +(* the last character in the non-quoted word must not be a backslash. I guess this is not completely semantically + correct but at the same time, apache discourages to use backslashes for anything else than + line breaking so we should be safe here. This restriction is in place to support + escaped new lines in the sep and eol rules. *) +let word = /\"([^\"\n]|\\\\\")*\"|'([^'\n]|\\\\')*'|[^'" \t\n]*[^'" \t\n\\]/ +let secarg = /\"([^\"\n]|\\\\\")*\"|'([^'\n]|\\\\')*'|[^'\" \t\n>]+/ +let wskey (k:regexp) = del ws "" . key k +let params (param:regexp) = [ sep . label "param" . store param ]* +let sec (name:string) (body:lens) = + [ wskey ("<" . name) . params secarg . del_str ">" . eol . + body . del ws "" . del_str("</" . name . ">") . eol ] + +(* Definitions *) +let comment = [ del /([ \t]*(#.*)*)\n/ "#\n" ] + +let directive = [ wskey alnum . params word . eol ] + +let section (name:string) = sec name (directive|comment)* + +let sections (body:lens) = sec "Directory" body + | sec "DirectoryMatch" body + | sec "Files" body + | sec "FilesMatch" body + | sec "Location" body + | sec "LocationMatch" body + | sec "AuthnProviderAlias" body + | sec "IfDefine" body + | sec "IfVersion" body + | sec "Limit" body + | sec "LimitExcept" body + | sec "Proxy" body + | sec "ProxyMatch" body + | sec "VirtualHost" body + | sec "IfModule" body + + +(* What we want ot say is *) +(* let rec body = (directive|comment)* | ifModule body | directory body | ... *) +(* but we can't typecheck that *) + +(* FIXME: *) +(* - Nesting of sections *) +let rec lns = (directive | comment | sections lns)* + +let filter = + incl "/etc/httpd/conf/httpd.conf" +let xfm = transform lns filter diff --git a/modules/plugins/apache/src/test/resources/httpd.conf b/modules/plugins/apache/src/test/resources/httpd.conf new file mode 100644 index 0000000..6cf9769 --- /dev/null +++ b/modules/plugins/apache/src/test/resources/httpd.conf @@ -0,0 +1,41 @@ +<VirtualHost 10.1.2.3> + ServerName www.example.com:80 + ServerAlias server server2.domain.com server2 + ServerAdmin www-admin@foo.example.com + DocumentRoot /home/fdrabek/Work + AddDefaultCharset utf-8 + Alias /image /ftp/pub/image + DefaultType image/gif + DirectoryIndex index.html index.txt /cgi-bin/index.pl + ErrorDocument 404 /cgi-bin/bad_urls.pl + Timeout 300 + Options Indexes FollowSymLinks + UseCanonicalName On + ErrorLog "|/usr/local/bin/httpd_errors" + CustomLog logs/access_log "%h %l %u %t \"%r\" %>s %b" + <Directory /usr/local/httpd/htdocs> + Order Deny,Allow + Allow from apache.org + Deny from all + AllowOverride AuthConfig Indexes + DefaultType image/gif + AddDefaultCharset utf-8 + DirectoryIndex index.html + ErrorDocument 403 "Sorry can't allow you access today" + Options +Includes -Indexes + UseCanonicalName DNS + <IfModule test.c> + Order Deny,Allow + Allow from apache.org + Deny from all + AllowOverride AuthConfig Indexes + DefaultType image/gif + AddDefaultCharset utf-8 + DirectoryIndex index.html + ErrorDocument 403 "Sorry can't allow you access today" + Options +Includes -Indexes + UseCanonicalName DNS + </IfModule> +</Directory> +Include included.conf +</VirtualHost> diff --git a/modules/plugins/apache/src/test/resources/included.conf b/modules/plugins/apache/src/test/resources/included.conf new file mode 100644 index 0000000..258f3f7 --- /dev/null +++ b/modules/plugins/apache/src/test/resources/included.conf @@ -0,0 +1,13 @@ +Include nested.conf +<Directory ~ "^/www/.*/[0-9]{3}"> + Order Deny,Allow + Allow from apache.org + Deny from all + AllowOverride AuthConfig Indexes + DefaultType image/gif + AddDefaultCharset utf-8 + DirectoryIndex index.html + ErrorDocument 403 "Sorry can't allow you access today" + Options +Includes -Indexes + UseCanonicalName DNS +</Directory> diff --git a/modules/plugins/apache/src/test/resources/loadconfig/Apache Virtual Host0 b/modules/plugins/apache/src/test/resources/loadconfig/Apache Virtual Host0 new file mode 100644 index 0000000..be5f4bc --- /dev/null +++ b/modules/plugins/apache/src/test/resources/loadconfig/Apache Virtual Host0 @@ -0,0 +1,2 @@ +<?xml version="1.0"?> +<configuration><simple name="ErrorLog">"|/usr/local/bin/httpd_errors"</simple><list name="CustomLog"><map name="CustomLog"><simple name="Destination">logs/access_log</simple><simple name="format">"%h %l %u %t "%r" %>s %b"</simple><simple name="_index">0</simple></map></list><simple name="ServerName">www.example.com:80</simple><list name="ServerAlias"><map name="ServerAlias"><simple name="hostname">server</simple><simple name="_index">0</simple></map><map name="ServerAlias"><simple name="hostname">server2.domain.com</simple><simple name="_index">0</simple></map><map name="ServerAlias"><simple name="hostname">server2</simple><simple name="_index">0</simple></map></list><simple name="ServerAdmin">www-admin@foo.example.com</simple><simple name="DocumentRoot">/home/fdrabek/Work</simple><simple name="AddDefaultCharset">utf-8</simple><list name="Alias"><map name="Alias"><simple name="URL">/image</simple><simple name="directory">/ftp/pub/image</simple></map></list><simple name="DefaultType">image/gif</simple><list name="DirectoryIndex"><map name="DirectoryIndex"><simple name="host">index.html</simple><simple name="_index">0</simple></map><map name="DirectoryIndex"><simple name="host">index.txt</simple><simple name="_index">0</simple></map><map name="DirectoryIndex"><simple name="host">/cgi-bin/index.pl</simple><simple name="_index">0</simple></map></list><list name="ErrorDocument"><map name="ErrorDocument"><simple name="responseCode">404</simple><simple name="document">/cgi-bin/bad_urls.pl</simple></map></list><simple name="Timeout">300</simple><list name="Options"><map name="Options"><simple name="Mode">Set</simple><simple name="Option">Indexes</simple><simple name="_index">0</simple></map><map name="Options"><simple name="Mode">Set</simple><simple name="Option">FollowSymLinks</simple><simple name="_index">0</simple></map></list><simple name="UseCanonicalName">On</simple><simple name="UseCanonicalPhysicalPort"/></configuration> \ No newline at end of file diff --git a/modules/plugins/apache/src/test/resources/loadconfig/Directory0 b/modules/plugins/apache/src/test/resources/loadconfig/Directory0 new file mode 100644 index 0000000..1c28e70 --- /dev/null +++ b/modules/plugins/apache/src/test/resources/loadconfig/Directory0 @@ -0,0 +1,2 @@ +<?xml version="1.0"?> +<configuration><list name="IfModules"/><simple name="Order">Deny,Allow</simple><list name="Allow"><map name="Allow"><simple name="host">apache.org</simple><simple name="_index">0</simple></map></list><list name="Deny"><map name="Deny"><simple name="host">all</simple><simple name="_index">0</simple></map></list><list name="AllowOverride"><map name="AllowOverride"><simple name="param">AuthConfig</simple><simple name="_index">0</simple></map><map name="AllowOverride"><simple name="param">Indexes</simple><simple name="_index">0</simple></map></list><simple name="AddDefaultCharset">utf-8</simple><simple name="DefaultType">image/gif</simple><list name="DirectoryIndex"><map name="DirectoryIndex"><simple name="host">index.html</simple><simple name="_index">0</simple></map></list><list name="ErrorDocument"><map name="ErrorDocument"><simple name="responseCode">403</simple><simple name="document">"Sorry can't allow you access today"</simple></map></list><list name="Options"><map name="Options"><simple name="Mode">Add</simple><simple name="Option">Includes</simple><simple name="_index">0</simple></map><map name="Options"><simple name="Mode">Remove</simple><simple name="Option">Indexes</simple><simple name="_index">0</simple></map></list><simple name="UseCanonicalName">DNS</simple><simple name="UseCanonicalPhysicalPort"/></configuration> \ No newline at end of file diff --git a/modules/plugins/apache/src/test/resources/loadconfig/Directory1 b/modules/plugins/apache/src/test/resources/loadconfig/Directory1 new file mode 100644 index 0000000..574fe20 --- /dev/null +++ b/modules/plugins/apache/src/test/resources/loadconfig/Directory1 @@ -0,0 +1,2 @@ +<?xml version="1.0"?> +<configuration><list name="IfModules"><map name="IfModule"><simple name="condition">"^/www/.*/[0-9]{3}"</simple></map></list><simple name="Order">Deny,Allow</simple><list name="Allow"><map name="Allow"><simple name="host">apache.org</simple><simple name="_index">0</simple></map></list><list name="Deny"><map name="Deny"><simple name="host">all</simple><simple name="_index">0</simple></map></list><list name="AllowOverride"><map name="AllowOverride"><simple name="param">AuthConfig</simple><simple name="_index">0</simple></map><map name="AllowOverride"><simple name="param">Indexes</simple><simple name="_index">0</simple></map></list><simple name="AddDefaultCharset">utf-8</simple><simple name="DefaultType">image/gif</simple><list name="DirectoryIndex"><map name="DirectoryIndex"><simple name="host">index.html</simple><simple name="_index">0</simple></map></list><list name="ErrorDocument"><map name="ErrorDocument"><simple name="responseCode">403</simple><simple name="document">"Sorry can't allow you access today"</simple></map></list><list name="Options"><map name="Options"><simple name="Mode">Add</simple><simple name="Option">Includes</simple><simple name="_index">0</simple></map><map name="Options"><simple name="Mode">Remove</simple><simple name="Option">Indexes</simple><simple name="_index">0</simple></map></list><simple name="UseCanonicalName">DNS</simple><simple name="UseCanonicalPhysicalPort"/></configuration> \ No newline at end of file diff --git a/modules/plugins/apache/src/test/resources/loadconfig/Directory2 b/modules/plugins/apache/src/test/resources/loadconfig/Directory2 new file mode 100644 index 0000000..574fe20 --- /dev/null +++ b/modules/plugins/apache/src/test/resources/loadconfig/Directory2 @@ -0,0 +1,2 @@ +<?xml version="1.0"?> +<configuration><list name="IfModules"><map name="IfModule"><simple name="condition">"^/www/.*/[0-9]{3}"</simple></map></list><simple name="Order">Deny,Allow</simple><list name="Allow"><map name="Allow"><simple name="host">apache.org</simple><simple name="_index">0</simple></map></list><list name="Deny"><map name="Deny"><simple name="host">all</simple><simple name="_index">0</simple></map></list><list name="AllowOverride"><map name="AllowOverride"><simple name="param">AuthConfig</simple><simple name="_index">0</simple></map><map name="AllowOverride"><simple name="param">Indexes</simple><simple name="_index">0</simple></map></list><simple name="AddDefaultCharset">utf-8</simple><simple name="DefaultType">image/gif</simple><list name="DirectoryIndex"><map name="DirectoryIndex"><simple name="host">index.html</simple><simple name="_index">0</simple></map></list><list name="ErrorDocument"><map name="ErrorDocument"><simple name="responseCode">403</simple><simple name="document">"Sorry can't allow you access today"</simple></map></list><list name="Options"><map name="Options"><simple name="Mode">Add</simple><simple name="Option">Includes</simple><simple name="_index">0</simple></map><map name="Options"><simple name="Mode">Remove</simple><simple name="Option">Indexes</simple><simple name="_index">0</simple></map></list><simple name="UseCanonicalName">DNS</simple><simple name="UseCanonicalPhysicalPort"/></configuration> \ No newline at end of file diff --git a/modules/plugins/apache/src/test/resources/loadconfig/IfModule Parameters0 b/modules/plugins/apache/src/test/resources/loadconfig/IfModule Parameters0 new file mode 100644 index 0000000..88bebc2 --- /dev/null +++ b/modules/plugins/apache/src/test/resources/loadconfig/IfModule Parameters0 @@ -0,0 +1,2 @@ +<?xml version="1.0"?> +<configuration><list name="IfModules"><map name="IfModule"><simple name="condition">test.c</simple></map></list><simple name="Order">Deny,Allow</simple><list name="Allow"><map name="Allow"><simple name="host">apache.org</simple><simple name="_index">0</simple></map></list><list name="Deny"><map name="Deny"><simple name="host">all</simple><simple name="_index">0</simple></map></list><list name="AllowOverride"><map name="AllowOverride"><simple name="param">AuthConfig</simple><simple name="_index">0</simple></map><map name="AllowOverride"><simple name="param">Indexes</simple><simple name="_index">0</simple></map></list><simple name="AddDefaultCharset">utf-8</simple><simple name="DefaultType">image/gif</simple><list name="DirectoryIndex"><map name="DirectoryIndex"><simple name="host">index.html</simple><simple name="_index">0</simple></map></list><list name="ErrorDocument"><map name="ErrorDocument"><simple name="responseCode">403</simple><simple name="document">"Sorry can't allow you access today"</simple></map></list><list name="Options"><map name="Options"><simple name="Mode">Add</simple><simple name="Option">Includes</simple><simple name="_index">0</simple></map><map name="Options"><simple name="Mode">Remove</simple><simple name="Option">Indexes</simple><simple name="_index">0</simple></map></list><simple name="UseCanonicalName">DNS</simple><simple name="UseCanonicalPhysicalPort"/></configuration> \ No newline at end of file diff --git a/modules/plugins/apache/src/test/resources/loadconfig/IfModule0 b/modules/plugins/apache/src/test/resources/loadconfig/IfModule0 new file mode 100644 index 0000000..823aee3 --- /dev/null +++ b/modules/plugins/apache/src/test/resources/loadconfig/IfModule0 @@ -0,0 +1,2 @@ +<?xml version="1.0"?> +<configuration><list name="IfModules"><map name="IfModule"><simple name="condition">test2.c</simple></map></list><simple name="Order">Deny,Allow</simple><list name="Allow"><map name="Allow"><simple name="host">apache.org</simple><simple name="_index">0</simple></map></list><list name="Deny"><map name="Deny"><simple name="host">all</simple><simple name="_index">0</simple></map></list><list name="AllowOverride"><map name="AllowOverride"><simple name="param">AuthConfig</simple><simple name="_index">0</simple></map><map name="AllowOverride"><simple name="param">Indexes</simple><simple name="_index">0</simple></map></list><simple name="AddDefaultCharset">utf-8</simple><simple name="DefaultType">image/gif</simple><list name="DirectoryIndex"><map name="DirectoryIndex"><simple name="host">index.html</simple><simple name="_index">0</simple></map></list><list name="ErrorDocument"><map name="ErrorDocument"><simple name="responseCode">403</simple><simple name="document">"Sorry can't allow you access today"</simple></map></list><list name="Options"><map name="Options"><simple name="Mode">Add</simple><simple name="Option">Includes</simple><simple name="_index">0</simple></map><map name="Options"><simple name="Mode">Remove</simple><simple name="Option">Indexes</simple><simple name="_index">0</simple></map></list><simple name="UseCanonicalName">DNS</simple><simple name="UseCanonicalPhysicalPort"/></configuration> \ No newline at end of file diff --git a/modules/plugins/apache/src/test/resources/loadconfig/IfModule1 b/modules/plugins/apache/src/test/resources/loadconfig/IfModule1 new file mode 100644 index 0000000..823aee3 --- /dev/null +++ b/modules/plugins/apache/src/test/resources/loadconfig/IfModule1 @@ -0,0 +1,2 @@ +<?xml version="1.0"?> +<configuration><list name="IfModules"><map name="IfModule"><simple name="condition">test2.c</simple></map></list><simple name="Order">Deny,Allow</simple><list name="Allow"><map name="Allow"><simple name="host">apache.org</simple><simple name="_index">0</simple></map></list><list name="Deny"><map name="Deny"><simple name="host">all</simple><simple name="_index">0</simple></map></list><list name="AllowOverride"><map name="AllowOverride"><simple name="param">AuthConfig</simple><simple name="_index">0</simple></map><map name="AllowOverride"><simple name="param">Indexes</simple><simple name="_index">0</simple></map></list><simple name="AddDefaultCharset">utf-8</simple><simple name="DefaultType">image/gif</simple><list name="DirectoryIndex"><map name="DirectoryIndex"><simple name="host">index.html</simple><simple name="_index">0</simple></map></list><list name="ErrorDocument"><map name="ErrorDocument"><simple name="responseCode">403</simple><simple name="document">"Sorry can't allow you access today"</simple></map></list><list name="Options"><map name="Options"><simple name="Mode">Add</simple><simple name="Option">Includes</simple><simple name="_index">0</simple></map><map name="Options"><simple name="Mode">Remove</simple><simple name="Option">Indexes</simple><simple name="_index">0</simple></map></list><simple name="UseCanonicalName">DNS</simple><simple name="UseCanonicalPhysicalPort"/></configuration> \ No newline at end of file diff --git a/modules/plugins/apache/src/test/resources/nested.conf b/modules/plugins/apache/src/test/resources/nested.conf new file mode 100644 index 0000000..9068fde --- /dev/null +++ b/modules/plugins/apache/src/test/resources/nested.conf @@ -0,0 +1,12 @@ + <IfModule test2.c> + Order Deny,Allow + Allow from apache.org + Deny from all + AllowOverride AuthConfig Indexes + DefaultType image/gif + AddDefaultCharset utf-8 + DirectoryIndex index.html + ErrorDocument 403 "Sorry can't allow you access today" + Options +Includes -Indexes + UseCanonicalName DNS + </IfModule> diff --git a/modules/plugins/apache/src/test/resources/updateconfig/httpd.aug b/modules/plugins/apache/src/test/resources/updateconfig/httpd.aug new file mode 100644 index 0000000..12c3205 --- /dev/null +++ b/modules/plugins/apache/src/test/resources/updateconfig/httpd.aug @@ -0,0 +1,58 @@ +module Httpd = + autoload xfm + +(* Helpers *) + +(* Newlines can be escaped. *) +let sep = del /([ \t]+(\\\n)?)+/ " " +let eol = del /([ \t]*(\\\n)?)*\n/ "\n" + let del_str (s:string) = del s s +let ws = /[ \t]*/ +let alnum = /[a-zA-Z0-9_]+/ +(* the last character in the non-quoted word must not be a backslash. I guess this is not completely semantically + correct but at the same time, apache discourages to use backslashes for anything else than + line breaking so we should be safe here. This restriction is in place to support + escaped new lines in the sep and eol rules. *) +let word = /"([^"\n]|\\")*"|'([^'\n]|\\')*'|[^'" \t\n]*[^'" \t\n\]/ +let secarg = /"([^"\n]|\\")*"|'([^'\n]|\\')*'|[^'" \t\n>]+/ +let wskey (k:regexp) = del ws "" . key k +let params (param:regexp) = [ sep . label "param" . store param ]* +let sec (name:string) (body:lens) = + [ wskey ("<" . name) . params secarg . del_str ">" . eol . + body . del ws "" . del_str("</" . name . ">") . eol ] + +(* Definitions *) +let comment = [ del /([ \t]*(#.*)*)\n/ "#\n" ] + +let directive = [ wskey alnum . params word . eol ] + +let section (name:string) = sec name (directive|comment)* + +let sections (body:lens) = sec "Directory" body + | sec "DirectoryMatch" body + | sec "Files" body + | sec "FilesMatch" body + | sec "Location" body + | sec "LocationMatch" body + | sec "AuthnProviderAlias" body + | sec "IfDefine" body + | sec "IfVersion" body + | sec "Limit" body + | sec "LimitExcept" body + | sec "Proxy" body + | sec "ProxyMatch" body + | sec "VirtualHost" body + | sec "IfModule" body + + +(* What we want ot say is *) +(* let rec body = (directive|comment)* | ifModule body | directory body | ... *) +(* but we can't typecheck that *) + +(* FIXME: *) +(* - Nesting of sections *) +let rec lns = (directive | comment | sections lns)* + +let filter = + incl "/etc/httpd/conf/httpd.conf" +let xfm = transform lns filter diff --git a/modules/plugins/apache/src/test/resources/updateconfig/httpd.conf b/modules/plugins/apache/src/test/resources/updateconfig/httpd.conf new file mode 100644 index 0000000..75342e6 --- /dev/null +++ b/modules/plugins/apache/src/test/resources/updateconfig/httpd.conf @@ -0,0 +1,10 @@ +<VirtualHost 10.1.2.3> + ServerName www.example.com:80 + <Directory /usr/local/httpd/htdocs> + Order Deny,Allow + <IfModule test.c> + Order Deny,Allow + </IfModule> +</Directory> +Include included.conf +</VirtualHost> diff --git a/modules/plugins/apache/src/test/resources/updateconfig/included.conf b/modules/plugins/apache/src/test/resources/updateconfig/included.conf new file mode 100644 index 0000000..4aa2557 --- /dev/null +++ b/modules/plugins/apache/src/test/resources/updateconfig/included.conf @@ -0,0 +1,4 @@ +Include nested.conf +<Directory ~ "^/www/.*/[0-9]{3}"> + Order Deny,Allow +</Directory> diff --git a/modules/plugins/apache/src/test/resources/updateconfig/nested.conf b/modules/plugins/apache/src/test/resources/updateconfig/nested.conf new file mode 100644 index 0000000..eb10dba --- /dev/null +++ b/modules/plugins/apache/src/test/resources/updateconfig/nested.conf @@ -0,0 +1,3 @@ + <IfModule test2.c> + UseCanonicalName DNS + </IfModule>
commit 02213a76c3a6df5ffef0ee09848c77bf6d4d1463 Author: Joseph Marques joseph@redhat.com Date: Fri Jul 16 03:05:09 2010 -0400
BZ-614845: ensure that the form is submitted after the ajax-selection completes
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/alert/notification/details.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/alert/notification/details.xhtml index d64cc27..51ca4f7 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/alert/notification/details.xhtml +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/alert/notification/details.xhtml @@ -78,7 +78,7 @@ ignoreDupResponses="true" requestDelay="25" status="commonStatus" - onsubmit="getElementCrossBrowser('notificationListForm:refreshButton').click();" + oncomplete="getElementCrossBrowser('notificationListForm:refreshButton').click();" /> ui:remove <a4j:support event="onkeyup"
commit 2a78542b7a9f055c71eab0d1e3a9f0d7c917ee31 Author: Joseph Marques joseph@redhat.com Date: Fri Jul 16 01:42:31 2010 -0400
BZ-614886: fix permissions necessary for resource/plugin configuration updates
* historic/auditing data should not requires permission above and beyond the ability to view the corresponding resource to which that data is attached
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationManagerBean.java index 1652b0b..2e6198d 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationManagerBean.java @@ -846,13 +846,6 @@ public class ConfigurationManagerBean implements ConfigurationManagerLocal, Conf public PageList<ResourceConfigurationUpdate> findResourceConfigurationUpdates(Subject subject, Integer resourceId, Long beginDate, Long endDate, boolean suppressOldest, PageControl pc) {
- if (!authorizationManager.hasResourcePermission(subject, Permission.CONFIGURE, resourceId)) { - throw new PermissionException("User [" + subject.getName() - + "] does not have permission to manage configuration for resource[id=" + resourceId + "]"); - } - - Resource resource = entityManager.find(Resource.class, resourceId); - // TODO (ips, 04/01/10): Our id's are not guaranteed to be sequential, because our sequences are configured to // pre-create and cache blocks of 10 sequence id's, so it may be better to order by // "cu.createdTime", rather than "cu.id". @@ -893,11 +886,6 @@ public class ConfigurationManagerBean implements ConfigurationManagerLocal, Conf public PluginConfigurationUpdate getPluginConfigurationUpdate(Subject subject, int configurationUpdateId) { PluginConfigurationUpdate update = entityManager.find(PluginConfigurationUpdate.class, configurationUpdateId);
- if (!authorizationManager.canViewResource(subject, update.getResource().getId())) { - throw new PermissionException("User [" + subject.getName() - + "] does not have permission to view plugin configuration update for [" + update.getResource() + "]"); - } - update.getConfiguration(); // this is EAGER loaded, so this really doesn't do anything
return update;
commit 66cea973deee5ab37431f1b57a461201ade18143 Author: Joseph Marques joseph@redhat.com Date: Fri Jul 16 01:30:14 2010 -0400
don't try to reload the data page upon authorization failures, just let it bubble up
diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/common/paging/PagedListDataModel.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/common/paging/PagedListDataModel.java index 0b1614f..015fdf7 100644 --- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/common/paging/PagedListDataModel.java +++ b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/common/paging/PagedListDataModel.java @@ -31,6 +31,7 @@ import org.rhq.core.gui.util.FacesContextUtility; import org.rhq.enterprise.gui.common.framework.PagedDataTableUIBean; import org.rhq.enterprise.gui.legacy.WebUser; import org.rhq.enterprise.gui.util.EnterpriseFacesContextUtility; +import org.rhq.enterprise.server.authz.PermissionException; import org.rhq.enterprise.server.util.HibernatePerformanceMonitor;
/** @@ -358,6 +359,8 @@ public abstract class PagedListDataModel<T> extends DataModel { } tryQueryAgain = true; } + } catch (PermissionException pe) { + throw pe; // don't try to reload the data page upon authorization failures, just let it bubble up } catch (Throwable t) { /* * known issues during pagination:
commit c46419d2cf68dd168c4a29371af4a0713c6f8df0 Author: Joseph Marques joseph@redhat.com Date: Thu Jul 15 23:41:52 2010 -0400
remove unnecessary debugging constructs
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestTextBox_v3.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestTextBox_v3.java index 0cd5f71..c14127b 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestTextBox_v3.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestTextBox_v3.java @@ -64,7 +64,6 @@ import org.rhq.core.domain.search.SearchSuggestion.Kind; import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup; import org.rhq.enterprise.gui.coregui.client.gwt.SearchGWTServiceAsync; import org.rhq.enterprise.gui.coregui.client.search.SearchBar; -import org.rhq.enterprise.gui.coregui.client.search.SearchLogger;
public class SuggestTextBox_v3 extends Composite implements HasText, HasAllFocusHandlers, HasValue<String>, HasSelectionHandlers<Suggestion> { @@ -512,8 +511,6 @@ public class SuggestTextBox_v3 extends Composite implements HasText, HasAllFocus String decoratedSuffix = wrap(highlightedSuggestion, "float: left; "); String floatClear = "<br style="clear: both;" />";
- SearchLogger.debug("decoratedSuffix: " + decoratedSuffix); - String innerHTML = decoratedPrefix + decoratedSuffix + floatClear; return innerHTML; } @@ -532,8 +529,6 @@ public class SuggestTextBox_v3 extends Composite implements HasText, HasAllFocus } }
- SearchLogger.debug("results: " + results); - return results.toString(); }
@@ -556,8 +551,6 @@ public class SuggestTextBox_v3 extends Composite implements HasText, HasAllFocus words.add(builder.toString()); }
- SearchLogger.debug("words: " + words); - return words; }
commit 42401c0e7be08f80ca8b627359eb39e85b3f6e3f Author: Joseph Marques joseph@redhat.com Date: Thu Jul 15 23:40:26 2010 -0400
BZ-612739: use more sophisticated highlighting mechanism that respects line breaks
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestTextBox_v3.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestTextBox_v3.java index 0b9ac6c..0cd5f71 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestTextBox_v3.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestTextBox_v3.java @@ -18,6 +18,7 @@ */ package org.rhq.enterprise.gui.coregui.client.search.suggest;
+import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.List; @@ -63,6 +64,7 @@ import org.rhq.core.domain.search.SearchSuggestion.Kind; import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup; import org.rhq.enterprise.gui.coregui.client.gwt.SearchGWTServiceAsync; import org.rhq.enterprise.gui.coregui.client.search.SearchBar; +import org.rhq.enterprise.gui.coregui.client.search.SearchLogger;
public class SuggestTextBox_v3 extends Composite implements HasText, HasAllFocusHandlers, HasValue<String>, HasSelectionHandlers<Suggestion> { @@ -502,14 +504,16 @@ public class SuggestTextBox_v3 extends Composite implements HasText, HasAllFocus } }
- String decoratedPrefix = decorate(prefix, style); + String decoratedPrefix = wrap(prefix, style); String formattedItemLabel = chopWithEvery(item.getLabel(), "<br/>", 100); String decoratedItemLabel = decorate(formattedItemLabel, "background-color: yellow;", item.getStartIndex(), item.getEndIndex()); String highlightedSuggestion = colorOperator(decoratedItemLabel); - String decoratedSuffix = decorate(highlightedSuggestion, "float: left; "); + String decoratedSuffix = wrap(highlightedSuggestion, "float: left; "); String floatClear = "<br style="clear: both;" />";
+ SearchLogger.debug("decoratedSuffix: " + decoratedSuffix); + String innerHTML = decoratedPrefix + decoratedSuffix + floatClear; return innerHTML; } @@ -575,10 +579,11 @@ public class SuggestTextBox_v3 extends Composite implements HasText, HasAllFocus return data; }
- private static String decorate(String data, String style) { - return decorate(data, style, 0, data.length()); + private static String wrap(String data, String style) { + return "<span style="" + style + "">" + data + "</span>"; }
+ /* private static String decorate(String data, String style, int startIndex, int endIndex) { if (startIndex == -1) { return data; // no match @@ -588,6 +593,69 @@ public class SuggestTextBox_v3 extends Composite implements HasText, HasAllFocus String after = data.substring(endIndex); return before + "<span style="" + style + "">" + highlight + "</span>" + after; } + */ + + private static String decorate(String data, String style, int startIndex, int endIndex) { + if (startIndex == -1 || (startIndex == endIndex)) { + return data; // no match or zero-width match + } + + String[] words = data.split("<br/>"); + int counter = 0; + int wordIndex = 0; + int letterIndex = 0; + + StringBuilder results = new StringBuilder(); + while (counter < startIndex) { + if (wordIndex == words.length) { + break; + } + + if (letterIndex < words[wordIndex].length()) { // more letters left in the current word? + results.append(words[wordIndex].charAt(letterIndex)); // append the next char of the current word + letterIndex++; // move to the next char in the current word + counter++; // only move counter forward when we've added non-BR chars to the results + } else { // next word + results.append("<br/>"); // put the break point back in between words + letterIndex = 0; // point to the first char + wordIndex++; // of the next word + } + } + + // we're at start index, wrap all words and word fragments in the specified style up to endIndex + results.append("<span style="" + style + "">"); // seed action + while (counter < endIndex) { + if (wordIndex == words.length) { + break; + } + + if (letterIndex < words[wordIndex].length()) { // more letters left in the current word? + results.append(words[wordIndex].charAt(letterIndex)); // append the next char of the current word + letterIndex++; // move to the next char in the current word + counter++; // only move counter forward when we've added non-BR chars to the results + } else { // next word + results.append("</span>"); // close the previous word, we don't highlight breaks + results.append("<br/>"); // put the break point back in between words + letterIndex = 0; // point to the first char + wordIndex++; // of the next word + results.append("<span style="" + style + "">"); // prepare for next word + } + } + results.append("</span>"); // end last dangling span + + // append the rest of the current word fragment, if any + if (wordIndex != words.length) { + results.append(words[wordIndex].substring(letterIndex)); + } + + // append the rest of the words + while (++wordIndex < words.length) { + results.append("<br/>"); // put the break point back in between words + results.append(words[wordIndex]); + } + + return results.toString(); + } }
class SearchSuggestOracle extends SuggestOracle {
commit a3fa5d55e6d8a64eca20348e00270a529bbab8a0 Author: Joseph Marques joseph@redhat.com Date: Thu Jul 15 23:39:41 2010 -0400
BZ-612739: ensure that search suggestions never overflow drop-down boundaries
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestTextBox_v3.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestTextBox_v3.java index bce49e4..0b9ac6c 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestTextBox_v3.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestTextBox_v3.java @@ -503,7 +503,7 @@ public class SuggestTextBox_v3 extends Composite implements HasText, HasAllFocus }
String decoratedPrefix = decorate(prefix, style); - String formattedItemLabel = chopWithEvery(item.getLabel(), "<br/>", 110); + String formattedItemLabel = chopWithEvery(item.getLabel(), "<br/>", 100); String decoratedItemLabel = decorate(formattedItemLabel, "background-color: yellow;", item.getStartIndex(), item.getEndIndex()); String highlightedSuggestion = colorOperator(decoratedItemLabel); @@ -514,21 +514,49 @@ public class SuggestTextBox_v3 extends Composite implements HasText, HasAllFocus return innerHTML; }
- private static String chopWithEvery(String chop, String with, int every) { - String[] words = chop.split("\s"); + private static String chopWithEvery(String toChop, String with, int every) { + //String[] words = toChop.split("\s"); + List<String> words = chop(toChop, "\/- \t\r\n"); StringBuilder results = new StringBuilder(); int currentLineLength = 0; for (String next : words) { + results.append(next); + currentLineLength += next.length(); if (currentLineLength + next.length() > every) { results.append(with); currentLineLength = 0; } - results.append(next).append(' '); - currentLineLength += (next.length() + 1); } + + SearchLogger.debug("results: " + results); + return results.toString(); }
+ // StringTokenzier doesn't exist in GWT, so have to write my own + private static List<String> chop(String dataToChop, String chopTokens) { + List<String> words = new ArrayList<String>(); + + StringBuilder builder = new StringBuilder(); + for (char next : dataToChop.toCharArray()) { + if (chopTokens.indexOf(next) != -1) { + if (builder.length() > 0) { + words.add(builder.toString()); + builder = new StringBuilder(); + } + } + builder.append(next); + } + + if (builder.length() > 0) { + words.add(builder.toString()); + } + + SearchLogger.debug("words: " + words); + + return words; + } + private static final List<String> OPERATORS = Arrays.asList("!==", "!=", "==", "=");
// TODO: fixing coloring strategy
commit f6888c317f7ed944379841efe9225a948a898bef Author: Joseph Marques joseph@redhat.com Date: Thu Jul 15 23:37:33 2010 -0400
parenthesize saved search results counts on all screens
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/favorites/SavedSearchGrid.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/favorites/SavedSearchGrid.java index ee7647b..c250f7c 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/favorites/SavedSearchGrid.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/favorites/SavedSearchGrid.java @@ -140,7 +140,7 @@ public class SavedSearchGrid extends Grid { private static String stylize(SavedSearch savedSearch) { String name = savedSearch.getName(); String pattern = savedSearch.getPattern(); - String count = savedSearch.getResultCount() == null ? "" : String.valueOf(savedSearch.getResultCount()); + String count = savedSearch.getResultCount() == null ? "" : "(" + savedSearch.getResultCount() + ")"; return "<span class="savedSearchesPanel-top">" + name + "</span> " + count + "<br/>" // + "<span class="savedSearchesPanel-bottom">" + pattern + "</span>"; }
commit 9abb570c9e6be87cc6aed9209a0e76adb671ae9a Author: John Mazzitelli mazz@redhat.com Date: Thu Jul 15 18:52:29 2010 -0400
BZ 535784 - pass in -e argument to readlink to support the "double linked" problem where rc.3.d has a symlink to init.d which in turn is a symlink to rhq-agent-wrapper.sh. Need -e so readlink recursively walks the symlinks to reach the actual script file
diff --git a/modules/enterprise/agent/src/etc/rhq-agent-wrapper.sh b/modules/enterprise/agent/src/etc/rhq-agent-wrapper.sh index ee714a9..2bb861c 100755 --- a/modules/enterprise/agent/src/etc/rhq-agent-wrapper.sh +++ b/modules/enterprise/agent/src/etc/rhq-agent-wrapper.sh @@ -94,12 +94,34 @@ prepare_pid_dir () fi }
+# ---------------------------------------------------------------------- +# Determine what specific platform we are running on. +# Set some platform-specific variables. + +case "`uname`" in + CYGWIN*) _CYGWIN=true + ;; + Linux*) _LINUX=true + ;; + Darwin*) _DARWIN=true + ;; + SunOS*) _SOLARIS=true + ;; + AIX*) _AIX=true + ;; +esac + # ------------------------------- # Get the location of this script. # Make sure we take into account the possibility $0 # is a symlink to the real agent installation script. +# Only certain platforms support the -e option of readlink + +if [ "x${_LINUX}${_SOLARIS}${_CYGWIN}" != "x" ]; then + _READLINK_ARG="-e" +fi
-_DOLLARZERO=`readlink "$0" || echo "$0"` +_DOLLARZERO=`readlink $_READLINK_ARG "$0" 2>/dev/null|| echo "$0"` RHQ_AGENT_WRAPPER_BIN_DIR_PATH=`dirname "$_DOLLARZERO"` debug_wrapper_msg "RHQ_AGENT_WRAPPER_BIN_DIR_PATH=$RHQ_AGENT_WRAPPER_BIN_DIR_PATH"
diff --git a/modules/enterprise/agent/src/etc/rhq-agent.sh b/modules/enterprise/agent/src/etc/rhq-agent.sh index 8ef0625..e0122bd 100755 --- a/modules/enterprise/agent/src/etc/rhq-agent.sh +++ b/modules/enterprise/agent/src/etc/rhq-agent.sh @@ -34,6 +34,7 @@ debug_msg () # ---------------------------------------------------------------------- # Try to determine the fallback JAVA_HOME if not already set # ---------------------------------------------------------------------- + set_java_home () { if [ "x$JAVA_HOME" = "x" ]; then @@ -56,6 +57,7 @@ set_java_home () # Determine what specific platform we are running on. # Set some platform-specific variables. # ---------------------------------------------------------------------- + case "`uname`" in CYGWIN*) _CYGWIN=true ;; @@ -63,6 +65,10 @@ case "`uname`" in ;; Darwin*) _DARWIN=true ;; + SunOS*) _SOLARIS=true + ;; + AIX*) _AIX=true + ;; esac
case "`uname -m`" in @@ -76,7 +82,13 @@ esac # We also assume our custom environment script is located in the same # place as this script. # ---------------------------------------------------------------------- -_DOLLARZERO=`readlink "$0" 2>/dev/null || echo "$0"` + +if [ "x${_LINUX}${_SOLARIS}${_CYGWIN}" != "x" ]; then + # only certain platforms support the -e argument for readlink + _READLINK_ARG="-e" +fi + +_DOLLARZERO=`readlink $_READLINK_ARG "$0" 2>/dev/null || echo "$0"` RHQ_AGENT_BIN_DIR_PATH=`dirname "$_DOLLARZERO"`
if [ -f "${RHQ_AGENT_BIN_DIR_PATH}/rhq-agent-env.sh" ]; then diff --git a/modules/enterprise/server/container/src/main/bin-resources/bin/rhq-server.sh b/modules/enterprise/server/container/src/main/bin-resources/bin/rhq-server.sh index 9179850..bbef0bf 100644 --- a/modules/enterprise/server/container/src/main/bin-resources/bin/rhq-server.sh +++ b/modules/enterprise/server/container/src/main/bin-resources/bin/rhq-server.sh @@ -178,12 +178,14 @@ remove_pid_files () case "`uname`" in CYGWIN*) _CYGWIN=true ;; + Linux*) _LINUX=true + ;; Darwin*) _DARWIN=true ;; SunOS*) _SOLARIS=true ;; - AIX*) _AIX=true - ;; + AIX*) _AIX=true + ;; esac
# ---------------------------------------------------------------------- @@ -193,7 +195,11 @@ esac # ----------------------------------------------------------------------
if [ -z "$RHQ_SERVER_HOME" ]; then - _DOLLARZERO=`readlink "$0" 2>/dev/null || echo "$0"` + if [ "x${_LINUX}${_SOLARIS}${_CYGWIN}" != "x" ]; then + # only certain platforms support the -e argument for readlink + _READLINK_ARG="-e" + fi + _DOLLARZERO=`readlink $_READLINK_ARG "$0" 2>/dev/null || echo "$0"` RHQ_SERVER_HOME=`dirname "$_DOLLARZERO"`/.. else if [ ! -d "$RHQ_SERVER_HOME" ]; then
commit 97f5d79977dbf38d027b1377b91d97c257da9256 Author: Joseph Marques joseph@redhat.com Date: Thu Jul 15 16:20:36 2010 -0400
fix the highlighting strategy to respect ^ and $ boundary characters
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java index e721cb4..92138bf 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java @@ -643,9 +643,21 @@ public class SearchAssistManager {
private List<SearchSuggestion> convert(List<String> suggestions, ParsedContext parsed, String term, Kind kind) { int startIndex = getStartIndex(parsed); + LOG.debug("convert(suggestions.size()=" + suggestions.size() + ", " + parsed + ", " + term + ", " + kind + ")"); term = term.toLowerCase(); List<SearchSuggestion> results = new ArrayList<SearchSuggestion>(suggestions.size()); for (String suggestion : suggestions) { + boolean startBounded = term.startsWith("^"); + boolean endBounded = term.endsWith("$"); + + if (startBounded && endBounded) { + term = term.substring(1, term.length() - 1); + } else if (startBounded) { + term = term.substring(1); + } else if (endBounded) { + term = term.substring(0, term.length() - 1); + } + int index = suggestion.toLowerCase().indexOf(term, startIndex); results.add(new SearchSuggestion(kind, suggestion, index, term.length())); }
commit acffdbd990b59dd1a87d602a645d18481927f1b8 Author: John Mazzitelli mazz@redhat.com Date: Thu Jul 15 16:20:57 2010 -0400
redirect error stream of readlink to dev/null when starting standalone pc
diff --git a/etc/standalone-pc/standalone.sh b/etc/standalone-pc/standalone.sh index 29fd40f..d8ffef6 100755 --- a/etc/standalone-pc/standalone.sh +++ b/etc/standalone-pc/standalone.sh @@ -1,6 +1,6 @@ #!/bin/sh
-_DOLLARZERO=`readlink "$0" || echo "$0"` +_DOLLARZERO=`readlink "$0" 2>/dev/null || echo "$0"` RHQ_AGENT_BIN_DIR_PATH=`dirname "$_DOLLARZERO"` RHQ_AGENT_MAINCLASS=org.rhq.core.pc.StandaloneContainer export RHQ_AGENT_MAINCLASS
commit d687058c983156b48098986b1a896daec4ca6143 Author: John Mazzitelli mazz@redhat.com Date: Thu Jul 15 16:20:37 2010 -0400
remove the chkconfig headers - its a copy-paste from the server script - doesn't make sense to have it here in the generate db passwd script
diff --git a/modules/enterprise/server/container/src/main/bin-resources/bin/generate-db-password.sh b/modules/enterprise/server/container/src/main/bin-resources/bin/generate-db-password.sh index e436d87..1d464d7 100755 --- a/modules/enterprise/server/container/src/main/bin-resources/bin/generate-db-password.sh +++ b/modules/enterprise/server/container/src/main/bin-resources/bin/generate-db-password.sh @@ -1,10 +1,5 @@ #!/bin/sh
-# chkconfig: 2345 92 26 -# description: Starts and stops the RHQ Server -# -# processname: java - # ============================================================================= # RHQ Server UNIX Generate db password script #
commit 627f6b03c8dc03946d6dc750699e445ce769dabf Author: Joseph Marques joseph@redhat.com Date: Thu Jul 15 15:33:48 2010 -0400
only add fragments to the generation suggestion-JPQL as necessary
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/AbstractSearchAssistant.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/AbstractSearchAssistant.java index 87e10a5..94a2bd5 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/AbstractSearchAssistant.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/AbstractSearchAssistant.java @@ -1,5 +1,7 @@ package org.rhq.enterprise.server.search.assist;
+import static org.rhq.enterprise.server.search.common.SearchQueryGenerationUtility.getJPQLForString; + import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -12,7 +14,6 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory;
import org.rhq.enterprise.server.util.LookupUtil; -import org.rhq.enterprise.server.util.QueryUtility;
public abstract class AbstractSearchAssistant implements SearchAssistant {
@@ -95,11 +96,12 @@ public abstract class AbstractSearchAssistant implements SearchAssistant { return results; }
- protected final String add(String fragment, String parameter) { - if (parameter != null && !parameter.equals("")) { - return fragment; + protected final String conditionallyAddJPQLString(String fragment, String filter) { + if (filter == null || filter.equals("")) { + return ""; } - return ""; + + return " AND " + getJPQLForString(fragment, filter); }
protected final List<String> filter(Class<? extends Enum<?>> enumType, String filter) { @@ -145,10 +147,6 @@ public abstract class AbstractSearchAssistant implements SearchAssistant { return "'" + data + "'"; }
- protected final String escape(String data) { - return QueryUtility.escapeSearchParameter(data); - } - protected final String getFormatterValueFragment(String data) { boolean hasWhitespace = false; for (char next : data.toCharArray()) { diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/GroupSearchAssistant.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/GroupSearchAssistant.java index b4c3069..be85fc5 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/GroupSearchAssistant.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/GroupSearchAssistant.java @@ -1,7 +1,5 @@ package org.rhq.enterprise.server.search.assist;
-import static org.rhq.enterprise.server.search.common.SearchQueryGenerationUtility.getJPQLForString; - import java.util.Arrays; import java.util.Collections; import java.util.List; @@ -64,8 +62,8 @@ public class GroupSearchAssistant extends TabAwareSearchAssistant { + " FROM ResourceType type, ResourceGroup rg " // + " WHERE rg.resourceType = type " // only suggest names that exist for visible groups in inventory + " AND rg.visible = true " // - + " AND " + getJPQLForString("type.name", filter) // - + " AND " + getJPQLForString("rg.groupCategory", tab) // + + conditionallyAddJPQLString("type.name", filter) // + + conditionallyAddJPQLString("rg.groupCategory", tab) // + " ORDER BY type.name ");
} else if (context.equals("plugin")) { @@ -74,8 +72,8 @@ public class GroupSearchAssistant extends TabAwareSearchAssistant { + " FROM ResourceType type, ResourceGroup rg " // + " WHERE rg.resourceType = type " // only suggest names that exist for visible groups in inventory + " AND rg.visible = true " // - + " AND " + getJPQLForString("type.plugin", filter) // - + " AND " + getJPQLForString("rg.groupCategory", tab) // + + conditionallyAddJPQLString("type.plugin", filter) // + + conditionallyAddJPQLString("rg.groupCategory", tab) // + " ORDER BY type.plugin ");
} else if (context.equals("name")) { @@ -83,8 +81,8 @@ public class GroupSearchAssistant extends TabAwareSearchAssistant { + "SELECT DISTINCT rg.name " // + " FROM ResourceGroup rg " // + " WHERE rg.visible = true " // only suggest names that exist for visible groups in inventory - + " AND " + getJPQLForString("rg.name", filter) // - + " AND " + getJPQLForString("rg.groupCategory", tab) // + + conditionallyAddJPQLString("rg.name", filter) // + + conditionallyAddJPQLString("rg.groupCategory", tab) // + " ORDER BY rg.name ");
} else { diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/ResourceSearchAssistant.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/ResourceSearchAssistant.java index e0560bf..671095f 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/ResourceSearchAssistant.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/ResourceSearchAssistant.java @@ -1,7 +1,5 @@ package org.rhq.enterprise.server.search.assist;
-import static org.rhq.enterprise.server.search.common.SearchQueryGenerationUtility.getJPQLForString; - import java.util.Arrays; import java.util.Collections; import java.util.List; @@ -69,8 +67,8 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant { + " WHERE res.resourceType = type " // only suggest names that exist for resources in inventory + " AND simpleDefinition = definition " // only suggest names for simple properties + " AND simpleDefinition.type <> 'PASSWORD' " // do not suggest hidden/password property types - + " AND " + getJPQLForString("definition.name", filter) // - + " AND " + getJPQLForString("type.category", tab) // + + conditionallyAddJPQLString("definition.name", filter) // + + conditionallyAddJPQLString("type.category", tab) // + " ORDER BY definition.name ");
} else if (context.equals("configuration")) { @@ -81,8 +79,8 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant { + " WHERE res.resourceType = type " // only suggest names that exist for resources in inventory + " AND simpleDefinition = definition " // only suggest names for simple properties + " AND simpleDefinition.type <> 'PASSWORD' " // do not suggest hidden/password property types - + " AND " + getJPQLForString("definition.name", filter) // - + " AND " + getJPQLForString("type.category", tab) // + + conditionallyAddJPQLString("definition.name", filter) // + + conditionallyAddJPQLString("type.category", tab) // + " ORDER BY definition.name ");
} else if (context.equals("trait")) { @@ -92,8 +90,8 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant { + " JOIN ms.definition def " // + " WHERE ms.resource = res " // only suggest names that exist for resources in inventory + " AND def.dataType = 1 " // trait types - + " AND " + getJPQLForString("ms.definition.name", filter) // - + " AND " + getJPQLForString("res.resourceType.category", tab) // + + conditionallyAddJPQLString("ms.definition.name", filter) // + + conditionallyAddJPQLString("res.resourceType.category", tab) // + " ORDER BY def.name ");
} else { @@ -115,8 +113,8 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant { + "SELECT DISTINCT type.name " // + " FROM Resource res, ResourceType type " // + " WHERE res.resourceType = type " // - + " AND " + getJPQLForString("type.name", filter) // - + " AND " + getJPQLForString("type.category", tab) // + + conditionallyAddJPQLString("type.name", filter) // + + conditionallyAddJPQLString("type.category", tab) // + " ORDER BY type.name ");
} else if (context.equals("plugin")) { @@ -124,8 +122,8 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant { + "SELECT DISTINCT type.plugin " // + " FROM Resource res, ResourceType type " // + " WHERE res.resourceType = type " // - + " AND " + getJPQLForString("type.plugin", filter) // - + " AND " + getJPQLForString("type.category", tab) // + + conditionallyAddJPQLString("type.plugin", filter) // + + conditionallyAddJPQLString("type.category", tab) // + " ORDER BY type.plugin ");
} else if (context.equals("name")) { @@ -133,8 +131,8 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant { + "SELECT DISTINCT res.name " // + " FROM Resource res, ResourceType type " // + " WHERE res.resourceType = type " // - + " AND " + getJPQLForString("res.name", filter) // - + " AND " + getJPQLForString("type.category", tab) // + + conditionallyAddJPQLString("res.name", filter) // + + conditionallyAddJPQLString("type.category", tab) // + " ORDER BY res.name ");
} else if (context.equals("alerts")) { @@ -150,9 +148,9 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant { + " AND simpleDefinition.type <> 'PASSWORD' " // do not suggest hidden/password property types + " AND property = simple " // join here so we can project simple.stringValue + " AND property.name = propertyDefinition.name " // property/definition are linked via name - + " AND " + getJPQLForString("property.name", param) // - + " AND " + getJPQLForString("property.stringValue", filter) // - + " AND " + getJPQLForString("res.resourceType.category", tab) // + + conditionallyAddJPQLString("property.name", param) // + + conditionallyAddJPQLString("property.stringValue", filter) // + + conditionallyAddJPQLString("res.resourceType.category", tab) // + " ORDER BY simple.stringValue ");
} else if (context.equals("configuration")) { @@ -165,9 +163,9 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant { + " AND simpleDefinition.type <> 'PASSWORD' " // do not suggest hidden/password property types + " AND property = simple " // join here so we can project simple.stringValue + " AND property.name = propertyDefinition.name " // property/definition are linked via name - + " AND " + getJPQLForString("property.name", param) // - + " AND " + getJPQLForString("property.stringValue", filter) // - + " AND " + getJPQLForString("res.resourceType.category", tab) // + + conditionallyAddJPQLString("property.name", param) // + + conditionallyAddJPQLString("property.stringValue", filter) // + + conditionallyAddJPQLString("res.resourceType.category", tab) // + " ORDER BY simple.stringValue ");
} else if (context.equals("trait")) { @@ -177,9 +175,9 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant { + " JOIN trait.schedule ms " // + " WHERE ms.definition.dataType = 1 " // + " AND ms.resource = res " // only suggest values that exist for inventoried resources - + " AND " + getJPQLForString("ms.definition.name", param) // - + " AND " + getJPQLForString("trait.value", filter) // - + " AND " + getJPQLForString("res.resourceType.category", tab) // + + conditionallyAddJPQLString("ms.definition.name", param) // + + conditionallyAddJPQLString("trait.value", filter) // + + conditionallyAddJPQLString("res.resourceType.category", tab) // + " ORDER BY trait.value ");
} else {
commit 208832871ccc19d69b0109d66577635d7c6591d1 Author: Joseph Marques joseph@redhat.com Date: Thu Jul 15 15:33:13 2010 -0400
support suggesting "null" values without quotes, which **is** a valid search term value
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java index 45b5358..e721cb4 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java @@ -681,6 +681,11 @@ public class SearchAssistManager {
List<String> results = new ArrayList<String>(); for (String next : data) { + if (next == null) { + results.add("null"); // null search comparisons should never be quoted + continue; + } + boolean hasWhiteSpace = next.matches(".*\s.*"); if (hasWhiteSpace == false) { // don't pad things that don't need padding
commit d105e4e165264bf7770f7b0cc89cba802ca5b8ae Author: Joseph Marques joseph@redhat.com Date: Thu Jul 15 15:11:05 2010 -0400
BZ-615017: enhance search suggestion/execution support for boundary matching
this fix supports all three styles for search terms:
* value * context=value * context[parameter]=value
this fix enhances boundar matching in the following ways:
1) adds boundary matching for 'parameter' suggestions 2) adds boundary matching for 'values' suggestions 3) supports search execution for bounded 'parameter' 4) supports search execution for bounded 'values'
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/GroupSearchAssistant.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/GroupSearchAssistant.java index cee5ff2..b4c3069 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/GroupSearchAssistant.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/GroupSearchAssistant.java @@ -1,5 +1,7 @@ package org.rhq.enterprise.server.search.assist;
+import static org.rhq.enterprise.server.search.common.SearchQueryGenerationUtility.getJPQLForString; + import java.util.Arrays; import java.util.Collections; import java.util.List; @@ -62,8 +64,8 @@ public class GroupSearchAssistant extends TabAwareSearchAssistant { + " FROM ResourceType type, ResourceGroup rg " // + " WHERE rg.resourceType = type " // only suggest names that exist for visible groups in inventory + " AND rg.visible = true " // - + add(" AND LOWER(rg.groupCategory) = '" + tab + "'", tab) // - + add(" AND LOWER(type.name) LIKE '%" + escape(filter.toLowerCase()) + "%'", filter) // + + " AND " + getJPQLForString("type.name", filter) // + + " AND " + getJPQLForString("rg.groupCategory", tab) // + " ORDER BY type.name ");
} else if (context.equals("plugin")) { @@ -72,8 +74,8 @@ public class GroupSearchAssistant extends TabAwareSearchAssistant { + " FROM ResourceType type, ResourceGroup rg " // + " WHERE rg.resourceType = type " // only suggest names that exist for visible groups in inventory + " AND rg.visible = true " // - + add(" AND LOWER(rg.groupCategory) = '" + tab + "'", tab) // - + add(" AND LOWER(type.plugin) LIKE '%" + escape(filter.toLowerCase()) + "%'", filter) // + + " AND " + getJPQLForString("type.plugin", filter) // + + " AND " + getJPQLForString("rg.groupCategory", tab) // + " ORDER BY type.plugin ");
} else if (context.equals("name")) { @@ -81,8 +83,8 @@ public class GroupSearchAssistant extends TabAwareSearchAssistant { + "SELECT DISTINCT rg.name " // + " FROM ResourceGroup rg " // + " WHERE rg.visible = true " // only suggest names that exist for visible groups in inventory - + add(" AND LOWER(rg.groupCategory) = '" + tab + "'", tab) // - + add(" AND LOWER(rg.name) LIKE '%" + escape(filter.toLowerCase()) + "%'", filter) // + + " AND " + getJPQLForString("rg.name", filter) // + + " AND " + getJPQLForString("rg.groupCategory", tab) // + " ORDER BY rg.name ");
} else { diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/ResourceSearchAssistant.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/ResourceSearchAssistant.java index 9900ecb..e0560bf 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/ResourceSearchAssistant.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/ResourceSearchAssistant.java @@ -1,5 +1,7 @@ package org.rhq.enterprise.server.search.assist;
+import static org.rhq.enterprise.server.search.common.SearchQueryGenerationUtility.getJPQLForString; + import java.util.Arrays; import java.util.Collections; import java.util.List; @@ -67,8 +69,8 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant { + " WHERE res.resourceType = type " // only suggest names that exist for resources in inventory + " AND simpleDefinition = definition " // only suggest names for simple properties + " AND simpleDefinition.type <> 'PASSWORD' " // do not suggest hidden/password property types - + add(" AND LOWER(type.category) = '" + tab + "'", tab) // - + add(" AND LOWER(definition.name) LIKE '%" + escape(filter.toLowerCase()) + "%'", filter) // + + " AND " + getJPQLForString("definition.name", filter) // + + " AND " + getJPQLForString("type.category", tab) // + " ORDER BY definition.name ");
} else if (context.equals("configuration")) { @@ -79,8 +81,8 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant { + " WHERE res.resourceType = type " // only suggest names that exist for resources in inventory + " AND simpleDefinition = definition " // only suggest names for simple properties + " AND simpleDefinition.type <> 'PASSWORD' " // do not suggest hidden/password property types - + add(" AND LOWER(type.category) = '" + tab + "'", tab) // - + add(" AND LOWER(definition.name) LIKE '%" + escape(filter.toLowerCase()) + "%'", filter) // + + " AND " + getJPQLForString("definition.name", filter) // + + " AND " + getJPQLForString("type.category", tab) // + " ORDER BY definition.name ");
} else if (context.equals("trait")) { @@ -90,8 +92,8 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant { + " JOIN ms.definition def " // + " WHERE ms.resource = res " // only suggest names that exist for resources in inventory + " AND def.dataType = 1 " // trait types - + add(" AND LOWER(res.resourceType.category) = '" + tab + "'", tab) // - + add(" AND LOWER(def.name) LIKE '%" + escape(filter.toLowerCase()) + "%'", filter) // + + " AND " + getJPQLForString("ms.definition.name", filter) // + + " AND " + getJPQLForString("res.resourceType.category", tab) // + " ORDER BY def.name ");
} else { @@ -113,8 +115,8 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant { + "SELECT DISTINCT type.name " // + " FROM Resource res, ResourceType type " // + " WHERE res.resourceType = type " // - + add(" AND LOWER(type.category) = '" + tab + "'", tab) // - + add(" AND LOWER(type.name) LIKE '%" + escape(filter.toLowerCase()) + "%'", filter) // + + " AND " + getJPQLForString("type.name", filter) // + + " AND " + getJPQLForString("type.category", tab) // + " ORDER BY type.name ");
} else if (context.equals("plugin")) { @@ -122,8 +124,8 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant { + "SELECT DISTINCT type.plugin " // + " FROM Resource res, ResourceType type " // + " WHERE res.resourceType = type " // - + add(" AND LOWER(type.category) = '" + tab + "'", tab) // - + add(" AND LOWER(type.plugin) LIKE '%" + escape(filter.toLowerCase()) + "%'", filter) // + + " AND " + getJPQLForString("type.plugin", filter) // + + " AND " + getJPQLForString("type.category", tab) // + " ORDER BY type.plugin ");
} else if (context.equals("name")) { @@ -131,8 +133,8 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant { + "SELECT DISTINCT res.name " // + " FROM Resource res, ResourceType type " // + " WHERE res.resourceType = type " // - + add(" AND LOWER(type.category) = '" + tab + "'", tab) // - + add(" AND LOWER(res.name) LIKE '%" + escape(filter.toLowerCase()) + "%'", filter) // + + " AND " + getJPQLForString("res.name", filter) // + + " AND " + getJPQLForString("type.category", tab) // + " ORDER BY res.name ");
} else if (context.equals("alerts")) { @@ -148,9 +150,9 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant { + " AND simpleDefinition.type <> 'PASSWORD' " // do not suggest hidden/password property types + " AND property = simple " // join here so we can project simple.stringValue + " AND property.name = propertyDefinition.name " // property/definition are linked via name - + " AND LOWER(property.name) LIKE '%" + escape(param.toLowerCase()) + "%'" // - + add(" AND LOWER(res.resourceType.category) = '" + tab + "'", tab) // - + add(" AND LOWER(property.stringValue) LIKE '%" + escape(filter.toLowerCase()) + "%'", filter) // + + " AND " + getJPQLForString("property.name", param) // + + " AND " + getJPQLForString("property.stringValue", filter) // + + " AND " + getJPQLForString("res.resourceType.category", tab) // + " ORDER BY simple.stringValue ");
} else if (context.equals("configuration")) { @@ -163,9 +165,9 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant { + " AND simpleDefinition.type <> 'PASSWORD' " // do not suggest hidden/password property types + " AND property = simple " // join here so we can project simple.stringValue + " AND property.name = propertyDefinition.name " // property/definition are linked via name - + " AND LOWER(property.name) LIKE '%" + escape(param.toLowerCase()) + "%'" // - + add(" AND LOWER(res.resourceType.category) = '" + tab + "'", tab) // - + add(" AND LOWER(property.stringValue) LIKE '%" + escape(filter.toLowerCase()) + "%'", filter) // + + " AND " + getJPQLForString("property.name", param) // + + " AND " + getJPQLForString("property.stringValue", filter) // + + " AND " + getJPQLForString("res.resourceType.category", tab) // + " ORDER BY simple.stringValue ");
} else if (context.equals("trait")) { @@ -175,9 +177,9 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant { + " JOIN trait.schedule ms " // + " WHERE ms.definition.dataType = 1 " // + " AND ms.resource = res " // only suggest values that exist for inventoried resources - + " AND LOWER(ms.definition.name) LIKE '%" + escape(param.toLowerCase()) + "%'" // - + add(" AND LOWER(res.resourceType.category) = '" + tab + "'", tab) // - + add(" AND LOWER(trait.value) LIKE '%" + escape(filter.toLowerCase()) + "%'", filter) // + + " AND " + getJPQLForString("ms.definition.name", param) // + + " AND " + getJPQLForString("trait.value", filter) // + + " AND " + getJPQLForString("res.resourceType.category", tab) // + " ORDER BY trait.value ");
} else { @@ -185,5 +187,4 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant {
} } - } diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/common/SearchQueryGenerationUtility.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/common/SearchQueryGenerationUtility.java new file mode 100644 index 0000000..734526a --- /dev/null +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/common/SearchQueryGenerationUtility.java @@ -0,0 +1,90 @@ +package org.rhq.enterprise.server.search.common; + +import org.rhq.enterprise.server.search.translation.antlr.RHQLComparisonOperator; +import org.rhq.enterprise.server.util.QueryUtility; + +public class SearchQueryGenerationUtility { + public enum ValueFilter { + STARTS_WITH, // + ENDS_WITH, // + INDEX_OF, // + EXACT_MATCH; + } + + public static String getJPQLForString(String fragment, String value) { + if (value == null) { + value = ""; + } + + return getJPQLForString(fragment, RHQLComparisonOperator.EQUALS, value); + } + + public static String getJPQLForString(String fragment, RHQLComparisonOperator operator, String value) { + if (value == null) { + value = ""; + } + + int size = value.length(); + if (value.startsWith("^")) { + if (value.endsWith("$")) { + return getJPQLForString(fragment, operator, value.substring(1, size - 1), ValueFilter.EXACT_MATCH); + } else { + return getJPQLForString(fragment, operator, value.substring(1), ValueFilter.STARTS_WITH); + } + } else { + if (value.endsWith("$")) { + return getJPQLForString(fragment, operator, value.substring(0, size - 1), ValueFilter.ENDS_WITH); + } else { + return getJPQLForString(fragment, operator, value, ValueFilter.INDEX_OF); + } + } + } + + private static String getJPQLForString(String fragment, RHQLComparisonOperator operator, String value, + ValueFilter filter) { + if (operator == RHQLComparisonOperator.EQUALS) { + return lower(fragment) + " LIKE " + process(filter, value.toLowerCase()); + + } else if (operator == RHQLComparisonOperator.EQUALS_STRICT) { + return fragment + " LIKE " + process(filter, value); + + } else if (operator == RHQLComparisonOperator.NOT_EQUALS) { + return lower(fragment) + " NOT LIKE " + process(filter, value.toLowerCase()); + + } else if (operator == RHQLComparisonOperator.NOT_EQUALS_STRICT) { + return fragment + " NOT LIKE " + process(filter, value); + + } else if (operator == RHQLComparisonOperator.NULL) { + return fragment + " IS NULL"; + + } else if (operator == RHQLComparisonOperator.NOT_NULL) { + return fragment + " IS NOT NULL"; + + } else { + throw new IllegalArgumentException("Unsupported operator " + operator); + } + } + + private static String process(ValueFilter filter, String value) { + if (filter == ValueFilter.STARTS_WITH) { + return "'" + escape(value) + "%'"; + } else if (filter == ValueFilter.ENDS_WITH) { + return "'%" + escape(value) + "'"; + } else if (filter == ValueFilter.INDEX_OF) { + return "'%" + escape(value) + "%'"; + } else if (filter == ValueFilter.EXACT_MATCH) { + return "'" + escape(value) + "'"; + } else { + throw new IllegalArgumentException("Unsupported ValueFilter: " + filter); + } + } + + public static String lower(String data) { + return "LOWER(" + data + ")"; + } + + public static String escape(String data) { + return QueryUtility.escapeSearchParameter(data); + } + +} diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java index e94f938..45b5358 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java @@ -220,9 +220,9 @@ public class SearchAssistManager { this.type = computeType(param, operator);
this.context = (this.type == Type.SIMPLE) ? stripQuotes(context) : context; - this.param = param; + this.param = param == null ? "" : param; // ensure non-null this.operator = operator; - this.value = value; + this.value = value == null ? "" : value; // ensure non-null }
private String stripQuotes(String data) { diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/AbstractSearchTranslator.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/AbstractSearchTranslator.java index 938b221..79f14ee 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/AbstractSearchTranslator.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/AbstractSearchTranslator.java @@ -1,72 +1,9 @@ package org.rhq.enterprise.server.search.translation;
import org.rhq.enterprise.server.search.translation.antlr.RHQLComparisonOperator; -import org.rhq.enterprise.server.util.QueryUtility;
public abstract class AbstractSearchTranslator implements SearchTranslator {
- public enum ValueFilter { - STARTS_WITH, // - ENDS_WITH, // - INDEX_OF, // - EXACT_MATCH; - } - - private String process(ValueFilter filter, String value) { - if (filter == ValueFilter.STARTS_WITH) { - return "'" + escape(value) + "%'"; - } else if (filter == ValueFilter.ENDS_WITH) { - return "'%" + escape(value) + "'"; - } else if (filter == ValueFilter.INDEX_OF) { - return "'%" + escape(value) + "%'"; - } else if (filter == ValueFilter.EXACT_MATCH) { - return "'" + escape(value) + "'"; - } else { - throw new IllegalArgumentException("Unsupported ValueFilter: " + filter); - } - } - - private String getJPQLForString(String fragment, RHQLComparisonOperator operator, String value, ValueFilter filter) { - if (operator == RHQLComparisonOperator.EQUALS) { - return lower(fragment) + " LIKE " + process(filter, value.toLowerCase()); - - } else if (operator == RHQLComparisonOperator.EQUALS_STRICT) { - return fragment + " LIKE " + process(filter, value); - - } else if (operator == RHQLComparisonOperator.NOT_EQUALS) { - return lower(fragment) + " NOT LIKE " + process(filter, value.toLowerCase()); - - } else if (operator == RHQLComparisonOperator.NOT_EQUALS_STRICT) { - return fragment + " NOT LIKE " + process(filter, value); - - } else if (operator == RHQLComparisonOperator.NULL) { - return fragment + " IS NULL"; - - } else if (operator == RHQLComparisonOperator.NOT_NULL) { - return fragment + " IS NOT NULL"; - - } else { - throw new IllegalArgumentException("Unsupported operator " + operator); - } - } - - protected String getJPQLForString(String fragment, RHQLComparisonOperator operator, String value) { - int size = value.length(); - if (value.startsWith("^")) { - if (value.endsWith("$")) { - return getJPQLForString(fragment, operator, value.substring(1, size - 1), ValueFilter.EXACT_MATCH); - } else { - return getJPQLForString(fragment, operator, value.substring(1), ValueFilter.STARTS_WITH); - } - } else { - if (value.endsWith("$")) { - return getJPQLForString(fragment, operator, value.substring(0, size - 1), ValueFilter.ENDS_WITH); - } else { - return getJPQLForString(fragment, operator, value, ValueFilter.INDEX_OF); - } - } - } - protected String getJPQLForEnum(String fragment, RHQLComparisonOperator operator, String value, Class<? extends Enum<?>> enumClass, boolean useOrdinal) { if (operator == RHQLComparisonOperator.NULL || // @@ -99,18 +36,10 @@ public abstract class AbstractSearchTranslator implements SearchTranslator { + value + "'"); }
- protected String lower(String data) { - return "LOWER(" + data + ")"; - } - protected String quote(String data) { return "'" + data + "'"; }
- protected String escape(String data) { - return QueryUtility.escapeSearchParameter(data); - } - protected final String addFragmentIfParameterNotValue(String fragment, String parameter, String value) { if (!parameter.equalsIgnoreCase(value)) { return fragment; diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/GroupSearchTranslator.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/GroupSearchTranslator.java index 5a603ed..0a2e0f1 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/GroupSearchTranslator.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/GroupSearchTranslator.java @@ -1,5 +1,7 @@ package org.rhq.enterprise.server.search.translation;
+import static org.rhq.enterprise.server.search.common.SearchQueryGenerationUtility.getJPQLForString; + import org.rhq.core.domain.resource.ResourceCategory; import org.rhq.enterprise.server.search.translation.antlr.RHQLAdvancedTerm; import org.rhq.enterprise.server.search.translation.antlr.RHQLComparisonOperator; diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/ResourceSearchTranslator.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/ResourceSearchTranslator.java index 3fd7b12..dfe53ec 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/ResourceSearchTranslator.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/ResourceSearchTranslator.java @@ -1,5 +1,7 @@ package org.rhq.enterprise.server.search.translation;
+import static org.rhq.enterprise.server.search.common.SearchQueryGenerationUtility.getJPQLForString; + import org.rhq.core.domain.alert.AlertPriority; import org.rhq.core.domain.measurement.AvailabilityType; import org.rhq.core.domain.resource.ResourceCategory; @@ -59,7 +61,7 @@ public class ResourceSearchTranslator extends AbstractSearchTranslator { + " JOIN res.schedules schedule " // + " WHERE trait.schedule = schedule " // + " AND schedule.definition.dataType = 1 " // - + " AND schedule.definition.name = " + quote(param) // + + " AND " + getJPQLForString("schedule.definition.name", RHQLComparisonOperator.EQUALS, param) // + " AND " + getJPQLForString("trait.value", op, filter));
} else if (path.equals("connection")) { @@ -71,7 +73,7 @@ public class ResourceSearchTranslator extends AbstractSearchTranslator { + " WHERE simpleDefinition = definition " // only provide translations for simple properties + " AND simpleDefinition.type <> 'PASSWORD' " // do not allow searching by hidden/password fields + " AND property = simple " // join to simple for filter by 'stringValue' attribute - + " AND definition.name = " + quote(param) // + + " AND " + getJPQLForString("definition.name", RHQLComparisonOperator.EQUALS, param) // + " AND " + getJPQLForString("simple.stringValue", op, filter));
} else if (path.equals("configuration")) { @@ -83,7 +85,7 @@ public class ResourceSearchTranslator extends AbstractSearchTranslator { + " WHERE simpleDefinition = definition " // only provide translations for simple properties + " AND simpleDefinition.type <> 'PASSWORD' " // do not allow searching by hidden/password fields + " AND property = simple " // join to simple for filter by 'stringValue' attribute - + " AND definition.name = " + quote(param) // + + " AND " + getJPQLForString("definition.name", RHQLComparisonOperator.EQUALS, param) // + " AND " + getJPQLForString("simple.stringValue", op, filter));
} else { diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/QueryUtility.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/QueryUtility.java index 8750977..c7cc99f 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/QueryUtility.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/QueryUtility.java @@ -40,7 +40,7 @@ public class QueryUtility { */ public static String escapeSearchParameter(String value) { if (value == null || value.trim().equals("")) { - return null; + return ""; // if we return null, query will get created as...where pathExpression LIKE '%null%' }
return doEscapeSearchParameter(value);
commit 5a20de24f35418707a68f74ed51cb0614d28639d Author: Joseph Marques joseph@redhat.com Date: Thu Jul 15 12:46:27 2010 -0400
do not escape enums in search
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/AbstractSearchTranslator.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/AbstractSearchTranslator.java index e2d3600..938b221 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/AbstractSearchTranslator.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/AbstractSearchTranslator.java @@ -14,13 +14,13 @@ public abstract class AbstractSearchTranslator implements SearchTranslator {
private String process(ValueFilter filter, String value) { if (filter == ValueFilter.STARTS_WITH) { - return "'" + QueryUtility.escapeSearchParameter(value) + "%'"; + return "'" + escape(value) + "%'"; } else if (filter == ValueFilter.ENDS_WITH) { - return "'%" + QueryUtility.escapeSearchParameter(value) + "'"; + return "'%" + escape(value) + "'"; } else if (filter == ValueFilter.INDEX_OF) { - return "'%" + QueryUtility.escapeSearchParameter(value) + "%'"; + return "'%" + escape(value) + "%'"; } else if (filter == ValueFilter.EXACT_MATCH) { - return "'" + QueryUtility.escapeSearchParameter(value) + "'"; + return "'" + escape(value) + "'"; } else { throw new IllegalArgumentException("Unsupported ValueFilter: " + filter); } @@ -71,14 +71,13 @@ public abstract class AbstractSearchTranslator implements SearchTranslator { Class<? extends Enum<?>> enumClass, boolean useOrdinal) { if (operator == RHQLComparisonOperator.NULL || // operator == RHQLComparisonOperator.NOT_NULL) { - return QueryUtility.escapeSearchParameter(fragment + operator.getDefaultTranslation()); + return fragment + operator.getDefaultTranslation();
} else if (operator == RHQLComparisonOperator.EQUALS || // operator == RHQLComparisonOperator.EQUALS_STRICT || // operator == RHQLComparisonOperator.NOT_EQUALS || // operator == RHQLComparisonOperator.NOT_EQUALS_STRICT) { - return QueryUtility.escapeSearchParameter(fragment + operator.getDefaultTranslation() - + getEnum(enumClass, value, useOrdinal)); + return fragment + operator.getDefaultTranslation() + getEnum(enumClass, value, useOrdinal);
} else { throw new IllegalArgumentException("Unsupported operator " + operator); @@ -108,6 +107,10 @@ public abstract class AbstractSearchTranslator implements SearchTranslator { return "'" + data + "'"; }
+ protected String escape(String data) { + return QueryUtility.escapeSearchParameter(data); + } + protected final String addFragmentIfParameterNotValue(String fragment, String parameter, String value) { if (!parameter.equalsIgnoreCase(value)) { return fragment;
commit efa06a26b20fc8b6a40697e793b540a50cf68afb Author: Joseph Marques joseph@redhat.com Date: Thu Jul 15 12:20:14 2010 -0400
BZ-610135: provide intelligent quoting for suggestions
* if a suggestion doesn't need to be quoted, don't quote it * if a suggestion has whitespace, then determine how to quote it ** if it has only single-quotes in the value, wrap it in double-quotes ** if it has only double-quotes in the value, wrap it in single-quotes ** if it has both types of quotes in the value, don't quote it *** thus, treat mixed-quoted values single search terms so the parser won't bomb
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/search/SearchSuggestion.java b/modules/core/domain/src/main/java/org/rhq/core/domain/search/SearchSuggestion.java index aa02b08..fb1b135 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/search/SearchSuggestion.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/search/SearchSuggestion.java @@ -89,7 +89,19 @@ public class SearchSuggestion implements Serializable, Comparable<SearchSuggesti if (kindComparision != 0) { return kindComparision; } - return label.toLowerCase().compareTo(other.label.toLowerCase()); + return toLowerStripQuotes(label).compareTo(toLowerStripQuotes(other.label)); + } + + private static String toLowerStripQuotes(String data) { + if (data.length() < 2) { + return data; + } + char firstChar = data.charAt(0); + char lastChar = data.charAt(data.length() - 1); + if ((firstChar == '"' && lastChar == '"') || (firstChar == ''' && lastChar == ''')) { + return data.substring(1, data.length() - 1); + } + return data; }
public String toString() { diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java index eb57c47..e94f938 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java @@ -427,25 +427,12 @@ public class SearchAssistManager { String primarySimpleContext = completor.getPrimarySimpleContext(); debug("getSimpleSuggestions: suggesting value completions for a simple context [" + primarySimpleContext + "]");
- String pad = getQuotePadding(beforeCaret); - List<String> valueSuggestions = pad(pad, completor.getValues(primarySimpleContext, null, parsedTerm), pad); + List<String> valueSuggestions = padWithQuotes(beforeCaret, completor.getValues(primarySimpleContext, null, + parsedTerm)); List<SearchSuggestion> suggestions = convert(valueSuggestions, parsed, parsedTerm, Kind.Simple); return suggestions; }
- private String getQuotePadding(String parsedTerm) { - if (parsedTerm.equals("")) { - return """; - } - // if not empty, it has at least one char - char first = parsedTerm.charAt(0); - if (first == ''') { - return "'"; - } else /* if (first == '"') */{ - return """; - } - } - public List<SearchSuggestion> getAdvancedSuggestions(String expression, int caretPos, String tab) { SearchAssistant completor = getTabAwareSearchAssistant(tab);
@@ -527,7 +514,8 @@ public class SearchAssistManager { debug("getAdvancedSuggestions: operator state"); if (allComparisonOperators.contains(parsed.operator)) { debug("search term is complete operator, suggesting values instead"); - List<String> valueSuggestions = pad(pad, completor.getValues(parsed.context, parsed.param, ""), pad); + List<String> valueSuggestions = padWithQuotes(beforeCaret, completor.getValues(parsed.context, + parsed.param, "")); if (completor.getSimpleContexts().contains(parsed.context)) { debug("getAdvancedSuggestions: suggesting value completions for a simple context"); return convert(pad(parsed.context + parsed.operator, valueSuggestions, "")); @@ -554,8 +542,8 @@ public class SearchAssistManager { } case VALUE: debug("getAdvancedSuggestions: value state"); - List<String> valueSuggestions = pad(pad, completor.getValues(parsed.context, parsed.param, parsed.value), - pad); + List<String> valueSuggestions = padWithQuotes(beforeCaret, completor.getValues(parsed.context, + parsed.param, parsed.value)); if (completor.getSimpleContexts().contains(parsed.context)) { debug("getAdvancedSuggestions: suggesting value completions for a simple context"); return convert(pad(parsed.context + parsed.operator, valueSuggestions, ""), parsed, parsed.value); @@ -688,6 +676,57 @@ public class SearchAssistManager { return results; }
+ private List<String> padWithQuotes(String beforeCaret, List<String> data) { + String defaultPad = getQuotePadding(beforeCaret); + + List<String> results = new ArrayList<String>(); + for (String next : data) { + boolean hasWhiteSpace = next.matches(".*\s.*"); + if (hasWhiteSpace == false) { + // don't pad things that don't need padding + results.add(next); + continue; + } + + // we do have whitespace, let's also see if we have quotes + boolean hasSingleQuote = next.indexOf("'") != -1; + boolean hasDoubleQuote = next.indexOf('"') != -1; + + if (hasSingleQuote && hasDoubleQuote) { + // don't pad if suggestion has both single- and double-quotes + // instead, treat suggestion as individual terms, otherwise parser will bomb + results.add(next); + continue; + } + + String pad = null; + if (hasSingleQuote) { + pad = """; // pad with double-quotes + } else if (hasDoubleQuote) { + pad = "'"; // pad with single-quotes + } else { + // otherwise respect the user-chosen padding + pad = defaultPad; + } + + results.add(pad + next + pad); + } + return results; + } + + private String getQuotePadding(String beforeCaret) { + if (beforeCaret.equals("")) { + return """; + } + // if not empty, it has at least one char + char first = beforeCaret.charAt(0); + if (first == ''') { + return "'"; + } else /* if (first == '"') */{ + return """; + } + } + private void debug(String message) { LOG.debug(message); }
commit 024b82d4d29d8fe25c81a163ad36fb5e9a147a47 Author: Joseph Marques joseph@redhat.com Date: Thu Jul 15 11:10:38 2010 -0400
BZ-610120: respect user-chosen quoting style
* if user starts with single-quote, offer suggestions wrapped with single-quotes * in all other cases, offer suggestions wrapped with double-quotes
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java index 2e84d69..eb57c47 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java @@ -427,11 +427,25 @@ public class SearchAssistManager { String primarySimpleContext = completor.getPrimarySimpleContext(); debug("getSimpleSuggestions: suggesting value completions for a simple context [" + primarySimpleContext + "]");
- List<String> valueSuggestions = pad(""", completor.getValues(primarySimpleContext, null, parsedTerm), """); + String pad = getQuotePadding(beforeCaret); + List<String> valueSuggestions = pad(pad, completor.getValues(primarySimpleContext, null, parsedTerm), pad); List<SearchSuggestion> suggestions = convert(valueSuggestions, parsed, parsedTerm, Kind.Simple); return suggestions; }
+ private String getQuotePadding(String parsedTerm) { + if (parsedTerm.equals("")) { + return """; + } + // if not empty, it has at least one char + char first = parsedTerm.charAt(0); + if (first == ''') { + return "'"; + } else /* if (first == '"') */{ + return """; + } + } + public List<SearchSuggestion> getAdvancedSuggestions(String expression, int caretPos, String tab) { SearchAssistant completor = getTabAwareSearchAssistant(tab);
@@ -448,6 +462,9 @@ public class SearchAssistManager { String beforeCaret = assistant.getFragmentBeforeCaret(); debug("getAdvancedSuggestions: beforeCaret is '" + beforeCaret + "'");
+ String pad = getQuotePadding(beforeCaret); + debug("getAdvancedSuggestions: padding is ~" + pad + "~"); + if (beforeCaret.startsWith("'") || beforeCaret.startsWith(""")) { return Collections.emptyList(); } @@ -510,7 +527,7 @@ public class SearchAssistManager { debug("getAdvancedSuggestions: operator state"); if (allComparisonOperators.contains(parsed.operator)) { debug("search term is complete operator, suggesting values instead"); - List<String> valueSuggestions = pad(""", completor.getValues(parsed.context, parsed.param, ""), """); + List<String> valueSuggestions = pad(pad, completor.getValues(parsed.context, parsed.param, ""), pad); if (completor.getSimpleContexts().contains(parsed.context)) { debug("getAdvancedSuggestions: suggesting value completions for a simple context"); return convert(pad(parsed.context + parsed.operator, valueSuggestions, "")); @@ -537,8 +554,8 @@ public class SearchAssistManager { } case VALUE: debug("getAdvancedSuggestions: value state"); - List<String> valueSuggestions = pad(""", completor.getValues(parsed.context, parsed.param, parsed.value), - """); + List<String> valueSuggestions = pad(pad, completor.getValues(parsed.context, parsed.param, parsed.value), + pad); if (completor.getSimpleContexts().contains(parsed.context)) { debug("getAdvancedSuggestions: suggesting value completions for a simple context"); return convert(pad(parsed.context + parsed.operator, valueSuggestions, ""), parsed, parsed.value);
commit f683e9e4a8acff49955ff3b6057726b82aae00dd Author: Joseph Marques joseph@redhat.com Date: Thu Jul 15 10:48:42 2010 -0400
BZ-614529: support search expressions containing ':'
diff --git a/modules/enterprise/server/jar/src/main/antlr3/org/rhq/enterprise/server/search/RHQL.g b/modules/enterprise/server/jar/src/main/antlr3/org/rhq/enterprise/server/search/RHQL.g index 899b07e..0c0f1d5 100644 --- a/modules/enterprise/server/jar/src/main/antlr3/org/rhq/enterprise/server/search/RHQL.g +++ b/modules/enterprise/server/jar/src/main/antlr3/org/rhq/enterprise/server/search/RHQL.g @@ -171,7 +171,7 @@ LEVEL ;
SYMBOL - : '!' | '@' | '#' | '$' | '%' | '^' | '&' | '*' | '-' | '_' | '+' | '|' | '?' | '/' | ',' | '<' | '>' | '`' | '~' + : '!' | '@' | '#' | '$' | '%' | '^' | '&' | '*' | '-' | '_' | '+' | '|' | '?' | '/' | ',' | '<' | '>' | '`' | '~' | ':' ;
WS
commit 3b1133f24d56f777c0707d540855654718c373d8 Author: Joseph Marques joseph@redhat.com Date: Wed Jul 14 23:28:31 2010 -0400
BZ-614693: ignore search terms that attempt to filter using hidden/password properties
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/ResourceSearchTranslator.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/ResourceSearchTranslator.java index 579184b..3fd7b12 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/ResourceSearchTranslator.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/ResourceSearchTranslator.java @@ -65,20 +65,26 @@ public class ResourceSearchTranslator extends AbstractSearchTranslator { } else if (path.equals("connection")) { return new SearchFragment( // SearchFragmentType.PRIMARY_KEY_SUBQUERY, "SELECT res.id" // - + " FROM Resource res " // + + " FROM Resource res, PropertySimple simple, PropertyDefinitionSimple simpleDefinition " // + " JOIN res.resourceType.pluginConfigurationDefinition.propertyDefinitions definition " // + " JOIN res.pluginConfiguration.properties property " // - + " WHERE definition.name = " + quote(param) // - + " AND " + getJPQLForString("property.value", op, filter)); + + " WHERE simpleDefinition = definition " // only provide translations for simple properties + + " AND simpleDefinition.type <> 'PASSWORD' " // do not allow searching by hidden/password fields + + " AND property = simple " // join to simple for filter by 'stringValue' attribute + + " AND definition.name = " + quote(param) // + + " AND " + getJPQLForString("simple.stringValue", op, filter));
} else if (path.equals("configuration")) { return new SearchFragment( // SearchFragmentType.PRIMARY_KEY_SUBQUERY, "SELECT res.id" // - + " FROM Resource res " // + + " FROM Resource res, PropertySimple simple, PropertyDefinitionSimple simpleDefinition " // + " JOIN res.resourceType.resourceConfigurationDefinition.propertyDefinitions definition " // + " JOIN res.resourceConfiguration.properties property " // - + " WHERE definition.name = " + quote(param) // - + " AND " + getJPQLForString("property.value", op, filter)); + + " WHERE simpleDefinition = definition " // only provide translations for simple properties + + " AND simpleDefinition.type <> 'PASSWORD' " // do not allow searching by hidden/password fields + + " AND property = simple " // join to simple for filter by 'stringValue' attribute + + " AND definition.name = " + quote(param) // + + " AND " + getJPQLForString("simple.stringValue", op, filter));
} else { if (param == null) {
commit becb1c6d0498dd02537167a7fa225c97528d790a Author: Joseph Marques joseph@redhat.com Date: Wed Jul 14 23:27:39 2010 -0400
BZ-614693: suppress search suggestions for hidden/password parameters/values
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/AbstractSearchAssistant.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/AbstractSearchAssistant.java index 61faf42..87e10a5 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/AbstractSearchAssistant.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/AbstractSearchAssistant.java @@ -12,6 +12,7 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory;
import org.rhq.enterprise.server.util.LookupUtil; +import org.rhq.enterprise.server.util.QueryUtility;
public abstract class AbstractSearchAssistant implements SearchAssistant {
@@ -144,6 +145,10 @@ public abstract class AbstractSearchAssistant implements SearchAssistant { return "'" + data + "'"; }
+ protected final String escape(String data) { + return QueryUtility.escapeSearchParameter(data); + } + protected final String getFormatterValueFragment(String data) { boolean hasWhitespace = false; for (char next : data.toCharArray()) { diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/GroupSearchAssistant.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/GroupSearchAssistant.java index a428edc..cee5ff2 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/GroupSearchAssistant.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/GroupSearchAssistant.java @@ -7,7 +7,6 @@ import java.util.List; import org.rhq.core.domain.measurement.AvailabilityType; import org.rhq.core.domain.resource.ResourceCategory; import org.rhq.core.domain.search.SearchSubsystem; -import org.rhq.enterprise.server.util.QueryUtility;
public class GroupSearchAssistant extends TabAwareSearchAssistant {
@@ -64,8 +63,7 @@ public class GroupSearchAssistant extends TabAwareSearchAssistant { + " WHERE rg.resourceType = type " // only suggest names that exist for visible groups in inventory + " AND rg.visible = true " // + add(" AND LOWER(rg.groupCategory) = '" + tab + "'", tab) // - + add(" AND LOWER(type.name) LIKE '%" + QueryUtility.escapeSearchParameter(filter.toLowerCase()) - + "%'", filter) // + + add(" AND LOWER(type.name) LIKE '%" + escape(filter.toLowerCase()) + "%'", filter) // + " ORDER BY type.name ");
} else if (context.equals("plugin")) { @@ -75,8 +73,7 @@ public class GroupSearchAssistant extends TabAwareSearchAssistant { + " WHERE rg.resourceType = type " // only suggest names that exist for visible groups in inventory + " AND rg.visible = true " // + add(" AND LOWER(rg.groupCategory) = '" + tab + "'", tab) // - + add(" AND LOWER(type.plugin) LIKE '%" + QueryUtility.escapeSearchParameter(filter.toLowerCase()) - + "%'", filter) // + + add(" AND LOWER(type.plugin) LIKE '%" + escape(filter.toLowerCase()) + "%'", filter) // + " ORDER BY type.plugin ");
} else if (context.equals("name")) { @@ -85,9 +82,7 @@ public class GroupSearchAssistant extends TabAwareSearchAssistant { + " FROM ResourceGroup rg " // + " WHERE rg.visible = true " // only suggest names that exist for visible groups in inventory + add(" AND LOWER(rg.groupCategory) = '" + tab + "'", tab) // - + add( - " AND LOWER(rg.name) LIKE '%" + QueryUtility.escapeSearchParameter(filter.toLowerCase()) + "%'", - filter) // + + add(" AND LOWER(rg.name) LIKE '%" + escape(filter.toLowerCase()) + "%'", filter) // + " ORDER BY rg.name ");
} else { diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/ResourceSearchAssistant.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/ResourceSearchAssistant.java index 124c07b..9900ecb 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/ResourceSearchAssistant.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/ResourceSearchAssistant.java @@ -9,7 +9,6 @@ import org.rhq.core.domain.measurement.AvailabilityType; import org.rhq.core.domain.resource.ResourceCategory; import org.rhq.core.domain.search.SearchSubsystem; import org.rhq.core.domain.search.assist.AlertSearchAssistParam; -import org.rhq.enterprise.server.util.QueryUtility;
public class ResourceSearchAssistant extends TabAwareSearchAssistant {
@@ -63,23 +62,25 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant { } else if (context.equals("connection")) { return execute("" // + "SELECT DISTINCT definition.name " // - + " FROM ResourceType type, Resource res " //" + + " FROM ResourceType type, Resource res, PropertyDefinitionSimple simpleDefinition " //" + " JOIN type.pluginConfigurationDefinition.propertyDefinitions definition " // + " WHERE res.resourceType = type " // only suggest names that exist for resources in inventory + + " AND simpleDefinition = definition " // only suggest names for simple properties + + " AND simpleDefinition.type <> 'PASSWORD' " // do not suggest hidden/password property types + add(" AND LOWER(type.category) = '" + tab + "'", tab) // - + add(" AND LOWER(definition.name) LIKE '%" - + QueryUtility.escapeSearchParameter(filter.toLowerCase()) + "%'", filter) // + + add(" AND LOWER(definition.name) LIKE '%" + escape(filter.toLowerCase()) + "%'", filter) // + " ORDER BY definition.name ");
} else if (context.equals("configuration")) { return execute("" // + "SELECT DISTINCT definition.name " // - + " FROM ResourceType type, Resource res " // + + " FROM ResourceType type, Resource res, PropertyDefinitionSimple simpleDefinition " //" + " JOIN type.resourceConfigurationDefinition.propertyDefinitions definition " // + " WHERE res.resourceType = type " // only suggest names that exist for resources in inventory + + " AND simpleDefinition = definition " // only suggest names for simple properties + + " AND simpleDefinition.type <> 'PASSWORD' " // do not suggest hidden/password property types + add(" AND LOWER(type.category) = '" + tab + "'", tab) // - + add(" AND LOWER(definition.name) LIKE '%" - + QueryUtility.escapeSearchParameter(filter.toLowerCase()) + "%'", filter) // + + add(" AND LOWER(definition.name) LIKE '%" + escape(filter.toLowerCase()) + "%'", filter) // + " ORDER BY definition.name ");
} else if (context.equals("trait")) { @@ -90,8 +91,7 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant { + " WHERE ms.resource = res " // only suggest names that exist for resources in inventory + " AND def.dataType = 1 " // trait types + add(" AND LOWER(res.resourceType.category) = '" + tab + "'", tab) // - + add(" AND LOWER(def.name) LIKE '%" + QueryUtility.escapeSearchParameter(filter.toLowerCase()) - + "%'", filter) // + + add(" AND LOWER(def.name) LIKE '%" + escape(filter.toLowerCase()) + "%'", filter) // + " ORDER BY def.name ");
} else { @@ -114,8 +114,7 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant { + " FROM Resource res, ResourceType type " // + " WHERE res.resourceType = type " // + add(" AND LOWER(type.category) = '" + tab + "'", tab) // - + add(" AND LOWER(type.name) LIKE '%" + QueryUtility.escapeSearchParameter(filter.toLowerCase()) - + "%'", filter) // + + add(" AND LOWER(type.name) LIKE '%" + escape(filter.toLowerCase()) + "%'", filter) // + " ORDER BY type.name ");
} else if (context.equals("plugin")) { @@ -124,8 +123,7 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant { + " FROM Resource res, ResourceType type " // + " WHERE res.resourceType = type " // + add(" AND LOWER(type.category) = '" + tab + "'", tab) // - + add(" AND LOWER(type.plugin) LIKE '%" + QueryUtility.escapeSearchParameter(filter.toLowerCase()) - + "%'", filter) // + + add(" AND LOWER(type.plugin) LIKE '%" + escape(filter.toLowerCase()) + "%'", filter) // + " ORDER BY type.plugin ");
} else if (context.equals("name")) { @@ -134,8 +132,7 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant { + " FROM Resource res, ResourceType type " // + " WHERE res.resourceType = type " // + add(" AND LOWER(type.category) = '" + tab + "'", tab) // - + add(" AND LOWER(res.name) LIKE '%" + QueryUtility.escapeSearchParameter(filter.toLowerCase()) - + "%'", filter) // + + add(" AND LOWER(res.name) LIKE '%" + escape(filter.toLowerCase()) + "%'", filter) // + " ORDER BY res.name ");
} else if (context.equals("alerts")) { @@ -144,29 +141,31 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant { } else if (context.equals("connection")) { return execute("" // + "SELECT DISTINCT simple.stringValue " // - + " FROM Resource res, PropertySimple simple " // + + " FROM Resource res, PropertySimple simple, PropertyDefinitionSimple simpleDefinition " // + " JOIN res.pluginConfiguration.properties property " // suggest values for existing resources only - + " WHERE simple.id = property.id " // - + " AND LOWER(property.name) LIKE '%" - + QueryUtility.escapeSearchParameter(param.toLowerCase()) - + "%'" // + + " JOIN res.resourceType.pluginConfigurationDefinition.propertyDefinitions propertyDefinition " // suggest values for existing resources only + + " WHERE simpleDefinition = propertyDefinition " // only suggest values for simple properties + + " AND simpleDefinition.type <> 'PASSWORD' " // do not suggest hidden/password property types + + " AND property = simple " // join here so we can project simple.stringValue + + " AND property.name = propertyDefinition.name " // property/definition are linked via name + + " AND LOWER(property.name) LIKE '%" + escape(param.toLowerCase()) + "%'" // + add(" AND LOWER(res.resourceType.category) = '" + tab + "'", tab) // - + add(" AND LOWER(property.stringValue) LIKE '%" - + QueryUtility.escapeSearchParameter(filter.toLowerCase()) + "%'", filter) // + + add(" AND LOWER(property.stringValue) LIKE '%" + escape(filter.toLowerCase()) + "%'", filter) // + " ORDER BY simple.stringValue ");
} else if (context.equals("configuration")) { return execute("" // + "SELECT DISTINCT simple.stringValue " // - + " FROM Resource res, PropertySimple simple " // + + " FROM Resource res, PropertySimple simple, PropertyDefinitionSimple simpleDefinition " // + " JOIN res.resourceConfiguration.properties property " // suggest values for existing resources only - + " WHERE simple.id = property.id " // - + " AND LOWER(property.name) LIKE '%" - + QueryUtility.escapeSearchParameter(param.toLowerCase()) - + "%'" // + + " JOIN res.resourceType.resourceConfigurationDefinition.propertyDefinitions propertyDefinition " // suggest values for existing resources only + + " WHERE simpleDefinition = propertyDefinition " // only suggest values for simple properties + + " AND simpleDefinition.type <> 'PASSWORD' " // do not suggest hidden/password property types + + " AND property = simple " // join here so we can project simple.stringValue + + " AND property.name = propertyDefinition.name " // property/definition are linked via name + + " AND LOWER(property.name) LIKE '%" + escape(param.toLowerCase()) + "%'" // + add(" AND LOWER(res.resourceType.category) = '" + tab + "'", tab) // - + add(" AND LOWER(property.stringValue) LIKE '%" - + QueryUtility.escapeSearchParameter(filter.toLowerCase()) + "%'", filter) // + + add(" AND LOWER(property.stringValue) LIKE '%" + escape(filter.toLowerCase()) + "%'", filter) // + " ORDER BY simple.stringValue ");
} else if (context.equals("trait")) { @@ -176,12 +175,9 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant { + " JOIN trait.schedule ms " // + " WHERE ms.definition.dataType = 1 " // + " AND ms.resource = res " // only suggest values that exist for inventoried resources - + " AND LOWER(ms.definition.name) LIKE '%" - + QueryUtility.escapeSearchParameter(param.toLowerCase()) - + "%'" // + + " AND LOWER(ms.definition.name) LIKE '%" + escape(param.toLowerCase()) + "%'" // + add(" AND LOWER(res.resourceType.category) = '" + tab + "'", tab) // - + add(" AND LOWER(trait.value) LIKE '%" + QueryUtility.escapeSearchParameter(filter.toLowerCase()) - + "%'", filter) // + + add(" AND LOWER(trait.value) LIKE '%" + escape(filter.toLowerCase()) + "%'", filter) // + " ORDER BY trait.value ");
} else {
commit 78f3557d5f2964a594e4c7d220f1dcb9c6ab98d9 Author: Joseph Marques joseph@redhat.com Date: Wed Jul 14 21:12:52 2010 -0400
BZ-614591: fix inventory sync issues that manifest during specific timings of async uninventory
part 1 - do not merge inventory report resources that have already been uninventoried
there exists a small window of time after the synchronous part of the uninventory and before the async quartz job comes along to perform the actual removal of the resource from the database, that an inventory report can come across the wire and !OVERWROTE! the UNINVENTORIED status back to COMMITTED. if we find, during an inventory report merge, that the existing resource was already uninventoried (indicating that the quartz job has not yet come along to remove this resource from the database) we should stop all processing from this node and return immediately. this short-cuts the processing for the entire sub-tree under this resource, but that's OK because the in-band uninventory logic will have marked entire sub-tree for uninventory atomically. in other words, all of the descendants under a resource would also be marked for async uninventory too.
part 2 - async uninventory work should recursively delete resources
this handles the case when the the rare timings in part 1 made it into the system and the inventory is current in an inconsistent state. the likely effect is that a resource marked with UNINVENTORIED status has a child that is marked as COMMITTED. thus, if we recursively delete resources in the out-of-band job, we ensure that synchronization inconsistencies are eliminated and the inventory is brought back to a consistent state.
part 3 - async uninventory work should remove resources from their containing groups
even though the group removal occurs in the in-band work, there can be some group definitions that just happens to perform its recalculation (either manually or schedules) in the period after the in-band work completes but before the async job triggers. since the ExpressionEvaluator that underlies the bulk of the dynagroup query generations automatically adds a filter to only manipulate COMMITTED resource, this work should be a no-op most of the time. however, in rare circumstances it's possible for an InventoryReport to come across the wire and flip the status of resources from UNINVENTORIED back to COMMITTED. in this case, this group removal logic needs to be executed again just prior to removing the rest of the reosurce history.
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/discovery/DiscoveryBossBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/discovery/DiscoveryBossBean.java index cded63b..e9f1dc5 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/discovery/DiscoveryBossBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/discovery/DiscoveryBossBean.java @@ -561,8 +561,8 @@ public class DiscoveryBossBean implements DiscoveryBossLocal, DiscoveryBossRemot Resource parent = resource; while (parent != null && existingResource == null) { parent = parent.getParentResource(); - existingResource = resourceManager.getResourceByParentAndKey(subjectManager.getOverlord(), parent, - resource.getResourceKey(), resourceType.getPlugin(), resourceType.getName()); + existingResource = resourceManager.getResourceByParentAndKey(subjectManager.getOverlord(), parent, + resource.getResourceKey(), resourceType.getPlugin(), resourceType.getName()); }
if (existingResource != null) { @@ -592,15 +592,30 @@ public class DiscoveryBossBean implements DiscoveryBossLocal, DiscoveryBossRemot
private void updatePreviouslyInventoriedResource(Resource resource, Resource existingResource, Resource parentResource) throws InvalidInventoryReportException { + /* + * there exists a small window of time after the synchronous part of the uninventory and before the async + * quartz job comes along to perform the actual removal of the resource from the database, that an inventory + * report can come across the wire and !OVERWROTE! the UNINVENTORIED status back to COMMITTED. if we find, + * during an inventory report merge, that the existing resource was already uninventoried (indicating that + * the quartz job has not yet come along to remove this resource from the database) we should stop all + * processing from this node and return immediately. this short-cuts the processing for the entire sub-tree + * under this resource, but that's OK because the in-band uninventory logic will have marked entire sub-tree + * for uninventory atomically. in other words, all of the descendants under a resource would also be marked + * for async uninventory too. + */ + if (existingResource.getInventoryStatus() == InventoryStatus.UNINVENTORIED) { + return; + } + assert (parentResource == null) || (parentResource.getId() != 0); - - ResourceType existingResourceParentType = (existingResource.getParentResource() != null) - ? existingResource.getParentResource().getResourceType() : null; - ResourceType resourceParentType = (resource.getParentResource() != null) - ? resource.getParentResource().getResourceType() : null; + + ResourceType existingResourceParentType = (existingResource.getParentResource() != null) ? existingResource + .getParentResource().getResourceType() : null; + ResourceType resourceParentType = (resource.getParentResource() != null) ? resource.getParentResource() + .getResourceType() : null; Set<ResourceType> validParentTypes = existingResource.getResourceType().getParentResourceTypes(); - if (validParentTypes != null && !validParentTypes.isEmpty() && - !validParentTypes.contains(existingResourceParentType)) { + if (validParentTypes != null && !validParentTypes.isEmpty() + && !validParentTypes.contains(existingResourceParentType)) { // The existing Resource has an invalid parent ResourceType. This may be because its ResourceType was moved // to a new parent ResourceType, but its new parent was not yet discovered at the time of the type move. See // if the Resource reported by the Agent has a valid parent type, and, if so, update the existing Resource's @@ -617,10 +632,10 @@ public class DiscoveryBossBean implements DiscoveryBossLocal, DiscoveryBossRemot existingResource.setParentResource(resource.getParentResource()); } else { log.debug("Existing Resource " + existingResource + " has invalid parent type (" - + existingResourceParentType + ") and so does plugin-reported Resource " + resource + " (" - + resourceParentType + ") - valid parent types are [" + validParentTypes + "]."); + + existingResourceParentType + ") and so does plugin-reported Resource " + resource + " (" + + resourceParentType + ") - valid parent types are [" + validParentTypes + "]."); } - } + }
// The below block is for Resources that were created via the RHQ GUI, whose descriptions will be null. if (existingResource.getDescription() == null && resource.getDescription() != null) { @@ -654,11 +669,11 @@ public class DiscoveryBossBean implements DiscoveryBossLocal, DiscoveryBossRemot private boolean initResourceTypes(Resource resource) { ResourceType resourceType; try { - resourceType = this.resourceTypeManager.getResourceTypeByNameAndPlugin(subjectManager.getOverlord(), resource - .getResourceType().getName(), resource.getResourceType().getPlugin()); + resourceType = this.resourceTypeManager.getResourceTypeByNameAndPlugin(subjectManager.getOverlord(), + resource.getResourceType().getName(), resource.getResourceType().getPlugin()); } catch (RuntimeException e) { log.error("Failed to lookup Resource type [" + resource.getResourceType() + "] for reported Resource [" - + resource + "] - this should not have happened."); + + resource + "] - this should not have happened."); return false; } if (resourceType == null) { diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerBean.java index df9b758..be85557 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerBean.java @@ -279,14 +279,13 @@ public class ResourceManagerBean implements ResourceManagerLocal, ResourceManage int i = 0; log.debug("== total size : " + toBeDeletedResourceIds.size());
- while (i<toBeDeletedResourceIds.size()) { + while (i < toBeDeletedResourceIds.size()) { int j = i + 1000; if (j > toBeDeletedResourceIds.size()) j = toBeDeletedResourceIds.size(); - List<Integer> idsToDelete = toBeDeletedResourceIds.subList(i,j); + List<Integer> idsToDelete = toBeDeletedResourceIds.subList(i, j); log.debug("== Bounds " + i + ", " + j);
- boolean hasErrors = uninventoryResourcesBulkDelete(overlord, idsToDelete); if (hasErrors) { throw new IllegalArgumentException("Could not remove resources from their containing groups"); @@ -338,7 +337,21 @@ public class ResourceManagerBean implements ResourceManagerLocal, ResourceManage throw new IllegalArgumentException("Only the overlord can execute out-of-band async resource delete method"); }
- boolean hasErrors = uninventoryResourceBulkDeleteAsyncWork(user, resourceId); + /* + * even though the group removal occurs in the in-band work, there can be some group definitions that just + * happens to perform its recalculation (either manually or schedules) in the period after the in-band work + * completes but before the async job triggers. since the ExpressionEvaluator that underlies the bulk of the + * dynagroup query generations automatically adds a filter to only manipulate COMMITTED resource, this work + * should be a no-op most of the time. however, in rare circumstances it's possible for an InventoryReport to + * come across the wire and flip the status of resources from UNINVENTORIED back to COMMITTED. in this case, + * this group removal logic needs to be executed again just prior to removing the rest of the reosurce history. + */ + boolean hasErrors = uninventoryResourcesBulkDelete(user, Arrays.asList(resourceId)); + if (hasErrors) { + return; // return early if there were any errors, because we can't remove the resource yet + } + + hasErrors = uninventoryResourceBulkDeleteAsyncWork(user, resourceId); if (hasErrors) { return; // return early if there were any errors, because we can't remove the resource yet } diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/scheduler/jobs/AsyncResourceDeleteJob.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/scheduler/jobs/AsyncResourceDeleteJob.java index 412e61d..b0d183d 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/scheduler/jobs/AsyncResourceDeleteJob.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/scheduler/jobs/AsyncResourceDeleteJob.java @@ -26,6 +26,7 @@ import org.quartz.JobExecutionContext; import org.quartz.JobExecutionException;
import org.rhq.core.domain.auth.Subject; +import org.rhq.core.util.exception.ThrowableUtil; import org.rhq.enterprise.server.exception.UnscheduleException; import org.rhq.enterprise.server.operation.OperationManagerLocal; import org.rhq.enterprise.server.operation.ResourceOperationSchedule; @@ -36,39 +37,72 @@ public class AsyncResourceDeleteJob extends AbstractStatefulJob {
private final Log log = LogFactory.getLog(AsyncResourceDeleteJob.class);
- @Override - public void executeJobCode(JobExecutionContext arg0) throws JobExecutionException { - - Subject overlord = LookupUtil.getSubjectManager().getOverlord(); - ResourceManagerLocal resourceManager = LookupUtil.getResourceManager(); + Subject overlord = LookupUtil.getSubjectManager().getOverlord(); + ResourceManagerLocal resourceManager = LookupUtil.getResourceManager();
+ private class AsyncDeletionStats { int deletedSuccessfully = 0; int deletedWithFailure = 0; - long time = 0; + long deletionTime; + + public String toString() { + return "Async resource deletion - " + deletedSuccessfully + " successful, " + deletedWithFailure + + " failed, took [" + deletionTime + "] ms"; + } + } + + @Override + public void executeJobCode(JobExecutionContext arg0) throws JobExecutionException { List<Integer> toBeRemovedIds = resourceManager.findResourcesMarkedForAsyncDeletion(overlord); + + AsyncDeletionStats stats = new AsyncDeletionStats(); for (Integer doomedResourceId : toBeRemovedIds) { try { - log.debug("Before asynchronous deletion of resource[id=" + doomedResourceId + "]"); - long startTime = System.currentTimeMillis(); - unscheduleJobs(overlord, doomedResourceId); - resourceManager.uninventoryResourceAsyncWork(overlord, doomedResourceId); - long endTime = System.currentTimeMillis(); - time += (endTime - startTime); - log.debug("After asynchronous deletion of resource[id=" + doomedResourceId + "], took [" - + (endTime - startTime) + "]ms"); - deletedSuccessfully++; + // do not recurse + uninventoryResource(overlord, doomedResourceId, stats, false); } catch (Throwable t) { - log.debug("Error during asynchronous deletion of resource[id=" + doomedResourceId + "]", t); - deletedWithFailure++; + log.debug("Simple asynchronous deletion of resource[id=" + doomedResourceId + "] failed, " + + "trying more robust yet expensive removal method, cause: " + ThrowableUtil.getAllMessages(t)); + try { + // try more robust yet expensive recursive delete + uninventoryResource(overlord, doomedResourceId, stats, true); + } catch (Throwable tt) { + log.debug("Error during asynchronous deletion of resource[id=" + doomedResourceId + "], cause: " + + ThrowableUtil.getAllMessages(tt)); + stats.deletedWithFailure++; + } } }
- if (deletedSuccessfully > 0 || deletedWithFailure > 0) { - log.info("Async resource deletion - " + deletedSuccessfully + " successful, " + deletedWithFailure - + " failed, took [" + time + "]ms"); + if (stats.deletedSuccessfully > 0 || stats.deletedWithFailure > 0) { + log.info(stats); } }
+ // return true if successful + private void uninventoryResource(Subject overlord, Integer doomedResourceId, AsyncDeletionStats stats, + boolean recurse) { + if (recurse) { + List<Integer> doomedChildrenIds = resourceManager.findChildrenResourceIds(doomedResourceId, null); + for (Integer nextDoomedChildId : doomedChildrenIds) { + uninventoryResource(overlord, nextDoomedChildId, stats, recurse); + } + } + log.debug("Before " + (recurse ? "(recursive)" : "") + " asynchronous deletion of resource[id=" + + doomedResourceId + "]"); + long startTime = System.currentTimeMillis(); + + unscheduleJobs(overlord, doomedResourceId); + resourceManager.uninventoryResourceAsyncWork(overlord, doomedResourceId); + stats.deletedSuccessfully++; + + long endTime = System.currentTimeMillis(); + log.debug("After " + (recurse ? "(recursive)" : "") + " asynchronous deletion of resource[id=" + + doomedResourceId + "] took [" + (endTime - startTime) + "]ms"); + + stats.deletionTime += (endTime - startTime); + } + private void unscheduleJobs(Subject overlord, Integer resourceId) { log.debug("Unscheduling jobs for resource[id=" + resourceId + "]"); OperationManagerLocal operationManager = LookupUtil.getOperationManager();
commit d5acc2c164a7d417a1b938bb7d95d21ed7f2d519 Author: Joseph Marques joseph@redhat.com Date: Wed Jul 14 21:07:11 2010 -0400
BZ-614688: support searching for values that contain single-quotes
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/GroupSearchAssistant.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/GroupSearchAssistant.java index cba008f..a428edc 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/GroupSearchAssistant.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/GroupSearchAssistant.java @@ -7,6 +7,7 @@ import java.util.List; import org.rhq.core.domain.measurement.AvailabilityType; import org.rhq.core.domain.resource.ResourceCategory; import org.rhq.core.domain.search.SearchSubsystem; +import org.rhq.enterprise.server.util.QueryUtility;
public class GroupSearchAssistant extends TabAwareSearchAssistant {
@@ -63,7 +64,8 @@ public class GroupSearchAssistant extends TabAwareSearchAssistant { + " WHERE rg.resourceType = type " // only suggest names that exist for visible groups in inventory + " AND rg.visible = true " // + add(" AND LOWER(rg.groupCategory) = '" + tab + "'", tab) // - + add(" AND LOWER(type.name) LIKE '%" + filter.toLowerCase() + "%'", filter) // + + add(" AND LOWER(type.name) LIKE '%" + QueryUtility.escapeSearchParameter(filter.toLowerCase()) + + "%'", filter) // + " ORDER BY type.name ");
} else if (context.equals("plugin")) { @@ -73,7 +75,8 @@ public class GroupSearchAssistant extends TabAwareSearchAssistant { + " WHERE rg.resourceType = type " // only suggest names that exist for visible groups in inventory + " AND rg.visible = true " // + add(" AND LOWER(rg.groupCategory) = '" + tab + "'", tab) // - + add(" AND LOWER(type.plugin) LIKE '%" + filter.toLowerCase() + "%'", filter) // + + add(" AND LOWER(type.plugin) LIKE '%" + QueryUtility.escapeSearchParameter(filter.toLowerCase()) + + "%'", filter) // + " ORDER BY type.plugin ");
} else if (context.equals("name")) { @@ -82,7 +85,9 @@ public class GroupSearchAssistant extends TabAwareSearchAssistant { + " FROM ResourceGroup rg " // + " WHERE rg.visible = true " // only suggest names that exist for visible groups in inventory + add(" AND LOWER(rg.groupCategory) = '" + tab + "'", tab) // - + add(" AND LOWER(rg.name) LIKE '%" + filter.toLowerCase() + "%'", filter) // + + add( + " AND LOWER(rg.name) LIKE '%" + QueryUtility.escapeSearchParameter(filter.toLowerCase()) + "%'", + filter) // + " ORDER BY rg.name ");
} else { diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/ResourceSearchAssistant.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/ResourceSearchAssistant.java index e6552fc..124c07b 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/ResourceSearchAssistant.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/ResourceSearchAssistant.java @@ -9,6 +9,7 @@ import org.rhq.core.domain.measurement.AvailabilityType; import org.rhq.core.domain.resource.ResourceCategory; import org.rhq.core.domain.search.SearchSubsystem; import org.rhq.core.domain.search.assist.AlertSearchAssistParam; +import org.rhq.enterprise.server.util.QueryUtility;
public class ResourceSearchAssistant extends TabAwareSearchAssistant {
@@ -66,7 +67,8 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant { + " JOIN type.pluginConfigurationDefinition.propertyDefinitions definition " // + " WHERE res.resourceType = type " // only suggest names that exist for resources in inventory + add(" AND LOWER(type.category) = '" + tab + "'", tab) // - + add(" AND LOWER(definition.name) LIKE '%" + filter.toLowerCase() + "%'", filter) // + + add(" AND LOWER(definition.name) LIKE '%" + + QueryUtility.escapeSearchParameter(filter.toLowerCase()) + "%'", filter) // + " ORDER BY definition.name ");
} else if (context.equals("configuration")) { @@ -76,7 +78,8 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant { + " JOIN type.resourceConfigurationDefinition.propertyDefinitions definition " // + " WHERE res.resourceType = type " // only suggest names that exist for resources in inventory + add(" AND LOWER(type.category) = '" + tab + "'", tab) // - + add(" AND LOWER(definition.name) LIKE '%" + filter.toLowerCase() + "%'", filter) // + + add(" AND LOWER(definition.name) LIKE '%" + + QueryUtility.escapeSearchParameter(filter.toLowerCase()) + "%'", filter) // + " ORDER BY definition.name ");
} else if (context.equals("trait")) { @@ -87,7 +90,8 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant { + " WHERE ms.resource = res " // only suggest names that exist for resources in inventory + " AND def.dataType = 1 " // trait types + add(" AND LOWER(res.resourceType.category) = '" + tab + "'", tab) // - + add(" AND LOWER(def.name) LIKE '%" + filter.toLowerCase() + "%'", filter) // + + add(" AND LOWER(def.name) LIKE '%" + QueryUtility.escapeSearchParameter(filter.toLowerCase()) + + "%'", filter) // + " ORDER BY def.name ");
} else { @@ -110,7 +114,8 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant { + " FROM Resource res, ResourceType type " // + " WHERE res.resourceType = type " // + add(" AND LOWER(type.category) = '" + tab + "'", tab) // - + add(" AND LOWER(type.name) LIKE '%" + filter.toLowerCase() + "%'", filter) // + + add(" AND LOWER(type.name) LIKE '%" + QueryUtility.escapeSearchParameter(filter.toLowerCase()) + + "%'", filter) // + " ORDER BY type.name ");
} else if (context.equals("plugin")) { @@ -119,7 +124,8 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant { + " FROM Resource res, ResourceType type " // + " WHERE res.resourceType = type " // + add(" AND LOWER(type.category) = '" + tab + "'", tab) // - + add(" AND LOWER(type.plugin) LIKE '%" + filter.toLowerCase() + "%'", filter) // + + add(" AND LOWER(type.plugin) LIKE '%" + QueryUtility.escapeSearchParameter(filter.toLowerCase()) + + "%'", filter) // + " ORDER BY type.plugin ");
} else if (context.equals("name")) { @@ -128,7 +134,8 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant { + " FROM Resource res, ResourceType type " // + " WHERE res.resourceType = type " // + add(" AND LOWER(type.category) = '" + tab + "'", tab) // - + add(" AND LOWER(res.name) LIKE '%" + filter.toLowerCase() + "%'", filter) // + + add(" AND LOWER(res.name) LIKE '%" + QueryUtility.escapeSearchParameter(filter.toLowerCase()) + + "%'", filter) // + " ORDER BY res.name ");
} else if (context.equals("alerts")) { @@ -140,9 +147,12 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant { + " FROM Resource res, PropertySimple simple " // + " JOIN res.pluginConfiguration.properties property " // suggest values for existing resources only + " WHERE simple.id = property.id " // - + " AND LOWER(property.name) LIKE '%" + param.toLowerCase() + "%'" // + + " AND LOWER(property.name) LIKE '%" + + QueryUtility.escapeSearchParameter(param.toLowerCase()) + + "%'" // + add(" AND LOWER(res.resourceType.category) = '" + tab + "'", tab) // - + add(" AND LOWER(property.stringValue) LIKE '%" + filter.toLowerCase() + "%'", filter) // + + add(" AND LOWER(property.stringValue) LIKE '%" + + QueryUtility.escapeSearchParameter(filter.toLowerCase()) + "%'", filter) // + " ORDER BY simple.stringValue ");
} else if (context.equals("configuration")) { @@ -151,9 +161,12 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant { + " FROM Resource res, PropertySimple simple " // + " JOIN res.resourceConfiguration.properties property " // suggest values for existing resources only + " WHERE simple.id = property.id " // - + " AND LOWER(property.name) LIKE '%" + param.toLowerCase() + "%'" // + + " AND LOWER(property.name) LIKE '%" + + QueryUtility.escapeSearchParameter(param.toLowerCase()) + + "%'" // + add(" AND LOWER(res.resourceType.category) = '" + tab + "'", tab) // - + add(" AND LOWER(property.stringValue) LIKE '%" + filter.toLowerCase() + "%'", filter) // + + add(" AND LOWER(property.stringValue) LIKE '%" + + QueryUtility.escapeSearchParameter(filter.toLowerCase()) + "%'", filter) // + " ORDER BY simple.stringValue ");
} else if (context.equals("trait")) { @@ -163,9 +176,12 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant { + " JOIN trait.schedule ms " // + " WHERE ms.definition.dataType = 1 " // + " AND ms.resource = res " // only suggest values that exist for inventoried resources - + " AND LOWER(ms.definition.name) LIKE '%" + param.toLowerCase() + "%'" // + + " AND LOWER(ms.definition.name) LIKE '%" + + QueryUtility.escapeSearchParameter(param.toLowerCase()) + + "%'" // + add(" AND LOWER(res.resourceType.category) = '" + tab + "'", tab) // - + add(" AND LOWER(trait.value) LIKE '%" + filter.toLowerCase() + "%'", filter) // + + add(" AND LOWER(trait.value) LIKE '%" + QueryUtility.escapeSearchParameter(filter.toLowerCase()) + + "%'", filter) // + " ORDER BY trait.value ");
} else { diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/AbstractSearchTranslator.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/AbstractSearchTranslator.java index 59f4888..e2d3600 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/AbstractSearchTranslator.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/AbstractSearchTranslator.java @@ -1,6 +1,7 @@ package org.rhq.enterprise.server.search.translation;
import org.rhq.enterprise.server.search.translation.antlr.RHQLComparisonOperator; +import org.rhq.enterprise.server.util.QueryUtility;
public abstract class AbstractSearchTranslator implements SearchTranslator {
@@ -13,13 +14,13 @@ public abstract class AbstractSearchTranslator implements SearchTranslator {
private String process(ValueFilter filter, String value) { if (filter == ValueFilter.STARTS_WITH) { - return "'" + value + "%'"; + return "'" + QueryUtility.escapeSearchParameter(value) + "%'"; } else if (filter == ValueFilter.ENDS_WITH) { - return "'%" + value + "'"; + return "'%" + QueryUtility.escapeSearchParameter(value) + "'"; } else if (filter == ValueFilter.INDEX_OF) { - return "'%" + value + "%'"; + return "'%" + QueryUtility.escapeSearchParameter(value) + "%'"; } else if (filter == ValueFilter.EXACT_MATCH) { - return "'" + value + "'"; + return "'" + QueryUtility.escapeSearchParameter(value) + "'"; } else { throw new IllegalArgumentException("Unsupported ValueFilter: " + filter); } @@ -70,20 +71,21 @@ public abstract class AbstractSearchTranslator implements SearchTranslator { Class<? extends Enum<?>> enumClass, boolean useOrdinal) { if (operator == RHQLComparisonOperator.NULL || // operator == RHQLComparisonOperator.NOT_NULL) { - return fragment + operator.getDefaultTranslation(); + return QueryUtility.escapeSearchParameter(fragment + operator.getDefaultTranslation());
} else if (operator == RHQLComparisonOperator.EQUALS || // operator == RHQLComparisonOperator.EQUALS_STRICT || // operator == RHQLComparisonOperator.NOT_EQUALS || // operator == RHQLComparisonOperator.NOT_EQUALS_STRICT) { - return fragment + operator.getDefaultTranslation() + getEnum(enumClass, value, useOrdinal); + return QueryUtility.escapeSearchParameter(fragment + operator.getDefaultTranslation() + + getEnum(enumClass, value, useOrdinal));
} else { throw new IllegalArgumentException("Unsupported operator " + operator); } }
- protected String getEnum(Class<? extends Enum<?>> enumClass, String value, boolean useOrdinal) { + private String getEnum(Class<? extends Enum<?>> enumClass, String value, boolean useOrdinal) { value = value.toLowerCase(); for (Enum<?> nextEnum : enumClass.getEnumConstants()) { if (nextEnum.name().toLowerCase().equals(value)) { diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/QueryUtility.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/QueryUtility.java index bd9cc8a..8750977 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/QueryUtility.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/QueryUtility.java @@ -48,16 +48,17 @@ public class QueryUtility {
private static String doEscapeSearchParameter(String value) { init(); - + // Escape LIKE's wildcard characters with escaped characters so that the user's input // will be matched literally value = value.replace(ESCAPE_CHARACTER, ESCAPED_ESCAPE); value = value.replace("_", ESCAPED_UNDERSCORE); value = value.replace("%", ESCAPED_PERCENT); + value = value.replace("'", "''");
return value; - } - + } + /** * Given the settings for the current DatabaseType, properly handle escaping special SQL characters as * well as UPCASING the value (standard for rhq filter searches) and wrapping with SQL wildcard for
commit a11d80bed0111bf051aac38d7f7c786518ea34ed Author: Greg Hinkle ghinkle@redhat.com Date: Wed Jul 14 22:41:08 2010 -0400
Tests with the ListGridFieldType.LINK
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundlesListView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundlesListView.java index 927056b..3dc9f4c 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundlesListView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundlesListView.java @@ -21,6 +21,7 @@ package org.rhq.enterprise.gui.coregui.client.bundle.list; import com.google.gwt.user.client.History; import com.google.gwt.user.client.rpc.AsyncCallback; import com.smartgwt.client.data.Criteria; +import com.smartgwt.client.types.ListGridFieldType; import com.smartgwt.client.types.SelectionAppearance; import com.smartgwt.client.types.SelectionStyle; import com.smartgwt.client.widgets.grid.CellFormatter; @@ -66,12 +67,15 @@ public class BundlesListView extends Table { setDataSource(new BundlesWithLatestVersionDataSource());
getListGrid().getField("id").setWidth("60"); - getListGrid().getField("name").setWidth("25%"); - getListGrid().getField("name").setCellFormatter(new CellFormatter() { - public String format(Object o, ListGridRecord listGridRecord, int i, int i1) { - return "<a href="#Bundles/Bundle/" + listGridRecord.getAttribute("id") + "">" + o + "</a>"; - } - }); + getListGrid().getField("link").setWidth("25%"); + getListGrid().getField("link").setType(ListGridFieldType.LINK); + getListGrid().getField("link").setTarget("_self"); + +// getListGrid().getField("name").setCellFormatter(new CellFormatter() { +// public String format(Object o, ListGridRecord listGridRecord, int i, int i1) { +// return "";//<a href="#Bundles/Bundle/" + listGridRecord.getAttribute("id") + "">" + o + "</a>"; +// } +// });
getListGrid().getField("description").setWidth("25%"); getListGrid().getField("latestVersion").setWidth("25%"); diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundlesWithLatestVersionDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundlesWithLatestVersionDataSource.java index f20d65e..e3b54ac 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundlesWithLatestVersionDataSource.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundlesWithLatestVersionDataSource.java @@ -22,6 +22,7 @@ import com.google.gwt.user.client.rpc.AsyncCallback; import com.smartgwt.client.data.DSRequest; import com.smartgwt.client.data.DSResponse; import com.smartgwt.client.data.fields.DataSourceIntegerField; +import com.smartgwt.client.data.fields.DataSourceLinkField; import com.smartgwt.client.data.fields.DataSourceTextField; import com.smartgwt.client.widgets.grid.ListGridRecord;
@@ -46,8 +47,9 @@ public class BundlesWithLatestVersionDataSource extends RPCDataSource<BundleWith idField.setPrimaryKey(true); addField(idField);
- DataSourceTextField nameField = new DataSourceTextField("name", "Name"); - addField(nameField); + DataSourceLinkField linkField = new DataSourceLinkField("link", "Name"); + addField(linkField); +
DataSourceTextField descriptionField = new DataSourceTextField("description", "Description"); addField(descriptionField); @@ -112,6 +114,12 @@ public class BundlesWithLatestVersionDataSource extends RPCDataSource<BundleWith
record.setAttribute("id", from.getBundleId()); record.setAttribute("name", from.getBundleName()); + + + record.setAttribute("link", "#Bundles/Bundle/" + from.getBundleId()); + record.setLinkText(from.getBundleName()); + + record.setAttribute("description", from.getBundleDescription()); record.setAttribute("latestVersion", from.getLatestVersion()); record.setAttribute("versionsCount", Integer.valueOf(from.getVersionsCount().intValue())); // want int, not long
commit d09d01da042f20a4d3aa7ed43407cd76ce020293 Author: Greg Hinkle ghinkle@redhat.com Date: Wed Jul 14 22:39:10 2010 -0400
IE6 XMLHttpRequest workaround for the searchgui Don't use CoreGUI framework features from the jsf embedded search gui components
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/SearchGUI.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/SearchGUI.java index e4e7f01..8ecfde5 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/SearchGUI.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/SearchGUI.java @@ -95,8 +95,12 @@ public class SearchGUI implements EntryPoint { GWTServiceLookup.getSubjectService().findSubjectsByCriteria(criteria, new AsyncCallback<PageList<Subject>>() { public void onFailure(Throwable caught) { - CoreGUI.getErrorHandler().handleError("Failed to load user's subject", caught); - new LoginView().showLoginDialog(); + // can't use this until gwt frame is always present, reserve for futureu + //CoreGUI.getErrorHandler().handleError("Failed to load user's subject", caught); + //SC.say("Failed to load user's subject."); + //new LoginView().showLoginDialog(); + + System.out.println("Failed to load user's subject"); }
public void onSuccess(PageList<Subject> result) { @@ -126,6 +130,7 @@ public class SearchGUI implements EntryPoint { CoreGUI.unforceIe6Hacks(); } } + }
public static Subject getSessionSubject() { @@ -135,4 +140,30 @@ public class SearchGUI implements EntryPoint { public SearchBar getSearchBar() { return searchBar; } + + + + /** + * Detects IE6. + * <p/> + * This is a nasty hack; but it's extremely reliable when running with other + * js libraries on the same page at the same time as gwt. + */ + public static native boolean detectIe6() /*-{ + if (typeof $doc.body.style.maxHeight != "undefined") + return(false); + else + return(true); +}-*/; + + public static native void forceIe6Hacks() /*-{ + $wnd.XMLHttpRequestBackup = $wnd.XMLHttpRequest; + $wnd.XMLHttpRequest = null; +}-*/; + + public static native void unforceIe6Hacks() /*-{ + $wnd.XMLHttpRequest = $wnd.XMLHttpRequestBackup; + $wnd.XMLHttpRequestBackup = null; +}-*/; + }
commit 66f26631cda5e42af276412d7af027c7d80a9d7d Author: Greg Hinkle ghinkle@redhat.com Date: Wed Jul 14 22:38:08 2010 -0400
Protect against invalid events
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/SearchBar.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/SearchBar.java index 60866e0..47dcded 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/SearchBar.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/SearchBar.java @@ -110,9 +110,12 @@ public class SearchBar extends SimplePanel {
Event.addNativePreviewHandler(new NativePreviewHandler() { public void onPreviewNativeEvent(NativePreviewEvent event) { - if (event.getNativeEvent().getEventTarget().equals(searchButton) - && event.getTypeInt() == Event.ONMOUSEDOWN) { - prepareSearchExecution(); + if (event.getNativeEvent() != null && event.getNativeEvent().getEventTarget() != null) { + + if (event.getNativeEvent().getEventTarget().equals(searchButton) + && event.getTypeInt() == Event.ONMOUSEDOWN) { + prepareSearchExecution(); + } } } });
commit 6e887d7303ef5de7f90b5d0371b62865669a3d46 Author: Greg Hinkle ghinkle@redhat.com Date: Wed Jul 14 17:02:33 2010 -0400
fully qualified image path for other context path usage
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/rpc/RPCManager.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/rpc/RPCManager.java index 44aaacd..37f553d 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/rpc/RPCManager.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/rpc/RPCManager.java @@ -35,7 +35,7 @@ public class RPCManager { Img activityIndicator;
public RPCManager() { - activityIndicator = new Img("ajax-loader.gif", 16, 16); + activityIndicator = new Img("/coregui/images/ajax-loader.gif", 16, 16); activityIndicator.setZIndex(10000); activityIndicator.setLeft(10); activityIndicator.setTop(40);
commit aace8158a984fd8368541a8a54fa42c5bbf89b4d Author: Greg Hinkle ghinkle@redhat.com Date: Wed Jul 14 17:02:00 2010 -0400
Switch menubar border overrides to css !important for bug in IE dom editing
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/menu/MenuBarView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/menu/MenuBarView.java index e5c0d93..55a7d47 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/menu/MenuBarView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/menu/MenuBarView.java @@ -77,25 +77,6 @@ public class MenuBarView extends VLayout {
this.aboutModalWindow = new AboutModalWindow();
- - /*// TODO GH: This is a nasty hack... it injects the css to override the smartgwt skin - String css = ".menuButton, .menuButtonOver, .menuButtonDown, .menuButtonDisabled, .menuButtonSelected, .menuButtonSelectedDown, .menuButtonSelectedOver, .menuButtonSelectedDisabled {\n" + - " border: none;\n" + - " font-size: 9pt; \n" + - " font-weight: bold;\n" + - "}\n" + - ".menuButtonDown {\n" + - " background: url("/coregui/org.rhq.enterprise.gui.coregui.CoreGUI/sc/skins/Enterprise/images/cssButton/button_Over_stretch.png") repeat-x scroll 0 0 #DDDDDD"; - - com.google.gwt.dom.client.StyleElement style = Document.get().createStyleElement(); - style.setPropertyString("language", "text/css"); - style.setInnerText(css); - Document.get().getBody().appendChild(style); - -*/ - - - HLayout topBar = new HLayout(); topBar.setHeight(28); topBar.setStyleName("topMenuBar");
commit 7d741942d29e94da90e4627648b0a6bcad51a4b8 Author: Greg Hinkle ghinkle@redhat.com Date: Wed Jul 14 16:58:11 2010 -0400
We have to release without user.agent specific builds to have proper multiple browser support!
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml index 264fbd6..14ca590 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml @@ -41,7 +41,7 @@ <set-property name="user.agent" value="safari"/>
<!-- Firefox 3 --> - <set-property name="user.agent" value="gecko1_8"/> + <!--<set-property name="user.agent" value="gecko1_8"/>-->
<entry-point class='org.rhq.enterprise.gui.coregui.client.CoreGUI'/>
commit a0fa16035a5750ddca2dead531fad2ce33501b3f Author: Ian Springer ian.springer@redhat.com Date: Wed Jul 14 21:47:24 2010 -0400
fix so unset checkbox works for textarea fields (for longString props) (https://bugzilla.redhat.com/show_bug.cgi?id=609456); call prepareInputsForSubmission() JS function upon submission of form on update alert sender config page
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/js/rhq.js b/modules/enterprise/gui/portal-war/src/main/webapp/js/rhq.js index 85077aa..138a5e5 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/js/rhq.js +++ b/modules/enterprise/gui/portal-war/src/main/webapp/js/rhq.js @@ -181,7 +181,7 @@ function writeProtectInputs(inputs) { * @param form a form element */ function prepareInputsForSubmission(form) { - var inputs = Form.getInputs(form); + var inputs = Form.getElements(form); for ( var i = 0; i < inputs.length; i++) { if (inputs[i].disabled) { // NOTE: It is vital to enable any disabled inputs, since the browser will exclude disabled inputs from the diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/alert/notification/details.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/alert/notification/details.xhtml index 01725e8..d64cc27 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/alert/notification/details.xhtml +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/alert/notification/details.xhtml @@ -117,7 +117,7 @@ </rich:panel>
<h:panelGroup id="customContentPanel" rendered="#{not empty alertNotificationsUIBean.activeNotification}"> - <h:form id="customContentForm"> + <h:form id="customContentForm" onsubmit="prepareInputsForSubmission(this)"> <input type="hidden" name="context" value="#{param.context}"/> <input type="hidden" name="contextId" value="#{param.contextId}"/> <input type="hidden" name="contextSubId" value="#{param.contextSubId}"/> @@ -189,4 +189,4 @@
</ui:composition>
-</html> \ No newline at end of file +</html>
commit bf4a057589b0ce6590043614b14c821cf18ef822 Author: Jay Shaughnessy jshaughn@redhat.com Date: Wed Jul 14 15:14:25 2010 -0400
[BZ 613918] Further ensure manage_bundle permission is sufficient to manipulate bundles and view deployments.
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/BundleResourceDeploymentCriteria.java b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/BundleResourceDeploymentCriteria.java index 5520e0b..4e38e46 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/BundleResourceDeploymentCriteria.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/BundleResourceDeploymentCriteria.java @@ -85,8 +85,12 @@ public class BundleResourceDeploymentCriteria extends Criteria { this.fetchBundleDeployment = fetchBundleDeployment; }
+ // TODO: MANAGE_INVENTORY was too restrictive as a bundle manager could not then + // see his resource deployments. Until we can handle granular authorization checks on + // optionally fetched resource member data, allow a bundle manager to see + // resouce deployments to any platform. /** - * Requires MANAGE_INVENTORY + * Requires MANAGE_INVENTORY or MANAGE_BUNDLE * * @param fetchResource */ diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerBean.java index a70919e..5cf8205 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerBean.java @@ -695,7 +695,9 @@ public class BundleManagerBean implements BundleManagerLocal, BundleManagerRemot
// Create the mapping between the Bundle's Repo and the BundleFile's PackageVersion Repo repo = bundle.getRepo(); - repoManager.addPackageVersionsToRepo(subject, repo.getId(), new int[] { packageVersion.getId() }); + // add the packageVersion as overlord, this allows users without MANAGE_INVENTORY permission to add bundle files + repoManager.addPackageVersionsToRepo(subjectManager.getOverlord(), repo.getId(), new int[] { packageVersion + .getId() });
// Classify the Package with the Bundle name in order to distinguish it from the same package name for // a different bundle. @@ -1151,12 +1153,15 @@ public class BundleManagerBean implements BundleManagerLocal, BundleManagerRemot CriteriaQueryGenerator generator = new CriteriaQueryGenerator(criteria); if (!authorizationManager.isInventoryManager(subject)) { if (criteria.isInventoryManagerRequired()) { - throw new PermissionException("Subject [" + subject.getName() - + "] requires InventoryManager permission for requested query criteria."); + // TODO: MANAGE_INVENTORY was too restrictive as a bundle manager could not then + // see his resource deployments. Until we can handle granular authorization checks on + // optionally fetched resource member data, allow a bundle manager to see + // resouce deployments to any platform. + if (!authorizationManager.hasGlobalPermission(subject, Permission.MANAGE_BUNDLE)) { + throw new PermissionException("Subject [" + subject.getName() + + "] requires InventoryManager or BundleManager permission for requested query criteria."); + } } - - generator.setAuthorizationResourceFragment(CriteriaQueryGenerator.AuthorizationTokenType.RESOURCE, null, - subject.getId()); }
CriteriaQueryRunner<BundleResourceDeployment> queryRunner = new CriteriaQueryRunner<BundleResourceDeployment>(
commit 71f2f42e257b49bf5435b525e1ee36a3798a7bc9 Author: Jay Shaughnessy jshaughn@redhat.com Date: Wed Jul 14 15:12:45 2010 -0400
remove the previous bundle version field, it wasn't available w/o another db rt and the info is already in the name/description.
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/revert/ConfirmationStep.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/revert/ConfirmationStep.java index d71992e..fd7264d 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/revert/ConfirmationStep.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/revert/ConfirmationStep.java @@ -156,13 +156,7 @@ public class ConfirmationStep extends AbstractWizardStep { prevDescItem.setWrap(false); prevDescItem.setValue((null != prev.getName()) ? prev.getName() : "none");
- StaticTextItem prevVersionItem = new StaticTextItem("prevVersion", "Bundle Version"); - prevVersionItem.setTitleAlign(Alignment.LEFT); - prevVersionItem.setAlign(Alignment.LEFT); - prevVersionItem.setWrap(false); - prevVersionItem.setValue(prev.getBundleVersion().getVersion()); - - prevForm.setItems(prevNameItem, prevDescItem, prevVersionItem); + prevForm.setItems(prevNameItem, prevDescItem); layout.addMember(prevForm);
Label confirmation = new Label();
commit 941b75583637be787b795f9935b56b683cbf0a5d Author: Heiko W. Rupp hwr@pilhuhn.de Date: Wed Jul 14 15:31:23 2010 +0200
Don't print to stdout, but use a logger.
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/util/SerialUtility.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/util/SerialUtility.java index 8758b72..7433805 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/util/SerialUtility.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/util/SerialUtility.java @@ -24,19 +24,24 @@ import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.ObjectOutputStream;
+import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + /** * @author Greg Hinkle */ public class SerialUtility {
+ private static Log log = LogFactory.getLog(SerialUtility.class);
public static <T> T prepare(T value, String message) {
long start = System.currentTimeMillis(); try { HibernateDetachUtility.nullOutUninitializedFields(value, HibernateDetachUtility.SerializationType.SERIALIZATION); - - System.out.println("SerialUtility.prepare [" + message + "] Detached in: " + (System.currentTimeMillis() - start) + "ms, Size is: " + serialSize(value)); + if (log.isDebugEnabled()) + log.debug("SerialUtility.prepare [" + message + "] Detached in: " + (System.currentTimeMillis() - start) + + "ms, Size is: " + serialSize(value)); } catch (Exception e) { e.printStackTrace(); } @@ -53,7 +58,7 @@ public class SerialUtility { o.flush(); return baos.size(); } catch (IOException e) { - e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates. + e.printStackTrace(); return -1; } }
commit cc1ce3352c2972f82e9d343faa88cc27a19fb0b7 Author: Greg Hinkle ghinkle@redhat.com Date: Fri Jul 16 14:28:31 2010 -0400
Shared syslog support for linux, solaris, osx via posix parent component
diff --git a/modules/plugins/platform/src/main/java/org/rhq/plugins/platform/LinuxPlatformComponent.java b/modules/plugins/platform/src/main/java/org/rhq/plugins/platform/LinuxPlatformComponent.java index cd4a782..38833eb 100644 --- a/modules/plugins/platform/src/main/java/org/rhq/plugins/platform/LinuxPlatformComponent.java +++ b/modules/plugins/platform/src/main/java/org/rhq/plugins/platform/LinuxPlatformComponent.java @@ -33,9 +33,6 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory;
import org.rhq.core.domain.configuration.Configuration; -import org.rhq.core.domain.configuration.Property; -import org.rhq.core.domain.configuration.PropertyList; -import org.rhq.core.domain.configuration.PropertyMap; import org.rhq.core.domain.configuration.PropertySimple; import org.rhq.core.domain.content.PackageType; import org.rhq.core.domain.content.transfer.ContentResponseResult; @@ -59,7 +56,7 @@ import org.rhq.plugins.platform.content.yum.YumContext; import org.rhq.plugins.platform.content.yum.YumProxy; import org.rhq.plugins.platform.content.yum.YumServer;
-public class LinuxPlatformComponent extends PlatformComponent implements ContentFacet { +public class LinuxPlatformComponent extends PosixPlatformComponent implements ContentFacet { // the prefix for all distro trait names private static final String DISTRO_TRAIT_NAME_PREFIX = "distro.";
@@ -67,18 +64,6 @@ public class LinuxPlatformComponent extends PlatformComponent implements Content private static final String TRAIT_DISTRO_NAME = DISTRO_TRAIT_NAME_PREFIX + "name"; private static final String TRAIT_DISTRO_VERSION = DISTRO_TRAIT_NAME_PREFIX + "version";
- // event tracking plugin config names - public static final String PLUGIN_CONFIG_EVENT_TRACKING_LOGS = "logs"; - public static final String PLUGIN_CONFIG_EVENT_TRACKING_ENABLED = "logTrackingEnabled"; - public static final String PLUGIN_CONFIG_EVENT_TRACKING_INCLUDES_REGEX = "logTrackingIncludesPattern"; - public static final String PLUGIN_CONFIG_EVENT_TRACKING_MIN_SEV = "logTrackingMinimumSeverity"; - public static final String PLUGIN_CONFIG_EVENT_TRACKING_PARSER_REGEX = "logTrackingParserRegex"; - public static final String PLUGIN_CONFIG_EVENT_TRACKING_DATETIME_FORMAT = "logTrackingDateTimeFormat"; - public static final String PLUGIN_CONFIG_EVENT_TRACKING_TYPE = "logTrackingType"; - public static final String PLUGIN_CONFIG_EVENT_TRACKING_PORT = "logTrackingPort"; - public static final String PLUGIN_CONFIG_EVENT_TRACKING_BIND_ADDR = "logTrackingBindAddress"; - public static final String PLUGIN_CONFIG_EVENT_TRACKING_FILE_PATH = "logTrackingFilePath"; - private final Log log = LogFactory.getLog(LinuxPlatformComponent.class);
private ContentContext contentContext; @@ -89,12 +74,6 @@ public class LinuxPlatformComponent extends PlatformComponent implements Content private boolean enableContentDiscovery = false; private boolean enableInternalYumServer = false;
- private enum EventTrackingType { - listener, file - }; - - private List<SyslogListenerEventLogDelegate> listenerEventDelegates; - private List<SyslogFileEventLogDelegate> fileEventDelegates;
@Override public void start(ResourceContext context) { @@ -127,55 +106,12 @@ public class LinuxPlatformComponent extends PlatformComponent implements Content
startWithContentContext(context.getContentContext());
- // prepare the syslog listeners - must shutdown any lingering ones first - PropertyList logs = pluginConfiguration.getList(PLUGIN_CONFIG_EVENT_TRACKING_LOGS); - if (logs != null && logs.getList() != null && logs.getList().size() > 0) { - for (Property logProp : logs.getList()) { - try { - PropertyMap singleLog = (PropertyMap) logProp; - if (singleLog.getSimple(PLUGIN_CONFIG_EVENT_TRACKING_ENABLED).getBooleanValue()) { - if (getEventTrackingType(singleLog) == EventTrackingType.listener) { - // Start up the syslog listener - SyslogListenerEventLogDelegate delegate = new SyslogListenerEventLogDelegate(context, - singleLog); - if (this.listenerEventDelegates == null) { - this.listenerEventDelegates = new ArrayList<SyslogListenerEventLogDelegate>(); - } - this.listenerEventDelegates.add(delegate); - } else if (getEventTrackingType(singleLog) == EventTrackingType.file) { - // Start up the syslog file poller - SyslogFileEventLogDelegate delegate = new SyslogFileEventLogDelegate(context, singleLog); - if (this.fileEventDelegates == null) { - this.fileEventDelegates = new ArrayList<SyslogFileEventLogDelegate>(); - } - this.fileEventDelegates.add(delegate); - } - } - } catch (Exception e) { - log.debug("Failed to prepare for event log [" + logProp + "]", e); - } - } - }
return; }
- private EventTrackingType getEventTrackingType(PropertyMap logConfiguration) { - // default is "file" as described in plugin descriptor - String type = logConfiguration.getSimpleValue(PLUGIN_CONFIG_EVENT_TRACKING_TYPE, EventTrackingType.file.name()); - EventTrackingType typeEnum; - try { - typeEnum = EventTrackingType.valueOf(type.toLowerCase()); - } catch (Exception e) { - typeEnum = EventTrackingType.file; - log.warn("event tracking type is invalid [" + type + "], defaulting to: " + typeEnum); - } - return typeEnum; - } - @Override public void stop() { - shutdownSyslogDelegates();
try { yumServer.halt(); @@ -186,30 +122,6 @@ public class LinuxPlatformComponent extends PlatformComponent implements Content super.stop(); }
- private void shutdownSyslogDelegates() { - if (this.listenerEventDelegates != null) { - for (SyslogListenerEventLogDelegate delegate : this.listenerEventDelegates) { - try { - delegate.shutdown(); - } catch (Exception e) { - log.warn("Failed to shutdown a syslog listener", e); - } - } - this.listenerEventDelegates.clear(); - } - - if (this.fileEventDelegates != null) { - for (SyslogFileEventLogDelegate delegate : this.fileEventDelegates) { - try { - delegate.shutdown(); - } catch (Exception e) { - log.warn("Failed to shutdown a syslog file poller", e); - } - } - this.fileEventDelegates.clear(); - } - } - private void startWithContentContext(ContentContext context) { if (this.enableInternalYumServer) { int port = yumPort(); diff --git a/modules/plugins/platform/src/main/java/org/rhq/plugins/platform/PlatformDiscoveryComponent.java b/modules/plugins/platform/src/main/java/org/rhq/plugins/platform/PlatformDiscoveryComponent.java index dcfaf2b..d7e9ef9 100644 --- a/modules/plugins/platform/src/main/java/org/rhq/plugins/platform/PlatformDiscoveryComponent.java +++ b/modules/plugins/platform/src/main/java/org/rhq/plugins/platform/PlatformDiscoveryComponent.java @@ -27,6 +27,7 @@ import java.util.Collections; import java.util.HashSet; import java.util.Set;
+import org.rhq.core.domain.configuration.Configuration; import org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails; import org.rhq.core.pluginapi.inventory.ResourceDiscoveryComponent; import org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext; @@ -73,6 +74,9 @@ public abstract class PlatformDiscoveryComponent implements ResourceDiscoveryCom version = "?"; }
+ Configuration config = context.getDefaultPluginConfiguration(); + discoverConfiguration(config); + DiscoveredResourceDetails discoveredResource = new DiscoveredResourceDetails(context.getResourceType(), key, name, version, description, null, null);
@@ -82,6 +86,14 @@ public abstract class PlatformDiscoveryComponent implements ResourceDiscoveryCom }
/** + * Override this method to add additional configurations to discovered platforms + * @param configuration + */ + protected void discoverConfiguration(Configuration configuration) { + + } + + /** * This will determine what the new platform's resource key should be. This default * implementation first tries to use the plugin container's name which is guaranteed * to be unique across all agents/plugin containers. If, for some odd reason, it is diff --git a/modules/plugins/platform/src/main/java/org/rhq/plugins/platform/PosixPlatformComponent.java b/modules/plugins/platform/src/main/java/org/rhq/plugins/platform/PosixPlatformComponent.java new file mode 100644 index 0000000..7327067 --- /dev/null +++ b/modules/plugins/platform/src/main/java/org/rhq/plugins/platform/PosixPlatformComponent.java @@ -0,0 +1,146 @@ +/* + * RHQ Management Platform + * Copyright (C) 2005-2010 Red Hat, Inc. + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License, version 2, as + * published by the Free Software Foundation, and/or the GNU Lesser + * General Public License, version 2.1, also as published by the Free + * Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License and the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License + * and the GNU Lesser General Public License along with this program; + * if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +package org.rhq.plugins.platform; + +import java.util.ArrayList; +import java.util.List; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +import org.rhq.core.domain.configuration.Configuration; +import org.rhq.core.domain.configuration.Property; +import org.rhq.core.domain.configuration.PropertyList; +import org.rhq.core.domain.configuration.PropertyMap; +import org.rhq.core.pluginapi.inventory.ResourceContext; + +/** + * @author Greg Hinkle + */ +public class PosixPlatformComponent extends PlatformComponent { + + private final Log log = LogFactory.getLog(PosixPlatformComponent.class); + + + protected List<SyslogListenerEventLogDelegate> listenerEventDelegates; + protected List<SyslogFileEventLogDelegate> fileEventDelegates; + // event tracking plugin config names + public static final String PLUGIN_CONFIG_EVENT_TRACKING_LOGS = "logs"; + public static final String PLUGIN_CONFIG_EVENT_TRACKING_ENABLED = "logTrackingEnabled"; + public static final String PLUGIN_CONFIG_EVENT_TRACKING_INCLUDES_REGEX = "logTrackingIncludesPattern"; + public static final String PLUGIN_CONFIG_EVENT_TRACKING_MIN_SEV = "logTrackingMinimumSeverity"; + public static final String PLUGIN_CONFIG_EVENT_TRACKING_PARSER_REGEX = "logTrackingParserRegex"; + public static final String PLUGIN_CONFIG_EVENT_TRACKING_DATETIME_FORMAT = "logTrackingDateTimeFormat"; + public static final String PLUGIN_CONFIG_EVENT_TRACKING_TYPE = "logTrackingType"; + public static final String PLUGIN_CONFIG_EVENT_TRACKING_PORT = "logTrackingPort"; + public static final String PLUGIN_CONFIG_EVENT_TRACKING_BIND_ADDR = "logTrackingBindAddress"; + public static final String PLUGIN_CONFIG_EVENT_TRACKING_FILE_PATH = "logTrackingFilePath"; + + + protected enum EventTrackingType { + listener, file + }; + + + + @Override + public void start(ResourceContext context) { + super.start(context); + + Configuration pluginConfiguration = context.getPluginConfiguration(); + + // prepare the syslog listeners - must shutdown any lingering ones first + PropertyList logs = pluginConfiguration.getList(PLUGIN_CONFIG_EVENT_TRACKING_LOGS); + if (logs != null && logs.getList() != null && logs.getList().size() > 0) { + for (Property logProp : logs.getList()) { + try { + PropertyMap singleLog = (PropertyMap) logProp; + if (singleLog.getSimple(PLUGIN_CONFIG_EVENT_TRACKING_ENABLED).getBooleanValue()) { + if (getEventTrackingType(singleLog) == EventTrackingType.listener) { + // Start up the syslog listener + SyslogListenerEventLogDelegate delegate = new SyslogListenerEventLogDelegate(context, + singleLog); + if (this.listenerEventDelegates == null) { + this.listenerEventDelegates = new ArrayList<SyslogListenerEventLogDelegate>(); + } + this.listenerEventDelegates.add(delegate); + } else if (getEventTrackingType(singleLog) == EventTrackingType.file) { + // Start up the syslog file poller + SyslogFileEventLogDelegate delegate = new SyslogFileEventLogDelegate(context, singleLog); + if (this.fileEventDelegates == null) { + this.fileEventDelegates = new ArrayList<SyslogFileEventLogDelegate>(); + } + this.fileEventDelegates.add(delegate); + } + } + } catch (Exception e) { + log.debug("Failed to prepare for event log [" + logProp + "]", e); + } + } + } + } + + private LinuxPlatformComponent.EventTrackingType getEventTrackingType(PropertyMap logConfiguration) { + // default is "file" as described in plugin descriptor + String type = logConfiguration.getSimpleValue(PLUGIN_CONFIG_EVENT_TRACKING_TYPE, LinuxPlatformComponent.EventTrackingType.file.name()); + LinuxPlatformComponent.EventTrackingType typeEnum; + try { + typeEnum = LinuxPlatformComponent.EventTrackingType.valueOf(type.toLowerCase()); + } catch (Exception e) { + typeEnum = LinuxPlatformComponent.EventTrackingType.file; + log.warn("event tracking type is invalid [" + type + "], defaulting to: " + typeEnum); + } + return typeEnum; + } + + protected void shutdownSyslogDelegates() { + if (this.listenerEventDelegates != null) { + for (SyslogListenerEventLogDelegate delegate : this.listenerEventDelegates) { + try { + delegate.shutdown(); + } catch (Exception e) { + log.warn("Failed to shutdown a syslog listener", e); + } + } + this.listenerEventDelegates.clear(); + } + + if (this.fileEventDelegates != null) { + for (SyslogFileEventLogDelegate delegate : this.fileEventDelegates) { + try { + delegate.shutdown(); + } catch (Exception e) { + log.warn("Failed to shutdown a syslog file poller", e); + } + } + this.fileEventDelegates.clear(); + } + } + + @Override + public void stop() { + shutdownSyslogDelegates(); + + super.stop(); + } +} diff --git a/modules/plugins/platform/src/main/resources/META-INF/rhq-plugin.xml b/modules/plugins/platform/src/main/resources/META-INF/rhq-plugin.xml index 7ee308e..22f4cb1 100644 --- a/modules/plugins/platform/src/main/resources/META-INF/rhq-plugin.xml +++ b/modules/plugins/platform/src/main/resources/META-INF/rhq-plugin.xml @@ -144,7 +144,46 @@ defaultOn="true" defaultInterval="3600000" description="Cache Size of this CPU"/> -'> +'> + +<!ENTITY syslogEventConfigurationGroup ' + <c:group name="Event Logs"> + <c:description>Tracking of syslog events</c:description> + <c:list-property name="logs"> + <c:map-property name="log"> + <c:simple-property name="logTrackingEnabled" summary="true" type="boolean" required="true" default="false" description="Enables the collection of syslog events"/> + <c:simple-property name="logTrackingIncludesPattern" displayName="Includes Pattern" required="false" description="A regular expression that is matched against a log message's detail text to determine if an Event should be fired for that log message. If not specified, no filtering of log messages will be done based on their detail."/> + <c:simple-property name="logTrackingMinimumSeverity" displayName="Minimum Severity" required="false" default="Warning" description="The minimum severity of log messages that will be collected. If not specified, there is no minimum severity (i.e. all will be collected)."> + <c:property-options> + <c:option value="Information"/> + <c:option value="Warning" default="true"/> + <c:option value="Error"/> + </c:property-options> + </c:simple-property> + <c:simple-property name="logTrackingType" summary="true" required="true" default="file" description="Defines if the log messages are to be found by polling a file or listening to a TCP socket"> + <c:property-options> + <c:option value="file" default="true"/> + <c:option value="listener"/> + </c:property-options> + </c:simple-property> + <c:simple-property name="logTrackingPort" summary="true" displayName="Syslog Listener Port" required="false" type="integer" default="514" description="Port that the syslog listener will run on if using listener style. If not defined, the default will be 514."> + <c:constraint> + <c:integer-constraint minimum="1" maximum="65535"/> + </c:constraint> + </c:simple-property> + <c:simple-property name="logTrackingBindAddress" displayName="Syslog Listener Bind Address" required="false" type="string" default="127.0.0.1" description="Address that the syslog listener will bind to if using listener style"/> + <c:simple-property name="logTrackingFilePath" summary="true" displayName="Syslog File Path" required="false" type="file" default="/var/log/messages" description="File path to watch for log events if using file style. If not defined, the default will be /var/log/messages"/> + <c:simple-property name="logTrackingParserRegex" displayName="Message Parser Regular Expression" required="false" description="A regular expression used to parse the different pieces of the log messages. This regex must have 3 capturing groups - #1 is the timestamp, #2 is the severity and #3 is the message details text. If not defined, a best guess will be made to parse the log messages."/> + <c:simple-property name="logTrackingDateTimeFormat" displayName="Date/Time Format" required="false" description="A regular expression that indicates how the message's date/timestamp is formatted. See the Javadoc on java.text.SimpleDateFormat for the syntax of this regex. If not defined, the date will not be parsed and the time the message was seen will be used."/> + </c:map-property> + </c:list-property> + </c:group> +'> + +<!ENTITY syslogEventDefinition ' + <event name="Event Log" description="Syslog event logs" displayName="Event Log"/> +'> + ]>
<plugin name="Platforms" @@ -257,37 +296,9 @@ </c:constraint> </c:simple-property> </c:group> - <c:group name="Event Logs"> - <c:description>Tracking of syslog events</c:description> - <c:list-property name="logs"> - <c:map-property name="log"> - <c:simple-property name="logTrackingEnabled" summary="true" type="boolean" required="true" default="false" description="Enables the collection of syslog events"/> - <c:simple-property name="logTrackingIncludesPattern" displayName="Includes Pattern" required="false" description="A regular expression that is matched against a log message's detail text to determine if an Event should be fired for that log message. If not specified, no filtering of log messages will be done based on their detail."/> - <c:simple-property name="logTrackingMinimumSeverity" displayName="Minimum Severity" required="false" default="Warning" description="The minimum severity of log messages that will be collected. If not specified, there is no minimum severity (i.e. all will be collected)."> - <c:property-options> - <c:option value="Information"/> - <c:option value="Warning" default="true"/> - <c:option value="Error"/> - </c:property-options> - </c:simple-property> - <c:simple-property name="logTrackingType" summary="true" required="true" default="file" description="Defines if the log messages are to be found by polling a file or listening to a TCP socket"> - <c:property-options> - <c:option value="file" default="true"/> - <c:option value="listener"/> - </c:property-options> - </c:simple-property> - <c:simple-property name="logTrackingPort" summary="true" displayName="Syslog Listener Port" required="false" type="integer" default="514" description="Port that the syslog listener will run on if using listener style. If not defined, the default will be 514."> - <c:constraint> - <c:integer-constraint minimum="1" maximum="65535"/> - </c:constraint> - </c:simple-property> - <c:simple-property name="logTrackingBindAddress" displayName="Syslog Listener Bind Address" required="false" type="string" default="127.0.0.1" description="Address that the syslog listener will bind to if using listener style"/> - <c:simple-property name="logTrackingFilePath" summary="true" displayName="Syslog File Path" required="false" type="file" default="/var/log/messages" description="File path to watch for log events if using file style. If not defined, the default will be /var/log/messages"/> - <c:simple-property name="logTrackingParserRegex" displayName="Message Parser Regular Expression" required="false" description="A regular expression used to parse the different pieces of the log messages. This regex must have 3 capturing groups - #1 is the timestamp, #2 is the severity and #3 is the message details text. If not defined, a best guess will be made to parse the log messages."/> - <c:simple-property name="logTrackingDateTimeFormat" displayName="Date/Time Format" required="false" description="A regular expression that indicates how the message's date/timestamp is formatted. See the Javadoc on java.text.SimpleDateFormat for the syntax of this regex. If not defined, the date will not be parsed and the time the message was seen will be used."/> - </c:map-property> - </c:list-property> - </c:group> + + &syslogEventConfigurationGroup; + </plugin-configuration>
&platformOperations; @@ -311,8 +322,7 @@ displayType="summary" defaultOn="true" />
- <event name="Event Log" description="Syslog event logs" displayName="Event Log"/> - + &syslogEventDefinition;
<content name="rpm" displayName="RPM File" category="deployable" description="Red Hat installable package"> <configuration> @@ -334,14 +344,21 @@ </platform>
<platform name="Solaris" - class="PlatformComponent" + class="PosixPlatformComponent" discovery="SolarisPlatformDiscoveryComponent" description="SUN Solaris Operating System"> + + <plugin-configuration> + &syslogEventConfigurationGroup; + </plugin-configuration> + &platformSubcategories; &platformOperations; &nativeMetrics; &platformCpu; &metrics; + &syslogEventDefinition; + </platform>
<platform name="HP-UX" @@ -378,14 +395,19 @@ </platform>
<platform name="Mac OS X" - class="PlatformComponent" + class="PosixPlatformComponent" discovery="MacOSXPlatformDiscoveryComponent" description="Mac OS X Operating System"> + <plugin-configuration> + &syslogEventConfigurationGroup; + </plugin-configuration> + &platformSubcategories; &platformOperations; &nativeMetrics; &platformCpu; &metrics; + &syslogEventDefinition; </platform>
<platform name="Java"
commit fa321620bdaddb71fd466d15b7b53139dc58477b Author: Greg Hinkle ghinkle@redhat.com Date: Fri Jul 16 14:26:57 2010 -0400
More GWT links
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LinkManager.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LinkManager.java index e2f61cd..fc93906 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LinkManager.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LinkManager.java @@ -72,7 +72,11 @@ public class LinkManager {
public static String getAutodiscoveryQueueLink() { - return "/rhq/discovery/queue.xhtml"; + if (GWT) { + return "#Administration/Security/Auto%20Discovery%20Queue"; + } else { + return "/rhq/discovery/queue.xhtml"; + } }
public static String getDashboardLink() { @@ -93,15 +97,27 @@ public class LinkManager { }
public static String getHubPlatformsLink() { - return "/rhq/inventory/browseResources.xhtml?subtab=platform"; + if (GWT) { + return "#Inventory/Platforms"; + } else { + return "/rhq/inventory/browseResources.xhtml?subtab=platform"; + } }
public static String getHubServerssLink() { - return "/rhq/inventory/browseResources.xhtml?subtab=server"; + if (GWT) { + return "#Inventory/Serers"; + } else { + return "/rhq/inventory/browseResources.xhtml?subtab=server"; + } }
public static String getHubServicesLink() { - return "/rhq/inventory/browseResources.xhtml?subtab=service"; + if (GWT) { + return "#Inventory/Services"; + } else { + return "/rhq/inventory/browseResources.xhtml?subtab=service"; + } }
@@ -138,7 +154,7 @@ public class LinkManager {
public static String getAdminUsersLink() { if (GWT) { - return "#Administration/Security/Manage%20Users"; + return "#Administration/Security/Manage Users"; } else { return "/admin/user/UserAdmin.do?mode=list"; } @@ -146,17 +162,17 @@ public class LinkManager {
public static String getAdminRolesLink() { if (GWT) { - return "#Administration/Security/Manage%20Roles"; + return "#Administration/Security/Manage Roles"; } else { - return "/admin/role/RoleAdmin.do?mode=list"; + return "/admin/role/RoleAdmin.do?mode=list"; } }
public static String getAdminSysConfigLink() { if (GWT) { - return "#Administration/Configuration/System%20Settings"; + return "#Administration/Configuration/System Settings"; } else { - return "/admin/config/Config.do?mode=edit"; + return "/admin/config/Config.do?mode=edit"; } }
@@ -171,7 +187,11 @@ public class LinkManager {
public static String getAdminTemplatesLink() { - return "/admin/config/EditDefaults.do?mode=monitor&viewMode=all"; + if (GWT) { + return "#Administration/Configuration/Templates"; + } else { + return "/admin/config/EditDefaults.do?mode=monitor&viewMode=all"; + } }
public static String getAdminAlertNotifTemplatesLink() { @@ -189,24 +209,44 @@ public class LinkManager {
public static String getHAServersLink() { - return "/rhq/ha/listServers.xhtml"; + if (GWT) { + return "#Administration/Cluster/Servers"; + } else { + return "/rhq/ha/listServers.xhtml"; + } }
public static String getHAAgentsLink() { - return "/rhq/ha/listAgents.xhtml"; + if (GWT) { + return "#Administration/Cluster/Agents"; + } else { + return "/rhq/ha/listAgents.xhtml"; + } }
public static String getHAAffinityGroupsLink() { - return "/rhq/ha/listAffinityGroups.xhtml"; + if (GWT) { + return "#Administration/Cluster/Affinity Groups"; + } else { + return "/rhq/ha/listAffinityGroups.xhtml"; + } }
public static String getHAEventsLink() { - return "/rhq/ha/listPartitionEvents.xhtml"; + if (GWT) { + return "#Administration/Cluster/Partition Events"; + } else { + return "/rhq/ha/listPartitionEvents.xhtml"; + } }
public static String getReportsInventoryLink() { - return "/rhq/admin/report/resourceInstallReport.xhtml"; + if (GWT) { + return "#Administration/Reports/Inventory Summary"; + } else { + return "/rhq/admin/report/resourceInstallReport.xhtml"; + } }
public static String getAdminDownloadsLink() {
commit 13d2385b605749b63818b010ce2c6eb19013828d Author: Greg Hinkle ghinkle@redhat.com Date: Fri Jul 16 14:26:49 2010 -0400
Manually add parentless types to platforms
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTreeView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTreeView.java index 5faf1c0..701c176 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTreeView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTreeView.java @@ -19,12 +19,15 @@ package org.rhq.enterprise.gui.coregui.client.inventory.resource.detail;
import org.rhq.core.domain.configuration.PropertySimple; +import org.rhq.core.domain.criteria.ResourceTypeCriteria; import org.rhq.core.domain.dashboard.Dashboard; import org.rhq.core.domain.dashboard.DashboardPortlet; import org.rhq.core.domain.measurement.MeasurementDefinition; import org.rhq.core.domain.operation.OperationDefinition; import org.rhq.core.domain.resource.Resource; +import org.rhq.core.domain.resource.ResourceCategory; import org.rhq.core.domain.resource.ResourceType; +import org.rhq.core.domain.util.PageList; import org.rhq.enterprise.gui.coregui.client.Breadcrumb; import org.rhq.enterprise.gui.coregui.client.CoreGUI; import org.rhq.enterprise.gui.coregui.client.ViewId; @@ -33,6 +36,7 @@ import org.rhq.enterprise.gui.coregui.client.components.configuration.Configurat import org.rhq.enterprise.gui.coregui.client.dashboard.portlets.inventory.resource.graph.GraphPortlet; import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup; import org.rhq.enterprise.gui.coregui.client.gwt.ResourceGWTServiceAsync; +import org.rhq.enterprise.gui.coregui.client.gwt.ResourceTypeGWTServiceAsync; import org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceSelectListener; import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.operation.create.OperationCreateWizard; import org.rhq.enterprise.gui.coregui.client.inventory.resource.factory.ResourceFactoryCreateWizard; @@ -287,11 +291,39 @@ public class ResourceTreeView extends VLayout { //todo action } } + if (resourceType.getCategory() == ResourceCategory.PLATFORM) { + loadManuallyAddServersToPlatforms(importChildSubMenu); + } importChildMenu.setSubmenu(importChildSubMenu); importChildMenu.setEnabled(importChildSubMenu.getItems().length > 0); contextMenu.addItem(importChildMenu); }
+ + private void loadManuallyAddServersToPlatforms(final Menu manuallyAddMenu) { + ResourceTypeGWTServiceAsync rts = GWTServiceLookup.getResourceTypeGWTService(); + + ResourceTypeCriteria criteria = new ResourceTypeCriteria(); + criteria.addFilterSupportsManualAdd(true); + criteria.fetchParentResourceTypes(true); + rts.findResourceTypesByCriteria(criteria, + new AsyncCallback<PageList<ResourceType>>() { + public void onFailure(Throwable caught) { + CoreGUI.getErrorHandler().handleError("Failed to load platform manual add children",caught); + } + + public void onSuccess(PageList<ResourceType> result) { + for (ResourceType type : result) { + if (type.getParentResourceTypes() == null || type.getParentResourceTypes().isEmpty()) { + MenuItem item = new MenuItem(type.getName()); + manuallyAddMenu.addItem(item); + } + } + } + }); + } + + private MenuItem buildMetricsMenu(final ResourceType type) { MenuItem measurements = new MenuItem("Measurements"); final Menu measurementsSubMenu = new Menu();
commit 64bb38f5c995a7664dc03929b7cd09d6ce0de028 Author: Greg Hinkle ghinkle@redhat.com Date: Fri Jul 16 14:26:20 2010 -0400
Re-enable alert and favorite footers in master
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/Footer.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/Footer.java index 2e3e242..65fc203 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/Footer.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/Footer.java @@ -70,9 +70,9 @@ public class Footer extends ToolStrip {
addMember(new ToolStripSeparator());
-// addMember(new FavoritesButton()); + addMember(new FavoritesButton());
-// addMember(new AlertsMessage()); + addMember(new AlertsMessage());
}
commit 73e9a6749b3cc9bf772c4f91bc937bf318aa968c Author: Greg Hinkle ghinkle@redhat.com Date: Fri Jul 16 14:25:58 2010 -0400
Fix event source display
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/event/EventDatasource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/event/EventDatasource.java index f8656e3..41e7971 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/event/EventDatasource.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/event/EventDatasource.java @@ -123,7 +123,7 @@ public class EventDatasource extends RPCDataSource<Event> { record.setAttribute("detailExcerpt", from.getDetailExcerpt()); record.setAttribute("severity", from.getSeverity().name()); record.setAttribute("source", from.getSource()); - record.setAttribute("sourceLocation", from.getSourceLocation()); + record.setAttribute("sourceLocation", from.getSource().getLocation()); record.setAttribute("type", from.getType()); record.setAttribute("timestamp", new Date(from.getTimestamp()));
commit 0a9ed45bd93e28c2370cc2466dcdea2d19864298 Author: Joseph Marques joseph@redhat.com Date: Fri Jul 16 13:48:35 2010 -0400
BZ-615351: respect user's authorization when displaying suggestions
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/AbstractSearchAssistant.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/AbstractSearchAssistant.java index 94a2bd5..6ba0c9c 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/AbstractSearchAssistant.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/AbstractSearchAssistant.java @@ -13,14 +13,30 @@ import javax.persistence.Query; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory;
+import org.rhq.core.domain.auth.Subject; import org.rhq.enterprise.server.util.LookupUtil;
public abstract class AbstractSearchAssistant implements SearchAssistant {
private final Log log = LogFactory.getLog(SearchAssistant.class);
+ private int subjectId; + private boolean requiresAuthorizationFragment; private int maxResultCount = 20;
+ public AbstractSearchAssistant(Subject subject) { + this.subjectId = subject.getId(); + this.requiresAuthorizationFragment = !LookupUtil.getAuthorizationManager().isInventoryManager(subject); + } + + public int getSubjectId() { + return subjectId; + } + + public boolean requiresAuthorizationFragment() { + return requiresAuthorizationFragment; + } + public int getMaxResultCount() { return maxResultCount; } @@ -104,6 +120,14 @@ public abstract class AbstractSearchAssistant implements SearchAssistant { return " AND " + getJPQLForString(fragment, filter); }
+ protected final String conditionallyAddAuthzFragment(String fragment) { + if (requiresAuthorizationFragment == false) { + return ""; + } + + return " AND " + fragment; + } + protected final List<String> filter(Class<? extends Enum<?>> enumType, String filter) { return filter(enumType, filter, false); } diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/GroupSearchAssistant.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/GroupSearchAssistant.java index be85fc5..ce31d79 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/GroupSearchAssistant.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/GroupSearchAssistant.java @@ -4,6 +4,7 @@ import java.util.Arrays; import java.util.Collections; import java.util.List;
+import org.rhq.core.domain.auth.Subject; import org.rhq.core.domain.measurement.AvailabilityType; import org.rhq.core.domain.resource.ResourceCategory; import org.rhq.core.domain.search.SearchSubsystem; @@ -19,8 +20,8 @@ public class GroupSearchAssistant extends TabAwareSearchAssistant { "name")); }
- public GroupSearchAssistant(String tab) { - super(tab); + public GroupSearchAssistant(Subject subject, String tab) { + super(subject, tab); }
public SearchSubsystem getSearchSubsystem() { @@ -64,6 +65,7 @@ public class GroupSearchAssistant extends TabAwareSearchAssistant { + " AND rg.visible = true " // + conditionallyAddJPQLString("type.name", filter) // + conditionallyAddJPQLString("rg.groupCategory", tab) // + + conditionallyAddAuthzFragment(getAuthzFragment()) // + " ORDER BY type.name ");
} else if (context.equals("plugin")) { @@ -74,6 +76,7 @@ public class GroupSearchAssistant extends TabAwareSearchAssistant { + " AND rg.visible = true " // + conditionallyAddJPQLString("type.plugin", filter) // + conditionallyAddJPQLString("rg.groupCategory", tab) // + + conditionallyAddAuthzFragment(getAuthzFragment()) // + " ORDER BY type.plugin ");
} else if (context.equals("name")) { @@ -83,6 +86,7 @@ public class GroupSearchAssistant extends TabAwareSearchAssistant { + " WHERE rg.visible = true " // only suggest names that exist for visible groups in inventory + conditionallyAddJPQLString("rg.name", filter) // + conditionallyAddJPQLString("rg.groupCategory", tab) // + + conditionallyAddAuthzFragment(getAuthzFragment()) // + " ORDER BY rg.name ");
} else { @@ -91,4 +95,13 @@ public class GroupSearchAssistant extends TabAwareSearchAssistant { } }
+ private String getAuthzFragment() { + return "rg.id IN " // + + "(SELECT igroup.id " // + + " FROM ResourceGroup igroup " // + + " JOIN igroup.roles irole " // + + " JOIN irole.subjects isubject " // + + " WHERE isubject.id = " + getSubjectId() + ")"; + } + } diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/ResourceSearchAssistant.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/ResourceSearchAssistant.java index 671095f..95295d0 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/ResourceSearchAssistant.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/ResourceSearchAssistant.java @@ -5,6 +5,7 @@ import java.util.Collections; import java.util.List;
import org.rhq.core.domain.alert.AlertPriority; +import org.rhq.core.domain.auth.Subject; import org.rhq.core.domain.measurement.AvailabilityType; import org.rhq.core.domain.resource.ResourceCategory; import org.rhq.core.domain.search.SearchSubsystem; @@ -22,8 +23,8 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant { "name")); }
- public ResourceSearchAssistant(String tab) { - super(tab); + public ResourceSearchAssistant(Subject subject, String tab) { + super(subject, tab); }
public SearchSubsystem getSearchSubsystem() { @@ -69,6 +70,7 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant { + " AND simpleDefinition.type <> 'PASSWORD' " // do not suggest hidden/password property types + conditionallyAddJPQLString("definition.name", filter) // + conditionallyAddJPQLString("type.category", tab) // + + conditionallyAddAuthzFragment(getAuthzFragment()) // + " ORDER BY definition.name ");
} else if (context.equals("configuration")) { @@ -81,6 +83,7 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant { + " AND simpleDefinition.type <> 'PASSWORD' " // do not suggest hidden/password property types + conditionallyAddJPQLString("definition.name", filter) // + conditionallyAddJPQLString("type.category", tab) // + + conditionallyAddAuthzFragment(getAuthzFragment()) // + " ORDER BY definition.name ");
} else if (context.equals("trait")) { @@ -92,6 +95,7 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant { + " AND def.dataType = 1 " // trait types + conditionallyAddJPQLString("ms.definition.name", filter) // + conditionallyAddJPQLString("res.resourceType.category", tab) // + + conditionallyAddAuthzFragment(getAuthzFragment()) // + " ORDER BY def.name ");
} else { @@ -115,6 +119,7 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant { + " WHERE res.resourceType = type " // + conditionallyAddJPQLString("type.name", filter) // + conditionallyAddJPQLString("type.category", tab) // + + conditionallyAddAuthzFragment(getAuthzFragment()) // + " ORDER BY type.name ");
} else if (context.equals("plugin")) { @@ -124,6 +129,7 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant { + " WHERE res.resourceType = type " // + conditionallyAddJPQLString("type.plugin", filter) // + conditionallyAddJPQLString("type.category", tab) // + + conditionallyAddAuthzFragment(getAuthzFragment()) // + " ORDER BY type.plugin ");
} else if (context.equals("name")) { @@ -133,6 +139,7 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant { + " WHERE res.resourceType = type " // + conditionallyAddJPQLString("res.name", filter) // + conditionallyAddJPQLString("type.category", tab) // + + conditionallyAddAuthzFragment(getAuthzFragment()) // + " ORDER BY res.name ");
} else if (context.equals("alerts")) { @@ -151,6 +158,7 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant { + conditionallyAddJPQLString("property.name", param) // + conditionallyAddJPQLString("property.stringValue", filter) // + conditionallyAddJPQLString("res.resourceType.category", tab) // + + conditionallyAddAuthzFragment(getAuthzFragment()) // + " ORDER BY simple.stringValue ");
} else if (context.equals("configuration")) { @@ -166,6 +174,7 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant { + conditionallyAddJPQLString("property.name", param) // + conditionallyAddJPQLString("property.stringValue", filter) // + conditionallyAddJPQLString("res.resourceType.category", tab) // + + conditionallyAddAuthzFragment(getAuthzFragment()) // + " ORDER BY simple.stringValue ");
} else if (context.equals("trait")) { @@ -178,6 +187,7 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant { + conditionallyAddJPQLString("ms.definition.name", param) // + conditionallyAddJPQLString("trait.value", filter) // + conditionallyAddJPQLString("res.resourceType.category", tab) // + + conditionallyAddAuthzFragment(getAuthzFragment()) // + " ORDER BY trait.value ");
} else { @@ -185,4 +195,14 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant {
} } + + private String getAuthzFragment() { + return "res.id IN " // + + "(SELECT ires.id " // + + " FROM Resource ires " // + + " JOIN ires.implicitGroups igroup " // + + " JOIN igroup.roles irole " // + + " JOIN irole.subjects isubject " // + + " WHERE isubject.id = " + getSubjectId() + ")"; + } } diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/SearchAssistantFactory.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/SearchAssistantFactory.java index 9caafec..040d15f 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/SearchAssistantFactory.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/SearchAssistantFactory.java @@ -1,5 +1,6 @@ package org.rhq.enterprise.server.search.assist;
+import org.rhq.core.domain.auth.Subject; import org.rhq.core.domain.search.SearchSubsystem;
public class SearchAssistantFactory { @@ -7,21 +8,21 @@ public class SearchAssistantFactory { // force use of static methods only }
- public static SearchAssistant getAssistant(SearchSubsystem searchContext) { + public static SearchAssistant getAssistant(Subject subject, SearchSubsystem searchContext) { if (searchContext == SearchSubsystem.RESOURCE) { - return new ResourceSearchAssistant(null); + return new ResourceSearchAssistant(subject, null); } else if (searchContext == SearchSubsystem.GROUP) { - return new GroupSearchAssistant(null); + return new GroupSearchAssistant(subject, null); } else { throw new IllegalArgumentException("No SearchAssistant found for SearchSubsystem[" + searchContext + "]"); } }
- public static SearchAssistant getTabAwareAssistant(SearchSubsystem searchContext, String tab) { + public static SearchAssistant getTabAwareAssistant(Subject subject, SearchSubsystem searchContext, String tab) { if (searchContext == SearchSubsystem.RESOURCE) { - return new ResourceSearchAssistant(tab); + return new ResourceSearchAssistant(subject, tab); } else if (searchContext == SearchSubsystem.GROUP) { - return new GroupSearchAssistant(tab); + return new GroupSearchAssistant(subject, tab); } else { throw new IllegalArgumentException("No SearchAssistant found for SearchSubsystem[" + searchContext + "]"); } diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/TabAwareSearchAssistant.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/TabAwareSearchAssistant.java index a68dc60..27f17b3 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/TabAwareSearchAssistant.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/TabAwareSearchAssistant.java @@ -1,9 +1,12 @@ package org.rhq.enterprise.server.search.assist;
+import org.rhq.core.domain.auth.Subject; + public abstract class TabAwareSearchAssistant extends AbstractSearchAssistant { protected String tab;
- public TabAwareSearchAssistant(String tab) { + public TabAwareSearchAssistant(Subject subject, String tab) { + super(subject); if (tab != null) { tab = tab.trim().toLowerCase(); if (tab.equals("")) { diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java index 92138bf..9a7d352 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java @@ -344,11 +344,11 @@ public class SearchAssistManager { }
protected SearchAssistant getSearchAssistant() { - return SearchAssistantFactory.getAssistant(searchSubsystem); + return SearchAssistantFactory.getAssistant(subject, searchSubsystem); }
protected SearchAssistant getTabAwareSearchAssistant(String tab) { - return SearchAssistantFactory.getTabAwareAssistant(searchSubsystem, tab); + return SearchAssistantFactory.getTabAwareAssistant(subject, searchSubsystem, tab); }
private List<String> getAllContexts() { diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchTranslationManager.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchTranslationManager.java index 53f1f87..855d89d 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchTranslationManager.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchTranslationManager.java @@ -24,6 +24,7 @@ import org.rhq.enterprise.server.search.translation.antlr.RHQLTerm; import org.rhq.enterprise.server.search.translation.antlr.RHQLTreeOperator; import org.rhq.enterprise.server.search.translation.jpql.SearchFragment; import org.rhq.enterprise.server.search.translation.jpql.SearchFragmentType; +import org.rhq.enterprise.server.util.LookupUtil;
public class SearchTranslationManager {
@@ -54,7 +55,8 @@ public class SearchTranslationManager { this.expression = expression;
this.translator = SearchTranslatorFactory.getTranslator(this.context); - this.assistant = SearchAssistantFactory.getAssistant(this.context); + this.assistant = SearchAssistantFactory + .getAssistant(LookupUtil.getSubjectManager().getOverlord(), this.context);
ANTLRStringStream input = new ANTLRStringStream(this.expression); // Create an input character stream from standard in this.lexer = new RHQLLexer(input); // Create an echoLexer that feeds from that stream diff --git a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/search/TestAutoCompletionManager.java b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/search/TestAutoCompletionManager.java index 3b658c7..67bff40 100644 --- a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/search/TestAutoCompletionManager.java +++ b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/search/TestAutoCompletionManager.java @@ -6,6 +6,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map;
+import org.rhq.core.domain.auth.Subject; import org.rhq.core.domain.search.SearchSubsystem; import org.rhq.enterprise.server.search.assist.AbstractSearchAssistant; import org.rhq.enterprise.server.search.assist.SearchAssistant; @@ -33,6 +34,10 @@ public class TestAutoCompletionManager extends SearchAssistManager { return Collections.unmodifiableList(Arrays.asList(items)); }
+ public TestAutoCompletor(Subject subject) { + super(subject); + } + @Override public SearchSubsystem getSearchSubsystem() { return null; @@ -68,11 +73,11 @@ public class TestAutoCompletionManager extends SearchAssistManager {
@Override protected AbstractSearchAssistant getSearchAssistant() { - return new TestAutoCompletor(); + return new TestAutoCompletor(LookupUtil.getSubjectManager().getOverlord()); }
@Override protected SearchAssistant getTabAwareSearchAssistant(String tab) { - return new TestAutoCompletor(); + return new TestAutoCompletor(LookupUtil.getSubjectManager().getOverlord()); } }
commit 03e5cb45737b76780214ffa33dd27af87ac9fcf4 Author: Jay Shaughnessy jshaughn@redhat.com Date: Fri Jul 16 11:35:59 2010 -0400
Up the timeout for upload servlet session
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/FileUploadServlet.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/FileUploadServlet.java index 32b1ddc..2c8e514 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/FileUploadServlet.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/FileUploadServlet.java @@ -33,6 +33,7 @@ import javax.servlet.ServletOutputStream; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpSession;
import org.apache.commons.fileupload.FileItem; import org.apache.commons.fileupload.FileUploadException; @@ -51,9 +52,17 @@ import org.rhq.enterprise.server.util.LookupUtil; public class FileUploadServlet extends HttpServlet { private static final long serialVersionUID = 1L;
+ /* The number of seconds the session can remain inactive. The default is 600 (10 minutes). + * It may take longer than 10 minutes to upload a large file, so we'll increase... + */ + private static final int MAX_INACTIVE_INTERVAL = 60 * 60; + @Override protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
+ HttpSession session = req.getSession(); + session.setMaxInactiveInterval(MAX_INACTIVE_INTERVAL); + if (ServletFileUpload.isMultipartContent(req)) {
DiskFileItemFactory fileItemFactory = new DiskFileItemFactory();
commit c739b0f8e8408c8771454dfa9c718bc228f1ce8f Author: Joseph Marques joseph@redhat.com Date: Fri Jul 16 10:43:44 2010 -0400
user must be able to view resource in order to see plugin configuration
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationManagerBean.java index 2e6198d..c0add68 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationManagerBean.java @@ -886,6 +886,11 @@ public class ConfigurationManagerBean implements ConfigurationManagerLocal, Conf public PluginConfigurationUpdate getPluginConfigurationUpdate(Subject subject, int configurationUpdateId) { PluginConfigurationUpdate update = entityManager.find(PluginConfigurationUpdate.class, configurationUpdateId);
+ if (!authorizationManager.canViewResource(subject, update.getResource().getId())) { + throw new PermissionException("User [" + subject.getName() + + "] does not have permission to view plugin configuration update for [" + update.getResource() + "]"); + } + update.getConfiguration(); // this is EAGER loaded, so this really doesn't do anything
return update;
commit e52d7671e9ec07800c84fe7e32a9445c635e69b6 Merge: 8746c03... 0842b83... Author: Filip Drabek fdrabek@dhcp-lab-136.englab.brq.redhat.com Date: Fri Jul 16 16:20:08 2010 +0200
Merge branch 'release-3.0.0' of ssh://git.fedorahosted.org/git/rhq/rhq into release-3.0.0
commit 8746c033f4a3735d0ad55ca87bae185ac7293227 Author: Filip Drabek fdrabek@dhcp-lab-136.englab.brq.redhat.com Date: Fri Jul 16 16:18:53 2010 +0200
Apache Unit tests update.
diff --git a/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/ApacheAugeasTest.java b/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/ApacheAugeasTest.java new file mode 100644 index 0000000..344ab1f --- /dev/null +++ b/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/ApacheAugeasTest.java @@ -0,0 +1,123 @@ +package org.rhq.plugins.apache; + +import java.io.File; +import java.util.List; + +import org.rhq.augeas.AugeasProxy; +import org.rhq.augeas.node.AugeasNode; +import org.rhq.augeas.tree.AugeasTree; +import org.rhq.core.domain.configuration.Configuration; +import org.rhq.core.domain.configuration.definition.ConfigurationDefinition; +import org.rhq.core.pc.PluginContainer; +import org.rhq.plugins.apache.augeas.AugeasConfigurationApache; +import org.rhq.plugins.apache.mapping.ApacheAugeasMapping; +import org.rhq.plugins.apache.util.ApacheConfigurationUtil; +import org.rhq.plugins.apache.util.AugeasNodeSearch; + +public class ApacheAugeasTest { + + /** + * Tests if all included configuration files were loaded. + * @return + */ + public void testFiles(AugeasProxy augeas){ + System.out.println("Test if all included cofiguration files was discovered and loaded."); + AugeasConfigurationApache config = (AugeasConfigurationApache)augeas.getConfiguration(); + List<File> configFiles = config.getAllConfigurationFiles(); + + /* + * There are three files one main file one which is included from main file and one which is included from + * included file and which is declared in IfModule. All of them must be discovered. + */ + boolean found=false; + for (File confFile : configFiles){ + found = false; + for (String fileName : ApacheTestConstants.CONFIG_FILE_NAMES){ + if (!confFile.getName().equals(fileName)) + found= true; + } + assert found; + } + } + /** + * Tests mapping of augeas tree to configuration and back. + * @param cont + * @throws Exception + */ + public void testMapping(PluginContainer cont){ + ApacheAugeasUtil apacheUtil = new ApacheAugeasUtil(); + try{ + //copy all configuration files to temporary folder + String path = apacheUtil.prepareConfigFiles(); + //loading of augeas from temporary folder + AugeasProxy proxy = apacheUtil.initAugeas(path+File.separator+ApacheTestConstants.ROOT_CONFIG_FILE_NAME, path, path); + AugeasTree tree = proxy.getAugeasTree(ApacheTestConstants.MODULE_NAME, true); + + testLoadConfig(tree, cont); + testSaveConfig(cont); + apacheUtil.cleanConfigFiles(); + }catch(Exception e){ + e.printStackTrace(); + apacheUtil.cleanConfigFiles(); + } + } + /** + * Tests mapping of augeas tree to rhq configuration. + * @param tree + * @param container + * @throws Exception + */ + public void testLoadConfig(AugeasTree tree,PluginContainer container)throws Exception{ + System.out.println("Test mapping of augeas tree to rhq configuration."); + ApacheConfigurationUtil util = new ApacheConfigurationUtil(); + for (Components component : Components.values()){ + //get nodes for each component + List<AugeasNode> nodes = component.getAllNodes(tree); + for (int i=0;i<nodes.size();i++){ + String key = AugeasNodeSearch.getNodeKey(nodes.get(i), tree.getRootNode()); + Configuration config = ApacheConfigurationUtil.componentToConfiguration(container, component, key, tree); + //load configuration for related component and augeas node from tempfolder + Configuration conf = util.loadConfiguration(ApacheTestConstants.getConfigFilesPathForLoad()+ + File.separator+component.getComponentName()+String.valueOf(i)); + assert config.equals(conf); + } + } + } + + /** + * Tests mapping of rhq configuration to augeas tree. + * + * @param container + * @throws Exception + */ + public void testSaveConfig(PluginContainer container)throws Exception{ + System.out.println("Test mapping of rhq configuration to augeas tree."); + ApacheAugeasUtil apacheUtil = new ApacheAugeasUtil(); + //load augeas tree from temporary folder + String path = ApacheTestConstants.getApacheConfigFilesPath(); + AugeasProxy proxy = apacheUtil.initAugeas(path+ApacheTestConstants.ROOT_CONFIG_FILE_NAME, path, path); + AugeasTree tree = proxy.getAugeasTree(ApacheTestConstants.MODULE_NAME, true); + //load augeas tree from temporary folder "updateconfig" + String pathUpdate = ApacheTestConstants.getApacheConfigFilesPathForUpdate(); + AugeasProxy proxyUpdate = apacheUtil.initAugeas(pathUpdate+ApacheTestConstants.ROOT_CONFIG_FILE_NAME, pathUpdate, pathUpdate); + AugeasTree treeUpdate = proxyUpdate.getAugeasTree(ApacheTestConstants.MODULE_NAME, true); + + for (Components component : Components.values()){ + List<AugeasNode> nodes = component.getAllNodes(tree); + ConfigurationDefinition configDef = ApacheConfigurationUtil.getConfigurationDefinition(container, component); + + for (int i=0;i<nodes.size();i++){ + //load component from first tree - transfare that tree to configuration - and update second tree with that configuration + String key = AugeasNodeSearch.getNodeKey(nodes.get(i), tree.getRootNode()); + Configuration config = ApacheConfigurationUtil.componentToConfiguration(container, component, key, tree); + AugeasNode updateNode = AugeasNodeSearch.findNodeById(treeUpdate.getRootNode(), key); + + ApacheAugeasMapping mapping = new ApacheAugeasMapping(treeUpdate); + mapping.updateAugeas(updateNode, config, configDef); + } + } + treeUpdate.save(); + //test if the updated augeas tree can be mapped to configuration stored at files in "loadconfig" temporary directory + testLoadConfig(treeUpdate, container); + } +} diff --git a/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/ApacheAugeasUtil.java b/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/ApacheAugeasUtil.java new file mode 100644 index 0000000..969052d --- /dev/null +++ b/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/ApacheAugeasUtil.java @@ -0,0 +1,172 @@ +package org.rhq.plugins.apache; + +import java.io.File; +import java.util.ArrayList; +import java.util.List; + +import org.rhq.augeas.AugeasProxy; +import org.rhq.augeas.node.AugeasNode; +import org.rhq.augeas.tree.AugeasTree; +import org.rhq.core.domain.configuration.Configuration; +import org.rhq.core.domain.configuration.PropertySimple; +import org.rhq.core.pc.PluginContainer; +import org.rhq.plugins.apache.augeas.AugeasConfigurationApache; +import org.rhq.plugins.apache.augeas.AugeasTreeBuilderApache; +import org.rhq.plugins.apache.helper.LensHelper; +import org.rhq.plugins.apache.util.ApacheConfigurationUtil; +import org.rhq.plugins.apache.util.AugeasNodeSearch; + +public class ApacheAugeasUtil { + + /** + * Loads augeas. + * @param configFilePath + * @param serverRootPath + * @param lensPath + * @return + */ + public AugeasProxy initAugeas(String configFilePath,String serverRootPath,String lensPath){ + Configuration configuration = new Configuration(); + configuration.put(new PropertySimple("configurationFilesInclusionPatterns",configFilePath)); + configuration.put(new PropertySimple("augeasModuleName", ApacheTestConstants.MODULE_NAME)); + configuration.put(new PropertySimple(ApacheTestConstants.PLUGIN_CONFIG_PROP_SERVER_ROOT,serverRootPath)); + + AugeasConfigurationApache conf = new AugeasConfigurationApache(lensPath,configuration); + AugeasTreeBuilderApache builder = new AugeasTreeBuilderApache(); + AugeasProxy augeas = new AugeasProxy(conf,builder); + + augeas.load(); + + return augeas; + } + + /** + * This method will create a new temporary directory and copy there all configuration files. + * @return + * @throws UnitTestException + */ + public String prepareConfigFiles() { + String tempDirPath=null; + try { + + File tempDirectory = LensHelper.createTempDir(ApacheTestConstants.TEMP_CONFIG_FILE_DIRECTORY); + if (!tempDirectory.exists()) + tempDirectory.createNewFile(); + //copy the apache configuration files to temp folder + tempDirPath = tempDirectory.getAbsolutePath()+File.separatorChar; + copyFiles(ApacheTestConstants.FILES_TO_LOAD, "", tempDirectory); + + File updateDir = new File(tempDirectory,ApacheTestConstants.TEST_FILE_APACHE_CONFIG_FOLDER); + if (!updateDir.exists()){ + updateDir.mkdir(); + updateDir.createNewFile(); + } + //copy the apache configuration files to temp folder "updateconfig" + copyFiles(ApacheTestConstants.FILES_TO_LOAD, ApacheTestConstants.TEST_FILE_APACHE_CONFIG_FOLDER, tempDirectory); + + File loadDir = new File(tempDirectory,ApacheTestConstants.TEST_FILE_CONFIG_FOLDER); + if (!loadDir.exists()){ + loadDir.mkdir(); + loadDir.createNewFile(); + } + //copy xml files with rhq configuration to loadconfig + for(Components component : Components.values()){ + copyFiles(component.getConfigurationFiles().toArray(new String[0]), ApacheTestConstants.TEST_FILE_CONFIG_FOLDER, tempDirectory); + } + + ApacheTestConstants.TEMP_FILES_PATH=tempDirectory.getAbsolutePath(); + + }catch (Exception e){ + e.printStackTrace(); + } + + return tempDirPath; + } + + public void cleanConfigFiles(){ + try { + + File tempDirectory = new File(ApacheTestConstants.getApacheConfigFilesPath()); + if (!tempDirectory.exists()) + return; + + deleteFiles(ApacheTestConstants.FILES_TO_LOAD, "", tempDirectory); + + File updateDir = new File(tempDirectory,ApacheTestConstants.TEST_FILE_APACHE_CONFIG_FOLDER); + if (updateDir.exists()){ + deleteFiles(ApacheTestConstants.FILES_TO_LOAD, ApacheTestConstants.TEST_FILE_APACHE_CONFIG_FOLDER, tempDirectory); + updateDir.delete(); + } + File loadDir = new File(tempDirectory,ApacheTestConstants.TEST_FILE_CONFIG_FOLDER); + if (loadDir.exists()) + { + for(Components component : Components.values()){ + deleteFiles(component.getConfigurationFiles().toArray(new String[0]), ApacheTestConstants.TEST_FILE_CONFIG_FOLDER, tempDirectory); + } + loadDir.delete(); + } + + tempDirectory.delete(); + }catch (Exception e){ + e.printStackTrace(); + } + } + public void copyFiles(String[] files,String folder,File destination) throws Exception{ + for (String fileName : files){ + String path=null; + + if (folder.equals("")) + path = fileName; + else + path = folder+File.separator+fileName; + + File configFile = LensHelper.cpFileFromPluginToTemp(this.getClass().getClassLoader(),destination, path); + if (!configFile.exists()) + throw new UnitTestException("Creation of temporary configuration file failed."); + } + } + + public void deleteFiles(String[] files,String folder,File destination) throws Exception{ + for (String fileName : files){ + String path=null; + + if (folder.equals("")) + path = fileName; + else + path = folder+File.separator+fileName; + + File configFile = new File(destination,path);; + if (configFile.exists()) + configFile.delete(); + } + } + /** + * Method for searching all components in ageasTree which returns List of keys which identify the component. + * @param parentNodeNames + * @param componentName + * @param tree + * @return + */ + public List<String> loadComponent(String[] parentNodeNames,String componentName,AugeasTree tree){ + List<String> paramsString = new ArrayList<String>(); + List<AugeasNode> nodes = AugeasNodeSearch.searchNode(parentNodeNames, componentName, tree.getRootNode()); + for (AugeasNode node : nodes){ + paramsString.add(AugeasNodeSearch.getNodeKey(node, tree.getRootNode())); + } + return paramsString; + } + + public void saveFiles(AugeasTree tree,PluginContainer container) throws Exception{ + for (Components component : Components.values()){ + String name = component.getComponentName(); + List<AugeasNode> nodes = component.getAllNodes(tree); + for (int i=0;i<nodes.size();i++){ + String key = AugeasNodeSearch.getNodeKey(nodes.get(i), tree.getRootNode()); + //PATH TO THE CONFIG FILES + String fileName = name+String.valueOf(i); + Configuration config = ApacheConfigurationUtil.componentToConfiguration(container, component, key, tree); + ApacheConfigurationUtil.saveConfiguration(config, fileName); + } + } + } +} diff --git a/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/ApachePluginTest.java b/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/ApachePluginTest.java index a1a42c1..f3ce761 100644 --- a/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/ApachePluginTest.java +++ b/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/ApachePluginTest.java @@ -63,7 +63,12 @@ public class ApachePluginTest {
pcConfig.setInsideAgent(false); PluginContainer.getInstance().setConfiguration(pcConfig); - PluginContainer.getInstance().initialize(); + PluginContainer container = PluginContainer.getInstance(); + container.initialize(); + container.getInventoryManager().executeServerScanImmediately(); + container.getInventoryManager().executeServiceScanImmediately(); + ApacheAugeasTest test = new ApacheAugeasTest(); + test.testMapping(container); } catch (Exception e) { e.printStackTrace(); } diff --git a/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/ApacheTestConstants.java b/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/ApacheTestConstants.java new file mode 100644 index 0000000..a23964b --- /dev/null +++ b/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/ApacheTestConstants.java @@ -0,0 +1,47 @@ +package org.rhq.plugins.apache; + +import java.io.File; + +public class ApacheTestConstants { + + public static final String MODULE_NAME="Httpd"; + public static final String PLUGIN_NAME="Apache"; + public static final String LENS_NAME="httpd.aug"; + public static final String TEMP_CONFIG_FILE_DIRECTORY = "HttpdTest"; + public static final String CONFIG_FILE_NAMES [] = { + "httpd.conf", + "included.conf", + "nested.conf"}; + public static final String FILES_TO_LOAD [] = { + "httpd.conf", + "included.conf", + "nested.conf", + "httpd.aug"}; + public static final String ROOT_CONFIG_FILE_NAME = "httpd.conf"; + public static final String PLUGIN_CONFIG_PROP_SERVER_ROOT = "serverRoot"; + public static final String TEST_FILE_CONFIG_FOLDER="loadconfig"; + public static final String TEST_FILE_APACHE_CONFIG_FOLDER="updateconfig"; + public static String TEMP_FILES_PATH; + + /** + * Path to folder containing rhq configuration in xml files. + * @return + */ + public static String getConfigFilesPathForLoad(){ + return TEMP_FILES_PATH+File.separator+TEST_FILE_CONFIG_FOLDER+File.separator; + } + /** + * Path to folder containing apache configuration in "loadconfig" folder + * @return + */ + public static String getApacheConfigFilesPathForUpdate(){ + return TEMP_FILES_PATH+File.separator+TEST_FILE_APACHE_CONFIG_FOLDER+File.separator; + } + /** + * Path to temporary folder where are/will be stored all config files. + * @return + */ + public static String getApacheConfigFilesPath(){ + return TEMP_FILES_PATH+File.separator; + } +} diff --git a/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/Components.java b/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/Components.java new file mode 100644 index 0000000..ff00796 --- /dev/null +++ b/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/Components.java @@ -0,0 +1,125 @@ +package org.rhq.plugins.apache; + +import java.util.ArrayList; +import java.util.List; + +import org.rhq.augeas.node.AugeasNode; +import org.rhq.augeas.tree.AugeasTree; +import org.rhq.plugins.apache.util.AugeasNodeSearch; + +/** + * Enum of all components in Apache plugin. + * @author fdrabek + * + */ +public enum Components { + + IFMODULE{ + public String getComponentName(){ + return "IfModule"; + } + public String[] getPossParentNodeName(){ + String [] parentNames = new String[2]; + parentNames[0]="<IfModule"; + parentNames[1]="<VirtualHost"; + return parentNames; + } + public String getNodeName(){ + return "<IfModule"; + } + public List<AugeasNode> getAllNodes(AugeasTree tree){ + return AugeasNodeSearch.searchNode(IFMODULE.getPossParentNodeName(), IFMODULE.getNodeName(), tree.getRootNode()); + } + public List<String> getConfigurationFiles(){ + List<String> list = new ArrayList<String>(); + list.add("IfModule0"); + list.add("IfModule1"); + return list; + } + }, + + IFMODULE_DIRECTORY{ + public String getComponentName(){ + return "IfModule Parameters"; + } + public String[] getPossParentNodeName(){ + String [] parentNames = new String[1]; + parentNames[0]="<IfModule"; + return parentNames; + } + public String getNodeName(){ + return "<IfModule"; + } + public List<AugeasNode> getAllNodes(AugeasTree tree){ + List<AugeasNode> nodes = DIRECTORY.getAllNodes(tree); + List<AugeasNode> ifModNodes = new ArrayList<AugeasNode>(); + for (AugeasNode node : nodes){ + List<AugeasNode> tempNodes = AugeasNodeSearch.searchNode(IFMODULE_DIRECTORY.getPossParentNodeName(), IFMODULE_DIRECTORY.getNodeName(), node); + if (tempNodes != null) + ifModNodes.addAll(tempNodes); + } + return ifModNodes; + + } + + public List<String> getConfigurationFiles(){ + List<String> list = new ArrayList<String>(); + list.add("IfModule Parameters0"); + return list; + } + }, + + DIRECTORY{ + public String getComponentName(){ + return "Directory"; + } + public String[] getPossParentNodeName(){ + String [] parentNames = new String[2]; + parentNames[0]="<IfModule"; + parentNames[1]="<VirtualHost"; + return parentNames; + } + public String getNodeName(){ + return "<Directory"; + } + public List<AugeasNode> getAllNodes(AugeasTree tree){ + return AugeasNodeSearch.searchNode(DIRECTORY.getPossParentNodeName(), DIRECTORY.getNodeName(), tree.getRootNode()); + } + + public List<String> getConfigurationFiles(){ + List<String> list = new ArrayList<String>(); + list.add("Directory0"); + list.add("Directory1"); + list.add("Directory2"); + return list; + } + }, + + VIRTUALHOST{ + public String getComponentName(){ + return "Apache Virtual Host"; + } + public String[] getPossParentNodeName(){ + String [] parentNames = new String[0]; + return parentNames; + } + public String getNodeName(){ + return "<VirtualHost"; + } + public List<AugeasNode> getAllNodes(AugeasTree tree){ + return tree.getRootNode().getChildByLabel("<VirtualHost"); + } + + public List<String> getConfigurationFiles(){ + List<String> list = new ArrayList<String>(); + list.add("Apache Virtual Host0"); + return list; + } + }; + + public abstract String getComponentName(); + public abstract String[] getPossParentNodeName(); + public abstract String getNodeName(); + public abstract List<AugeasNode> getAllNodes(AugeasTree tree); + public abstract List<String> getConfigurationFiles(); +} diff --git a/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/UnitTestException.java b/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/UnitTestException.java new file mode 100644 index 0000000..41b3ee9 --- /dev/null +++ b/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/UnitTestException.java @@ -0,0 +1,21 @@ +package org.rhq.plugins.apache; + +public class UnitTestException extends Exception{ + + public UnitTestException(){ + super(); + } + + public UnitTestException(String text){ + super(text); + } + + public UnitTestException(Exception e){ + super(e); + } + + public UnitTestException(String message,Throwable cause){ + super(message,cause); + } + +} diff --git a/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/helper/LensFilter.java b/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/helper/LensFilter.java new file mode 100644 index 0000000..f6df6d0 --- /dev/null +++ b/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/helper/LensFilter.java @@ -0,0 +1,23 @@ +package org.rhq.plugins.apache.helper; + +import java.io.File; +import java.io.FileFilter; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +public class LensFilter implements FileFilter{ + private Pattern pattern; + + public LensFilter(String name){ + pattern = Pattern.compile(name+".*"); + } + + public boolean accept(File pathname) { + String name = pathname.getName(); + Matcher match = pattern.matcher(name); + if (match.matches()) + return true; + + return false; + } +} \ No newline at end of file diff --git a/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/helper/LensHelper.java b/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/helper/LensHelper.java new file mode 100644 index 0000000..329b3ca --- /dev/null +++ b/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/helper/LensHelper.java @@ -0,0 +1,109 @@ +/* + * RHQ Management Platform + * Copyright (C) 2005-2009 Red Hat, Inc. + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License, version 2, as + * published by the Free Software Foundation, and/or the GNU Lesser + * General Public License, version 2.1, also as published by the Free + * Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License and the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License + * and the GNU Lesser General Public License along with this program; + * if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +package org.rhq.plugins.apache.helper; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; + +public class LensHelper { + public static final String TEMP_DIRECTORY = "java.io.tmpdir"; + public static final String TEMP_FILE_SUFFIX = ".aug"; + + + public static String getLensPath(String param) throws IOException,Exception{ + String lensPath=null; + + if (param.indexOf(File.separatorChar)==-1){ + + }else + lensPath = param; + return lensPath; + + } + + public static void copyFile(InputStream in,File destination) throws Exception{ + + if (!destination.canWrite()) + throw new Exception("Creating of temporary file for lens failed. Destination file " + + destination.getAbsolutePath()+" is not accessible."); + + OutputStream out = new FileOutputStream(destination); + + byte[] buf = new byte[1024]; + int length; + + while ((length = in.read(buf)) > 0) { + out.write(buf, 0, length); + } + + in.close(); + out.close(); + + } + + public static File createTempDir(String name) throws IOException{ + + String tempDir = (String)System.getProperties().get(TEMP_DIRECTORY); + + File tempDirectory = new File(tempDir); + File [] lens = tempDirectory.listFiles(new LensFilter(name)); + + File lensDirectory; + + if (lens.length==0){ + File tempFile = File.createTempFile(name, ""); + String nm = tempFile.getName(); + tempFile.delete(); + lensDirectory = new File(tempDirectory,nm); + lensDirectory.mkdir(); + lensDirectory.deleteOnExit(); + }else{ + lensDirectory = lens[0]; + } + + return lensDirectory; + + } + + public static String getTempDirectoryPath(){ + return (String)System.getProperties().get(TEMP_DIRECTORY); + } + + public static File cpFileFromPluginToTemp(ClassLoader loader,File tempDirectory,String fileName) throws IOException,Exception{ + + File destinationFile = new File(tempDirectory,fileName); + if (!destinationFile.exists()) + { + destinationFile.createNewFile(); + + InputStream input = loader.getResourceAsStream(fileName); + copyFile(input, destinationFile); + } + + return destinationFile; + } + +} \ No newline at end of file diff --git a/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/util/ApacheConfigurationUtil.java b/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/util/ApacheConfigurationUtil.java new file mode 100644 index 0000000..06a9f71 --- /dev/null +++ b/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/util/ApacheConfigurationUtil.java @@ -0,0 +1,230 @@ +package org.rhq.plugins.apache.util; + +import java.io.File; +import java.util.Collection; +import java.util.List; +import java.util.Map; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; + +import org.rhq.augeas.node.AugeasNode; +import org.rhq.augeas.tree.AugeasTree; +import org.rhq.core.clientapi.agent.metadata.PluginMetadataManager; +import org.rhq.core.domain.configuration.Configuration; +import org.rhq.core.domain.configuration.Property; +import org.rhq.core.domain.configuration.PropertyList; +import org.rhq.core.domain.configuration.PropertyMap; +import org.rhq.core.domain.configuration.PropertySimple; +import org.rhq.core.domain.configuration.definition.ConfigurationDefinition; +import org.rhq.core.domain.resource.ResourceType; +import org.rhq.core.pc.PluginContainer; +import org.rhq.core.pc.plugin.PluginManager; +import org.rhq.plugins.apache.ApacheTestConstants; +import org.rhq.plugins.apache.Components; +import org.rhq.plugins.apache.UnitTestException; +import org.rhq.plugins.apache.mapping.ApacheAugeasMapping; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.NamedNodeMap; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; + +import com.sun.org.apache.xml.internal.serialize.XMLSerializer; + +/** + * + * @author Filip Drabek + * + */ + +public class ApacheConfigurationUtil { + + public static final String SIMPLE_TAG_NAME = "simple"; + public static final String LIST_TAG_NAME = "list"; + public static final String MAP_TAG_NAME = "map"; + public static final String ROOT_ELEMENT = "configuration"; + public static final String NAME_ATTRIBUTE = "name"; + + private Document loadXML(String file) throws UnitTestException{ + Document document= null; + try { + File xmlFile = new File(file); + if (!xmlFile.exists()) + throw new UnitTestException("Configuration file not found."); + + DocumentBuilderFactory factory = + DocumentBuilderFactory.newInstance(); + DocumentBuilder loader = factory.newDocumentBuilder(); + + document = loader.parse(file); + + }catch(Exception e){ + throw new UnitTestException("Loading of xml file failed.",e); + } + + return document; + } + + public static void saveConfiguration(Configuration config,String fileName) throws UnitTestException{ + try { + Collection<Property> properties = config.getProperties(); + DocumentBuilderFactory dbfac = DocumentBuilderFactory.newInstance(); + DocumentBuilder docBuilder = dbfac.newDocumentBuilder(); + Document doc = docBuilder.newDocument(); + Element element = doc.createElement(ROOT_ELEMENT); + + for (Property property : properties){ + element.appendChild(configurationToDom(property,doc)); + } + doc.appendChild(element); + saveXML(doc,fileName); + + }catch(Exception e){ + throw new UnitTestException(e); + } + } + + + private static Element configurationToDom(Property prop,Document doc){ + Element element = null; + if (prop instanceof PropertySimple){ + element = doc.createElement(SIMPLE_TAG_NAME); + element.appendChild(doc.createTextNode(((PropertySimple) prop).getStringValue())); + } + + if (prop instanceof PropertyList){ + PropertyList list = (PropertyList) prop; + element = doc.createElement(LIST_TAG_NAME); + List<Property> propertyList = list.getList(); + for (Property property : propertyList){ + element.appendChild(configurationToDom(property,doc)); + } + } + + if (prop instanceof PropertyMap){ + PropertyMap map = (PropertyMap) prop; + element = doc.createElement(MAP_TAG_NAME); + Map<String,Property> propertyMap = map.getMap(); + for (Property property : propertyMap.values()){ + element.appendChild(configurationToDom(property,doc)); + } + } + + fillElement(element,prop); + return element; + } + + private static void fillElement(Element element,Property prop){ + element.setAttribute(NAME_ATTRIBUTE, prop.getName()); + } + + public Configuration loadConfiguration(String fileName) throws UnitTestException{ + Document document = loadXML(fileName); + NodeList nodeList = document.getElementsByTagName(ROOT_ELEMENT); + if (nodeList.getLength()!=1) + throw new UnitTestException("Configuration file's " + fileName+ " format is not valid."); + + Node rootElement = nodeList.item(0); + Configuration configuration = new Configuration(); + NodeList childNodes = rootElement.getChildNodes(); + for (int i=0;i<childNodes.getLength();i++){ + configuration.put(domToConfiguration(childNodes.item(i))); + } + return configuration; + } + + private Property domToConfiguration(Node node){ + String nodeName = node.getNodeName(); + NamedNodeMap attrMap = node.getAttributes(); + Node attrNode = attrMap.getNamedItem(NAME_ATTRIBUTE); + String propertyName = attrNode.getNodeValue(); + + Property prop = null; + + if (nodeName.equals(SIMPLE_TAG_NAME)){ + PropertySimple propertySimple = new PropertySimple(propertyName,null); + String value = node.getTextContent(); + propertySimple.setStringValue(value); + prop = propertySimple; + } + + if (nodeName.equals(LIST_TAG_NAME)){ + PropertyList propertyList = new PropertyList(propertyName); + NodeList list = node.getChildNodes(); + for (int i=0;i<list.getLength();i++) { + propertyList.add(domToConfiguration(list.item(i))); + } + prop = propertyList; + } + + if (nodeName.equals(MAP_TAG_NAME)){ + PropertyMap propertyMap = new PropertyMap(propertyName); + NodeList list = node.getChildNodes(); + for (int i=0;i<list.getLength();i++){ + propertyMap.put(domToConfiguration(list.item(i))); + } + prop = propertyMap; + } + + return prop; + } + + @SuppressWarnings("restriction") + private static void saveXML(Document document,String fileName) throws UnitTestException{ + try { + File file = new File(fileName); + if (!file.exists()) + file.createNewFile(); + + XMLSerializer serializer = new XMLSerializer(); + serializer.setOutputCharStream( + new java.io.FileWriter(fileName)); + serializer.serialize(document); + }catch(Exception e){ + throw new UnitTestException("Saving of xml file failed",e); + } + } + + public static void printConfiguration(Property prop){ + if (prop instanceof PropertySimple){ + System.out.println(" SimpleProperty name="+prop.getName()+" value="+((PropertySimple)prop).getStringValue()); + } + + if (prop instanceof PropertyList){ + PropertyList list = (PropertyList) prop; + System.out.println("PropertyList name="+list.getName()); + for (Property property : list.getList()){ + printConfiguration(property); + } + } + + if (prop instanceof PropertyMap){ + PropertyMap map = (PropertyMap) prop; + System.out.println(" PropertyMap name="+map.getName()); + Map<String,Property> propertyMap = map.getMap(); + for (Property property : propertyMap.values()){ + printConfiguration(property); + } + } + } + + + public static ConfigurationDefinition getConfigurationDefinition(PluginContainer container,Components component){ + PluginManager pluginManager = container.getPluginManager(); + PluginMetadataManager pluginMetadataManager = pluginManager.getMetadataManager(); + + ResourceType type = pluginMetadataManager.getType(component.getComponentName(), ApacheTestConstants.PLUGIN_NAME); + ConfigurationDefinition configDef = type.getResourceConfigurationDefinition(); + return configDef; + } + + + public static Configuration componentToConfiguration(PluginContainer container,Components component,String key,AugeasTree tree) throws UnitTestException{ + ConfigurationDefinition def = getConfigurationDefinition(container,component); + AugeasNode node = AugeasNodeSearch.findNodeById(tree.getRootNode(), key); + ApacheAugeasMapping map = new ApacheAugeasMapping(tree); + Configuration config = map.updateConfiguration(node, def); + return config; + } +} diff --git a/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/util/StandAloneContainer.java b/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/util/StandAloneContainer.java new file mode 100644 index 0000000..0047faf --- /dev/null +++ b/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/util/StandAloneContainer.java @@ -0,0 +1,75 @@ +package org.rhq.plugins.apache.util; + +import java.io.File; + +import org.rhq.augeas.tree.AugeasTree; +import org.rhq.core.clientapi.agent.PluginContainerException; +import org.rhq.core.domain.resource.Resource; +import org.rhq.core.pc.PluginContainer; +import org.rhq.core.pc.PluginContainerConfiguration; +import org.rhq.core.pc.inventory.InventoryManager; +import org.rhq.core.pc.inventory.ResourceContainer; +import org.rhq.core.pc.plugin.FileSystemPluginFinder; +import org.rhq.core.pc.util.ComponentUtil; +import org.rhq.core.pc.util.FacetLockType; + +public class StandAloneContainer { + + public PluginContainer getContainer(AugeasTree tree,String pluginPath){ + PluginContainer container=null; + try { + container = PluginContainer.getInstance(); + File pluginDir = new File(pluginPath); + PluginContainerConfiguration config = new PluginContainerConfiguration(); + config.setPluginFinder(new FileSystemPluginFinder(pluginDir)); + config.setPluginDirectory(pluginDir); + + container.setConfiguration(config); + container.initialize(); + container.getInventoryManager().executeServerScanImmediately(); + container.getInventoryManager().executeServiceScanImmediately(); + + return container; + + }catch(Exception e){ + e.printStackTrace(); + if (container!=null) + container.shutdown(); + } + return null; + } + + + + public static <T> T getComponent(int resourceId, Class<T> facetInterface, FacetLockType lockType, + long timeout, boolean daemonThread, boolean onlyIfStarted) throws PluginContainerException { + InventoryManager inventoryManager = PluginContainer.getInstance().getInventoryManager(); + ResourceContainer resourceContainer = inventoryManager.getResourceContainer(resourceId); + if (resourceContainer == null) { + throw new PluginContainerException("Resource component container could not be retrieved for resource: " + + resourceId); + } + return resourceContainer.createResourceComponentProxy(facetInterface, lockType, timeout, daemonThread, onlyIfStarted); + } + + public static <T> Object getComponentProxy(Resource res,Class<T> facetInterface) throws Exception { + ClassLoader currenContextClassLoader = Thread.currentThread() + .getContextClassLoader(); + try { + Resource asResource = res; + ClassLoader cl = PluginContainer.getInstance().getPluginComponentFactory(). + getResourceClassloader(asResource); + + Class<?> resourceSpecificFacetInterface = Class.forName( + facetInterface.getName(), true, cl); + + Thread.currentThread().setContextClassLoader(cl); + + return ComponentUtil.getComponent(asResource.getId(),resourceSpecificFacetInterface, + FacetLockType.WRITE, 30000, true, true); + } finally { + Thread.currentThread().setContextClassLoader( + currenContextClassLoader); + } + } +} diff --git a/modules/plugins/apache/src/test/resources/httpd.aug b/modules/plugins/apache/src/test/resources/httpd.aug new file mode 100644 index 0000000..0fddced --- /dev/null +++ b/modules/plugins/apache/src/test/resources/httpd.aug @@ -0,0 +1,58 @@ +module Httpd = + autoload xfm + +(* Helpers *) + +(* Newlines can be escaped. *) +let sep = del /([ \t]+(\\\\\n)?)+/ " " +let eol = del /([ \t]*(\\\\\n)?)*\n/ "\n" + let del_str (s:string) = del s s +let ws = /[ \t]*/ +let alnum = /[a-zA-Z0-9_]+/ +(* the last character in the non-quoted word must not be a backslash. I guess this is not completely semantically + correct but at the same time, apache discourages to use backslashes for anything else than + line breaking so we should be safe here. This restriction is in place to support + escaped new lines in the sep and eol rules. *) +let word = /\"([^\"\n]|\\\\\")*\"|'([^'\n]|\\\\')*'|[^'" \t\n]*[^'" \t\n\\]/ +let secarg = /\"([^\"\n]|\\\\\")*\"|'([^'\n]|\\\\')*'|[^'\" \t\n>]+/ +let wskey (k:regexp) = del ws "" . key k +let params (param:regexp) = [ sep . label "param" . store param ]* +let sec (name:string) (body:lens) = + [ wskey ("<" . name) . params secarg . del_str ">" . eol . + body . del ws "" . del_str("</" . name . ">") . eol ] + +(* Definitions *) +let comment = [ del /([ \t]*(#.*)*)\n/ "#\n" ] + +let directive = [ wskey alnum . params word . eol ] + +let section (name:string) = sec name (directive|comment)* + +let sections (body:lens) = sec "Directory" body + | sec "DirectoryMatch" body + | sec "Files" body + | sec "FilesMatch" body + | sec "Location" body + | sec "LocationMatch" body + | sec "AuthnProviderAlias" body + | sec "IfDefine" body + | sec "IfVersion" body + | sec "Limit" body + | sec "LimitExcept" body + | sec "Proxy" body + | sec "ProxyMatch" body + | sec "VirtualHost" body + | sec "IfModule" body + + +(* What we want ot say is *) +(* let rec body = (directive|comment)* | ifModule body | directory body | ... *) +(* but we can't typecheck that *) + +(* FIXME: *) +(* - Nesting of sections *) +let rec lns = (directive | comment | sections lns)* + +let filter = + incl "/etc/httpd/conf/httpd.conf" +let xfm = transform lns filter diff --git a/modules/plugins/apache/src/test/resources/httpd.conf b/modules/plugins/apache/src/test/resources/httpd.conf new file mode 100644 index 0000000..7814492 --- /dev/null +++ b/modules/plugins/apache/src/test/resources/httpd.conf @@ -0,0 +1,41 @@ +<VirtualHost 10.1.2.3> + ServerName www.example.com:80 + ServerAlias server server2.domain.com server2 + ServerAdmin www-admin@foo.example.com + DocumentRoot /home/fdrabek/Work + AddDefaultCharset utf-8 + Alias /image /ftp/pub/image + DefaultType image/gif + DirectoryIndex index.html index.txt /cgi-bin/index.pl + ErrorDocument 404 /cgi-bin/bad_urls.pl + Timeout 300 + Options Indexes FollowSymLinks + UseCanonicalName On + ErrorLog "|/usr/local/bin/httpd_errors" + CustomLog logs/access_log "%h %l %u %t \"%r\" %>s %b" + <Directory /usr/local/httpd/htdocs> + Order Deny,Allow + Allow from apache.org + Deny from all + AllowOverride AuthConfig Indexes + DefaultType image/gif + AddDefaultCharset utf-8 + DirectoryIndex index.html + ErrorDocument 403 "Sorry can't allow you access today" + Options +Includes -Indexes + UseCanonicalName DNS + <IfModule test.c> + Order Deny,Allow + Allow from apache.org + Deny from all + AllowOverride AuthConfig Indexes + DefaultType image/gif + AddDefaultCharset utf-8 + DirectoryIndex index.html + ErrorDocument 403 "Sorry can't allow you access today" + Options +Includes -Indexes + UseCanonicalName DNS + </IfModule> +</Directory> +Include included.conf +</VirtualHost> diff --git a/modules/plugins/apache/src/test/resources/included.conf b/modules/plugins/apache/src/test/resources/included.conf new file mode 100644 index 0000000..258f3f7 --- /dev/null +++ b/modules/plugins/apache/src/test/resources/included.conf @@ -0,0 +1,13 @@ +Include nested.conf +<Directory ~ "^/www/.*/[0-9]{3}"> + Order Deny,Allow + Allow from apache.org + Deny from all + AllowOverride AuthConfig Indexes + DefaultType image/gif + AddDefaultCharset utf-8 + DirectoryIndex index.html + ErrorDocument 403 "Sorry can't allow you access today" + Options +Includes -Indexes + UseCanonicalName DNS +</Directory> diff --git a/modules/plugins/apache/src/test/resources/loadconfig/Apache Virtual Host0 b/modules/plugins/apache/src/test/resources/loadconfig/Apache Virtual Host0 new file mode 100644 index 0000000..be5f4bc --- /dev/null +++ b/modules/plugins/apache/src/test/resources/loadconfig/Apache Virtual Host0 @@ -0,0 +1,2 @@ +<?xml version="1.0"?> +<configuration><simple name="ErrorLog">"|/usr/local/bin/httpd_errors"</simple><list name="CustomLog"><map name="CustomLog"><simple name="Destination">logs/access_log</simple><simple name="format">"%h %l %u %t "%r" %>s %b"</simple><simple name="_index">0</simple></map></list><simple name="ServerName">www.example.com:80</simple><list name="ServerAlias"><map name="ServerAlias"><simple name="hostname">server</simple><simple name="_index">0</simple></map><map name="ServerAlias"><simple name="hostname">server2.domain.com</simple><simple name="_index">0</simple></map><map name="ServerAlias"><simple name="hostname">server2</simple><simple name="_index">0</simple></map></list><simple name="ServerAdmin">www-admin@foo.example.com</simple><simple name="DocumentRoot">/home/fdrabek/Work</simple><simple name="AddDefaultCharset">utf-8</simple><list name="Alias"><map name="Alias"><simple name="URL">/image</simple><simple name="directory">/ftp/pub/image</simple></map></list><simple name="DefaultType">image/gif</simple><list name="DirectoryIndex"><map name="DirectoryIndex"><simple name="host">index.html</simple><simple name="_index">0</simple></map><map name="DirectoryIndex"><simple name="host">index.txt</simple><simple name="_index">0</simple></map><map name="DirectoryIndex"><simple name="host">/cgi-bin/index.pl</simple><simple name="_index">0</simple></map></list><list name="ErrorDocument"><map name="ErrorDocument"><simple name="responseCode">404</simple><simple name="document">/cgi-bin/bad_urls.pl</simple></map></list><simple name="Timeout">300</simple><list name="Options"><map name="Options"><simple name="Mode">Set</simple><simple name="Option">Indexes</simple><simple name="_index">0</simple></map><map name="Options"><simple name="Mode">Set</simple><simple name="Option">FollowSymLinks</simple><simple name="_index">0</simple></map></list><simple name="UseCanonicalName">On</simple><simple name="UseCanonicalPhysicalPort"/></configuration> \ No newline at end of file diff --git a/modules/plugins/apache/src/test/resources/loadconfig/Directory0 b/modules/plugins/apache/src/test/resources/loadconfig/Directory0 new file mode 100644 index 0000000..1c28e70 --- /dev/null +++ b/modules/plugins/apache/src/test/resources/loadconfig/Directory0 @@ -0,0 +1,2 @@ +<?xml version="1.0"?> +<configuration><list name="IfModules"/><simple name="Order">Deny,Allow</simple><list name="Allow"><map name="Allow"><simple name="host">apache.org</simple><simple name="_index">0</simple></map></list><list name="Deny"><map name="Deny"><simple name="host">all</simple><simple name="_index">0</simple></map></list><list name="AllowOverride"><map name="AllowOverride"><simple name="param">AuthConfig</simple><simple name="_index">0</simple></map><map name="AllowOverride"><simple name="param">Indexes</simple><simple name="_index">0</simple></map></list><simple name="AddDefaultCharset">utf-8</simple><simple name="DefaultType">image/gif</simple><list name="DirectoryIndex"><map name="DirectoryIndex"><simple name="host">index.html</simple><simple name="_index">0</simple></map></list><list name="ErrorDocument"><map name="ErrorDocument"><simple name="responseCode">403</simple><simple name="document">"Sorry can't allow you access today"</simple></map></list><list name="Options"><map name="Options"><simple name="Mode">Add</simple><simple name="Option">Includes</simple><simple name="_index">0</simple></map><map name="Options"><simple name="Mode">Remove</simple><simple name="Option">Indexes</simple><simple name="_index">0</simple></map></list><simple name="UseCanonicalName">DNS</simple><simple name="UseCanonicalPhysicalPort"/></configuration> \ No newline at end of file diff --git a/modules/plugins/apache/src/test/resources/loadconfig/Directory1 b/modules/plugins/apache/src/test/resources/loadconfig/Directory1 new file mode 100644 index 0000000..574fe20 --- /dev/null +++ b/modules/plugins/apache/src/test/resources/loadconfig/Directory1 @@ -0,0 +1,2 @@ +<?xml version="1.0"?> +<configuration><list name="IfModules"><map name="IfModule"><simple name="condition">"^/www/.*/[0-9]{3}"</simple></map></list><simple name="Order">Deny,Allow</simple><list name="Allow"><map name="Allow"><simple name="host">apache.org</simple><simple name="_index">0</simple></map></list><list name="Deny"><map name="Deny"><simple name="host">all</simple><simple name="_index">0</simple></map></list><list name="AllowOverride"><map name="AllowOverride"><simple name="param">AuthConfig</simple><simple name="_index">0</simple></map><map name="AllowOverride"><simple name="param">Indexes</simple><simple name="_index">0</simple></map></list><simple name="AddDefaultCharset">utf-8</simple><simple name="DefaultType">image/gif</simple><list name="DirectoryIndex"><map name="DirectoryIndex"><simple name="host">index.html</simple><simple name="_index">0</simple></map></list><list name="ErrorDocument"><map name="ErrorDocument"><simple name="responseCode">403</simple><simple name="document">"Sorry can't allow you access today"</simple></map></list><list name="Options"><map name="Options"><simple name="Mode">Add</simple><simple name="Option">Includes</simple><simple name="_index">0</simple></map><map name="Options"><simple name="Mode">Remove</simple><simple name="Option">Indexes</simple><simple name="_index">0</simple></map></list><simple name="UseCanonicalName">DNS</simple><simple name="UseCanonicalPhysicalPort"/></configuration> \ No newline at end of file diff --git a/modules/plugins/apache/src/test/resources/loadconfig/Directory2 b/modules/plugins/apache/src/test/resources/loadconfig/Directory2 new file mode 100644 index 0000000..574fe20 --- /dev/null +++ b/modules/plugins/apache/src/test/resources/loadconfig/Directory2 @@ -0,0 +1,2 @@ +<?xml version="1.0"?> +<configuration><list name="IfModules"><map name="IfModule"><simple name="condition">"^/www/.*/[0-9]{3}"</simple></map></list><simple name="Order">Deny,Allow</simple><list name="Allow"><map name="Allow"><simple name="host">apache.org</simple><simple name="_index">0</simple></map></list><list name="Deny"><map name="Deny"><simple name="host">all</simple><simple name="_index">0</simple></map></list><list name="AllowOverride"><map name="AllowOverride"><simple name="param">AuthConfig</simple><simple name="_index">0</simple></map><map name="AllowOverride"><simple name="param">Indexes</simple><simple name="_index">0</simple></map></list><simple name="AddDefaultCharset">utf-8</simple><simple name="DefaultType">image/gif</simple><list name="DirectoryIndex"><map name="DirectoryIndex"><simple name="host">index.html</simple><simple name="_index">0</simple></map></list><list name="ErrorDocument"><map name="ErrorDocument"><simple name="responseCode">403</simple><simple name="document">"Sorry can't allow you access today"</simple></map></list><list name="Options"><map name="Options"><simple name="Mode">Add</simple><simple name="Option">Includes</simple><simple name="_index">0</simple></map><map name="Options"><simple name="Mode">Remove</simple><simple name="Option">Indexes</simple><simple name="_index">0</simple></map></list><simple name="UseCanonicalName">DNS</simple><simple name="UseCanonicalPhysicalPort"/></configuration> \ No newline at end of file diff --git a/modules/plugins/apache/src/test/resources/loadconfig/IfModule Parameters0 b/modules/plugins/apache/src/test/resources/loadconfig/IfModule Parameters0 new file mode 100644 index 0000000..88bebc2 --- /dev/null +++ b/modules/plugins/apache/src/test/resources/loadconfig/IfModule Parameters0 @@ -0,0 +1,2 @@ +<?xml version="1.0"?> +<configuration><list name="IfModules"><map name="IfModule"><simple name="condition">test.c</simple></map></list><simple name="Order">Deny,Allow</simple><list name="Allow"><map name="Allow"><simple name="host">apache.org</simple><simple name="_index">0</simple></map></list><list name="Deny"><map name="Deny"><simple name="host">all</simple><simple name="_index">0</simple></map></list><list name="AllowOverride"><map name="AllowOverride"><simple name="param">AuthConfig</simple><simple name="_index">0</simple></map><map name="AllowOverride"><simple name="param">Indexes</simple><simple name="_index">0</simple></map></list><simple name="AddDefaultCharset">utf-8</simple><simple name="DefaultType">image/gif</simple><list name="DirectoryIndex"><map name="DirectoryIndex"><simple name="host">index.html</simple><simple name="_index">0</simple></map></list><list name="ErrorDocument"><map name="ErrorDocument"><simple name="responseCode">403</simple><simple name="document">"Sorry can't allow you access today"</simple></map></list><list name="Options"><map name="Options"><simple name="Mode">Add</simple><simple name="Option">Includes</simple><simple name="_index">0</simple></map><map name="Options"><simple name="Mode">Remove</simple><simple name="Option">Indexes</simple><simple name="_index">0</simple></map></list><simple name="UseCanonicalName">DNS</simple><simple name="UseCanonicalPhysicalPort"/></configuration> \ No newline at end of file diff --git a/modules/plugins/apache/src/test/resources/loadconfig/IfModule0 b/modules/plugins/apache/src/test/resources/loadconfig/IfModule0 new file mode 100644 index 0000000..823aee3 --- /dev/null +++ b/modules/plugins/apache/src/test/resources/loadconfig/IfModule0 @@ -0,0 +1,2 @@ +<?xml version="1.0"?> +<configuration><list name="IfModules"><map name="IfModule"><simple name="condition">test2.c</simple></map></list><simple name="Order">Deny,Allow</simple><list name="Allow"><map name="Allow"><simple name="host">apache.org</simple><simple name="_index">0</simple></map></list><list name="Deny"><map name="Deny"><simple name="host">all</simple><simple name="_index">0</simple></map></list><list name="AllowOverride"><map name="AllowOverride"><simple name="param">AuthConfig</simple><simple name="_index">0</simple></map><map name="AllowOverride"><simple name="param">Indexes</simple><simple name="_index">0</simple></map></list><simple name="AddDefaultCharset">utf-8</simple><simple name="DefaultType">image/gif</simple><list name="DirectoryIndex"><map name="DirectoryIndex"><simple name="host">index.html</simple><simple name="_index">0</simple></map></list><list name="ErrorDocument"><map name="ErrorDocument"><simple name="responseCode">403</simple><simple name="document">"Sorry can't allow you access today"</simple></map></list><list name="Options"><map name="Options"><simple name="Mode">Add</simple><simple name="Option">Includes</simple><simple name="_index">0</simple></map><map name="Options"><simple name="Mode">Remove</simple><simple name="Option">Indexes</simple><simple name="_index">0</simple></map></list><simple name="UseCanonicalName">DNS</simple><simple name="UseCanonicalPhysicalPort"/></configuration> \ No newline at end of file diff --git a/modules/plugins/apache/src/test/resources/loadconfig/IfModule1 b/modules/plugins/apache/src/test/resources/loadconfig/IfModule1 new file mode 100644 index 0000000..823aee3 --- /dev/null +++ b/modules/plugins/apache/src/test/resources/loadconfig/IfModule1 @@ -0,0 +1,2 @@ +<?xml version="1.0"?> +<configuration><list name="IfModules"><map name="IfModule"><simple name="condition">test2.c</simple></map></list><simple name="Order">Deny,Allow</simple><list name="Allow"><map name="Allow"><simple name="host">apache.org</simple><simple name="_index">0</simple></map></list><list name="Deny"><map name="Deny"><simple name="host">all</simple><simple name="_index">0</simple></map></list><list name="AllowOverride"><map name="AllowOverride"><simple name="param">AuthConfig</simple><simple name="_index">0</simple></map><map name="AllowOverride"><simple name="param">Indexes</simple><simple name="_index">0</simple></map></list><simple name="AddDefaultCharset">utf-8</simple><simple name="DefaultType">image/gif</simple><list name="DirectoryIndex"><map name="DirectoryIndex"><simple name="host">index.html</simple><simple name="_index">0</simple></map></list><list name="ErrorDocument"><map name="ErrorDocument"><simple name="responseCode">403</simple><simple name="document">"Sorry can't allow you access today"</simple></map></list><list name="Options"><map name="Options"><simple name="Mode">Add</simple><simple name="Option">Includes</simple><simple name="_index">0</simple></map><map name="Options"><simple name="Mode">Remove</simple><simple name="Option">Indexes</simple><simple name="_index">0</simple></map></list><simple name="UseCanonicalName">DNS</simple><simple name="UseCanonicalPhysicalPort"/></configuration> \ No newline at end of file diff --git a/modules/plugins/apache/src/test/resources/nested.conf b/modules/plugins/apache/src/test/resources/nested.conf new file mode 100644 index 0000000..37326cb --- /dev/null +++ b/modules/plugins/apache/src/test/resources/nested.conf @@ -0,0 +1,12 @@ + <IfModule test2.c> + Order Deny,Allow + Allow from apache.org + Deny from all + AllowOverride AuthConfig Indexes + DefaultType image/gif + AddDefaultCharset utf-8 + DirectoryIndex index.html + ErrorDocument 403 "Sorry can't allow you access today" + Options +Includes -Indexes + UseCanonicalName DNS + </IfModule> diff --git a/modules/plugins/apache/src/test/resources/updateconfig/httpd.aug b/modules/plugins/apache/src/test/resources/updateconfig/httpd.aug new file mode 100644 index 0000000..0fddced --- /dev/null +++ b/modules/plugins/apache/src/test/resources/updateconfig/httpd.aug @@ -0,0 +1,58 @@ +module Httpd = + autoload xfm + +(* Helpers *) + +(* Newlines can be escaped. *) +let sep = del /([ \t]+(\\\n)?)+/ " " +let eol = del /([ \t]*(\\\n)?)*\n/ "\n" + let del_str (s:string) = del s s +let ws = /[ \t]*/ +let alnum = /[a-zA-Z0-9_]+/ +(* the last character in the non-quoted word must not be a backslash. I guess this is not completely semantically + correct but at the same time, apache discourages to use backslashes for anything else than + line breaking so we should be safe here. This restriction is in place to support + escaped new lines in the sep and eol rules. *) +let word = /"([^"\n]|\\")*"|'([^'\n]|\\')*'|[^'" \t\n]*[^'" \t\n\]/ +let secarg = /"([^"\n]|\\")*"|'([^'\n]|\\')*'|[^'" \t\n>]+/ +let wskey (k:regexp) = del ws "" . key k +let params (param:regexp) = [ sep . label "param" . store param ]* +let sec (name:string) (body:lens) = + [ wskey ("<" . name) . params secarg . del_str ">" . eol . + body . del ws "" . del_str("</" . name . ">") . eol ] + +(* Definitions *) +let comment = [ del /([ \t]*(#.*)*)\n/ "#\n" ] + +let directive = [ wskey alnum . params word . eol ] + +let section (name:string) = sec name (directive|comment)* + +let sections (body:lens) = sec "Directory" body + | sec "DirectoryMatch" body + | sec "Files" body + | sec "FilesMatch" body + | sec "Location" body + | sec "LocationMatch" body + | sec "AuthnProviderAlias" body + | sec "IfDefine" body + | sec "IfVersion" body + | sec "Limit" body + | sec "LimitExcept" body + | sec "Proxy" body + | sec "ProxyMatch" body + | sec "VirtualHost" body + | sec "IfModule" body + + +(* What we want ot say is *) +(* let rec body = (directive|comment)* | ifModule body | directory body | ... *) +(* but we can't typecheck that *) + +(* FIXME: *) +(* - Nesting of sections *) +let rec lns = (directive | comment | sections lns)* + +let filter = + incl "/etc/httpd/conf/httpd.conf" +let xfm = transform lns filter diff --git a/modules/plugins/apache/src/test/resources/updateconfig/httpd.conf b/modules/plugins/apache/src/test/resources/updateconfig/httpd.conf new file mode 100644 index 0000000..75342e6 --- /dev/null +++ b/modules/plugins/apache/src/test/resources/updateconfig/httpd.conf @@ -0,0 +1,10 @@ +<VirtualHost 10.1.2.3> + ServerName www.example.com:80 + <Directory /usr/local/httpd/htdocs> + Order Deny,Allow + <IfModule test.c> + Order Deny,Allow + </IfModule> +</Directory> +Include included.conf +</VirtualHost> diff --git a/modules/plugins/apache/src/test/resources/updateconfig/included.conf b/modules/plugins/apache/src/test/resources/updateconfig/included.conf new file mode 100644 index 0000000..4aa2557 --- /dev/null +++ b/modules/plugins/apache/src/test/resources/updateconfig/included.conf @@ -0,0 +1,4 @@ +Include nested.conf +<Directory ~ "^/www/.*/[0-9]{3}"> + Order Deny,Allow +</Directory> diff --git a/modules/plugins/apache/src/test/resources/updateconfig/nested.conf b/modules/plugins/apache/src/test/resources/updateconfig/nested.conf new file mode 100644 index 0000000..ef66e99 --- /dev/null +++ b/modules/plugins/apache/src/test/resources/updateconfig/nested.conf @@ -0,0 +1,3 @@ + <IfModule test2.c> + UseCanonicalName DNS + </IfModule>
commit 0842b8358144b9af26e1e9385d8c2a60c1e337e5 Author: Joseph Marques joseph@redhat.com Date: Fri Jul 16 03:05:09 2010 -0400
BZ-614845: ensure that the form is submitted after the ajax-selection completes
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/alert/notification/details.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/alert/notification/details.xhtml index e5b1075..2eef373 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/alert/notification/details.xhtml +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/alert/notification/details.xhtml @@ -78,7 +78,7 @@ ignoreDupResponses="true" requestDelay="25" status="commonStatus" - onsubmit="getElementCrossBrowser('notificationListForm:refreshButton').click();" + oncomplete="getElementCrossBrowser('notificationListForm:refreshButton').click();" /> ui:remove <a4j:support event="onkeyup"
commit 9b91e5efdfd522c622bb8d779b01bd75b799e616 Author: Joseph Marques joseph@redhat.com Date: Fri Jul 16 01:42:31 2010 -0400
BZ-614886: fix permissions necessary for resource/plugin configuration updates
* historic/auditing data should not requires permission above and beyond the ability to view the corresponding resource to which that data is attached
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationManagerBean.java index 1652b0b..2e6198d 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationManagerBean.java @@ -846,13 +846,6 @@ public class ConfigurationManagerBean implements ConfigurationManagerLocal, Conf public PageList<ResourceConfigurationUpdate> findResourceConfigurationUpdates(Subject subject, Integer resourceId, Long beginDate, Long endDate, boolean suppressOldest, PageControl pc) {
- if (!authorizationManager.hasResourcePermission(subject, Permission.CONFIGURE, resourceId)) { - throw new PermissionException("User [" + subject.getName() - + "] does not have permission to manage configuration for resource[id=" + resourceId + "]"); - } - - Resource resource = entityManager.find(Resource.class, resourceId); - // TODO (ips, 04/01/10): Our id's are not guaranteed to be sequential, because our sequences are configured to // pre-create and cache blocks of 10 sequence id's, so it may be better to order by // "cu.createdTime", rather than "cu.id". @@ -893,11 +886,6 @@ public class ConfigurationManagerBean implements ConfigurationManagerLocal, Conf public PluginConfigurationUpdate getPluginConfigurationUpdate(Subject subject, int configurationUpdateId) { PluginConfigurationUpdate update = entityManager.find(PluginConfigurationUpdate.class, configurationUpdateId);
- if (!authorizationManager.canViewResource(subject, update.getResource().getId())) { - throw new PermissionException("User [" + subject.getName() - + "] does not have permission to view plugin configuration update for [" + update.getResource() + "]"); - } - update.getConfiguration(); // this is EAGER loaded, so this really doesn't do anything
return update;
commit 5f64058c9248af196fbf6136bfcbf2b0bc334f3e Author: Joseph Marques joseph@redhat.com Date: Fri Jul 16 01:30:14 2010 -0400
don't try to reload the data page upon authorization failures, just let it bubble up
diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/common/paging/PagedListDataModel.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/common/paging/PagedListDataModel.java index 0b1614f..c1c8ffe 100644 --- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/common/paging/PagedListDataModel.java +++ b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/common/paging/PagedListDataModel.java @@ -31,6 +31,7 @@ import org.rhq.core.gui.util.FacesContextUtility; import org.rhq.enterprise.gui.common.framework.PagedDataTableUIBean; import org.rhq.enterprise.gui.legacy.WebUser; import org.rhq.enterprise.gui.util.EnterpriseFacesContextUtility; +import org.rhq.enterprise.server.authz.PermissionException; import org.rhq.enterprise.server.util.HibernatePerformanceMonitor;
/** @@ -358,6 +359,8 @@ public abstract class PagedListDataModel<T> extends DataModel { } tryQueryAgain = true; } + } catch (PermissionException pe) { + throw pe; // don't try to reload the data page upon authorization failures, just let it bubble up } catch (Throwable t) { /* * known issues during pagination:
commit 632868dd3e8f3ee7a55f5bad02756d4b9df30a86 Author: Joseph Marques joseph@redhat.com Date: Thu Jul 15 23:41:52 2010 -0400
remove unnecessary debugging constructs
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestTextBox_v3.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestTextBox_v3.java index 0cd5f71..c14127b 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestTextBox_v3.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestTextBox_v3.java @@ -64,7 +64,6 @@ import org.rhq.core.domain.search.SearchSuggestion.Kind; import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup; import org.rhq.enterprise.gui.coregui.client.gwt.SearchGWTServiceAsync; import org.rhq.enterprise.gui.coregui.client.search.SearchBar; -import org.rhq.enterprise.gui.coregui.client.search.SearchLogger;
public class SuggestTextBox_v3 extends Composite implements HasText, HasAllFocusHandlers, HasValue<String>, HasSelectionHandlers<Suggestion> { @@ -512,8 +511,6 @@ public class SuggestTextBox_v3 extends Composite implements HasText, HasAllFocus String decoratedSuffix = wrap(highlightedSuggestion, "float: left; "); String floatClear = "<br style="clear: both;" />";
- SearchLogger.debug("decoratedSuffix: " + decoratedSuffix); - String innerHTML = decoratedPrefix + decoratedSuffix + floatClear; return innerHTML; } @@ -532,8 +529,6 @@ public class SuggestTextBox_v3 extends Composite implements HasText, HasAllFocus } }
- SearchLogger.debug("results: " + results); - return results.toString(); }
@@ -556,8 +551,6 @@ public class SuggestTextBox_v3 extends Composite implements HasText, HasAllFocus words.add(builder.toString()); }
- SearchLogger.debug("words: " + words); - return words; }
commit c8d7ffa904e66d92b89ae43df500200e7dbe5440 Author: Joseph Marques joseph@redhat.com Date: Thu Jul 15 23:40:26 2010 -0400
BZ-612739: use more sophisticated highlighting mechanism that respects line breaks
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestTextBox_v3.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestTextBox_v3.java index 0b9ac6c..0cd5f71 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestTextBox_v3.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestTextBox_v3.java @@ -18,6 +18,7 @@ */ package org.rhq.enterprise.gui.coregui.client.search.suggest;
+import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.List; @@ -63,6 +64,7 @@ import org.rhq.core.domain.search.SearchSuggestion.Kind; import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup; import org.rhq.enterprise.gui.coregui.client.gwt.SearchGWTServiceAsync; import org.rhq.enterprise.gui.coregui.client.search.SearchBar; +import org.rhq.enterprise.gui.coregui.client.search.SearchLogger;
public class SuggestTextBox_v3 extends Composite implements HasText, HasAllFocusHandlers, HasValue<String>, HasSelectionHandlers<Suggestion> { @@ -502,14 +504,16 @@ public class SuggestTextBox_v3 extends Composite implements HasText, HasAllFocus } }
- String decoratedPrefix = decorate(prefix, style); + String decoratedPrefix = wrap(prefix, style); String formattedItemLabel = chopWithEvery(item.getLabel(), "<br/>", 100); String decoratedItemLabel = decorate(formattedItemLabel, "background-color: yellow;", item.getStartIndex(), item.getEndIndex()); String highlightedSuggestion = colorOperator(decoratedItemLabel); - String decoratedSuffix = decorate(highlightedSuggestion, "float: left; "); + String decoratedSuffix = wrap(highlightedSuggestion, "float: left; "); String floatClear = "<br style="clear: both;" />";
+ SearchLogger.debug("decoratedSuffix: " + decoratedSuffix); + String innerHTML = decoratedPrefix + decoratedSuffix + floatClear; return innerHTML; } @@ -575,10 +579,11 @@ public class SuggestTextBox_v3 extends Composite implements HasText, HasAllFocus return data; }
- private static String decorate(String data, String style) { - return decorate(data, style, 0, data.length()); + private static String wrap(String data, String style) { + return "<span style="" + style + "">" + data + "</span>"; }
+ /* private static String decorate(String data, String style, int startIndex, int endIndex) { if (startIndex == -1) { return data; // no match @@ -588,6 +593,69 @@ public class SuggestTextBox_v3 extends Composite implements HasText, HasAllFocus String after = data.substring(endIndex); return before + "<span style="" + style + "">" + highlight + "</span>" + after; } + */ + + private static String decorate(String data, String style, int startIndex, int endIndex) { + if (startIndex == -1 || (startIndex == endIndex)) { + return data; // no match or zero-width match + } + + String[] words = data.split("<br/>"); + int counter = 0; + int wordIndex = 0; + int letterIndex = 0; + + StringBuilder results = new StringBuilder(); + while (counter < startIndex) { + if (wordIndex == words.length) { + break; + } + + if (letterIndex < words[wordIndex].length()) { // more letters left in the current word? + results.append(words[wordIndex].charAt(letterIndex)); // append the next char of the current word + letterIndex++; // move to the next char in the current word + counter++; // only move counter forward when we've added non-BR chars to the results + } else { // next word + results.append("<br/>"); // put the break point back in between words + letterIndex = 0; // point to the first char + wordIndex++; // of the next word + } + } + + // we're at start index, wrap all words and word fragments in the specified style up to endIndex + results.append("<span style="" + style + "">"); // seed action + while (counter < endIndex) { + if (wordIndex == words.length) { + break; + } + + if (letterIndex < words[wordIndex].length()) { // more letters left in the current word? + results.append(words[wordIndex].charAt(letterIndex)); // append the next char of the current word + letterIndex++; // move to the next char in the current word + counter++; // only move counter forward when we've added non-BR chars to the results + } else { // next word + results.append("</span>"); // close the previous word, we don't highlight breaks + results.append("<br/>"); // put the break point back in between words + letterIndex = 0; // point to the first char + wordIndex++; // of the next word + results.append("<span style="" + style + "">"); // prepare for next word + } + } + results.append("</span>"); // end last dangling span + + // append the rest of the current word fragment, if any + if (wordIndex != words.length) { + results.append(words[wordIndex].substring(letterIndex)); + } + + // append the rest of the words + while (++wordIndex < words.length) { + results.append("<br/>"); // put the break point back in between words + results.append(words[wordIndex]); + } + + return results.toString(); + } }
class SearchSuggestOracle extends SuggestOracle {
commit fdef972cd1fdb826536b80e6e2e44f5c07ea2351 Author: Joseph Marques joseph@redhat.com Date: Thu Jul 15 23:39:41 2010 -0400
BZ-612739: ensure that search suggestions never overflow drop-down boundaries
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestTextBox_v3.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestTextBox_v3.java index bce49e4..0b9ac6c 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestTextBox_v3.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestTextBox_v3.java @@ -503,7 +503,7 @@ public class SuggestTextBox_v3 extends Composite implements HasText, HasAllFocus }
String decoratedPrefix = decorate(prefix, style); - String formattedItemLabel = chopWithEvery(item.getLabel(), "<br/>", 110); + String formattedItemLabel = chopWithEvery(item.getLabel(), "<br/>", 100); String decoratedItemLabel = decorate(formattedItemLabel, "background-color: yellow;", item.getStartIndex(), item.getEndIndex()); String highlightedSuggestion = colorOperator(decoratedItemLabel); @@ -514,21 +514,49 @@ public class SuggestTextBox_v3 extends Composite implements HasText, HasAllFocus return innerHTML; }
- private static String chopWithEvery(String chop, String with, int every) { - String[] words = chop.split("\s"); + private static String chopWithEvery(String toChop, String with, int every) { + //String[] words = toChop.split("\s"); + List<String> words = chop(toChop, "\/- \t\r\n"); StringBuilder results = new StringBuilder(); int currentLineLength = 0; for (String next : words) { + results.append(next); + currentLineLength += next.length(); if (currentLineLength + next.length() > every) { results.append(with); currentLineLength = 0; } - results.append(next).append(' '); - currentLineLength += (next.length() + 1); } + + SearchLogger.debug("results: " + results); + return results.toString(); }
+ // StringTokenzier doesn't exist in GWT, so have to write my own + private static List<String> chop(String dataToChop, String chopTokens) { + List<String> words = new ArrayList<String>(); + + StringBuilder builder = new StringBuilder(); + for (char next : dataToChop.toCharArray()) { + if (chopTokens.indexOf(next) != -1) { + if (builder.length() > 0) { + words.add(builder.toString()); + builder = new StringBuilder(); + } + } + builder.append(next); + } + + if (builder.length() > 0) { + words.add(builder.toString()); + } + + SearchLogger.debug("words: " + words); + + return words; + } + private static final List<String> OPERATORS = Arrays.asList("!==", "!=", "==", "=");
// TODO: fixing coloring strategy
commit a3c9ba855d997ecc918e5f666b8757acf9a2804b Author: Joseph Marques joseph@redhat.com Date: Thu Jul 15 23:37:33 2010 -0400
parenthesize saved search results counts on all screens
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/favorites/SavedSearchGrid.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/favorites/SavedSearchGrid.java index ee7647b..c250f7c 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/favorites/SavedSearchGrid.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/favorites/SavedSearchGrid.java @@ -140,7 +140,7 @@ public class SavedSearchGrid extends Grid { private static String stylize(SavedSearch savedSearch) { String name = savedSearch.getName(); String pattern = savedSearch.getPattern(); - String count = savedSearch.getResultCount() == null ? "" : String.valueOf(savedSearch.getResultCount()); + String count = savedSearch.getResultCount() == null ? "" : "(" + savedSearch.getResultCount() + ")"; return "<span class="savedSearchesPanel-top">" + name + "</span> " + count + "<br/>" // + "<span class="savedSearchesPanel-bottom">" + pattern + "</span>"; }
commit 58c0104617caf09db42c7802e55d6df3fb420f81 Author: John Mazzitelli mazz@redhat.com Date: Thu Jul 15 18:52:29 2010 -0400
BZ 535784 - pass in -e argument to readlink to support the "double linked" problem where rc.3.d has a symlink to init.d which in turn is a symlink to rhq-agent-wrapper.sh. Need -e so readlink recursively walks the symlinks to reach the actual script file
diff --git a/modules/enterprise/agent/src/etc/rhq-agent-wrapper.sh b/modules/enterprise/agent/src/etc/rhq-agent-wrapper.sh index ee714a9..2bb861c 100755 --- a/modules/enterprise/agent/src/etc/rhq-agent-wrapper.sh +++ b/modules/enterprise/agent/src/etc/rhq-agent-wrapper.sh @@ -94,12 +94,34 @@ prepare_pid_dir () fi }
+# ---------------------------------------------------------------------- +# Determine what specific platform we are running on. +# Set some platform-specific variables. + +case "`uname`" in + CYGWIN*) _CYGWIN=true + ;; + Linux*) _LINUX=true + ;; + Darwin*) _DARWIN=true + ;; + SunOS*) _SOLARIS=true + ;; + AIX*) _AIX=true + ;; +esac + # ------------------------------- # Get the location of this script. # Make sure we take into account the possibility $0 # is a symlink to the real agent installation script. +# Only certain platforms support the -e option of readlink + +if [ "x${_LINUX}${_SOLARIS}${_CYGWIN}" != "x" ]; then + _READLINK_ARG="-e" +fi
-_DOLLARZERO=`readlink "$0" || echo "$0"` +_DOLLARZERO=`readlink $_READLINK_ARG "$0" 2>/dev/null|| echo "$0"` RHQ_AGENT_WRAPPER_BIN_DIR_PATH=`dirname "$_DOLLARZERO"` debug_wrapper_msg "RHQ_AGENT_WRAPPER_BIN_DIR_PATH=$RHQ_AGENT_WRAPPER_BIN_DIR_PATH"
diff --git a/modules/enterprise/agent/src/etc/rhq-agent.sh b/modules/enterprise/agent/src/etc/rhq-agent.sh index 8ef0625..e0122bd 100755 --- a/modules/enterprise/agent/src/etc/rhq-agent.sh +++ b/modules/enterprise/agent/src/etc/rhq-agent.sh @@ -34,6 +34,7 @@ debug_msg () # ---------------------------------------------------------------------- # Try to determine the fallback JAVA_HOME if not already set # ---------------------------------------------------------------------- + set_java_home () { if [ "x$JAVA_HOME" = "x" ]; then @@ -56,6 +57,7 @@ set_java_home () # Determine what specific platform we are running on. # Set some platform-specific variables. # ---------------------------------------------------------------------- + case "`uname`" in CYGWIN*) _CYGWIN=true ;; @@ -63,6 +65,10 @@ case "`uname`" in ;; Darwin*) _DARWIN=true ;; + SunOS*) _SOLARIS=true + ;; + AIX*) _AIX=true + ;; esac
case "`uname -m`" in @@ -76,7 +82,13 @@ esac # We also assume our custom environment script is located in the same # place as this script. # ---------------------------------------------------------------------- -_DOLLARZERO=`readlink "$0" 2>/dev/null || echo "$0"` + +if [ "x${_LINUX}${_SOLARIS}${_CYGWIN}" != "x" ]; then + # only certain platforms support the -e argument for readlink + _READLINK_ARG="-e" +fi + +_DOLLARZERO=`readlink $_READLINK_ARG "$0" 2>/dev/null || echo "$0"` RHQ_AGENT_BIN_DIR_PATH=`dirname "$_DOLLARZERO"`
if [ -f "${RHQ_AGENT_BIN_DIR_PATH}/rhq-agent-env.sh" ]; then diff --git a/modules/enterprise/server/container/src/main/bin-resources/bin/rhq-server.sh b/modules/enterprise/server/container/src/main/bin-resources/bin/rhq-server.sh index 9179850..bbef0bf 100644 --- a/modules/enterprise/server/container/src/main/bin-resources/bin/rhq-server.sh +++ b/modules/enterprise/server/container/src/main/bin-resources/bin/rhq-server.sh @@ -178,12 +178,14 @@ remove_pid_files () case "`uname`" in CYGWIN*) _CYGWIN=true ;; + Linux*) _LINUX=true + ;; Darwin*) _DARWIN=true ;; SunOS*) _SOLARIS=true ;; - AIX*) _AIX=true - ;; + AIX*) _AIX=true + ;; esac
# ---------------------------------------------------------------------- @@ -193,7 +195,11 @@ esac # ----------------------------------------------------------------------
if [ -z "$RHQ_SERVER_HOME" ]; then - _DOLLARZERO=`readlink "$0" 2>/dev/null || echo "$0"` + if [ "x${_LINUX}${_SOLARIS}${_CYGWIN}" != "x" ]; then + # only certain platforms support the -e argument for readlink + _READLINK_ARG="-e" + fi + _DOLLARZERO=`readlink $_READLINK_ARG "$0" 2>/dev/null || echo "$0"` RHQ_SERVER_HOME=`dirname "$_DOLLARZERO"`/.. else if [ ! -d "$RHQ_SERVER_HOME" ]; then
commit 18ef5bdb6c05411b93e80df9c66f8e1b403f8939 Author: Joseph Marques joseph@redhat.com Date: Thu Jul 15 16:20:36 2010 -0400
fix the highlighting strategy to respect ^ and $ boundary characters
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java index e721cb4..92138bf 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java @@ -643,9 +643,21 @@ public class SearchAssistManager {
private List<SearchSuggestion> convert(List<String> suggestions, ParsedContext parsed, String term, Kind kind) { int startIndex = getStartIndex(parsed); + LOG.debug("convert(suggestions.size()=" + suggestions.size() + ", " + parsed + ", " + term + ", " + kind + ")"); term = term.toLowerCase(); List<SearchSuggestion> results = new ArrayList<SearchSuggestion>(suggestions.size()); for (String suggestion : suggestions) { + boolean startBounded = term.startsWith("^"); + boolean endBounded = term.endsWith("$"); + + if (startBounded && endBounded) { + term = term.substring(1, term.length() - 1); + } else if (startBounded) { + term = term.substring(1); + } else if (endBounded) { + term = term.substring(0, term.length() - 1); + } + int index = suggestion.toLowerCase().indexOf(term, startIndex); results.add(new SearchSuggestion(kind, suggestion, index, term.length())); }
commit c0967d64b12aa0d7852dd36a8e5f782dbd4c226b Author: John Mazzitelli mazz@redhat.com Date: Thu Jul 15 16:20:57 2010 -0400
redirect error stream of readlink to dev/null when starting standalone pc
diff --git a/etc/standalone-pc/standalone.sh b/etc/standalone-pc/standalone.sh index 29fd40f..d8ffef6 100755 --- a/etc/standalone-pc/standalone.sh +++ b/etc/standalone-pc/standalone.sh @@ -1,6 +1,6 @@ #!/bin/sh
-_DOLLARZERO=`readlink "$0" || echo "$0"` +_DOLLARZERO=`readlink "$0" 2>/dev/null || echo "$0"` RHQ_AGENT_BIN_DIR_PATH=`dirname "$_DOLLARZERO"` RHQ_AGENT_MAINCLASS=org.rhq.core.pc.StandaloneContainer export RHQ_AGENT_MAINCLASS
commit 15dec636ee9519d754306c44b0f0ca0263383d4b Author: John Mazzitelli mazz@redhat.com Date: Thu Jul 15 16:20:37 2010 -0400
remove the chkconfig headers - its a copy-paste from the server script - doesn't make sense to have it here in the generate db passwd script
diff --git a/modules/enterprise/server/container/src/main/bin-resources/bin/generate-db-password.sh b/modules/enterprise/server/container/src/main/bin-resources/bin/generate-db-password.sh index e436d87..1d464d7 100755 --- a/modules/enterprise/server/container/src/main/bin-resources/bin/generate-db-password.sh +++ b/modules/enterprise/server/container/src/main/bin-resources/bin/generate-db-password.sh @@ -1,10 +1,5 @@ #!/bin/sh
-# chkconfig: 2345 92 26 -# description: Starts and stops the RHQ Server -# -# processname: java - # ============================================================================= # RHQ Server UNIX Generate db password script #
commit 13f07907fb73d9085e26c62e85938649c8eadadd Author: Joseph Marques joseph@redhat.com Date: Thu Jul 15 15:33:48 2010 -0400
only add fragments to the generation suggestion-JPQL as necessary
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/AbstractSearchAssistant.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/AbstractSearchAssistant.java index 87e10a5..94a2bd5 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/AbstractSearchAssistant.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/AbstractSearchAssistant.java @@ -1,5 +1,7 @@ package org.rhq.enterprise.server.search.assist;
+import static org.rhq.enterprise.server.search.common.SearchQueryGenerationUtility.getJPQLForString; + import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -12,7 +14,6 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory;
import org.rhq.enterprise.server.util.LookupUtil; -import org.rhq.enterprise.server.util.QueryUtility;
public abstract class AbstractSearchAssistant implements SearchAssistant {
@@ -95,11 +96,12 @@ public abstract class AbstractSearchAssistant implements SearchAssistant { return results; }
- protected final String add(String fragment, String parameter) { - if (parameter != null && !parameter.equals("")) { - return fragment; + protected final String conditionallyAddJPQLString(String fragment, String filter) { + if (filter == null || filter.equals("")) { + return ""; } - return ""; + + return " AND " + getJPQLForString(fragment, filter); }
protected final List<String> filter(Class<? extends Enum<?>> enumType, String filter) { @@ -145,10 +147,6 @@ public abstract class AbstractSearchAssistant implements SearchAssistant { return "'" + data + "'"; }
- protected final String escape(String data) { - return QueryUtility.escapeSearchParameter(data); - } - protected final String getFormatterValueFragment(String data) { boolean hasWhitespace = false; for (char next : data.toCharArray()) { diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/GroupSearchAssistant.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/GroupSearchAssistant.java index b4c3069..be85fc5 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/GroupSearchAssistant.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/GroupSearchAssistant.java @@ -1,7 +1,5 @@ package org.rhq.enterprise.server.search.assist;
-import static org.rhq.enterprise.server.search.common.SearchQueryGenerationUtility.getJPQLForString; - import java.util.Arrays; import java.util.Collections; import java.util.List; @@ -64,8 +62,8 @@ public class GroupSearchAssistant extends TabAwareSearchAssistant { + " FROM ResourceType type, ResourceGroup rg " // + " WHERE rg.resourceType = type " // only suggest names that exist for visible groups in inventory + " AND rg.visible = true " // - + " AND " + getJPQLForString("type.name", filter) // - + " AND " + getJPQLForString("rg.groupCategory", tab) // + + conditionallyAddJPQLString("type.name", filter) // + + conditionallyAddJPQLString("rg.groupCategory", tab) // + " ORDER BY type.name ");
} else if (context.equals("plugin")) { @@ -74,8 +72,8 @@ public class GroupSearchAssistant extends TabAwareSearchAssistant { + " FROM ResourceType type, ResourceGroup rg " // + " WHERE rg.resourceType = type " // only suggest names that exist for visible groups in inventory + " AND rg.visible = true " // - + " AND " + getJPQLForString("type.plugin", filter) // - + " AND " + getJPQLForString("rg.groupCategory", tab) // + + conditionallyAddJPQLString("type.plugin", filter) // + + conditionallyAddJPQLString("rg.groupCategory", tab) // + " ORDER BY type.plugin ");
} else if (context.equals("name")) { @@ -83,8 +81,8 @@ public class GroupSearchAssistant extends TabAwareSearchAssistant { + "SELECT DISTINCT rg.name " // + " FROM ResourceGroup rg " // + " WHERE rg.visible = true " // only suggest names that exist for visible groups in inventory - + " AND " + getJPQLForString("rg.name", filter) // - + " AND " + getJPQLForString("rg.groupCategory", tab) // + + conditionallyAddJPQLString("rg.name", filter) // + + conditionallyAddJPQLString("rg.groupCategory", tab) // + " ORDER BY rg.name ");
} else { diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/ResourceSearchAssistant.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/ResourceSearchAssistant.java index e0560bf..671095f 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/ResourceSearchAssistant.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/ResourceSearchAssistant.java @@ -1,7 +1,5 @@ package org.rhq.enterprise.server.search.assist;
-import static org.rhq.enterprise.server.search.common.SearchQueryGenerationUtility.getJPQLForString; - import java.util.Arrays; import java.util.Collections; import java.util.List; @@ -69,8 +67,8 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant { + " WHERE res.resourceType = type " // only suggest names that exist for resources in inventory + " AND simpleDefinition = definition " // only suggest names for simple properties + " AND simpleDefinition.type <> 'PASSWORD' " // do not suggest hidden/password property types - + " AND " + getJPQLForString("definition.name", filter) // - + " AND " + getJPQLForString("type.category", tab) // + + conditionallyAddJPQLString("definition.name", filter) // + + conditionallyAddJPQLString("type.category", tab) // + " ORDER BY definition.name ");
} else if (context.equals("configuration")) { @@ -81,8 +79,8 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant { + " WHERE res.resourceType = type " // only suggest names that exist for resources in inventory + " AND simpleDefinition = definition " // only suggest names for simple properties + " AND simpleDefinition.type <> 'PASSWORD' " // do not suggest hidden/password property types - + " AND " + getJPQLForString("definition.name", filter) // - + " AND " + getJPQLForString("type.category", tab) // + + conditionallyAddJPQLString("definition.name", filter) // + + conditionallyAddJPQLString("type.category", tab) // + " ORDER BY definition.name ");
} else if (context.equals("trait")) { @@ -92,8 +90,8 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant { + " JOIN ms.definition def " // + " WHERE ms.resource = res " // only suggest names that exist for resources in inventory + " AND def.dataType = 1 " // trait types - + " AND " + getJPQLForString("ms.definition.name", filter) // - + " AND " + getJPQLForString("res.resourceType.category", tab) // + + conditionallyAddJPQLString("ms.definition.name", filter) // + + conditionallyAddJPQLString("res.resourceType.category", tab) // + " ORDER BY def.name ");
} else { @@ -115,8 +113,8 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant { + "SELECT DISTINCT type.name " // + " FROM Resource res, ResourceType type " // + " WHERE res.resourceType = type " // - + " AND " + getJPQLForString("type.name", filter) // - + " AND " + getJPQLForString("type.category", tab) // + + conditionallyAddJPQLString("type.name", filter) // + + conditionallyAddJPQLString("type.category", tab) // + " ORDER BY type.name ");
} else if (context.equals("plugin")) { @@ -124,8 +122,8 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant { + "SELECT DISTINCT type.plugin " // + " FROM Resource res, ResourceType type " // + " WHERE res.resourceType = type " // - + " AND " + getJPQLForString("type.plugin", filter) // - + " AND " + getJPQLForString("type.category", tab) // + + conditionallyAddJPQLString("type.plugin", filter) // + + conditionallyAddJPQLString("type.category", tab) // + " ORDER BY type.plugin ");
} else if (context.equals("name")) { @@ -133,8 +131,8 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant { + "SELECT DISTINCT res.name " // + " FROM Resource res, ResourceType type " // + " WHERE res.resourceType = type " // - + " AND " + getJPQLForString("res.name", filter) // - + " AND " + getJPQLForString("type.category", tab) // + + conditionallyAddJPQLString("res.name", filter) // + + conditionallyAddJPQLString("type.category", tab) // + " ORDER BY res.name ");
} else if (context.equals("alerts")) { @@ -150,9 +148,9 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant { + " AND simpleDefinition.type <> 'PASSWORD' " // do not suggest hidden/password property types + " AND property = simple " // join here so we can project simple.stringValue + " AND property.name = propertyDefinition.name " // property/definition are linked via name - + " AND " + getJPQLForString("property.name", param) // - + " AND " + getJPQLForString("property.stringValue", filter) // - + " AND " + getJPQLForString("res.resourceType.category", tab) // + + conditionallyAddJPQLString("property.name", param) // + + conditionallyAddJPQLString("property.stringValue", filter) // + + conditionallyAddJPQLString("res.resourceType.category", tab) // + " ORDER BY simple.stringValue ");
} else if (context.equals("configuration")) { @@ -165,9 +163,9 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant { + " AND simpleDefinition.type <> 'PASSWORD' " // do not suggest hidden/password property types + " AND property = simple " // join here so we can project simple.stringValue + " AND property.name = propertyDefinition.name " // property/definition are linked via name - + " AND " + getJPQLForString("property.name", param) // - + " AND " + getJPQLForString("property.stringValue", filter) // - + " AND " + getJPQLForString("res.resourceType.category", tab) // + + conditionallyAddJPQLString("property.name", param) // + + conditionallyAddJPQLString("property.stringValue", filter) // + + conditionallyAddJPQLString("res.resourceType.category", tab) // + " ORDER BY simple.stringValue ");
} else if (context.equals("trait")) { @@ -177,9 +175,9 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant { + " JOIN trait.schedule ms " // + " WHERE ms.definition.dataType = 1 " // + " AND ms.resource = res " // only suggest values that exist for inventoried resources - + " AND " + getJPQLForString("ms.definition.name", param) // - + " AND " + getJPQLForString("trait.value", filter) // - + " AND " + getJPQLForString("res.resourceType.category", tab) // + + conditionallyAddJPQLString("ms.definition.name", param) // + + conditionallyAddJPQLString("trait.value", filter) // + + conditionallyAddJPQLString("res.resourceType.category", tab) // + " ORDER BY trait.value ");
} else {
commit 39d835db7d1331f3c4c9f279ebb431316b7eabe9 Author: Joseph Marques joseph@redhat.com Date: Thu Jul 15 15:33:13 2010 -0400
support suggesting "null" values without quotes, which **is** a valid search term value
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java index 45b5358..e721cb4 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java @@ -681,6 +681,11 @@ public class SearchAssistManager {
List<String> results = new ArrayList<String>(); for (String next : data) { + if (next == null) { + results.add("null"); // null search comparisons should never be quoted + continue; + } + boolean hasWhiteSpace = next.matches(".*\s.*"); if (hasWhiteSpace == false) { // don't pad things that don't need padding
commit 5d75679249ad69455da1a121cb3355ab75dc9629 Author: Joseph Marques joseph@redhat.com Date: Thu Jul 15 15:11:05 2010 -0400
BZ-615017: enhance search suggestion/execution support for boundary matching
this fix supports all three styles for search terms:
* value * context=value * context[parameter]=value
this fix enhances boundar matching in the following ways:
1) adds boundary matching for 'parameter' suggestions 2) adds boundary matching for 'values' suggestions 3) supports search execution for bounded 'parameter' 4) supports search execution for bounded 'values'
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/GroupSearchAssistant.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/GroupSearchAssistant.java index cee5ff2..b4c3069 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/GroupSearchAssistant.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/GroupSearchAssistant.java @@ -1,5 +1,7 @@ package org.rhq.enterprise.server.search.assist;
+import static org.rhq.enterprise.server.search.common.SearchQueryGenerationUtility.getJPQLForString; + import java.util.Arrays; import java.util.Collections; import java.util.List; @@ -62,8 +64,8 @@ public class GroupSearchAssistant extends TabAwareSearchAssistant { + " FROM ResourceType type, ResourceGroup rg " // + " WHERE rg.resourceType = type " // only suggest names that exist for visible groups in inventory + " AND rg.visible = true " // - + add(" AND LOWER(rg.groupCategory) = '" + tab + "'", tab) // - + add(" AND LOWER(type.name) LIKE '%" + escape(filter.toLowerCase()) + "%'", filter) // + + " AND " + getJPQLForString("type.name", filter) // + + " AND " + getJPQLForString("rg.groupCategory", tab) // + " ORDER BY type.name ");
} else if (context.equals("plugin")) { @@ -72,8 +74,8 @@ public class GroupSearchAssistant extends TabAwareSearchAssistant { + " FROM ResourceType type, ResourceGroup rg " // + " WHERE rg.resourceType = type " // only suggest names that exist for visible groups in inventory + " AND rg.visible = true " // - + add(" AND LOWER(rg.groupCategory) = '" + tab + "'", tab) // - + add(" AND LOWER(type.plugin) LIKE '%" + escape(filter.toLowerCase()) + "%'", filter) // + + " AND " + getJPQLForString("type.plugin", filter) // + + " AND " + getJPQLForString("rg.groupCategory", tab) // + " ORDER BY type.plugin ");
} else if (context.equals("name")) { @@ -81,8 +83,8 @@ public class GroupSearchAssistant extends TabAwareSearchAssistant { + "SELECT DISTINCT rg.name " // + " FROM ResourceGroup rg " // + " WHERE rg.visible = true " // only suggest names that exist for visible groups in inventory - + add(" AND LOWER(rg.groupCategory) = '" + tab + "'", tab) // - + add(" AND LOWER(rg.name) LIKE '%" + escape(filter.toLowerCase()) + "%'", filter) // + + " AND " + getJPQLForString("rg.name", filter) // + + " AND " + getJPQLForString("rg.groupCategory", tab) // + " ORDER BY rg.name ");
} else { diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/ResourceSearchAssistant.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/ResourceSearchAssistant.java index 9900ecb..e0560bf 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/ResourceSearchAssistant.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/ResourceSearchAssistant.java @@ -1,5 +1,7 @@ package org.rhq.enterprise.server.search.assist;
+import static org.rhq.enterprise.server.search.common.SearchQueryGenerationUtility.getJPQLForString; + import java.util.Arrays; import java.util.Collections; import java.util.List; @@ -67,8 +69,8 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant { + " WHERE res.resourceType = type " // only suggest names that exist for resources in inventory + " AND simpleDefinition = definition " // only suggest names for simple properties + " AND simpleDefinition.type <> 'PASSWORD' " // do not suggest hidden/password property types - + add(" AND LOWER(type.category) = '" + tab + "'", tab) // - + add(" AND LOWER(definition.name) LIKE '%" + escape(filter.toLowerCase()) + "%'", filter) // + + " AND " + getJPQLForString("definition.name", filter) // + + " AND " + getJPQLForString("type.category", tab) // + " ORDER BY definition.name ");
} else if (context.equals("configuration")) { @@ -79,8 +81,8 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant { + " WHERE res.resourceType = type " // only suggest names that exist for resources in inventory + " AND simpleDefinition = definition " // only suggest names for simple properties + " AND simpleDefinition.type <> 'PASSWORD' " // do not suggest hidden/password property types - + add(" AND LOWER(type.category) = '" + tab + "'", tab) // - + add(" AND LOWER(definition.name) LIKE '%" + escape(filter.toLowerCase()) + "%'", filter) // + + " AND " + getJPQLForString("definition.name", filter) // + + " AND " + getJPQLForString("type.category", tab) // + " ORDER BY definition.name ");
} else if (context.equals("trait")) { @@ -90,8 +92,8 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant { + " JOIN ms.definition def " // + " WHERE ms.resource = res " // only suggest names that exist for resources in inventory + " AND def.dataType = 1 " // trait types - + add(" AND LOWER(res.resourceType.category) = '" + tab + "'", tab) // - + add(" AND LOWER(def.name) LIKE '%" + escape(filter.toLowerCase()) + "%'", filter) // + + " AND " + getJPQLForString("ms.definition.name", filter) // + + " AND " + getJPQLForString("res.resourceType.category", tab) // + " ORDER BY def.name ");
} else { @@ -113,8 +115,8 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant { + "SELECT DISTINCT type.name " // + " FROM Resource res, ResourceType type " // + " WHERE res.resourceType = type " // - + add(" AND LOWER(type.category) = '" + tab + "'", tab) // - + add(" AND LOWER(type.name) LIKE '%" + escape(filter.toLowerCase()) + "%'", filter) // + + " AND " + getJPQLForString("type.name", filter) // + + " AND " + getJPQLForString("type.category", tab) // + " ORDER BY type.name ");
} else if (context.equals("plugin")) { @@ -122,8 +124,8 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant { + "SELECT DISTINCT type.plugin " // + " FROM Resource res, ResourceType type " // + " WHERE res.resourceType = type " // - + add(" AND LOWER(type.category) = '" + tab + "'", tab) // - + add(" AND LOWER(type.plugin) LIKE '%" + escape(filter.toLowerCase()) + "%'", filter) // + + " AND " + getJPQLForString("type.plugin", filter) // + + " AND " + getJPQLForString("type.category", tab) // + " ORDER BY type.plugin ");
} else if (context.equals("name")) { @@ -131,8 +133,8 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant { + "SELECT DISTINCT res.name " // + " FROM Resource res, ResourceType type " // + " WHERE res.resourceType = type " // - + add(" AND LOWER(type.category) = '" + tab + "'", tab) // - + add(" AND LOWER(res.name) LIKE '%" + escape(filter.toLowerCase()) + "%'", filter) // + + " AND " + getJPQLForString("res.name", filter) // + + " AND " + getJPQLForString("type.category", tab) // + " ORDER BY res.name ");
} else if (context.equals("alerts")) { @@ -148,9 +150,9 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant { + " AND simpleDefinition.type <> 'PASSWORD' " // do not suggest hidden/password property types + " AND property = simple " // join here so we can project simple.stringValue + " AND property.name = propertyDefinition.name " // property/definition are linked via name - + " AND LOWER(property.name) LIKE '%" + escape(param.toLowerCase()) + "%'" // - + add(" AND LOWER(res.resourceType.category) = '" + tab + "'", tab) // - + add(" AND LOWER(property.stringValue) LIKE '%" + escape(filter.toLowerCase()) + "%'", filter) // + + " AND " + getJPQLForString("property.name", param) // + + " AND " + getJPQLForString("property.stringValue", filter) // + + " AND " + getJPQLForString("res.resourceType.category", tab) // + " ORDER BY simple.stringValue ");
} else if (context.equals("configuration")) { @@ -163,9 +165,9 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant { + " AND simpleDefinition.type <> 'PASSWORD' " // do not suggest hidden/password property types + " AND property = simple " // join here so we can project simple.stringValue + " AND property.name = propertyDefinition.name " // property/definition are linked via name - + " AND LOWER(property.name) LIKE '%" + escape(param.toLowerCase()) + "%'" // - + add(" AND LOWER(res.resourceType.category) = '" + tab + "'", tab) // - + add(" AND LOWER(property.stringValue) LIKE '%" + escape(filter.toLowerCase()) + "%'", filter) // + + " AND " + getJPQLForString("property.name", param) // + + " AND " + getJPQLForString("property.stringValue", filter) // + + " AND " + getJPQLForString("res.resourceType.category", tab) // + " ORDER BY simple.stringValue ");
} else if (context.equals("trait")) { @@ -175,9 +177,9 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant { + " JOIN trait.schedule ms " // + " WHERE ms.definition.dataType = 1 " // + " AND ms.resource = res " // only suggest values that exist for inventoried resources - + " AND LOWER(ms.definition.name) LIKE '%" + escape(param.toLowerCase()) + "%'" // - + add(" AND LOWER(res.resourceType.category) = '" + tab + "'", tab) // - + add(" AND LOWER(trait.value) LIKE '%" + escape(filter.toLowerCase()) + "%'", filter) // + + " AND " + getJPQLForString("ms.definition.name", param) // + + " AND " + getJPQLForString("trait.value", filter) // + + " AND " + getJPQLForString("res.resourceType.category", tab) // + " ORDER BY trait.value ");
} else { @@ -185,5 +187,4 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant {
} } - } diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/common/SearchQueryGenerationUtility.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/common/SearchQueryGenerationUtility.java new file mode 100644 index 0000000..734526a --- /dev/null +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/common/SearchQueryGenerationUtility.java @@ -0,0 +1,90 @@ +package org.rhq.enterprise.server.search.common; + +import org.rhq.enterprise.server.search.translation.antlr.RHQLComparisonOperator; +import org.rhq.enterprise.server.util.QueryUtility; + +public class SearchQueryGenerationUtility { + public enum ValueFilter { + STARTS_WITH, // + ENDS_WITH, // + INDEX_OF, // + EXACT_MATCH; + } + + public static String getJPQLForString(String fragment, String value) { + if (value == null) { + value = ""; + } + + return getJPQLForString(fragment, RHQLComparisonOperator.EQUALS, value); + } + + public static String getJPQLForString(String fragment, RHQLComparisonOperator operator, String value) { + if (value == null) { + value = ""; + } + + int size = value.length(); + if (value.startsWith("^")) { + if (value.endsWith("$")) { + return getJPQLForString(fragment, operator, value.substring(1, size - 1), ValueFilter.EXACT_MATCH); + } else { + return getJPQLForString(fragment, operator, value.substring(1), ValueFilter.STARTS_WITH); + } + } else { + if (value.endsWith("$")) { + return getJPQLForString(fragment, operator, value.substring(0, size - 1), ValueFilter.ENDS_WITH); + } else { + return getJPQLForString(fragment, operator, value, ValueFilter.INDEX_OF); + } + } + } + + private static String getJPQLForString(String fragment, RHQLComparisonOperator operator, String value, + ValueFilter filter) { + if (operator == RHQLComparisonOperator.EQUALS) { + return lower(fragment) + " LIKE " + process(filter, value.toLowerCase()); + + } else if (operator == RHQLComparisonOperator.EQUALS_STRICT) { + return fragment + " LIKE " + process(filter, value); + + } else if (operator == RHQLComparisonOperator.NOT_EQUALS) { + return lower(fragment) + " NOT LIKE " + process(filter, value.toLowerCase()); + + } else if (operator == RHQLComparisonOperator.NOT_EQUALS_STRICT) { + return fragment + " NOT LIKE " + process(filter, value); + + } else if (operator == RHQLComparisonOperator.NULL) { + return fragment + " IS NULL"; + + } else if (operator == RHQLComparisonOperator.NOT_NULL) { + return fragment + " IS NOT NULL"; + + } else { + throw new IllegalArgumentException("Unsupported operator " + operator); + } + } + + private static String process(ValueFilter filter, String value) { + if (filter == ValueFilter.STARTS_WITH) { + return "'" + escape(value) + "%'"; + } else if (filter == ValueFilter.ENDS_WITH) { + return "'%" + escape(value) + "'"; + } else if (filter == ValueFilter.INDEX_OF) { + return "'%" + escape(value) + "%'"; + } else if (filter == ValueFilter.EXACT_MATCH) { + return "'" + escape(value) + "'"; + } else { + throw new IllegalArgumentException("Unsupported ValueFilter: " + filter); + } + } + + public static String lower(String data) { + return "LOWER(" + data + ")"; + } + + public static String escape(String data) { + return QueryUtility.escapeSearchParameter(data); + } + +} diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java index e94f938..45b5358 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java @@ -220,9 +220,9 @@ public class SearchAssistManager { this.type = computeType(param, operator);
this.context = (this.type == Type.SIMPLE) ? stripQuotes(context) : context; - this.param = param; + this.param = param == null ? "" : param; // ensure non-null this.operator = operator; - this.value = value; + this.value = value == null ? "" : value; // ensure non-null }
private String stripQuotes(String data) { diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/AbstractSearchTranslator.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/AbstractSearchTranslator.java index 938b221..79f14ee 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/AbstractSearchTranslator.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/AbstractSearchTranslator.java @@ -1,72 +1,9 @@ package org.rhq.enterprise.server.search.translation;
import org.rhq.enterprise.server.search.translation.antlr.RHQLComparisonOperator; -import org.rhq.enterprise.server.util.QueryUtility;
public abstract class AbstractSearchTranslator implements SearchTranslator {
- public enum ValueFilter { - STARTS_WITH, // - ENDS_WITH, // - INDEX_OF, // - EXACT_MATCH; - } - - private String process(ValueFilter filter, String value) { - if (filter == ValueFilter.STARTS_WITH) { - return "'" + escape(value) + "%'"; - } else if (filter == ValueFilter.ENDS_WITH) { - return "'%" + escape(value) + "'"; - } else if (filter == ValueFilter.INDEX_OF) { - return "'%" + escape(value) + "%'"; - } else if (filter == ValueFilter.EXACT_MATCH) { - return "'" + escape(value) + "'"; - } else { - throw new IllegalArgumentException("Unsupported ValueFilter: " + filter); - } - } - - private String getJPQLForString(String fragment, RHQLComparisonOperator operator, String value, ValueFilter filter) { - if (operator == RHQLComparisonOperator.EQUALS) { - return lower(fragment) + " LIKE " + process(filter, value.toLowerCase()); - - } else if (operator == RHQLComparisonOperator.EQUALS_STRICT) { - return fragment + " LIKE " + process(filter, value); - - } else if (operator == RHQLComparisonOperator.NOT_EQUALS) { - return lower(fragment) + " NOT LIKE " + process(filter, value.toLowerCase()); - - } else if (operator == RHQLComparisonOperator.NOT_EQUALS_STRICT) { - return fragment + " NOT LIKE " + process(filter, value); - - } else if (operator == RHQLComparisonOperator.NULL) { - return fragment + " IS NULL"; - - } else if (operator == RHQLComparisonOperator.NOT_NULL) { - return fragment + " IS NOT NULL"; - - } else { - throw new IllegalArgumentException("Unsupported operator " + operator); - } - } - - protected String getJPQLForString(String fragment, RHQLComparisonOperator operator, String value) { - int size = value.length(); - if (value.startsWith("^")) { - if (value.endsWith("$")) { - return getJPQLForString(fragment, operator, value.substring(1, size - 1), ValueFilter.EXACT_MATCH); - } else { - return getJPQLForString(fragment, operator, value.substring(1), ValueFilter.STARTS_WITH); - } - } else { - if (value.endsWith("$")) { - return getJPQLForString(fragment, operator, value.substring(0, size - 1), ValueFilter.ENDS_WITH); - } else { - return getJPQLForString(fragment, operator, value, ValueFilter.INDEX_OF); - } - } - } - protected String getJPQLForEnum(String fragment, RHQLComparisonOperator operator, String value, Class<? extends Enum<?>> enumClass, boolean useOrdinal) { if (operator == RHQLComparisonOperator.NULL || // @@ -99,18 +36,10 @@ public abstract class AbstractSearchTranslator implements SearchTranslator { + value + "'"); }
- protected String lower(String data) { - return "LOWER(" + data + ")"; - } - protected String quote(String data) { return "'" + data + "'"; }
- protected String escape(String data) { - return QueryUtility.escapeSearchParameter(data); - } - protected final String addFragmentIfParameterNotValue(String fragment, String parameter, String value) { if (!parameter.equalsIgnoreCase(value)) { return fragment; diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/GroupSearchTranslator.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/GroupSearchTranslator.java index 5a603ed..0a2e0f1 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/GroupSearchTranslator.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/GroupSearchTranslator.java @@ -1,5 +1,7 @@ package org.rhq.enterprise.server.search.translation;
+import static org.rhq.enterprise.server.search.common.SearchQueryGenerationUtility.getJPQLForString; + import org.rhq.core.domain.resource.ResourceCategory; import org.rhq.enterprise.server.search.translation.antlr.RHQLAdvancedTerm; import org.rhq.enterprise.server.search.translation.antlr.RHQLComparisonOperator; diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/ResourceSearchTranslator.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/ResourceSearchTranslator.java index 3fd7b12..dfe53ec 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/ResourceSearchTranslator.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/ResourceSearchTranslator.java @@ -1,5 +1,7 @@ package org.rhq.enterprise.server.search.translation;
+import static org.rhq.enterprise.server.search.common.SearchQueryGenerationUtility.getJPQLForString; + import org.rhq.core.domain.alert.AlertPriority; import org.rhq.core.domain.measurement.AvailabilityType; import org.rhq.core.domain.resource.ResourceCategory; @@ -59,7 +61,7 @@ public class ResourceSearchTranslator extends AbstractSearchTranslator { + " JOIN res.schedules schedule " // + " WHERE trait.schedule = schedule " // + " AND schedule.definition.dataType = 1 " // - + " AND schedule.definition.name = " + quote(param) // + + " AND " + getJPQLForString("schedule.definition.name", RHQLComparisonOperator.EQUALS, param) // + " AND " + getJPQLForString("trait.value", op, filter));
} else if (path.equals("connection")) { @@ -71,7 +73,7 @@ public class ResourceSearchTranslator extends AbstractSearchTranslator { + " WHERE simpleDefinition = definition " // only provide translations for simple properties + " AND simpleDefinition.type <> 'PASSWORD' " // do not allow searching by hidden/password fields + " AND property = simple " // join to simple for filter by 'stringValue' attribute - + " AND definition.name = " + quote(param) // + + " AND " + getJPQLForString("definition.name", RHQLComparisonOperator.EQUALS, param) // + " AND " + getJPQLForString("simple.stringValue", op, filter));
} else if (path.equals("configuration")) { @@ -83,7 +85,7 @@ public class ResourceSearchTranslator extends AbstractSearchTranslator { + " WHERE simpleDefinition = definition " // only provide translations for simple properties + " AND simpleDefinition.type <> 'PASSWORD' " // do not allow searching by hidden/password fields + " AND property = simple " // join to simple for filter by 'stringValue' attribute - + " AND definition.name = " + quote(param) // + + " AND " + getJPQLForString("definition.name", RHQLComparisonOperator.EQUALS, param) // + " AND " + getJPQLForString("simple.stringValue", op, filter));
} else { diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/QueryUtility.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/QueryUtility.java index 8750977..c7cc99f 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/QueryUtility.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/QueryUtility.java @@ -40,7 +40,7 @@ public class QueryUtility { */ public static String escapeSearchParameter(String value) { if (value == null || value.trim().equals("")) { - return null; + return ""; // if we return null, query will get created as...where pathExpression LIKE '%null%' }
return doEscapeSearchParameter(value);
commit 2456bc0b79952de2486f750e6ed61752e8711475 Author: Joseph Marques joseph@redhat.com Date: Thu Jul 15 12:46:27 2010 -0400
do not escape enums in search
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/AbstractSearchTranslator.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/AbstractSearchTranslator.java index e2d3600..938b221 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/AbstractSearchTranslator.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/AbstractSearchTranslator.java @@ -14,13 +14,13 @@ public abstract class AbstractSearchTranslator implements SearchTranslator {
private String process(ValueFilter filter, String value) { if (filter == ValueFilter.STARTS_WITH) { - return "'" + QueryUtility.escapeSearchParameter(value) + "%'"; + return "'" + escape(value) + "%'"; } else if (filter == ValueFilter.ENDS_WITH) { - return "'%" + QueryUtility.escapeSearchParameter(value) + "'"; + return "'%" + escape(value) + "'"; } else if (filter == ValueFilter.INDEX_OF) { - return "'%" + QueryUtility.escapeSearchParameter(value) + "%'"; + return "'%" + escape(value) + "%'"; } else if (filter == ValueFilter.EXACT_MATCH) { - return "'" + QueryUtility.escapeSearchParameter(value) + "'"; + return "'" + escape(value) + "'"; } else { throw new IllegalArgumentException("Unsupported ValueFilter: " + filter); } @@ -71,14 +71,13 @@ public abstract class AbstractSearchTranslator implements SearchTranslator { Class<? extends Enum<?>> enumClass, boolean useOrdinal) { if (operator == RHQLComparisonOperator.NULL || // operator == RHQLComparisonOperator.NOT_NULL) { - return QueryUtility.escapeSearchParameter(fragment + operator.getDefaultTranslation()); + return fragment + operator.getDefaultTranslation();
} else if (operator == RHQLComparisonOperator.EQUALS || // operator == RHQLComparisonOperator.EQUALS_STRICT || // operator == RHQLComparisonOperator.NOT_EQUALS || // operator == RHQLComparisonOperator.NOT_EQUALS_STRICT) { - return QueryUtility.escapeSearchParameter(fragment + operator.getDefaultTranslation() - + getEnum(enumClass, value, useOrdinal)); + return fragment + operator.getDefaultTranslation() + getEnum(enumClass, value, useOrdinal);
} else { throw new IllegalArgumentException("Unsupported operator " + operator); @@ -108,6 +107,10 @@ public abstract class AbstractSearchTranslator implements SearchTranslator { return "'" + data + "'"; }
+ protected String escape(String data) { + return QueryUtility.escapeSearchParameter(data); + } + protected final String addFragmentIfParameterNotValue(String fragment, String parameter, String value) { if (!parameter.equalsIgnoreCase(value)) { return fragment;
commit 186aa9fe1f54389a86aa637577793284814c3a7d Author: Joseph Marques joseph@redhat.com Date: Thu Jul 15 12:20:14 2010 -0400
BZ-610135: provide intelligent quoting for suggestions
* if a suggestion doesn't need to be quoted, don't quote it * if a suggestion has whitespace, then determine how to quote it ** if it has only single-quotes in the value, wrap it in double-quotes ** if it has only double-quotes in the value, wrap it in single-quotes ** if it has both types of quotes in the value, don't quote it *** thus, treat mixed-quoted values single search terms so the parser won't bomb
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/search/SearchSuggestion.java b/modules/core/domain/src/main/java/org/rhq/core/domain/search/SearchSuggestion.java index aa02b08..fb1b135 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/search/SearchSuggestion.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/search/SearchSuggestion.java @@ -89,7 +89,19 @@ public class SearchSuggestion implements Serializable, Comparable<SearchSuggesti if (kindComparision != 0) { return kindComparision; } - return label.toLowerCase().compareTo(other.label.toLowerCase()); + return toLowerStripQuotes(label).compareTo(toLowerStripQuotes(other.label)); + } + + private static String toLowerStripQuotes(String data) { + if (data.length() < 2) { + return data; + } + char firstChar = data.charAt(0); + char lastChar = data.charAt(data.length() - 1); + if ((firstChar == '"' && lastChar == '"') || (firstChar == ''' && lastChar == ''')) { + return data.substring(1, data.length() - 1); + } + return data; }
public String toString() { diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java index eb57c47..e94f938 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java @@ -427,25 +427,12 @@ public class SearchAssistManager { String primarySimpleContext = completor.getPrimarySimpleContext(); debug("getSimpleSuggestions: suggesting value completions for a simple context [" + primarySimpleContext + "]");
- String pad = getQuotePadding(beforeCaret); - List<String> valueSuggestions = pad(pad, completor.getValues(primarySimpleContext, null, parsedTerm), pad); + List<String> valueSuggestions = padWithQuotes(beforeCaret, completor.getValues(primarySimpleContext, null, + parsedTerm)); List<SearchSuggestion> suggestions = convert(valueSuggestions, parsed, parsedTerm, Kind.Simple); return suggestions; }
- private String getQuotePadding(String parsedTerm) { - if (parsedTerm.equals("")) { - return """; - } - // if not empty, it has at least one char - char first = parsedTerm.charAt(0); - if (first == ''') { - return "'"; - } else /* if (first == '"') */{ - return """; - } - } - public List<SearchSuggestion> getAdvancedSuggestions(String expression, int caretPos, String tab) { SearchAssistant completor = getTabAwareSearchAssistant(tab);
@@ -527,7 +514,8 @@ public class SearchAssistManager { debug("getAdvancedSuggestions: operator state"); if (allComparisonOperators.contains(parsed.operator)) { debug("search term is complete operator, suggesting values instead"); - List<String> valueSuggestions = pad(pad, completor.getValues(parsed.context, parsed.param, ""), pad); + List<String> valueSuggestions = padWithQuotes(beforeCaret, completor.getValues(parsed.context, + parsed.param, "")); if (completor.getSimpleContexts().contains(parsed.context)) { debug("getAdvancedSuggestions: suggesting value completions for a simple context"); return convert(pad(parsed.context + parsed.operator, valueSuggestions, "")); @@ -554,8 +542,8 @@ public class SearchAssistManager { } case VALUE: debug("getAdvancedSuggestions: value state"); - List<String> valueSuggestions = pad(pad, completor.getValues(parsed.context, parsed.param, parsed.value), - pad); + List<String> valueSuggestions = padWithQuotes(beforeCaret, completor.getValues(parsed.context, + parsed.param, parsed.value)); if (completor.getSimpleContexts().contains(parsed.context)) { debug("getAdvancedSuggestions: suggesting value completions for a simple context"); return convert(pad(parsed.context + parsed.operator, valueSuggestions, ""), parsed, parsed.value); @@ -688,6 +676,57 @@ public class SearchAssistManager { return results; }
+ private List<String> padWithQuotes(String beforeCaret, List<String> data) { + String defaultPad = getQuotePadding(beforeCaret); + + List<String> results = new ArrayList<String>(); + for (String next : data) { + boolean hasWhiteSpace = next.matches(".*\s.*"); + if (hasWhiteSpace == false) { + // don't pad things that don't need padding + results.add(next); + continue; + } + + // we do have whitespace, let's also see if we have quotes + boolean hasSingleQuote = next.indexOf("'") != -1; + boolean hasDoubleQuote = next.indexOf('"') != -1; + + if (hasSingleQuote && hasDoubleQuote) { + // don't pad if suggestion has both single- and double-quotes + // instead, treat suggestion as individual terms, otherwise parser will bomb + results.add(next); + continue; + } + + String pad = null; + if (hasSingleQuote) { + pad = """; // pad with double-quotes + } else if (hasDoubleQuote) { + pad = "'"; // pad with single-quotes + } else { + // otherwise respect the user-chosen padding + pad = defaultPad; + } + + results.add(pad + next + pad); + } + return results; + } + + private String getQuotePadding(String beforeCaret) { + if (beforeCaret.equals("")) { + return """; + } + // if not empty, it has at least one char + char first = beforeCaret.charAt(0); + if (first == ''') { + return "'"; + } else /* if (first == '"') */{ + return """; + } + } + private void debug(String message) { LOG.debug(message); }
commit f3fa4486e9c1b359fd9cb8b73f824630bc1430ee Author: Joseph Marques joseph@redhat.com Date: Thu Jul 15 11:10:38 2010 -0400
BZ-610120: respect user-chosen quoting style
* if user starts with single-quote, offer suggestions wrapped with single-quotes * in all other cases, offer suggestions wrapped with double-quotes
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java index 2e84d69..eb57c47 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java @@ -427,11 +427,25 @@ public class SearchAssistManager { String primarySimpleContext = completor.getPrimarySimpleContext(); debug("getSimpleSuggestions: suggesting value completions for a simple context [" + primarySimpleContext + "]");
- List<String> valueSuggestions = pad(""", completor.getValues(primarySimpleContext, null, parsedTerm), """); + String pad = getQuotePadding(beforeCaret); + List<String> valueSuggestions = pad(pad, completor.getValues(primarySimpleContext, null, parsedTerm), pad); List<SearchSuggestion> suggestions = convert(valueSuggestions, parsed, parsedTerm, Kind.Simple); return suggestions; }
+ private String getQuotePadding(String parsedTerm) { + if (parsedTerm.equals("")) { + return """; + } + // if not empty, it has at least one char + char first = parsedTerm.charAt(0); + if (first == ''') { + return "'"; + } else /* if (first == '"') */{ + return """; + } + } + public List<SearchSuggestion> getAdvancedSuggestions(String expression, int caretPos, String tab) { SearchAssistant completor = getTabAwareSearchAssistant(tab);
@@ -448,6 +462,9 @@ public class SearchAssistManager { String beforeCaret = assistant.getFragmentBeforeCaret(); debug("getAdvancedSuggestions: beforeCaret is '" + beforeCaret + "'");
+ String pad = getQuotePadding(beforeCaret); + debug("getAdvancedSuggestions: padding is ~" + pad + "~"); + if (beforeCaret.startsWith("'") || beforeCaret.startsWith(""")) { return Collections.emptyList(); } @@ -510,7 +527,7 @@ public class SearchAssistManager { debug("getAdvancedSuggestions: operator state"); if (allComparisonOperators.contains(parsed.operator)) { debug("search term is complete operator, suggesting values instead"); - List<String> valueSuggestions = pad(""", completor.getValues(parsed.context, parsed.param, ""), """); + List<String> valueSuggestions = pad(pad, completor.getValues(parsed.context, parsed.param, ""), pad); if (completor.getSimpleContexts().contains(parsed.context)) { debug("getAdvancedSuggestions: suggesting value completions for a simple context"); return convert(pad(parsed.context + parsed.operator, valueSuggestions, "")); @@ -537,8 +554,8 @@ public class SearchAssistManager { } case VALUE: debug("getAdvancedSuggestions: value state"); - List<String> valueSuggestions = pad(""", completor.getValues(parsed.context, parsed.param, parsed.value), - """); + List<String> valueSuggestions = pad(pad, completor.getValues(parsed.context, parsed.param, parsed.value), + pad); if (completor.getSimpleContexts().contains(parsed.context)) { debug("getAdvancedSuggestions: suggesting value completions for a simple context"); return convert(pad(parsed.context + parsed.operator, valueSuggestions, ""), parsed, parsed.value);
commit 9e1900927a46832737a16ac0d3c2ad96e7e0b9d1 Merge: 26a8b39... 51b5d72... Author: Greg Hinkle ghinkle@redhat.com Date: Thu Jul 15 10:58:03 2010 -0400
Merge branch 'master' of ssh://git.fedorahosted.org/git/rhq/rhq
commit 26a8b39cc736d41e62292a86035864422d0593d2 Author: Greg Hinkle ghinkle@redhat.com Date: Thu Jul 15 10:55:00 2010 -0400
cleanup graph portlet
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/inventory/resource/graph/GraphPortlet.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/inventory/resource/graph/GraphPortlet.java index b540699..580100c 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/inventory/resource/graph/GraphPortlet.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/inventory/resource/graph/GraphPortlet.java @@ -51,8 +51,13 @@ public class GraphPortlet extends SmallGraphView implements CustomSettingsPortle
public static final String KEY = "Resource Graph";
- PortletWindow portletWindow; - DashboardPortlet storedPortlet; + + + private PortletWindow portletWindow; + private DashboardPortlet storedPortlet; + + public static final String CFG_RESOURCE_ID = "resourceId"; + public static final String CFG_DEFINITION_ID = "definitionId";
public GraphPortlet() { setOverflow(Overflow.HIDDEN); @@ -61,9 +66,9 @@ public class GraphPortlet extends SmallGraphView implements CustomSettingsPortle public void configure(PortletWindow portletWindow, DashboardPortlet storedPortlet) { this.portletWindow = portletWindow; this.storedPortlet = storedPortlet; - if (storedPortlet.getConfiguration().getSimple("resourceId") != null) { - setResourceId(storedPortlet.getConfiguration().getSimple("resourceId").getIntegerValue()); - setDefinitionId(storedPortlet.getConfiguration().getSimple("definitionId").getIntegerValue()); + if (storedPortlet.getConfiguration().getSimple(CFG_RESOURCE_ID) != null) { + setResourceId(storedPortlet.getConfiguration().getSimple(CFG_RESOURCE_ID).getIntegerValue()); + setDefinitionId(storedPortlet.getConfiguration().getSimple(CFG_DEFINITION_ID).getIntegerValue()); } }
@@ -73,8 +78,8 @@ public class GraphPortlet extends SmallGraphView implements CustomSettingsPortle
public ConfigurationDefinition getConfigurationDefinition() { ConfigurationDefinition def = new ConfigurationDefinition("Graph Config", "Configuration of the graph portlet"); - def.put(new PropertyDefinitionSimple("resourceId", "The resource to graph", true, PropertySimpleType.INTEGER)); - def.put(new PropertyDefinitionSimple("definitionId", "The metric definition id to graph", true, PropertySimpleType.INTEGER)); + def.put(new PropertyDefinitionSimple(CFG_RESOURCE_ID, "The resource to graph", true, PropertySimpleType.INTEGER)); + def.put(new PropertyDefinitionSimple(CFG_DEFINITION_ID, "The metric definition id to graph", true, PropertySimpleType.INTEGER));
return def; } @@ -84,7 +89,7 @@ public class GraphPortlet extends SmallGraphView implements CustomSettingsPortle @Override protected void onDraw() { removeMembers(getMembers()); - if (storedPortlet.getConfiguration().getSimple("resourceId") != null) { + if (storedPortlet.getConfiguration().getSimple(CFG_RESOURCE_ID) != null) { super.onDraw(); } else { addMember(new Label("This graph is unconfigured, click the settings button to configure.")); @@ -95,17 +100,17 @@ public class GraphPortlet extends SmallGraphView implements CustomSettingsPortle final DynamicForm form = new DynamicForm();
- final ResourceLookupComboBoxItem resourceLookupComboBoxItem = new ResourceLookupComboBoxItem("resourceId", "Resource"); + final ResourceLookupComboBoxItem resourceLookupComboBoxItem = new ResourceLookupComboBoxItem(CFG_RESOURCE_ID, "Resource"); resourceLookupComboBoxItem.setWidth(300);
- final SelectItem metric = new SelectItem("definitionId", "Metric") { + final SelectItem metric = new SelectItem(CFG_DEFINITION_ID, "Metric") { @Override protected Criteria getPickListFilterCriteria() { Criteria criteria = new Criteria();
if (resourceLookupComboBoxItem.getValue() != null) { int resourceId = (Integer) resourceLookupComboBoxItem.getValue(); - criteria.addCriteria("resourceId", resourceId); + criteria.addCriteria(CFG_RESOURCE_ID, resourceId); } return criteria; } @@ -121,24 +126,24 @@ public class GraphPortlet extends SmallGraphView implements CustomSettingsPortle public void onChanged(ChangedEvent event) {
- if (form.getValue("resourceId") instanceof Integer) { + if (form.getValue(CFG_RESOURCE_ID) instanceof Integer) { metric.fetchData(); form.clearValue("defininitionId"); } } });
- if (storedPortlet.getConfiguration().getSimple("resourceId") != null) { - form.setValue("resourceId", storedPortlet.getConfiguration().getSimple("resourceId").getIntegerValue()); - form.setValue("definitionId", storedPortlet.getConfiguration().getSimple("definitionId").getIntegerValue()); + if (storedPortlet.getConfiguration().getSimple(CFG_RESOURCE_ID) != null) { + form.setValue(CFG_RESOURCE_ID, storedPortlet.getConfiguration().getSimple(CFG_RESOURCE_ID).getIntegerValue()); + form.setValue(CFG_DEFINITION_ID, storedPortlet.getConfiguration().getSimple(CFG_DEFINITION_ID).getIntegerValue()); }
form.setFields(resourceLookupComboBoxItem, metric);
form.addSubmitValuesHandler(new SubmitValuesHandler() { public void onSubmitValues(SubmitValuesEvent submitValuesEvent) { - storedPortlet.getConfiguration().put(new PropertySimple("resourceId", form.getValue("resourceId"))); - storedPortlet.getConfiguration().put(new PropertySimple("definitionId", form.getValue("definitionId"))); + storedPortlet.getConfiguration().put(new PropertySimple(CFG_RESOURCE_ID, form.getValue(CFG_RESOURCE_ID))); + storedPortlet.getConfiguration().put(new PropertySimple(CFG_DEFINITION_ID, form.getValue(CFG_DEFINITION_ID)));
} });
commit aab10b92069e64ab69fa1d99cbc534e173f21375 Author: Greg Hinkle ghinkle@redhat.com Date: Thu Jul 15 10:54:38 2010 -0400
Fixed warning icon name
diff --git a/modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/event/WARNING_16.png b/modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/event/WARNING_16.png deleted file mode 100644 index f766722..0000000 Binary files a/modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/event/WARNING_16.png and /dev/null differ diff --git a/modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/event/WARN_16.png b/modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/event/WARN_16.png new file mode 100644 index 0000000..f766722 Binary files /dev/null and b/modules/enterprise/gui/coregui/src/main/webapp/images/subsystems/event/WARN_16.png differ
commit 4839d4b9f31fd34e1986bb59d2bd38e87c297a4d Author: Greg Hinkle ghinkle@redhat.com Date: Thu Jul 15 10:53:59 2010 -0400
display event severity icons
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/event/EventHistoryView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/event/EventHistoryView.java index 72ecded..492dc14 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/event/EventHistoryView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/event/EventHistoryView.java @@ -42,6 +42,8 @@ public class EventHistoryView extends Table {
}
+ + @Override protected void onDraw() { super.onDraw(); @@ -49,7 +51,7 @@ public class EventHistoryView extends Table { getListGrid().getField("severity").setWidth(120); getListGrid().getField("severity").setCellFormatter(new CellFormatter() { public String format(Object o, ListGridRecord listGridRecord, int i, int i1) { - return Canvas.imgHTML("subsystems/event/" + o, 16, 16) + o; + return Canvas.imgHTML("subsystems/event/" + o + "_16.png", 16, 16) + o; } });
commit 234417e5ba0170168d530e583c4973a603888bfc Author: Greg Hinkle ghinkle@redhat.com Date: Thu Jul 15 10:53:02 2010 -0400
fix overflow in favs portlet
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/inventory/resource/FavoriteResourcesPortlet.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/inventory/resource/FavoriteResourcesPortlet.java index 9c5f3fe..f92e7a2 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/inventory/resource/FavoriteResourcesPortlet.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/inventory/resource/FavoriteResourcesPortlet.java @@ -26,6 +26,7 @@ import java.util.Set;
import com.google.gwt.core.client.GWT; import com.smartgwt.client.data.Criteria; +import com.smartgwt.client.types.Overflow; import com.smartgwt.client.widgets.Canvas; import com.smartgwt.client.widgets.HTMLFlow; import com.smartgwt.client.widgets.grid.events.FieldStateChangedEvent; @@ -52,9 +53,13 @@ public class FavoriteResourcesPortlet extends ResourceSearchView implements Port private PortletWindow portletWindow;
public FavoriteResourcesPortlet() { + super(); + setOverflow(Overflow.HIDDEN); + setShowHeader(false); setShowFooter(false);
+ Set<Integer> favoriteIds = CoreGUI.getUserPreferences().getFavoriteResources();
Integer[] favArray = favoriteIds.toArray(new Integer[favoriteIds.size()]); @@ -62,9 +67,9 @@ public class FavoriteResourcesPortlet extends ResourceSearchView implements Port
Criteria criteria = new Criteria(); if (favoriteIds.isEmpty()) { - criteria.addCriteria("id",-1); + criteria.addCriteria("id", -1); } else { - criteria.addCriteria("resourceIds", favArray ); + criteria.addCriteria("resourceIds", favArray); }
refresh(criteria); @@ -73,7 +78,7 @@ public class FavoriteResourcesPortlet extends ResourceSearchView implements Port public void onFieldStateChanged(FieldStateChangedEvent fieldStateChangedEvent) { String state = getListGrid().getViewState();
- storedPortlet.getConfiguration().put(new PropertySimple(CFG_TABLE_PREFS,state)); + storedPortlet.getConfiguration().put(new PropertySimple(CFG_TABLE_PREFS, state)); portletWindow.save(); } });
commit 691766463fb125a9254cb6a6e81f837309e5c6aa Author: Greg Hinkle ghinkle@redhat.com Date: Thu Jul 15 10:52:42 2010 -0400
support icons in the breadcrumb trail
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/Breadcrumb.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/Breadcrumb.java index dd8443c..2bddbf2 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/Breadcrumb.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/Breadcrumb.java @@ -18,6 +18,8 @@ */ package org.rhq.enterprise.gui.coregui.client;
+import com.smartgwt.client.widgets.Canvas; + /** * Information about a breadcrumb (i.e. history token component) that is used to render that breadcrumb in the * breadcrumb trail at the top of the page. @@ -27,6 +29,7 @@ package org.rhq.enterprise.gui.coregui.client; public class Breadcrumb { private String name; private String displayName; + private String icon; private boolean hyperlink;
public Breadcrumb(String name) { @@ -34,18 +37,19 @@ public class Breadcrumb { }
public Breadcrumb(String name, String displayName) { - this(name, displayName, true); + this(name, displayName, null, true); }
public Breadcrumb(String name, boolean hyperlink) { - this(name, name, hyperlink); + this(name, name, null, hyperlink); }
- public Breadcrumb(String name, String displayName, boolean hyperlink) { + public Breadcrumb(String name, String displayName, String icon, boolean hyperlink) { if (name == null) { throw new IllegalArgumentException("Name is null."); } this.name = name; + this.icon = icon; setDisplayName(displayName); this.hyperlink = hyperlink; } @@ -89,6 +93,25 @@ public class Breadcrumb { return this.hyperlink; }
+ public String getIcon() { + return icon; + } + + public void setIcon(String icon) { + this.icon = icon; + } + + public String getDisplayHTML() { + String display = ""; + if (icon != null) { + display += Canvas.imgHTML(icon, 16, 16); + } + display += this.displayName; + + return display; + } + + @Override public String toString() { return this.name; diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/BreadcrumbTrailPane.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/BreadcrumbTrailPane.java index ad0c449..29377cd 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/BreadcrumbTrailPane.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/BreadcrumbTrailPane.java @@ -78,12 +78,7 @@ public class BreadcrumbTrailPane extends ToolStrip { firstBC = false; }
- if (!breadcrumb.isHyperlink()) { - // last item in trail is the current page and so should not be a link - addMember(getCrumb(breadcrumb.getDisplayName())); - } else { - addMember(getCrumb(breadcrumb.getDisplayName(), path.toString() + breadcrumb.getName())); - } + addMember(getCrumb(breadcrumb, path.toString())); } path.append(viewId.getPath()); } @@ -106,22 +101,23 @@ public class BreadcrumbTrailPane extends ToolStrip { redraw(); }
- private Label getCrumb(String text, String url) { - Label l = new Label("<a href="#" + url + "">" + text + "</a>"); + private Label getCrumb(Breadcrumb crumb, String path) { + Label l = null; + if (crumb.isHyperlink()) { + l = new Label("<a href="#" + path.toString() + crumb.getName() + "">" + crumb.getDisplayName() + "</a>"); + } else { + l = new Label(crumb.getDisplayName()); + } + if (crumb.getIcon() != null) { + l.setIcon(crumb.getIcon()); + l.setIconSize(16); + } l.setValign(VerticalAlignment.CENTER); l.setWrap(false); l.setAutoWidth(); return l; }
- private Label getCrumb(String text) { - Label l = new Label(text); - l.setValign(VerticalAlignment.CENTER); - l.setWrap(false); - l.setAutoFit(true); - return l; - } - private Img getSpacer() { return new Img("header/breadcrumb_space.png", 28, 28); } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTreeView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTreeView.java index ac109f8..5faf1c0 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTreeView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTreeView.java @@ -18,6 +18,10 @@ */ package org.rhq.enterprise.gui.coregui.client.inventory.resource.detail;
+import org.rhq.core.domain.configuration.PropertySimple; +import org.rhq.core.domain.dashboard.Dashboard; +import org.rhq.core.domain.dashboard.DashboardPortlet; +import org.rhq.core.domain.measurement.MeasurementDefinition; import org.rhq.core.domain.operation.OperationDefinition; import org.rhq.core.domain.resource.Resource; import org.rhq.core.domain.resource.ResourceType; @@ -26,6 +30,7 @@ import org.rhq.enterprise.gui.coregui.client.CoreGUI; import org.rhq.enterprise.gui.coregui.client.ViewId; import org.rhq.enterprise.gui.coregui.client.ViewPath; import org.rhq.enterprise.gui.coregui.client.components.configuration.ConfigurationEditor; +import org.rhq.enterprise.gui.coregui.client.dashboard.portlets.inventory.resource.graph.GraphPortlet; import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup; import org.rhq.enterprise.gui.coregui.client.gwt.ResourceGWTServiceAsync; import org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceSelectListener; @@ -68,7 +73,7 @@ public class ResourceTreeView extends VLayout { private Resource rootResource;
private TreeGrid treeGrid; - Menu contextMenu; + private Menu contextMenu;
private ViewId currentViewId;
@@ -78,7 +83,6 @@ public class ResourceTreeView extends VLayout {
public ResourceTreeView() { super(); - this.selectedResource = selectedResource;
setWidth("250"); setHeight100(); @@ -105,6 +109,7 @@ public class ResourceTreeView extends VLayout { treeGrid.setShowHeader(false);
treeGrid.setLeaveScrollbarGap(false); +
contextMenu = new Menu(); MenuItem item = new MenuItem("Expand node"); @@ -248,6 +253,11 @@ public class ResourceTreeView extends VLayout { contextMenu.addItem(operations);
+ + contextMenu.addItem(buildMetricsMenu(resourceType)); + + + // Create Menu MenuItem createChildMenu = new MenuItem("Create Child"); Menu createChildSubMenu = new Menu(); @@ -282,6 +292,65 @@ public class ResourceTreeView extends VLayout { contextMenu.addItem(importChildMenu); }
+ private MenuItem buildMetricsMenu(final ResourceType type) { + MenuItem measurements = new MenuItem("Measurements"); + final Menu measurementsSubMenu = new Menu(); + + + + + GWTServiceLookup.getDashboardService().findDashboardsForSubject(new AsyncCallback<List<Dashboard>>() { + public void onFailure(Throwable caught) { + CoreGUI.getErrorHandler().handleError("Failed to load user dashboards", caught); + } + + public void onSuccess(List<Dashboard> result) { + + for (final MeasurementDefinition def : type.getMetricDefinitions()) { + + MenuItem defItem = new MenuItem(def.getDisplayName()); + measurementsSubMenu.addItem(defItem); + Menu defSubItem = new Menu(); + defItem.setSubmenu(defSubItem); + + + + for (final Dashboard d : result) { + MenuItem addToDBItem = new MenuItem("Add chart to Dashboard: " + d.getName()); + defSubItem.addItem(addToDBItem); + + addToDBItem.addClickHandler(new ClickHandler() { + public void onClick(MenuItemClickEvent menuItemClickEvent) { + + DashboardPortlet p = new DashboardPortlet(def.getDisplayName() + " Chart", GraphPortlet.KEY, 250); + p.getConfiguration().put(new PropertySimple(GraphPortlet.CFG_RESOURCE_ID, selectedResource.getId())); + p.getConfiguration().put(new PropertySimple(GraphPortlet.CFG_DEFINITION_ID, def.getId())); + + d.addPortlet(p, 0, 0); + + GWTServiceLookup.getDashboardService().storeDashboard(d, new AsyncCallback<Dashboard>() { + public void onFailure(Throwable caught) { + CoreGUI.getErrorHandler().handleError("Failed to save dashboard to server", caught); + } + + public void onSuccess(Dashboard result) { + CoreGUI.getMessageCenter().notify(new Message("Saved dashboard " + result.getName() + " to server", Message.Severity.Info)); + } + }); + + } + }); + + } + + + } + + } + }); + measurements.setSubmenu(measurementsSubMenu); + return measurements; + }
Resource getResource(int resourceId) { if (this.treeGrid != null && this.treeGrid.getTree() != null) { @@ -317,12 +386,10 @@ public class ResourceTreeView extends VLayout { viewId.getBreadcrumbs().clear(); for (int i = parents.length - 1; i >= 0; i--) { TreeNode n = parents[i]; - if (n instanceof ResourceTreeDatasource.ResourceTreeNode) { - viewId.getBreadcrumbs().add(new Breadcrumb(n.getAttribute("id"), - n.getName() + " (" + ((ResourceTreeDatasource.ResourceTreeNode)n).getResourceType().getName() + ")", true)); - } + adjustBreadcrumb(n, viewId); } - viewId.getBreadcrumbs().add(new Breadcrumb(node.getAttribute("id"), node.getName(), true)); + adjustBreadcrumb(node, viewId); + CoreGUI.refreshBreadCrumbTrail();
@@ -373,12 +440,9 @@ public class ResourceTreeView extends VLayout { viewId.getBreadcrumbs().clear(); for (int i = parents.length - 1; i >= 0; i--) { TreeNode n = parents[i]; - if (n instanceof ResourceTreeDatasource.ResourceTreeNode) { - viewId.getBreadcrumbs().add(new Breadcrumb(n.getAttribute("id"), - n.getName() + " (" + ((ResourceTreeDatasource.ResourceTreeNode)n).getResourceType().getName() + ")", true)); - } + adjustBreadcrumb(n, viewId); } - viewId.getBreadcrumbs().add(new Breadcrumb(selectedNode.getAttribute("id"), selectedNode.getName(), true)); + adjustBreadcrumb(selectedNode, viewId); CoreGUI.refreshBreadCrumbTrail(); } } @@ -435,12 +499,9 @@ public class ResourceTreeView extends VLayout { viewId.getBreadcrumbs().clear(); for (int i = parents.length - 1; i >= 0; i--) { TreeNode n = parents[i]; - if (n instanceof ResourceTreeDatasource.ResourceTreeNode) { - viewId.getBreadcrumbs().add(new Breadcrumb(n.getAttribute("id"), - n.getName() + " (" + ((ResourceTreeDatasource.ResourceTreeNode)n).getResourceType().getName() + ")", true)); - } + adjustBreadcrumb(n, viewId); } - viewId.getBreadcrumbs().add(new Breadcrumb(selectedNode.getAttribute("id"), selectedNode.getName(), true)); + adjustBreadcrumb(selectedNode, viewId); CoreGUI.refreshBreadCrumbTrail();
} else { @@ -469,30 +530,50 @@ public class ResourceTreeView extends VLayout { }
+ private void adjustBreadcrumb(TreeNode node, ViewId viewId) { + if (node instanceof ResourceTreeDatasource.ResourceTreeNode) { + + Resource nr = ((ResourceTreeDatasource.ResourceTreeNode) node).getResource(); + String display = node.getName() + " <span class="subtitle">" + nr.getResourceType().getName() + "</span>"; + String icon = "types/" + nr.getResourceType().getCategory().getDisplayName() + "_up_16.png"; + + + viewId.getBreadcrumbs().add(new Breadcrumb(node.getAttribute("id"), + display, icon, true)); + + } else { + +// if (node.getName() != null) { +// viewId.getBreadcrumbs().add(new Breadcrumb(node.getAttribute("id"), node.getName(), null, true)); +// } + } + } + + /*private List<Resource> preload(final List<Resource> lineage) {
- final ArrayList<Resource> list = new ArrayList<Resource>(lineage); + final ArrayList<Resource> list = new ArrayList<Resource>(lineage);
- ResourceGWTServiceAsync resourceService = ResourceGWTServiceAsync.Util.getInstance(); + ResourceGWTServiceAsync resourceService = ResourceGWTServiceAsync.Util.getInstance();
- ResourceCriteria c = new ResourceCriteria(); - c.addFilterParentResourceId(lineage.get(0).getId()); - resourceService.findResourcesByCriteria(CoreGUI.getSessionSubject(), c, new AsyncCallback<PageList<Resource>>() { - public void onFailure(Throwable caught) { - SC.say("SHit"); - } + ResourceCriteria c = new ResourceCriteria(); + c.addFilterParentResourceId(lineage.get(0).getId()); + resourceService.findResourcesByCriteria(CoreGUI.getSessionSubject(), c, new AsyncCallback<PageList<Resource>>() { + public void onFailure(Throwable caught) { + SC.say("SHit"); + }
- public void onSuccess(PageList<Resource> result) { - SC.say("GotONE"); + public void onSuccess(PageList<Resource> result) { + SC.say("GotONE");
- if (lineage.size() > 1) { - result.addAll(preload(lineage.subList(1, lineage.size()))); + if (lineage.size() > 1) { + result.addAll(preload(lineage.subList(1, lineage.size()))); + } } - } - }); + }); + } } - } -*/ + */
public void addResourceSelectListener(ResourceSelectListener listener) { this.selectListeners.add(listener);
commit 204b30160fa0e13c61380d2285295e7282eda7be Author: Greg Hinkle ghinkle@redhat.com Date: Thu Jul 15 10:51:44 2010 -0400
Properly order graphs
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/GraphListView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/GraphListView.java index 4076921..d77e08b 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/GraphListView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/GraphListView.java @@ -38,6 +38,8 @@ import com.smartgwt.client.widgets.Label; import com.smartgwt.client.widgets.layout.VLayout;
import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; import java.util.EnumSet; import java.util.List;
@@ -95,6 +97,12 @@ public class GraphListView extends VLayout implements ResourceSelectListener { } }
+ Collections.sort(measurementDefinitions, new Comparator<MeasurementDefinition>() { + public int compare(MeasurementDefinition o1, MeasurementDefinition o2) { + return new Integer(o1.getDisplayOrder()).compareTo(o2.getDisplayOrder()); + } + }); + int[] measDefIdArray = new int[measurementDefinitions.size()]; for (int i = 0; i < measDefIdArray.length; i++) { measDefIdArray[i] = measurementDefinitions.get(i).getId();
commit ea1cb09f9d8b195b3f4a0e990e366c56fa298331 Author: Greg Hinkle ghinkle@redhat.com Date: Thu Jul 15 10:51:21 2010 -0400
Progress on alert editing
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/AlertDefinitionsView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/AlertDefinitionsView.java index d3ae574..0e35a55 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/AlertDefinitionsView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/AlertDefinitionsView.java @@ -53,7 +53,7 @@ public class AlertDefinitionsView extends VLayout {
table.addTableAction("New", new TableAction() { public void executeAction(ListGridRecord[] selection) { - new AlertEditView().displayAsDialog(); + new AlertEditView(resource).displayAsDialog(); } });
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/alert/AlertEditView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/alert/AlertEditView.java index 2f38c18..f9ed1b2 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/alert/AlertEditView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/alert/AlertEditView.java @@ -19,6 +19,7 @@ package org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.alert;
import java.util.ArrayList; +import java.util.EnumSet; import java.util.LinkedHashMap;
import com.smartgwt.client.widgets.Canvas; @@ -34,22 +35,35 @@ import com.smartgwt.client.widgets.form.fields.HeaderItem; import com.smartgwt.client.widgets.form.fields.RadioGroupItem; import com.smartgwt.client.widgets.form.fields.SelectItem; import com.smartgwt.client.widgets.form.fields.SpacerItem; +import com.smartgwt.client.widgets.form.fields.StaticTextItem; import com.smartgwt.client.widgets.form.fields.TextAreaItem; import com.smartgwt.client.widgets.form.fields.TextItem; +import com.smartgwt.client.widgets.form.fields.events.ChangedEvent; +import com.smartgwt.client.widgets.form.fields.events.ChangedHandler; import com.smartgwt.client.widgets.form.fields.events.ClickEvent; import com.smartgwt.client.widgets.form.fields.events.ClickHandler; import com.smartgwt.client.widgets.layout.VLayout;
import org.rhq.core.domain.alert.AlertConditionCategory; import org.rhq.core.domain.alert.AlertPriority; +import org.rhq.core.domain.measurement.DataType; +import org.rhq.core.domain.measurement.MeasurementDefinition; +import org.rhq.core.domain.operation.OperationDefinition; +import org.rhq.core.domain.resource.Resource; +import org.rhq.core.domain.resource.ResourceType; import org.rhq.enterprise.gui.coregui.client.components.form.RadioGroupWithComponentsItem; +import org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTypeRepository;
/** * @author Greg Hinkle */ public class AlertEditView extends VLayout {
- public AlertEditView() { + private Resource resource; + private ResourceType resourceType; + + public AlertEditView(Resource resource) { + this.resource = resource; setWidth100(); }
@@ -72,10 +86,16 @@ public class AlertEditView extends VLayout { protected void onDraw() { super.onDraw();
- addMember(buildEditForm()); - - addMember(buildConditionSection(0)); + ResourceTypeRepository.Cache.getInstance().getResourceTypes(resource.getResourceType().getId(), + EnumSet.of(ResourceTypeRepository.MetadataType.measurements, ResourceTypeRepository.MetadataType.operations), + new ResourceTypeRepository.TypeLoadedCallback() { + public void onTypesLoaded(ResourceType type) { + resourceType = type; + addMember(buildEditForm());
+ addMember(buildConditionSection(0)); + } + }); }
@@ -160,11 +180,10 @@ public class AlertEditView extends VLayout { form.setValuesManager(vm);
form.setNumCols(3); - form.setColWidths("30","120","*"); + form.setColWidths("30", "120", "*"); ArrayList<FormItem> items = new ArrayList<FormItem>();
- RadioGroupItem conditionType = new RadioGroupItem("conditionType" + ci, "Condition Type"); conditionType.setImageURLPrefix("subsystems/"); conditionType.setImageURLSuffix("_16.png"); @@ -177,6 +196,7 @@ public class AlertEditView extends VLayout { valueMap.put(AlertConditionCategory.CONTROL.name(), AlertConditionCategory.CONTROL.getDisplayName()); valueMap.put(AlertConditionCategory.EVENT.name(), AlertConditionCategory.EVENT.getDisplayName()); conditionType.setValueMap(valueMap); + conditionType.setRedrawOnChange(true);
LinkedHashMap<String, String> iconMap = new LinkedHashMap<String, String>(); @@ -217,6 +237,14 @@ public class AlertEditView extends VLayout {
}*/
+ CanvasItem availCanvas = buildAvailabilitySectionCanvas(vm); + availCanvas.setShowIfCondition(new FormItemIfFunction() { + public boolean execute(FormItem formItem, Object o, DynamicForm dynamicForm) { + return AlertConditionCategory.AVAILABILITY.name().equals(form.getValue("conditionType" + ci)); + } + }); + items.add(availCanvas); + CanvasItem metricCanvas = buildMetricSectionCavans(vm); metricCanvas.setShowIfCondition(new FormItemIfFunction() { public boolean execute(FormItem formItem, Object o, DynamicForm dynamicForm) { @@ -229,29 +257,126 @@ public class AlertEditView extends VLayout { CanvasItem propertyCanvas = buildInventoryPropertySectionCavans(vm); propertyCanvas.setShowIfCondition(new FormItemIfFunction() { public boolean execute(FormItem formItem, Object o, DynamicForm dynamicForm) { - return AlertConditionCategory.AVAILABILITY.name().equals(form.getValue("conditionType" + ci)); + return AlertConditionCategory.TRAIT.name().equals(form.getValue("conditionType" + ci)); } }); items.add(propertyCanvas);
+ CanvasItem operationCanvas = buildOperationsSectionCanvas(vm); + operationCanvas.setShowIfCondition(new FormItemIfFunction() { + public boolean execute(FormItem formItem, Object o, DynamicForm dynamicForm) { + return AlertConditionCategory.CONTROL.name().equals(form.getValue("conditionType" + ci)); + } + }); + items.add(operationCanvas); + + form.setItems(items.toArray(new FormItem[items.size()])); return form; }
+ private CanvasItem buildAvailabilitySectionCanvas(ValuesManager vm) { + DynamicForm form = new DynamicForm(); + form.setTitleSuffix(""); + form.setColWidths("10%"); + form.setValuesManager(vm); + + + SelectItem metricSelect = new SelectItem("availChange", "Avaialability Change"); + metricSelect.setRequired(true); + metricSelect.setEmptyDisplayValue("Select..."); + metricSelect.setValueMap("Goes UP", "Goes DOWN"); + + + form.setItems(metricSelect); + + + CanvasItem canvasItem = new CanvasItem("metricConditionCanvas"); + canvasItem.setShowTitle(false); + canvasItem.setCanvas(form); + + return canvasItem; + + } + + private CanvasItem buildOperationsSectionCanvas(ValuesManager vm) { + final DynamicForm form = new DynamicForm(); + form.setTitleSuffix(""); + form.setColWidths("10%"); + form.setValuesManager(vm); + + + final SelectItem operationSelect = new SelectItem("operation", "Operation"); + operationSelect.setRequired(true); + operationSelect.setEmptyDisplayValue("Select..."); + operationSelect.setShowHint(true); + + + LinkedHashMap<String, String> operations = new LinkedHashMap<String, String>(); + for (OperationDefinition def : resourceType.getOperationDefinitions()) { + operations.put(def.getName(), def.getDisplayName()); + } + operationSelect.setValueMap(operations); + operationSelect.setRedrawOnChange(true); + + operationSelect.addChangedHandler(new ChangedHandler() { + public void onChanged(ChangedEvent changedEvent) { + for (OperationDefinition def : resourceType.getOperationDefinitions()) { + + if (def.getName().equals(operationSelect.getValue())) { + operationSelect.setHint(def.getDescription()); + } + } + } + }); + + + form.setItems(operationSelect); + + CanvasItem canvasItem = new CanvasItem("operationConditionCanvas"); + canvasItem.setShowTitle(false); + canvasItem.setCanvas(form); + + return canvasItem; + + }
private CanvasItem buildMetricSectionCavans(ValuesManager vm) {
DynamicForm form = new DynamicForm(); form.setTitleSuffix(""); - form.setColWidths("10%"); + form.setColWidths("10%", "90%"); form.setValuesManager(vm);
- SelectItem metricSelect = new SelectItem("metric", "Metric"); + final SelectItem metricSelect = new SelectItem("metric", "Metric"); metricSelect.setRequired(true); metricSelect.setEmptyDisplayValue("Select..."); - metricSelect.setValueMap("CPU Usage", "Free Memory", "Swap Used", "User CPU", "System CPU"); + metricSelect.setWidth(200); + + LinkedHashMap<String, String> metrics = new LinkedHashMap<String, String>(); + for (MeasurementDefinition def : resourceType.getMetricDefinitions()) { + if (def.getDataType() == DataType.MEASUREMENT) { + metrics.put(def.getName(), def.getDisplayName()); + } + } + metricSelect.setValueMap(metrics); + + + metricSelect.addChangedHandler(new ChangedHandler() { + public void onChanged(ChangedEvent changedEvent) { + for (MeasurementDefinition def : resourceType.getMetricDefinitions()) { + + if (def.getName().equals(metricSelect.getValue())) { + metricSelect.setHint(def.getDescription()); + } + } + } + }); + + +
LinkedHashMap valueMap = new LinkedHashMap();
commit d0f40464fe9ca82f2f77b593db4ee29d37bad915 Author: Greg Hinkle ghinkle@redhat.com Date: Thu Jul 15 10:50:44 2010 -0400
protect against passed in string ints
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceDatasource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceDatasource.java index b2903cc..5f22a2f 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceDatasource.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceDatasource.java @@ -98,7 +98,7 @@ public class ResourceDatasource extends RPCDataSource<Resource> { }
if (request.getCriteria().getValues().get("id") != null) { - criteria.addFilterId(request.getCriteria().getAttributeAsInt("id")); + criteria.addFilterId(Integer.parseInt(request.getCriteria().getAttribute("id"))); }
if (request.getCriteria().getValues().get("resourceIds") != null) {
commit ac57897a7dfd4619324037626b9afce85ca0436a Author: Greg Hinkle ghinkle@redhat.com Date: Thu Jul 15 10:50:11 2010 -0400
use ibuttons for consistent l&f
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/configuration/ConfigurationEditor.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/configuration/ConfigurationEditor.java index 74d9bf7..8f143ae 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/configuration/ConfigurationEditor.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/configuration/ConfigurationEditor.java @@ -95,6 +95,7 @@ import com.smartgwt.client.widgets.layout.LayoutSpacer; import com.smartgwt.client.widgets.layout.SectionStack; import com.smartgwt.client.widgets.layout.SectionStackSection; import com.smartgwt.client.widgets.layout.VLayout; +import com.smartgwt.client.widgets.menu.IMenuButton; import com.smartgwt.client.widgets.menu.Menu; import com.smartgwt.client.widgets.menu.MenuButton; import com.smartgwt.client.widgets.menu.MenuItem; @@ -426,7 +427,7 @@ public class ConfigurationEditor extends VLayout {
// toolStrip.addMember(resetButton); toolStrip.addMember(new LayoutSpacer()); - toolStrip.addMember(new MenuButton("Jump to Section", menu)); + toolStrip.addMember(new IMenuButton("Jump to Section", menu));
layout.addMember(toolStrip);
commit 0065515c79d542cd69b6e2b8f5df83bb7e1032ce Author: Greg Hinkle ghinkle@redhat.com Date: Thu Jul 15 10:48:46 2010 -0400
fixes for custom query plugin db components
diff --git a/modules/plugins/database/src/main/java/org/rhq/plugins/database/CustomTableComponent.java b/modules/plugins/database/src/main/java/org/rhq/plugins/database/CustomTableComponent.java index 2c6472e..0c7a5a5 100644 --- a/modules/plugins/database/src/main/java/org/rhq/plugins/database/CustomTableComponent.java +++ b/modules/plugins/database/src/main/java/org/rhq/plugins/database/CustomTableComponent.java @@ -68,7 +68,9 @@ public class CustomTableComponent implements DatabaseComponent<DatabaseComponent public void getValues(MeasurementReport report, Set<MeasurementScheduleRequest> metrics) throws Exception { String query = this.context.getPluginConfiguration().getSimpleValue("metricQuery", null);
- Map<String, Double> values = DatabaseQueryUtility.getNumericQueryValueMap(this, query); + query = CustomTableRowDiscoveryComponent.formatMessage(query, this.context.getPluginConfiguration().getSimpleValue("key",null)); + + Map<String, Double> values = DatabaseQueryUtility.getNumericQueryValues(this, query); for (MeasurementScheduleRequest request : metrics) { Double value = values.get(request.getName()); if (value != null) { diff --git a/modules/plugins/database/src/main/java/org/rhq/plugins/database/CustomTableDiscoveryComponent.java b/modules/plugins/database/src/main/java/org/rhq/plugins/database/CustomTableDiscoveryComponent.java index 875846c..633c28c 100644 --- a/modules/plugins/database/src/main/java/org/rhq/plugins/database/CustomTableDiscoveryComponent.java +++ b/modules/plugins/database/src/main/java/org/rhq/plugins/database/CustomTableDiscoveryComponent.java @@ -23,9 +23,11 @@ import java.sql.SQLException; import java.sql.Statement; import java.util.Collections; import java.util.Set; + import org.rhq.core.domain.configuration.Configuration; import org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails; import org.rhq.core.pluginapi.inventory.InvalidPluginConfigurationException; +import org.rhq.core.pluginapi.inventory.ManualAddFacet; import org.rhq.core.pluginapi.inventory.ResourceDiscoveryComponent; import org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext; import org.rhq.core.util.jdbc.JDBCUtil; @@ -37,10 +39,10 @@ import org.rhq.core.util.jdbc.JDBCUtil; * * @author Greg Hinkle */ -public class CustomTableDiscoveryComponent implements ResourceDiscoveryComponent<DatabaseComponent> { +public class CustomTableDiscoveryComponent implements ManualAddFacet<DatabaseComponent>, ResourceDiscoveryComponent<DatabaseComponent> { public Set<DiscoveredResourceDetails> discoverResources( - ResourceDiscoveryContext<DatabaseComponent> resourceDiscoveryContext) - throws InvalidPluginConfigurationException, Exception { + ResourceDiscoveryContext<DatabaseComponent> resourceDiscoveryContext) + throws InvalidPluginConfigurationException, Exception { Statement statement = null; try { Connection conn = resourceDiscoveryContext.getParentResourceComponent().getConnection(); @@ -54,7 +56,7 @@ public class CustomTableDiscoveryComponent implements ResourceDiscoveryComponent statement.executeQuery("SELECT COUNT(*) FROM " + table);
DiscoveredResourceDetails details = new DiscoveredResourceDetails(resourceDiscoveryContext - .getResourceType(), table, resourceName, null, resourceDescription, config, null); + .getResourceType(), table, resourceName, null, resourceDescription, config, null);
return Collections.singleton(details); } catch (SQLException e) { @@ -63,6 +65,35 @@ public class CustomTableDiscoveryComponent implements ResourceDiscoveryComponent JDBCUtil.safeClose(statement); }
+ + if (!resourceDiscoveryContext.getPluginConfigurations().isEmpty()) { + return Collections.singleton(discoverResource(resourceDiscoveryContext.getPluginConfigurations().get(0),resourceDiscoveryContext)); + } + + + return Collections.emptySet(); } + + public DiscoveredResourceDetails discoverResource(Configuration pluginConfiguration, ResourceDiscoveryContext<DatabaseComponent> discoveryContext) + throws InvalidPluginConfigurationException { + + Configuration config = pluginConfiguration; + + String table = config.getSimpleValue("table", null); + String resourceName = config.getSimpleValue("name", null); + String resourceDescription = config.getSimpleValue("description", null); + + DiscoveredResourceDetails details = + new DiscoveredResourceDetails( + discoveryContext.getResourceType(), + table + resourceName, + resourceName, + null, + resourceDescription, + config, + null); + + return details; + } } \ No newline at end of file diff --git a/modules/plugins/database/src/main/java/org/rhq/plugins/database/CustomTableRowDiscoveryComponent.java b/modules/plugins/database/src/main/java/org/rhq/plugins/database/CustomTableRowDiscoveryComponent.java index 71c003a..aaf2e67 100644 --- a/modules/plugins/database/src/main/java/org/rhq/plugins/database/CustomTableRowDiscoveryComponent.java +++ b/modules/plugins/database/src/main/java/org/rhq/plugins/database/CustomTableRowDiscoveryComponent.java @@ -62,9 +62,14 @@ public class CustomTableRowDiscoveryComponent implements ResourceDiscoveryCompon while (resultSet.next()) { config = resourceDiscoveryContext.getDefaultPluginConfiguration(); String key = resultSet.getString(keyColumn); - config.put(new PropertySimple("Key", key)); - DiscoveredResourceDetails details = new DiscoveredResourceDetails(resourceDiscoveryContext - .getResourceType(), key, formatMessage(resourceName, key), null, formatMessage(resourceDescription, + config.put(new PropertySimple("key", key)); + DiscoveredResourceDetails details = + new DiscoveredResourceDetails( + resourceDiscoveryContext.getResourceType(), + key, + formatMessage(resourceName, key), + null, + formatMessage(resourceDescription, key), config, null); found.add(details); } diff --git a/modules/plugins/postgres/src/main/resources/META-INF/rhq-plugin.xml b/modules/plugins/postgres/src/main/resources/META-INF/rhq-plugin.xml index d032e9f..450dcfe 100644 --- a/modules/plugins/postgres/src/main/resources/META-INF/rhq-plugin.xml +++ b/modules/plugins/postgres/src/main/resources/META-INF/rhq-plugin.xml @@ -538,6 +538,23 @@
</service>
+ + <service name="Query" + class="org.rhq.plugins.database.CustomTableComponent" + discovery="org.rhq.plugins.database.CustomTableDiscoveryComponent" + supportsManualAdd="true"> + + <plugin-configuration> + <c:simple-property name="table" description="The table to discover"/> + <c:simple-property name="name"/> + <c:simple-property name="description"/> + <c:simple-property name="metricQuery" description="The query that will gather metric data"/> + </plugin-configuration> + + <metric property="metricColumn" displayType="summary"/> + + </service> + </service>
<service name="User" discovery="PostgresUserDiscoveryComponent" class="PostgresUserComponent" @@ -569,6 +586,11 @@ </resource-configuration>
</service> + + + + + </server>
</plugin> \ No newline at end of file
commit bcd005aee3303e3cf230eb8e9a0595829f283b54 Author: Joseph Marques joseph@redhat.com Date: Thu Jul 15 10:48:42 2010 -0400
BZ-614529: support search expressions containing ':'
diff --git a/modules/enterprise/server/jar/src/main/antlr3/org/rhq/enterprise/server/search/RHQL.g b/modules/enterprise/server/jar/src/main/antlr3/org/rhq/enterprise/server/search/RHQL.g index 899b07e..0c0f1d5 100644 --- a/modules/enterprise/server/jar/src/main/antlr3/org/rhq/enterprise/server/search/RHQL.g +++ b/modules/enterprise/server/jar/src/main/antlr3/org/rhq/enterprise/server/search/RHQL.g @@ -171,7 +171,7 @@ LEVEL ;
SYMBOL - : '!' | '@' | '#' | '$' | '%' | '^' | '&' | '*' | '-' | '_' | '+' | '|' | '?' | '/' | ',' | '<' | '>' | '`' | '~' + : '!' | '@' | '#' | '$' | '%' | '^' | '&' | '*' | '-' | '_' | '+' | '|' | '?' | '/' | ',' | '<' | '>' | '`' | '~' | ':' ;
WS
commit cb3347e6582719b3629ab7caba22f420148d3deb Author: Joseph Marques joseph@redhat.com Date: Wed Jul 14 23:28:31 2010 -0400
BZ-614693: ignore search terms that attempt to filter using hidden/password properties
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/ResourceSearchTranslator.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/ResourceSearchTranslator.java index 579184b..3fd7b12 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/ResourceSearchTranslator.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/ResourceSearchTranslator.java @@ -65,20 +65,26 @@ public class ResourceSearchTranslator extends AbstractSearchTranslator { } else if (path.equals("connection")) { return new SearchFragment( // SearchFragmentType.PRIMARY_KEY_SUBQUERY, "SELECT res.id" // - + " FROM Resource res " // + + " FROM Resource res, PropertySimple simple, PropertyDefinitionSimple simpleDefinition " // + " JOIN res.resourceType.pluginConfigurationDefinition.propertyDefinitions definition " // + " JOIN res.pluginConfiguration.properties property " // - + " WHERE definition.name = " + quote(param) // - + " AND " + getJPQLForString("property.value", op, filter)); + + " WHERE simpleDefinition = definition " // only provide translations for simple properties + + " AND simpleDefinition.type <> 'PASSWORD' " // do not allow searching by hidden/password fields + + " AND property = simple " // join to simple for filter by 'stringValue' attribute + + " AND definition.name = " + quote(param) // + + " AND " + getJPQLForString("simple.stringValue", op, filter));
} else if (path.equals("configuration")) { return new SearchFragment( // SearchFragmentType.PRIMARY_KEY_SUBQUERY, "SELECT res.id" // - + " FROM Resource res " // + + " FROM Resource res, PropertySimple simple, PropertyDefinitionSimple simpleDefinition " // + " JOIN res.resourceType.resourceConfigurationDefinition.propertyDefinitions definition " // + " JOIN res.resourceConfiguration.properties property " // - + " WHERE definition.name = " + quote(param) // - + " AND " + getJPQLForString("property.value", op, filter)); + + " WHERE simpleDefinition = definition " // only provide translations for simple properties + + " AND simpleDefinition.type <> 'PASSWORD' " // do not allow searching by hidden/password fields + + " AND property = simple " // join to simple for filter by 'stringValue' attribute + + " AND definition.name = " + quote(param) // + + " AND " + getJPQLForString("simple.stringValue", op, filter));
} else { if (param == null) {
commit ad27f8122efd073586019eedd12bf91eb54a8f73 Author: Joseph Marques joseph@redhat.com Date: Wed Jul 14 23:27:39 2010 -0400
BZ-614693: suppress search suggestions for hidden/password parameters/values
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/AbstractSearchAssistant.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/AbstractSearchAssistant.java index 61faf42..87e10a5 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/AbstractSearchAssistant.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/AbstractSearchAssistant.java @@ -12,6 +12,7 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory;
import org.rhq.enterprise.server.util.LookupUtil; +import org.rhq.enterprise.server.util.QueryUtility;
public abstract class AbstractSearchAssistant implements SearchAssistant {
@@ -144,6 +145,10 @@ public abstract class AbstractSearchAssistant implements SearchAssistant { return "'" + data + "'"; }
+ protected final String escape(String data) { + return QueryUtility.escapeSearchParameter(data); + } + protected final String getFormatterValueFragment(String data) { boolean hasWhitespace = false; for (char next : data.toCharArray()) { diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/GroupSearchAssistant.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/GroupSearchAssistant.java index a428edc..cee5ff2 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/GroupSearchAssistant.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/GroupSearchAssistant.java @@ -7,7 +7,6 @@ import java.util.List; import org.rhq.core.domain.measurement.AvailabilityType; import org.rhq.core.domain.resource.ResourceCategory; import org.rhq.core.domain.search.SearchSubsystem; -import org.rhq.enterprise.server.util.QueryUtility;
public class GroupSearchAssistant extends TabAwareSearchAssistant {
@@ -64,8 +63,7 @@ public class GroupSearchAssistant extends TabAwareSearchAssistant { + " WHERE rg.resourceType = type " // only suggest names that exist for visible groups in inventory + " AND rg.visible = true " // + add(" AND LOWER(rg.groupCategory) = '" + tab + "'", tab) // - + add(" AND LOWER(type.name) LIKE '%" + QueryUtility.escapeSearchParameter(filter.toLowerCase()) - + "%'", filter) // + + add(" AND LOWER(type.name) LIKE '%" + escape(filter.toLowerCase()) + "%'", filter) // + " ORDER BY type.name ");
} else if (context.equals("plugin")) { @@ -75,8 +73,7 @@ public class GroupSearchAssistant extends TabAwareSearchAssistant { + " WHERE rg.resourceType = type " // only suggest names that exist for visible groups in inventory + " AND rg.visible = true " // + add(" AND LOWER(rg.groupCategory) = '" + tab + "'", tab) // - + add(" AND LOWER(type.plugin) LIKE '%" + QueryUtility.escapeSearchParameter(filter.toLowerCase()) - + "%'", filter) // + + add(" AND LOWER(type.plugin) LIKE '%" + escape(filter.toLowerCase()) + "%'", filter) // + " ORDER BY type.plugin ");
} else if (context.equals("name")) { @@ -85,9 +82,7 @@ public class GroupSearchAssistant extends TabAwareSearchAssistant { + " FROM ResourceGroup rg " // + " WHERE rg.visible = true " // only suggest names that exist for visible groups in inventory + add(" AND LOWER(rg.groupCategory) = '" + tab + "'", tab) // - + add( - " AND LOWER(rg.name) LIKE '%" + QueryUtility.escapeSearchParameter(filter.toLowerCase()) + "%'", - filter) // + + add(" AND LOWER(rg.name) LIKE '%" + escape(filter.toLowerCase()) + "%'", filter) // + " ORDER BY rg.name ");
} else { diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/ResourceSearchAssistant.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/ResourceSearchAssistant.java index 124c07b..9900ecb 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/ResourceSearchAssistant.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/ResourceSearchAssistant.java @@ -9,7 +9,6 @@ import org.rhq.core.domain.measurement.AvailabilityType; import org.rhq.core.domain.resource.ResourceCategory; import org.rhq.core.domain.search.SearchSubsystem; import org.rhq.core.domain.search.assist.AlertSearchAssistParam; -import org.rhq.enterprise.server.util.QueryUtility;
public class ResourceSearchAssistant extends TabAwareSearchAssistant {
@@ -63,23 +62,25 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant { } else if (context.equals("connection")) { return execute("" // + "SELECT DISTINCT definition.name " // - + " FROM ResourceType type, Resource res " //" + + " FROM ResourceType type, Resource res, PropertyDefinitionSimple simpleDefinition " //" + " JOIN type.pluginConfigurationDefinition.propertyDefinitions definition " // + " WHERE res.resourceType = type " // only suggest names that exist for resources in inventory + + " AND simpleDefinition = definition " // only suggest names for simple properties + + " AND simpleDefinition.type <> 'PASSWORD' " // do not suggest hidden/password property types + add(" AND LOWER(type.category) = '" + tab + "'", tab) // - + add(" AND LOWER(definition.name) LIKE '%" - + QueryUtility.escapeSearchParameter(filter.toLowerCase()) + "%'", filter) // + + add(" AND LOWER(definition.name) LIKE '%" + escape(filter.toLowerCase()) + "%'", filter) // + " ORDER BY definition.name ");
} else if (context.equals("configuration")) { return execute("" // + "SELECT DISTINCT definition.name " // - + " FROM ResourceType type, Resource res " // + + " FROM ResourceType type, Resource res, PropertyDefinitionSimple simpleDefinition " //" + " JOIN type.resourceConfigurationDefinition.propertyDefinitions definition " // + " WHERE res.resourceType = type " // only suggest names that exist for resources in inventory + + " AND simpleDefinition = definition " // only suggest names for simple properties + + " AND simpleDefinition.type <> 'PASSWORD' " // do not suggest hidden/password property types + add(" AND LOWER(type.category) = '" + tab + "'", tab) // - + add(" AND LOWER(definition.name) LIKE '%" - + QueryUtility.escapeSearchParameter(filter.toLowerCase()) + "%'", filter) // + + add(" AND LOWER(definition.name) LIKE '%" + escape(filter.toLowerCase()) + "%'", filter) // + " ORDER BY definition.name ");
} else if (context.equals("trait")) { @@ -90,8 +91,7 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant { + " WHERE ms.resource = res " // only suggest names that exist for resources in inventory + " AND def.dataType = 1 " // trait types + add(" AND LOWER(res.resourceType.category) = '" + tab + "'", tab) // - + add(" AND LOWER(def.name) LIKE '%" + QueryUtility.escapeSearchParameter(filter.toLowerCase()) - + "%'", filter) // + + add(" AND LOWER(def.name) LIKE '%" + escape(filter.toLowerCase()) + "%'", filter) // + " ORDER BY def.name ");
} else { @@ -114,8 +114,7 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant { + " FROM Resource res, ResourceType type " // + " WHERE res.resourceType = type " // + add(" AND LOWER(type.category) = '" + tab + "'", tab) // - + add(" AND LOWER(type.name) LIKE '%" + QueryUtility.escapeSearchParameter(filter.toLowerCase()) - + "%'", filter) // + + add(" AND LOWER(type.name) LIKE '%" + escape(filter.toLowerCase()) + "%'", filter) // + " ORDER BY type.name ");
} else if (context.equals("plugin")) { @@ -124,8 +123,7 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant { + " FROM Resource res, ResourceType type " // + " WHERE res.resourceType = type " // + add(" AND LOWER(type.category) = '" + tab + "'", tab) // - + add(" AND LOWER(type.plugin) LIKE '%" + QueryUtility.escapeSearchParameter(filter.toLowerCase()) - + "%'", filter) // + + add(" AND LOWER(type.plugin) LIKE '%" + escape(filter.toLowerCase()) + "%'", filter) // + " ORDER BY type.plugin ");
} else if (context.equals("name")) { @@ -134,8 +132,7 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant { + " FROM Resource res, ResourceType type " // + " WHERE res.resourceType = type " // + add(" AND LOWER(type.category) = '" + tab + "'", tab) // - + add(" AND LOWER(res.name) LIKE '%" + QueryUtility.escapeSearchParameter(filter.toLowerCase()) - + "%'", filter) // + + add(" AND LOWER(res.name) LIKE '%" + escape(filter.toLowerCase()) + "%'", filter) // + " ORDER BY res.name ");
} else if (context.equals("alerts")) { @@ -144,29 +141,31 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant { } else if (context.equals("connection")) { return execute("" // + "SELECT DISTINCT simple.stringValue " // - + " FROM Resource res, PropertySimple simple " // + + " FROM Resource res, PropertySimple simple, PropertyDefinitionSimple simpleDefinition " // + " JOIN res.pluginConfiguration.properties property " // suggest values for existing resources only - + " WHERE simple.id = property.id " // - + " AND LOWER(property.name) LIKE '%" - + QueryUtility.escapeSearchParameter(param.toLowerCase()) - + "%'" // + + " JOIN res.resourceType.pluginConfigurationDefinition.propertyDefinitions propertyDefinition " // suggest values for existing resources only + + " WHERE simpleDefinition = propertyDefinition " // only suggest values for simple properties + + " AND simpleDefinition.type <> 'PASSWORD' " // do not suggest hidden/password property types + + " AND property = simple " // join here so we can project simple.stringValue + + " AND property.name = propertyDefinition.name " // property/definition are linked via name + + " AND LOWER(property.name) LIKE '%" + escape(param.toLowerCase()) + "%'" // + add(" AND LOWER(res.resourceType.category) = '" + tab + "'", tab) // - + add(" AND LOWER(property.stringValue) LIKE '%" - + QueryUtility.escapeSearchParameter(filter.toLowerCase()) + "%'", filter) // + + add(" AND LOWER(property.stringValue) LIKE '%" + escape(filter.toLowerCase()) + "%'", filter) // + " ORDER BY simple.stringValue ");
} else if (context.equals("configuration")) { return execute("" // + "SELECT DISTINCT simple.stringValue " // - + " FROM Resource res, PropertySimple simple " // + + " FROM Resource res, PropertySimple simple, PropertyDefinitionSimple simpleDefinition " // + " JOIN res.resourceConfiguration.properties property " // suggest values for existing resources only - + " WHERE simple.id = property.id " // - + " AND LOWER(property.name) LIKE '%" - + QueryUtility.escapeSearchParameter(param.toLowerCase()) - + "%'" // + + " JOIN res.resourceType.resourceConfigurationDefinition.propertyDefinitions propertyDefinition " // suggest values for existing resources only + + " WHERE simpleDefinition = propertyDefinition " // only suggest values for simple properties + + " AND simpleDefinition.type <> 'PASSWORD' " // do not suggest hidden/password property types + + " AND property = simple " // join here so we can project simple.stringValue + + " AND property.name = propertyDefinition.name " // property/definition are linked via name + + " AND LOWER(property.name) LIKE '%" + escape(param.toLowerCase()) + "%'" // + add(" AND LOWER(res.resourceType.category) = '" + tab + "'", tab) // - + add(" AND LOWER(property.stringValue) LIKE '%" - + QueryUtility.escapeSearchParameter(filter.toLowerCase()) + "%'", filter) // + + add(" AND LOWER(property.stringValue) LIKE '%" + escape(filter.toLowerCase()) + "%'", filter) // + " ORDER BY simple.stringValue ");
} else if (context.equals("trait")) { @@ -176,12 +175,9 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant { + " JOIN trait.schedule ms " // + " WHERE ms.definition.dataType = 1 " // + " AND ms.resource = res " // only suggest values that exist for inventoried resources - + " AND LOWER(ms.definition.name) LIKE '%" - + QueryUtility.escapeSearchParameter(param.toLowerCase()) - + "%'" // + + " AND LOWER(ms.definition.name) LIKE '%" + escape(param.toLowerCase()) + "%'" // + add(" AND LOWER(res.resourceType.category) = '" + tab + "'", tab) // - + add(" AND LOWER(trait.value) LIKE '%" + QueryUtility.escapeSearchParameter(filter.toLowerCase()) - + "%'", filter) // + + add(" AND LOWER(trait.value) LIKE '%" + escape(filter.toLowerCase()) + "%'", filter) // + " ORDER BY trait.value ");
} else {
commit 92d9c90a19089534aca252ab5292c4c128237c1a Author: Joseph Marques joseph@redhat.com Date: Wed Jul 14 21:12:52 2010 -0400
BZ-614591: fix inventory sync issues that manifest during specific timings of async uninventory
part 1 - do not merge inventory report resources that have already been uninventoried
there exists a small window of time after the synchronous part of the uninventory and before the async quartz job comes along to perform the actual removal of the resource from the database, that an inventory report can come across the wire and !OVERWROTE! the UNINVENTORIED status back to COMMITTED. if we find, during an inventory report merge, that the existing resource was already uninventoried (indicating that the quartz job has not yet come along to remove this resource from the database) we should stop all processing from this node and return immediately. this short-cuts the processing for the entire sub-tree under this resource, but that's OK because the in-band uninventory logic will have marked entire sub-tree for uninventory atomically. in other words, all of the descendants under a resource would also be marked for async uninventory too.
part 2 - async uninventory work should recursively delete resources
this handles the case when the the rare timings in part 1 made it into the system and the inventory is current in an inconsistent state. the likely effect is that a resource marked with UNINVENTORIED status has a child that is marked as COMMITTED. thus, if we recursively delete resources in the out-of-band job, we ensure that synchronization inconsistencies are eliminated and the inventory is brought back to a consistent state.
part 3 - async uninventory work should remove resources from their containing groups
even though the group removal occurs in the in-band work, there can be some group definitions that just happens to perform its recalculation (either manually or schedules) in the period after the in-band work completes but before the async job triggers. since the ExpressionEvaluator that underlies the bulk of the dynagroup query generations automatically adds a filter to only manipulate COMMITTED resource, this work should be a no-op most of the time. however, in rare circumstances it's possible for an InventoryReport to come across the wire and flip the status of resources from UNINVENTORIED back to COMMITTED. in this case, this group removal logic needs to be executed again just prior to removing the rest of the reosurce history.
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/discovery/DiscoveryBossBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/discovery/DiscoveryBossBean.java index cded63b..185562a 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/discovery/DiscoveryBossBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/discovery/DiscoveryBossBean.java @@ -561,8 +561,8 @@ public class DiscoveryBossBean implements DiscoveryBossLocal, DiscoveryBossRemot Resource parent = resource; while (parent != null && existingResource == null) { parent = parent.getParentResource(); - existingResource = resourceManager.getResourceByParentAndKey(subjectManager.getOverlord(), parent, - resource.getResourceKey(), resourceType.getPlugin(), resourceType.getName()); + existingResource = resourceManager.getResourceByParentAndKey(subjectManager.getOverlord(), parent, + resource.getResourceKey(), resourceType.getPlugin(), resourceType.getName()); }
if (existingResource != null) { @@ -592,15 +592,30 @@ public class DiscoveryBossBean implements DiscoveryBossLocal, DiscoveryBossRemot
private void updatePreviouslyInventoriedResource(Resource resource, Resource existingResource, Resource parentResource) throws InvalidInventoryReportException { + /* + * there exists a small window of time after the synchronous part of the uninventory and before the async + * quartz job comes along to perform the actual removal of the resource from the database, that an inventory + * report can come across the wire and !OVERWROTE! the UNINVENTORIED status back to COMMITTED. if we find, + * during an inventory report merge, that the existing resource was already uninventoried (indicating that + * the quartz job has not yet come along to remove this resource from the database) we should stop all + * processing from this node and return immediately. this short-cuts the processing for the entire sub-tree + * under this resource, but that's OK because the in-band uninventory logic will have marked entire sub-tree + * for uninventory atomically. in other words, all of the descendants under a resource would also be marked + * for async uninventory too. + */ + if (existingResource.getInventoryStatus() == InventoryStatus.UNINVENTORIED) { + return; + } + assert (parentResource == null) || (parentResource.getId() != 0); - - ResourceType existingResourceParentType = (existingResource.getParentResource() != null) - ? existingResource.getParentResource().getResourceType() : null; - ResourceType resourceParentType = (resource.getParentResource() != null) - ? resource.getParentResource().getResourceType() : null; + + ResourceType existingResourceParentType = (existingResource.getParentResource() != null) ? existingResource + .getParentResource().getResourceType() : null; + ResourceType resourceParentType = (resource.getParentResource() != null) ? resource.getParentResource() + .getResourceType() : null; Set<ResourceType> validParentTypes = existingResource.getResourceType().getParentResourceTypes(); - if (validParentTypes != null && !validParentTypes.isEmpty() && - !validParentTypes.contains(existingResourceParentType)) { + if (validParentTypes != null && !validParentTypes.isEmpty() + && !validParentTypes.contains(existingResourceParentType)) { // The existing Resource has an invalid parent ResourceType. This may be because its ResourceType was moved // to a new parent ResourceType, but its new parent was not yet discovered at the time of the type move. See // if the Resource reported by the Agent has a valid parent type, and, if so, update the existing Resource's @@ -617,10 +632,10 @@ public class DiscoveryBossBean implements DiscoveryBossLocal, DiscoveryBossRemot existingResource.setParentResource(resource.getParentResource()); } else { log.debug("Existing Resource " + existingResource + " has invalid parent type (" - + existingResourceParentType + ") and so does plugin-reported Resource " + resource + " (" - + resourceParentType + ") - valid parent types are [" + validParentTypes + "]."); + + existingResourceParentType + ") and so does plugin-reported Resource " + resource + " (" + + resourceParentType + ") - valid parent types are [" + validParentTypes + "]."); } - } + }
// The below block is for Resources that were created via the RHQ GUI, whose descriptions will be null. if (existingResource.getDescription() == null && resource.getDescription() != null) { @@ -654,11 +669,11 @@ public class DiscoveryBossBean implements DiscoveryBossLocal, DiscoveryBossRemot private boolean initResourceTypes(Resource resource) { ResourceType resourceType; try { - resourceType = this.resourceTypeManager.getResourceTypeByNameAndPlugin(subjectManager.getOverlord(), resource - .getResourceType().getName(), resource.getResourceType().getPlugin()); + resourceType = this.resourceTypeManager.getResourceTypeByNameAndPlugin(subjectManager.getOverlord(), + resource.getResourceType().getName(), resource.getResourceType().getPlugin()); } catch (RuntimeException e) { log.error("Failed to lookup Resource type [" + resource.getResourceType() + "] for reported Resource [" - + resource + "] - this should not have happened."); + + resource + "] - this should not have happened."); return false; } if (resourceType == null) { diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerBean.java index df9b758..be85557 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerBean.java @@ -279,14 +279,13 @@ public class ResourceManagerBean implements ResourceManagerLocal, ResourceManage int i = 0; log.debug("== total size : " + toBeDeletedResourceIds.size());
- while (i<toBeDeletedResourceIds.size()) { + while (i < toBeDeletedResourceIds.size()) { int j = i + 1000; if (j > toBeDeletedResourceIds.size()) j = toBeDeletedResourceIds.size(); - List<Integer> idsToDelete = toBeDeletedResourceIds.subList(i,j); + List<Integer> idsToDelete = toBeDeletedResourceIds.subList(i, j); log.debug("== Bounds " + i + ", " + j);
- boolean hasErrors = uninventoryResourcesBulkDelete(overlord, idsToDelete); if (hasErrors) { throw new IllegalArgumentException("Could not remove resources from their containing groups"); @@ -338,7 +337,21 @@ public class ResourceManagerBean implements ResourceManagerLocal, ResourceManage throw new IllegalArgumentException("Only the overlord can execute out-of-band async resource delete method"); }
- boolean hasErrors = uninventoryResourceBulkDeleteAsyncWork(user, resourceId); + /* + * even though the group removal occurs in the in-band work, there can be some group definitions that just + * happens to perform its recalculation (either manually or schedules) in the period after the in-band work + * completes but before the async job triggers. since the ExpressionEvaluator that underlies the bulk of the + * dynagroup query generations automatically adds a filter to only manipulate COMMITTED resource, this work + * should be a no-op most of the time. however, in rare circumstances it's possible for an InventoryReport to + * come across the wire and flip the status of resources from UNINVENTORIED back to COMMITTED. in this case, + * this group removal logic needs to be executed again just prior to removing the rest of the reosurce history. + */ + boolean hasErrors = uninventoryResourcesBulkDelete(user, Arrays.asList(resourceId)); + if (hasErrors) { + return; // return early if there were any errors, because we can't remove the resource yet + } + + hasErrors = uninventoryResourceBulkDeleteAsyncWork(user, resourceId); if (hasErrors) { return; // return early if there were any errors, because we can't remove the resource yet } diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/scheduler/jobs/AsyncResourceDeleteJob.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/scheduler/jobs/AsyncResourceDeleteJob.java index 412e61d..b0d183d 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/scheduler/jobs/AsyncResourceDeleteJob.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/scheduler/jobs/AsyncResourceDeleteJob.java @@ -26,6 +26,7 @@ import org.quartz.JobExecutionContext; import org.quartz.JobExecutionException;
import org.rhq.core.domain.auth.Subject; +import org.rhq.core.util.exception.ThrowableUtil; import org.rhq.enterprise.server.exception.UnscheduleException; import org.rhq.enterprise.server.operation.OperationManagerLocal; import org.rhq.enterprise.server.operation.ResourceOperationSchedule; @@ -36,39 +37,72 @@ public class AsyncResourceDeleteJob extends AbstractStatefulJob {
private final Log log = LogFactory.getLog(AsyncResourceDeleteJob.class);
- @Override - public void executeJobCode(JobExecutionContext arg0) throws JobExecutionException { - - Subject overlord = LookupUtil.getSubjectManager().getOverlord(); - ResourceManagerLocal resourceManager = LookupUtil.getResourceManager(); + Subject overlord = LookupUtil.getSubjectManager().getOverlord(); + ResourceManagerLocal resourceManager = LookupUtil.getResourceManager();
+ private class AsyncDeletionStats { int deletedSuccessfully = 0; int deletedWithFailure = 0; - long time = 0; + long deletionTime; + + public String toString() { + return "Async resource deletion - " + deletedSuccessfully + " successful, " + deletedWithFailure + + " failed, took [" + deletionTime + "] ms"; + } + } + + @Override + public void executeJobCode(JobExecutionContext arg0) throws JobExecutionException { List<Integer> toBeRemovedIds = resourceManager.findResourcesMarkedForAsyncDeletion(overlord); + + AsyncDeletionStats stats = new AsyncDeletionStats(); for (Integer doomedResourceId : toBeRemovedIds) { try { - log.debug("Before asynchronous deletion of resource[id=" + doomedResourceId + "]"); - long startTime = System.currentTimeMillis(); - unscheduleJobs(overlord, doomedResourceId); - resourceManager.uninventoryResourceAsyncWork(overlord, doomedResourceId); - long endTime = System.currentTimeMillis(); - time += (endTime - startTime); - log.debug("After asynchronous deletion of resource[id=" + doomedResourceId + "], took [" - + (endTime - startTime) + "]ms"); - deletedSuccessfully++; + // do not recurse + uninventoryResource(overlord, doomedResourceId, stats, false); } catch (Throwable t) { - log.debug("Error during asynchronous deletion of resource[id=" + doomedResourceId + "]", t); - deletedWithFailure++; + log.debug("Simple asynchronous deletion of resource[id=" + doomedResourceId + "] failed, " + + "trying more robust yet expensive removal method, cause: " + ThrowableUtil.getAllMessages(t)); + try { + // try more robust yet expensive recursive delete + uninventoryResource(overlord, doomedResourceId, stats, true); + } catch (Throwable tt) { + log.debug("Error during asynchronous deletion of resource[id=" + doomedResourceId + "], cause: " + + ThrowableUtil.getAllMessages(tt)); + stats.deletedWithFailure++; + } } }
- if (deletedSuccessfully > 0 || deletedWithFailure > 0) { - log.info("Async resource deletion - " + deletedSuccessfully + " successful, " + deletedWithFailure - + " failed, took [" + time + "]ms"); + if (stats.deletedSuccessfully > 0 || stats.deletedWithFailure > 0) { + log.info(stats); } }
+ // return true if successful + private void uninventoryResource(Subject overlord, Integer doomedResourceId, AsyncDeletionStats stats, + boolean recurse) { + if (recurse) { + List<Integer> doomedChildrenIds = resourceManager.findChildrenResourceIds(doomedResourceId, null); + for (Integer nextDoomedChildId : doomedChildrenIds) { + uninventoryResource(overlord, nextDoomedChildId, stats, recurse); + } + } + log.debug("Before " + (recurse ? "(recursive)" : "") + " asynchronous deletion of resource[id=" + + doomedResourceId + "]"); + long startTime = System.currentTimeMillis(); + + unscheduleJobs(overlord, doomedResourceId); + resourceManager.uninventoryResourceAsyncWork(overlord, doomedResourceId); + stats.deletedSuccessfully++; + + long endTime = System.currentTimeMillis(); + log.debug("After " + (recurse ? "(recursive)" : "") + " asynchronous deletion of resource[id=" + + doomedResourceId + "] took [" + (endTime - startTime) + "]ms"); + + stats.deletionTime += (endTime - startTime); + } + private void unscheduleJobs(Subject overlord, Integer resourceId) { log.debug("Unscheduling jobs for resource[id=" + resourceId + "]"); OperationManagerLocal operationManager = LookupUtil.getOperationManager();
commit 5c0c296d0827308330762bab4d4db7b5988c5d59 Author: Joseph Marques joseph@redhat.com Date: Wed Jul 14 21:07:11 2010 -0400
BZ-614688: support searching for values that contain single-quotes
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/GroupSearchAssistant.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/GroupSearchAssistant.java index cba008f..a428edc 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/GroupSearchAssistant.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/GroupSearchAssistant.java @@ -7,6 +7,7 @@ import java.util.List; import org.rhq.core.domain.measurement.AvailabilityType; import org.rhq.core.domain.resource.ResourceCategory; import org.rhq.core.domain.search.SearchSubsystem; +import org.rhq.enterprise.server.util.QueryUtility;
public class GroupSearchAssistant extends TabAwareSearchAssistant {
@@ -63,7 +64,8 @@ public class GroupSearchAssistant extends TabAwareSearchAssistant { + " WHERE rg.resourceType = type " // only suggest names that exist for visible groups in inventory + " AND rg.visible = true " // + add(" AND LOWER(rg.groupCategory) = '" + tab + "'", tab) // - + add(" AND LOWER(type.name) LIKE '%" + filter.toLowerCase() + "%'", filter) // + + add(" AND LOWER(type.name) LIKE '%" + QueryUtility.escapeSearchParameter(filter.toLowerCase()) + + "%'", filter) // + " ORDER BY type.name ");
} else if (context.equals("plugin")) { @@ -73,7 +75,8 @@ public class GroupSearchAssistant extends TabAwareSearchAssistant { + " WHERE rg.resourceType = type " // only suggest names that exist for visible groups in inventory + " AND rg.visible = true " // + add(" AND LOWER(rg.groupCategory) = '" + tab + "'", tab) // - + add(" AND LOWER(type.plugin) LIKE '%" + filter.toLowerCase() + "%'", filter) // + + add(" AND LOWER(type.plugin) LIKE '%" + QueryUtility.escapeSearchParameter(filter.toLowerCase()) + + "%'", filter) // + " ORDER BY type.plugin ");
} else if (context.equals("name")) { @@ -82,7 +85,9 @@ public class GroupSearchAssistant extends TabAwareSearchAssistant { + " FROM ResourceGroup rg " // + " WHERE rg.visible = true " // only suggest names that exist for visible groups in inventory + add(" AND LOWER(rg.groupCategory) = '" + tab + "'", tab) // - + add(" AND LOWER(rg.name) LIKE '%" + filter.toLowerCase() + "%'", filter) // + + add( + " AND LOWER(rg.name) LIKE '%" + QueryUtility.escapeSearchParameter(filter.toLowerCase()) + "%'", + filter) // + " ORDER BY rg.name ");
} else { diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/ResourceSearchAssistant.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/ResourceSearchAssistant.java index e6552fc..124c07b 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/ResourceSearchAssistant.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/ResourceSearchAssistant.java @@ -9,6 +9,7 @@ import org.rhq.core.domain.measurement.AvailabilityType; import org.rhq.core.domain.resource.ResourceCategory; import org.rhq.core.domain.search.SearchSubsystem; import org.rhq.core.domain.search.assist.AlertSearchAssistParam; +import org.rhq.enterprise.server.util.QueryUtility;
public class ResourceSearchAssistant extends TabAwareSearchAssistant {
@@ -66,7 +67,8 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant { + " JOIN type.pluginConfigurationDefinition.propertyDefinitions definition " // + " WHERE res.resourceType = type " // only suggest names that exist for resources in inventory + add(" AND LOWER(type.category) = '" + tab + "'", tab) // - + add(" AND LOWER(definition.name) LIKE '%" + filter.toLowerCase() + "%'", filter) // + + add(" AND LOWER(definition.name) LIKE '%" + + QueryUtility.escapeSearchParameter(filter.toLowerCase()) + "%'", filter) // + " ORDER BY definition.name ");
} else if (context.equals("configuration")) { @@ -76,7 +78,8 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant { + " JOIN type.resourceConfigurationDefinition.propertyDefinitions definition " // + " WHERE res.resourceType = type " // only suggest names that exist for resources in inventory + add(" AND LOWER(type.category) = '" + tab + "'", tab) // - + add(" AND LOWER(definition.name) LIKE '%" + filter.toLowerCase() + "%'", filter) // + + add(" AND LOWER(definition.name) LIKE '%" + + QueryUtility.escapeSearchParameter(filter.toLowerCase()) + "%'", filter) // + " ORDER BY definition.name ");
} else if (context.equals("trait")) { @@ -87,7 +90,8 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant { + " WHERE ms.resource = res " // only suggest names that exist for resources in inventory + " AND def.dataType = 1 " // trait types + add(" AND LOWER(res.resourceType.category) = '" + tab + "'", tab) // - + add(" AND LOWER(def.name) LIKE '%" + filter.toLowerCase() + "%'", filter) // + + add(" AND LOWER(def.name) LIKE '%" + QueryUtility.escapeSearchParameter(filter.toLowerCase()) + + "%'", filter) // + " ORDER BY def.name ");
} else { @@ -110,7 +114,8 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant { + " FROM Resource res, ResourceType type " // + " WHERE res.resourceType = type " // + add(" AND LOWER(type.category) = '" + tab + "'", tab) // - + add(" AND LOWER(type.name) LIKE '%" + filter.toLowerCase() + "%'", filter) // + + add(" AND LOWER(type.name) LIKE '%" + QueryUtility.escapeSearchParameter(filter.toLowerCase()) + + "%'", filter) // + " ORDER BY type.name ");
} else if (context.equals("plugin")) { @@ -119,7 +124,8 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant { + " FROM Resource res, ResourceType type " // + " WHERE res.resourceType = type " // + add(" AND LOWER(type.category) = '" + tab + "'", tab) // - + add(" AND LOWER(type.plugin) LIKE '%" + filter.toLowerCase() + "%'", filter) // + + add(" AND LOWER(type.plugin) LIKE '%" + QueryUtility.escapeSearchParameter(filter.toLowerCase()) + + "%'", filter) // + " ORDER BY type.plugin ");
} else if (context.equals("name")) { @@ -128,7 +134,8 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant { + " FROM Resource res, ResourceType type " // + " WHERE res.resourceType = type " // + add(" AND LOWER(type.category) = '" + tab + "'", tab) // - + add(" AND LOWER(res.name) LIKE '%" + filter.toLowerCase() + "%'", filter) // + + add(" AND LOWER(res.name) LIKE '%" + QueryUtility.escapeSearchParameter(filter.toLowerCase()) + + "%'", filter) // + " ORDER BY res.name ");
} else if (context.equals("alerts")) { @@ -140,9 +147,12 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant { + " FROM Resource res, PropertySimple simple " // + " JOIN res.pluginConfiguration.properties property " // suggest values for existing resources only + " WHERE simple.id = property.id " // - + " AND LOWER(property.name) LIKE '%" + param.toLowerCase() + "%'" // + + " AND LOWER(property.name) LIKE '%" + + QueryUtility.escapeSearchParameter(param.toLowerCase()) + + "%'" // + add(" AND LOWER(res.resourceType.category) = '" + tab + "'", tab) // - + add(" AND LOWER(property.stringValue) LIKE '%" + filter.toLowerCase() + "%'", filter) // + + add(" AND LOWER(property.stringValue) LIKE '%" + + QueryUtility.escapeSearchParameter(filter.toLowerCase()) + "%'", filter) // + " ORDER BY simple.stringValue ");
} else if (context.equals("configuration")) { @@ -151,9 +161,12 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant { + " FROM Resource res, PropertySimple simple " // + " JOIN res.resourceConfiguration.properties property " // suggest values for existing resources only + " WHERE simple.id = property.id " // - + " AND LOWER(property.name) LIKE '%" + param.toLowerCase() + "%'" // + + " AND LOWER(property.name) LIKE '%" + + QueryUtility.escapeSearchParameter(param.toLowerCase()) + + "%'" // + add(" AND LOWER(res.resourceType.category) = '" + tab + "'", tab) // - + add(" AND LOWER(property.stringValue) LIKE '%" + filter.toLowerCase() + "%'", filter) // + + add(" AND LOWER(property.stringValue) LIKE '%" + + QueryUtility.escapeSearchParameter(filter.toLowerCase()) + "%'", filter) // + " ORDER BY simple.stringValue ");
} else if (context.equals("trait")) { @@ -163,9 +176,12 @@ public class ResourceSearchAssistant extends TabAwareSearchAssistant { + " JOIN trait.schedule ms " // + " WHERE ms.definition.dataType = 1 " // + " AND ms.resource = res " // only suggest values that exist for inventoried resources - + " AND LOWER(ms.definition.name) LIKE '%" + param.toLowerCase() + "%'" // + + " AND LOWER(ms.definition.name) LIKE '%" + + QueryUtility.escapeSearchParameter(param.toLowerCase()) + + "%'" // + add(" AND LOWER(res.resourceType.category) = '" + tab + "'", tab) // - + add(" AND LOWER(trait.value) LIKE '%" + filter.toLowerCase() + "%'", filter) // + + add(" AND LOWER(trait.value) LIKE '%" + QueryUtility.escapeSearchParameter(filter.toLowerCase()) + + "%'", filter) // + " ORDER BY trait.value ");
} else { diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/AbstractSearchTranslator.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/AbstractSearchTranslator.java index 59f4888..e2d3600 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/AbstractSearchTranslator.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/AbstractSearchTranslator.java @@ -1,6 +1,7 @@ package org.rhq.enterprise.server.search.translation;
import org.rhq.enterprise.server.search.translation.antlr.RHQLComparisonOperator; +import org.rhq.enterprise.server.util.QueryUtility;
public abstract class AbstractSearchTranslator implements SearchTranslator {
@@ -13,13 +14,13 @@ public abstract class AbstractSearchTranslator implements SearchTranslator {
private String process(ValueFilter filter, String value) { if (filter == ValueFilter.STARTS_WITH) { - return "'" + value + "%'"; + return "'" + QueryUtility.escapeSearchParameter(value) + "%'"; } else if (filter == ValueFilter.ENDS_WITH) { - return "'%" + value + "'"; + return "'%" + QueryUtility.escapeSearchParameter(value) + "'"; } else if (filter == ValueFilter.INDEX_OF) { - return "'%" + value + "%'"; + return "'%" + QueryUtility.escapeSearchParameter(value) + "%'"; } else if (filter == ValueFilter.EXACT_MATCH) { - return "'" + value + "'"; + return "'" + QueryUtility.escapeSearchParameter(value) + "'"; } else { throw new IllegalArgumentException("Unsupported ValueFilter: " + filter); } @@ -70,20 +71,21 @@ public abstract class AbstractSearchTranslator implements SearchTranslator { Class<? extends Enum<?>> enumClass, boolean useOrdinal) { if (operator == RHQLComparisonOperator.NULL || // operator == RHQLComparisonOperator.NOT_NULL) { - return fragment + operator.getDefaultTranslation(); + return QueryUtility.escapeSearchParameter(fragment + operator.getDefaultTranslation());
} else if (operator == RHQLComparisonOperator.EQUALS || // operator == RHQLComparisonOperator.EQUALS_STRICT || // operator == RHQLComparisonOperator.NOT_EQUALS || // operator == RHQLComparisonOperator.NOT_EQUALS_STRICT) { - return fragment + operator.getDefaultTranslation() + getEnum(enumClass, value, useOrdinal); + return QueryUtility.escapeSearchParameter(fragment + operator.getDefaultTranslation() + + getEnum(enumClass, value, useOrdinal));
} else { throw new IllegalArgumentException("Unsupported operator " + operator); } }
- protected String getEnum(Class<? extends Enum<?>> enumClass, String value, boolean useOrdinal) { + private String getEnum(Class<? extends Enum<?>> enumClass, String value, boolean useOrdinal) { value = value.toLowerCase(); for (Enum<?> nextEnum : enumClass.getEnumConstants()) { if (nextEnum.name().toLowerCase().equals(value)) { diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/QueryUtility.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/QueryUtility.java index bd9cc8a..8750977 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/QueryUtility.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/QueryUtility.java @@ -48,16 +48,17 @@ public class QueryUtility {
private static String doEscapeSearchParameter(String value) { init(); - + // Escape LIKE's wildcard characters with escaped characters so that the user's input // will be matched literally value = value.replace(ESCAPE_CHARACTER, ESCAPED_ESCAPE); value = value.replace("_", ESCAPED_UNDERSCORE); value = value.replace("%", ESCAPED_PERCENT); + value = value.replace("'", "''");
return value; - } - + } + /** * Given the settings for the current DatabaseType, properly handle escaping special SQL characters as * well as UPCASING the value (standard for rhq filter searches) and wrapping with SQL wildcard for
commit 2f23d21e0fafb6c03190cfec19cee09af9bfb293 Author: Greg Hinkle ghinkle@redhat.com Date: Wed Jul 14 22:41:08 2010 -0400
Tests with the ListGridFieldType.LINK
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundlesListView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundlesListView.java index 927056b..3dc9f4c 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundlesListView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundlesListView.java @@ -21,6 +21,7 @@ package org.rhq.enterprise.gui.coregui.client.bundle.list; import com.google.gwt.user.client.History; import com.google.gwt.user.client.rpc.AsyncCallback; import com.smartgwt.client.data.Criteria; +import com.smartgwt.client.types.ListGridFieldType; import com.smartgwt.client.types.SelectionAppearance; import com.smartgwt.client.types.SelectionStyle; import com.smartgwt.client.widgets.grid.CellFormatter; @@ -66,12 +67,15 @@ public class BundlesListView extends Table { setDataSource(new BundlesWithLatestVersionDataSource());
getListGrid().getField("id").setWidth("60"); - getListGrid().getField("name").setWidth("25%"); - getListGrid().getField("name").setCellFormatter(new CellFormatter() { - public String format(Object o, ListGridRecord listGridRecord, int i, int i1) { - return "<a href="#Bundles/Bundle/" + listGridRecord.getAttribute("id") + "">" + o + "</a>"; - } - }); + getListGrid().getField("link").setWidth("25%"); + getListGrid().getField("link").setType(ListGridFieldType.LINK); + getListGrid().getField("link").setTarget("_self"); + +// getListGrid().getField("name").setCellFormatter(new CellFormatter() { +// public String format(Object o, ListGridRecord listGridRecord, int i, int i1) { +// return "";//<a href="#Bundles/Bundle/" + listGridRecord.getAttribute("id") + "">" + o + "</a>"; +// } +// });
getListGrid().getField("description").setWidth("25%"); getListGrid().getField("latestVersion").setWidth("25%"); diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundlesWithLatestVersionDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundlesWithLatestVersionDataSource.java index f20d65e..e3b54ac 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundlesWithLatestVersionDataSource.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundlesWithLatestVersionDataSource.java @@ -22,6 +22,7 @@ import com.google.gwt.user.client.rpc.AsyncCallback; import com.smartgwt.client.data.DSRequest; import com.smartgwt.client.data.DSResponse; import com.smartgwt.client.data.fields.DataSourceIntegerField; +import com.smartgwt.client.data.fields.DataSourceLinkField; import com.smartgwt.client.data.fields.DataSourceTextField; import com.smartgwt.client.widgets.grid.ListGridRecord;
@@ -46,8 +47,9 @@ public class BundlesWithLatestVersionDataSource extends RPCDataSource<BundleWith idField.setPrimaryKey(true); addField(idField);
- DataSourceTextField nameField = new DataSourceTextField("name", "Name"); - addField(nameField); + DataSourceLinkField linkField = new DataSourceLinkField("link", "Name"); + addField(linkField); +
DataSourceTextField descriptionField = new DataSourceTextField("description", "Description"); addField(descriptionField); @@ -112,6 +114,12 @@ public class BundlesWithLatestVersionDataSource extends RPCDataSource<BundleWith
record.setAttribute("id", from.getBundleId()); record.setAttribute("name", from.getBundleName()); + + + record.setAttribute("link", "#Bundles/Bundle/" + from.getBundleId()); + record.setLinkText(from.getBundleName()); + + record.setAttribute("description", from.getBundleDescription()); record.setAttribute("latestVersion", from.getLatestVersion()); record.setAttribute("versionsCount", Integer.valueOf(from.getVersionsCount().intValue())); // want int, not long
commit db16f69cec6123b2eb60ec6fd5605c8c59338dab Author: Greg Hinkle ghinkle@redhat.com Date: Wed Jul 14 22:39:10 2010 -0400
IE6 XMLHttpRequest workaround for the searchgui Don't use CoreGUI framework features from the jsf embedded search gui components
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/SearchGUI.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/SearchGUI.java index 76520b8..5526b3d 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/SearchGUI.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/SearchGUI.java @@ -63,6 +63,12 @@ public class SearchGUI implements EntryPoint { }
public static void checkLoginStatus() { + + if (detectIe6()) { + forceIe6Hacks(); + } + + RequestBuilder b = new RequestBuilder(RequestBuilder.GET, "/sessionAccess"); try { b.setCallback(new RequestCallback() { @@ -89,8 +95,12 @@ public class SearchGUI implements EntryPoint { GWTServiceLookup.getSubjectService().findSubjectsByCriteria(criteria, new AsyncCallback<PageList<Subject>>() { public void onFailure(Throwable caught) { - CoreGUI.getErrorHandler().handleError("Failed to load user's subject", caught); - new LoginView().showLoginDialog(); + // can't use this until gwt frame is always present, reserve for futureu + //CoreGUI.getErrorHandler().handleError("Failed to load user's subject", caught); + //SC.say("Failed to load user's subject."); + //new LoginView().showLoginDialog(); + + System.out.println("Failed to load user's subject"); }
public void onSuccess(PageList<Subject> result) { @@ -115,7 +125,12 @@ public class SearchGUI implements EntryPoint { } catch (RequestException e) { SC.say("Unable to determine login status, check server status"); e.printStackTrace(); + } finally { + if (detectIe6()) { +// unforceIe6Hacks(); + } } + }
public static Subject getSessionSubject() { @@ -125,4 +140,30 @@ public class SearchGUI implements EntryPoint { public SearchBar getSearchBar() { return searchBar; } + + + + /** + * Detects IE6. + * <p/> + * This is a nasty hack; but it's extremely reliable when running with other + * js libraries on the same page at the same time as gwt. + */ + public static native boolean detectIe6() /*-{ + if (typeof $doc.body.style.maxHeight != "undefined") + return(false); + else + return(true); +}-*/; + + public static native void forceIe6Hacks() /*-{ + $wnd.XMLHttpRequestBackup = $wnd.XMLHttpRequest; + $wnd.XMLHttpRequest = null; +}-*/; + + public static native void unforceIe6Hacks() /*-{ + $wnd.XMLHttpRequest = $wnd.XMLHttpRequestBackup; + $wnd.XMLHttpRequestBackup = null; +}-*/; + }
commit 8b9d621d09dcd9379e53b622222b3fb98dce44d7 Author: Greg Hinkle ghinkle@redhat.com Date: Wed Jul 14 22:38:08 2010 -0400
Protect against invalid events
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/SearchBar.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/SearchBar.java index 60866e0..47dcded 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/SearchBar.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/SearchBar.java @@ -110,9 +110,12 @@ public class SearchBar extends SimplePanel {
Event.addNativePreviewHandler(new NativePreviewHandler() { public void onPreviewNativeEvent(NativePreviewEvent event) { - if (event.getNativeEvent().getEventTarget().equals(searchButton) - && event.getTypeInt() == Event.ONMOUSEDOWN) { - prepareSearchExecution(); + if (event.getNativeEvent() != null && event.getNativeEvent().getEventTarget() != null) { + + if (event.getNativeEvent().getEventTarget().equals(searchButton) + && event.getTypeInt() == Event.ONMOUSEDOWN) { + prepareSearchExecution(); + } } } });
commit 160d7b800caf7639c0ab21bac81bfd21059a0f47 Author: Greg Hinkle ghinkle@redhat.com Date: Wed Jul 14 17:02:33 2010 -0400
fully qualified image path for other context path usage
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/rpc/RPCManager.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/rpc/RPCManager.java index 44aaacd..37f553d 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/rpc/RPCManager.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/rpc/RPCManager.java @@ -35,7 +35,7 @@ public class RPCManager { Img activityIndicator;
public RPCManager() { - activityIndicator = new Img("ajax-loader.gif", 16, 16); + activityIndicator = new Img("/coregui/images/ajax-loader.gif", 16, 16); activityIndicator.setZIndex(10000); activityIndicator.setLeft(10); activityIndicator.setTop(40);
commit ef05e9a1417faf1dd11dd0dff2dfbbc53aaf8470 Author: Greg Hinkle ghinkle@redhat.com Date: Wed Jul 14 17:02:00 2010 -0400
Switch menubar border overrides to css !important for bug in IE dom editing
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/menu/MenuBarView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/menu/MenuBarView.java index bcc4236..9992897 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/menu/MenuBarView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/menu/MenuBarView.java @@ -78,24 +78,6 @@ public class MenuBarView extends VLayout { this.aboutModalWindow = new AboutModalWindow();
- // TODO GH: This is a nasty hack... it injects the css to override the smartgwt skin - String css = ".menuButton, .menuButtonOver, .menuButtonDown, .menuButtonDisabled, .menuButtonSelected, .menuButtonSelectedDown, .menuButtonSelectedOver, .menuButtonSelectedDisabled {\n" + - " border: none;\n" + - " font-size: 9pt; \n" + - " font-weight: bold;\n" + - "}\n" + - ".menuButtonDown {\n" + - " background: url("/coregui/org.rhq.enterprise.gui.coregui.CoreGUI/sc/skins/Enterprise/images/cssButton/button_Over_stretch.png") repeat-x scroll 0 0 #DDDDDD"; - - com.google.gwt.dom.client.StyleElement style = Document.get().createStyleElement(); - style.setPropertyString("language", "text/css"); - style.setInnerText(css); - Document.get().getBody().appendChild(style); - - - - - HLayout topBar = new HLayout(); topBar.setHeight(28); topBar.setStyleName("topMenuBar"); diff --git a/modules/enterprise/gui/coregui/src/main/webapp/CoreGUI.css b/modules/enterprise/gui/coregui/src/main/webapp/CoreGUI.css index 40274c1..a00b6ed 100644 --- a/modules/enterprise/gui/coregui/src/main/webapp/CoreGUI.css +++ b/modules/enterprise/gui/coregui/src/main/webapp/CoreGUI.css @@ -302,8 +302,8 @@ a:hover { }
.menuButton, .menuButtonOver, .menuButtonDown, .menuButtonDisabled, .menuButtonSelected, .menuButtonSelectedDown, .menuButtonSelectedOver, .menuButtonSelectedDisabled { - border: none; - font-weight: bold; + border: none !important; + font-weight: bold !important; }
commit 3a9ea20e071e15b17c797c00f06da6a2eb9199b1 Author: Greg Hinkle ghinkle@redhat.com Date: Wed Jul 14 16:58:11 2010 -0400
We have to release without user.agent specific builds to have proper multiple browser support!
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml index a7782bf..b65157a 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml @@ -41,7 +41,7 @@ <!--<set-property name="user.agent" value="safari"/>-->
<!-- Firefox 3 --> - <set-property name="user.agent" value="gecko1_8"/> + <!--<set-property name="user.agent" value="gecko1_8"/>-->
<entry-point class='org.rhq.enterprise.gui.coregui.client.CoreGUI'/>
commit a3a6c3cbf971f898795f2ed7a18506af42498c2a Author: Ian Springer ian.springer@redhat.com Date: Wed Jul 14 21:47:24 2010 -0400
fix so unset checkbox works for textarea fields (for longString props) (https://bugzilla.redhat.com/show_bug.cgi?id=609456); call prepareInputsForSubmission() JS function upon submission of form on update alert sender config page
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/js/rhq.js b/modules/enterprise/gui/portal-war/src/main/webapp/js/rhq.js index 85077aa..138a5e5 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/js/rhq.js +++ b/modules/enterprise/gui/portal-war/src/main/webapp/js/rhq.js @@ -181,7 +181,7 @@ function writeProtectInputs(inputs) { * @param form a form element */ function prepareInputsForSubmission(form) { - var inputs = Form.getInputs(form); + var inputs = Form.getElements(form); for ( var i = 0; i < inputs.length; i++) { if (inputs[i].disabled) { // NOTE: It is vital to enable any disabled inputs, since the browser will exclude disabled inputs from the diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/alert/notification/details.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/alert/notification/details.xhtml index 01725e8..e5b1075 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/alert/notification/details.xhtml +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/alert/notification/details.xhtml @@ -117,7 +117,7 @@ </rich:panel>
<h:panelGroup id="customContentPanel" rendered="#{not empty alertNotificationsUIBean.activeNotification}"> - <h:form id="customContentForm"> + <h:form id="customContentForm" onsubmit="prepareInputsForSubmission(this)"> <input type="hidden" name="context" value="#{param.context}"/> <input type="hidden" name="contextId" value="#{param.contextId}"/> <input type="hidden" name="contextSubId" value="#{param.contextSubId}"/> @@ -189,4 +189,5 @@
</ui:composition>
-</html> \ No newline at end of file +</html> + \ No newline at end of file
commit 8ddfc3efc49e9b296f6dfd599c4649b73e2fc6e3 Merge: f1b2a3b... 764922f... Author: Jay Shaughnessy jshaughn@redhat.com Date: Wed Jul 14 15:19:33 2010 -0400
Merge branch 'release-3.0.0' of ssh://git.fedorahosted.org/git/rhq/rhq into release-3.0.0
commit f1b2a3b10a905df46794b1defdd273b282a854e7 Author: Jay Shaughnessy jshaughn@redhat.com Date: Wed Jul 14 15:14:25 2010 -0400
[BZ 613918] Further ensure manage_bundle permission is sufficient to manipulate bundles and view deployments.
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/BundleResourceDeploymentCriteria.java b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/BundleResourceDeploymentCriteria.java index 5520e0b..4e38e46 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/BundleResourceDeploymentCriteria.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/BundleResourceDeploymentCriteria.java @@ -85,8 +85,12 @@ public class BundleResourceDeploymentCriteria extends Criteria { this.fetchBundleDeployment = fetchBundleDeployment; }
+ // TODO: MANAGE_INVENTORY was too restrictive as a bundle manager could not then + // see his resource deployments. Until we can handle granular authorization checks on + // optionally fetched resource member data, allow a bundle manager to see + // resouce deployments to any platform. /** - * Requires MANAGE_INVENTORY + * Requires MANAGE_INVENTORY or MANAGE_BUNDLE * * @param fetchResource */ diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerBean.java index a70919e..5cf8205 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerBean.java @@ -695,7 +695,9 @@ public class BundleManagerBean implements BundleManagerLocal, BundleManagerRemot
// Create the mapping between the Bundle's Repo and the BundleFile's PackageVersion Repo repo = bundle.getRepo(); - repoManager.addPackageVersionsToRepo(subject, repo.getId(), new int[] { packageVersion.getId() }); + // add the packageVersion as overlord, this allows users without MANAGE_INVENTORY permission to add bundle files + repoManager.addPackageVersionsToRepo(subjectManager.getOverlord(), repo.getId(), new int[] { packageVersion + .getId() });
// Classify the Package with the Bundle name in order to distinguish it from the same package name for // a different bundle. @@ -1151,12 +1153,15 @@ public class BundleManagerBean implements BundleManagerLocal, BundleManagerRemot CriteriaQueryGenerator generator = new CriteriaQueryGenerator(criteria); if (!authorizationManager.isInventoryManager(subject)) { if (criteria.isInventoryManagerRequired()) { - throw new PermissionException("Subject [" + subject.getName() - + "] requires InventoryManager permission for requested query criteria."); + // TODO: MANAGE_INVENTORY was too restrictive as a bundle manager could not then + // see his resource deployments. Until we can handle granular authorization checks on + // optionally fetched resource member data, allow a bundle manager to see + // resouce deployments to any platform. + if (!authorizationManager.hasGlobalPermission(subject, Permission.MANAGE_BUNDLE)) { + throw new PermissionException("Subject [" + subject.getName() + + "] requires InventoryManager or BundleManager permission for requested query criteria."); + } } - - generator.setAuthorizationResourceFragment(CriteriaQueryGenerator.AuthorizationTokenType.RESOURCE, null, - subject.getId()); }
CriteriaQueryRunner<BundleResourceDeployment> queryRunner = new CriteriaQueryRunner<BundleResourceDeployment>(
commit 3a473fbf48a704f79fc250f732a35d5327667d25 Author: Jay Shaughnessy jshaughn@redhat.com Date: Wed Jul 14 15:12:45 2010 -0400
remove the previous bundle version field, it wasn't available w/o another db rt and the info is already in the name/description.
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/revert/ConfirmationStep.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/revert/ConfirmationStep.java index d71992e..fd7264d 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/revert/ConfirmationStep.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/revert/ConfirmationStep.java @@ -156,13 +156,7 @@ public class ConfirmationStep extends AbstractWizardStep { prevDescItem.setWrap(false); prevDescItem.setValue((null != prev.getName()) ? prev.getName() : "none");
- StaticTextItem prevVersionItem = new StaticTextItem("prevVersion", "Bundle Version"); - prevVersionItem.setTitleAlign(Alignment.LEFT); - prevVersionItem.setAlign(Alignment.LEFT); - prevVersionItem.setWrap(false); - prevVersionItem.setValue(prev.getBundleVersion().getVersion()); - - prevForm.setItems(prevNameItem, prevDescItem, prevVersionItem); + prevForm.setItems(prevNameItem, prevDescItem); layout.addMember(prevForm);
Label confirmation = new Label();
commit 51b5d72779664fb9399e8267536b451b6889bb0b Author: Heiko W. Rupp hwr@pilhuhn.de Date: Wed Jul 14 16:08:50 2010 +0200
Follow the changes to SenderResult
diff --git a/modules/enterprise/server/plugins/alert-microblog/src/main/java/org/rhq/enterprise/server/plugins/alertMicroblog/MicroblogSender.java b/modules/enterprise/server/plugins/alert-microblog/src/main/java/org/rhq/enterprise/server/plugins/alertMicroblog/MicroblogSender.java index b148a9b..1cf74b5 100644 --- a/modules/enterprise/server/plugins/alert-microblog/src/main/java/org/rhq/enterprise/server/plugins/alertMicroblog/MicroblogSender.java +++ b/modules/enterprise/server/plugins/alert-microblog/src/main/java/org/rhq/enterprise/server/plugins/alertMicroblog/MicroblogSender.java @@ -81,11 +81,11 @@ public class MicroblogSender extends AlertSender {
Status status = twitter.updateStatus(msg);
- result = new SenderResult(ResultState.SUCCESS,"Send notification to " + txt + ", msg-id: " + status.getId()); + result = SenderResult.getSimpleSuccess("Send notification to " + txt + ", msg-id: " + status.getId()); } catch (TwitterException e) {
log.warn("Notification via Microblog failed for " + txt + " ", e); - result = new SenderResult(ResultState.FAILURE,"Sending failed :" + e.getMessage()); + result = SenderResult.getSimpleFailure("Sending failed :" + e.getMessage());
} return result;
commit 764922f1e413c95e43f2c040c513851e38b25d62 Merge: d07d19f... 2a967b1... Author: Heiko W. Rupp hwr@pilhuhn.de Date: Wed Jul 14 15:33:46 2010 +0200
Merge branch 'release-3.0.0' of ssh://git.fedorahosted.org/git/rhq/rhq into release-3.0.0
commit d07d19ffc9f3ca23292d4ca1448ac72ca6ed5b35 Author: Heiko W. Rupp hwr@pilhuhn.de Date: Wed Jul 14 15:31:23 2010 +0200
Don't print to stdout, but use a logger.
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/util/SerialUtility.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/util/SerialUtility.java index 8758b72..7433805 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/util/SerialUtility.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/util/SerialUtility.java @@ -24,19 +24,24 @@ import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.ObjectOutputStream;
+import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + /** * @author Greg Hinkle */ public class SerialUtility {
+ private static Log log = LogFactory.getLog(SerialUtility.class);
public static <T> T prepare(T value, String message) {
long start = System.currentTimeMillis(); try { HibernateDetachUtility.nullOutUninitializedFields(value, HibernateDetachUtility.SerializationType.SERIALIZATION); - - System.out.println("SerialUtility.prepare [" + message + "] Detached in: " + (System.currentTimeMillis() - start) + "ms, Size is: " + serialSize(value)); + if (log.isDebugEnabled()) + log.debug("SerialUtility.prepare [" + message + "] Detached in: " + (System.currentTimeMillis() - start) + + "ms, Size is: " + serialSize(value)); } catch (Exception e) { e.printStackTrace(); } @@ -53,7 +58,7 @@ public class SerialUtility { o.flush(); return baos.size(); } catch (IOException e) { - e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates. + e.printStackTrace(); return -1; } }
commit 2fa692b5f5aa315b535888968bc0bfb852a8dde9 Merge: f7bc351... 2a967b1... Author: Jay Shaughnessy jshaughn@redhat.com Date: Wed Jul 14 09:30:54 2010 -0400
Merge branch 'release-3.0.0' into master-jay
commit 2a967b1cb103eaca19b103cc8035d6a430e7ba09 Merge: f40ab04... 2d97df9... Author: Jay Shaughnessy jshaughn@redhat.com Date: Tue Jul 13 18:17:40 2010 -0400
Merge branch 'release-3.0.0' into release-3.0.0-jay
commit f40ab04c9ff14674930edb296fc0b95a7e577221 Author: Jay Shaughnessy jshaughn@redhat.com Date: Tue Jul 13 18:15:28 2010 -0400
Postgres seems to have some different transaction semantics wrt ddl updates. Make sure to execute schema tasks with ignoreError=true in their own trans to avoid a failure marking the whole scheme spec trans for rollback.
diff --git a/modules/core/dbutils/src/main/java/org/rhq/core/db/ant/dbupgrade/SchemaSpec.java b/modules/core/dbutils/src/main/java/org/rhq/core/db/ant/dbupgrade/SchemaSpec.java index 979dcd3..4b7c0a5 100644 --- a/modules/core/dbutils/src/main/java/org/rhq/core/db/ant/dbupgrade/SchemaSpec.java +++ b/modules/core/dbutils/src/main/java/org/rhq/core/db/ant/dbupgrade/SchemaSpec.java @@ -19,6 +19,7 @@ package org.rhq.core.db.ant.dbupgrade;
import java.sql.Connection; +import java.sql.SQLException; import java.util.ArrayList; import java.util.List;
@@ -135,6 +136,16 @@ public class SchemaSpec extends Task implements TaskContainer, Comparable { log(MSG.getMsg(DbAntI18NResourceKeys.EXECUTING_SCHEMA_SPEC_TASK, sst.getClass(), getVersion()));
sst.initialize(conn, upgrader); + // to be able to ignore a failed ddl update we need to execute that + // update in its own trans, because the failure may mark the trans + // for rollback. So, commit ant transaction in progress. + if (sst.isIgnoreError()) { + try { + conn.commit(); + } catch (SQLException e) { + log("commit() exception: " + e.toString()); + } + } sst.execute(); } catch (Exception e) { String msg = MSG.getMsg(DbAntI18NResourceKeys.ERROR_EXECUTING_SCHEMA_SPEC_TASK, sst.getClass() @@ -142,6 +153,12 @@ public class SchemaSpec extends Task implements TaskContainer, Comparable { if (!sst.isIgnoreError()) { throw new BuildException(msg, e); } else { + // rollback the trans so the next statement starts a new trans + try { + conn.rollback(); + } catch (SQLException e2) { + log("rollback() exception: " + e2.toString()); + } log(msg); } }
commit 2d97df9bb2a6e577f7e7b7f24b192426bba5449e Merge: 4b1dc2d... 64cce78... Author: Simeon Pinder spinder@redhat.com Date: Tue Jul 13 16:31:11 2010 -0400
Merge branch 'release-3.0.0' into spinder-provisioning
commit 64cce78d37296a1d0c5be804687aef4e0394f86b Author: Joseph Marques joseph@redhat.com Date: Tue Jul 13 16:06:21 2010 -0400
BZ-613918: allow bundle managers without MANAGE_INVENTORY perm to create/delete bundles
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerBean.java index 6a78fe1..a70919e 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerBean.java @@ -175,7 +175,9 @@ public class BundleManagerBean implements BundleManagerLocal, BundleManagerRemot Repo repo = new Repo(name); repo.setCandidate(false); repo.setSyncSchedule(null); - repo = repoManager.createRepo(subject, repo); + + // create the repo as overlord, this allows users without MANAGE_INVENTORY permission to create bundles + repo = repoManager.createRepo(subjectManager.getOverlord(), repo);
// add the required PackageType. the PackageType is an attached object which helps in cascade removal // of packages in the bundle's repo. @@ -1227,7 +1229,8 @@ public class BundleManagerBean implements BundleManagerLocal, BundleManagerRemot this.entityManager.remove(bundle); this.entityManager.flush();
- repoManager.deleteRepo(subject, bundleRepo.getId()); + // delete the repo as overlord, this allows users without MANAGE_INVENTORY permission to delete bundles + repoManager.deleteRepo(subjectManager.getOverlord(), bundleRepo.getId()); }
@RequiredPermission(Permission.MANAGE_BUNDLE)
commit 4b1dc2d5133aa3e56d8460e57eda85b405792487 Author: Simeon Pinder spinder@redhat.com Date: Tue Jul 13 15:11:18 2010 -0400
BZ 604792: fix bundle left nav update issue.
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/BundleTopView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/BundleTopView.java index a3be0fa..c9955f3 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/BundleTopView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/BundleTopView.java @@ -98,7 +98,6 @@ public class BundleTopView extends HLayout implements BookmarkableView { // refresh System.out.println("Refreshing BundleTopView");
- bundleTreeView.refresh(); bundlesListView.refresh(); } else { currentNextPath = null; @@ -116,5 +115,6 @@ public class BundleTopView extends HLayout implements BookmarkableView { bundleView.renderView(viewPath.next()); } } + bundleTreeView.refresh();//refresh the tree in all cases. } }
commit 9e687dd74bfa3a42db4b719d0dc27ccba107f8cf Author: Joseph Marques joseph@redhat.com Date: Tue Jul 13 15:44:57 2010 -0400
ensure the "location" column for various dashboard portlets always renders
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/portlet/controlactions/View.jsp b/modules/enterprise/gui/portal-war/src/main/webapp/portlet/controlactions/View.jsp index 4665c09..27f84c6 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/portlet/controlactions/View.jsp +++ b/modules/enterprise/gui/portal-war/src/main/webapp/portlet/controlactions/View.jsp @@ -55,7 +55,7 @@ <c:forEach items="${lastCompletedResource}" var="obj"> <tr class="ListRow"> <td class="ListCell"><display:disambiguatedResourceName resourceName="${obj.original.resourceName}" disambiguationReport="${obj}" resourceId="${obj.original.resourceId}" /></td> - <td class="ListCell"><display:disambiguatedResourceLineage parents="${obj.parents}" /></td> + <td class="ListCell"><display:disambiguatedResourceLineage parents="${obj.parents}" /> </td> <td class="ListCell"><c:out value="${obj.original.operationName}"/></td> <td class="ListCell"><hq:dateFormatter value="${obj.original.operationStartTime}"/></td> <td class="ListCell" align="center"> diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/portlet/problemResources/View.jsp b/modules/enterprise/gui/portal-war/src/main/webapp/portlet/problemResources/View.jsp index 1a46253..7dffbd2 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/portlet/problemResources/View.jsp +++ b/modules/enterprise/gui/portal-war/src/main/webapp/portlet/problemResources/View.jsp @@ -37,7 +37,7 @@ <display:disambiguatedResourceNameDecorator resourceName="${obj.original.resourceName}" resourceId="${obj.original.resourceId}" disambiguationReport="${obj}"/> </display:column> <display:column width="20%" title="dash.home.TableHeader.Location"> - <display:disambiguatedResourceLineageDecorator parents="${obj.parents}"/> + <display:disambiguatedResourceLineageDecorator parents="${obj.parents}"/> </display:column> <display:column width="10%" property="original.numAlerts" title="dash.home.TableHeader.Alerts" align="center"/> <display:column width="10%" property="original.availabilityType" title="resource.common.monitor.visibility.CAvailabilityTH" align="center" > diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/portlet/resourceHealth/View.jsp b/modules/enterprise/gui/portal-war/src/main/webapp/portlet/resourceHealth/View.jsp index fd69279..bf05184 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/portlet/resourceHealth/View.jsp +++ b/modules/enterprise/gui/portal-war/src/main/webapp/portlet/resourceHealth/View.jsp @@ -31,7 +31,7 @@ <display:disambiguatedResourceNameDecorator resourceName="${item.original.name}" disambiguationReport="${item}" resourceId="${item.original.id}"/> </display:column> <display:column width="25%" title="dash.home.TableHeader.Location"> - <display:disambiguatedResourceLineageDecorator parents="${item.parents}"/> + <display:disambiguatedResourceLineageDecorator parents="${item.parents}"/> </display:column> <c:if test="${alerts}"> <display:column width="10%" property="original.alerts" title="dash.home.TableHeader.Alerts" align="center"/>
commit ddbb4b214fd500b08aecedbc404cb66c3c8a97c6 Author: Joseph Marques joseph@redhat.com Date: Tue Jul 13 15:44:18 2010 -0400
BZ-613939: fix link for "recent group operation" section from the dashboard
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/portlet/controlactions/View.jsp b/modules/enterprise/gui/portal-war/src/main/webapp/portlet/controlactions/View.jsp index 055e2c9..4665c09 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/portlet/controlactions/View.jsp +++ b/modules/enterprise/gui/portal-war/src/main/webapp/portlet/controlactions/View.jsp @@ -89,7 +89,7 @@ </tr> <c:forEach items="${lastCompletedGroup}" var="obj"> <tr class="ListRow"> - <td class="ListCell"><html:link page="/rhq/groups/monitor/graphs.xhtml?category=COMPATIBLE&groupId=${obj.groupId}"><c:out value="${obj.groupName}"/></html:link></td> + <td class="ListCell"><html:link page="/rhq/group/monitor/graphs.xhtml?category=COMPATIBLE&groupId=${obj.groupId}"><c:out value="${obj.groupName}"/></html:link></td> <td class="ListCell"><c:out value="${obj.groupResourceTypeName}"/></td> <td class="ListCell"><c:out value="${obj.operationName}"/></td> <td class="ListCell"><hq:dateFormatter value="${obj.operationStartTime}"/></td>
commit f7bc3514be4e70b7a86a6fc923bd1d581311a497 Author: Jay Shaughnessy jshaughn@redhat.com Date: Tue Jul 13 15:31:45 2010 -0400
uncripple some code that was disabled for 3.0.0.GA
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java index a10372f..7dfd9df 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java @@ -121,20 +121,17 @@ public class CoreGUI implements EntryPoint, ValueChangeHandler<String> {
checkLoginStatus();
- }
- public static void checkLoginStatus() {
-// String sessionIdString = com.google.gwt.user.client.Cookies.getCookie("RHQ_Sesssion"); -// if (sessionIdString == null) { + // String sessionIdString = com.google.gwt.user.client.Cookies.getCookie("RHQ_Sesssion"); + // if (sessionIdString == null) {
if (detectIe6()) { - forceIe6Hacks(); + forceIe6Hacks(); }
- RequestBuilder b = new RequestBuilder(RequestBuilder.GET, "/sessionAccess"); try { b.setCallback(new RequestCallback() { @@ -158,22 +155,22 @@ public class CoreGUI implements EntryPoint, ValueChangeHandler<String> { criteria.addFilterId(subjectId); criteria.fetchRoles(true);
+ GWTServiceLookup.getSubjectService().findSubjectsByCriteria(criteria, + new AsyncCallback<PageList<Subject>>() { + public void onFailure(Throwable caught) { + CoreGUI.getErrorHandler().handleError("Failed to load user's subject", caught); + new LoginView().showLoginDialog(); + }
- GWTServiceLookup.getSubjectService().findSubjectsByCriteria(criteria, new AsyncCallback<PageList<Subject>>() { - public void onFailure(Throwable caught) { - CoreGUI.getErrorHandler().handleError("Failed to load user's subject", caught); - new LoginView().showLoginDialog(); - } + public void onSuccess(PageList<Subject> result) {
- public void onSuccess(PageList<Subject> result) { + Subject subject = result.get(0); + subject.setSessionId(sessionId); + setSessionSubject(subject); + System.out.println("Portal-War logged in");
- Subject subject = result.get(0); - subject.setSessionId(sessionId); - setSessionSubject(subject); - System.out.println("Portal-War logged in"); - - } - }); + } + }); } else { new LoginView().showLoginDialog(); } @@ -189,12 +186,11 @@ public class CoreGUI implements EntryPoint, ValueChangeHandler<String> { e.printStackTrace(); } finally { if (detectIe6()) { - unforceIe6Hacks(); - } + unforceIe6Hacks(); + } } }
- private void buildCoreUI() { // If the core gui is already built (eg. from previous login, just refire event) if (this.rootCanvas == null) { @@ -247,7 +243,7 @@ public class CoreGUI implements EntryPoint, ValueChangeHandler<String> {
rootCanvas.renderView(currentViewPath); } - + public static void refresh() { currentViewPath = new ViewPath(currentPath);
@@ -258,21 +254,6 @@ public class CoreGUI implements EntryPoint, ValueChangeHandler<String> { public Canvas createContent(String breadcrumbName) { Canvas canvas;
- //============= - // TODO: REMOVE THIS AFTER 3.0 RELEASE - WE ONLY WANT 3.0 TO EXPOSE BUNDLES AND TAGS - // THEREAFTER, WE WILL EXPOSE ALL GWT FUNCTIONALITY - canvas = null; - if (canvas == null) { - if (breadcrumbName.equals("Bundles")) { - return new BundleTopView(); - } else if (breadcrumbName.equals("Tag")) { - return new TaggedView(); - } else { - return null; - } - } - //============= - if (breadcrumbName.equals("Administration")) { canvas = new AdministrationView(); } else if (breadcrumbName.equals("Demo")) { @@ -322,7 +303,7 @@ public class CoreGUI implements EntryPoint, ValueChangeHandler<String> { // s.setSessionId(subject.getSessionId()); CoreGUI.sessionSubject = subject; CoreGUI.userPreferences = new UserPreferences(subject); - loadProductInfo(); + loadProductInfo(); }
public static void setContent(Canvas newContent) { @@ -356,14 +337,14 @@ public class CoreGUI implements EntryPoint, ValueChangeHandler<String> { private static void loadProductInfo() { GWTServiceLookup.getSystemService().getProductInfo(new AsyncCallback<ProductInfo>() { public void onFailure(Throwable caught) { - CoreGUI.getErrorHandler().handleError("Failed to load product information.", caught); - } + CoreGUI.getErrorHandler().handleError("Failed to load product information.", caught); + }
- public void onSuccess(ProductInfo result) { - productInfo = result; - coreGUI.buildCoreUI(); - } - }); + public void onSuccess(ProductInfo result) { + productInfo = result; + coreGUI.buildCoreUI(); + } + }); }
private class RootCanvas extends VLayout implements BookmarkableView { @@ -397,7 +378,6 @@ public class CoreGUI implements EntryPoint, ValueChangeHandler<String> { } }
- /** * Detects IE6. * <p/> @@ -405,20 +385,20 @@ public class CoreGUI implements EntryPoint, ValueChangeHandler<String> { * js libraries on the same page at the same time as gwt. */ public static native boolean detectIe6() /*-{ - if (typeof $doc.body.style.maxHeight != "undefined") - return(false); - else - return(true); -}-*/; + if (typeof $doc.body.style.maxHeight != "undefined") + return(false); + else + return(true); + }-*/;
public static native void forceIe6Hacks() /*-{ - $wnd.XMLHttpRequestBackup = $wnd.XMLHttpRequest; - $wnd.XMLHttpRequest = null; -}-*/; + $wnd.XMLHttpRequestBackup = $wnd.XMLHttpRequest; + $wnd.XMLHttpRequest = null; + }-*/;
public static native void unforceIe6Hacks() /*-{ - $wnd.XMLHttpRequest = $wnd.XMLHttpRequestBackup; - $wnd.XMLHttpRequestBackup = null; -}-*/; + $wnd.XMLHttpRequest = $wnd.XMLHttpRequestBackup; + $wnd.XMLHttpRequestBackup = null; + }-*/;
} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/BundleTopView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/BundleTopView.java index 156e80e..f2c6637 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/BundleTopView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/BundleTopView.java @@ -32,6 +32,7 @@ import org.rhq.enterprise.gui.coregui.client.ViewPath; import org.rhq.enterprise.gui.coregui.client.bundle.list.BundleView; import org.rhq.enterprise.gui.coregui.client.bundle.list.BundlesListView; import org.rhq.enterprise.gui.coregui.client.bundle.tree.BundleTreeView; +import org.rhq.enterprise.gui.coregui.client.content.repository.tree.ContentRepositoryTreeView;
/** * @author Greg Hinkle @@ -66,14 +67,13 @@ public class BundleTopView extends HLayout implements BookmarkableView { bundlesSection.addItem(bundleTreeView); sectionStack.addSection(bundlesSection);
- // Don't show these in 3.0, they are not fully baked - //SectionStackSection repositoriesSection = new SectionStackSection("Repositories"); - //ContentRepositoryTreeView repoTree = new ContentRepositoryTreeView(); - //repositoriesSection.addItem(repoTree); - //sectionStack.addSection(repositoriesSection); + SectionStackSection repositoriesSection = new SectionStackSection("Repositories"); + ContentRepositoryTreeView repoTree = new ContentRepositoryTreeView(); + repositoriesSection.addItem(repoTree); + sectionStack.addSection(repositoriesSection);
- //SectionStackSection providersSection = new SectionStackSection("Providers"); - //sectionStack.addSection(providersSection); + SectionStackSection providersSection = new SectionStackSection("Providers"); + sectionStack.addSection(providersSection);
addMember(sectionStack);
commit fb09fe364d4a9934c2010ac2f4b4b577517a00f3 Author: Jay Shaughnessy jshaughn@redhat.com Date: Tue Jul 13 15:30:51 2010 -0400
Merge some db upgrade stuff. Will require a dbsetup to get to 2.91 if you're at 2.89 in master.
diff --git a/modules/core/dbutils/pom.xml b/modules/core/dbutils/pom.xml index 3dd9747..31e3e0a 100644 --- a/modules/core/dbutils/pom.xml +++ b/modules/core/dbutils/pom.xml @@ -22,7 +22,7 @@
<properties> <scm.module.path>modules/core/dbutils/</scm.module.path> - <db.schema.version>2.90</db.schema.version> + <db.schema.version>2.91</db.schema.version> </properties>
<dependencies> diff --git a/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml b/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml index 2156d24..7071839 100644 --- a/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml +++ b/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml @@ -3057,17 +3057,6 @@ </statement> </schema-directSQL> </schemaSpec> - - <schemaSpec version="2.89"> - <schema-directSQL> - <statement desc="Add end time index on call time data to speed up purges"> - CREATE INDEX RHQ_CT_DA_VA_END_TIM_IDX ON RHQ_CALLTIME_DATA_VALUE (end_time) - </statement> - <statement desc="Add index on measurement definition numeric type"> - CREATE INDEX RHQ_METRIC_DEF_NT_IDX ON RHQ_MEASUREMENT_DEF (numeric_type) - </statement> - </schema-directSQL> - </schemaSpec>
<!-- rhq 3.0.0.final release at this point. -->
@@ -3122,6 +3111,18 @@ </schema-directSQL>
</schemaSpec> + + <schemaSpec version="2.91"> + <schema-directSQL> + <statement desc="Add end time index on call time data to speed up purges"> + CREATE INDEX RHQ_CT_DA_VA_END_TIM_IDX ON RHQ_CALLTIME_DATA_VALUE (end_time) + </statement> + <statement desc="Add index on measurement definition numeric type"> + CREATE INDEX RHQ_METRIC_DEF_NT_IDX ON RHQ_MEASUREMENT_DEF (numeric_type) + </statement> + </schema-directSQL> + </schemaSpec> + </dbupgrade> </target> </project>
commit 43b89bae5e0c1b0539002644890e3d2132d10f7c Author: Joseph Marques joseph@redhat.com Date: Tue Jul 13 15:26:01 2010 -0400
BZ-614176: fix for selecting resource/group saved searches from the menu bar
* improve handling around "activiating" default search text and default savedSearch patterns * change hidden param name from defaultSavedSearchPattern to defaultSavedSearchPatternId, to better imply what data is represents * add the ability to load a default saved search pattern by id to the SavedSearchManager
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/SearchBar.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/SearchBar.java index 2c432d1..60866e0 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/SearchBar.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/SearchBar.java @@ -45,6 +45,7 @@ import com.google.gwt.user.client.ui.RootPanel; import com.google.gwt.user.client.ui.SimplePanel; import com.google.gwt.user.client.ui.TextBox;
+import org.rhq.core.domain.search.SavedSearch; import org.rhq.core.domain.search.SearchSubsystem; import org.rhq.enterprise.gui.coregui.client.search.favorites.SavedSearchGrid; import org.rhq.enterprise.gui.coregui.client.search.favorites.SavedSearchManager; @@ -88,7 +89,7 @@ public class SearchBar extends SimplePanel { private final SavedSearchManager savedSearchManager; private SearchSubsystem searchSubsystem; private String defaultSearchText; - private String defaultSavedSearchPattern; + private String defaultSavedSearchPatternId; private String selectedTab;
private Element searchButton; @@ -122,8 +123,8 @@ public class SearchBar extends SimplePanel { String defaultSearchText = searchBarElement.getAttribute("defaultSearchText"); setDefaultSearchText(defaultSearchText);
- String defaultSavedSearchPattern = searchBarElement.getAttribute("defaultSavedSearchPattern"); - setDefaultSavedSearchPattern(defaultSavedSearchPattern); + String defaultSavedSearchPatternId = searchBarElement.getAttribute("defaultSavedSearchPatternId"); + setDefaultSavedSearchPatternId(defaultSavedSearchPatternId);
String tab = searchBarElement.getAttribute("subtab"); if (tab != null) { @@ -161,6 +162,20 @@ public class SearchBar extends SimplePanel { setupArrowImage(); setupSavedSearches();
+ // + if (defaultSearchText != null) { + this.autoCompletePatternField.setText(defaultSearchText); + click(searchButton); // execute the search with this default search expression + } else if (defaultSavedSearchPatternId != null) { + try { + Integer savedSearchId = Integer.valueOf(defaultSavedSearchPatternId); + activateSavedSearch(savedSearchId); + } catch (Exception e) { + this.autoCompletePatternField.setText("'Error selecting saved search'"); + click(searchButton); // execute the search, which will help to further highlight the error + } + } + // presume the enclosing page logic loads results without a button click }
@@ -191,29 +206,26 @@ public class SearchBar extends SimplePanel { }
this.defaultSearchText = defaultSearchText; - this.autoCompletePatternField.setText(defaultSearchText); - click(searchButton); // execute the search with this default search expression }
public String getDefaultSearchText() { return defaultSearchText; }
- public void setDefaultSavedSearchPattern(String defaultSavedSearchPattern) { - if (defaultSavedSearchPattern == null || defaultSavedSearchPattern.trim().equals("")) { + public void setDefaultSavedSearchPatternId(String defaultSavedSearchPatternId) { + if (defaultSavedSearchPatternId == null || defaultSavedSearchPatternId.trim().equals("")) { return; // do nothing }
- this.defaultSavedSearchPattern = defaultSavedSearchPattern; - activateSavedSearch(defaultSavedSearchPattern); + this.defaultSavedSearchPatternId = defaultSavedSearchPatternId; }
public String getSelectedTab() { return selectedTab; }
- public String getDefaultSavedSearchPattern() { - return defaultSavedSearchPattern; + public String getDefaultSavedSearchPatternId() { + return defaultSavedSearchPatternId; }
public String getWelcomeMessage() { @@ -485,16 +497,29 @@ public class SearchBar extends SimplePanel { button.click(); }-*/;
+ public void activateSavedSearch(Integer savedSearchId) { + SavedSearch savedSearch = savedSearchManager.getSavedSearchById(savedSearchId); + if (savedSearch == null) { + SearchLogger.debug("activateSavedSearch: no known saved search with id '" + savedSearchId + "'"); + return; // no saved search existing with the specified id + } + activateSavedSearch(savedSearch); + } + public void activateSavedSearch(String savedSearchName) { - currentSearch = ""; - String patternValue = savedSearchManager.getPatternByName(savedSearchName); - if (patternValue == null) { - SearchLogger.debug("activeSavedSearch: no pattern known for saved search named '" + savedSearchName + "'"); + SavedSearch savedSearch = savedSearchManager.getSavedSearchByName(savedSearchName); + if (savedSearch == null) { + SearchLogger.debug("activateSavedSearch: no known saved search with name '" + savedSearchName + "'"); return; // no saved search existing with the specified name } - autoCompletePatternField.setValue(patternValue, true); - patternNameField.setValue(savedSearchName, true); - SearchLogger.debug("search results change: [" + savedSearchName + "," + patternValue + "]"); + activateSavedSearch(savedSearch); + } + + public void activateSavedSearch(SavedSearch savedSearch) { + currentSearch = ""; + autoCompletePatternField.setValue(savedSearch.getPattern(), true); + patternNameField.setValue(savedSearch.getName(), true); + SearchLogger.debug("search results change: [" + savedSearch.getName() + "," + savedSearch.getPattern() + "]"); turnNameFieldIntoLabel(); savedSearchesPanel.hide(); click(searchButton); diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/favorites/SavedSearchManager.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/favorites/SavedSearchManager.java index 398b4d8..66260e8 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/favorites/SavedSearchManager.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/favorites/SavedSearchManager.java @@ -62,6 +62,15 @@ public class SavedSearchManager { return savedSearches.get(name); }
+ public synchronized SavedSearch getSavedSearchById(Integer savedSearchId) { + for (SavedSearch next : savedSearches.values()) { + if (next.getId().equals(savedSearchId)) { + return next; + } + } + return null; + } + public synchronized void updatePatternByName(final String name, final String pattern) { SavedSearch savedSearch = savedSearches.get(name); if (savedSearch == null) { // created case diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/searchInterface.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/searchInterface.xhtml index 0c7022b..99bf2d1 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/searchInterface.xhtml +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/searchInterface.xhtml @@ -14,7 +14,7 @@ searchButtonId="#{searchButtonId}" searchSubsystem="#{searchSubsystem}" defaultSearchText="#{defaultSearchText}" - defaultSavedSearchPattern="#{defaultSavedSearchPattern}" + defaultSavedSearchPatternId="#{defaultSavedSearchPatternId}" subtab="#{subtab}" id="searchBar"> <div class="searchBarBackgroundContainer"> diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseGroups.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseGroups.xhtml index a132a39..87bb3ee 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseGroups.xhtml +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseGroups.xhtml @@ -45,6 +45,7 @@ <ui:param name="searchButtonId" value="browseGroupsForm:searchButtonJSF" /> <ui:param name="searchSubsystem" value="GROUP" /> <ui:param name="defaultSearchText" value="#{param.search}" /> + <ui:param name="defaultSavedSearchPatternId" value="#{param.searchId}" /> <ui:param name="subtab" value="${param.subtab}" /> </ui:include>
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseResources.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseResources.xhtml index 4bfb91a..c7f43c7 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseResources.xhtml +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseResources.xhtml @@ -45,7 +45,7 @@ <ui:param name="searchButtonId" value="browseResourcesForm:searchButtonJSF" /> <ui:param name="searchSubsystem" value="RESOURCE" /> <ui:param name="defaultSearchText" value="#{param.search}" /> - <ui:param name="defaultSavedSearchPattern" value="#{param.searchId}" /> + <ui:param name="defaultSavedSearchPatternId" value="#{param.searchId}" /> <ui:param name="subtab" value="${param.subtab}" /> </ui:include>
commit 729deb1e260cd73f7e6bcfcd5d63e1f57ae4a7da Author: Joseph Marques joseph@redhat.com Date: Tue Jul 13 15:10:54 2010 -0400
BZ-614165: do not try to parameter-replace UNSET configuration properties
diff --git a/modules/enterprise/server/plugins/alert-operations/src/main/java/org/rhq/enterprise/server/plugins/alertOperations/OperationsSender.java b/modules/enterprise/server/plugins/alert-operations/src/main/java/org/rhq/enterprise/server/plugins/alertOperations/OperationsSender.java index e50b143..1fcb295 100644 --- a/modules/enterprise/server/plugins/alert-operations/src/main/java/org/rhq/enterprise/server/plugins/alertOperations/OperationsSender.java +++ b/modules/enterprise/server/plugins/alert-operations/src/main/java/org/rhq/enterprise/server/plugins/alertOperations/OperationsSender.java @@ -72,6 +72,9 @@ public class OperationsSender extends AlertSender { AlertTokenReplacer replacementEngine = new AlertTokenReplacer(alert, operation, targetResource); for (PropertySimple simpleProperty : replacedParameters.getSimpleProperties().values()) { String temp = simpleProperty.getStringValue(); + if (temp == null) { + continue; // do not process 'UNSET' properties + } temp = replacementEngine.replaceTokens(temp); simpleProperty.setStringValue(temp); }
commit 44e7da0fb7b120e552b47486c8fdb1ac00198e57 Merge: e030743... 726f1ff... Author: Jay Shaughnessy jshaughn@redhat.com Date: Tue Jul 13 15:09:32 2010 -0400
Merge branch 'release-3.0.0' into master-jay
Conflicts: modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceDatasource.java modules/enterprise/gui/coregui/src/main/webapp/images/types/Server_down_16.png modules/enterprise/gui/coregui/src/main/webapp/images/types/Server_up_16.png modules/enterprise/gui/coregui/src/main/webapp/images/types/Service_down_16.png modules/enterprise/gui/coregui/src/main/webapp/images/types/Service_down_24.png modules/enterprise/gui/coregui/src/main/webapp/images/types/Service_up_16.png modules/enterprise/gui/coregui/src/main/webapp/images/types/Service_up_24.png
diff --cc modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml index 5ce87bc,a7782bf..264fbd6 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml @@@ -37,10 -38,10 +38,10 @@@ <!-- limit builds to your preferred browser -->
<!-- Safari --> - <!--<set-property name="user.agent" value="safari"/>--> + <set-property name="user.agent" value="safari"/>
<!-- Firefox 3 --> - <!-- <set-property name="user.agent" value="gecko1_8"/>--> + <set-property name="user.agent" value="gecko1_8"/>
<entry-point class='org.rhq.enterprise.gui.coregui.client.CoreGUI'/> @@@ -63,11 -64,7 +64,12 @@@ <servlet path="/RoleGWTService" class="org.rhq.enterprise.gui.coregui.server.gwt.RoleGWTServiceImpl"/> <servlet path="/SearchGWTService" class="org.rhq.enterprise.gui.coregui.server.gwt.SearchGWTServiceImpl"/> <servlet path="/SubjectGWTService" class="org.rhq.enterprise.gui.coregui.server.gwt.SubjectGWTServiceImpl"/> + <servlet path="/SystemGWTService" class="org.rhq.enterprise.gui.coregui.server.gwt.SystemGWTServiceImpl"/> <servlet path="/TagGWTService" class="org.rhq.enterprise.gui.coregui.server.gwt.TagGWTServiceImpl"/> + <servlet path="/RemoteInstallGWTService" class="org.rhq.enterprise.gui.coregui.server.gwt.RemoteInstallGWTServiceImpl"/> + <servlet path="/RepoGWTService" class="org.rhq.enterprise.gui.coregui.server.gwt.RepoGWTServiceImpl"/> + <servlet path="/ContentGWTService" class="org.rhq.enterprise.gui.coregui.server.gwt.ContentGWTServiceImpl"/> + <servlet path="/DashboardGWTService" class="org.rhq.enterprise.gui.coregui.server.gwt.DashboardGWTServiceImpl"/> + <servlet path="/EventGWTService" class="org.rhq.enterprise.gui.coregui.server.gwt.EventGWTServiceImpl"/>
</module> diff --cc modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceDatasource.java index b2903cc,048ba11..2bc3318 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceDatasource.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceDatasource.java @@@ -18,8 -18,6 +18,15 @@@ */ package org.rhq.enterprise.gui.coregui.client.inventory.resource;
++import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.AVAILABILITY; ++import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.CATEGORY; ++import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.DESCRIPTION; ++import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.NAME; ++import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.PLUGIN; ++import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.TYPE; ++ +import java.util.List; + import com.google.gwt.core.client.JavaScriptObject; import com.google.gwt.user.client.rpc.AsyncCallback; import com.smartgwt.client.data.DSRequest; @@@ -61,17 -67,19 +68,19 @@@ public class ResourceDatasource extend DataSourceImageField iconField = new DataSourceImageField("icon"); iconField.setImageURLPrefix("types/");
- DataSourceTextField nameDataField = new DataSourceTextField("name", "Name", 200); + DataSourceTextField nameDataField = new DataSourceTextField(NAME.propertyName(), NAME.title(), 200); nameDataField.setCanEdit(false);
- DataSourceTextField descriptionDataField = new DataSourceTextField("description", "Description"); - DataSourceTextField descriptionDataField = new DataSourceTextField(DESCRIPTION.propertyName(), - DESCRIPTION.title()); ++ DataSourceTextField descriptionDataField = new DataSourceTextField(DESCRIPTION.propertyName(), DESCRIPTION ++ .title()); descriptionDataField.setCanEdit(false);
- DataSourceTextField typeNameDataField = new DataSourceTextField("typeName", "Type"); - DataSourceTextField pluginNameDataField = new DataSourceTextField("pluginName", "Plugin"); - DataSourceTextField categoryDataField = new DataSourceTextField("category", "Category"); + DataSourceTextField typeNameDataField = new DataSourceTextField(TYPE.propertyName(), TYPE.title()); + DataSourceTextField pluginNameDataField = new DataSourceTextField(PLUGIN.propertyName(), PLUGIN.title()); + DataSourceTextField categoryDataField = new DataSourceTextField(CATEGORY.propertyName(), CATEGORY.title());
- DataSourceImageField availabilityDataField = new DataSourceImageField("currentAvailability", "Availability", 20); - DataSourceImageField availabilityDataField = new DataSourceImageField(AVAILABILITY.propertyName(), - AVAILABILITY.title(), 20); ++ DataSourceImageField availabilityDataField = new DataSourceImageField(AVAILABILITY.propertyName(), AVAILABILITY ++ .title(), 20);
availabilityDataField.setCanEdit(false);
@@@ -97,40 -105,28 +106,40 @@@ "parentId"))); }
+ if (request.getCriteria().getValues().get("id") != null) { + criteria.addFilterId(request.getCriteria().getAttributeAsInt("id")); + } + + if (request.getCriteria().getValues().get("resourceIds") != null) { - int[] ids = request.getCriteria().getAttributeAsIntArray("resourceIds"); ++ int[] ids = request.getCriteria().getAttributeAsIntArray("resourceIds"); + Integer[] oids = new Integer[ids.length]; + for (int i = 0; i < ids.length; i++) { + oids[i] = ids[i++]; + } + criteria.addFilterIds(oids); + } + - if (request.getCriteria().getValues().get("name") != null) { - criteria.addFilterName((String) request.getCriteria().getValues().get("name")); + if (request.getCriteria().getValues().get(NAME.propertyName()) != null) { + criteria.addFilterName((String) request.getCriteria().getValues().get(NAME.propertyName())); }
- if (request.getCriteria().getValues().get("category") != null) { + if (request.getCriteria().getValues().get(CATEGORY.propertyName()) != null) { criteria.addFilterResourceCategory(ResourceCategory.valueOf(((String) request.getCriteria().getValues() - .get("category")).toUpperCase())); + .get(CATEGORY.propertyName())).toUpperCase())); }
- if (request.getCriteria().getValues().get("availability") != null) { + if (request.getCriteria().getValues().get(AVAILABILITY.propertyName()) != null) { criteria.addFilterCurrentAvailability(AvailabilityType.valueOf(((String) request.getCriteria().getValues() - .get("availability")).toUpperCase())); + .get(AVAILABILITY.propertyName())).toUpperCase())); }
- if (request.getCriteria().getValues().get("type") != null) { - criteria - .addFilterResourceTypeId(Integer.parseInt(((String) request.getCriteria().getValues().get("type")))); + if (request.getCriteria().getValues().get(TYPE.propertyName()) != null) { - criteria - .addFilterResourceTypeId(Integer.parseInt(((String) request.getCriteria().getValues().get( - TYPE.propertyName())))); ++ criteria.addFilterResourceTypeId(Integer.parseInt(((String) request.getCriteria().getValues().get( ++ TYPE.propertyName())))); }
- if (request.getCriteria().getValues().get("plugin") != null) { - criteria.addFilterPluginName((String) request.getCriteria().getValues().get("plugin")); + if (request.getCriteria().getValues().get(PLUGIN.propertyName()) != null) { + criteria.addFilterPluginName((String) request.getCriteria().getValues().get(PLUGIN.propertyName())); }
if (request.getCriteria().getValues().get("tag") != null) { diff --cc pom.xml index dff1c40,7ff85bb..19876d2 --- a/pom.xml +++ b/pom.xml @@@ -655,10 -665,10 +666,10 @@@ <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>properties-maven-plugin</artifactId> - <executions> + <executions> <execution> <id>read-build-properties</id> - <phase>process-resources</phase> + <phase>process-sources</phase> <goals> <goal>read-project-properties</goal> </goals>
commit e0307434f51f8fd229138c556fc229e2660458f5 Merge: 5d78444... 9ace780... Author: Jay Shaughnessy jshaughn@redhat.com Date: Tue Jul 13 14:33:08 2010 -0400
Merge branch 'master' into master-jay
Conflicts: modules/enterprise/gui/portal-war/src/main/webapp/admin/config/GeneralPropertiesConfigForm.jsp modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ManagedComponentComponent.java
commit 726f1fffdafd289a82b213003e5d6b3a787ee3e9 Merge: ad4bde1... 978b418... Author: Jay Shaughnessy jshaughn@redhat.com Date: Tue Jul 13 14:29:25 2010 -0400
Merge branch 'release-3.0.0' into release-3.0.0-jay
commit ad4bde1bc7b94a5cf4e814e7e3681cf88f146d18 Author: Jay Shaughnessy jshaughn@redhat.com Date: Tue Jul 13 14:27:56 2010 -0400
trivial - fix up some comments
diff --git a/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml b/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml index b43824d..6cf784d 100644 --- a/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml +++ b/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml @@ -1518,7 +1518,7 @@
<schemaSpec version="2.60.2"> <schema-directSQL> - <!-- RHN_CHANNEL => RHQ_REPO --> + <!-- RHQ_CHANNEL => RHQ_REPO --> <statement> ALTER TABLE RHQ_CHANNEL RENAME TO RHQ_REPO </statement> @@ -1539,8 +1539,7 @@ <statement targetDBVendor="postgresql"> ALTER TABLE RHQ_REPO ADD CONSTRAINT RHQ_REPO_PKEY PRIMARY KEY ( ID ) - </statement> - <!-- RHQ_CHANNEL_CONTENT_SRC_MAP => RHQ_REPO_CONTENT_SRC_MAP --> + </statement> <statement> ALTER TABLE RHQ_CHANNEL_CONTENT_SRC_MAP RENAME TO RHQ_REPO_CONTENT_SRC_MAP @@ -3010,7 +3009,7 @@
<!-- rhq 3.0.0.final release at this point. -->
- <!-- 2.89 corrects problems in 3.0.0.final *new* instal The problems it + <!-- 2.89 corrects problems in 3.0.0.final *new* installs. The problems it fixes are not present in an upgraded db. As such, ignore any errors. --> <schemaSpec version="2.89"> @@ -3034,10 +3033,9 @@ </schemaSpec>
<!-- 2.90 corrects problems in 3.0.0.final upgrade installs. The problems it - fixes are not present in an new db. As such, ignore any errors. + fixes are not present in a new db. As such, ignore any errors. --> - <schemaSpec version="2.90"> - <!-- correct problems in rhq-3.0.0.final upgrade installs --> + <schemaSpec version="2.90"> <schema-dropSequence ignoreError="true" name="rhq_tag_id_seq" /> <schema-dropSequence ignoreError="true" name="rhq_advisory_buglist_seq" />
commit 978b418ff8f86fbaf0b0c1e60fa9a4a3a8734d23 Author: Joseph Marques joseph@redhat.com Date: Tue Jul 13 13:40:34 2010 -0400
BZ-614087, BZ-614090: fix selection/deletion of saved searches
* was incorrectly using "name (count)" to look up saved search entry instead of "name" * improve debug logging a bit
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/SearchBar.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/SearchBar.java index eb6a724..2c432d1 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/SearchBar.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/SearchBar.java @@ -80,7 +80,7 @@ public class SearchBar extends SimplePanel { private final Image arrowImage = new Image(ARROW_WHITE_URL);
private final PopupPanel savedSearchesPanel = new PopupPanel(true); - private final SavedSearchGrid savedSearches = new SavedSearchGrid(this); + private final SavedSearchGrid savedSearchesGrid = new SavedSearchGrid(this);
private String currentSearch = ""; private long lastNameFieldBlurTime = 0; @@ -268,9 +268,9 @@ public class SearchBar extends SimplePanel { }
private void setupSavedSearches() { - savedSearchesPanel.add(savedSearches); + savedSearchesPanel.add(savedSearchesGrid); savedSearchesPanel.setStyleName("savedSearchesPanel"); - savedSearches.addStyleName("savedSearchesPanel"); + savedSearchesGrid.addStyleName("savedSearchesPanel");
// panel position will be re-calculated on down-arrow click savedSearchesPanel.show(); @@ -278,7 +278,7 @@ public class SearchBar extends SimplePanel {
SavedSearchesEventHandler handler = new SavedSearchesEventHandler(); savedSearchesPanel.addCloseHandler(handler); - savedSearches.setPatternSelectionHandler(handler); + savedSearchesGrid.setPatternSelectionHandler(handler); }
private void turnNameFieldIntoLabel() { @@ -438,7 +438,7 @@ public class SearchBar extends SimplePanel {
class ArrowImageEventHandler implements ClickHandler { public void onClick(ClickEvent event) { - savedSearches.updateModel(); + savedSearchesGrid.updateModel(); int left = autoCompletePatternField.getAbsoluteLeft(); int top = autoCompletePatternField.getAbsoluteTop() + autoCompletePatternField.getOffsetHeight(); savedSearchesPanel.setPopupPosition(left, top + 5); @@ -453,6 +453,8 @@ public class SearchBar extends SimplePanel { }
public void handleSelection(int rowIndex, int columnIndex, String patternName) { + SearchLogger.debug("SavedSearchesEventHandler.handleSelection(" + rowIndex + "," + columnIndex + "," + + patternName + ")"); if (columnIndex == 1) { savedSearchManager.removePatternByName(patternName);
@@ -471,7 +473,7 @@ public class SearchBar extends SimplePanel { savedSearchesPanel.hide(); }
- savedSearches.removeRow(rowIndex); + savedSearchesGrid.removeRow(rowIndex); } else { activateSavedSearch(patternName); // activating the saved search also clicks the button } @@ -487,6 +489,7 @@ public class SearchBar extends SimplePanel { currentSearch = ""; String patternValue = savedSearchManager.getPatternByName(savedSearchName); if (patternValue == null) { + SearchLogger.debug("activeSavedSearch: no pattern known for saved search named '" + savedSearchName + "'"); return; // no saved search existing with the specified name } autoCompletePatternField.setValue(patternValue, true); diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/SearchLogger.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/SearchLogger.java index f15dcc9..9ac8bed 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/SearchLogger.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/SearchLogger.java @@ -1,7 +1,9 @@ package org.rhq.enterprise.gui.coregui.client.search;
+import com.google.gwt.core.client.GWT; + public class SearchLogger { public static void debug(String message) { - System.out.println(message); + GWT.log("SearchBar: " + message); } } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/favorites/SavedSearchGrid.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/favorites/SavedSearchGrid.java index 15aa671..ee7647b 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/favorites/SavedSearchGrid.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/favorites/SavedSearchGrid.java @@ -27,6 +27,7 @@ import com.google.gwt.user.client.ui.Grid;
import org.rhq.core.domain.search.SavedSearch; import org.rhq.enterprise.gui.coregui.client.search.SearchBar; +import org.rhq.enterprise.gui.coregui.client.search.SearchLogger;
/** * @author Joseph Marques @@ -87,6 +88,7 @@ public class SavedSearchGrid extends Grid { int startIndex = text.indexOf('>') + 1; int endIndex = text.toLowerCase().indexOf("</span>", startIndex); String patternName = text.substring(startIndex, endIndex); + SearchLogger.debug("Selected '" + patternName + " at row=" + rowIndex + ", col=" + columnIndex); patternSelectionHandler.handleSelection(rowIndex, columnIndex, patternName); if (columnIndex == 0) { onRowOut(tr); @@ -136,12 +138,11 @@ public class SavedSearchGrid extends Grid { }
private static String stylize(SavedSearch savedSearch) { - String header = savedSearch.getName(); - if (savedSearch.getResultCount() != null) { - header += " (" + savedSearch.getResultCount() + ")"; - } - return "<span class="savedSearchesPanel-top">" + header + "</span>" + "<br/>" // - + "<span class="savedSearchesPanel-bottom">" + savedSearch.getPattern() + "</span>"; + String name = savedSearch.getName(); + String pattern = savedSearch.getPattern(); + String count = savedSearch.getResultCount() == null ? "" : String.valueOf(savedSearch.getResultCount()); + return "<span class="savedSearchesPanel-top">" + name + "</span> " + count + "<br/>" // + + "<span class="savedSearchesPanel-bottom">" + pattern + "</span>"; }
private static String trashify() {
commit 31d8a14d352f9caae312b82ae5149d9b808027e7 Author: Joseph Marques joseph@redhat.com Date: Tue Jul 13 13:04:28 2010 -0400
remove main method
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/favorites/SavedSearchGrid.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/favorites/SavedSearchGrid.java index c6bea22..15aa671 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/favorites/SavedSearchGrid.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/favorites/SavedSearchGrid.java @@ -155,10 +155,4 @@ public class SavedSearchGrid extends Grid { public String getSelectedItem() { return ""; } - - public static void main(String[] args) { - Grid grid = new Grid(); - grid.clear(true); - - } }
commit 753e6988ea79857a00a6d90b0c4b0887fe63fdff Author: Joseph Marques joseph@redhat.com Date: Tue Jul 13 13:01:31 2010 -0400
add missing quote for attribute
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseGroups.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseGroups.xhtml index 9a0a83e..a132a39 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseGroups.xhtml +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseGroups.xhtml @@ -54,7 +54,7 @@ actionListener="#{BrowseGroupsUIBean.clearDataModel}" styleClass="buttonmed" similarityGroupingId="searchRequest" - requestDelay=50" + requestDelay="50" ignoreDupResponses="true" onclick="applySearchFilter(getElementCrossBrowser('patternField').value);"> <s:defaultAction/>
commit 965da8b99fea42c04bc8dc07cb54b405daa13a3d Author: Joseph Marques joseph@redhat.com Date: Tue Jul 13 12:36:04 2010 -0400
BZ-610228: allow search expression errors to bubble up to the inventory browser
* create new SearchExpressionException runtime exception class * update RHQL.g grammar file, short-cut and throw SearchExpressionException on error * allow CriteriaQueryGenerator to directly pass SearchExpressionExceptions up to the caller * update the inventory browser layout file to use rich:messages to show ajax-errors * add inventoryBrowserErrorPanel to list of rerendered objects when invoking resource/group search ** (Note: 'requestDelay' attribute is required, otherwise msg is sometimes lost) * add exception handlers in Browse(Resource|Group)UIBean.fetchDataForPage to add appropriate faces message on error
diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/browse/BrowseGroupsUIBean.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/browse/BrowseGroupsUIBean.java index 5c3368f..382e5e7 100644 --- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/browse/BrowseGroupsUIBean.java +++ b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/browse/BrowseGroupsUIBean.java @@ -66,19 +66,25 @@ public class BrowseGroupsUIBean extends PagedDataTableUIBean { }
public PageList<ResourceGroupComposite> fetchPage(PageControl pc) { - String search = getSearch(); - GroupCategory category = getCategory(); - - ResourceGroupCriteria criteria = new ResourceGroupCriteria(); - criteria.setPageControl(pc); - if (search != null && !search.trim().equals("")) { - criteria.setSearchExpression(search); + try { + String search = getSearch(); + GroupCategory category = getCategory(); + + ResourceGroupCriteria criteria = new ResourceGroupCriteria(); + criteria.setPageControl(pc); + if (search != null && !search.trim().equals("")) { + criteria.setSearchExpression(search); + } + criteria.addFilterGroupCategory(category); + + PageList<ResourceGroupComposite> results; + results = groupManager.findResourceGroupCompositesByCriteria(getSubject(), criteria); + return results; + } catch (Throwable t) { + FacesContextUtility.addMessage(FacesMessage.SEVERITY_ERROR, "Failed to fetch results: " + + t.getMessage()); + return new PageList<ResourceGroupComposite>(pc); } - criteria.addFilterGroupCategory(category); - - PageList<ResourceGroupComposite> results; - results = groupManager.findResourceGroupCompositesByCriteria(getSubject(), criteria); - return results; } }
diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/browse/BrowseResourcesUIBean.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/browse/BrowseResourcesUIBean.java index d499979..be5a302 100644 --- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/browse/BrowseResourcesUIBean.java +++ b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/inventory/browse/BrowseResourcesUIBean.java @@ -76,21 +76,27 @@ public class BrowseResourcesUIBean extends PagedDataTableUIBean { }
public PageList<ResourceComposite> fetchDataForPage(PageControl pc) { - String search = getSearch(); - ResourceCategory category = getCategory(); - - ResourceCriteria criteria = new ResourceCriteria(); - criteria.setPageControl(pc); - criteria.addFilterResourceCategory(category); - if (search != null && !search.trim().equals("")) { - criteria.setSearchExpression(search); + try { + String search = getSearch(); + ResourceCategory category = getCategory(); + + ResourceCriteria criteria = new ResourceCriteria(); + criteria.setPageControl(pc); + criteria.addFilterResourceCategory(category); + if (search != null && !search.trim().equals("")) { + criteria.setSearchExpression(search); + } + // lineage info is now provided by the disambiguation stuff + // criteria.fetchParentResource(true); + + PageList<ResourceComposite> results; + results = resourceManager.findResourceCompositesByCriteria(getSubject(), criteria); + return results; + } catch (Throwable t) { + FacesContextUtility.addMessage(FacesMessage.SEVERITY_ERROR, "Failed to fetch results: " + + t.getMessage()); + return new PageList<ResourceComposite>(pc); } - // lineage info is now provided by the disambiguation stuff - // criteria.fetchParentResource(true); - - PageList<ResourceComposite> results; - results = resourceManager.findResourceCompositesByCriteria(getSubject(), criteria); - return results; }
protected IntExtractor<ResourceComposite> getResourceIdExtractor() { diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseGroups.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseGroups.xhtml index 399ab6a..9a0a83e 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseGroups.xhtml +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseGroups.xhtml @@ -49,10 +49,13 @@ </ui:include>
<a4j:commandButton id="searchButtonJSF" value="GO" - reRender="browseGroupsDataTable, browseGroupsDataTableScroller" + reRender="browseGroupsDataTable, browseGroupsDataTableScroller, inventoryBrowserErrorPanel" status="commonStatus" actionListener="#{BrowseGroupsUIBean.clearDataModel}" styleClass="buttonmed" + similarityGroupingId="searchRequest" + requestDelay=50" + ignoreDupResponses="true" onclick="applySearchFilter(getElementCrossBrowser('patternField').value);"> <s:defaultAction/> </a4j:commandButton> diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseResources.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseResources.xhtml index fc6741e..4bfb91a 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseResources.xhtml +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseResources.xhtml @@ -50,10 +50,13 @@ </ui:include>
<a4j:commandButton id="searchButtonJSF" value="GO" - reRender="browseResourcesDataTable, browseResourcesDataTableScroller" + reRender="browseResourcesDataTable, browseResourcesDataTableScroller, inventoryBrowserErrorPanel" status="commonStatus" actionListener="#{BrowseResourcesUIBean.clearDataModel}" styleClass="buttonmed" + similarityGroupingId="searchRequest" + requestDelay="50" + ignoreDupResponses="true" onclick="applySearchFilter(getElementCrossBrowser('patternField').value);"> <s:defaultAction/> </a4j:commandButton> diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/layout/main.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/layout/main.xhtml index ceb1d3e..0b67eae 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/layout/main.xhtml +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/layout/main.xhtml @@ -29,13 +29,6 @@
<ui:define name="tabBar">
- a4j:region - <h:form> - <a4j:poll interval="60000" timeout="5000" - reRender="browserTabBarPanel" status="commonStatus" /> - </h:form> - </a4j:region> - <onc:tabBar id="browserTabBarPanel" selectedTabName="#{selectedTabName}" > <onc:tab name="Resources" displayName="Resources #{InventorySummaryUIBean.resourceCount}" @@ -75,15 +68,16 @@
<p />
- <h:messages showSummary="true" - showDetail="true" - infoClass="InfoBlock" - warnClass="WarnBlock" - errorClass="ErrorBlock" - fatalClass="FatalBlock" - globalOnly="false" - layout="table" - width="100%"/> + <rich:messages id="inventoryBrowserErrorPanel" + showSummary="true" + showDetail="true" + infoClass="InfoBlock" + warnClass="WarnBlock" + errorClass="ErrorBlock" + fatalClass="FatalBlock" + globalOnly="false" + layout="table" + width="100%"/> </ui:define>
<ui:define name="content"> diff --git a/modules/enterprise/server/jar/src/main/antlr3/org/rhq/enterprise/server/search/RHQL.g b/modules/enterprise/server/jar/src/main/antlr3/org/rhq/enterprise/server/search/RHQL.g index 0769fd6..899b07e 100644 --- a/modules/enterprise/server/jar/src/main/antlr3/org/rhq/enterprise/server/search/RHQL.g +++ b/modules/enterprise/server/jar/src/main/antlr3/org/rhq/enterprise/server/search/RHQL.g @@ -72,6 +72,13 @@ tokens { package org.rhq.enterprise.server.search; }
+@parser::members { + @Override + public void reportError(RecognitionException e) { + throw new org.rhq.enterprise.server.search.SearchExpressionException("search pattern error"); + } +} +
/* * parser rules diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/SearchExpressionException.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/SearchExpressionException.java new file mode 100644 index 0000000..dc1a91e --- /dev/null +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/SearchExpressionException.java @@ -0,0 +1,47 @@ +/* + * RHQ Management Platform + * Copyright (C) 2005-2008 Red Hat, Inc. + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ +package org.rhq.enterprise.server.search; + +/** + * An exception to be ignored by the PagedListDataModel when fetching the page in a guarded fashion, + * so that the first time an exception occurs it is allowed to bubble up to the surface. This exception + * is generated by the antlr-based parser upon capturing a RecognitionException from the lexer. + * + * @author Joseph Marques + */ +public class SearchExpressionException extends RuntimeException { + + private static final long serialVersionUID = 1L; + + public SearchExpressionException() { + } + + public SearchExpressionException(String message) { + super(message); + } + + public SearchExpressionException(Throwable cause) { + super(cause); + } + + public SearchExpressionException(String message, Throwable cause) { + super(message, cause); + } + +} diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/CriteriaQueryGenerator.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/CriteriaQueryGenerator.java index 459d7d4..a1b809f 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/CriteriaQueryGenerator.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/CriteriaQueryGenerator.java @@ -52,6 +52,7 @@ import org.rhq.core.domain.util.PageControl; import org.rhq.core.domain.util.PageOrdering; import org.rhq.core.server.PersistenceUtility; import org.rhq.core.util.exception.ThrowableUtil; +import org.rhq.enterprise.server.search.SearchExpressionException; import org.rhq.enterprise.server.search.execution.SearchTranslationManager;
/** @@ -533,9 +534,12 @@ public final class CriteriaQueryGenerator { if (translatedJPQL != null) { searchExpressionWhereClause = translatedJPQL; } + } catch (SearchExpressionException see) { + throw see; // bubble up to the top } catch (Exception e) { LOG.error("Could not get JPQL translation for '" + searchExpression + "': " + ThrowableUtil.getAllMessages(e, true)); + throw new RuntimeException(e); } }
commit a52cd12da95dd8433d4d2f9b1df1e1bc1a212c36 Author: Joseph Marques joseph@redhat.com Date: Tue Jul 13 12:29:17 2010 -0400
cache user preferences uibean in the page
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/menu/menu.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/menu/menu.xhtml index f767b5a..2c4e779 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/menu/menu.xhtml +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/menu/menu.xhtml @@ -647,6 +647,8 @@ v <rich:menuItem submitMode="none" <input type="button" value="Close" onclick="Richfaces.hideModalPanel('aboutPanel');"/> </rich:modalPanel>
+<a4j:keepAlive beanName="UserPreferencesUIBean"/> + </h:form>
commit af7bc88bdaca80ebdbd1fc7efdba2cbb6b529538 Author: Joseph Marques joseph@redhat.com Date: Tue Jul 13 12:28:53 2010 -0400
do not propogate faces messages for ajax requests
diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/common/framework/FacesMessagePropogationPhaseListener.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/common/framework/FacesMessagePropogationPhaseListener.java index f98ea9a..d1fbc83 100644 --- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/common/framework/FacesMessagePropogationPhaseListener.java +++ b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/common/framework/FacesMessagePropogationPhaseListener.java @@ -30,6 +30,7 @@ import javax.faces.event.PhaseEvent; import javax.faces.event.PhaseId; import javax.faces.event.PhaseListener;
+import org.ajax4jsf.context.AjaxContext; import org.jetbrains.annotations.Nullable;
import org.jboss.seam.core.Manager; @@ -50,6 +51,10 @@ public class FacesMessagePropogationPhaseListener implements PhaseListener { }
public void beforePhase(PhaseEvent event) { + if (AjaxContext.getCurrentInstance().isAjaxRequest()) { + return; + } + PhaseId phaseId = event.getPhaseId(); if (phaseId == PhaseId.RESTORE_VIEW) { // We want to add the saved messages back to the context immediately after the view is restored. @@ -61,6 +66,10 @@ public class FacesMessagePropogationPhaseListener implements PhaseListener { }
public void afterPhase(PhaseEvent event) { + if (AjaxContext.getCurrentInstance().isAjaxRequest()) { + return; + } + PhaseId phaseId = event.getPhaseId(); if (phaseId == PhaseId.INVOKE_APPLICATION) { // We want to store the messages in the context after the application has done its processing.
commit f96d9462ee44c169a720f8deb80e4703dd60d0ad Author: Lukas Krejci lkrejci@redhat.com Date: Tue Jul 13 17:17:50 2010 +0200
BZ 612189 - reverting the resource keys of apache server and vhost resource types to the format used in the last released version of JON.
diff --git a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheServerDiscoveryComponent.java b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheServerDiscoveryComponent.java index edffb23..9c2e448 100644 --- a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheServerDiscoveryComponent.java +++ b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheServerDiscoveryComponent.java @@ -220,8 +220,18 @@ public class ApacheServerDiscoveryComponent implements ResourceDiscoveryComponen name = uri.getHost() + ":" + uri.getPort(); }
+ String serverRoot = pluginConfig.getSimple(ApacheServerComponent.PLUGIN_CONFIG_PROP_SERVER_ROOT) + .getStringValue(); + + String key = FileUtils.getCanonicalPath(serverRoot); + + //BZ 612189 - reverting to the serverRoot as the resource key temporarily until we have the resource + //upgrade functionality ready (BZ 592038). Uncommenting the line below will make the resource key totally unique + //(see BZ 593270). + //key += "|" + httpdConf; + DiscoveredResourceDetails resourceDetails = new DiscoveredResourceDetails(discoveryContext.getResourceType(), - httpdConf, name, version, PRODUCT_DESCRIPTION, pluginConfig, processInfo); + key, name, version, PRODUCT_DESCRIPTION, pluginConfig, processInfo); log.debug("Apache Server resource details created: " + resourceDetails); return resourceDetails; } diff --git a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheVirtualHostServiceComponent.java b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheVirtualHostServiceComponent.java index 73d6ee5..d97d9fc 100644 --- a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheVirtualHostServiceComponent.java +++ b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheVirtualHostServiceComponent.java @@ -71,7 +71,7 @@ import org.rhq.plugins.www.util.WWWUtils; */ public class ApacheVirtualHostServiceComponent implements ResourceComponent<ApacheServerComponent>, MeasurementFacet, ConfigurationFacet, DeleteResourceFacet, CreateChildResourceFacet { - private final Log log = LogFactory.getLog(this.getClass()); + private static final Log log = LogFactory.getLog(ApacheVirtualHostServiceComponent.class);
public static final String URL_CONFIG_PROP = "url"; public static final String MAIN_SERVER_RESOURCE_KEY = "MainServer"; @@ -473,6 +473,77 @@ public class ApacheVirtualHostServiceComponent implements ResourceComponent<Apac return oid; }
+ public static int getMatchingWwwServiceIndex(ApacheServerComponent parent, String resourceKey, List<SNMPValue> names, List<SNMPValue> ports) { + int ret = -1; + Iterator<SNMPValue> namesIterator = names.iterator(); + Iterator<SNMPValue> portsIterator = ports.iterator(); + + //figure out the servername and addresses of this virtual host + //from the resource key. + String vhostServerName = null; + String[] vhostAddressStrings = null; + int pipeIdx = resourceKey.indexOf('|'); + if (pipeIdx >= 0) { + vhostServerName = resourceKey.substring(0, pipeIdx); + } + vhostAddressStrings = resourceKey.substring(pipeIdx + 1).split(" "); + + ApacheDirectiveTree tree = parent.loadParser(); + + //convert the vhost addresses into fully qualified ip/port addresses + List<HttpdAddressUtility.Address> vhostAddresses = new ArrayList<HttpdAddressUtility.Address>( + vhostAddressStrings.length); + + if (vhostAddressStrings.length == 1 && MAIN_SERVER_RESOURCE_KEY.equals(vhostAddressStrings[0])) { + HttpdAddressUtility.Address serverAddr = parent.getAddressUtility().getMainServerSampleAddress(tree, null, 0); + if (serverAddr != null) { + vhostAddresses.add(serverAddr); + } + } else { + for (int i = 0; i < vhostAddressStrings.length; ++i) { + HttpdAddressUtility.Address vhostAddr = parent.getAddressUtility().getVirtualHostSampleAddress(tree, vhostAddressStrings[i], + vhostServerName, true); + if (vhostAddr != null) { + vhostAddresses.add(vhostAddr); + } + } + } + + //finding the snmp index that corresponds to the address(es) of the vhost isn't that simple + //because the snmp module in apache always resolves the IPs to hostnames. + //on the other hand, the resource key tries to be more accurate about what a + //vhost can actually be represented as. A vhost is represented by at most 1 hostname (i.e. ServerName) + //and possibly multiple IP addresses. + SNMPValue bestMatch = null; + int bestMatchRate = 0; + + while (namesIterator.hasNext()) { + SNMPValue nameValue = namesIterator.next(); + SNMPValue portValue = portsIterator.next(); + + String snmpHost = nameValue.toString(); + String fullPort = portValue.toString(); + + int snmpPort = Integer.parseInt(fullPort.substring(fullPort.lastIndexOf(".") + 1)); + + HttpdAddressUtility.Address snmpAddress = new HttpdAddressUtility.Address(snmpHost, snmpPort); + + int matchRate = matchRate(vhostAddresses, snmpAddress); + if (matchRate > bestMatchRate) { + bestMatch = nameValue; + bestMatchRate = matchRate; + } + } + + if (bestMatch != null) { + String nameOID = bestMatch.getOID(); + ret = Integer.parseInt(nameOID.substring(nameOID.lastIndexOf(".") + 1)); + } else { + log.warn("Unable to match the Virtual Host [" + resourceKey + "] with any of the SNMP advertised vhosts: " + names + ". It won't be possible to monitor the Virtual Host."); + } + return ret; + } + /** * @return the index of the virtual host that identifies it in SNMP * @throws Exception on SNMP error @@ -494,79 +565,13 @@ public class ApacheVirtualHostServiceComponent implements ResourceComponent<Apac
names = snmpSession.getColumn(SNMPConstants.COLUMN_VHOST_NAME); ports = snmpSession.getColumn(SNMPConstants.COLUMN_VHOST_PORT); - Iterator<SNMPValue> namesIterator = names.iterator(); - Iterator<SNMPValue> portsIterator = ports.iterator(); - - //figure out the servername and addresses of this virtual host - //from the resource key. - String vhostServerName = null; - String[] vhostAddressStrings = null; - String key = resourceContext.getResourceKey(); - int pipeIdx = key.indexOf('|'); - if (pipeIdx >= 0) { - vhostServerName = key.substring(0, pipeIdx); - } - vhostAddressStrings = key.substring(pipeIdx + 1).split(" "); - - ApacheDirectiveTree tree = loadParser();
- //convert the vhost addresses into fully qualified ip/port addresses - List<HttpdAddressUtility.Address> vhostAddresses = new ArrayList<HttpdAddressUtility.Address>( - vhostAddressStrings.length); - - ApacheServerComponent parent = resourceContext.getParentResourceComponent(); - if (vhostAddressStrings.length == 1 && MAIN_SERVER_RESOURCE_KEY.equals(vhostAddressStrings[0])) { - HttpdAddressUtility.Address serverAddr = parent.getAddressUtility().getMainServerSampleAddress(tree, null, 0); - if (serverAddr != null) { - vhostAddresses.add(serverAddr); - } - } else { - for (int i = 0; i < vhostAddressStrings.length; ++i) { - HttpdAddressUtility.Address vhostAddr = parent.getAddressUtility().getVirtualHostSampleAddress(tree, vhostAddressStrings[i], - vhostServerName, true); - if (vhostAddr != null) { - vhostAddresses.add(vhostAddr); - } - } - } - - //finding the snmp index that corresponds to the address(es) of the vhost isn't that simple - //because the snmp module in apache always resolves the IPs to hostnames. - //on the other hand, the resource key tries to be more accurate about what a - //vhost can actually be represented as. A vhost is represented by at most 1 hostname (i.e. ServerName) - //and possibly multiple IP addresses. - SNMPValue bestMatch = null; - int bestMatchRate = 0; - - while (namesIterator.hasNext()) { - SNMPValue nameValue = namesIterator.next(); - SNMPValue portValue = portsIterator.next(); - - String snmpHost = nameValue.toString(); - String fullPort = portValue.toString(); - - int snmpPort = Integer.parseInt(fullPort.substring(fullPort.lastIndexOf(".") + 1)); - - HttpdAddressUtility.Address snmpAddress = new HttpdAddressUtility.Address(snmpHost, snmpPort); - - int matchRate = matchRate(vhostAddresses, snmpAddress); - if (matchRate > bestMatchRate) { - bestMatch = nameValue; - bestMatchRate = matchRate; - } - } - - if (bestMatch != null) { - String nameOID = bestMatch.getOID(); - snmpWwwServiceIndex = Integer.parseInt(nameOID.substring(nameOID.lastIndexOf(".") + 1)); - } else { - log.warn("Unable to match the Virtual Host [" + key + "] with any of the SNMP advertised vhosts: " + names + ". It won't be possible to monitor the Virtual Host."); - } + snmpWwwServiceIndex = getMatchingWwwServiceIndex(resourceContext.getParentResourceComponent(), resourceContext.getResourceKey(), names, ports); } return snmpWwwServiceIndex; }
- private int matchRate(List<HttpdAddressUtility.Address> addresses, HttpdAddressUtility.Address addressToCheck) { + private static int matchRate(List<HttpdAddressUtility.Address> addresses, HttpdAddressUtility.Address addressToCheck) { for(HttpdAddressUtility.Address a : addresses) { if (HttpdAddressUtility.isAddressConforming(addressToCheck, a.host, a.port, true)) { return 3; diff --git a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheVirtualHostServiceDiscoveryComponent.java b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheVirtualHostServiceDiscoveryComponent.java index b308dd4..4a32e27 100644 --- a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheVirtualHostServiceDiscoveryComponent.java +++ b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheVirtualHostServiceDiscoveryComponent.java @@ -38,6 +38,9 @@ import org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext; import org.rhq.plugins.apache.parser.ApacheDirective; import org.rhq.plugins.apache.parser.ApacheDirectiveTree; import org.rhq.plugins.apache.util.HttpdAddressUtility.Address; +import org.rhq.plugins.www.snmp.SNMPException; +import org.rhq.plugins.www.snmp.SNMPSession; +import org.rhq.plugins.www.snmp.SNMPValue;
/** * Discovers VirtualHosts under the Apache server by reading them out from Augeas tree constructed @@ -62,10 +65,14 @@ public class ApacheVirtualHostServiceDiscoveryComponent implements ResourceDisco
Set<DiscoveredResourceDetails> discoveredResources = new LinkedHashSet<DiscoveredResourceDetails>();
+ //BZ 612189 - prepare for the legacy overrides. We need to revert to the old-style resource keys until + //resource upgrade functionality is ready. + SnmpWwwServiceIndexes snmpDiscoveries = getSnmpDiscoveries(context); + ApacheServerComponent serverComponent = context.getParentResourceComponent(); ApacheDirectiveTree tree = serverComponent.loadParser(); //first define the root server as one virtual host - discoverMainServer(context, discoveredResources); + discoverMainServer(context, discoveredResources, snmpDiscoveries);
ResourceType resourceType = context.getResourceType();
@@ -146,6 +153,12 @@ public class ApacheVirtualHostServiceDiscoveryComponent implements ResourceDisco resourceName = resourceKey; }
+ //BZ 612189 - remove this once we have resource upgrade + if (snmpDiscoveries != null) { + String legacyResourceKey = getLegacyResourceKey(context, resourceKey, snmpDiscoveries); + resourceKey = legacyResourceKey != null ? legacyResourceKey : resourceKey; + } + discoveredResources.add(new DiscoveredResourceDetails(resourceType, resourceKey, resourceName, null, null, pluginConfiguration, null)); } @@ -155,7 +168,7 @@ public class ApacheVirtualHostServiceDiscoveryComponent implements ResourceDisco
private void discoverMainServer(ResourceDiscoveryContext<ApacheServerComponent> context, - Set<DiscoveredResourceDetails> discoveredResources) throws Exception { + Set<DiscoveredResourceDetails> discoveredResources, SnmpWwwServiceIndexes snmpDiscoveries) throws Exception {
ResourceType resourceType = context.getResourceType(); Configuration mainServerPluginConfig = context.getDefaultPluginConfiguration(); @@ -185,9 +198,101 @@ public class ApacheVirtualHostServiceDiscoveryComponent implements ResourceDisco mainServerPluginConfig.put(rtLogProp); }
+ String key = ApacheVirtualHostServiceComponent.MAIN_SERVER_RESOURCE_KEY; + + //BZ 612189 - remove this once we have resource upgrade + if (snmpDiscoveries != null) { + String legacyKey = getLegacyResourceKey(context, key, snmpDiscoveries); + key = legacyKey != null ? legacyKey : key; + } + DiscoveredResourceDetails mainServer = new DiscoveredResourceDetails(resourceType, - ApacheVirtualHostServiceComponent.MAIN_SERVER_RESOURCE_KEY, "Main", null, null, + key, "Main", null, null, mainServerPluginConfig, null); discoveredResources.add(mainServer); } + + /** + * @deprecated remove this once we have resource upgrade + * @param discoveryContext + * @param newStyleResourceKey + * @param snmpDiscoveries + * @return + */ + @Deprecated + private String getLegacyResourceKey(ResourceDiscoveryContext<ApacheServerComponent> discoveryContext, String newStyleResourceKey, SnmpWwwServiceIndexes snmpDiscoveries) { + int snmpWwwServiceIndex = ApacheVirtualHostServiceComponent.getMatchingWwwServiceIndex(discoveryContext.getParentResourceComponent(), newStyleResourceKey, snmpDiscoveries.names, snmpDiscoveries.ports); + + if (snmpWwwServiceIndex < 1) { + return null; + } else { + String host = snmpDiscoveries.names.get(snmpWwwServiceIndex - 1).toString(); + String fullPort = snmpDiscoveries.ports.get(snmpWwwServiceIndex - 1).toString(); + + // The port value will be in the form "1.3.6.1.2.1.6.XXXXX", + // where "1.3.6.1.2.1.6" represents the TCP protocol ID, + // and XXXXX is the actual port number + String port = fullPort.substring(fullPort.lastIndexOf(".") + 1); + return host + ":" + port; + } + } + + /** + * @deprecated remove this once we have resource upgrade + * @param discoveryContext + * @return + */ + @Deprecated + private SnmpWwwServiceIndexes getSnmpDiscoveries(ResourceDiscoveryContext<ApacheServerComponent> discoveryContext) { + try { + SNMPSession snmpSession = discoveryContext.getParentResourceComponent().getSNMPSession(); + List<SNMPValue> nameValues; + List<SNMPValue> portValues; + SNMPValue descValue; + + try { + nameValues = snmpSession.getColumn(SNMPConstants.COLUMN_VHOST_NAME); + } catch (SNMPException e) { + throw new Exception( + "Error getting SNMP column: " + SNMPConstants.COLUMN_VHOST_NAME + ": " + e.getMessage(), e); + } + + try { + portValues = snmpSession.getColumn(SNMPConstants.COLUMN_VHOST_PORT); + } catch (SNMPException e) { + throw new Exception( + "Error getting SNMP column: " + SNMPConstants.COLUMN_VHOST_PORT + ": " + e.getMessage(), e); + } + + try { + // Just get the first one - they are all the same. + descValue = snmpSession.getNextValue(SNMPConstants.COLUMN_VHOST_DESC); + } catch (SNMPException e) { + throw new Exception("Error getting SNMP value: " + SNMPConstants.COLUMN_VHOST_DESC + ": " + e.getMessage(), + e); + } + + SnmpWwwServiceIndexes ret = new SnmpWwwServiceIndexes(); + ret.names = nameValues; + ret.ports = portValues; + ret.desc = descValue; + + return ret; + } catch (Exception e) { + log.warn("Error while trying to contact SNMP of the apache server " + discoveryContext.getParentResourceContext().getResourceKey()); + return null; + } + } + + /** + * @deprecated remove this once we have resource upgrade + * + * @author Lukas Krejci + */ + @Deprecated + private static class SnmpWwwServiceIndexes { + public List<SNMPValue> names; + public List<SNMPValue> ports; + public SNMPValue desc; + } } \ No newline at end of file
commit 282c87996fc5bd73f293086cf730d0be9922e025 Merge: 1d91fa3... 57a0a39... Author: Jay Shaughnessy jshaughn@redhat.com Date: Tue Jul 13 11:09:29 2010 -0400
Merge branch 'release-3.0.0' into release-3.0.0-jay
commit 57a0a3942317494496b730708279fae1dbc45347 Author: Lukas Krejci lkrejci@redhat.com Date: Tue Jul 13 12:50:19 2010 +0200
BZ 604032 - Adding a little bit of margin between resource type and resource name in the disambiguated lists.
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/css/win.css b/modules/enterprise/gui/portal-war/src/main/webapp/css/win.css index 6859fe2..e6ad8cc 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/css/win.css +++ b/modules/enterprise/gui/portal-war/src/main/webapp/css/win.css @@ -2375,6 +2375,7 @@ ul.radio-group .unspecified { /* Disambiguated resources formatting */ .disambiguated-resource-type { font-style: italic; + margin-right: 0.4em; }
.disambiguated-resource-plugin {
commit 9ace7803d6e7bc59babd06687a7c51ce3b331e61 Author: Heiko W. Rupp hwr@pilhuhn.de Date: Tue Jul 13 09:46:04 2010 +0200
Add a new simple bundle generator. This obviously has room for improvement.
diff --git a/modules/helpers/bundleGen/pom.xml b/modules/helpers/bundleGen/pom.xml new file mode 100644 index 0000000..465a9eb --- /dev/null +++ b/modules/helpers/bundleGen/pom.xml @@ -0,0 +1,79 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd%22%3E + <parent> + <artifactId>rhq-helpers</artifactId> + <groupId>org.rhq.helpers</groupId> + <version>4.0.0-SNAPSHOT</version> + </parent> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.rhq.helpers</groupId> + <artifactId>bundleGen</artifactId> + <version>4.0.0-SNAPSHOT</version> + + <build> + <plugins> + + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-jar-plugin</artifactId> + <version>2.2</version> + <configuration> + <archive> + <manifest> + <mainClass>org.rhq.helpers.bundleGen.BundleGen</mainClass> + <packageName>org.rhq.helpers.bundleGen</packageName> + </manifest> + </archive> + </configuration> + </plugin> + + <plugin> + <artifactId>maven-assembly-plugin</artifactId> + <configuration> + <descriptorRefs> + <descriptorRef>jar-with-dependencies</descriptorRef> + </descriptorRefs> + <archive> + <manifest> + <mainClass>org.rhq.helpers.bundleGen.BundleGen</mainClass> + </manifest> + </archive> + </configuration> + <executions> + <execution> + <id>make-assembly</id> <!-- this is used for inheritance merges --> + <phase>package</phase> <!-- append to the packaging phase. --> + <goals> + <goal>attached</goal> <!-- goals == mojos --> + </goals> + </execution> + </executions> + </plugin> + </plugins> + + </build> + + <dependencies> + <dependency> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + <version>1.1</version> + </dependency> + + <dependency> + <groupId>org.freemarker</groupId> + <artifactId>freemarker</artifactId> + <version>2.3.11</version> + </dependency> + <dependency> + <groupId>${rhq.groupId}</groupId> + <artifactId>rhq-core-util</artifactId> + <version>${project.version}</version> + </dependency> + </dependencies> + + +</project> \ No newline at end of file diff --git a/modules/helpers/bundleGen/src/main/java/org/rhq/helpers/bundleGen/BundleGen.java b/modules/helpers/bundleGen/src/main/java/org/rhq/helpers/bundleGen/BundleGen.java new file mode 100644 index 0000000..289b36f --- /dev/null +++ b/modules/helpers/bundleGen/src/main/java/org/rhq/helpers/bundleGen/BundleGen.java @@ -0,0 +1,167 @@ +/* + * RHQ Management Platform + * Copyright (C) 2005-2009 Red Hat, Inc. + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ +package org.rhq.helpers.bundleGen; + +import java.io.BufferedReader; +import java.io.BufferedWriter; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.FileWriter; +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.Writer; +import java.text.MessageFormat;import java.util.HashMap; +import java.util.Map; +import java.util.ResourceBundle; +import java.util.zip.ZipEntry; +import java.util.zip.ZipOutputStream; + +import freemarker.cache.ClassTemplateLoader; +import freemarker.cache.MultiTemplateLoader; +import freemarker.cache.TemplateLoader; +import freemarker.template.Configuration; +import freemarker.template.Template; +import freemarker.template.TemplateException; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +import org.rhq.core.util.stream.StreamUtil; + +/** + * Main class of a (simple) bundle creator + * @author Heiko W. Rupp + */ +public class BundleGen { + + private final Log log = LogFactory.getLog(BundleGen.class); + + public static void main(String[] args) throws Exception { + BundleGen bg = new BundleGen(); + bg.run(); + } + + + private void run() { + + ResourceBundle resourceBundle = ResourceBundle.getBundle("bundleGen"); + Props props = new Props(); + BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); + + // Ask the user + XmlQuestionsReader xqr = new XmlQuestionsReader("bundleQuestions"); + try { + xqr.readQuestions(br,props); + } catch (Exception e) { + log.error(e.getMessage()); + return; + } + + String bundleTargetDirectory = "/tmp"; // TODO ask user? + + String tmpDirPath = System.getProperty("java.io.tmpdir"); + log.debug("Java Tmp dir is " + tmpDirPath); + + String genPath = tmpDirPath + "/" + "bundleGen"; + File tmpDir = new File(genPath); // TODO path separator + if (!tmpDir.exists() && !tmpDir.mkdir()) { + log.error(resourceBundle.getString("no.tmp.dir")); + System.exit(1); + } + + createFile(props,"deployMain","deploy.xml", genPath); + + try { + File outFile = new File(genPath,"generatedBundle.zip"); + FileOutputStream fos = new FileOutputStream(outFile); + ZipOutputStream zos = new ZipOutputStream(fos); + + copyToOutputStream(zos,genPath,"deploy.xml"); + copyToOutputStream(zos,props.getContentDir(),props.getBundleFile()); + zos.flush(); + zos.close(); + + File targetFile = new File(bundleTargetDirectory + "/" + "generatedBundle.zip"); + boolean success = outFile.renameTo(targetFile); + if (success) + log.info(MessageFormat.format(resourceBundle.getString("bundle.ready"), targetFile.getAbsolutePath())); + else { + log.debug("Could not rename file to ["+ targetFile.getAbsolutePath()+"]"); + log.info(MessageFormat.format(resourceBundle.getString("bundle.ready"), outFile.getAbsolutePath())); + } + + } catch (IOException e) { + e.printStackTrace(); // TODO: Customise this generated block + } + + } + + /** + * Copy a file to the passed Zip Output Stream + * @param zos OutputStream for a new Zip file + * @param filedir directory of the file to copy + * @param fileName name of the file to copy + * @throws IOException If anything here goes wrong. + */ + private void copyToOutputStream(ZipOutputStream zos,String filedir, String fileName) throws IOException { + ZipEntry entry = new ZipEntry(fileName); + zos.putNextEntry(entry); + FileInputStream fis = new FileInputStream(new File(filedir , fileName)); + StreamUtil.copy(fis,zos,false); + zos.flush(); + log.debug("Added ["+ fileName + "]"); + fis.close(); + } + + /** + * Apply a freemarker template to generate a file + * @param props The properties used to create the respective file + * @param template The name of the template without .ftl suffix + * @param fileName The name of the file to create + * @param directory The name of the directory to create in + */ + public void createFile(Props props, String template, String fileName, String directory) { + + try { + log.info("Trying to generate " + directory + "/" + fileName); + Configuration config = new Configuration(); + + ClassTemplateLoader ctl = new ClassTemplateLoader(getClass(), "/"); + TemplateLoader[] loaders = new TemplateLoader[] { ctl }; + MultiTemplateLoader mtl = new MultiTemplateLoader(loaders); + + config.setTemplateLoader(mtl); + + Template templ = config.getTemplate(template + ".ftl"); + + Writer out = new BufferedWriter(new FileWriter(new File(directory, fileName))); + Map<String, Props> root = new HashMap<String, Props>(); + root.put("props", props); + templ.process(root, out); + out.flush(); + out.close(); + } catch (IOException ioe) { + ioe.printStackTrace(); + } catch (TemplateException te) { + te.printStackTrace(); + } + } +} diff --git a/modules/helpers/bundleGen/src/main/java/org/rhq/helpers/bundleGen/Props.java b/modules/helpers/bundleGen/src/main/java/org/rhq/helpers/bundleGen/Props.java new file mode 100644 index 0000000..322ce74 --- /dev/null +++ b/modules/helpers/bundleGen/src/main/java/org/rhq/helpers/bundleGen/Props.java @@ -0,0 +1,97 @@ +/* + * RHQ Management Platform + * Copyright (C) 2005-2009 Red Hat, Inc. + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ +package org.rhq.helpers.bundleGen; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +/** + * TODO: Document this + * @author Heiko W. Rupp + */ +public class Props { + + private final Log log = LogFactory.getLog(Props.class); + + + private String project; + private String bundleName; + private String bundleVersion; + private String bundleDescription; + private String bundleFile; + private String replacePattern; + private String contentDir; + + public String getProject() { + return project; + } + + public void setProject(String project) { + this.project = project; + } + + public String getBundleName() { + return bundleName; + } + + public void setBundleName(String bundleName) { + this.bundleName = bundleName; + } + + public String getBundleVersion() { + return bundleVersion; + } + + public void setBundleVersion(String bundleVersion) { + this.bundleVersion = bundleVersion; + } + + public String getBundleDescription() { + return bundleDescription; + } + + public void setBundleDescription(String bundleDescription) { + this.bundleDescription = bundleDescription; + } + + public String getBundleFile() { + return bundleFile; + } + + public void setBundleFile(String bundleFile) { + this.bundleFile = bundleFile; + } + + public String getReplacePattern() { + return replacePattern; + } + + public void setReplacePattern(String replacePattern) { + this.replacePattern = replacePattern; + } + + public String getContentDir() { + return contentDir; + } + + public void setContentDir(String contentDir) { + this.contentDir = contentDir; + } +} + diff --git a/modules/helpers/bundleGen/src/main/java/org/rhq/helpers/bundleGen/XmlQuestionsReader.java b/modules/helpers/bundleGen/src/main/java/org/rhq/helpers/bundleGen/XmlQuestionsReader.java new file mode 100644 index 0000000..e47da34 --- /dev/null +++ b/modules/helpers/bundleGen/src/main/java/org/rhq/helpers/bundleGen/XmlQuestionsReader.java @@ -0,0 +1,200 @@ +/* + * RHQ Management Platform + * Copyright (C) 2005-2008 Red Hat, Inc. + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ +package org.rhq.helpers.bundleGen; + +import java.io.BufferedReader; +import java.io.FileNotFoundException; +import java.io.InputStream; +import java.util.Locale; +import java.lang.reflect.Method; +import java.util.ResourceBundle; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; + +/** + * Reads questions from an XML file and shows them to the user. + * The reader first tries to load a locale based version of the + * questions (file.<locale>.xml) if this fails, it falls back + * to using a default version (file.xml) + * + * @author Heiko W. Rupp + */ +public class XmlQuestionsReader { + + private final Log log = LogFactory.getLog(XmlQuestionsReader.class); + String baseName; + ResourceBundle resourceBundle = ResourceBundle.getBundle("bundleGen"); + + /** + * Create a new XmlQuestionReader + * @param fileBaseName the basename of a file - sans .xml suffix! + */ + public XmlQuestionsReader(String fileBaseName) { + baseName = fileBaseName; + } + + /** + * Present the questions to the user and read answers from the provided <i>reader</i>. + * @param reader Buffered Reader to read from. Usually an InputStreamReader(System.in) + * @param props Props object to fill the answers into. + * @throws FileNotFoundException if no question file is found + * @throws Exception On various other occasions + */ + public void readQuestions(BufferedReader reader, Props props) throws Exception { + + try { + DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); + DocumentBuilder builder = factory.newDocumentBuilder(); + Class<? extends XmlQuestionsReader> clazz = getClass(); + String lang = Locale.getDefault().getLanguage(); + InputStream input = clazz.getResourceAsStream("/"+baseName + "_" + lang + ".xml"); + if (input==null) { + log.debug("No localized version of " + baseName + " found, locale=" + lang); + log.debug("Now trying " + baseName); + input = clazz.getResourceAsStream("/"+baseName +".xml" ); + } + if (input == null) { + throw new FileNotFoundException("Input file [" + baseName + "] not found"); + } + + Document doc = builder.parse(input); + Element root = doc.getDocumentElement(); // <questions> + NodeList questionNodes = root.getChildNodes();// "question" + + for (int i = 0; i < questionNodes.getLength(); i++ ) { + Node node = questionNodes.item(i); + if (node instanceof Element) { + Element question = (Element)node; + String prop = question.getAttribute("prop"); + String type = question.getAttribute("type"); + if (type.equals("")) + type="string"; + String aIf = question.getAttribute("if"); // TODO implement + + if (!isValidType(type)) { + System.err.println("Type " + type + " is invalid in " + question ); + return; + } + Element text = (Element) question.getElementsByTagName("text").item(0); + NodeList prefillNodes = question.getElementsByTagName("prefill"); + String prefill = null; + if (prefillNodes.getLength()>0) { + prefill = prefillNodes.item(0).getTextContent(); + } + NodeList helpNodes = question.getElementsByTagName("help"); + String help = null; + if (helpNodes.getLength()>0) { + help = helpNodes.item(0).getTextContent(); + } + + boolean isBool = false; + System.out.print(text.getTextContent()); + if ("bool".equals(type)) { + isBool = true; + System.out.print(resourceBundle.getString("yes.no")); + } + if (prefill!=null) { + System.out.print("[" + prefill + "]"); + } + + String answer; + boolean helpRequested = false; + do { + helpRequested = false; + System.out.print(": "); + answer = reader.readLine(); + if (answer.startsWith("?")) { + helpRequested = true; + if (help!=null) { + System.out.println(help); + } + else + System.out.println(resourceBundle.getString("no.help.available")); + } + + } while (helpRequested); + + String setterName = "set" + caps(prop); + Method setter; + if (isBool) + setter = Props.class.getMethod(setterName, Boolean.TYPE); + else + setter = Props.class.getMethod(setterName, String.class); + + if (isBool) { + String yesString = resourceBundle.getString("yes.key"); + if (answer.toLowerCase(Locale.getDefault()).startsWith(yesString)) { + setter.invoke(props, true); + } + } + else if ("string".equals(type)) { + // If only return pressed and we have a prefill, use this. + if (prefill!= null && answer.length()==0) { + setter.invoke(props,prefill); + } + else { + if (!answer.startsWith("\n") && !answer.startsWith("\r") && !(answer.length() == 0)) + setter.invoke(props,answer); + } + } + else { + // TODO + } + } + + + + + } + } + catch (Exception e) { + throw e; + } + + } + + /** + * Returns true if the passed type is a valid data type of the properties (not for a single + * property). + * @param type A type as string + * @return true if its valid, false otherwise + */ + private boolean isValidType(String type) { + + if ("bool".equals(type) || "string".equals(type) || "resourceCategory".equals(type)) + return true; + + return false; + } + + static String caps(String in) { + if (in == null) + return null; + + return in.substring(0, 1).toUpperCase(Locale.getDefault()) + in.substring(1); + } +} diff --git a/modules/helpers/bundleGen/src/main/resources/bundleGen.properties b/modules/helpers/bundleGen/src/main/resources/bundleGen.properties new file mode 100644 index 0000000..4d93074 --- /dev/null +++ b/modules/helpers/bundleGen/src/main/resources/bundleGen.properties @@ -0,0 +1,5 @@ +no.help.available=Sorry, no help available for this topic +yes.no=(y/N) +yes.key=y +no.tmp.dir=Can't generate tmp dir to write to +bundle.ready=Your bundle is now ready in [{0}] \ No newline at end of file diff --git a/modules/helpers/bundleGen/src/main/resources/bundleGen_de.properties b/modules/helpers/bundleGen/src/main/resources/bundleGen_de.properties new file mode 100644 index 0000000..867c63f --- /dev/null +++ b/modules/helpers/bundleGen/src/main/resources/bundleGen_de.properties @@ -0,0 +1,5 @@ +no.help.available=HierfŸr gibt es leider keine Hilfe +yes.no=(j/N) +no.tmp.dir=Kann kein temporŠres Verzeichnis zum Schreiben erzeugen +bundle.ready=Das Bundle ist in [{0}]\\ verfŸgbar +yes.key=j \ No newline at end of file diff --git a/modules/helpers/bundleGen/src/main/resources/bundleGen_fr.properties b/modules/helpers/bundleGen/src/main/resources/bundleGen_fr.properties new file mode 100644 index 0000000..dc6f76e --- /dev/null +++ b/modules/helpers/bundleGen/src/main/resources/bundleGen_fr.properties @@ -0,0 +1,2 @@ +yes.no=(o/N) +yes.key=o \ No newline at end of file diff --git a/modules/helpers/bundleGen/src/main/resources/bundleQuestions.xml b/modules/helpers/bundleGen/src/main/resources/bundleQuestions.xml new file mode 100644 index 0000000..94b5c14 --- /dev/null +++ b/modules/helpers/bundleGen/src/main/resources/bundleQuestions.xml @@ -0,0 +1,28 @@ +<?xml version="1.0" ?> +<!-- DOCTYPE questions SYSTEM "questions.dtd"--> +<questions> + <question prop="project"> + <text>Please give the project name</text> + <prefill>myProject</prefill> + </question> + <question prop="bundleName"> + <text>Please give the bundle name</text> + </question> + <question prop="bundleVersion"> + <text>Please specify the bundle version</text> + <prefill>1.0</prefill> + </question> + <question prop="bundleDescription"> + <text>Please describe your bundle</text> + </question> + <question prop="bundleFile"> + <text>Please give the name (only) of your bundle content file</text> + </question> + <question prop="contentDir"> + <text>Please give the directory (only) of your bundle content file</text> + </question> + <question prop="replacePattern"> + <text>Please give a patten of files to replace templates</text> + <help>E.g. *.jsp</help> + </question> +</questions> \ No newline at end of file diff --git a/modules/helpers/bundleGen/src/main/resources/bundleQuestions_de.xml b/modules/helpers/bundleGen/src/main/resources/bundleQuestions_de.xml new file mode 100644 index 0000000..41deb9c --- /dev/null +++ b/modules/helpers/bundleGen/src/main/resources/bundleQuestions_de.xml @@ -0,0 +1,28 @@ +<?xml version="1.0" ?> +<!-- DOCTYPE questions SYSTEM "questions.dtd"--> +<questions> + <question prop="project"> + <text>Bitte geben Sie den Projektnamen an</text> + <prefill>myProject</prefill> + </question> + <question prop="bundleName"> + <text>Bitte geben Sie den Namen des Bundles an</text> + </question> + <question prop="bundleVersion"> + <text>Bite spezifizieren Sie die Version des Bundles</text> + <prefill>1.0</prefill> + </question> + <question prop="bundleDescription"> + <text>Bitte beschreiben Sie Ihr Bundle</text> + </question> + <question prop="bundleFile"> + <text>Bitte geben Sie (nur) den Namen der Datei mit dem Bundle-Inhalt an.</text> + </question> + <question prop="contentDir"> + <text>Bitte geben Sie (nur) das Verzeichnis mit der Datei mit dem Bundle-Inhalt an.</text> + </question> + <question prop="replacePattern"> + <text>Bitte geben Sie ein Datei-Muster fÃŒr Ersetzungen an</text> + <help>Z.B. *.jsp</help> + </question> +</questions> \ No newline at end of file diff --git a/modules/helpers/bundleGen/src/main/resources/deployMain.ftl b/modules/helpers/bundleGen/src/main/resources/deployMain.ftl new file mode 100644 index 0000000..21d53f7 --- /dev/null +++ b/modules/helpers/bundleGen/src/main/resources/deployMain.ftl @@ -0,0 +1,60 @@ +<#-- +/* + * RHQ Management Platform + * Copyright (C) 2005-2010 Red Hat, Inc. + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ +--> +<#-- @ftlvariable name="props" type="org.rhq.helpers.bundleGen.Props" --> +<?xml version="1.0"?> + +<project name="${props.project}" default="main" + xmlns:rhq="antlib:org.rhq.bundle"> + + <rhq:bundle name="${props.bundleName}" + version="${props.bundleVersion}" + description="${props.bundleDescription}"> + + <rhq:deployment-unit name="fixedForNow" + preinstallTarget="preinstall" + postinstallTarget="postinstall"> + + <rhq:archive name="${props.bundleFile}"> + <#if props.replacePattern??> + rhq:replace + rhq:fileset + <include name="${props.replacePattern}"/> + </rhq:fileset> + </rhq:replace> + </#if> + </rhq:archive> + + </rhq:deployment-unit> + </rhq:bundle> + + <!-- needed by ant, do not remove --> + <target name="main"/> + + <target name="preinstall"> + <echo>Installing to ${r"${rhq.deploy.dir}"}...</echo> + </target> + + <target name="postinstall"> + <echo>Done installing to ${r"${rhq.deploy.dir}"}.</echo> + </target> + + +</project> \ No newline at end of file diff --git a/modules/helpers/bundleGen/src/main/resources/questions.dtd b/modules/helpers/bundleGen/src/main/resources/questions.dtd new file mode 100644 index 0000000..aa6ad32 --- /dev/null +++ b/modules/helpers/bundleGen/src/main/resources/questions.dtd @@ -0,0 +1,36 @@ + +<!-- root of all evil --> +<!ELEMENT questions (question+)> + +<!-- one single question --> +<!ELEMENT question (text, options?, prefill?, help?)> + +<!ATTLIST question + prop CDATA #REQUIRED + type (bool|string) #IMPLIED + if (true|false) #IMPLIED + strip (start|end|outer|all) #IMPLIED +> + + + +<!-- The text to ask --> +<!ELEMENT text (#PCDATA)> + +<!-- The expected return type --> +<!ELEMENT type (#PCDATA)> + +<!-- possible options for the return value --> +<!ELEMENT options (option+)> + +<!-- one single option for the return type --> +<!ELEMENT option (#PCDATA)> + +<!-- rules for prefilling a an answer --> +<!ELEMENT prefill (#PCDATA)> + +<!-- A help text for this specific question that + gives more infomation about the feateure. + Can span multiple lines --> +<!ELEMENT help (#PCDATA)> + diff --git a/modules/helpers/pom.xml b/modules/helpers/pom.xml index 154fc0f..8fa853a 100644 --- a/modules/helpers/pom.xml +++ b/modules/helpers/pom.xml @@ -37,6 +37,7 @@ <!-- plugin generator --> <module>pluginGen</module> <module>pluginAnnotations</module> + <module>bundleGen</module>
</modules>
commit 1d91fa3e29f338c0f9a30092d48052020f993bd1 Author: Jay Shaughnessy jshaughn@redhat.com Date: Mon Jul 12 18:22:48 2010 -0400
A bunch of changes to handle discrepencies between the results of dbsetup and dbupgrade (from 2.3.1). Unfortunately, these differences went out with 3.0.0.final meaning dbs at 2.88 can still differ in structure depending on whether they were new or upgraded.
diff --git a/modules/core/dbutils/pom.xml b/modules/core/dbutils/pom.xml index d536ce6..ccc3b31 100644 --- a/modules/core/dbutils/pom.xml +++ b/modules/core/dbutils/pom.xml @@ -22,7 +22,7 @@
<properties> <scm.module.path>modules/core/dbutils/</scm.module.path> - <db.schema.version>2.88</db.schema.version> + <db.schema.version>2.90</db.schema.version> </properties>
<dependencies> diff --git a/modules/core/dbutils/src/main/scripts/dbsetup/alert-schema.xml b/modules/core/dbutils/src/main/scripts/dbsetup/alert-schema.xml index bce92a3..68e7635 100644 --- a/modules/core/dbutils/src/main/scripts/dbsetup/alert-schema.xml +++ b/modules/core/dbutils/src/main/scripts/dbsetup/alert-schema.xml @@ -33,8 +33,6 @@ <column name="DAMPENING_VALUE_UNITS" type="SMALLINT"/> <column name="DAMPENING_PERIOD" type="INTEGER"/> <column name="DAMPENING_PERIOD_UNITS" type="SMALLINT"/> - - <column name="OPERATION_DEF_ID" type="INTEGER" references="RHQ_OPERATION_DEF(ID)"/> </table>
<table name="RHQ_ALERT_DAMPEN_EVENT"> @@ -74,7 +72,6 @@ primarykey="true" required="true" type="INTEGER"/> <column name="ALERT_DEFINITION_ID" required="false" type="INTEGER" references="RHQ_ALERT_DEFINITION(ID)"/> <column name="CTIME" required="true" type="LONG"/> - <column name="TRIGGERED_OPERATION" required="false" type="VARCHAR2" size="255"/> <column name="RECOVERY_ID" type="INTEGER" required="true"/> <!-- required, but 0 effectively means null --> <column name="WILL_RECOVER" required="true" default="false" type="BOOLEAN"/> diff --git a/modules/core/dbutils/src/main/scripts/dbsetup/content-schema.xml b/modules/core/dbutils/src/main/scripts/dbsetup/content-schema.xml index c6cbafd..dec8587 100644 --- a/modules/core/dbutils/src/main/scripts/dbsetup/content-schema.xml +++ b/modules/core/dbutils/src/main/scripts/dbsetup/content-schema.xml @@ -433,7 +433,7 @@ <column name="ID" default="sequence-only" initial="10001" primarykey="true" required="true" type="INTEGER"/> <column name="ADVISORY_ID" type="INTEGER" required="true" references="RHQ_ADVISORY"/> <column name="CVE_ID" type="INTEGER" required="true" references="RHQ_CVE"/> - <column name="LAST_MODIFIED" type="LONG" required="false"/> + <column name="LAST_MODIFIED" type="LONG" required="true"/>
<index name="RHQ_ADVISORY_CVE_IDX" unique="true"> <field ref="ADVISORY_ID"/> @@ -581,7 +581,7 @@ <column name="STATUS" type="VARCHAR2" required="true" size="16"/> <column name="CTIME" type="LONG" required="true"/>
- <index name="RHQ_BUNDLE_RES_DEP_UNIQUE" unique="true"> + <index name="RHQ_BUNDLE_RES_DEPLOY_IDX" unique="true"> <field ref="BUNDLE_DEPLOYMENT_ID"/> <field ref="RESOURCE_ID"/> </index> @@ -601,8 +601,8 @@ </table>
<table name="RHQ_TAGGING_BUNDLE_MAP"> - <column name="BUNDLE_ID" type="INTEGER" references="RHQ_BUNDLE"/> - <column name="TAG_ID" type="INTEGER" references="RHQ_TAGGING"/> + <column name="BUNDLE_ID" type="INTEGER" required="true" references="RHQ_BUNDLE"/> + <column name="TAG_ID" type="INTEGER" required="true" references="RHQ_TAGGING"/> <constraint name="RHQ_TAGGING_BUNDLE_MAP_KEY"> <primaryKey> <field ref="BUNDLE_ID"/> @@ -612,8 +612,8 @@ </table>
<table name="RHQ_TAGGING_BUNDLE_VERSION_MAP"> - <column name="BUNDLE_VERSION_ID" type="INTEGER" references="RHQ_BUNDLE_VERSION"/> - <column name="TAG_ID" type="INTEGER" references="RHQ_TAGGING"/> + <column name="BUNDLE_VERSION_ID" type="INTEGER" required="true" references="RHQ_BUNDLE_VERSION"/> + <column name="TAG_ID" type="INTEGER" required="true" references="RHQ_TAGGING"/> <constraint name="RHQ_TAGGING_BUNDLE_VER_MAP_KEY"> <primaryKey> <field ref="BUNDLE_VERSION_ID"/> @@ -623,8 +623,8 @@ </table>
<table name="RHQ_TAGGING_BUNDLE_DEPLOY_MAP"> - <column name="BUNDLE_DEPLOYMENT_ID" type="INTEGER" references="RHQ_BUNDLE_DEPLOYMENT"/> - <column name="TAG_ID" type="INTEGER" references="RHQ_TAGGING"/> + <column name="BUNDLE_DEPLOYMENT_ID" type="INTEGER" required="true" references="RHQ_BUNDLE_DEPLOYMENT"/> + <column name="TAG_ID" type="INTEGER" required="true" references="RHQ_TAGGING"/> <constraint name="RHQ_TAGGING_BUNDLE_DEP_MAP_KEY"> <primaryKey> <field ref="BUNDLE_DEPLOYMENT_ID"/> @@ -634,8 +634,8 @@ </table>
<table name="RHQ_TAGGING_BUNDLE_DEST_MAP"> - <column name="BUNDLE_DESTINATION_ID" type="INTEGER" references="RHQ_BUNDLE_DESTINATION"/> - <column name="TAG_ID" type="INTEGER" references="RHQ_TAGGING"/> + <column name="BUNDLE_DESTINATION_ID" type="INTEGER" required="true" references="RHQ_BUNDLE_DESTINATION"/> + <column name="TAG_ID" type="INTEGER" required="true" references="RHQ_TAGGING"/> <constraint name="RHQ_TAGGING_BUNDLE_DES_MAP_KEY"> <primaryKey> <field ref="BUNDLE_DESTINATION_ID"/> diff --git a/modules/core/dbutils/src/main/scripts/dbsetup/inventory-schema.xml b/modules/core/dbutils/src/main/scripts/dbsetup/inventory-schema.xml index 7c51ef7..da048e1 100644 --- a/modules/core/dbutils/src/main/scripts/dbsetup/inventory-schema.xml +++ b/modules/core/dbutils/src/main/scripts/dbsetup/inventory-schema.xml @@ -245,8 +245,8 @@ </table>
<table name="RHQ_TAGGING_RESOURCE_MAP"> - <column name="RESOURCE_ID" type="INTEGER" references="RHQ_RESOURCE"/> - <column name="TAG_ID" type="INTEGER" references="RHQ_TAGGING"/> + <column name="RESOURCE_ID" type="INTEGER" required="true" references="RHQ_RESOURCE"/> + <column name="TAG_ID" type="INTEGER" required="true" references="RHQ_TAGGING"/> <constraint name="RHQ_TAGGING_RESOURCE_MAP_KEY"> <primaryKey> <field ref="RESOURCE_ID"/> @@ -256,8 +256,8 @@ </table>
<table name="RHQ_TAGGING_RES_GROUP_MAP"> - <column name="RESOURCE_GROUP_ID" type="INTEGER" references="RHQ_RESOURCE_GROUP"/> - <column name="TAG_ID" type="INTEGER" references="RHQ_TAGGING"/> + <column name="RESOURCE_GROUP_ID" type="INTEGER" required="true" references="RHQ_RESOURCE_GROUP"/> + <column name="TAG_ID" type="INTEGER" required="true" references="RHQ_TAGGING"/> <constraint name="RHQ_TAGGING_RES_GROUP_MAP_KEY"> <primaryKey> <field ref="RESOURCE_GROUP_ID"/> diff --git a/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml b/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml index 7f8f9da..b43824d 100644 --- a/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml +++ b/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml @@ -2186,7 +2186,7 @@ <schema-alterColumn table="RHQ_ADVISORY_PACKAGE" column="LAST_MODIFIED" nullable="false" /> <schema-directSQL> <statement> - CREATE UNIQUE INDEX RHQ_ADVISORY_PACKAGE_UQ ON RHQ_ADVISORY_PACKAGE ( ADVISORY_ID, PACKAGE_VERSION_ID ) + CREATE UNIQUE INDEX RHQ_ADVISORY_PACKAGE_IDX ON RHQ_ADVISORY_PACKAGE ( ADVISORY_ID, PACKAGE_VERSION_ID ) </statement> <statement> ALTER TABLE RHQ_ADVISORY_PACKAGE @@ -2227,7 +2227,7 @@ <schema-alterColumn table="RHQ_ADVISORY_CVE" column="LAST_MODIFIED" nullable="false" /> <schema-directSQL> <statement> - CREATE UNIQUE INDEX RHQ_ADVISORY_CVE_UQ ON RHQ_ADVISORY_CVE ( ADVISORY_ID, CVE_ID ) + CREATE UNIQUE INDEX RHQ_ADVISORY_CVE_IDX ON RHQ_ADVISORY_CVE ( ADVISORY_ID, CVE_ID ) </statement> <statement> ALTER TABLE RHQ_ADVISORY_CVE @@ -2259,7 +2259,7 @@ <schema-alterColumn table="RHQ_ADVISORY_BUGLIST" column="LAST_MODIFIED" nullable="false" /> <schema-directSQL> <statement> - CREATE UNIQUE INDEX RHQ_ADVISORY_BUGLIST_UQ ON RHQ_ADVISORY_BUGLIST ( ADVISORY_ID, BUG_ID ) + CREATE UNIQUE INDEX RHQ_ADVISORY_BUG_IDX ON RHQ_ADVISORY_BUGLIST ( ADVISORY_ID, BUG_ID ) </statement> <statement> ALTER TABLE RHQ_ADVISORY_BUGLIST @@ -2621,8 +2621,8 @@ FOREIGN KEY (RESOURCE_ID) REFERENCES RHQ_RESOURCE (ID) </statement> - <statement desc="Creating RHQ_BUNDLE_RES_DEPLOY unique constraint on def-resource mapping"> - CREATE UNIQUE INDEX RHQ_BUNDLE_RES_DEPLOY_MAP_IX + <statement desc="Creating RHQ_BUNDLE_RES_DEPLOY unique constraint on dep-resource mapping"> + CREATE UNIQUE INDEX RHQ_BUNDLE_RES_DEPLOY_IDX ON RHQ_BUNDLE_RES_DEPLOY (BUNDLE_DEPLOYMENT_ID, RESOURCE_ID) </statement> </schema-directSQL> @@ -2695,23 +2695,19 @@ </statement> </schema-directSQL> <schema-alterColumn table="RHQ_SAVED_SEARCH" column="ID" nullable="FALSE" /> - - <schema-addColumn table="RHQ_SAVED_SEARCH" column="CONTEXT" columnType="VARCHAR2" precision="25" /> + <schema-addColumn table="RHQ_SAVED_SEARCH" column="CONTEXT" columnType="VARCHAR2" precision="25" /> <schema-alterColumn table="RHQ_SAVED_SEARCH" column="CONTEXT" nullable="FALSE" /> - - <schema-addColumn table="RHQ_SAVED_SEARCH" column="NAME" columnType="VARCHAR2" precision="200" /> - <schema-addColumn table="RHQ_SAVED_SEARCH" column="DESCRIPTION" columnType="VARCHAR2" precision="500" /> - <schema-addColumn table="RHQ_SAVED_SEARCH" column="PATTERN" columnType="VARCHAR2" precision="1000" /> + <schema-addColumn table="RHQ_SAVED_SEARCH" column="NAME" columnType="VARCHAR2" precision="200" /> + <schema-addColumn table="RHQ_SAVED_SEARCH" column="DESCRIPTION" columnType="VARCHAR2" precision="500" /> + <schema-addColumn table="RHQ_SAVED_SEARCH" column="PATTERN" columnType="VARCHAR2" precision="1000" /> <schema-alterColumn table="RHQ_SAVED_SEARCH" column="PATTERN" nullable="FALSE" /> - - <schema-addColumn table="RHQ_SAVED_SEARCH" column="JPQL_TRANSLATION" columnType="VARCHAR2" precision="4000" /> - <schema-addColumn table="RHQ_SAVED_SEARCH" column="LAST_COMPUTE_TIME" columnType="LONG" /> + <schema-addColumn table="RHQ_SAVED_SEARCH" column="JPQL_TRANSLATION" columnType="VARCHAR2" precision="4000" /> + <schema-addColumn table="RHQ_SAVED_SEARCH" column="LAST_COMPUTE_TIME" columnType="LONG" /> <schema-alterColumn table="RHQ_SAVED_SEARCH" column="LAST_COMPUTE_TIME" nullable="FALSE" /> - <schema-addColumn table="RHQ_SAVED_SEARCH" column="RESULT_COUNT" columnType="LONG" /> - - <schema-addColumn table="RHQ_SAVED_SEARCH" column="SUBJECT_ID" columnType="INTEGER" /> + <schema-addColumn table="RHQ_SAVED_SEARCH" column="RESULT_COUNT" columnType="LONG" /> + <schema-addColumn table="RHQ_SAVED_SEARCH" column="SUBJECT_ID" columnType="INTEGER" /> <schema-alterColumn table="RHQ_SAVED_SEARCH" column="SUBJECT_ID" nullable="FALSE" /> - <schema-addColumn table="RHQ_SAVED_SEARCH" column="GLOBAL" columnType="BOOLEAN" /> + <schema-addColumn table="RHQ_SAVED_SEARCH" column="GLOBAL" columnType="BOOLEAN" /> <schema-alterColumn table="RHQ_SAVED_SEARCH" column="GLOBAL" nullable="FALSE" />
<schema-createSequence name="RHQ_SAVED_SEARCH_ID_SEQ" initial="10001" /> @@ -2785,7 +2781,7 @@ </statement> <statement> CREATE UNIQUE INDEX RHQ_ROLE_LDAP_GROUP_IDX - ON RHQ_ROLE_LDAP_GROUP ( LDAP_GROUP_NAME, ROLE_ID ) + ON RHQ_ROLE_LDAP_GROUP ( ROLE_ID, LDAP_GROUP_NAME ) </statement> </schema-directSQL> </schemaSpec> @@ -3011,6 +3007,61 @@ </statement> </schema-directSQL> </schemaSpec> + + <!-- rhq 3.0.0.final release at this point. --> + + <!-- 2.89 corrects problems in 3.0.0.final *new* instal The problems it + fixes are not present in an upgraded db. As such, ignore any errors. + --> + <schemaSpec version="2.89"> + <schema-deleteColumn ignoreError="true" table="RHQ_ALERT" column="TRIGGERED_OPERATION" /> + <schema-deleteColumn ignoreError="true" table="RHQ_ALERT_DEFINITION" column="operation_def_id" /> + + <schema-alterColumn ignoreError="true" table="RHQ_ADVISORY_CVE" column="LAST_MODIFIED" nullable="false" /> + + <schema-alterColumn ignoreError="true" table="RHQ_TAGGING_BUNDLE_MAP" column="BUNDLE_ID" nullable="false" /> + <schema-alterColumn ignoreError="true" table="RHQ_TAGGING_BUNDLE_MAP" column="TAG_ID" nullable="false" /> + <schema-alterColumn ignoreError="true" table="RHQ_TAGGING_BUNDLE_VERSION_MAP" column="BUNDLE_VERSION_ID" nullable="false" /> + <schema-alterColumn ignoreError="true" table="RHQ_TAGGING_BUNDLE_VERSION_MAP" column="TAG_ID" nullable="false" /> + <schema-alterColumn ignoreError="true" table="RHQ_TAGGING_BUNDLE_DEPLOY_MAP" column="BUNDLE_DEPLOYMENT_ID" nullable="false" /> + <schema-alterColumn ignoreError="true" table="RHQ_TAGGING_BUNDLE_DEPLOY_MAP" column="TAG_ID" nullable="false" /> + <schema-alterColumn ignoreError="true" table="RHQ_TAGGING_BUNDLE_DEST_MAP" column="BUNDLE_DESTINATION_ID" nullable="false" /> + <schema-alterColumn ignoreError="true" table="RHQ_TAGGING_BUNDLE_DEST_MAP" column="TAG_ID" nullable="false" /> + <schema-alterColumn ignoreError="true" table="RHQ_TAGGING_RESOURCE_MAP" column="RESOURCE_ID" nullable="false" /> + <schema-alterColumn ignoreError="true" table="RHQ_TAGGING_RESOURCE_MAP" column="TAG_ID" nullable="false" /> + <schema-alterColumn ignoreError="true" table="RHQ_TAGGING_RES_GROUP_MAP" column="RESOURCE_GROUP_ID" nullable="false" /> + <schema-alterColumn ignoreError="true" table="RHQ_TAGGING_RES_GROUP_MAP" column="TAG_ID" nullable="false" /> + </schemaSpec> + + <!-- 2.90 corrects problems in 3.0.0.final upgrade installs. The problems it + fixes are not present in an new db. As such, ignore any errors. + --> + <schemaSpec version="2.90"> + <!-- correct problems in rhq-3.0.0.final upgrade installs --> + <schema-dropSequence ignoreError="true" name="rhq_tag_id_seq" /> + <schema-dropSequence ignoreError="true" name="rhq_advisory_buglist_seq" /> + + <schema-createSequence ignoreError="true" name="RHQ_ADVISORY_BUGLIST_ID_SEQ" initial="10001" /> + + <schema-alterColumn ignoreError="true" table="RHQ_ALERT_NOTIF_LOG" column="SENDER" nullable="TRUE" /> + + <schema-alterColumn ignoreError="true" table="RHQ_BUNDLE_TYPE" column="RESOURCE_TYPE_ID" nullable="FALSE" /> + + <schema-alterColumn ignoreError="true" table="RHQ_ROLE_LDAP_GROUP" column="LDAP_GROUP_NAME" nullable="FALSE" /> + + <schema-deleteColumn ignoreError="true" table="RHQ_SAVED_SEARCH" column="JPQL_TRANSLATION" /> + <schema-alterColumn ignoreError="true" table="RHQ_SAVED_SEARCH" column="NAME" nullable="FALSE" /> + + <schema-directSQL ignoreError="true"> + <statement desc="Creating RHQ_SAVED_SEARCH foreign key relation to RHQ_SUBJECT"> + ALTER TABLE RHQ_SAVED_SEARCH + ADD CONSTRAINT RHQ_SAVED_SEARCH_SUBJECT_ID_FK + FOREIGN KEY (SUBJECT_ID) + REFERENCES RHQ_SUBJECT (ID) + </statement> + </schema-directSQL> + + </schemaSpec> </dbupgrade> </target> </project> diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/content/AdvisoryCVE.java b/modules/core/domain/src/main/java/org/rhq/core/domain/content/AdvisoryCVE.java index 24d0c9b..7576617 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/content/AdvisoryCVE.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/content/AdvisoryCVE.java @@ -36,7 +36,6 @@ import javax.persistence.NamedQuery; import javax.persistence.PrePersist; import javax.persistence.SequenceGenerator; import javax.persistence.Table; -import javax.xml.bind.annotation.XmlTransient;
/** * This is the many-to-many entity that correlates an advisory with a package. @@ -74,7 +73,7 @@ public class AdvisoryCVE implements Serializable { @JoinColumn(name = "CVE_ID", referencedColumnName = "ID", nullable = false) private CVE cve;
- @Column(name = "LAST_MODIFIED", nullable = true) + @Column(name = "LAST_MODIFIED", nullable = false) private long lastModifiedDate;
protected AdvisoryCVE() { diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/search/SavedSearch.java b/modules/core/domain/src/main/java/org/rhq/core/domain/search/SavedSearch.java index 96ba158..45cd6e9 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/search/SavedSearch.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/search/SavedSearch.java @@ -73,7 +73,7 @@ public class SavedSearch implements Serializable { @Enumerated(EnumType.STRING) private SearchSubsystem searchSubsystem;
- @Column(name = "NAME") + @Column(name = "NAME", nullable = false) private String name;
@Column(name = "DESCRIPTION")
commit 794a62beffbf33c07f67b35c74aa2fd6e5be988f Author: Jay Shaughnessy jshaughn@redhat.com Date: Mon Jul 12 18:20:25 2010 -0400
Add ignoreError attribute for schemaSpecTasks to handle upgrade situations where we can't guarantee the state of the db we're upgrading.
diff --git a/modules/core/dbutils/src/main/java/org/rhq/core/db/ant/dbupgrade/SchemaSpec.java b/modules/core/dbutils/src/main/java/org/rhq/core/db/ant/dbupgrade/SchemaSpec.java index 53e1b64..979dcd3 100644 --- a/modules/core/dbutils/src/main/java/org/rhq/core/db/ant/dbupgrade/SchemaSpec.java +++ b/modules/core/dbutils/src/main/java/org/rhq/core/db/ant/dbupgrade/SchemaSpec.java @@ -21,11 +21,14 @@ package org.rhq.core.db.ant.dbupgrade; import java.sql.Connection; import java.util.ArrayList; import java.util.List; + import mazz.i18n.Msg; + import org.apache.tools.ant.BuildException; import org.apache.tools.ant.Task; import org.apache.tools.ant.TaskContainer; import org.apache.tools.ant.UnknownElement; + import org.rhq.core.db.ant.DbAntI18NFactory; import org.rhq.core.db.ant.DbAntI18NResourceKeys;
@@ -134,8 +137,13 @@ public class SchemaSpec extends Task implements TaskContainer, Comparable { sst.initialize(conn, upgrader); sst.execute(); } catch (Exception e) { - throw new BuildException(MSG.getMsg(DbAntI18NResourceKeys.ERROR_EXECUTING_SCHEMA_SPEC_TASK, sst - .getClass().getName(), getVersion(), e), e); + String msg = MSG.getMsg(DbAntI18NResourceKeys.ERROR_EXECUTING_SCHEMA_SPEC_TASK, sst.getClass() + .getName(), getVersion(), e); + if (!sst.isIgnoreError()) { + throw new BuildException(msg, e); + } else { + log(msg); + } } } } diff --git a/modules/core/dbutils/src/main/java/org/rhq/core/db/ant/dbupgrade/SchemaSpecTask.java b/modules/core/dbutils/src/main/java/org/rhq/core/db/ant/dbupgrade/SchemaSpecTask.java index 6c04bea..9b97dd2 100644 --- a/modules/core/dbutils/src/main/java/org/rhq/core/db/ant/dbupgrade/SchemaSpecTask.java +++ b/modules/core/dbutils/src/main/java/org/rhq/core/db/ant/dbupgrade/SchemaSpecTask.java @@ -25,9 +25,12 @@ import java.sql.SQLException; import java.sql.Types; import java.util.HashMap; import java.util.Map; + import mazz.i18n.Msg; + import org.apache.tools.ant.BuildException; import org.apache.tools.ant.Task; + import org.rhq.core.db.DatabaseType; import org.rhq.core.db.TypeMap; import org.rhq.core.db.ant.DbAntI18NFactory; @@ -46,6 +49,8 @@ public abstract class SchemaSpecTask extends Task { private String targetDBVendor; private String targetDBVersion;
+ private String ignoreError; + // cache all known JDBC SQL data types private static Map<String, Integer> SQL_TYPES = new HashMap<String, Integer>();
@@ -104,6 +109,18 @@ public abstract class SchemaSpecTask extends Task { return targetDBVersion; }
+ public String getIgnoreError() { + return ignoreError; + } + + public void setIgnoreError(String ignoreError) { + this.ignoreError = ignoreError; + } + + public boolean isIgnoreError() { + return new Boolean(this.ignoreError); + } + /** * Returns <code>true</code> if this task's database is targeted for this schema spec. Note that if * {@link #getTargetDBVendor()} is not specified, then any specified {@link #getTargetDBVersion()} will cause a
commit 1184cb067af37649d5b24f07948ee733e535a5a5 Author: John Mazzitelli mazz@redhat.com Date: Mon Jul 12 13:10:16 2010 -0400
BZ 605648 - temporarily disable all gwt views except for bundle/tag related ones
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java index 42f8a2c..e3b76e5 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java @@ -249,6 +249,21 @@ public class CoreGUI implements EntryPoint, ValueChangeHandler<String> { public Canvas createContent(String breadcrumbName) { Canvas canvas;
+ //============= + // TODO: REMOVE THIS AFTER 3.0 RELEASE - WE ONLY WANT 3.0 TO EXPOSE BUNDLES AND TAGS + // THEREAFTER, WE WILL EXPOSE ALL GWT FUNCTIONALITY + canvas = null; + if (canvas == null) { + if (breadcrumbName.equals("Bundles")) { + return new BundleTopView(); + } else if (breadcrumbName.equals("Tag")) { + return new TaggedView(); + } else { + return null; + } + } + //============= + if (breadcrumbName.equals("Administration")) { canvas = new AdministrationView(); } else if (breadcrumbName.equals("Demo")) {
commit 2977e3e330a48370b66a130a04706367ed4579d4 Merge: 84e58e7... ea19081... Author: Ian Springer ian.springer@redhat.com Date: Mon Jul 12 12:31:46 2010 -0400
Merge branch 'release-3.0.0' of ssh://git.fedorahosted.org/git/rhq/rhq into release-3.0.0
commit 84e58e73e12c43a582bc75ef2233a7a33dcb0b72 Author: Ian Springer ian.springer@redhat.com Date: Mon Jul 12 11:57:38 2010 -0400
fix logic bug in getURL()
diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/common/framework/FaceletRedirectionViewHandler.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/common/framework/FaceletRedirectionViewHandler.java index 22aaccb..839e322 100644 --- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/common/framework/FaceletRedirectionViewHandler.java +++ b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/common/framework/FaceletRedirectionViewHandler.java @@ -72,10 +72,11 @@ public class FaceletRedirectionViewHandler extends FaceletViewHandler { for (Map.Entry<String, Object> urlParam : viewToRender.getAttributes().entrySet()) { if (first) { results.append('?'); + first = false; } else { results.append('&'); } - results.append(urlParam.getKey() + "=" + urlParam.getValue()); + results.append(urlParam.getKey()).append("=").append(urlParam.getValue()); }
return results.toString();
commit ea19081756a4e944a7096ea92454c359ecb29ccc Author: Joseph Marques joseph@redhat.com Date: Mon Jul 12 11:42:19 2010 -0400
fix failing unit test
diff --git a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/search/TestAutoCompletionManager.java b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/search/TestAutoCompletionManager.java index 704146b..3b658c7 100644 --- a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/search/TestAutoCompletionManager.java +++ b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/search/TestAutoCompletionManager.java @@ -8,6 +8,7 @@ import java.util.Map;
import org.rhq.core.domain.search.SearchSubsystem; import org.rhq.enterprise.server.search.assist.AbstractSearchAssistant; +import org.rhq.enterprise.server.search.assist.SearchAssistant; import org.rhq.enterprise.server.search.execution.SearchAssistManager; import org.rhq.enterprise.server.util.LookupUtil;
@@ -68,6 +69,10 @@ public class TestAutoCompletionManager extends SearchAssistManager { @Override protected AbstractSearchAssistant getSearchAssistant() { return new TestAutoCompletor(); + }
+ @Override + protected SearchAssistant getTabAwareSearchAssistant(String tab) { + return new TestAutoCompletor(); } }
commit 315d9ef72f96c3fc1efeec76129b45f9f4679578 Merge: a01b65d... aa8f1ce... Author: Ian Springer ian.springer@redhat.com Date: Mon Jul 12 10:52:17 2010 -0400
Merge branch 'release-3.0.0' of ssh://git.fedorahosted.org/git/rhq/rhq into release-3.0.0
commit aa8f1ce8dab5c6c4d649cf50cee6e948a89db5f5 Author: Greg Hinkle ghinkle@redhat.com Date: Mon Jul 12 10:12:42 2010 -0400
Cache bug fix moved to release branch
diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/authentication/SessionAccessServlet.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/authentication/SessionAccessServlet.java index 7acfcbe..08911dd 100644 --- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/authentication/SessionAccessServlet.java +++ b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/authentication/SessionAccessServlet.java @@ -56,6 +56,14 @@ public class SessionAccessServlet extends HttpServlet { HttpServletResponse response = (HttpServletResponse) resp; HttpServletRequest request = (HttpServletRequest) req;
+ response.addHeader("Pragma", "no-cache"); + response.addHeader("Cache-Control", "no-cache"); + // Stronger according to blog comment below that references HTTP spec + response.addHeader("Cache-Control", "no-store"); + response.addHeader("Cache-Control", "must-revalidate"); + // some date in the past + response.addHeader("Expires", "Mon, 8 Aug 2006 10:00:00 GMT"); + //if a session does not already exist this call will create one HttpSession session = request.getSession();
commit c4241e2c4add58fef7fff149a40aeda905e5978e Merge: 538ebda... 2cb7cea... Author: Jay Shaughnessy jshaughn@redhat.com Date: Mon Jul 12 09:41:45 2010 -0400
Merge branch 'release-3.0.0' into release-3.0.0-jay
commit 2cb7ceaf443bf4376e1c369c8a66a218f9132805 Author: Joseph Marques joseph@redhat.com Date: Sat Jul 10 01:37:13 2010 -0400
fix whitespace padding
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/favorites/SavedSearchGrid.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/favorites/SavedSearchGrid.java index e8f0c5d..c6bea22 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/favorites/SavedSearchGrid.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/favorites/SavedSearchGrid.java @@ -138,7 +138,7 @@ public class SavedSearchGrid extends Grid { private static String stylize(SavedSearch savedSearch) { String header = savedSearch.getName(); if (savedSearch.getResultCount() != null) { - header += " ( " + savedSearch.getResultCount() + ")"; + header += " (" + savedSearch.getResultCount() + ")"; } return "<span class="savedSearchesPanel-top">" + header + "</span>" + "<br/>" // + "<span class="savedSearchesPanel-bottom">" + savedSearch.getPattern() + "</span>";
commit bebf8612034b07ef1983bcb01fab27ba01f1e792 Author: Joseph Marques joseph@redhat.com Date: Sat Jul 10 01:23:20 2010 -0400
show result counts for saved searches in the suggestions pop-up
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java index 12e0619..2e84d69 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java @@ -580,6 +580,9 @@ public class SearchAssistManager { List<SearchSuggestion> results = new ArrayList<SearchSuggestion>(); for (SavedSearch next : savedSearchResults) { String label = next.getName(); + if (next.getResultCount() != null) { + label += " (" + next.getResultCount() + ")"; + } String value = next.getPattern(); int index = next.getName().toLowerCase().indexOf(expression); SearchSuggestion suggestion = new SearchSuggestion(Kind.UserSavedSearch, label, value, index, expression
commit 3cef84d0c9408492c3fcb8345643d57ed1b9f45f Author: Joseph Marques joseph@redhat.com Date: Sat Jul 10 01:08:11 2010 -0400
compute the result counts for the group-specific saved searches
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/scheduler/jobs/SavedSearchResultCountRecalculationJob.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/scheduler/jobs/SavedSearchResultCountRecalculationJob.java index 5b23039..621cd33 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/scheduler/jobs/SavedSearchResultCountRecalculationJob.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/scheduler/jobs/SavedSearchResultCountRecalculationJob.java @@ -27,12 +27,15 @@ import org.quartz.JobExecutionException;
import org.rhq.core.domain.auth.Subject; import org.rhq.core.domain.criteria.ResourceCriteria; +import org.rhq.core.domain.criteria.ResourceGroupCriteria; import org.rhq.core.domain.criteria.SavedSearchCriteria; import org.rhq.core.domain.resource.Resource; +import org.rhq.core.domain.resource.group.ResourceGroup; import org.rhq.core.domain.search.SavedSearch; import org.rhq.core.domain.search.SearchSubsystem; import org.rhq.core.domain.util.PageList; import org.rhq.enterprise.server.resource.ResourceManagerLocal; +import org.rhq.enterprise.server.resource.group.ResourceGroupManagerLocal; import org.rhq.enterprise.server.search.SavedSearchManagerLocal; import org.rhq.enterprise.server.util.LookupUtil;
@@ -47,6 +50,7 @@ public class SavedSearchResultCountRecalculationJob extends AbstractStatefulJob
private SavedSearchManagerLocal savedSearchManager = LookupUtil.getSavedSearchManager(); private ResourceManagerLocal resourceManager = LookupUtil.getResourceManager(); + private ResourceGroupManagerLocal resourceGroupManager = LookupUtil.getResourceGroupManager();
private Subject overlord = LookupUtil.getSubjectManager().getOverlord();
@@ -62,6 +66,7 @@ public class SavedSearchResultCountRecalculationJob extends AbstractStatefulJob continue; } try { + if (next.getSearchSubsystem() == SearchSubsystem.RESOURCE) { ResourceCriteria criteria = new ResourceCriteria(); criteria.setSearchExpression(next.getPattern()); @@ -70,12 +75,20 @@ public class SavedSearchResultCountRecalculationJob extends AbstractStatefulJob PageList<Resource> results = resourceManager.findResourcesByCriteria(overlord, criteria); totalMillis += System.currentTimeMillis();
- // TODO: should recent count be computed at the time of update/save for this saved search? - // it would obviate the need for null checking here as well as in the UI for conditional - // display of the result count - if (next.getResultCount() == null || results.getTotalSize() != next.getResultCount()) { - next.setResultCount((long) results.getTotalSize()); - savedSearchManager.updateSavedSearch(overlord, next); + if (processResults(next, results)) { + updated++; + } + + } else if (next.getSearchSubsystem() == SearchSubsystem.GROUP) { + ResourceGroupCriteria criteria = new ResourceGroupCriteria(); + criteria.setSearchExpression(next.getPattern()); + + totalMillis -= System.currentTimeMillis(); + PageList<ResourceGroup> results = resourceGroupManager.findResourceGroupsByCriteria(overlord, + criteria); + totalMillis += System.currentTimeMillis(); + + if (processResults(next, results)) { updated++; } } @@ -93,6 +106,18 @@ public class SavedSearchResultCountRecalculationJob extends AbstractStatefulJob } }
+ private boolean processResults(SavedSearch next, PageList<?> results) { + // TODO: should recent count be computed at the time of update/save for this saved search? + // it would obviate the need for null checking here as well as in the UI for conditional + // display of the result count + if (next.getResultCount() == null || results.getTotalSize() != next.getResultCount()) { + next.setResultCount((long) results.getTotalSize()); + savedSearchManager.updateSavedSearch(overlord, next); + return true; + } + return false; + } + private List<SavedSearch> getSavedSearchesNeedingRecomputation() { long fiveMinutesAgo = System.currentTimeMillis() - (5 * 60 * 1000);
commit d655ff54fd5996786d581e8db70afaddb7e3ebd2 Author: Joseph Marques joseph@redhat.com Date: Sat Jul 10 01:07:33 2010 -0400
display the count of results in the saved searches drop-down
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/favorites/SavedSearchGrid.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/favorites/SavedSearchGrid.java index a5b0a48..e8f0c5d 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/favorites/SavedSearchGrid.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/favorites/SavedSearchGrid.java @@ -25,6 +25,7 @@ import com.google.gwt.user.client.Element; import com.google.gwt.user.client.Event; import com.google.gwt.user.client.ui.Grid;
+import org.rhq.core.domain.search.SavedSearch; import org.rhq.enterprise.gui.coregui.client.search.SearchBar;
/** @@ -127,16 +128,20 @@ public class SavedSearchGrid extends Grid {
for (int i = 0; i < names.size(); i++) { String name = names.get(i); - String pattern = searchBar.getSavedSearchManager().getPatternByName(name); - setHTML(i, 0, stylize(name, pattern)); + SavedSearch savedSearch = searchBar.getSavedSearchManager().getSavedSearchByName(name); + setHTML(i, 0, stylize(savedSearch)); setHTML(i, 1, trashify()); } setRowFormatter(new SavedSearchRowFormatter()); }
- private static String stylize(String name, String pattern) { - return "<span class="savedSearchesPanel-top">" + name + "</span>" + "<br/>" - + "<span class="savedSearchesPanel-bottom">" + pattern + "</span>"; + private static String stylize(SavedSearch savedSearch) { + String header = savedSearch.getName(); + if (savedSearch.getResultCount() != null) { + header += " ( " + savedSearch.getResultCount() + ")"; + } + return "<span class="savedSearchesPanel-top">" + header + "</span>" + "<br/>" // + + "<span class="savedSearchesPanel-bottom">" + savedSearch.getPattern() + "</span>"; }
private static String trashify() { diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/favorites/SavedSearchManager.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/favorites/SavedSearchManager.java index 4981e2b..398b4d8 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/favorites/SavedSearchManager.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/favorites/SavedSearchManager.java @@ -58,6 +58,10 @@ public class SavedSearchManager { return savedSearch.getPattern(); }
+ public synchronized SavedSearch getSavedSearchByName(String name) { + return savedSearches.get(name); + } + public synchronized void updatePatternByName(final String name, final String pattern) { SavedSearch savedSearch = savedSearches.get(name); if (savedSearch == null) { // created case
commit 913a7b533b15a0ad5e64659bb722d913641d7d09 Author: Joseph Marques joseph@redhat.com Date: Sat Jul 10 01:07:10 2010 -0400
BZ-613222: only display saved searches for the current/active search subsystem
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/SearchBar.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/SearchBar.java index 3ac3f3f..eb6a724 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/SearchBar.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/SearchBar.java @@ -138,6 +138,11 @@ public class SearchBar extends SimplePanel { public SearchBar() { System.out.println("Loading SearchBar...");
+ // in the future, will be instantiated directly from a higher-level widget + if (existsOnPage()) { + loadAdditionalDataFromDivAttributes(); + } + savedSearchManager = new SavedSearchManager(this); }
@@ -156,10 +161,6 @@ public class SearchBar extends SimplePanel { setupArrowImage(); setupSavedSearches();
- // in the future, will be instantiated directly from a higher-level widget - if (existsOnPage()) { - loadAdditionalDataFromDivAttributes(); - } // presume the enclosing page logic loads results without a button click }
commit 47609849bb93035887cec2f1979eb44b70250e3e Author: Joseph Marques joseph@redhat.com Date: Sat Jul 10 00:23:49 2010 -0400
interpret "all" tab as the absence of a category filter
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/SearchBar.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/SearchBar.java index fb61df1..3ac3f3f 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/SearchBar.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/SearchBar.java @@ -125,7 +125,14 @@ public class SearchBar extends SimplePanel { String defaultSavedSearchPattern = searchBarElement.getAttribute("defaultSavedSearchPattern"); setDefaultSavedSearchPattern(defaultSavedSearchPattern);
- this.selectedTab = searchBarElement.getAttribute("subtab"); + String tab = searchBarElement.getAttribute("subtab"); + if (tab != null) { + tab = tab.trim().toLowerCase(); + if (tab.equals("") || tab.equals("all")) { + tab = null; + } + } + this.selectedTab = tab; }
public SearchBar() {
commit 3dcbafcafe7b2d85d6d9f36e4043d3d6e6dbf77c Author: Joseph Marques joseph@redhat.com Date: Fri Jul 9 17:40:22 2010 -0400
do not recalculate global searches
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/scheduler/jobs/SavedSearchResultCountRecalculationJob.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/scheduler/jobs/SavedSearchResultCountRecalculationJob.java index d42f529..5b23039 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/scheduler/jobs/SavedSearchResultCountRecalculationJob.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/scheduler/jobs/SavedSearchResultCountRecalculationJob.java @@ -58,6 +58,9 @@ public class SavedSearchResultCountRecalculationJob extends AbstractStatefulJob int updated = 0; long totalMillis = 0; for (SavedSearch next : staleSavedSearches) { + if (next.isGlobal()) { + continue; + } try { if (next.getSearchSubsystem() == SearchSubsystem.RESOURCE) { ResourceCriteria criteria = new ResourceCriteria();
commit 0cefa02502c348f4007d6f0f3cef0186cb2b194c Author: Joseph Marques joseph@redhat.com Date: Fri Jul 9 17:35:01 2010 -0400
BZ-601354: only offer resource/group suggestions specific to the active sub-tab (if any)
* this is a one-off fix for the next release only * this solution needs to be replaced by a generic solution that will filter suggestions by all known contextual data (i.e., other completed search terms)
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/SearchGWTService.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/SearchGWTService.java index be00e9c..00b1d73 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/SearchGWTService.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/SearchGWTService.java @@ -35,6 +35,9 @@ public interface SearchGWTService extends RemoteService { /* * search suggestions */ + List<SearchSuggestion> getTabAwareSuggestions(SearchSubsystem searchSubsystem, String expression, + int caretPosition, String tab); + List<SearchSuggestion> getSuggestions(SearchSubsystem searchSubsystem, String expression, int caretPosition);
/* diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/SearchBar.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/SearchBar.java index 13e5ec7..fb61df1 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/SearchBar.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/SearchBar.java @@ -89,6 +89,7 @@ public class SearchBar extends SimplePanel { private SearchSubsystem searchSubsystem; private String defaultSearchText; private String defaultSavedSearchPattern; + private String selectedTab;
private Element searchButton;
@@ -123,6 +124,8 @@ public class SearchBar extends SimplePanel {
String defaultSavedSearchPattern = searchBarElement.getAttribute("defaultSavedSearchPattern"); setDefaultSavedSearchPattern(defaultSavedSearchPattern); + + this.selectedTab = searchBarElement.getAttribute("subtab"); }
public SearchBar() { @@ -197,6 +200,10 @@ public class SearchBar extends SimplePanel { activateSavedSearch(defaultSavedSearchPattern); }
+ public String getSelectedTab() { + return selectedTab; + } + public String getDefaultSavedSearchPattern() { return defaultSavedSearchPattern; } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestTextBox_v3.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestTextBox_v3.java index dd37901..bce49e4 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestTextBox_v3.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestTextBox_v3.java @@ -581,28 +581,28 @@ public class SuggestTextBox_v3 extends Composite implements HasText, HasAllFocus String expression = suggestionRequest.getQuery(); int caretPosition = suggestionRequest.getCursorPosition();
- searchService.getSuggestions(searchBar.getSearchSubsystem(), expression, caretPosition, - new AsyncCallback<List<SearchSuggestion>>() { + searchService.getTabAwareSuggestions(searchBar.getSearchSubsystem(), expression, caretPosition, searchBar + .getSelectedTab(), new AsyncCallback<List<SearchSuggestion>>() {
- public void onSuccess(List<SearchSuggestion> results) { - adaptAndHandle(results.toArray(new SearchSuggestion[results.size()])); - } + public void onSuccess(List<SearchSuggestion> results) { + adaptAndHandle(results.toArray(new SearchSuggestion[results.size()])); + }
- public void onFailure(Throwable caught) { - SearchSuggestion errorInform = new SearchSuggestion(Kind.InstructionalTextComment, caught - .getMessage()); - adaptAndHandle(errorInform); - } + public void onFailure(Throwable caught) { + SearchSuggestion errorInform = new SearchSuggestion(Kind.InstructionalTextComment, caught + .getMessage()); + adaptAndHandle(errorInform); + }
- private void adaptAndHandle(SearchSuggestion... searchSuggestionResults) { - List<SearchSuggestionOracleAdapter> adaptedResults = new java.util.ArrayList<SearchSuggestionOracleAdapter>(); - for (SearchSuggestion next : searchSuggestionResults) { - adaptedResults.add(new SearchSuggestionOracleAdapter(next)); - } - SuggestOracle.Response response = new SuggestOracle.Response(adaptedResults); - callback.onSuggestionsReady(request, response); + private void adaptAndHandle(SearchSuggestion... searchSuggestionResults) { + List<SearchSuggestionOracleAdapter> adaptedResults = new java.util.ArrayList<SearchSuggestionOracleAdapter>(); + for (SearchSuggestion next : searchSuggestionResults) { + adaptedResults.add(new SearchSuggestionOracleAdapter(next)); } - }); + SuggestOracle.Response response = new SuggestOracle.Response(adaptedResults); + callback.onSuggestionsReady(request, response); + } + }); } }
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/SearchGWTServiceImpl.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/SearchGWTServiceImpl.java index 55b81ce..cff798c 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/SearchGWTServiceImpl.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/SearchGWTServiceImpl.java @@ -37,6 +37,13 @@ public class SearchGWTServiceImpl extends AbstractGWTServiceImpl implements Sear
private SavedSearchManagerLocal savedSearchManager = LookupUtil.getSavedSearchManager();
+ public List<SearchSuggestion> getTabAwareSuggestions(SearchSubsystem searchSubsystem, String expression, + int caretPosition, String tab) { + SearchAssistManager searchAssistManager = new SearchAssistManager(getSessionSubject(), searchSubsystem); + List<SearchSuggestion> results = searchAssistManager.getTabAwareSuggestions(expression, caretPosition, tab); + return results; + } + public List<SearchSuggestion> getSuggestions(SearchSubsystem searchSubsystem, String expression, int caretPosition) { SearchAssistManager searchAssistManager = new SearchAssistManager(getSessionSubject(), searchSubsystem); List<SearchSuggestion> results = searchAssistManager.getSuggestions(expression, caretPosition); diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/searchInterface.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/searchInterface.xhtml index 661cf8c..0c7022b 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/searchInterface.xhtml +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/searchInterface.xhtml @@ -15,6 +15,7 @@ searchSubsystem="#{searchSubsystem}" defaultSearchText="#{defaultSearchText}" defaultSavedSearchPattern="#{defaultSavedSearchPattern}" + subtab="#{subtab}" id="searchBar"> <div class="searchBarBackgroundContainer"> <div class="searchBarComponentsContainer"> diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseGroups.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseGroups.xhtml index 869b9dc..399ab6a 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseGroups.xhtml +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseGroups.xhtml @@ -45,6 +45,7 @@ <ui:param name="searchButtonId" value="browseGroupsForm:searchButtonJSF" /> <ui:param name="searchSubsystem" value="GROUP" /> <ui:param name="defaultSearchText" value="#{param.search}" /> + <ui:param name="subtab" value="${param.subtab}" /> </ui:include>
<a4j:commandButton id="searchButtonJSF" value="GO" diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseResources.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseResources.xhtml index 5fd39e5..fc6741e 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseResources.xhtml +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseResources.xhtml @@ -46,6 +46,7 @@ <ui:param name="searchSubsystem" value="RESOURCE" /> <ui:param name="defaultSearchText" value="#{param.search}" /> <ui:param name="defaultSavedSearchPattern" value="#{param.searchId}" /> + <ui:param name="subtab" value="${param.subtab}" /> </ui:include>
<a4j:commandButton id="searchButtonJSF" value="GO" diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/AbstractSearchAssistant.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/AbstractSearchAssistant.java index b948809..61faf42 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/AbstractSearchAssistant.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/AbstractSearchAssistant.java @@ -95,7 +95,7 @@ public abstract class AbstractSearchAssistant implements SearchAssistant { }
protected final String add(String fragment, String parameter) { - if (!parameter.equals("")) { + if (parameter != null && !parameter.equals("")) { return fragment; } return ""; diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/GroupSearchAssistant.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/GroupSearchAssistant.java index 96c10ec..cba008f 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/GroupSearchAssistant.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/GroupSearchAssistant.java @@ -8,7 +8,7 @@ import org.rhq.core.domain.measurement.AvailabilityType; import org.rhq.core.domain.resource.ResourceCategory; import org.rhq.core.domain.search.SearchSubsystem;
-public class GroupSearchAssistant extends AbstractSearchAssistant { +public class GroupSearchAssistant extends TabAwareSearchAssistant {
private static final List<String> parameterizedContexts; private static final List<String> simpleContexts; @@ -19,6 +19,10 @@ public class GroupSearchAssistant extends AbstractSearchAssistant { "name")); }
+ public GroupSearchAssistant(String tab) { + super(tab); + } + public SearchSubsystem getSearchSubsystem() { return SearchSubsystem.GROUP; } @@ -58,7 +62,8 @@ public class GroupSearchAssistant extends AbstractSearchAssistant { + " FROM ResourceType type, ResourceGroup rg " // + " WHERE rg.resourceType = type " // only suggest names that exist for visible groups in inventory + " AND rg.visible = true " // - + add(" AND LOWER(type.name) LIKE '%" + filter.toLowerCase() + "%'", filter) // + + add(" AND LOWER(rg.groupCategory) = '" + tab + "'", tab) // + + add(" AND LOWER(type.name) LIKE '%" + filter.toLowerCase() + "%'", filter) // + " ORDER BY type.name ");
} else if (context.equals("plugin")) { @@ -67,7 +72,8 @@ public class GroupSearchAssistant extends AbstractSearchAssistant { + " FROM ResourceType type, ResourceGroup rg " // + " WHERE rg.resourceType = type " // only suggest names that exist for visible groups in inventory + " AND rg.visible = true " // - + add(" AND LOWER(type.plugin) LIKE '%" + filter.toLowerCase() + "%'", filter) // + + add(" AND LOWER(rg.groupCategory) = '" + tab + "'", tab) // + + add(" AND LOWER(type.plugin) LIKE '%" + filter.toLowerCase() + "%'", filter) // + " ORDER BY type.plugin ");
} else if (context.equals("name")) { @@ -75,7 +81,8 @@ public class GroupSearchAssistant extends AbstractSearchAssistant { + "SELECT DISTINCT rg.name " // + " FROM ResourceGroup rg " // + " WHERE rg.visible = true " // only suggest names that exist for visible groups in inventory - + add(" AND LOWER(rg.name) LIKE '%" + filter.toLowerCase() + "%'", filter) // + + add(" AND LOWER(rg.groupCategory) = '" + tab + "'", tab) // + + add(" AND LOWER(rg.name) LIKE '%" + filter.toLowerCase() + "%'", filter) // + " ORDER BY rg.name ");
} else { diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/ResourceSearchAssistant.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/ResourceSearchAssistant.java index c03c7b5..e6552fc 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/ResourceSearchAssistant.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/ResourceSearchAssistant.java @@ -10,7 +10,7 @@ import org.rhq.core.domain.resource.ResourceCategory; import org.rhq.core.domain.search.SearchSubsystem; import org.rhq.core.domain.search.assist.AlertSearchAssistParam;
-public class ResourceSearchAssistant extends AbstractSearchAssistant { +public class ResourceSearchAssistant extends TabAwareSearchAssistant {
private static final List<String> parameterizedContexts; private static final List<String> simpleContexts; @@ -22,6 +22,10 @@ public class ResourceSearchAssistant extends AbstractSearchAssistant { "name")); }
+ public ResourceSearchAssistant(String tab) { + super(tab); + } + public SearchSubsystem getSearchSubsystem() { return SearchSubsystem.RESOURCE; } @@ -61,7 +65,8 @@ public class ResourceSearchAssistant extends AbstractSearchAssistant { + " FROM ResourceType type, Resource res " //" + " JOIN type.pluginConfigurationDefinition.propertyDefinitions definition " // + " WHERE res.resourceType = type " // only suggest names that exist for resources in inventory - + add(" AND LOWER(definition.name) LIKE '%" + filter.toLowerCase() + "%'", filter) // + + add(" AND LOWER(type.category) = '" + tab + "'", tab) // + + add(" AND LOWER(definition.name) LIKE '%" + filter.toLowerCase() + "%'", filter) // + " ORDER BY definition.name ");
} else if (context.equals("configuration")) { @@ -70,7 +75,8 @@ public class ResourceSearchAssistant extends AbstractSearchAssistant { + " FROM ResourceType type, Resource res " // + " JOIN type.resourceConfigurationDefinition.propertyDefinitions definition " // + " WHERE res.resourceType = type " // only suggest names that exist for resources in inventory - + add(" AND LOWER(definition.name) LIKE '%" + filter.toLowerCase() + "%'", filter) // + + add(" AND LOWER(type.category) = '" + tab + "'", tab) // + + add(" AND LOWER(definition.name) LIKE '%" + filter.toLowerCase() + "%'", filter) // + " ORDER BY definition.name ");
} else if (context.equals("trait")) { @@ -80,6 +86,7 @@ public class ResourceSearchAssistant extends AbstractSearchAssistant { + " JOIN ms.definition def " // + " WHERE ms.resource = res " // only suggest names that exist for resources in inventory + " AND def.dataType = 1 " // trait types + + add(" AND LOWER(res.resourceType.category) = '" + tab + "'", tab) // + add(" AND LOWER(def.name) LIKE '%" + filter.toLowerCase() + "%'", filter) // + " ORDER BY def.name ");
@@ -100,24 +107,28 @@ public class ResourceSearchAssistant extends AbstractSearchAssistant { } else if (context.equals("type")) { return execute("" // + "SELECT DISTINCT type.name " // - + " FROM Resource res " // - + " JOIN res.resourceType type " // - + add(" WHERE LOWER(type.name) LIKE '%" + filter.toLowerCase() + "%'", filter) // + + " FROM Resource res, ResourceType type " // + + " WHERE res.resourceType = type " // + + add(" AND LOWER(type.category) = '" + tab + "'", tab) // + + add(" AND LOWER(type.name) LIKE '%" + filter.toLowerCase() + "%'", filter) // + " ORDER BY type.name ");
} else if (context.equals("plugin")) { return execute("" // + "SELECT DISTINCT type.plugin " // - + " FROM Resource res " // - + " JOIN res.resourceType type " // - + add(" WHERE LOWER(type.plugin) LIKE '%" + filter.toLowerCase() + "%'", filter) // + + " FROM Resource res, ResourceType type " // + + " WHERE res.resourceType = type " // + + add(" AND LOWER(type.category) = '" + tab + "'", tab) // + + add(" AND LOWER(type.plugin) LIKE '%" + filter.toLowerCase() + "%'", filter) // + " ORDER BY type.plugin ");
} else if (context.equals("name")) { return execute("" // + "SELECT DISTINCT res.name " // - + " FROM Resource res " // - + add(" WHERE LOWER(res.name) LIKE '%" + filter.toLowerCase() + "%'", filter) // + + " FROM Resource res, ResourceType type " // + + " WHERE res.resourceType = type " // + + add(" AND LOWER(type.category) = '" + tab + "'", tab) // + + add(" AND LOWER(res.name) LIKE '%" + filter.toLowerCase() + "%'", filter) // + " ORDER BY res.name ");
} else if (context.equals("alerts")) { @@ -130,6 +141,7 @@ public class ResourceSearchAssistant extends AbstractSearchAssistant { + " JOIN res.pluginConfiguration.properties property " // suggest values for existing resources only + " WHERE simple.id = property.id " // + " AND LOWER(property.name) LIKE '%" + param.toLowerCase() + "%'" // + + add(" AND LOWER(res.resourceType.category) = '" + tab + "'", tab) // + add(" AND LOWER(property.stringValue) LIKE '%" + filter.toLowerCase() + "%'", filter) // + " ORDER BY simple.stringValue ");
@@ -140,6 +152,7 @@ public class ResourceSearchAssistant extends AbstractSearchAssistant { + " JOIN res.resourceConfiguration.properties property " // suggest values for existing resources only + " WHERE simple.id = property.id " // + " AND LOWER(property.name) LIKE '%" + param.toLowerCase() + "%'" // + + add(" AND LOWER(res.resourceType.category) = '" + tab + "'", tab) // + add(" AND LOWER(property.stringValue) LIKE '%" + filter.toLowerCase() + "%'", filter) // + " ORDER BY simple.stringValue ");
@@ -151,6 +164,7 @@ public class ResourceSearchAssistant extends AbstractSearchAssistant { + " WHERE ms.definition.dataType = 1 " // + " AND ms.resource = res " // only suggest values that exist for inventoried resources + " AND LOWER(ms.definition.name) LIKE '%" + param.toLowerCase() + "%'" // + + add(" AND LOWER(res.resourceType.category) = '" + tab + "'", tab) // + add(" AND LOWER(trait.value) LIKE '%" + filter.toLowerCase() + "%'", filter) // + " ORDER BY trait.value ");
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/SearchAssistantFactory.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/SearchAssistantFactory.java index 05ad883..9caafec 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/SearchAssistantFactory.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/SearchAssistantFactory.java @@ -9,9 +9,19 @@ public class SearchAssistantFactory {
public static SearchAssistant getAssistant(SearchSubsystem searchContext) { if (searchContext == SearchSubsystem.RESOURCE) { - return new ResourceSearchAssistant(); + return new ResourceSearchAssistant(null); } else if (searchContext == SearchSubsystem.GROUP) { - return new GroupSearchAssistant(); + return new GroupSearchAssistant(null); + } else { + throw new IllegalArgumentException("No SearchAssistant found for SearchSubsystem[" + searchContext + "]"); + } + } + + public static SearchAssistant getTabAwareAssistant(SearchSubsystem searchContext, String tab) { + if (searchContext == SearchSubsystem.RESOURCE) { + return new ResourceSearchAssistant(tab); + } else if (searchContext == SearchSubsystem.GROUP) { + return new GroupSearchAssistant(tab); } else { throw new IllegalArgumentException("No SearchAssistant found for SearchSubsystem[" + searchContext + "]"); } diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/TabAwareSearchAssistant.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/TabAwareSearchAssistant.java new file mode 100644 index 0000000..a68dc60 --- /dev/null +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/TabAwareSearchAssistant.java @@ -0,0 +1,15 @@ +package org.rhq.enterprise.server.search.assist; + +public abstract class TabAwareSearchAssistant extends AbstractSearchAssistant { + protected String tab; + + public TabAwareSearchAssistant(String tab) { + if (tab != null) { + tab = tab.trim().toLowerCase(); + if (tab.equals("")) { + tab = null; + } + } + this.tab = tab; + } +} diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java index 34eed0e..12e0619 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java @@ -347,6 +347,10 @@ public class SearchAssistManager { return SearchAssistantFactory.getAssistant(searchSubsystem); }
+ protected SearchAssistant getTabAwareSearchAssistant(String tab) { + return SearchAssistantFactory.getTabAwareAssistant(searchSubsystem, tab); + } + private List<String> getAllContexts() { List<String> results = new ArrayList<String>(getSearchAssistant().getSimpleContexts()); for (String parameterized : getSearchAssistant().getParameterizedContexts()) { @@ -356,6 +360,10 @@ public class SearchAssistManager { }
public List<SearchSuggestion> getSuggestions(String expression, int caretPos) { + return getTabAwareSuggestions(expression, caretPos, null); + } + + public List<SearchSuggestion> getTabAwareSuggestions(String expression, int caretPos, String tab) { List<SearchSuggestion> results = new ArrayList<SearchSuggestion>();
if (subject == null) { @@ -371,8 +379,8 @@ public class SearchAssistManager { expression = ""; }
- List<SearchSuggestion> simple = getSimpleSuggestions(expression, caretPos); - List<SearchSuggestion> advanced = getAdvancedSuggestions(expression, caretPos); + List<SearchSuggestion> simple = getSimpleSuggestions(expression, caretPos, tab); + List<SearchSuggestion> advanced = getAdvancedSuggestions(expression, caretPos, tab); List<SearchSuggestion> userSavedSearches = getUserSavedSearchSuggestions(expression); //List<SearchSuggestion> globalSavedSearches = getGlobalSavedSearchSuggestions(expression);
@@ -398,8 +406,8 @@ public class SearchAssistManager { return results; }
- public List<SearchSuggestion> getSimpleSuggestions(String expression, int caretPos) { - SearchAssistant completor = getSearchAssistant(); + public List<SearchSuggestion> getSimpleSuggestions(String expression, int caretPos, String tab) { + SearchAssistant completor = getTabAwareSearchAssistant(tab);
debug("getSimpleSuggestions: START");
@@ -424,8 +432,8 @@ public class SearchAssistManager { return suggestions; }
- public List<SearchSuggestion> getAdvancedSuggestions(String expression, int caretPos) { - SearchAssistant completor = getSearchAssistant(); + public List<SearchSuggestion> getAdvancedSuggestions(String expression, int caretPos, String tab) { + SearchAssistant completor = getTabAwareSearchAssistant(tab);
debug("getAdvancedSuggestions: START"); SearchTermAssistant assistant = new SearchTermAssistant(expression, caretPos); diff --git a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/search/GenericSearchAssistTest.java b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/search/GenericSearchAssistTest.java index 0a28dee..3570f56 100644 --- a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/search/GenericSearchAssistTest.java +++ b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/search/GenericSearchAssistTest.java @@ -37,7 +37,7 @@ public class GenericSearchAssistTest extends AbstractEJB3Test {
count++; List<SearchSuggestion> results = new TestAutoCompletionManager().getAdvancedSuggestions(expression, - expression.length()); + expression.length(), null); List<String> expectedResults = Arrays.asList(expected.split(" "));
System.out.println();
commit 0cb1c2429d8315e98d1ca264c51d06877159722e Author: John Mazzitelli mazz@redhat.com Date: Fri Jul 9 16:07:13 2010 -0400
BZ 601214 - fix classloading issue when a child deep in the hierarchy exists and the direct parents of two services are the same but the resources actually belong to two different servers (which is only known by looking higher up in ancestry)
diff --git a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/plugin/CanonicalResourceKey.java b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/plugin/CanonicalResourceKey.java index aadd1f8..12f777f 100644 --- a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/plugin/CanonicalResourceKey.java +++ b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/plugin/CanonicalResourceKey.java @@ -23,6 +23,8 @@ package org.rhq.core.pc.plugin;
import java.io.Serializable; +import java.util.ArrayList; +import java.util.List;
import org.rhq.core.clientapi.agent.PluginContainerException; import org.rhq.core.domain.resource.Resource; @@ -38,12 +40,8 @@ public class CanonicalResourceKey implements Serializable {
private static final long serialVersionUID = 1L;
- private final String resourceKey; - private final String resourceTypeName; - private final String resourcePlugin; - private final String parentKey; - private final String parentTypeName; - private final String parentPlugin; + private final KeyTypePlugin resourceKeyTypePlugin; + private final List<KeyTypePlugin> ancestorKeyTypePlugins;
public CanonicalResourceKey(Resource resource, Resource parent) throws PluginContainerException { if (resource == null) { @@ -53,92 +51,48 @@ public class CanonicalResourceKey implements Serializable { throw new PluginContainerException("parent must not be null"); }
- ResourceType resourceType = resource.getResourceType(); - ResourceType parentType = parent.getResourceType(); + this.resourceKeyTypePlugin = new KeyTypePlugin(resource.getResourceKey(), resource.getResourceType());
- if (resourceType == null) { - throw new PluginContainerException("resource type must not be null"); - } - if (parentType == null) { - throw new PluginContainerException("parent type must not be null"); - } - - this.resourceKey = resource.getResourceKey(); - this.resourceTypeName = resourceType.getName(); - this.resourcePlugin = resourceType.getPlugin(); - this.parentKey = parent.getResourceKey(); - this.parentTypeName = parentType.getName(); - this.parentPlugin = parentType.getPlugin(); - - if (this.resourceKey == null) { - throw new PluginContainerException("resource key must not be null"); - } - if (this.resourceTypeName == null) { - throw new PluginContainerException("resource type name must not be null"); - } - if (this.resourcePlugin == null) { - throw new PluginContainerException("resource plugin must not be null"); - } - - if (this.parentKey == null) { - throw new PluginContainerException("parent key must not be null"); - } - if (this.parentTypeName == null) { - throw new PluginContainerException("parent type name must not be null"); - } - if (this.parentPlugin == null) { - throw new PluginContainerException("parent plugin must not be null"); + this.ancestorKeyTypePlugins = new ArrayList<KeyTypePlugin>(5); + while (parent != null) { + KeyTypePlugin ktp = new KeyTypePlugin(parent.getResourceKey(), parent.getResourceType()); + this.ancestorKeyTypePlugins.add(ktp); + parent = parent.getParentResource(); } }
public String getResourceKey() { - return this.resourceKey; + return this.resourceKeyTypePlugin.key; }
public String getResourceTypeName() { - return this.resourceTypeName; + return this.resourceKeyTypePlugin.type; }
public String getResourcePlugin() { - return this.resourcePlugin; - } - - public String getParentKey() { - return this.parentKey; - } - - public String getParentTypeName() { - return this.parentTypeName; - } - - public String getParentPlugin() { - return this.parentPlugin; + return this.resourceKeyTypePlugin.plugin; }
@Override public String toString() { StringBuilder builder = new StringBuilder(); builder.append("["); - builder.append("resourceKey=").append(this.resourceKey).append(","); - builder.append("resourceTypeName=").append(this.resourceTypeName).append(","); - builder.append("resourcePlugin=").append(this.resourcePlugin).append(","); - builder.append("parentKey=").append(this.parentKey).append(","); - builder.append("parentTypeName=").append(this.parentTypeName).append(","); - builder.append("parentPlugin=").append(this.parentPlugin); + int ancestor = 0; + for (KeyTypePlugin ktp : this.ancestorKeyTypePlugins) { + builder.append("ancestor#").append(ancestor++).append("=").append(ktp).append(','); + } + builder.append("resource=").append(this.resourceKeyTypePlugin); builder.append("]"); return builder.toString(); }
@Override public int hashCode() { - final int prime = 31; int result = 1; - result = prime * result + this.resourceKey.hashCode(); - result = prime * result + this.resourceTypeName.hashCode(); - result = prime * result + this.resourcePlugin.hashCode(); - result = prime * result + this.parentKey.hashCode(); - result = prime * result + this.parentTypeName.hashCode(); - result = prime * result + this.parentPlugin.hashCode(); + result = 31 * result + this.resourceKeyTypePlugin.hashCode(); + for (KeyTypePlugin ktp : this.ancestorKeyTypePlugins) { + result = 31 * result + ktp.hashCode(); + } return result; }
@@ -153,30 +107,76 @@ public class CanonicalResourceKey implements Serializable {
CanonicalResourceKey other = (CanonicalResourceKey) obj;
- if (!this.resourceKey.equals(other.resourceKey)) { - return false; - } - - if (!this.resourceTypeName.equals(other.resourceTypeName)) { - return false; - } - - if (!this.resourcePlugin.equals(other.resourcePlugin)) { + if (!this.resourceKeyTypePlugin.equals(other.resourceKeyTypePlugin)) { return false; }
- if (!this.parentKey.equals(other.parentKey)) { + if (!this.ancestorKeyTypePlugins.equals(other.ancestorKeyTypePlugins)) { return false; }
- if (!this.parentTypeName.equals(other.parentTypeName)) { - return false; - } + return true; + }
- if (!this.parentPlugin.equals(other.parentPlugin)) { - return false; + private class KeyTypePlugin { + public final String key; + public final String type; + public final String plugin; + + KeyTypePlugin(String key, ResourceType type) throws PluginContainerException { + if (key == null) { + throw new PluginContainerException("key must not be null"); + } + if (type == null) { + throw new PluginContainerException("type must not be null"); + } + if (type.getName() == null) { + throw new PluginContainerException("type name must not be null"); + } + if (type.getPlugin() == null) { + throw new PluginContainerException("plugin must not be null"); + } + this.key = key; + this.type = type.getName(); + this.plugin = type.getPlugin(); + } + + @Override + public String toString() { + StringBuilder builder = new StringBuilder(); + builder.append("[key=").append(key).append(",type=").append(type).append(",plugin=").append(plugin).append( + "]"); + return builder.toString(); + } + + @Override + public int hashCode() { + int result = 1; + result = 31 * result + key.hashCode(); + result = 31 * result + type.hashCode(); + result = 31 * result + plugin.hashCode(); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof KeyTypePlugin)) { + return false; + } + KeyTypePlugin other = (KeyTypePlugin) obj; + if (!this.key.equals(other.key)) { + return false; + } + if (!this.plugin.equals(other.plugin)) { + return false; + } + if (!this.type.equals(other.type)) { + return false; + } + return true; } - - return true; } } diff --git a/modules/core/plugin-container/src/test/java/org/rhq/core/pc/plugin/CanonicalResourceKeyTest.java b/modules/core/plugin-container/src/test/java/org/rhq/core/pc/plugin/CanonicalResourceKeyTest.java new file mode 100644 index 0000000..8e0dc7f --- /dev/null +++ b/modules/core/plugin-container/src/test/java/org/rhq/core/pc/plugin/CanonicalResourceKeyTest.java @@ -0,0 +1,155 @@ +/* + * RHQ Management Platform + * Copyright (C) 2005-2010 Red Hat, Inc. + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License, version 2, as + * published by the Free Software Foundation, and/or the GNU Lesser + * General Public License, version 2.1, also as published by the Free + * Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License and the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License + * and the GNU Lesser General Public License along with this program; + * if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +package org.rhq.core.pc.plugin; + +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; + +import org.rhq.core.clientapi.agent.PluginContainerException; +import org.rhq.core.domain.resource.Resource; +import org.rhq.core.domain.resource.ResourceCategory; +import org.rhq.core.domain.resource.ResourceType; + +@Test +public class CanonicalResourceKeyTest { + private final String KEY1 = "key1"; + private final String KEY2 = "key2"; + private final String KEY3 = "key3"; + private final String KEY4 = "key4"; + private final String KEY5 = "key5"; + + private ResourceType resourceType1; + private ResourceType resourceType2; + private ResourceType resourceType3; + private ResourceType resourceType4; + private ResourceType resourceType5; + + private Resource resource1a; + private Resource resource1b; + private Resource resource2a; + private Resource resource2b; + private Resource resource3a; + private Resource resource3b; + private Resource resource4a; + private Resource resource4b; + private Resource resource5a; + private Resource resource5b; + + private final String KEYA = "keyA"; + private ResourceType resourceTypeA; + private Resource resourceA_1235; // resource whose ancestors's keys are 1,2,3,5 + private Resource resourceA_1245; // resource whose ancestors's keys are 1,2,4,5 + + @BeforeClass + public void setup() { + this.resourceType1 = new ResourceType("type1", "plugin", ResourceCategory.SERVER, null); + this.resourceType2 = new ResourceType("type2", "plugin", ResourceCategory.SERVER, null); + this.resourceType3 = new ResourceType("type3", "plugin", ResourceCategory.SERVER, null); + this.resourceType4 = new ResourceType("type4", "plugin", ResourceCategory.SERVER, null); + this.resourceType5 = new ResourceType("type5", "plugin", ResourceCategory.SERVER, null); + this.resourceTypeA = new ResourceType("typeA", "plugin", ResourceCategory.SERVER, null); + + this.resource1a = new Resource(KEY1, KEY1, this.resourceType1); + this.resource2a = new Resource(KEY2, KEY2, this.resourceType2); + this.resource3a = new Resource(KEY3, KEY3, this.resourceType3); + this.resource4a = new Resource(KEY4, KEY4, this.resourceType4); + this.resource5a = new Resource(KEY5, KEY5, this.resourceType5); + + this.resource1b = new Resource(KEY1, KEY1, this.resourceType1); + this.resource2b = new Resource(KEY2, KEY2, this.resourceType2); + this.resource3b = new Resource(KEY3, KEY3, this.resourceType3); + this.resource4b = new Resource(KEY4, KEY4, this.resourceType4); + this.resource5b = new Resource(KEY5, KEY5, this.resourceType5); + + this.resourceA_1235 = new Resource(KEYA, KEYA, this.resourceTypeA); + this.resourceA_1235.setParentResource(resource1a); + this.resource1a.setParentResource(resource2a); + this.resource2a.setParentResource(resource3a); + this.resource3a.setParentResource(resource5a); + + this.resourceA_1245 = new Resource(KEYA, KEYA, this.resourceTypeA); + this.resourceA_1245.setParentResource(resource1b); + this.resource1b.setParentResource(resource2b); + this.resource2b.setParentResource(resource4b); + this.resource4b.setParentResource(resource5b); + } + + public void testError() { + try { + new CanonicalResourceKey(null, null); + assert false : "should not be allowed to pass null"; + } catch (PluginContainerException ok) { + } + + try { + new CanonicalResourceKey(this.resource3b, null); + assert false : "should not be allowed to pass null"; + } catch (PluginContainerException ok) { + } + + try { + new CanonicalResourceKey(null, this.resource4a); + assert false : "should not be allowed to pass null"; + } catch (PluginContainerException ok) { + } + + try { + new CanonicalResourceKey(this.resource3b, this.resource4a); + } catch (Exception bad) { + throw new RuntimeException("should not throw error - both resources are valid", bad); + } + } + + public void testSimple() throws Exception { + CanonicalResourceKey key1a = new CanonicalResourceKey(this.resource1a, this.resource1a.getParentResource()); + assert key1a.equals(key1a); + assert key1a.hashCode() == key1a.hashCode(); + + CanonicalResourceKey key1a_dup = new CanonicalResourceKey(this.resource1a, this.resource1a.getParentResource()); + assert key1a.equals(key1a_dup); + assert key1a.hashCode() == key1a_dup.hashCode(); + + CanonicalResourceKey key2a = new CanonicalResourceKey(this.resource2a, this.resource2a.getParentResource()); + assert !key1a.equals(key2a); + assert key1a.hashCode() != key2a.hashCode(); + } + + public void testAncestorDiff() throws Exception { + // this test shows that even if a resource and its direct parent are the same as another resource/parent pair, that + // the equals and hashCode methods will know that the ancestors make each canonical resource key unique + CanonicalResourceKey key1a = new CanonicalResourceKey(this.resourceA_1235, this.resourceA_1235 + .getParentResource()); + assert key1a.equals(key1a); + assert key1a.hashCode() == key1a.hashCode(); + + CanonicalResourceKey key1a_dup = new CanonicalResourceKey(this.resourceA_1235, this.resourceA_1235 + .getParentResource()); + assert key1a.equals(key1a_dup); + assert key1a.hashCode() == key1a_dup.hashCode(); + + CanonicalResourceKey key2a = new CanonicalResourceKey(this.resourceA_1245, this.resourceA_1245 + .getParentResource()); + assert !key1a.equals(key2a); + assert key1a.hashCode() != key2a.hashCode(); + } +}
commit 538ebdae24cd90e127002e9d203386b700b910c8 Author: Jay Shaughnessy jshaughn@redhat.com Date: Fri Jul 9 15:01:34 2010 -0400
[bz 611749] Get the BundleSelector search filter to work more like our other search filters, namely treating the typed string as a substring match. It was currently requiring an exact match. This requires using smartgwt's AdvancedCriteria, as opposed to just Criteria. Note, this class seems to be fickle, the only way it behaved was to pass the Criterion in the constructor. Applied the same change to ResourceSelector and ResourceGroupSelector.
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/BundleSelector.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/BundleSelector.java index 1a32d4b..e1b94f0 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/BundleSelector.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/BundleSelector.java @@ -22,7 +22,10 @@ import java.util.ArrayList; import java.util.Collection;
import com.google.gwt.user.client.rpc.AsyncCallback; +import com.smartgwt.client.data.AdvancedCriteria; import com.smartgwt.client.data.Criteria; +import com.smartgwt.client.data.Criterion; +import com.smartgwt.client.types.OperatorId; import com.smartgwt.client.widgets.form.DynamicForm; import com.smartgwt.client.widgets.form.fields.SelectItem; import com.smartgwt.client.widgets.form.fields.TextItem; @@ -78,11 +81,17 @@ public class BundleSelector extends AbstractSelector<Bundle> { }
protected Criteria getLatestCriteria(DynamicForm availableFilterForm) { - Criteria latestCriteria = new Criteria(); - Object search = availableFilterForm.getValue("search"); - Object bundleType = availableFilterForm.getValue("bundleType"); - latestCriteria.setAttribute("name", search); - latestCriteria.setAttribute("bundleType", bundleType); + String search = (String) availableFilterForm.getValue("search"); + String bundleType = (String) availableFilterForm.getValue("bundleType"); + ArrayList<Criterion> criteria = new ArrayList<Criterion>(2); + if (null != search) { + criteria.add(new Criterion("name", OperatorId.CONTAINS, search)); + } + if (null != bundleType) { + criteria.add(new Criterion("bundleType", OperatorId.EQUALS, bundleType)); + } + AdvancedCriteria latestCriteria = new AdvancedCriteria(OperatorId.AND, criteria.toArray(new Criterion[criteria + .size()]));
return latestCriteria; } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/selection/ResourceGroupSelector.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/selection/ResourceGroupSelector.java index d373ac6..5c3c007 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/selection/ResourceGroupSelector.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/selection/ResourceGroupSelector.java @@ -18,9 +18,13 @@ */ package org.rhq.enterprise.gui.coregui.client.inventory.resource.selection;
+import java.util.ArrayList; import java.util.Collection;
+import com.smartgwt.client.data.AdvancedCriteria; import com.smartgwt.client.data.Criteria; +import com.smartgwt.client.data.Criterion; +import com.smartgwt.client.types.OperatorId; import com.smartgwt.client.widgets.form.DynamicForm; import com.smartgwt.client.widgets.form.fields.SelectItem; import com.smartgwt.client.widgets.form.fields.SpacerItem; @@ -28,7 +32,6 @@ import com.smartgwt.client.widgets.form.fields.TextItem; import com.smartgwt.client.widgets.grid.ListGridRecord;
import org.rhq.core.domain.resource.group.ResourceGroup; -import org.rhq.core.domain.util.PageList; import org.rhq.enterprise.gui.coregui.client.inventory.groups.ResourceGroupsDataSource; import org.rhq.enterprise.gui.coregui.client.util.RPCDataSource;
@@ -60,11 +63,17 @@ public class ResourceGroupSelector extends AbstractSelector<ResourceGroup> { }
protected Criteria getLatestCriteria(DynamicForm availableFilterForm) { - Criteria latestCriteria = new Criteria(); - Object search = availableFilterForm.getValue("search"); - Object category = availableFilterForm.getValue("groupCategory"); - latestCriteria.setAttribute("name", search); - latestCriteria.setAttribute("category", category); + String search = (String) availableFilterForm.getValue("search"); + String category = (String) availableFilterForm.getValue("groupCategory"); + ArrayList<Criterion> criteria = new ArrayList<Criterion>(2); + if (null != search) { + criteria.add(new Criterion("name", OperatorId.CONTAINS, search)); + } + if (null != category) { + criteria.add(new Criterion("category", OperatorId.EQUALS, category)); + } + AdvancedCriteria latestCriteria = new AdvancedCriteria(OperatorId.AND, criteria.toArray(new Criterion[criteria + .size()]));
return latestCriteria; } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/selection/ResourceSelector.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/selection/ResourceSelector.java index 015b377..a692a2f 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/selection/ResourceSelector.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/selection/ResourceSelector.java @@ -18,9 +18,13 @@ */ package org.rhq.enterprise.gui.coregui.client.inventory.resource.selection;
+import java.util.ArrayList; import java.util.Collection;
+import com.smartgwt.client.data.AdvancedCriteria; import com.smartgwt.client.data.Criteria; +import com.smartgwt.client.data.Criterion; +import com.smartgwt.client.types.OperatorId; import com.smartgwt.client.widgets.form.DynamicForm; import com.smartgwt.client.widgets.form.fields.IPickTreeItem; import com.smartgwt.client.widgets.form.fields.SelectItem; @@ -85,17 +89,27 @@ public class ResourceSelector extends AbstractSelector<Resource> { }
protected Criteria getLatestCriteria(DynamicForm availableFilterForm) { - Criteria latestCriteria = new Criteria(); - latestCriteria.setAttribute("name", availableFilterForm.getValue("search")); - - // If its a number its a typeId, otherwise a plugin name - try { - Integer.parseInt((String) availableFilterForm.getValue("type")); - latestCriteria.setAttribute("type", availableFilterForm.getValue("type")); - } catch (NumberFormatException nfe) { - latestCriteria.setAttribute("plugin", availableFilterForm.getValue("type")); + String search = (String) availableFilterForm.getValue("search"); + String type = (String) availableFilterForm.getValue("type"); + String category = (String) availableFilterForm.getValue("category"); + ArrayList<Criterion> criteria = new ArrayList<Criterion>(3); + if (null != search) { + criteria.add(new Criterion("name", OperatorId.CONTAINS, search)); } - latestCriteria.setAttribute("category", availableFilterForm.getValue("category")); + if (null != type) { + // If type is a number its a typeId, otherwise a plugin name + try { + Integer.parseInt(type); + criteria.add(new Criterion("type", OperatorId.EQUALS, type)); + } catch (NumberFormatException nfe) { + criteria.add(new Criterion("plugin", OperatorId.EQUALS, type)); + } + } + if (null != category) { + criteria.add(new Criterion("category", OperatorId.EQUALS, category)); + } + AdvancedCriteria latestCriteria = new AdvancedCriteria(OperatorId.AND, criteria.toArray(new Criterion[criteria + .size()]));
return latestCriteria; }
commit 38c428b88f9b3b322bfc6de73efb3750c163cc04 Merge: 7999505... 3d4ecf9... Author: John Sanda jsanda@redhat.com Date: Fri Jul 9 09:37:07 2010 -0400
Merge branch 'release-3.0.0' of ssh://git.fedorahosted.org/git/rhq/rhq into release-3.0.0
commit 7999505fd2f2888dfd915e4e6b219ae173bfe6ef Author: John Sanda jsanda@redhat.com Date: Fri Jul 9 09:36:16 2010 -0400
Removing unecessary comments that were present only for review
diff --git a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/mapping/ApacheAugeasMapping.java b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/mapping/ApacheAugeasMapping.java index bd9b3c3..8146de9 100644 --- a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/mapping/ApacheAugeasMapping.java +++ b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/mapping/ApacheAugeasMapping.java @@ -79,14 +79,6 @@ public class ApacheAugeasMapping implements RhqAugeasMapping { DirectiveMapping mapping = ApacheDirectiveRegExpression.getMappingType(propDef.getName()); ConfigurationDefinition def = new ConfigurationDefinition("temp",""); def.put(propDef); - // Removing call to create new configuration as this was causing the TransientObjectException discussed - // in https://bugzilla.redhat.com/show_bug.cgi?id=601153. It is not clear to why this configuration object - // is created. Since I am not familiar with the augeas code, I need to consult with Filip on this change. - // - // jsanda - -// Configuration configuration = new Configuration(); -// configuration.put(config.get(propDef.getName())); mapping.mapToAugeas(tree, node, config, def); } }
commit 3d4ecf9e7243a0641712147102d481709e13fba7 Author: Heiko W. Rupp hwr@redhat.com Date: Fri Jul 9 14:44:21 2010 +0200
BZ 604716,604714 - disable alerts and favorites in the Footer.
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/Footer.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/Footer.java index ca88567..559f223 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/Footer.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/Footer.java @@ -70,9 +70,9 @@ public class Footer extends ToolStrip {
addMember(new ToolStripSeparator());
- addMember(new FavoritesButton()); - - addMember(new AlertsMessage()); +// addMember(new FavoritesButton()); + +// addMember(new AlertsMessage());
}
commit 5859a837d07167c1ea05ff08b501ab8104b0bf37 Author: Joseph Marques joseph@redhat.com Date: Thu Jul 8 18:56:10 2010 -0400
BZ-610107: ensure search expression for translation into JPQL is whitespace-trimmed and non-null
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchTranslationManager.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchTranslationManager.java index 8893977..53f1f87 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchTranslationManager.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchTranslationManager.java @@ -46,6 +46,11 @@ public class SearchTranslationManager { }
public void setExpression(String expression) { + if (expression == null) { + expression = ""; + } else { + expression = expression.trim(); + } this.expression = expression;
this.translator = SearchTranslatorFactory.getTranslator(this.context);
commit cf3e4987ebe4bd2d8d9a6d0b00750777885c4edd Author: Joseph Marques joseph@redhat.com Date: Thu Jul 8 18:55:16 2010 -0400
remove main method used for debugging long ago
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchTranslationManager.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchTranslationManager.java index e8099dc..8893977 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchTranslationManager.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchTranslationManager.java @@ -286,10 +286,4 @@ public class SearchTranslationManager { return builder.toString(); } } - - public static void main(String[] args) throws Exception { - SearchTranslationManager manager = new SearchTranslationManager(SearchSubsystem.RESOURCE); - manager.setExpression("(name = rhq and category = server) or plugin = jbossas"); - String jpql = manager.getJPQLSelectStatement(); - } }
commit 86e7669b628a750989a344e05dfe3e37b884f254 Author: Joseph Marques joseph@redhat.com Date: Thu Jul 8 18:45:57 2010 -0400
BZ-610155: relax suggestion matching, suppress "empty" results
* only suggest plugin configuration param names for inventoried resources * only suggest resource configuration param names for inventoried resources * only suggest trait names for inventoried resources
* only suggest type values for inventoried resources * only suggest plugin values for inventoried resources * only suggest plugin configuration values for inventoried resources with the specific plugin configuration param name, case-insensitively (relaxed) * only suggest resourceplugin configuration values for inventoried resources with the specific resourceplugin configuration param name, case-insensitively (relaxed) * only suggest trait values for inventoried resources with the specific trait param name, case-insensitively (relaxed)
* only suggest type values for visible groups in inventory * only suggest plugin values for visible groups in inventory
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/GroupSearchAssistant.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/GroupSearchAssistant.java index 7f46e11..96c10ec 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/GroupSearchAssistant.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/GroupSearchAssistant.java @@ -55,22 +55,26 @@ public class GroupSearchAssistant extends AbstractSearchAssistant { } else if (context.equals("type")) { return execute("" // + "SELECT DISTINCT type.name " // - + " FROM ResourceType type " // - + add(" WHERE LOWER(type.name) LIKE '%" + filter.toLowerCase() + "%'", filter) // + + " FROM ResourceType type, ResourceGroup rg " // + + " WHERE rg.resourceType = type " // only suggest names that exist for visible groups in inventory + + " AND rg.visible = true " // + + add(" AND LOWER(type.name) LIKE '%" + filter.toLowerCase() + "%'", filter) // + " ORDER BY type.name ");
} else if (context.equals("plugin")) { return execute("" // + "SELECT DISTINCT type.plugin " // - + " FROM ResourceType type " // - + add(" WHERE LOWER(type.plugin) LIKE '%" + filter.toLowerCase() + "%'", filter) // + + " FROM ResourceType type, ResourceGroup rg " // + + " WHERE rg.resourceType = type " // only suggest names that exist for visible groups in inventory + + " AND rg.visible = true " // + + add(" AND LOWER(type.plugin) LIKE '%" + filter.toLowerCase() + "%'", filter) // + " ORDER BY type.plugin ");
} else if (context.equals("name")) { return execute("" // + "SELECT DISTINCT rg.name " // + " FROM ResourceGroup rg " // - + " WHERE rg.visible = true " // + + " WHERE rg.visible = true " // only suggest names that exist for visible groups in inventory + add(" AND LOWER(rg.name) LIKE '%" + filter.toLowerCase() + "%'", filter) // + " ORDER BY rg.name ");
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/ResourceSearchAssistant.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/ResourceSearchAssistant.java index 3be47bc..c03c7b5 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/ResourceSearchAssistant.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/ResourceSearchAssistant.java @@ -58,26 +58,30 @@ public class ResourceSearchAssistant extends AbstractSearchAssistant { } else if (context.equals("connection")) { return execute("" // + "SELECT DISTINCT definition.name " // - + " FROM ResourceType type " // + + " FROM ResourceType type, Resource res " //" + " JOIN type.pluginConfigurationDefinition.propertyDefinitions definition " // - + add(" WHERE LOWER(definition.name) LIKE '%" + filter.toLowerCase() + "%'", filter) // + + " WHERE res.resourceType = type " // only suggest names that exist for resources in inventory + + add(" AND LOWER(definition.name) LIKE '%" + filter.toLowerCase() + "%'", filter) // + " ORDER BY definition.name ");
} else if (context.equals("configuration")) { return execute("" // + "SELECT DISTINCT definition.name " // - + " FROM ResourceType type " // + + " FROM ResourceType type, Resource res " // + " JOIN type.resourceConfigurationDefinition.propertyDefinitions definition " // - + add(" WHERE LOWER(definition.name) LIKE '%" + filter.toLowerCase() + "%'", filter) // + + " WHERE res.resourceType = type " // only suggest names that exist for resources in inventory + + add(" AND LOWER(definition.name) LIKE '%" + filter.toLowerCase() + "%'", filter) // + " ORDER BY definition.name ");
} else if (context.equals("trait")) { return execute("" // - + "SELECT DISTINCT definition.name " // - + " FROM MeasurementDefinition definition " // - + " WHERE definition.dataType = 1 " // - + add(" AND LOWER(definition.name) LIKE '%" + filter.toLowerCase() + "%'", filter) // - + " ORDER BY definition.name "); + + "SELECT DISTINCT def.name " // + + " FROM MeasurementSchedule ms, Resource res " // + + " JOIN ms.definition def " // + + " WHERE ms.resource = res " // only suggest names that exist for resources in inventory + + " AND def.dataType = 1 " // trait types + + add(" AND LOWER(def.name) LIKE '%" + filter.toLowerCase() + "%'", filter) // + + " ORDER BY def.name ");
} else { return Collections.emptyList(); @@ -96,14 +100,16 @@ public class ResourceSearchAssistant extends AbstractSearchAssistant { } else if (context.equals("type")) { return execute("" // + "SELECT DISTINCT type.name " // - + " FROM ResourceType type " // + + " FROM Resource res " // + + " JOIN res.resourceType type " // + add(" WHERE LOWER(type.name) LIKE '%" + filter.toLowerCase() + "%'", filter) // + " ORDER BY type.name ");
} else if (context.equals("plugin")) { return execute("" // + "SELECT DISTINCT type.plugin " // - + " FROM ResourceType type " // + + " FROM Resource res " // + + " JOIN res.resourceType type " // + add(" WHERE LOWER(type.plugin) LIKE '%" + filter.toLowerCase() + "%'", filter) // + " ORDER BY type.plugin ");
@@ -121,9 +127,9 @@ public class ResourceSearchAssistant extends AbstractSearchAssistant { return execute("" // + "SELECT DISTINCT simple.stringValue " // + " FROM Resource res, PropertySimple simple " // - + " JOIN res.pluginConfiguration.properties property " // + + " JOIN res.pluginConfiguration.properties property " // suggest values for existing resources only + " WHERE simple.id = property.id " // - + " AND LOWER(property.name) LIKE '%" + param + "%'" // + + " AND LOWER(property.name) LIKE '%" + param.toLowerCase() + "%'" // + add(" AND LOWER(property.stringValue) LIKE '%" + filter.toLowerCase() + "%'", filter) // + " ORDER BY simple.stringValue ");
@@ -131,18 +137,20 @@ public class ResourceSearchAssistant extends AbstractSearchAssistant { return execute("" // + "SELECT DISTINCT simple.stringValue " // + " FROM Resource res, PropertySimple simple " // - + " JOIN res.resourceConfiguration.properties property " // + + " JOIN res.resourceConfiguration.properties property " // suggest values for existing resources only + " WHERE simple.id = property.id " // - + " AND LOWER(property.name) LIKE '%" + param + "%'" // + + " AND LOWER(property.name) LIKE '%" + param.toLowerCase() + "%'" // + add(" AND LOWER(property.stringValue) LIKE '%" + filter.toLowerCase() + "%'", filter) // + " ORDER BY simple.stringValue ");
} else if (context.equals("trait")) { return execute("" // - + "SELECT trait.value " // - + " FROM MeasurementDataTrait trait " // - + " WHERE trait.schedule.definition.dataType = 1 " // - + " AND LOWER(trait.schedule.definition.name) LIKE '%" + param + "%'" // + + "SELECT DISTINCT trait.value " // + + " FROM MeasurementDataTrait trait, Resource res " // + + " JOIN trait.schedule ms " // + + " WHERE ms.definition.dataType = 1 " // + + " AND ms.resource = res " // only suggest values that exist for inventoried resources + + " AND LOWER(ms.definition.name) LIKE '%" + param.toLowerCase() + "%'" // + add(" AND LOWER(trait.value) LIKE '%" + filter.toLowerCase() + "%'", filter) // + " ORDER BY trait.value ");
commit a01b65dc8559ee7be3f2914364d201000a75f9c2 Author: Ian Springer ian.springer@redhat.com Date: Thu Jul 8 17:40:40 2010 -0400
add i18n infrastructure to coregui and i19n about box as an example; expose product info properties via a server SLSB API that can be used by coregui - the properties are stored in a properties file, which can easily be replaced in the JON build - this allows us to display the correct product name, version, and build number in the coregui About box (fix for https://bugzilla.redhat.com/show_bug.cgi?id=604679)
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/common/ProductInfo.java b/modules/core/domain/src/main/java/org/rhq/core/domain/common/ProductInfo.java new file mode 100644 index 0000000..29aa74e --- /dev/null +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/common/ProductInfo.java @@ -0,0 +1,121 @@ +/* + * RHQ Management Platform + * Copyright (C) 2010 Red Hat, Inc. + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ +package org.rhq.core.domain.common; + +import java.io.Serializable; + +/** + * Product (i.e. RHQ or JON) information. + * + * @author Ian Springer + */ +public class ProductInfo implements Serializable { + private static final long serialVersionUID = 1L; + + private String shortName; + private String name; + private String fullName; + private String url; + private String urlDomain; + private String salesEmail; + private String supportEmail; + private String version; + private String buildNumber; + private String helpDocRoot; + + public String getShortName() { + return shortName; + } + + public void setShortName(String shortName) { + this.shortName = shortName; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getFullName() { + return fullName; + } + + public void setFullName(String fullName) { + this.fullName = fullName; + } + + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + + public String getUrlDomain() { + return urlDomain; + } + + public void setUrlDomain(String urlDomain) { + this.urlDomain = urlDomain; + } + + public String getSalesEmail() { + return salesEmail; + } + + public void setSalesEmail(String salesEmail) { + this.salesEmail = salesEmail; + } + + public String getSupportEmail() { + return supportEmail; + } + + public void setSupportEmail(String supportEmail) { + this.supportEmail = supportEmail; + } + + public String getVersion() { + return version; + } + + public void setVersion(String version) { + this.version = version; + } + + public String getBuildNumber() { + return buildNumber; + } + + public void setBuildNumber(String buildNumber) { + this.buildNumber = buildNumber; + } + + public String getHelpDocRoot() { + return helpDocRoot; + } + + public void setHelpDocRoot(String helpDocRoot) { + this.helpDocRoot = helpDocRoot; + } +} diff --git a/modules/enterprise/gui/coregui/pom.xml b/modules/enterprise/gui/coregui/pom.xml index ca1b68d..acbe21f 100644 --- a/modules/enterprise/gui/coregui/pom.xml +++ b/modules/enterprise/gui/coregui/pom.xml @@ -17,23 +17,13 @@
<scm> <connection>scm:git:ssh://git.fedorahosted.org/git/rhq.git/modules/enterprise/gui/coregui/</connection> - <developerConnection>scm:git:ssh://git.fedorahosted.org/git/rhq.git/modules/enterprise/gui/coregui/ - </developerConnection> + <developerConnection>scm:git:ssh://git.fedorahosted.org/git/rhq.git/modules/enterprise/gui/coregui/</developerConnection> </scm>
<properties> <!-- dependency versions --> <gwt.version>2.0.3</gwt.version> - - <product.shortName>RHQ</product.shortName> - <product.name>RHQ</product.name> - <product.fullName>RHQ</product.fullName> - <product.url.domain>rhq-project.org</product.url.domain> - <product.sales.email>sales@rhq-project.org</product.sales.email> - <product.support.email>info@rhq-project.org</product.support.email> - <product.version>${project.version}</product.version> - <product.help.doc.root>http://support.rhq-project.org/display/RHQ/</product.help.doc.root>
<!-- If this is too much memory to allocate to your gwt:debug process then override this property in in your settings.xml --> @@ -212,6 +202,28 @@
<plugins>
+ <plugin> + <artifactId>maven-resources-plugin</artifactId> + <executions> + <execution> + <id>copy-resources</id> + <phase>process-resources</phase> + <goals> + <goal>copy-resources</goal> + </goals> + <configuration> + <outputDirectory>${project.build.directory}/generated-sources/gwt</outputDirectory> + <resources> + <resource> + <directory>src/main/resources</directory> + <filtering>true</filtering> + </resource> + </resources> + </configuration> + </execution> + </executions> + </plugin> + <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>gwt-maven-plugin</artifactId> @@ -229,23 +241,22 @@ <hostedWebapp>target/hostedwar</hostedWebapp> <debugSuspend>false</debugSuspend> <servicePattern>**/gwt/*GWTService.java</servicePattern> - + <i18nMessagesBundle>org.rhq.enterprise.gui.coregui.client.Messages</i18nMessagesBundle> </configuration> + <executions> <execution> - <goals> <goal>compile</goal> <goal>generateAsync</goal> + <goal>i18n</goal> </goals> </execution> </executions> </plugin>
- <plugin> <artifactId>maven-war-plugin</artifactId> - <version>2.1-beta-1</version> <configuration> <archive> <manifest> @@ -268,7 +279,6 @@ <!-- <plugin> <artifactId>maven-antrun-plugin</artifactId> - <version>1.1</version> <executions> <execution> <id>Generate I18N Resource Bundles</id> @@ -331,7 +341,6 @@
<plugin> <artifactId>maven-antrun-plugin</artifactId> - <version>1.1</version> <executions>
<execution> diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml index b0e8afa..a7782bf 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml @@ -4,6 +4,7 @@ <module>
<inherits name='com.google.gwt.user.User'/> + <inherits name='com.google.gwt.i18n.I18N'/> <inherits name='org.rhq.core.RHQDomain'/>
<inherits name='com.smartgwt.SmartGwt' /> @@ -40,7 +41,7 @@ <!--<set-property name="user.agent" value="safari"/>-->
<!-- Firefox 3 --> - <!-- <set-property name="user.agent" value="gecko1_8"/>--> + <set-property name="user.agent" value="gecko1_8"/>
<entry-point class='org.rhq.enterprise.gui.coregui.client.CoreGUI'/> @@ -63,6 +64,7 @@ <servlet path="/RoleGWTService" class="org.rhq.enterprise.gui.coregui.server.gwt.RoleGWTServiceImpl"/> <servlet path="/SearchGWTService" class="org.rhq.enterprise.gui.coregui.server.gwt.SearchGWTServiceImpl"/> <servlet path="/SubjectGWTService" class="org.rhq.enterprise.gui.coregui.server.gwt.SubjectGWTServiceImpl"/> + <servlet path="/SystemGWTService" class="org.rhq.enterprise.gui.coregui.server.gwt.SystemGWTServiceImpl"/> <servlet path="/TagGWTService" class="org.rhq.enterprise.gui.coregui.server.gwt.TagGWTServiceImpl"/>
</module> \ No newline at end of file diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java index 68d34f4..42f8a2c 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/CoreGUI.java @@ -1,3 +1,21 @@ +/* + * RHQ Management Platform + * Copyright (C) 2005-2010 Red Hat, Inc. + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ package org.rhq.enterprise.gui.coregui.client;
import com.google.gwt.core.client.EntryPoint; @@ -23,6 +41,7 @@ import com.smartgwt.client.widgets.Canvas; import com.smartgwt.client.widgets.layout.VLayout;
import org.rhq.core.domain.auth.Subject; +import org.rhq.core.domain.common.ProductInfo; import org.rhq.core.domain.criteria.SubjectCriteria; import org.rhq.core.domain.util.PageList; import org.rhq.enterprise.gui.coregui.client.admin.AdministrationView; @@ -67,6 +86,10 @@ public class CoreGUI implements EntryPoint, ValueChangeHandler<String> {
private static CoreGUI coreGUI;
+ private static Messages messages; + + private static ProductInfo productInfo; + public void onModuleLoad() { if (GWT.getHostPageBaseURL().indexOf("/coregui/") == -1) { System.out.println("Suppressing load of CoreGUI module"); @@ -94,9 +117,11 @@ public class CoreGUI implements EntryPoint, ValueChangeHandler<String> {
messageCenter = new MessageCenter();
+ messages = GWT.create(Messages.class);
checkLoginStatus();
+ }
@@ -267,13 +292,13 @@ public class CoreGUI implements EntryPoint, ValueChangeHandler<String> { }
public static void setSessionSubject(Subject subject) { - // TODO this breaks because of reattach rules, bizarely even in queries. gonna switch out to non-subject include apis + // TODO this breaks because of reattach rules, bizarrely even in queries. gonna switch out to non-subject include apis // Create a minimized session object for validation on requests // Subject s = new Subject(subject.getName(),subject.getFactive(), subject.getFsystem()); // s.setSessionId(subject.getSessionId()); CoreGUI.sessionSubject = subject; CoreGUI.userPreferences = new UserPreferences(subject); - coreGUI.buildCoreUI(); + loadProductInfo(); }
public static void setContent(Canvas newContent) { @@ -296,6 +321,27 @@ public class CoreGUI implements EntryPoint, ValueChangeHandler<String> { breadCrumbTrailPane.refresh(currentViewPath); }
+ public static Messages getMessages() { + return messages; + } + + public static ProductInfo getProductInfo() { + return productInfo; + } + + private static void loadProductInfo() { + GWTServiceLookup.getSystemService().getProductInfo(new AsyncCallback<ProductInfo>() { + public void onFailure(Throwable caught) { + CoreGUI.getErrorHandler().handleError("Failed to load product information.", caught); + } + + public void onSuccess(ProductInfo result) { + productInfo = result; + coreGUI.buildCoreUI(); + } + }); + } + private class RootCanvas extends VLayout implements BookmarkableView {
ViewId currentViewId; diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/AboutModalWindow.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/AboutModalWindow.java index d38ea91..7aa6dff 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/AboutModalWindow.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/AboutModalWindow.java @@ -28,6 +28,9 @@ import com.smartgwt.client.widgets.events.ClickEvent; import com.smartgwt.client.widgets.events.ClickHandler; import com.smartgwt.client.widgets.layout.HLayout; import com.smartgwt.client.widgets.layout.VLayout; +import org.rhq.core.domain.common.ProductInfo; +import org.rhq.enterprise.gui.coregui.client.CoreGUI; +import org.rhq.enterprise.gui.coregui.client.Messages;
/** * The "About RHQ" modal window. @@ -35,12 +38,13 @@ import com.smartgwt.client.widgets.layout.VLayout; * @author Ian Springer */ public class AboutModalWindow extends Window { - private static final String TITLE = "About RHQ"; + private static final Messages MESSAGES = CoreGUI.getMessages(); + private static final ProductInfo PRODUCT_INFO = CoreGUI.getProductInfo();
public AboutModalWindow() { - setTitle(TITLE); + setTitle(MESSAGES.about_title(PRODUCT_INFO.getFullName())); setWidth(300); - setHeight(240); + setHeight(255); setOverflow(Overflow.VISIBLE); setShowMinimizeButton(false); setIsModal(true); @@ -62,23 +66,27 @@ public class AboutModalWindow extends Window { HTMLFlow htmlFlow = new HTMLFlow(); String html = "<span class="DisplaySubhead">\n" + - " <a href="http://rhq-project.org/%5C" title="RHQ Homepage" target="_blank">RHQ</a>\n" + + " <a href="" + PRODUCT_INFO.getUrl() + "" title="" + PRODUCT_INFO.getFullName() + " " + + MESSAGES.about_homepage() + "" target="_blank">" + PRODUCT_INFO.getFullName() + "</a>\n" + "</span><br/>\n" + - "<span class="DisplayLabel">Version: 3.0.0-SNAPSHOT</span><br/>\n" + - "<span class="DisplayLabel">Build Number: 0</span>\n" + - "<p><a href="http://jboss.org/%5C" title="JBoss Homepage">\n" + - " <img height="55" alt="JBoss by Red Hat" src="/images/jboss_logo.png">\n" + + "<span class="DisplayLabel">" + MESSAGES.about_version() + " " + PRODUCT_INFO.getVersion() + + "</span><br/>\n" + + "<span class="DisplayLabel">" + MESSAGES.about_buildNumber() + " " + PRODUCT_INFO.getBuildNumber() + + "</span>\n" + + "<p><a href="http://jboss.org/%5C" title="JBoss " + MESSAGES.about_homepage() + "">\n" + + " <img height="55" alt="" + MESSAGES.about_jbossByRedHat() + "" src="/images/jboss_logo.png">\n" + "</a></p>\n" + - "<div style="top-margin: 10px">All rights reserved.</div>\n"; + "<div style="top-margin: 10px">" + MESSAGES.about_allRightsReserved() + "</div>\n"; htmlFlow.setContents(html); contentPane.addMember(htmlFlow);
HLayout bottomPanel = new HLayout(); + bottomPanel.setAlign(VerticalAlignment.BOTTOM); contentPane.addMember(bottomPanel); Canvas spacer = new Canvas(); spacer.setWidth("*"); bottomPanel.addMember(spacer); - Button closeButton = new Button("Close"); + Button closeButton = new Button(MESSAGES.button_close()); closeButton.setShowRollOver(true); closeButton.setShowDown(true); closeButton.setWidth("60"); diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/GWTServiceLookup.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/GWTServiceLookup.java index d48dd7a..2e4a26f 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/GWTServiceLookup.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/GWTServiceLookup.java @@ -60,6 +60,10 @@ public class GWTServiceLookup { return secure(SubjectGWTServiceAsync.Util.getInstance()); }
+ public static SystemGWTServiceAsync getSystemService() { + return secure(SystemGWTServiceAsync.Util.getInstance()); + } + public static MeasurementDataGWTServiceAsync getMeasurementDataService() { return secure(MeasurementDataGWTServiceAsync.Util.getInstance()); } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/SystemGWTService.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/SystemGWTService.java new file mode 100644 index 0000000..c6dc504 --- /dev/null +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/SystemGWTService.java @@ -0,0 +1,29 @@ +/* + * RHQ Management Platform + * Copyright (C) 2010 Red Hat, Inc. + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ +package org.rhq.enterprise.gui.coregui.client.gwt; + +import com.google.gwt.user.client.rpc.RemoteService; +import org.rhq.core.domain.common.ProductInfo; + +/** + * @author Ian Springer + */ +public interface SystemGWTService extends RemoteService { + ProductInfo getProductInfo(); +} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/AlertGWTServiceImpl.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/AlertGWTServiceImpl.java index 90469e0..bc0d32d 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/AlertGWTServiceImpl.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/AlertGWTServiceImpl.java @@ -54,7 +54,4 @@ public class AlertGWTServiceImpl extends AbstractGWTServiceImpl implements Alert return SerialUtility.prepare(this.alertDefinitionManager.findAlertDefinitionsByCriteria(getSessionSubject(), criteria), "AlertService.findAlertDefinitionsByCriteria"); } - - - } \ No newline at end of file diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/SystemGWTServiceImpl.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/SystemGWTServiceImpl.java new file mode 100644 index 0000000..af12a6a --- /dev/null +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/SystemGWTServiceImpl.java @@ -0,0 +1,35 @@ +/* + * RHQ Management Platform + * Copyright (C) 2010 Red Hat, Inc. + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ +package org.rhq.enterprise.gui.coregui.server.gwt; + +import org.rhq.core.domain.common.ProductInfo; +import org.rhq.enterprise.gui.coregui.client.gwt.SystemGWTService; +import org.rhq.enterprise.server.system.SystemManagerLocal; +import org.rhq.enterprise.server.util.LookupUtil; + +/** + * @author Ian Springer + */ +public class SystemGWTServiceImpl extends AbstractGWTServiceImpl implements SystemGWTService { + private SystemManagerLocal systemManager = LookupUtil.getSystemManager(); + + public ProductInfo getProductInfo() { + return this.systemManager.getProductInfo(getSessionSubject()); + } +} \ No newline at end of file diff --git a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties new file mode 100644 index 0000000..60fe75b --- /dev/null +++ b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties @@ -0,0 +1,19 @@ +# +# i18n Messages - English +########################### + +# +# Standard Button Labels +# +button.ok = OK +button.close = Close + +# +# About Box +# +about.title = About {0} +about.homepage = Homepage +about.version = Version: +about.buildNumber = Build Number: +about.jbossByRedHat = JBoss by Red Hat +about.allRightsReserved = All Rights Reserved. diff --git a/modules/enterprise/gui/coregui/src/main/webapp/WEB-INF/web.xml b/modules/enterprise/gui/coregui/src/main/webapp/WEB-INF/web.xml index 97b5a3e..c7846b4 100644 --- a/modules/enterprise/gui/coregui/src/main/webapp/WEB-INF/web.xml +++ b/modules/enterprise/gui/coregui/src/main/webapp/WEB-INF/web.xml @@ -15,6 +15,10 @@ <servlet-class>org.rhq.enterprise.gui.coregui.server.gwt.SubjectGWTServiceImpl</servlet-class> </servlet> <servlet> + <servlet-name>org.rhq.enterprise.gui.coregui.CoreGUI SystemGWTService</servlet-name> + <servlet-class>org.rhq.enterprise.gui.coregui.server.gwt.SystemGWTServiceImpl</servlet-class> + </servlet> + <servlet> <servlet-name>org.rhq.enterprise.gui.coregui.CoreGUI ResourceGroupGWTService</servlet-name> <servlet-class>org.rhq.enterprise.gui.coregui.server.gwt.ResourceGroupGWTServiceImpl</servlet-class> </servlet> @@ -103,6 +107,10 @@ <url-pattern>/org.rhq.enterprise.gui.coregui.CoreGUI/SubjectGWTService</url-pattern> </servlet-mapping> <servlet-mapping> + <servlet-name>org.rhq.enterprise.gui.coregui.CoreGUI SystemGWTService</servlet-name> + <url-pattern>/org.rhq.enterprise.gui.coregui.CoreGUI/SystemGWTService</url-pattern> + </servlet-mapping> + <servlet-mapping> <servlet-name>org.rhq.enterprise.gui.coregui.CoreGUI ResourceGroupGWTService</servlet-name> <url-pattern>/org.rhq.enterprise.gui.coregui.CoreGUI/ResourceGroupGWTService</url-pattern> </servlet-mapping> diff --git a/modules/enterprise/gui/portal-war/pom.xml b/modules/enterprise/gui/portal-war/pom.xml index 783942c..a794cd6 100644 --- a/modules/enterprise/gui/portal-war/pom.xml +++ b/modules/enterprise/gui/portal-war/pom.xml @@ -31,14 +31,7 @@ <!-- plugin versions --> <jetty-jspc-maven-plugin.version>7.0.1.v20091125</jetty-jspc-maven-plugin.version>
- <product.shortName>RHQ</product.shortName> - <product.name>RHQ</product.name> - <product.fullName>RHQ</product.fullName> - <product.url.domain>rhq-project.org</product.url.domain> - <product.sales.email>sales@rhq-project.org</product.sales.email> - <product.support.email>info@rhq-project.org</product.support.email> - <product.version>${project.version}</product.version> - <product.help.doc.root>http://support.rhq-project.org/display/RHQ/</product.help.doc.root> + <!-- Note: The product info properties now live in the RHQ root pom. --> </properties>
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp-filtered/WEB-INF/classes/ApplicationResources.properties b/modules/enterprise/gui/portal-war/src/main/webapp-filtered/WEB-INF/classes/ApplicationResources.properties index 2510400..d72193e 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp-filtered/WEB-INF/classes/ApplicationResources.properties +++ b/modules/enterprise/gui/portal-war/src/main/webapp-filtered/WEB-INF/classes/ApplicationResources.properties @@ -6,9 +6,9 @@ product.name=${product.name} product.fullName=${product.fullName} product.version=${product.version} product.buildNumber=${buildNumber} -product.url.domain=${product.url.domain} -product.support.email=${product.support.email} -product.sales.email=${product.sales.email} +product.url.domain=${product.urlDomain} +product.support.email=${product.supportEmail} +product.sales.email=${product.salesEmail}
header.plan=Plan header.resource=Inventory diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/menu/menu.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/menu/menu.xhtml index 9e2ae2b..f767b5a 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/menu/menu.xhtml +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/menu/menu.xhtml @@ -629,9 +629,9 @@ v <rich:menuItem submitMode="none" </p>
<p> - <a href="http://jboss.org/jopr"> + <a href="http://rhq-project.org/"> <h:graphicImage value="/images/logo_icon.png" style="vertical-align:middle" /> - Jopr Project + RHQ Project </a>
ui:remove diff --git a/modules/enterprise/server/jar/pom.xml b/modules/enterprise/server/jar/pom.xml index 9e7bb24..79fdc38 100644 --- a/modules/enterprise/server/jar/pom.xml +++ b/modules/enterprise/server/jar/pom.xml @@ -394,6 +394,13 @@ <build> <finalName>${project.artifactId}</finalName>
+ <resources> + <resource> + <directory>src/main/resources</directory> + <filtering>true</filtering> + </resource> + </resources> + <testResources> <testResource> <directory>src/test/resources</directory> diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/CoreServer.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/CoreServer.java index cbee6bc..2d766aa 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/CoreServer.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/CoreServer.java @@ -19,6 +19,7 @@ package org.rhq.enterprise.server.core;
import java.io.File; +import java.io.IOException; import java.io.InputStream; import java.util.Date; import java.util.Properties; @@ -34,9 +35,13 @@ import org.jboss.mx.util.MBeanServerLocator; import org.jboss.system.ServiceMBeanSupport; import org.jboss.system.server.ServerConfig;
+import org.rhq.core.domain.common.ProductInfo; import org.rhq.core.util.ObjectNameFactory;
public class CoreServer extends ServiceMBeanSupport implements CoreServerMBean { + private static final String PRODUCT_INFO_PROPERTIES_RESOURCE_PATH = + "org/rhq/enterprise/server/core/ProductInfo.properties"; + private final Log log = LogFactory.getLog(CoreServer.class);
/** @@ -125,6 +130,35 @@ public class CoreServer extends ServiceMBeanSupport implements CoreServerMBean { return serverTempDir; }
+ public ProductInfo getProductInfo() { + ClassLoader classLoader = this.getClass().getClassLoader(); + InputStream inputStream = classLoader.getResourceAsStream(PRODUCT_INFO_PROPERTIES_RESOURCE_PATH); + if (inputStream == null) { + throw new IllegalStateException("Failed to find class loader resource [" + + PRODUCT_INFO_PROPERTIES_RESOURCE_PATH + "]."); + } + Properties props = new Properties(); + try { + props.load(inputStream); + } catch (IOException e) { + throw new IllegalStateException("Failed to load product info properties from class loader resource [" + + PRODUCT_INFO_PROPERTIES_RESOURCE_PATH + "]."); + } + ProductInfo productInfo = new ProductInfo(); + // TODO: Using reflection below might be nicer. + productInfo.setBuildNumber(props.getProperty("buildNumber")); + productInfo.setFullName(props.getProperty("fullName")); + productInfo.setHelpDocRoot(props.getProperty("helpDocRoot")); + productInfo.setName(props.getProperty("name")); + productInfo.setSalesEmail(props.getProperty("salesEmail")); + productInfo.setShortName(props.getProperty("shortName")); + productInfo.setSupportEmail(props.getProperty("supportEmail")); + productInfo.setUrlDomain(props.getProperty("urlDomain")); + productInfo.setUrl(props.getProperty("url")); + productInfo.setVersion(props.getProperty("version")); + return productInfo; + } + private MBeanServer getMBeanServer() { return MBeanServerLocator.locateJBoss(); } diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/CoreServerMBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/CoreServerMBean.java index 108a0d5..33c105d 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/CoreServerMBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/CoreServerMBean.java @@ -25,6 +25,7 @@ import javax.management.ObjectName;
import org.jboss.mx.util.ObjectNameFactory; import org.jboss.system.ServiceMBean; +import org.rhq.core.domain.common.ProductInfo;
/** * An MBean that exposes various core server global attributes (version, uptime, etc.). @@ -84,4 +85,11 @@ public interface CoreServerMBean extends ServiceMBean { * @return jboss server home directory */ File getJBossServerTempDir(); + + /** + * Product information - the product name, homepage URL, docs URL, etc. + * + * @return product information - the product name, homepage URL, docs URL, etc. + */ + ProductInfo getProductInfo(); } \ No newline at end of file diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/SystemManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/SystemManagerBean.java index 4dc713b..7e4ce9e 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/SystemManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/SystemManagerBean.java @@ -58,6 +58,7 @@ import org.rhq.core.db.DatabaseType; import org.rhq.core.db.DatabaseTypeFactory; import org.rhq.core.domain.auth.Subject; import org.rhq.core.domain.authz.Permission; +import org.rhq.core.domain.common.ProductInfo; import org.rhq.core.domain.common.SystemConfiguration; import org.rhq.core.server.PersistenceUtility; import org.rhq.core.util.ObjectNameFactory; @@ -662,4 +663,10 @@ public class SystemManagerBean implements SystemManagerLocal, SystemManagerRemot ServerVersion serverVersion = new ServerVersion(version, buildNumber); return serverVersion; } + + public ProductInfo getProductInfo(Subject subject) { + CoreServerMBean coreServer = LookupUtil.getCoreServer(); + ProductInfo productInfo = coreServer.getProductInfo(); + return productInfo; + } } \ No newline at end of file diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/SystemManagerLocal.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/SystemManagerLocal.java index e339c8b..e044b0a 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/SystemManagerLocal.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/SystemManagerLocal.java @@ -25,6 +25,7 @@ import javax.ejb.Local;
import org.rhq.core.db.DatabaseType; import org.rhq.core.domain.auth.Subject; +import org.rhq.core.domain.common.ProductInfo; import org.rhq.enterprise.server.license.License;
/** @@ -172,4 +173,6 @@ public interface SystemManagerLocal { // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
ServerVersion getServerVersion(Subject subject) throws Exception; + + ProductInfo getProductInfo(Subject subject); } \ No newline at end of file diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/SystemManagerRemote.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/SystemManagerRemote.java index 8fa6c5b..cb04a95 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/SystemManagerRemote.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/SystemManagerRemote.java @@ -24,6 +24,7 @@ import javax.jws.WebParam; import javax.jws.WebService;
import org.rhq.core.domain.auth.Subject; +import org.rhq.core.domain.common.ProductInfo;
/** * @author John Mazzitelli @@ -39,4 +40,8 @@ public interface SystemManagerRemote { @WebMethod ServerVersion getServerVersion( // @WebParam(name = "subject") Subject subject) throws Exception; + + @WebMethod + ProductInfo getProductInfo( + @WebParam(name = "subject") Subject subject); } diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/webservices/WebservicesManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/webservices/WebservicesManagerBean.java index cab0954..1fd9720 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/webservices/WebservicesManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/webservices/WebservicesManagerBean.java @@ -30,6 +30,7 @@ import java.util.Map; import java.util.Set;
import javax.ejb.Stateless; +import javax.jws.WebParam; import javax.jws.WebService; import javax.xml.bind.annotation.XmlSeeAlso; import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; @@ -46,6 +47,7 @@ import org.rhq.core.domain.bundle.BundleResourceDeployment; import org.rhq.core.domain.bundle.BundleType; import org.rhq.core.domain.bundle.BundleVersion; import org.rhq.core.domain.bundle.composite.BundleWithLatestVersionComposite; +import org.rhq.core.domain.common.ProductInfo; import org.rhq.core.domain.configuration.Configuration; import org.rhq.core.domain.configuration.PluginConfigurationUpdate; import org.rhq.core.domain.configuration.ResourceConfigurationUpdate; @@ -1008,6 +1010,10 @@ public class WebservicesManagerBean implements WebservicesRemote { return systemManager.getServerVersion(subject); }
+ public ProductInfo getProductInfo(@WebParam(name = "subject") Subject subject) { + return systemManager.getProductInfo(subject); + } + //SYSTEMMANAGER: END ------------------------------------
private void checkParametersPassedIn(Subject subject, Criteria criteria) { diff --git a/modules/enterprise/server/jar/src/main/resources/org/rhq/enterprise/server/core/ProductInfo.properties b/modules/enterprise/server/jar/src/main/resources/org/rhq/enterprise/server/core/ProductInfo.properties new file mode 100644 index 0000000..f323a0e --- /dev/null +++ b/modules/enterprise/server/jar/src/main/resources/org/rhq/enterprise/server/core/ProductInfo.properties @@ -0,0 +1,9 @@ +shortName = ${product.shortName} +name = ${product.name} +fullName = ${product.fullName} +version = ${product.version} +buildNumber = ${buildNumber} +url = ${product.url} +urlDomain = ${product.urlDomain} +supportEmail = ${product.supportEmail} +salesEmail = ${product.salesEmail} diff --git a/pom.xml b/pom.xml index 4743b2c..7ff85bb 100644 --- a/pom.xml +++ b/pom.xml @@ -43,7 +43,16 @@ <!-- set the below prop to true to enable misc extra build output --> <rhq.debug>false</rhq.debug>
- <findbugs.version>2.3</findbugs.version> + <!-- product info --> + <product.shortName>RHQ</product.shortName> + <product.name>RHQ</product.name> + <product.fullName>RHQ</product.fullName> + <product.url>http://rhq-project.org/</product.url> + <product.urlDomain>rhq-project.org</product.urlDomain> + <product.salesEmail>sales@rhq-project.org</product.salesEmail> + <product.supportEmail>info@rhq-project.org</product.supportEmail> + <product.version>${project.version}</product.version> + <product.helpDocRoot>http://support.rhq-project.org/display/RHQ/</product.helpDocRoot>
<doUpdate>false</doUpdate>
@@ -65,6 +74,7 @@
<commons-logging.version>1.1.0.jboss</commons-logging.version> <concurrent.version>1.3.4-jboss-update1</concurrent.version> <!-- oswego-concurrent compatible with 4.2.3.GA --> + <findbugs.version>2.3</findbugs.version> <getopt.version>1.0.13</getopt.version> <hibernate3.version>3.2.r14201-2</hibernate3.version> <hibernate-annotations.version>3.2.1.GA</hibernate-annotations.version> @@ -600,7 +610,7 @@ <goals> <goal>run</goal> </goals> - <phase>generate-resources</phase> + <phase>generate-sources</phase> <configuration> <tasks> <tstamp> @@ -635,7 +645,7 @@ <executions> <execution> <id>generate-build-number-properties</id> - <phase>generate-resources</phase> + <phase>generate-sources</phase> <goals> <goal>exec</goal> </goals> @@ -658,7 +668,7 @@ <executions> <execution> <id>read-build-properties</id> - <phase>process-resources</phase> + <phase>process-sources</phase> <goals> <goal>read-project-properties</goal> </goals>
commit 5623f6c379c745715c0ae18f878b269713d3a64d Merge: c582fb4... c229c5c... Author: Jay Shaughnessy jshaughn@redhat.com Date: Thu Jul 8 16:51:43 2010 -0400
Merge branch 'release-3.0.0' into release-3.0.0-jay
commit c582fb4252fb6e583807287950d2aca8aa365f6e Author: Jay Shaughnessy jshaughn@redhat.com Date: Thu Jul 8 16:49:14 2010 -0400
[BZ 612100] Work to better inform the bundle create wizard user about file upload when in progress. And to protect against previous/next navigation until the upload completes.
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDataStep.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDataStep.java index 7e3ed51..794a2c1 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDataStep.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDataStep.java @@ -37,13 +37,13 @@ import org.rhq.enterprise.gui.coregui.client.components.HeaderLabel; import org.rhq.enterprise.gui.coregui.client.components.upload.BundleFileUploadForm; import org.rhq.enterprise.gui.coregui.client.components.upload.DynamicFormHandler; import org.rhq.enterprise.gui.coregui.client.components.upload.DynamicFormSubmitCompleteEvent; -import org.rhq.enterprise.gui.coregui.client.components.wizard.WizardStep; +import org.rhq.enterprise.gui.coregui.client.components.wizard.AbstractWizardStep; import org.rhq.enterprise.gui.coregui.client.gwt.BundleGWTServiceAsync; import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup; import org.rhq.enterprise.gui.coregui.client.util.message.Message; import org.rhq.enterprise.gui.coregui.client.util.message.Message.Severity;
-public class BundleUploadDataStep implements WizardStep { +public class BundleUploadDataStep extends AbstractWizardStep {
private final AbstractBundleCreateWizard wizard; private final BundleGWTServiceAsync bundleServer = GWTServiceLookup.getBundleService(); @@ -89,9 +89,25 @@ public class BundleUploadDataStep implements WizardStep { }
public boolean nextPage() { + wizard.getView().hideMessage(); + return isFinished(); }
+ public boolean previousPage() { + wizard.getView().hideMessage(); + + for (BundleFileUploadForm uploadForm : this.uploadForms) { + if (uploadForm.isUploadInProgress()) { + handleUploadError("[" + uploadForm.getName() + + "] Upload is in progress... This can take several minutes for large files.", false); + return false; + } + } + + return true; + } + public String getName() { return "Upload Bundle Files"; } @@ -107,9 +123,13 @@ public class BundleUploadDataStep implements WizardStep {
boolean needToUpload = false; for (BundleFileUploadForm uploadForm : this.uploadForms) { - if (uploadForm.getUploadResult() == null) { - uploadForm.submitForm(); + if (uploadForm.isUploadInProgress()) { + handleUploadError("[" + uploadForm.getName() + + "] Upload is in progress... This can take several minutes for large files.", false); + needToUpload = true; + } else if (uploadForm.getUploadResult() == null) { needToUpload = true; + uploadForm.submitForm(); // on certain errors the form may never be submitted, report these errors outside submit handlers handleUploadError(uploadForm.getUploadError(), false); } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDistroFileStep.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDistroFileStep.java index bd447ef..27f5a99 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDistroFileStep.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDistroFileStep.java @@ -42,13 +42,13 @@ import org.rhq.enterprise.gui.coregui.client.components.upload.DynamicCallbackFo import org.rhq.enterprise.gui.coregui.client.components.upload.DynamicFormHandler; import org.rhq.enterprise.gui.coregui.client.components.upload.DynamicFormSubmitCompleteEvent; import org.rhq.enterprise.gui.coregui.client.components.upload.TextFileRetrieverForm; -import org.rhq.enterprise.gui.coregui.client.components.wizard.WizardStep; +import org.rhq.enterprise.gui.coregui.client.components.wizard.AbstractWizardStep; import org.rhq.enterprise.gui.coregui.client.gwt.BundleGWTServiceAsync; import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup; import org.rhq.enterprise.gui.coregui.client.util.message.Message; import org.rhq.enterprise.gui.coregui.client.util.message.Message.Severity;
-public class BundleUploadDistroFileStep implements WizardStep { +public class BundleUploadDistroFileStep extends AbstractWizardStep {
private final AbstractBundleCreateWizard wizard;
@@ -89,6 +89,12 @@ public class BundleUploadDistroFileStep implements WizardStep { public boolean nextPage() { wizard.getView().hideMessage();
+ if (uploadDistroForm.isUploadInProgress()) { + handleUploadError("Upload is in progress... This can take several minutes for large distribution files.", + false); + return false; + } + if (wizard.getBundleVersion() == null) { String selected = radioGroup.getSelected();
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/upload/BundleDistributionFileUploadForm.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/upload/BundleDistributionFileUploadForm.java index 3021132..a835f23 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/upload/BundleDistributionFileUploadForm.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/upload/BundleDistributionFileUploadForm.java @@ -42,6 +42,7 @@ public class BundleDistributionFileUploadForm extends DynamicCallbackForm {
private Boolean uploadResult; private String uploadError; + private boolean uploadInProgress; private int bundleVersionId;
private final FormItemIcon iconLoading; @@ -103,9 +104,20 @@ public class BundleDistributionFileUploadForm extends DynamicCallbackForm { this.uploadError = uploadError; }
+ public boolean isUploadInProgress() { + return uploadInProgress; + } + @Override public void submitForm() { setUploadError(null); + + if (uploadInProgress) { + String message = "Can not submit, upload is currently in progress"; + setUploadError(message); + return; + } + Object value = bundleUploadItem.getValue(); if (value == null || value.toString().length() == 0) { String message = "Please select a bundle distribution file to upload"; @@ -116,6 +128,7 @@ public class BundleDistributionFileUploadForm extends DynamicCallbackForm { } else { icon.setIcons(iconLoading); icon.setTooltip("Processing..."); + uploadInProgress = true; super.submitForm(); } } @@ -167,6 +180,8 @@ public class BundleDistributionFileUploadForm extends DynamicCallbackForm { // make sure this handler is executed first in case the creator has also added a handler pushFormHandler(new DynamicFormHandler() { public void onSubmitComplete(DynamicFormSubmitCompleteEvent event) { + uploadInProgress = false; + String results = event.getResults(); bundleVersionId = parseIdFromResponse(results); if (bundleVersionId > 0) { @@ -193,6 +208,8 @@ public class BundleDistributionFileUploadForm extends DynamicCallbackForm {
addFormSubmitFailedHandler(new FormSubmitFailedHandler() { public void onFormSubmitFailed(FormSubmitFailedEvent event) { + uploadInProgress = false; + uploadResult = Boolean.FALSE; String cause = "Bundle Distribution file upload failed, check for invalid file path."; icon.setIcons(iconRed); diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/upload/BundleFileUploadForm.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/upload/BundleFileUploadForm.java index f3d862c..9455302 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/upload/BundleFileUploadForm.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/upload/BundleFileUploadForm.java @@ -43,6 +43,7 @@ public class BundleFileUploadForm extends DynamicCallbackForm {
private Boolean uploadResult; private String uploadError; + private boolean uploadInProgress;
private final BundleVersion bundleVersion; private final String name; @@ -60,6 +61,7 @@ public class BundleFileUploadForm extends DynamicCallbackForm { this.name = name; this.showNameLabel = showNameLabel; this.uploadResult = isAlreadyUploaded; // null if unknown, false if error during previous upload attempt, true if already uploaded before + this.uploadInProgress = false;
setEncoding(Encoding.MULTIPART); setAction(GWT.getModuleBaseURL() + "/BundleFileUploadServlet"); @@ -118,9 +120,20 @@ public class BundleFileUploadForm extends DynamicCallbackForm { this.uploadError = uploadError; }
+ public boolean isUploadInProgress() { + return uploadInProgress; + } + @Override public void submitForm() { setUploadError(null); + + if (uploadInProgress) { + String message = "Can not submit, upload is currently in progress"; + setUploadError(message); + return; + } + Object value = bundleUploadItem.getValue(); if (value == null || value.toString().length() == 0) { String message = "[" + name + "] Please select a file to upload"; @@ -131,6 +144,7 @@ public class BundleFileUploadForm extends DynamicCallbackForm { } else { icon.setIcons(iconLoading); icon.setTooltip("Loading..."); + uploadInProgress = true; super.submitForm(); } } @@ -190,6 +204,8 @@ public class BundleFileUploadForm extends DynamicCallbackForm { // push the form handler so it executes first if the form creator has also added a handler pushFormHandler(new DynamicFormHandler() { public void onSubmitComplete(DynamicFormSubmitCompleteEvent event) { + uploadInProgress = false; + String results = event.getResults(); if (!results.contains("Failed to upload bundle file")) { uploadResult = Boolean.TRUE; @@ -216,6 +232,8 @@ public class BundleFileUploadForm extends DynamicCallbackForm {
addFormSubmitFailedHandler(new FormSubmitFailedHandler() { public void onFormSubmitFailed(FormSubmitFailedEvent event) { + uploadInProgress = false; + uploadResult = Boolean.FALSE; String cause = "Bundle file [" + name + "] upload failed, check for invalid file path."; icon.setIcons(iconRed);
commit cde0a9ace064bdac47754bb31076c6e2cc6255eb Author: Jay Shaughnessy jshaughn@redhat.com Date: Thu Jul 8 16:47:00 2010 -0400
As part of the research for BZ 611456 (delete bundle issue) I found that Bundle had cascade delete (actually cascade all) declared for bundleVersions. This is not necessary, or desired. Removing all cascade options on bundleVersions. Unfortunately, I don't think this was the cause of any deleteBundle issues that may be occurring.
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/bundle/Bundle.java b/modules/core/domain/src/main/java/org/rhq/core/domain/bundle/Bundle.java index bed3a10..6dd4a02 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/bundle/Bundle.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/bundle/Bundle.java @@ -101,7 +101,7 @@ public class Bundle implements Serializable { @OneToMany(mappedBy = "bundle", fetch = FetchType.LAZY, cascade = CascadeType.ALL) private List<BundleDestination> destinations = new ArrayList<BundleDestination>();
- @OneToMany(mappedBy = "bundle", fetch = FetchType.LAZY, cascade = CascadeType.ALL) + @OneToMany(mappedBy = "bundle", fetch = FetchType.LAZY) private List<BundleVersion> bundleVersions = new ArrayList<BundleVersion>();
@ManyToMany(mappedBy = "bundles", fetch = FetchType.LAZY, cascade = CascadeType.REMOVE)
commit 12da55901c5a611771cc43dad254fa77bb30664c Author: Jay Shaughnessy jshaughn@redhat.com Date: Thu Jul 8 16:44:07 2010 -0400
Added previousPage() to WizardStep interface. This is analogous to the existing nextPage() hook. It allows a Step to deny the Previous button from moving to the previous step. This is not usually needed but in certain cases the step may have in-progress work, like file upload, that should be allowed to complete for a consistent user experience. To make interface changes easier to apply in the future created AbstractWizardStep and updated all WizardSteps to extend it. Note that nextPage and previousPage return true by default, in the abstract class.
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleSummaryStep.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleSummaryStep.java index 0959e26..219d58f 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleSummaryStep.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleSummaryStep.java @@ -25,12 +25,12 @@ import com.smartgwt.client.widgets.form.DynamicForm; import com.smartgwt.client.widgets.form.fields.StaticTextItem;
import org.rhq.enterprise.gui.coregui.client.CoreGUI; -import org.rhq.enterprise.gui.coregui.client.components.wizard.WizardStep; +import org.rhq.enterprise.gui.coregui.client.components.wizard.AbstractWizardStep;
/** * @author John Mazzitelli */ -public class BundleSummaryStep implements WizardStep { +public class BundleSummaryStep extends AbstractWizardStep {
private final AbstractBundleCreateWizard wizard;
@@ -87,7 +87,7 @@ public class BundleSummaryStep implements WizardStep {
public boolean nextPage() { CoreGUI.refresh(); - + return true; // this is the last page, we are done }
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadRecipeStep.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadRecipeStep.java index 79bcc09..b173219 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadRecipeStep.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadRecipeStep.java @@ -35,12 +35,12 @@ import org.rhq.enterprise.gui.coregui.client.components.upload.DynamicCallbackFo import org.rhq.enterprise.gui.coregui.client.components.upload.DynamicFormHandler; import org.rhq.enterprise.gui.coregui.client.components.upload.DynamicFormSubmitCompleteEvent; import org.rhq.enterprise.gui.coregui.client.components.upload.TextFileRetrieverForm; -import org.rhq.enterprise.gui.coregui.client.components.wizard.WizardStep; +import org.rhq.enterprise.gui.coregui.client.components.wizard.AbstractWizardStep; import org.rhq.enterprise.gui.coregui.client.gwt.BundleGWTServiceAsync; import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup; import org.rhq.enterprise.gui.coregui.client.util.message.Message;
-public class BundleUploadRecipeStep implements WizardStep { +public class BundleUploadRecipeStep extends AbstractWizardStep {
private DynamicCallbackForm form; private final AbstractBundleCreateWizard wizard; diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/DeployStep.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/DeployStep.java index d8bf7ae..c96debc 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/DeployStep.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/DeployStep.java @@ -28,7 +28,7 @@ import com.smartgwt.client.widgets.layout.VLayout;
import org.rhq.core.domain.bundle.BundleDeployment; import org.rhq.enterprise.gui.coregui.client.CoreGUI; -import org.rhq.enterprise.gui.coregui.client.components.wizard.WizardStep; +import org.rhq.enterprise.gui.coregui.client.components.wizard.AbstractWizardStep; import org.rhq.enterprise.gui.coregui.client.gwt.BundleGWTServiceAsync; import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup; import org.rhq.enterprise.gui.coregui.client.util.message.Message; @@ -38,7 +38,7 @@ import org.rhq.enterprise.gui.coregui.client.util.message.Message.Severity; * @author Jay Shaughnessy * */ -public class DeployStep implements WizardStep { +public class DeployStep extends AbstractWizardStep {
private VLayout canvas; private final BundleDeployWizard wizard; diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDeploymentConfigStep.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDeploymentConfigStep.java index 505948b..38a1f79 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDeploymentConfigStep.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDeploymentConfigStep.java @@ -25,9 +25,9 @@ import org.rhq.core.domain.configuration.Configuration; import org.rhq.core.domain.configuration.definition.ConfigurationDefinition; import org.rhq.enterprise.gui.coregui.client.components.HeaderLabel; import org.rhq.enterprise.gui.coregui.client.components.configuration.ConfigurationEditor; -import org.rhq.enterprise.gui.coregui.client.components.wizard.WizardStep; +import org.rhq.enterprise.gui.coregui.client.components.wizard.AbstractWizardStep;
-public class GetDeploymentConfigStep implements WizardStep { +public class GetDeploymentConfigStep extends AbstractWizardStep {
private final BundleDeployWizard wizard; private VLayout editor; diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDeploymentInfoStep.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDeploymentInfoStep.java index 1c00b7d..558d396 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDeploymentInfoStep.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDeploymentInfoStep.java @@ -28,7 +28,7 @@ import com.smartgwt.client.widgets.form.fields.events.ChangedEvent; import com.smartgwt.client.widgets.form.fields.events.ChangedHandler;
import org.rhq.enterprise.gui.coregui.client.CoreGUI; -import org.rhq.enterprise.gui.coregui.client.components.wizard.WizardStep; +import org.rhq.enterprise.gui.coregui.client.components.wizard.AbstractWizardStep; import org.rhq.enterprise.gui.coregui.client.gwt.BundleGWTServiceAsync; import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
@@ -36,7 +36,7 @@ import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup; * @author Jay Shaughnessy * */ -public class GetDeploymentInfoStep implements WizardStep { +public class GetDeploymentInfoStep extends AbstractWizardStep {
private DynamicForm form; private final BundleDeployWizard wizard; diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDeploymentOptionsStep.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDeploymentOptionsStep.java index 5f1e6b9..24ca6c7 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDeploymentOptionsStep.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDeploymentOptionsStep.java @@ -26,9 +26,9 @@ import com.smartgwt.client.widgets.form.fields.RadioGroupItem; import com.smartgwt.client.widgets.form.fields.events.ChangedEvent; import com.smartgwt.client.widgets.form.fields.events.ChangedHandler;
-import org.rhq.enterprise.gui.coregui.client.components.wizard.WizardStep; +import org.rhq.enterprise.gui.coregui.client.components.wizard.AbstractWizardStep;
-public class GetDeploymentOptionsStep implements WizardStep { +public class GetDeploymentOptionsStep extends AbstractWizardStep {
static private final String DEPLOY_LATER = "later"; static private final String DEPLOY_NOW = "now"; diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDestinationStep.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDestinationStep.java index 0fab3aa..407e3d9 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDestinationStep.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDestinationStep.java @@ -33,13 +33,13 @@ import com.smartgwt.client.widgets.layout.VLayout; import org.rhq.core.domain.bundle.BundleDestination; import org.rhq.enterprise.gui.coregui.client.CoreGUI; import org.rhq.enterprise.gui.coregui.client.bundle.deploy.selection.SinglePlatformResourceGroupSelector; -import org.rhq.enterprise.gui.coregui.client.components.wizard.WizardStep; +import org.rhq.enterprise.gui.coregui.client.components.wizard.AbstractWizardStep; import org.rhq.enterprise.gui.coregui.client.gwt.BundleGWTServiceAsync; import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup; import org.rhq.enterprise.gui.coregui.client.util.message.Message; import org.rhq.enterprise.gui.coregui.client.util.message.Message.Severity;
-public class GetDestinationStep implements WizardStep { +public class GetDestinationStep extends AbstractWizardStep {
private final BundleGWTServiceAsync bundleServer = GWTServiceLookup.getBundleService(); private final BundleDeployWizard wizard; diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/SelectBundleStep.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/SelectBundleStep.java index ee64475..271ca59 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/SelectBundleStep.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/SelectBundleStep.java @@ -25,10 +25,10 @@ import com.smartgwt.client.widgets.Canvas;
import org.rhq.core.domain.bundle.Bundle; import org.rhq.enterprise.gui.coregui.client.bundle.BundleSelector; -import org.rhq.enterprise.gui.coregui.client.components.wizard.WizardStep; +import org.rhq.enterprise.gui.coregui.client.components.wizard.AbstractWizardStep; import org.rhq.enterprise.gui.coregui.client.inventory.resource.selection.AbstractSelector;
-public class SelectBundleStep implements WizardStep { +public class SelectBundleStep extends AbstractWizardStep {
private final BundleDeployWizard wizard;
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/SelectBundleVersionStep.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/SelectBundleVersionStep.java index c57bb49..a9529af 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/SelectBundleVersionStep.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/SelectBundleVersionStep.java @@ -34,11 +34,11 @@ import org.rhq.core.domain.criteria.BundleDeploymentCriteria; import org.rhq.core.domain.criteria.BundleVersionCriteria; import org.rhq.core.domain.util.PageList; import org.rhq.enterprise.gui.coregui.client.CoreGUI; -import org.rhq.enterprise.gui.coregui.client.components.wizard.WizardStep; +import org.rhq.enterprise.gui.coregui.client.components.wizard.AbstractWizardStep; import org.rhq.enterprise.gui.coregui.client.gwt.BundleGWTServiceAsync; import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
-public class SelectBundleVersionStep implements WizardStep { +public class SelectBundleVersionStep extends AbstractWizardStep {
static private final String LATEST_VERSION = "latest"; static private final String LIVE_VERSION = "live"; diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/revert/ConfirmationStep.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/revert/ConfirmationStep.java index d531de7..d71992e 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/revert/ConfirmationStep.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/revert/ConfirmationStep.java @@ -30,7 +30,7 @@ import org.rhq.core.domain.bundle.BundleDeployment; import org.rhq.core.domain.criteria.BundleDeploymentCriteria; import org.rhq.core.domain.util.PageList; import org.rhq.enterprise.gui.coregui.client.CoreGUI; -import org.rhq.enterprise.gui.coregui.client.components.wizard.WizardStep; +import org.rhq.enterprise.gui.coregui.client.components.wizard.AbstractWizardStep; import org.rhq.enterprise.gui.coregui.client.gwt.BundleGWTServiceAsync; import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup; import org.rhq.enterprise.gui.coregui.client.util.message.Message; @@ -39,7 +39,7 @@ import org.rhq.enterprise.gui.coregui.client.util.message.Message; * @author Jay Shaughnessy * */ -public class ConfirmationStep implements WizardStep { +public class ConfirmationStep extends AbstractWizardStep {
private VLayout layout; private boolean nextPage = true; diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/revert/GetRevertInfoStep.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/revert/GetRevertInfoStep.java index 5608172..0164035 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/revert/GetRevertInfoStep.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/revert/GetRevertInfoStep.java @@ -28,7 +28,7 @@ import com.smartgwt.client.widgets.form.fields.events.ChangedEvent; import com.smartgwt.client.widgets.form.fields.events.ChangedHandler;
import org.rhq.enterprise.gui.coregui.client.CoreGUI; -import org.rhq.enterprise.gui.coregui.client.components.wizard.WizardStep; +import org.rhq.enterprise.gui.coregui.client.components.wizard.AbstractWizardStep; import org.rhq.enterprise.gui.coregui.client.gwt.BundleGWTServiceAsync; import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
@@ -36,7 +36,7 @@ import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup; * @author Jay Shaughnessy * */ -public class GetRevertInfoStep implements WizardStep { +public class GetRevertInfoStep extends AbstractWizardStep {
private DynamicForm form; private final BundleRevertWizard wizard; diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/revert/RevertStep.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/revert/RevertStep.java index 04bec9f..41566e3 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/revert/RevertStep.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/revert/RevertStep.java @@ -28,7 +28,7 @@ import com.smartgwt.client.widgets.layout.VLayout;
import org.rhq.core.domain.bundle.BundleDeployment; import org.rhq.enterprise.gui.coregui.client.CoreGUI; -import org.rhq.enterprise.gui.coregui.client.components.wizard.WizardStep; +import org.rhq.enterprise.gui.coregui.client.components.wizard.AbstractWizardStep; import org.rhq.enterprise.gui.coregui.client.gwt.BundleGWTServiceAsync; import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup; import org.rhq.enterprise.gui.coregui.client.util.message.Message; @@ -38,7 +38,7 @@ import org.rhq.enterprise.gui.coregui.client.util.message.Message.Severity; * @author Jay Shaughnessy * */ -public class RevertStep implements WizardStep { +public class RevertStep extends AbstractWizardStep {
private VLayout canvas; private final BundleRevertWizard wizard; diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/wizard/AbstractWizardStep.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/wizard/AbstractWizardStep.java new file mode 100644 index 0000000..1fd87f8 --- /dev/null +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/wizard/AbstractWizardStep.java @@ -0,0 +1,36 @@ +/* + * RHQ Management Platform + * Copyright (C) 2005-2010 Red Hat, Inc. + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ +package org.rhq.enterprise.gui.coregui.client.components.wizard; + +import com.smartgwt.client.widgets.Canvas; + +public abstract class AbstractWizardStep implements WizardStep { + + abstract public Canvas getCanvas(); + + abstract public String getName(); + + public boolean nextPage() { + return true; + } + + public boolean previousPage() { + return true; + } +} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/wizard/WizardStep.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/wizard/WizardStep.java index f9fe66b..c21a564 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/wizard/WizardStep.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/wizard/WizardStep.java @@ -29,5 +29,7 @@ public interface WizardStep {
boolean nextPage();
+ boolean previousPage(); + String getName(); } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/wizard/WizardView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/wizard/WizardView.java index 93fe036..a8ff10b 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/wizard/WizardView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/wizard/WizardView.java @@ -164,7 +164,11 @@ public class WizardView extends VLayout { previousButton.setDisabled(true); previousButton.addClickHandler(new ClickHandler() { public void onClick(ClickEvent clickEvent) { - decrementStep(); + + WizardStep step = wizard.getSteps().get(currentStep); + if (step.previousPage()) { + decrementStep(); + } } }); nextButton = new IButton("Next"); @@ -236,6 +240,9 @@ public class WizardView extends VLayout {
contentLayout.addMember(currentCanvas);
+ // clean any message from a previous step + hideMessage(); + markForRedraw(); }
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/wizard/GroupCreateStep.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/wizard/GroupCreateStep.java index 002c8f9..96b6017 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/wizard/GroupCreateStep.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/wizard/GroupCreateStep.java @@ -28,7 +28,6 @@ import com.smartgwt.client.widgets.Canvas; import com.smartgwt.client.widgets.form.DynamicForm; import com.smartgwt.client.widgets.form.ValuesManager; import com.smartgwt.client.widgets.form.fields.AutoFitTextAreaItem; -import com.smartgwt.client.widgets.form.fields.BooleanItem; import com.smartgwt.client.widgets.form.fields.CheckboxItem; import com.smartgwt.client.widgets.form.fields.IPickTreeItem; import com.smartgwt.client.widgets.form.fields.TextAreaItem; @@ -37,20 +36,18 @@ import com.smartgwt.client.widgets.form.fields.TextItem; import org.rhq.core.domain.resource.ResourceType; import org.rhq.core.domain.resource.group.ResourceGroup; import org.rhq.enterprise.gui.coregui.client.components.form.RadioGroupWithComponentsItem; -import org.rhq.enterprise.gui.coregui.client.components.wizard.WizardStep; +import org.rhq.enterprise.gui.coregui.client.components.wizard.AbstractWizardStep; import org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTypePluginTreeDataSource;
/** * @author Greg Hinkle */ -public class GroupCreateStep implements WizardStep { - +public class GroupCreateStep extends AbstractWizardStep {
private DynamicForm form;
public Canvas getCanvas() {
- if (form == null) {
form = new DynamicForm(); @@ -64,7 +61,7 @@ public class GroupCreateStep implements WizardStep {
TextAreaItem description = new AutoFitTextAreaItem("description", "Description");
- CheckboxItem recursive = new CheckboxItem("recursive","Recursive"); + CheckboxItem recursive = new CheckboxItem("recursive", "Recursive");
LinkedHashMap<String, Canvas> options = new LinkedHashMap<String, Canvas>();
@@ -83,7 +80,6 @@ public class GroupCreateStep implements WizardStep { form2.setFields(typeSelectItem); options.put("Compatible", form2);
- RadioGroupWithComponentsItem kind = new RadioGroupWithComponentsItem("kind", "Group Type", options, form); kind.setValue("Mixed Resources");
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/wizard/GroupMembersStep.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/wizard/GroupMembersStep.java index 0f5f92c..5f13657 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/wizard/GroupMembersStep.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/wizard/GroupMembersStep.java @@ -26,14 +26,13 @@ import java.util.HashSet;
import com.smartgwt.client.widgets.Canvas;
-import org.rhq.enterprise.gui.coregui.client.components.wizard.WizardStep; +import org.rhq.enterprise.gui.coregui.client.components.wizard.AbstractWizardStep; import org.rhq.enterprise.gui.coregui.client.inventory.resource.selection.ResourceSelector;
/** * @author Greg Hinkle */ -public class GroupMembersStep implements WizardStep { - +public class GroupMembersStep extends AbstractWizardStep {
private GroupCreateWizard wizard; private ResourceSelector selector; diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/create/OperationParametersStep.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/create/OperationParametersStep.java index 42de0a4..e4c7d53 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/create/OperationParametersStep.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/create/OperationParametersStep.java @@ -25,12 +25,12 @@ import org.rhq.core.domain.configuration.Configuration; import org.rhq.core.domain.configuration.definition.ConfigurationDefinition; import org.rhq.core.domain.operation.OperationDefinition; import org.rhq.enterprise.gui.coregui.client.components.configuration.ConfigurationEditor; -import org.rhq.enterprise.gui.coregui.client.components.wizard.WizardStep; +import org.rhq.enterprise.gui.coregui.client.components.wizard.AbstractWizardStep;
/** * @author Greg Hinkle */ -public class OperationParametersStep implements WizardStep { +public class OperationParametersStep extends AbstractWizardStep {
private OperationDefinition definition;
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/create/OperationSchedulingStep.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/create/OperationSchedulingStep.java index c1546a8..0623308 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/create/OperationSchedulingStep.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/create/OperationSchedulingStep.java @@ -43,12 +43,12 @@ import com.smartgwt.client.widgets.form.fields.StaticTextItem; import com.smartgwt.client.widgets.form.fields.TimeItem; import com.smartgwt.client.widgets.form.validator.CustomValidator;
-import org.rhq.enterprise.gui.coregui.client.components.wizard.WizardStep; +import org.rhq.enterprise.gui.coregui.client.components.wizard.AbstractWizardStep;
/** * @author Greg Hinkle */ -public class OperationSchedulingStep implements WizardStep, ItemChangedHandler { +public class OperationSchedulingStep extends AbstractWizardStep implements ItemChangedHandler {
private DynamicForm form; private ValuesManager valuesManager; diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/factory/ConfigurationStep.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/factory/ConfigurationStep.java index 0d466d3..3ff18c6 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/factory/ConfigurationStep.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/factory/ConfigurationStep.java @@ -23,12 +23,12 @@ import com.smartgwt.client.widgets.Canvas; import org.rhq.core.domain.configuration.Configuration; import org.rhq.core.domain.configuration.definition.ConfigurationDefinition; import org.rhq.enterprise.gui.coregui.client.components.configuration.ConfigurationEditor; -import org.rhq.enterprise.gui.coregui.client.components.wizard.WizardStep; +import org.rhq.enterprise.gui.coregui.client.components.wizard.AbstractWizardStep;
/** * @author Greg Hinkle */ -public class ConfigurationStep implements WizardStep { +public class ConfigurationStep extends AbstractWizardStep {
private ConfigurationEditor editor; ResourceFactoryCreateWizard wizard; diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/factory/ConfigurationTemplateStep.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/factory/ConfigurationTemplateStep.java index d619c3a..14ec617 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/factory/ConfigurationTemplateStep.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/factory/ConfigurationTemplateStep.java @@ -28,12 +28,12 @@ import com.smartgwt.client.widgets.form.fields.TextItem; import org.rhq.core.domain.configuration.Configuration; import org.rhq.core.domain.configuration.definition.ConfigurationDefinition; import org.rhq.core.domain.configuration.definition.ConfigurationTemplate; -import org.rhq.enterprise.gui.coregui.client.components.wizard.WizardStep; +import org.rhq.enterprise.gui.coregui.client.components.wizard.AbstractWizardStep;
/** * @author Greg Hinkle */ -public class ConfigurationTemplateStep implements WizardStep { +public class ConfigurationTemplateStep extends AbstractWizardStep {
private DynamicForm form; private ResourceFactoryCreateWizard wizard;
commit c229c5caa1bcde75fd61f2340721d22c7d0c8779 Merge: 6fefb92... 8e0e245... Author: John Sanda jsanda@redhat.com Date: Thu Jul 8 15:10:18 2010 -0400
Merge branch 'release-3.0.0' of ssh://git.fedorahosted.org/git/rhq/rhq into release-3.0.0
commit 6fefb92216811c6a727e5bff0eb6de6872d0d2be Author: John Sanda jsanda@redhat.com Date: Thu Jul 8 15:07:56 2010 -0400
[BZ 604744] Correcting property name for resource category field
The Resource property names and their corresponding display names used in and by ResourceDataSource were hard coded in several places. I introdcued a new enum, ResourceDataSourceField which encapsulates the property names and their display names.
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceDataSourceField.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceDataSourceField.java new file mode 100644 index 0000000..358021d --- /dev/null +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceDataSourceField.java @@ -0,0 +1,63 @@ +/* + * RHQ Management Platform + * Copyright (C) 2005-2008 Red Hat, Inc. + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License, version 2, as + * published by the Free Software Foundation, and/or the GNU Lesser + * General Public License, version 2.1, also as published by the Free + * Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License and the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License + * and the GNU Lesser General Public License along with this program; + * if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +package org.rhq.enterprise.gui.coregui.client.inventory.resource; + +public enum ResourceDataSourceField { + + NAME("name", "Name"), + + DESCRIPTION("description", "Description"), + + TYPE("resourceType.name", "Type"), + + PLUGIN("pluginName", "Plugin"), + + CATEGORY("resourceType.category", "Category"), + + AVAILABILITY("currentAvailability", "Availability"); + + /** + * Corresponds to a property name of Resource + */ + private String propertyName; + + /** + * The display name for the field or proeprty + */ + private String title; + + private ResourceDataSourceField(String propertyName, String title) { + this.propertyName = propertyName; + this.title = title; + } + + public String propertyName() { + return propertyName; + } + + public String title() { + return title; + } + +} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceDatasource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceDatasource.java index ec47c75..048ba11 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceDatasource.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceDatasource.java @@ -18,8 +18,6 @@ */ package org.rhq.enterprise.gui.coregui.client.inventory.resource;
-import java.util.List; - import com.google.gwt.core.client.JavaScriptObject; import com.google.gwt.user.client.rpc.AsyncCallback; import com.smartgwt.client.data.DSRequest; @@ -30,7 +28,6 @@ import com.smartgwt.client.data.fields.DataSourceIntegerField; import com.smartgwt.client.data.fields.DataSourceTextField; import com.smartgwt.client.rpc.RPCResponse; import com.smartgwt.client.widgets.grid.ListGridRecord; - import org.rhq.core.domain.criteria.ResourceCriteria; import org.rhq.core.domain.measurement.AvailabilityType; import org.rhq.core.domain.resource.Resource; @@ -43,6 +40,15 @@ import org.rhq.enterprise.gui.coregui.client.gwt.ResourceGWTServiceAsync; import org.rhq.enterprise.gui.coregui.client.util.RPCDataSource; import org.rhq.enterprise.gui.coregui.client.util.message.Message;
+import java.util.List; + +import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.AVAILABILITY; +import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.CATEGORY; +import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.DESCRIPTION; +import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.NAME; +import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.PLUGIN; +import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.TYPE; + /** * @author Greg Hinkle */ @@ -61,17 +67,19 @@ public class ResourceDatasource extends RPCDataSource<Resource> { DataSourceImageField iconField = new DataSourceImageField("icon"); iconField.setImageURLPrefix("types/");
- DataSourceTextField nameDataField = new DataSourceTextField("name", "Name", 200); + DataSourceTextField nameDataField = new DataSourceTextField(NAME.propertyName(), NAME.title(), 200); nameDataField.setCanEdit(false);
- DataSourceTextField descriptionDataField = new DataSourceTextField("description", "Description"); + DataSourceTextField descriptionDataField = new DataSourceTextField(DESCRIPTION.propertyName(), + DESCRIPTION.title()); descriptionDataField.setCanEdit(false);
- DataSourceTextField typeNameDataField = new DataSourceTextField("typeName", "Type"); - DataSourceTextField pluginNameDataField = new DataSourceTextField("pluginName", "Plugin"); - DataSourceTextField categoryDataField = new DataSourceTextField("category", "Category"); + DataSourceTextField typeNameDataField = new DataSourceTextField(TYPE.propertyName(), TYPE.title()); + DataSourceTextField pluginNameDataField = new DataSourceTextField(PLUGIN.propertyName(), PLUGIN.title()); + DataSourceTextField categoryDataField = new DataSourceTextField(CATEGORY.propertyName(), CATEGORY.title());
- DataSourceImageField availabilityDataField = new DataSourceImageField("currentAvailability", "Availability", 20); + DataSourceImageField availabilityDataField = new DataSourceImageField(AVAILABILITY.propertyName(), + AVAILABILITY.title(), 20);
availabilityDataField.setCanEdit(false);
@@ -97,27 +105,28 @@ public class ResourceDatasource extends RPCDataSource<Resource> { "parentId"))); }
- if (request.getCriteria().getValues().get("name") != null) { - criteria.addFilterName((String) request.getCriteria().getValues().get("name")); + if (request.getCriteria().getValues().get(NAME.propertyName()) != null) { + criteria.addFilterName((String) request.getCriteria().getValues().get(NAME.propertyName())); }
- if (request.getCriteria().getValues().get("category") != null) { + if (request.getCriteria().getValues().get(CATEGORY.propertyName()) != null) { criteria.addFilterResourceCategory(ResourceCategory.valueOf(((String) request.getCriteria().getValues() - .get("category")).toUpperCase())); + .get(CATEGORY.propertyName())).toUpperCase())); }
- if (request.getCriteria().getValues().get("availability") != null) { + if (request.getCriteria().getValues().get(AVAILABILITY.propertyName()) != null) { criteria.addFilterCurrentAvailability(AvailabilityType.valueOf(((String) request.getCriteria().getValues() - .get("availability")).toUpperCase())); + .get(AVAILABILITY.propertyName())).toUpperCase())); }
- if (request.getCriteria().getValues().get("type") != null) { + if (request.getCriteria().getValues().get(TYPE.propertyName()) != null) { criteria - .addFilterResourceTypeId(Integer.parseInt(((String) request.getCriteria().getValues().get("type")))); + .addFilterResourceTypeId(Integer.parseInt(((String) request.getCriteria().getValues().get( + TYPE.propertyName())))); }
- if (request.getCriteria().getValues().get("plugin") != null) { - criteria.addFilterPluginName((String) request.getCriteria().getValues().get("plugin")); + if (request.getCriteria().getValues().get(PLUGIN.propertyName()) != null) { + criteria.addFilterPluginName((String) request.getCriteria().getValues().get(PLUGIN.propertyName())); }
if (request.getCriteria().getValues().get("tag") != null) { @@ -191,11 +200,11 @@ public class ResourceDatasource extends RPCDataSource<Resource> { ListGridRecord record = new ListGridRecord(); record.setAttribute("resource", from); record.setAttribute("id", from.getId()); - record.setAttribute("name", from.getName()); - record.setAttribute("description", from.getDescription()); - record.setAttribute("typeName", from.getResourceType().getName()); - record.setAttribute("pluginName", from.getResourceType().getPlugin()); - record.setAttribute("category", from.getResourceType().getCategory().getDisplayName()); + record.setAttribute(NAME.propertyName(), from.getName()); + record.setAttribute(DESCRIPTION.propertyName(), from.getDescription()); + record.setAttribute(TYPE.propertyName(), from.getResourceType().getName()); + record.setAttribute(PLUGIN.propertyName(), from.getResourceType().getPlugin()); + record.setAttribute(CATEGORY.propertyName(), from.getResourceType().getCategory().getDisplayName()); record.setAttribute("icon", from.getResourceType().getCategory().getDisplayName() + "_" + (from.getCurrentAvailability().getAvailabilityType() == AvailabilityType.UP ? "up" : "down") + "_16.png");
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceSearchView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceSearchView.java index c08c42f..77f326b 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceSearchView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceSearchView.java @@ -39,6 +39,13 @@ import com.smartgwt.client.widgets.layout.VLayout; import org.rhq.enterprise.gui.coregui.client.components.table.Table; import org.rhq.enterprise.gui.coregui.client.components.table.TableAction;
+import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.AVAILABILITY; +import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.CATEGORY; +import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.DESCRIPTION; +import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.NAME; +import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.PLUGIN; +import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.TYPE; + /** * @author Greg Hinkle */ @@ -98,19 +105,19 @@ public class ResourceSearchView extends Table { ListGridField idField = new ListGridField("id", "Id", 55); idField.setType(ListGridFieldType.INTEGER); ListGridField iconField = new ListGridField("icon","", 40); - ListGridField nameField = new ListGridField("name", "Name", 250); + ListGridField nameField = new ListGridField(NAME.propertyName(), NAME.title(), 250); nameField.setCellFormatter(new CellFormatter() { public String format(Object o, ListGridRecord listGridRecord, int i, int i1) { return "<a href="#Resource/" + listGridRecord.getAttribute("id") + "">" + o + "</a>"; } });
- ListGridField descriptionField = new ListGridField("description", "Description"); - ListGridField typeNameField = new ListGridField("typeName", "Type", 130); - ListGridField pluginNameField = new ListGridField("pluginName", "Plugin", 100); - ListGridField categoryField = new ListGridField("category", "Category", 60); + ListGridField descriptionField = new ListGridField(DESCRIPTION.propertyName(), DESCRIPTION.title()); + ListGridField typeNameField = new ListGridField(TYPE.propertyName(), TYPE.title(), 130); + ListGridField pluginNameField = new ListGridField(PLUGIN.propertyName(), PLUGIN.title(), 100); + ListGridField categoryField = new ListGridField(CATEGORY.propertyName(), CATEGORY.title(), 60);
- ListGridField availabilityField = new ListGridField("currentAvailability", "Availability", 55); + ListGridField availabilityField = new ListGridField(AVAILABILITY.propertyName(), AVAILABILITY.title(), 55); availabilityField.setAlign(Alignment.CENTER); getListGrid().setFields(idField, iconField, nameField, descriptionField, typeNameField, pluginNameField, categoryField, availabilityField); diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/menu/SearchBarPane.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/menu/SearchBarPane.java index 6dfdf36..0923c4d 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/menu/SearchBarPane.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/menu/SearchBarPane.java @@ -51,6 +51,13 @@ import org.rhq.enterprise.gui.coregui.client.LinkManager; import org.rhq.enterprise.gui.coregui.client.inventory.groups.ResourceGroupsDataSource; import org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDatasource;
+import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.AVAILABILITY; +import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.CATEGORY; +import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.DESCRIPTION; +import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.NAME; +import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.PLUGIN; +import static org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDataSourceField.TYPE; + /** * @author Greg Hinkle */ @@ -107,12 +114,12 @@ public class SearchBarPane extends HLayout {
comboBox.setOptionDataSource(new ResourceDatasource());
- ListGridField nameField = new ListGridField("name", "Name", 250); - ListGridField descriptionField = new ListGridField("description", "Description"); - ListGridField typeNameField = new ListGridField("resourceType.name", "Type", 130); - ListGridField pluginNameField = new ListGridField("pluginName", "Plugin", 100); - ListGridField categoryField = new ListGridField("category", "Category", 60); - ListGridField availabilityField = new ListGridField("currentAvailability", "Availability", 55); + ListGridField nameField = new ListGridField(NAME.propertyName(), NAME.title(), 250); + ListGridField descriptionField = new ListGridField(DESCRIPTION.propertyName(), DESCRIPTION.title()); + ListGridField typeNameField = new ListGridField(TYPE.propertyName(), TYPE.title(), 130); + ListGridField pluginNameField = new ListGridField(PLUGIN.propertyName(), PLUGIN.title(), 100); + ListGridField categoryField = new ListGridField(CATEGORY.propertyName(), CATEGORY.title(), 60); + ListGridField availabilityField = new ListGridField(AVAILABILITY.propertyName(), AVAILABILITY.title(), 55); availabilityField.setAlign(Alignment.CENTER);
comboBox.setPickListFields(nameField, descriptionField, typeNameField, pluginNameField, categoryField, availabilityField);
commit 8e0e245599ff900c815ae60bf10d767c021dc2a5 Author: Joseph Marques joseph@redhat.com Date: Thu Jul 8 14:16:40 2010 -0400
BZ-612612: only suggest names for visible groups
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/GroupSearchAssistant.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/GroupSearchAssistant.java index 8ad4dd5..7f46e11 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/GroupSearchAssistant.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/assist/GroupSearchAssistant.java @@ -70,7 +70,8 @@ public class GroupSearchAssistant extends AbstractSearchAssistant { return execute("" // + "SELECT DISTINCT rg.name " // + " FROM ResourceGroup rg " // - + add(" WHERE LOWER(rg.name) LIKE '%" + filter.toLowerCase() + "%'", filter) // + + " WHERE rg.visible = true " // + + add(" AND LOWER(rg.name) LIKE '%" + filter.toLowerCase() + "%'", filter) // + " ORDER BY rg.name ");
} else {
commit 868926d6448140a0c0be38b70cc9110da18cca74 Author: Joseph Marques joseph@redhat.com Date: Thu Jul 8 13:03:32 2010 -0400
removed obsolete auto-complete / search suggestion components
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestResultsListBox.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestResultsListBox.java deleted file mode 100644 index cbdd17b..0000000 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestResultsListBox.java +++ /dev/null @@ -1,158 +0,0 @@ -/* - * RHQ Management Platform - * Copyright (C) 2010 Red Hat, Inc. - * All rights reserved. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation version 2 of the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ -package org.rhq.enterprise.gui.coregui.client.search.suggest; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import com.google.gwt.dom.client.Document; -import com.google.gwt.dom.client.OptionElement; -import com.google.gwt.dom.client.SelectElement; -import com.google.gwt.user.client.ui.ListBox; - -import org.rhq.core.domain.search.SearchSuggestion; -import org.rhq.core.domain.search.SearchSuggestion.Kind; - -public class SuggestResultsListBox extends ListBox { - public static final String FOOTER_MESSAGE = "Start typing for more simple text matches"; - - private List<SearchSuggestion> searchSuggestions = new ArrayList<SearchSuggestion>(); - - private final List<String> OPERATORS = Arrays.asList("!==", "!=", "==", "="); - - public void setErrorMessage(String error) { - this.searchSuggestions.clear(); - this.searchSuggestions.add(new SearchSuggestion(Kind.InstructionalTextComment, error)); - } - - public void setSearchSuggestions(List<SearchSuggestion> searchSuggestions) { - this.searchSuggestions.clear(); - this.searchSuggestions.addAll(searchSuggestions); - } - - public int render(int maxSuggestions, int maxResultsShown) { - clear(); - int addedResults = 0; - - if (searchSuggestions.size() == 0) { - appendFooter(FOOTER_MESSAGE); - addedResults++; - } - - for (SearchSuggestion next : searchSuggestions) { - if (addedResults == maxSuggestions) { - break; - } - - appendSuggestItem(next); - addedResults++; - } - - setVisibleItemCount(Math.max(2, Math.min(maxResultsShown, addedResults))); - - return addedResults; - } - - private void appendFooter(String message) { - SelectElement select = getElement().cast(); - OptionElement option = Document.get().createOptionElement(); - - String style = "float: left; margin-left: 2px; font-style: italic; color: gray;"; - String footer = "<span style="" + style + "">" + message + "</span>"; - - style = "clear: both;"; - String floatClear = "<br style="" + style + "" />"; - - option.setDisabled(true); - option.setValue(FOOTER_MESSAGE); - option.setInnerHTML(footer + floatClear); - select.add(option, null); - } - - private void appendSuggestItem(SearchSuggestion item) { - String className = "suggestData "; - String prefix = ""; - - if (item.getKind() == SearchSuggestion.Kind.Simple) { - className += "suggestDataSimple"; - prefix = "text"; - } else if (item.getKind() == SearchSuggestion.Kind.Advanced) { - className += "suggestDataAdvanced"; - prefix = "query"; - } else if (item.getKind() == SearchSuggestion.Kind.GlobalSavedSearch - || item.getKind() == SearchSuggestion.Kind.UserSavedSearch) { - className += "suggestDataSavedSearch"; - prefix = "saved"; - } else { - } - - SelectElement select = getElement().cast(); - OptionElement option = Document.get().createOptionElement(); - option.setValue(item.getValue()); - String style = "font-variant: small-caps; font-weight: bold; font-size: 11px; float: left; margin-left: 2px; width: 50px;"; - int marginOffset = 20; - if (className.endsWith("suggestDataSavedSearch")) { - style += " color: green;"; - marginOffset += 2; - } else { - style += " color: gray;"; - if (className.endsWith("suggestDataSimple")) { - marginOffset += 8; - } - } - String decoratedPrefix = decorate(prefix, style); - String highlightedSuggestion = colorOperator(decorate(item.getLabel(), "background-color: yellow;", item - .getStartIndex(), item.getEndIndex())); - //String decoratedSuffix = decorate(highlightedSuggestion, "float: left; margin-left: " + marginOffset + "px;"); - String decoratedSuffix = decorate(highlightedSuggestion, "float: left; "); - String floatClear = "<br style="clear: both;" />"; - - String innerHTML = decoratedPrefix + decoratedSuffix + floatClear; - option.setInnerHTML(innerHTML); - select.add(option, null); - } - - // TODO: fixing coloring strategy - private String colorOperator(String data) { - for (String operator : OPERATORS) { - int index = -1; - while ((index = data.indexOf(operator, index + 1)) != -1) { - if ((index - 5 >= 0) && data.substring(index - 5, index).equals("style") == false) { - break; - } - } - if (index != -1) { - return decorate(data, "color: blue;", index, index + operator.length()); - } - } - return data; - } - - private String decorate(String data, String style) { - return decorate(data, style, 0, data.length()); - } - - private String decorate(String data, String style, int startIndex, int endIndex) { - String before = data.substring(0, startIndex); - String highlight = data.substring(startIndex, endIndex); - String after = data.substring(endIndex); - return before + "<span style="" + style + "">" + highlight + "</span>" + after; - } -} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestTextBox.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestTextBox.java deleted file mode 100644 index 4e75b52..0000000 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestTextBox.java +++ /dev/null @@ -1,301 +0,0 @@ -/* - * RHQ Management Platform - * Copyright (C) 2010 Red Hat, Inc. - * All rights reserved. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation version 2 of the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ -package org.rhq.enterprise.gui.coregui.client.search.suggest; - -import java.util.List; - -import com.google.gwt.event.dom.client.ChangeEvent; -import com.google.gwt.event.dom.client.ChangeHandler; -import com.google.gwt.event.dom.client.ClickEvent; -import com.google.gwt.event.dom.client.ClickHandler; -import com.google.gwt.event.dom.client.FocusEvent; -import com.google.gwt.event.dom.client.FocusHandler; -import com.google.gwt.event.dom.client.KeyCodes; -import com.google.gwt.event.dom.client.KeyUpEvent; -import com.google.gwt.event.dom.client.KeyUpHandler; -import com.google.gwt.user.client.rpc.AsyncCallback; -import com.google.gwt.user.client.ui.PopupPanel; -import com.google.gwt.user.client.ui.ScrollPanel; -import com.google.gwt.user.client.ui.TextBox; - -import org.rhq.core.domain.search.SearchSuggestion; -import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup; -import org.rhq.enterprise.gui.coregui.client.gwt.SearchGWTServiceAsync; -import org.rhq.enterprise.gui.coregui.client.search.SearchBar; - -public class SuggestTextBox extends TextBox { - - protected PopupPanel choicesPopup = new PopupPanel(true); - protected ScrollPanel choicesScrollPanel = new ScrollPanel(); - protected SuggestResultsListBox choices = new SuggestResultsListBox(); - - private SearchBar searchBar; - - private SearchGWTServiceAsync searchService = GWTServiceLookup.getSearchService(); - - public SuggestTextBox(SearchBar searchBar) { - super(); - this.searchBar = searchBar; - setupTextBox(); - setupChoicesPopup(); - setupChoicesListBox(); - } - - public void setupTextBox() { - getElement().setAttribute("autocomplete", "off"); // we're producing completion suggestions, not the browser - SuggestTextBoxEventHandler handler = new SuggestTextBoxEventHandler(); - this.addKeyUpHandler(handler); - this.addFocusHandler(handler); - } - - public void setupChoicesPopup() { - choicesPopup.removeStyleName("gwt-PopupPanel"); - choicesPopup.addStyleName("suggestPanel"); - choicesPopup.add(choices); - } - - public PopupPanel getSuggestionComponent() { - return choicesPopup; - } - - public void setupChoicesListBox() { - choices.addStyleName("suggestPanel"); - - SuggestionResultsListBoxEventHandler handler = new SuggestionResultsListBoxEventHandler(); - choices.addChangeHandler(handler); - choices.addClickHandler(handler); - } - - public void hideInitialSuggestions() { - show(); - hide(); - } - - public boolean isSuggestionListShowing() { - return isDisplayed(); - } - - public boolean isItemSelected() { - return (choices.getSelectedIndex() != -1); - } - - protected void complete() { - if (choices.getItemCount() > 0 && choices.getSelectedIndex() != -1) { - String currentText = this.getText().toLowerCase(); - String completion = choices.getValue(choices.getSelectedIndex()); - - int cursorPosition = this.getCursorPos(); - int previousWhitespaceIndex = cursorPosition; - if (cursorPosition != 0) { - while (--previousWhitespaceIndex > 0) { - if (this.getText().charAt(previousWhitespaceIndex) == ' ') { - previousWhitespaceIndex++; // put index right after found whitespace - break; - } - } - } - String before = this.getText().substring(0, previousWhitespaceIndex); - String after = this.getText().substring(cursorPosition); - this.setValue(before + completion + after); - - // TODO: this algo screws up when it does the indexOf search on just a single char from currentText - // use case is "availability=dow<enter>" -- is this still true, now that we're completing longer things for advanced search? - - if (currentText.equals(this.getText().toLowerCase())) { - this.setValue(currentText + completion, true); - } - } - - choices.clear(); - hide(); - - // if this is a saved search pattern completion, execute that search immediately - System.out.println("just completed to '" + this.getValue() + "'"); - String patternValue = searchBar.getSavedSearchManager().getPatternByName(this.getValue()); - if (patternValue != null) { - searchBar.prepareSearchExecution(); - } else { - // send a 'fake' key, this will rerender PopupPanel with the new completion list - handleKeyCode(0); - } - } - - private void hide() { - choicesPopup.hide(); - } - - private void show() { - choicesPopup.show(); - } - - private boolean isDisplayed() { - return choicesPopup.isShowing(); - } - - public void hidePopup() { - handleKeyCode(KeyCodes.KEY_ESCAPE); - } - - class SuggestTextBoxEventHandler implements KeyUpHandler, FocusHandler { - public void onKeyUp(KeyUpEvent event) { - int keyCode = event.getNativeKeyCode(); - handleKeyCode(keyCode); - - if (keyCode == KeyCodes.KEY_TAB) { - event.stopPropagation(); - event.preventDefault(); - } - } - - public void onFocus(FocusEvent event) { - if (getText().equals(searchBar.getWelcomeMessage())) { - setText(""); - } - // send a 'fake' key, this will rerender PopupPanel with the new completion list - handleKeyCode(1); - } - } - - class SuggestionResultsListBoxEventHandler implements ChangeHandler, ClickHandler { - public void onChange(ChangeEvent event) { - complete(); - } - - public void onClick(ClickEvent event) { - complete(); - } - } - - protected void handleKeyCode(int keyCode) { - if (keyCode == KeyCodes.KEY_TAB) { - this.setValue(this.getValue() + " "); - this.setCursorPos(this.getValue().length()); - this.setFocus(true); - return; - } - - if (keyCode == KeyCodes.KEY_DOWN) { - int selectedIndex = choices.getSelectedIndex(); - selectedIndex++; - if (selectedIndex >= choices.getItemCount()) { - selectedIndex = 0; - } - String value = choices.getValue(selectedIndex); - if (value.equals(SuggestResultsListBox.FOOTER_MESSAGE)) { - if (choices.getItemCount() == 1) { - selectedIndex = -1; // do not allow the disabled row to be selected via KEY_DOWN - } else { - selectedIndex++; - } - } - choices.setSelectedIndex(selectedIndex); - return; - } - - if (keyCode == KeyCodes.KEY_UP) { - int selectedIndex = choices.getSelectedIndex(); - selectedIndex--; - if (selectedIndex < 0) { - selectedIndex = choices.getItemCount() - 1; - } - String value = choices.getValue(selectedIndex); - if (value.equals(SuggestResultsListBox.FOOTER_MESSAGE)) { - if (choices.getItemCount() == 1) { - selectedIndex = -1; // do not allow the disabled row to be selected via KEY_UP - } else { - selectedIndex = choices.getItemCount() - 1; - } - } - choices.setSelectedIndex(selectedIndex); - return; - } - - if (keyCode == KeyCodes.KEY_ENTER) { - int selectedIndex = choices.getSelectedIndex(); - if (selectedIndex != -1) { - complete(); - } - return; - } - - if (keyCode == KeyCodes.KEY_ESCAPE) { - choices.clear(); - hide(); - return; - } - - hide(); - String text = this.getText(); - - searchService.getSuggestions( // - searchBar.getSearchSubsystem(), // - text, // - this.getCursorPos(), // - new SearchSuggestionCallback(keyCode)); - } - - class SearchSuggestionCallback implements AsyncCallback<List<SearchSuggestion>> { - - private int keyCode; - - public SearchSuggestionCallback(int keyCode) { - this.keyCode = keyCode; - } - - public void onFailure(Throwable caught) { - choices.setErrorMessage(caught.getMessage()); - commonHandler(); - } - - public void onSuccess(List<SearchSuggestion> result) { - choices.setSearchSuggestions(result); - commonHandler(); - } - - private void commonHandler() { - int suggestionCount = choices.render(100, 15); - if (suggestionCount == 0) { - return; - } - - choicesPopup.setPopupPosition(getAbsoluteLeft(), getAbsoluteTop() + getOffsetHeight() + 5); - show(); - - if (keyCode == 0) { - /* - if (choices.getItemCount() > 0) { - String value = choices.getValue(0); - if (value.equals(SuggestResultsListBox.FOOTER_MESSAGE)) { - if (choices.getItemCount() > 1) { - choices.setSelectedIndex(1); - } else { - choices.setSelectedIndex(-1); // nothing is selected if FOOTER_MESSAGE is the only suggestion - } - } else { - choices.setSelectedIndex(0); - } - } - */ - - setFocus(true); - } - } - - } -} \ No newline at end of file diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestTextBox_v2.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestTextBox_v2.java deleted file mode 100644 index b5a7c79..0000000 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/search/suggest/SuggestTextBox_v2.java +++ /dev/null @@ -1,166 +0,0 @@ -/* - * RHQ Management Platform - * Copyright (C) 2010 Red Hat, Inc. - * All rights reserved. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation version 2 of the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ -package org.rhq.enterprise.gui.coregui.client.search.suggest; - -import java.util.List; - -import com.google.gwt.event.logical.shared.SelectionEvent; -import com.google.gwt.event.logical.shared.SelectionHandler; -import com.google.gwt.user.client.rpc.AsyncCallback; -import com.google.gwt.user.client.ui.SuggestBox; -import com.google.gwt.user.client.ui.SuggestOracle; -import com.google.gwt.user.client.ui.TextBox; -import com.google.gwt.user.client.ui.SuggestOracle.Suggestion; - -import org.rhq.core.domain.search.SearchSuggestion; -import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup; -import org.rhq.enterprise.gui.coregui.client.gwt.SearchGWTServiceAsync; -import org.rhq.enterprise.gui.coregui.client.search.SearchBar; - -public class SuggestTextBox_v2 extends TextBox { - - private final SearchBar searchBar; - private final SearchSuggestOracle searchSuggestionOracle; - private final SuggestBox suggestBox; - - public SuggestTextBox_v2(SearchBar searchBar) { - super(); - getElement().setAttribute("autocomplete", "off"); // we're producing completion suggestions, not the browser - this.searchBar = searchBar; - this.searchSuggestionOracle = new SearchSuggestOracle(); - this.suggestBox = new SuggestBox(searchSuggestionOracle, this); - - this.suggestBox.setWidth("785px"); - this.suggestBox.setLimit(15); - this.suggestBox.setAutoSelectEnabled(false); - this.suggestBox.setAnimationEnabled(true); - - initHandlers(); - } - - private void initHandlers() { - this.suggestBox.addSelectionHandler(new SelectionHandler<Suggestion>() { - - public void onSelection(SelectionEvent<Suggestion> event) { - - //event.stopPropagation(); - //event.preventDefault(); - complete(event.getSelectedItem().getReplacementString(), getCursorPos()); - //Suggestion suggestion = event.getSelectedItem(); - //searchBar.executeSearch(); - } - }); - } - - public void hidePopup() { - this.suggestBox.hideSuggestionList(); - } - - public boolean isSuggestionListShowing() { - return this.suggestBox.isSuggestionListShowing(); - } - - public SuggestBox getSuggestionBox() { - return this.suggestBox; - } - - class SearchSuggestOracle extends SuggestOracle { - private SearchGWTServiceAsync searchService = GWTServiceLookup.getSearchService(); - - @Override - public boolean isDisplayStringHTML() { - return true; - } - - @Override - public void requestDefaultSuggestions(Request request, Callback callback) { - requestSuggestions(request, callback); - } - - @Override - public void requestSuggestions(final Request request, final Callback callback) { - String expression = getText(); - int caretPosition = getCursorPos(); // hack, but it wasn't passed in the request - - searchService.getSuggestions(searchBar.getSearchSubsystem(), expression, caretPosition, - new AsyncCallback<List<SearchSuggestion>>() { - - public void onSuccess(List<SearchSuggestion> results) { - List<SearchSuggestionOracleAdapter> adaptedResults = new java.util.ArrayList<SearchSuggestionOracleAdapter>(); - for (SearchSuggestion next : results) { - adaptedResults.add(new SearchSuggestionOracleAdapter(next)); - } - SuggestOracle.Response response = new SuggestOracle.Response(adaptedResults); - callback.onSuggestionsReady(request, response); - } - - public void onFailure(Throwable caught) { - System.out.println("Uh oh"); - } - }); - } - } - - protected void complete(String completion, int cursorPosition) { - String currentText = getText().toLowerCase(); - int previousWhitespaceIndex = cursorPosition; - if (cursorPosition != 0) { - while (--previousWhitespaceIndex > 0) { - if (getText().charAt(previousWhitespaceIndex) == ' ') { - previousWhitespaceIndex++; // put index right after found whitespace - break; - } - } - } - String before = getText().substring(0, previousWhitespaceIndex); - String after = getText().substring(cursorPosition); - setValue(before + completion + after); - - // TODO: this algo screws up when it does the indexOf search on just a single char from currentText - // use case is "availability=dow<enter>" -- is this still true, now that we're completing longer things for advanced search? - - if (currentText.equals(getText().toLowerCase())) { - setValue(currentText + completion, true); - } - - String patternValue = searchBar.getSavedSearchManager().getPatternByName(getValue()); - if (patternValue != null) { - searchBar.prepareSearchExecution(); - } else { - suggestBox.showSuggestionList(); - } - } - - class SearchSuggestionOracleAdapter implements SuggestOracle.Suggestion { - private final SearchSuggestion suggestion; - - public SearchSuggestionOracleAdapter(SearchSuggestion suggestion) { - this.suggestion = suggestion; - } - - public String getDisplayString() { - return suggestion.getLabel(); - } - - public String getReplacementString() { - return suggestion.getValue(); - } - - } -}
commit 6ea7eac1aeb78764764d0191da0a76348db997ad Author: Joseph Marques joseph@redhat.com Date: Wed Jul 7 19:50:53 2010 -0400
disallow creation of global saved searches, which will minimize upgrade burden later
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/SavedSearchManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/SavedSearchManagerBean.java index 8e8c45c..c8cf5f4 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/SavedSearchManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/SavedSearchManagerBean.java @@ -98,10 +98,7 @@ public class SavedSearchManagerBean implements SavedSearchManagerLocal /* local
private void validateManipulatePermission(Subject subject, SavedSearch savedSearch) { if (savedSearch.isGlobal()) { - if (!authorizationManager.isInventoryManager(subject)) { - throw new PermissionException("Only inventory managers can manipulate global saved searches"); - } - // note: inventory managers can modify any saved search pattern, not just their own + throw new UnsupportedOperationException("Global saved searches are not yet supported"); } else { if (subject.getId() != savedSearch.getSubjectId() && !authorizationManager.isInventoryManager(subject)) { throw new PermissionException("Users without inventory manager permission "
commit 32cbf5aa0d5b872911801a7a25a48b6d68411d0c Author: Joseph Marques joseph@redhat.com Date: Wed Jul 7 19:50:04 2010 -0400
fix typo in exception message
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/SavedSearchManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/SavedSearchManagerBean.java index 32aa7cd..8e8c45c 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/SavedSearchManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/SavedSearchManagerBean.java @@ -114,7 +114,7 @@ public class SavedSearchManagerBean implements SavedSearchManagerLocal /* local if (!savedSearch.isGlobal()) { if (subject.getId() != savedSearch.getSubjectId() && !authorizationManager.isInventoryManager(subject)) { throw new PermissionException("Users without inventory manager permission " - + "can only view their own or global saved saved searches"); + + "can only view their own saved searches"); } } }
commit 5b9121ecd59d46395ab8ee389fca4be62a27dbc5 Author: Joseph Marques joseph@redhat.com Date: Wed Jul 7 19:47:36 2010 -0400
prevnet global saved searches from appearing in the menu bar
diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/common/framework/UserPreferencesUIBean.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/common/framework/UserPreferencesUIBean.java index 8fa9e9f..146c663 100644 --- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/common/framework/UserPreferencesUIBean.java +++ b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/common/framework/UserPreferencesUIBean.java @@ -160,9 +160,7 @@ public class UserPreferencesUIBean { if (savedSearches == null) { SavedSearchCriteria criteria = new SavedSearchCriteria(); criteria.addFilterSubjectId(getSubject().getId()); - criteria.addFilterGlobal(true); - criteria.setFiltersOptional(true); // get this user's searches as well as global ones - criteria.addSortGlobal(PageOrdering.DESC); // globals, then user-specified + criteria.addFilterGlobal(false); criteria.addSortName(PageOrdering.ASC); // each sublist is alphabetical
savedSearches = savedSearchManager.findSavedSearchesByCriteria(getSubject(), criteria);
commit 01445ef3c09a6429fb6ce4ba97f64dd2fc60a098 Author: John Mazzitelli mazz@redhat.com Date: Thu Jul 8 13:12:34 2010 -0400
BZ 612358 - when uploading recipe and then uploading bundle files, need to make the bundle files wiht the same version as the bundle
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/upload/BundleFileUploadForm.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/upload/BundleFileUploadForm.java index f3d862c..ab2c539 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/upload/BundleFileUploadForm.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/upload/BundleFileUploadForm.java @@ -149,7 +149,7 @@ public class BundleFileUploadForm extends DynamicCallbackForm { nameField.setValue(this.name);
HiddenItem versionField = new HiddenItem("version"); - versionField.setValue("1.0"); + versionField.setValue(this.bundleVersion.getVersion());
setNumCols(7);
commit a9b4cf49b9fb2ba40ec4eae3bd116c389fc58bf8 Author: John Sanda jsanda@redhat.com Date: Thu Jul 8 12:52:25 2010 -0400
[BZ 604744] Correcting list field property name for sorting
The dropdown field name for the resource type name was set to typeName which is incorect. It should be resourceType.name.
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/menu/SearchBarPane.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/menu/SearchBarPane.java index 40c6154..6dfdf36 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/menu/SearchBarPane.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/menu/SearchBarPane.java @@ -109,7 +109,7 @@ public class SearchBarPane extends HLayout {
ListGridField nameField = new ListGridField("name", "Name", 250); ListGridField descriptionField = new ListGridField("description", "Description"); - ListGridField typeNameField = new ListGridField("typeName", "Type", 130); + ListGridField typeNameField = new ListGridField("resourceType.name", "Type", 130); ListGridField pluginNameField = new ListGridField("pluginName", "Plugin", 100); ListGridField categoryField = new ListGridField("category", "Category", 60); ListGridField availabilityField = new ListGridField("currentAvailability", "Availability", 55);
commit bb1a0ea1e49cb73e9d92a5aa01399489a10bd4e6 Merge: 54f92b5... 074d5c2... Author: Jay Shaughnessy jshaughn@redhat.com Date: Thu Jul 8 10:57:44 2010 -0400
Merge branch 'release-3.0.0' into release-3.0.0-jay
commit 54f92b5688e0922d6c3e00af7a410cdbe8e54650 Author: Jay Shaughnessy jshaughn@redhat.com Date: Thu Jul 8 10:50:50 2010 -0400
[BZ 611411] Fix a different failure message scenario for this bundle create wizard bz.
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDataStep.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDataStep.java index 50f1a15..7e3ed51 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDataStep.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDataStep.java @@ -41,6 +41,7 @@ import org.rhq.enterprise.gui.coregui.client.components.wizard.WizardStep; import org.rhq.enterprise.gui.coregui.client.gwt.BundleGWTServiceAsync; import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup; import org.rhq.enterprise.gui.coregui.client.util.message.Message; +import org.rhq.enterprise.gui.coregui.client.util.message.Message.Severity;
public class BundleUploadDataStep implements WizardStep {
@@ -109,6 +110,8 @@ public class BundleUploadDataStep implements WizardStep { if (uploadForm.getUploadResult() == null) { uploadForm.submitForm(); needToUpload = true; + // on certain errors the form may never be submitted, report these errors outside submit handlers + handleUploadError(uploadForm.getUploadError(), false); } } if (needToUpload) { @@ -173,13 +176,7 @@ public class BundleUploadDataStep implements WizardStep { } else { allFilesStatus.put(uploadForm.getName(), Boolean.FALSE); String errorMessage = uploadForm.getUploadError(); - if (null != errorMessage) { - wizard.getView().showMessage(errorMessage); - } else { - errorMessage = ""; - } - CoreGUI.getMessageCenter().notify( - new Message("Failed to upload bundle file", results, Message.Severity.Error)); + handleUploadError(errorMessage, true); } } }); @@ -198,4 +195,18 @@ public class BundleUploadDataStep implements WizardStep {
return; } + + private void handleUploadError(String errorMessage, boolean sendToMessageCenter) { + if (null != errorMessage) { + wizard.getView().showMessage(errorMessage); + } else { + errorMessage = ""; + } + + if (sendToMessageCenter) { + CoreGUI.getMessageCenter().notify( + new Message("Failed to upload bundle distribution file. " + errorMessage, Severity.Error)); + } + } + } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDistroFileStep.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDistroFileStep.java index 3245b61..bd447ef 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDistroFileStep.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDistroFileStep.java @@ -96,6 +96,8 @@ public class BundleUploadDistroFileStep implements WizardStep { processUrl(); } else if ("Upload".equals(selected)) { uploadDistroForm.submitForm(); + // on certain errors the form may never be submitted, report these errors outside submit handlers + handleUploadError(uploadDistroForm.getUploadError(), false); } else if ("Recipe".equals(selected)) { processRecipe(); } else { @@ -238,13 +240,7 @@ public class BundleUploadDistroFileStep implements WizardStep { }); } else { String errorMessage = uploadDistroForm.getUploadError(); - if (null != errorMessage) { - wizard.getView().showMessage(errorMessage); - } else { - errorMessage = ""; - } - CoreGUI.getMessageCenter().notify( - new Message("Failed to upload bundle distribution file. " + errorMessage, Severity.Error)); + handleUploadError(errorMessage, true); wizard.setBundleVersion(null); setButtonsDisableMode(false); } @@ -277,4 +273,17 @@ public class BundleUploadDistroFileStep implements WizardStep { wizard.getView().getCancelButton().setDisabled(disabled); wizard.getView().getNextButton().setDisabled(disabled); } + + private void handleUploadError(String errorMessage, boolean sendToMessageCenter) { + if (null != errorMessage) { + wizard.getView().showMessage(errorMessage); + } else { + errorMessage = ""; + } + + if (sendToMessageCenter) { + CoreGUI.getMessageCenter().notify( + new Message("Failed to upload bundle distribution file. " + errorMessage, Severity.Error)); + } + } } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/upload/BundleDistributionFileUploadForm.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/upload/BundleDistributionFileUploadForm.java index 652259d..3021132 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/upload/BundleDistributionFileUploadForm.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/upload/BundleDistributionFileUploadForm.java @@ -105,10 +105,14 @@ public class BundleDistributionFileUploadForm extends DynamicCallbackForm {
@Override public void submitForm() { + setUploadError(null); Object value = bundleUploadItem.getValue(); if (value == null || value.toString().length() == 0) { + String message = "Please select a bundle distribution file to upload"; icon.setIcons(iconRed); - icon.setTooltip("Please select a bundle distribution file to upload"); + icon.setTooltip(message); + setUploadError(message); + // note - don't even submit this definitite failure } else { icon.setIcons(iconLoading); icon.setTooltip("Processing..."); @@ -147,8 +151,10 @@ public class BundleDistributionFileUploadForm extends DynamicCallbackForm { icon.setIcons(iconGreen); icon.setTooltip("Bundle distribution file has already been uploaded"); } else { + String message = "Bundle distribution file upload has previously failed"; icon.setIcons(iconRed); - icon.setTooltip("Bundle distribution file upload has previously failed"); + icon.setTooltip(message); + setUploadError(message); } } else { icon.setIcons((FormItemIcon) null); diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/upload/BundleFileUploadForm.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/upload/BundleFileUploadForm.java index 4a502ce..f3d862c 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/upload/BundleFileUploadForm.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/upload/BundleFileUploadForm.java @@ -120,10 +120,14 @@ public class BundleFileUploadForm extends DynamicCallbackForm {
@Override public void submitForm() { + setUploadError(null); Object value = bundleUploadItem.getValue(); if (value == null || value.toString().length() == 0) { + String message = "[" + name + "] Please select a file to upload"; icon.setIcons(iconRed); - icon.setTooltip("Please select a file to upload"); + icon.setTooltip(message); + setUploadError(message); + // note - don't even submit this definitite failure } else { icon.setIcons(iconLoading); icon.setTooltip("Loading..."); @@ -170,8 +174,10 @@ public class BundleFileUploadForm extends DynamicCallbackForm { icon.setIcons(iconGreen); icon.setTooltip("Bundle file has already been uploaded"); } else { + String message = "Bundle file upload has previously failed"; icon.setIcons(iconRed); - icon.setTooltip("Bundle file upload has previously failed"); + icon.setTooltip(message); + setUploadError(message); } } else { icon.setIcons(iconGrey);
commit 8f15e8631991e517dd9e044fd6371d3eed4675ae Author: Heiko W. Rupp hwr@redhat.com Date: Thu Jul 8 15:19:10 2010 +0200
Catch Exception from Augeas when the wanted file is not available and just return an empty set.
diff --git a/modules/plugins/augeas/src/main/java/org/rhq/plugins/augeas/AugeasConfigurationDiscoveryComponent.java b/modules/plugins/augeas/src/main/java/org/rhq/plugins/augeas/AugeasConfigurationDiscoveryComponent.java index 04d4faf..def1097 100644 --- a/modules/plugins/augeas/src/main/java/org/rhq/plugins/augeas/AugeasConfigurationDiscoveryComponent.java +++ b/modules/plugins/augeas/src/main/java/org/rhq/plugins/augeas/AugeasConfigurationDiscoveryComponent.java @@ -60,12 +60,16 @@ public class AugeasConfigurationDiscoveryComponent<T extends ResourceComponent> pluginConfig.put(includeProps); pluginConfig.put(excludeProps);
- checkFiles(pluginConfig); - - DiscoveredResourceDetails resource = createResourceDetails(discoveryContext, pluginConfig); - discoveredResources.add(resource); - log.debug("Discovered " + discoveryContext.getResourceType().getName() + " Resource with key [" - + resource.getResourceKey() + "]."); + try { + checkFiles(pluginConfig); + + DiscoveredResourceDetails resource = createResourceDetails(discoveryContext, pluginConfig); + discoveredResources.add(resource); + log.debug("Discovered " + discoveryContext.getResourceType().getName() + " Resource with key [" + + resource.getResourceKey() + "]."); + } catch (IllegalStateException e) { // Thrown by augeas if it can not read a file + log.warn("Discovery failed: " + e.getMessage()); + }
return discoveredResources; }
commit c7d5f87938f085f90d0cefacf693c1ebd7f6da2b Author: Heiko W. Rupp hwr@redhat.com Date: Thu Jul 8 15:17:25 2010 +0200
Return UP until we know why context has no process info
diff --git a/modules/plugins/hadoop/src/main/java/org/rhq/plugins/hadoop/HadoopServiceComponent.java b/modules/plugins/hadoop/src/main/java/org/rhq/plugins/hadoop/HadoopServiceComponent.java index 53f437b..c0f060f 100644 --- a/modules/plugins/hadoop/src/main/java/org/rhq/plugins/hadoop/HadoopServiceComponent.java +++ b/modules/plugins/hadoop/src/main/java/org/rhq/plugins/hadoop/HadoopServiceComponent.java @@ -40,7 +40,8 @@ public class HadoopServiceComponent extends JMXServerComponent implements JMXCom * @see org.rhq.core.pluginapi.inventory.ResourceComponent#getAvailability() */ public AvailabilityType getAvailability() { - return context.getNativeProcess().isRunning() ? AvailabilityType.UP: AvailabilityType.DOWN; + return AvailabilityType.UP; // Return UP until we know why context has no process info TODO + //return context.getNativeProcess().isRunning() ? AvailabilityType.UP: AvailabilityType.DOWN; }
commit 074d5c218e4f9e3bceb91963ad6c4daa6e4982aa Author: Ian Springer ian.springer@redhat.com Date: Wed Jul 7 18:55:22 2010 -0400
fix so user with Bundle perm can view Content>Bundles menu item but so user with Inventory perm and not Bundle perm cannot (fix for https://bugzilla.redhat.com/show_bug.cgi?id=611760)
diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/authorization/GlobalPermissionsUIBean.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/authorization/GlobalPermissionsUIBean.java index 9f6ffd0..a1f3145 100644 --- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/authorization/GlobalPermissionsUIBean.java +++ b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/authorization/GlobalPermissionsUIBean.java @@ -1,6 +1,6 @@ /* * RHQ Management Platform - * Copyright (C) 2005-2008 Red Hat, Inc. + * Copyright (C) 2005-2010 Red Hat, Inc. * All rights reserved. * * This program is free software; you can redistribute it and/or modify @@ -31,6 +31,7 @@ public class GlobalPermissionsUIBean { private boolean security; private boolean inventory; private boolean settings; + private boolean bundle; private boolean isSuperuser; private boolean isDebugMode; private boolean isExperimental; @@ -44,6 +45,7 @@ public class GlobalPermissionsUIBean { security = globalPermissions.contains(Permission.MANAGE_SECURITY); inventory = globalPermissions.contains(Permission.MANAGE_INVENTORY); settings = globalPermissions.contains(Permission.MANAGE_SETTINGS); + bundle = globalPermissions.contains(Permission.MANAGE_BUNDLE); isSuperuser = LookupUtil.getAuthorizationManager().isSystemSuperuser(user); }
@@ -75,4 +77,8 @@ public class GlobalPermissionsUIBean { public boolean isSettings() { return settings; } + + public boolean isBundle() { + return bundle; + } } diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/menu/menu.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/menu/menu.xhtml index f7bbaa9..9e2ae2b 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/menu/menu.xhtml +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/menu/menu.xhtml @@ -345,14 +345,17 @@ </rich:menuGroup>
ui:remove***** Administration > CONTENT *****</ui:remove> - <rich:menuGroup value="Content" rendered="#{GlobalPermissionsUIBean.inventory}"> - <rich:menuItem submitMode="none" onclick="window.location = '/coregui/CoreGUI.html#Bundles'"> + <rich:menuGroup value="Content" rendered="#{GlobalPermissionsUIBean.inventory || GlobalPermissionsUIBean.bundle}"> + <rich:menuItem submitMode="none" onclick="window.location = '/coregui/CoreGUI.html#Bundles'" + rendered="#{GlobalPermissionsUIBean.bundle}"> <h:outputText value="Bundles"/> </rich:menuItem> - <rich:menuItem submitMode="none" onclick="window.location = '/rhq/content/listContentProviders.xhtml'"> + <rich:menuItem submitMode="none" onclick="window.location = '/rhq/content/listContentProviders.xhtml'" + rendered="#{GlobalPermissionsUIBean.inventory}"> <h:outputText value="Content Sources"/> </rich:menuItem> - <rich:menuItem submitMode="none" onclick="window.location = '/rhq/content/listRepos.xhtml'"> + <rich:menuItem submitMode="none" onclick="window.location = '/rhq/content/listRepos.xhtml'" + rendered="#{GlobalPermissionsUIBean.inventory}"> <h:outputText value="Repositories"/> </rich:menuItem> </rich:menuGroup> @@ -684,5 +687,4 @@ v <rich:menuItem submitMode="none" </a4j:region>
- -</a4j:region> \ No newline at end of file +</a4j:region>
commit b53a1e1018cc90346cc85e4bfaadc096a0910ca4 Merge: 578a960... f1f81a2... Author: Ian Springer ian.springer@redhat.com Date: Wed Jul 7 17:20:32 2010 -0400
Merge branch 'release-3.0.0' of ssh://git.fedorahosted.org/git/rhq/rhq into release-3.0.0
commit 578a960805bd4e636762438b7badf04f247d2528 Author: Ian Springer ian.springer@redhat.com Date: Wed Jul 7 17:15:20 2010 -0400
copy new Server/Service icons into coregui war too; remove redundant Service icons from images/resources dir in coregui war, since they already exist in the images/types dir
diff --git a/modules/enterprise/gui/coregui/src/main/webapp/images/resources/Service_down_16.png b/modules/enterprise/gui/coregui/src/main/webapp/images/resources/Service_down_16.png deleted file mode 100644 index d09143b..0000000 Binary files a/modules/enterprise/gui/coregui/src/main/webapp/images/resources/Service_down_16.png and /dev/null differ diff --git a/modules/enterprise/gui/coregui/src/main/webapp/images/resources/Service_down_24.png b/modules/enterprise/gui/coregui/src/main/webapp/images/resources/Service_down_24.png deleted file mode 100644 index 24b1d98..0000000 Binary files a/modules/enterprise/gui/coregui/src/main/webapp/images/resources/Service_down_24.png and /dev/null differ diff --git a/modules/enterprise/gui/coregui/src/main/webapp/images/resources/Service_up_16.png b/modules/enterprise/gui/coregui/src/main/webapp/images/resources/Service_up_16.png deleted file mode 100644 index bbebc5c..0000000 Binary files a/modules/enterprise/gui/coregui/src/main/webapp/images/resources/Service_up_16.png and /dev/null differ diff --git a/modules/enterprise/gui/coregui/src/main/webapp/images/resources/Service_up_24.png b/modules/enterprise/gui/coregui/src/main/webapp/images/resources/Service_up_24.png deleted file mode 100644 index 7df5599..0000000 Binary files a/modules/enterprise/gui/coregui/src/main/webapp/images/resources/Service_up_24.png and /dev/null differ diff --git a/modules/enterprise/gui/coregui/src/main/webapp/images/types/Server_down_16.png b/modules/enterprise/gui/coregui/src/main/webapp/images/types/Server_down_16.png index 69a4d9f..df7487f 100644 Binary files a/modules/enterprise/gui/coregui/src/main/webapp/images/types/Server_down_16.png and b/modules/enterprise/gui/coregui/src/main/webapp/images/types/Server_down_16.png differ diff --git a/modules/enterprise/gui/coregui/src/main/webapp/images/types/Server_up_16.png b/modules/enterprise/gui/coregui/src/main/webapp/images/types/Server_up_16.png index 132e4ce..73b5f6b 100644 Binary files a/modules/enterprise/gui/coregui/src/main/webapp/images/types/Server_up_16.png and b/modules/enterprise/gui/coregui/src/main/webapp/images/types/Server_up_16.png differ diff --git a/modules/enterprise/gui/coregui/src/main/webapp/images/types/Service_down_16.png b/modules/enterprise/gui/coregui/src/main/webapp/images/types/Service_down_16.png index d09143b..a31229b 100644 Binary files a/modules/enterprise/gui/coregui/src/main/webapp/images/types/Service_down_16.png and b/modules/enterprise/gui/coregui/src/main/webapp/images/types/Service_down_16.png differ diff --git a/modules/enterprise/gui/coregui/src/main/webapp/images/types/Service_down_24.png b/modules/enterprise/gui/coregui/src/main/webapp/images/types/Service_down_24.png index 24b1d98..fc8583f 100644 Binary files a/modules/enterprise/gui/coregui/src/main/webapp/images/types/Service_down_24.png and b/modules/enterprise/gui/coregui/src/main/webapp/images/types/Service_down_24.png differ diff --git a/modules/enterprise/gui/coregui/src/main/webapp/images/types/Service_up_16.png b/modules/enterprise/gui/coregui/src/main/webapp/images/types/Service_up_16.png index bbebc5c..a925aaf 100644 Binary files a/modules/enterprise/gui/coregui/src/main/webapp/images/types/Service_up_16.png and b/modules/enterprise/gui/coregui/src/main/webapp/images/types/Service_up_16.png differ diff --git a/modules/enterprise/gui/coregui/src/main/webapp/images/types/Service_up_24.png b/modules/enterprise/gui/coregui/src/main/webapp/images/types/Service_up_24.png index 7df5599..6c37504 100644 Binary files a/modules/enterprise/gui/coregui/src/main/webapp/images/types/Service_up_24.png and b/modules/enterprise/gui/coregui/src/main/webapp/images/types/Service_up_24.png differ
commit f1f81a2b0a25042926403220d90ddf3fadf61a7e Author: Jay Shaughnessy jshaughn@redhat.com Date: Wed Jul 7 17:00:37 2010 -0400
[BZ 611468] Add message to create wizard.
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDistroFileStep.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDistroFileStep.java index 634825d..3245b61 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDistroFileStep.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDistroFileStep.java @@ -99,6 +99,7 @@ public class BundleUploadDistroFileStep implements WizardStep { } else if ("Recipe".equals(selected)) { processRecipe(); } else { + wizard.getView().showMessage("You must choose one option for creating your Bundle!"); return false; } return false;
commit 19a824a9bc31cdec8f31229398eb82af2a387c5e Merge: 91c9d1f... 4f6a2f0... Author: Jay Shaughnessy jshaughn@redhat.com Date: Wed Jul 7 15:32:44 2010 -0400
Merge branch 'release-3.0.0' into release-3.0.0-jay
commit 4f6a2f047da289a6fb0bd96db847102b91bbb50f Merge: 825d685... d21faf4... Author: Jay Shaughnessy jshaughn@redhat.com Date: Wed Jul 7 15:32:14 2010 -0400
Merge branch 'release-3.0.0' of ssh://git.fedorahosted.org/git/rhq/rhq into release-3.0.0
commit 91c9d1fb7849b9966f60a2cdeb8bca1903e3389c Author: Jay Shaughnessy jshaughn@redhat.com Date: Wed Jul 7 15:30:30 2010 -0400
[BZ 612121, 612115, 608732, 611436, 611411, 604710, 601175] A bunch of related fixes regarding the bundle wizards. Added new message bar for wizards to report messages independent of the message center and used it to improve messaging for wizard users. Fixed issue with step# tracking. Added somore more protection in wizard navigation.
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDataStep.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDataStep.java index 2d767d3..50f1a15 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDataStep.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDataStep.java @@ -106,7 +106,7 @@ public class BundleUploadDataStep implements WizardStep {
boolean needToUpload = false; for (BundleFileUploadForm uploadForm : this.uploadForms) { - if (uploadForm.getUploadResults() == null) { + if (uploadForm.getUploadResult() == null) { uploadForm.submitForm(); needToUpload = true; } @@ -172,6 +172,12 @@ public class BundleUploadDataStep implements WizardStep { allFilesStatus.put(uploadForm.getName(), Boolean.TRUE); } else { allFilesStatus.put(uploadForm.getName(), Boolean.FALSE); + String errorMessage = uploadForm.getUploadError(); + if (null != errorMessage) { + wizard.getView().showMessage(errorMessage); + } else { + errorMessage = ""; + } CoreGUI.getMessageCenter().notify( new Message("Failed to upload bundle file", results, Message.Severity.Error)); } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDistroFileStep.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDistroFileStep.java index 496268b..634825d 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDistroFileStep.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDistroFileStep.java @@ -73,6 +73,7 @@ public class BundleUploadDistroFileStep implements WizardStep { radioGroup = new RadioGroupWithComponentsItem("bundleDistroRadioGroup", "Bundle Distribution", radioItems, mainCanvasForm); radioGroup.setShowTitle(false); + mainCanvasForm.setItems(radioGroup); }
@@ -86,6 +87,8 @@ public class BundleUploadDistroFileStep implements WizardStep { }
public boolean nextPage() { + wizard.getView().hideMessage(); + if (wizard.getBundleVersion() == null) { String selected = radioGroup.getSelected();
@@ -199,6 +202,7 @@ public class BundleUploadDistroFileStep implements WizardStep { }
public void onFailure(Throwable caught) { + wizard.getView().showMessage(caught.getMessage()); CoreGUI.getErrorHandler().handleError("Failed to create bundle", caught); wizard.setBundleVersion(null); setButtonsDisableMode(false); @@ -207,7 +211,7 @@ public class BundleUploadDistroFileStep implements WizardStep { }
private void processUpload() { - if (Boolean.TRUE.equals(uploadDistroForm.getUploadResults())) { + if (Boolean.TRUE.equals(uploadDistroForm.getUploadResult())) { int bvId = uploadDistroForm.getBundleVersionId(); BundleVersionCriteria criteria = new BundleVersionCriteria(); criteria.addFilterId(bvId); @@ -225,13 +229,21 @@ public class BundleUploadDistroFileStep implements WizardStep { }
public void onFailure(Throwable caught) { + wizard.getView().showMessage(caught.getMessage()); CoreGUI.getErrorHandler().handleError("Failed to create bundle", caught); wizard.setBundleVersion(null); setButtonsDisableMode(false); } }); } else { - CoreGUI.getMessageCenter().notify(new Message("Failed to upload bundle distribution file", Severity.Error)); + String errorMessage = uploadDistroForm.getUploadError(); + if (null != errorMessage) { + wizard.getView().showMessage(errorMessage); + } else { + errorMessage = ""; + } + CoreGUI.getMessageCenter().notify( + new Message("Failed to upload bundle distribution file. " + errorMessage, Severity.Error)); wizard.setBundleVersion(null); setButtonsDisableMode(false); } @@ -251,6 +263,7 @@ public class BundleUploadDistroFileStep implements WizardStep { }
public void onFailure(Throwable caught) { + wizard.getView().showMessage(caught.getMessage()); CoreGUI.getErrorHandler().handleError("Failed to create bundle", caught); wizard.setBundleVersion(null); wizard.setRecipe(""); @@ -262,6 +275,5 @@ public class BundleUploadDistroFileStep implements WizardStep { private void setButtonsDisableMode(boolean disabled) { wizard.getView().getCancelButton().setDisabled(disabled); wizard.getView().getNextButton().setDisabled(disabled); - wizard.getView().getPreviousButton().setDisabled(disabled); } } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDestinationStep.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDestinationStep.java index 5643bd3..0fab3aa 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDestinationStep.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDestinationStep.java @@ -174,9 +174,9 @@ public class GetDestinationStep implements WizardStep { }
public void onFailure(Throwable caught) { - CoreGUI.getErrorHandler().handleError( - "Failed to create destination. (Note, for an existing destination deploy from the Destination view) : " - + caught.getMessage(), caught); + String message = "Failed to create destination, it may already exist. (Note, for an existing destination deploy from the Destination view)"; + wizard.getView().showMessage(message); + CoreGUI.getErrorHandler().handleError(message + ": " + caught.getMessage(), caught); createInProgress = false; wizard.getView().decrementStep(); } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/revert/ConfirmationStep.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/revert/ConfirmationStep.java index 47be5ce..d531de7 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/revert/ConfirmationStep.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/revert/ConfirmationStep.java @@ -33,6 +33,7 @@ import org.rhq.enterprise.gui.coregui.client.CoreGUI; import org.rhq.enterprise.gui.coregui.client.components.wizard.WizardStep; import org.rhq.enterprise.gui.coregui.client.gwt.BundleGWTServiceAsync; import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup; +import org.rhq.enterprise.gui.coregui.client.util.message.Message;
/** * @author Jay Shaughnessy @@ -41,6 +42,7 @@ import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup; public class ConfirmationStep implements WizardStep {
private VLayout layout; + private boolean nextPage = true; private final BundleRevertWizard wizard; private final BundleGWTServiceAsync bundleServer = GWTServiceLookup.getBundleService();
@@ -65,23 +67,31 @@ public class ConfirmationStep implements WizardStep { new AsyncCallback<PageList<BundleDeployment>>() { public void onSuccess(PageList<BundleDeployment> liveDeployments) { if (1 != liveDeployments.size()) { - throw new IllegalArgumentException("No live deployment found for destination [" - + wizard.getDestination() + "]"); + nextPage = false; + String message = "No live deployment found for destination [" + wizard.getDestination() + + "]"; + wizard.getView().showMessage(message); + CoreGUI.getMessageCenter().notify(new Message(message, Message.Severity.Warning)); } wizard.setLiveDeployment(liveDeployments.get(0)); wizard.setPreviousDeployment(wizard.getLiveDeployment().getReplacedBundleDeployment()); if (null == wizard.getPreviousDeployment()) { - throw new IllegalArgumentException("Live deployment [" + wizard.getLiveDeployment() + nextPage = false; + String message = "Live deployment [" + wizard.getLiveDeployment() + "] can not be reverted. There is no prior deployment for the destination [" - + wizard.getDestination() + "]"); + + wizard.getDestination() + "]"; + wizard.getView().showMessage(message); + CoreGUI.getMessageCenter().notify(new Message(message, Message.Severity.Warning)); }
setLayout(); }
public void onFailure(Throwable caught) { - CoreGUI.getErrorHandler().handleError( - "Failed to find live deployment, can not revert: " + caught.getMessage(), caught); + nextPage = false; + String message = "Failed to find live deployment, can not revert: " + caught.getMessage(); + wizard.getView().showMessage(message); + CoreGUI.getErrorHandler().handleError(message, caught); } }); } @@ -165,6 +175,6 @@ public class ConfirmationStep implements WizardStep { }
public boolean nextPage() { - return true; + return nextPage; } } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/upload/BundleDistributionFileUploadForm.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/upload/BundleDistributionFileUploadForm.java index 9df0a6d..652259d 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/upload/BundleDistributionFileUploadForm.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/upload/BundleDistributionFileUploadForm.java @@ -40,7 +40,8 @@ public class BundleDistributionFileUploadForm extends DynamicCallbackForm { private ButtonItem uploadButton; private StaticTextItem icon;
- private Boolean uploadResults; + private Boolean uploadResult; + private String uploadError; private int bundleVersionId;
private final FormItemIcon iconLoading; @@ -87,8 +88,19 @@ public class BundleDistributionFileUploadForm extends DynamicCallbackForm { * Returns null if this upload form has not be submitted yet (see {@link #submitForm()}). * @return status of the upload request */ - public Boolean getUploadResults() { - return uploadResults; + public Boolean getUploadResult() { + return uploadResult; + } + + /** + * @return Error text if {@link #getUploadResult()} returns false, otherwise null + */ + public String getUploadError() { + return uploadError; + } + + private void setUploadError(String uploadError) { + this.uploadError = uploadError; }
@Override @@ -130,8 +142,8 @@ public class BundleDistributionFileUploadForm extends DynamicCallbackForm { icon = new StaticTextItem("icon"); icon.setStartRow(false); icon.setShowTitle(false); - if (uploadResults != null) { - if (uploadResults.booleanValue()) { + if (uploadResult != null) { + if (uploadResult.booleanValue()) { icon.setIcons(iconGreen); icon.setTooltip("Bundle distribution file has already been uploaded"); } else { @@ -146,13 +158,13 @@ public class BundleDistributionFileUploadForm extends DynamicCallbackForm {
setItems(sessionIdField, bundleUploadItem, uploadButton, icon);
- // make sure this handler is executed first + // make sure this handler is executed first in case the creator has also added a handler pushFormHandler(new DynamicFormHandler() { public void onSubmitComplete(DynamicFormSubmitCompleteEvent event) { String results = event.getResults(); bundleVersionId = parseIdFromResponse(results); if (bundleVersionId > 0) { - uploadResults = Boolean.TRUE; + uploadResult = Boolean.TRUE; icon.setIcons(iconGreen); icon.setTooltip("Uploaded bundle distribution file successfully"); CoreGUI.getMessageCenter().notify( @@ -160,9 +172,11 @@ public class BundleDistributionFileUploadForm extends DynamicCallbackForm { icon.hide(); icon.show(); } else { - uploadResults = Boolean.FALSE; + uploadResult = Boolean.FALSE; + String cause = parseCauseFromResponse(results); icon.setIcons(iconRed); - icon.setTooltip("Bundle distribution file upload failed"); + icon.setTooltip(cause); + setUploadError(cause); CoreGUI.getMessageCenter().notify( new Message("Bundle distribution file upload failed", results, Severity.Error)); icon.hide(); @@ -173,11 +187,12 @@ public class BundleDistributionFileUploadForm extends DynamicCallbackForm {
addFormSubmitFailedHandler(new FormSubmitFailedHandler() { public void onFormSubmitFailed(FormSubmitFailedEvent event) { - uploadResults = Boolean.FALSE; + uploadResult = Boolean.FALSE; + String cause = "Bundle Distribution file upload failed, check for invalid file path."; icon.setIcons(iconRed); - icon.setTooltip("File upload failed"); - CoreGUI.getMessageCenter().notify( - new Message("Bundle distribution file upload request failed", Severity.Error)); + icon.setTooltip(cause); + setUploadError(cause); + CoreGUI.getMessageCenter().notify(new Message(cause, Severity.Error)); icon.hide(); icon.show(); } @@ -204,4 +219,11 @@ public class BundleDistributionFileUploadForm extends DynamicCallbackForm { } return id; } -} + + private String parseCauseFromResponse(String results) { + int i = (null == results) ? -1 : results.indexOf("\tat "); + String cause = (-1 == i) ? results : results.substring(0, i); + return cause; + } + +} \ No newline at end of file diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/upload/BundleFileUploadForm.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/upload/BundleFileUploadForm.java index b0617f0..4a502ce 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/upload/BundleFileUploadForm.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/upload/BundleFileUploadForm.java @@ -41,7 +41,8 @@ public class BundleFileUploadForm extends DynamicCallbackForm { private ButtonItem uploadButton; private StaticTextItem icon;
- private Boolean uploadResults; + private Boolean uploadResult; + private String uploadError;
private final BundleVersion bundleVersion; private final String name; @@ -58,7 +59,7 @@ public class BundleFileUploadForm extends DynamicCallbackForm { this.bundleVersion = bundleVersion; this.name = name; this.showNameLabel = showNameLabel; - this.uploadResults = isAlreadyUploaded; // null if unknown, false if error during previous upload attempt, true if already uploaded before + this.uploadResult = isAlreadyUploaded; // null if unknown, false if error during previous upload attempt, true if already uploaded before
setEncoding(Encoding.MULTIPART); setAction(GWT.getModuleBaseURL() + "/BundleFileUploadServlet"); @@ -102,8 +103,19 @@ public class BundleFileUploadForm extends DynamicCallbackForm { * Returns null if this upload form has not be submitted yet (see {@link #submitForm()}). * @return status of the upload request */ - public Boolean getUploadResults() { - return uploadResults; + public Boolean getUploadResult() { + return uploadResult; + } + + /** + * @return Error text if {@link #getUploadResult()} returns false, otherwise null + */ + public String getUploadError() { + return uploadError; + } + + private void setUploadError(String uploadError) { + this.uploadError = uploadError; }
@Override @@ -153,8 +165,8 @@ public class BundleFileUploadForm extends DynamicCallbackForm { icon = new StaticTextItem("icon"); icon.setStartRow(false); icon.setShowTitle(false); - if (uploadResults != null) { - if (uploadResults.booleanValue()) { + if (uploadResult != null) { + if (uploadResult.booleanValue()) { icon.setIcons(iconGreen); icon.setTooltip("Bundle file has already been uploaded"); } else { @@ -169,11 +181,12 @@ public class BundleFileUploadForm extends DynamicCallbackForm {
setItems(sessionIdField, bundleVersionIdField, nameField, versionField, bundleUploadItem, uploadButton, icon);
- addFormHandler(new DynamicFormHandler() { + // push the form handler so it executes first if the form creator has also added a handler + pushFormHandler(new DynamicFormHandler() { public void onSubmitComplete(DynamicFormSubmitCompleteEvent event) { String results = event.getResults(); if (!results.contains("Failed to upload bundle file")) { - uploadResults = Boolean.TRUE; + uploadResult = Boolean.TRUE; icon.setIcons(iconGreen); icon.setTooltip("Uploaded bundle file successfully"); CoreGUI.getMessageCenter().notify( @@ -181,11 +194,14 @@ public class BundleFileUploadForm extends DynamicCallbackForm { icon.hide(); icon.show(); } else { - uploadResults = Boolean.FALSE; + uploadResult = Boolean.FALSE; + String cause = "[" + name + "] " + parseCauseFromResponse(results); icon.setIcons(iconRed); - icon.setTooltip("Bundle file upload failed"); - CoreGUI.getMessageCenter() - .notify(new Message("Bundle file upload failed", results, Severity.Error)); + icon.setTooltip(cause); + setUploadError(cause); + icon.setTooltip(cause); + CoreGUI.getMessageCenter().notify( + new Message("Bundle file [" + name + "] upload failed", results, Severity.Error)); icon.hide(); icon.show(); } @@ -194,13 +210,22 @@ public class BundleFileUploadForm extends DynamicCallbackForm {
addFormSubmitFailedHandler(new FormSubmitFailedHandler() { public void onFormSubmitFailed(FormSubmitFailedEvent event) { - uploadResults = Boolean.FALSE; + uploadResult = Boolean.FALSE; + String cause = "Bundle file [" + name + "] upload failed, check for invalid file path."; icon.setIcons(iconRed); - icon.setTooltip("Bundle file upload failed"); - CoreGUI.getMessageCenter().notify(new Message("Bundle file upload request failed", Severity.Error)); + icon.setTooltip(cause); + setUploadError(cause); + CoreGUI.getMessageCenter().notify(new Message(cause, Severity.Error)); icon.hide(); icon.show(); } }); } + + private String parseCauseFromResponse(String results) { + int i = (null == results) ? -1 : results.indexOf("\tat "); + String cause = (-1 == i) ? results : results.substring(0, i); + return cause; + } + } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/wizard/WizardView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/wizard/WizardView.java index fbce82f..93fe036 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/wizard/WizardView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/wizard/WizardView.java @@ -51,6 +51,10 @@ public class WizardView extends VLayout {
Label stepTitleLabel; HLayout contentLayout; + + HLayout messageBar; + HTMLFlow messageLabel; + ToolStrip buttonBar;
IButton cancelButton; @@ -101,6 +105,18 @@ public class WizardView extends VLayout {
addMember(contentLayout);
+ messageBar = new HLayout(); + messageBar.setHeight(20); + messageBar.setPadding(2); + messageBar.setBackgroundColor("#F0F0F0"); + messageLabel = new HTMLFlow(); + messageLabel.setWidth("*"); + messageLabel.setLeft(20); + messageBar.addMember(messageLabel); + messageBar.setVisible(false); + + addMember(messageBar); + buttonBar = new ToolStrip(); buttonBar.setPadding(5); buttonBar.setWidth100(); @@ -122,6 +138,19 @@ public class WizardView extends VLayout { + (wizard.getSubtitle() != null ? wizard.getSubtitle() : "")); }
+ public void showMessage(String message) { + if (null == message) { + hideMessage(); + } else { + this.messageLabel.setContents("<span style='color:red'>" + message + "</span>"); + this.messageBar.show(); + } + } + + public void hideMessage() { + this.messageBar.hide(); + } + private void setupButtons() { cancelButton = new IButton("Cancel"); cancelButton.setDisabled(false); @@ -157,16 +186,21 @@ public class WizardView extends VLayout { }
private void setStep(int stepIndex) { - currentStep = stepIndex; - - List<WizardStep> wizardSteps = wizard.getSteps(); + if (stepIndex < 0) { + this.previousButton.setDisabled(true); + return; + }
// determine if we are "finished" - that is, going past our last step - if (currentStep >= wizardSteps.size()) { + List<WizardStep> wizardSteps = wizard.getSteps(); + if (stepIndex >= wizardSteps.size()) { closeDialog(); return; }
+ // a valid step, continue + currentStep = stepIndex; + stepLabel.setContents("Step " + (stepIndex + 1) + " of " + wizardSteps.size());
WizardStep step = wizardSteps.get(currentStep);
commit 6c6d945b5a7e65d85d80aabdc858df8f565ce25d Author: Jay Shaughnessy jshaughn@redhat.com Date: Wed Jul 7 15:25:35 2010 -0400
[BZ 608732] Remove unnecessary stack sections from bundle view. Note, these may need to be uncommented after a merge to Master.
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/BundleTopView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/BundleTopView.java index 546a7fa..a3be0fa 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/BundleTopView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/BundleTopView.java @@ -31,7 +31,6 @@ import org.rhq.enterprise.gui.coregui.client.ViewPath; import org.rhq.enterprise.gui.coregui.client.bundle.list.BundleView; import org.rhq.enterprise.gui.coregui.client.bundle.list.BundlesListView; import org.rhq.enterprise.gui.coregui.client.bundle.tree.BundleTreeView; -import org.rhq.enterprise.gui.coregui.client.content.repository.tree.ContentRepositoryTreeView;
/** * @author Greg Hinkle @@ -65,13 +64,14 @@ public class BundleTopView extends HLayout implements BookmarkableView { bundlesSection.addItem(bundleTreeView); sectionStack.addSection(bundlesSection);
- SectionStackSection repositoriesSection = new SectionStackSection("Repositories"); - ContentRepositoryTreeView repoTree = new ContentRepositoryTreeView(); - repositoriesSection.addItem(repoTree); - sectionStack.addSection(repositoriesSection); + // Don't show these in 3.0, they are not fully baked + //SectionStackSection repositoriesSection = new SectionStackSection("Repositories"); + //ContentRepositoryTreeView repoTree = new ContentRepositoryTreeView(); + //repositoriesSection.addItem(repoTree); + //sectionStack.addSection(repositoriesSection);
- SectionStackSection providersSection = new SectionStackSection("Providers"); - sectionStack.addSection(providersSection); + //SectionStackSection providersSection = new SectionStackSection("Providers"); + //sectionStack.addSection(providersSection);
addMember(sectionStack);
@@ -79,7 +79,6 @@ public class BundleTopView extends HLayout implements BookmarkableView { contentCanvas.setWidth100(); contentCanvas.setHeight100(); addMember(contentCanvas); - }
public void setContent(Canvas newContent) { @@ -90,12 +89,10 @@ public class BundleTopView extends HLayout implements BookmarkableView { contentCanvas.markForRedraw(); }
- public void renderView(ViewPath viewPath) {
bundleTreeView.selectPath(viewPath);
- if (viewPath.isEnd()) { if (currentNextPath == null && bundlesListView != null) { // refresh
commit 2a6a0bca7da20148600d3137f15e84ab8dead75c Author: Jay Shaughnessy jshaughn@redhat.com Date: Wed Jul 7 15:23:58 2010 -0400
Turn the generic AbstractBundleWizard into AbstractWizard, impementing Wizard, and let all Wizards extend.
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/AbstractBundleWizard.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/AbstractBundleWizard.java deleted file mode 100644 index 7bacb3b..0000000 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/AbstractBundleWizard.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * RHQ Management Platform - * Copyright (C) 2005-2010 Red Hat, Inc. - * All rights reserved. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation version 2 of the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ -package org.rhq.enterprise.gui.coregui.client.bundle; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import com.smartgwt.client.widgets.IButton; - -import org.rhq.enterprise.gui.coregui.client.components.wizard.Wizard; -import org.rhq.enterprise.gui.coregui.client.components.wizard.WizardStep; -import org.rhq.enterprise.gui.coregui.client.components.wizard.WizardView; - -public abstract class AbstractBundleWizard implements Wizard { - - private ArrayList<WizardStep> steps; - private WizardView view; - private String windowTitle = ""; - private String title = ""; - private String subtitle = ""; - - public String getWindowTitle() { - return windowTitle; - } - - public void setWindowTitle(String windowTitle) { - this.windowTitle = windowTitle; - } - - public String getTitle() { - return title; - } - - public void setTitle(String title) { - this.title = title; - } - - public String getSubtitle() { - return subtitle; - } - - public void setSubtitle(String subtitle) { - this.subtitle = subtitle; - if (this.view != null) { - this.view.refreshTitleLabelContents(); - } - } - - public List<WizardStep> getSteps() { - return steps; - } - - public void setSteps(ArrayList<WizardStep> steps) { - this.steps = steps; - } - - public List<IButton> getCustomButtons(int step) { - return Collections.emptyList(); - } - - public void startBundleWizard() { - view = new WizardView(this); - view.displayDialog(); - } - - public WizardView getView() { - return view; - } - -} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/AbstractBundleCreateWizard.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/AbstractBundleCreateWizard.java index eac3c65..b0ddff7 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/AbstractBundleCreateWizard.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/AbstractBundleCreateWizard.java @@ -24,13 +24,13 @@ import com.google.gwt.user.client.rpc.AsyncCallback;
import org.rhq.core.domain.bundle.BundleVersion; import org.rhq.enterprise.gui.coregui.client.CoreGUI; -import org.rhq.enterprise.gui.coregui.client.bundle.AbstractBundleWizard; +import org.rhq.enterprise.gui.coregui.client.components.wizard.AbstractWizard; import org.rhq.enterprise.gui.coregui.client.gwt.BundleGWTServiceAsync; import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup; import org.rhq.enterprise.gui.coregui.client.util.message.Message; import org.rhq.enterprise.gui.coregui.client.util.message.Message.Severity;
-public abstract class AbstractBundleCreateWizard extends AbstractBundleWizard { +public abstract class AbstractBundleCreateWizard extends AbstractWizard {
// the things we build up in the wizard private String recipe; diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/AbstractBundleDeployWizard.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/AbstractBundleDeployWizard.java index 88b67be..a0728af 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/AbstractBundleDeployWizard.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/AbstractBundleDeployWizard.java @@ -22,13 +22,13 @@ import org.rhq.core.domain.bundle.BundleDeployment; import org.rhq.core.domain.bundle.BundleDestination; import org.rhq.core.domain.bundle.BundleVersion; import org.rhq.core.domain.configuration.Configuration; -import org.rhq.enterprise.gui.coregui.client.bundle.AbstractBundleWizard; +import org.rhq.enterprise.gui.coregui.client.components.wizard.AbstractWizard;
/** * @author Jay Shaughnessy * */ -public abstract class AbstractBundleDeployWizard extends AbstractBundleWizard { +public abstract class AbstractBundleDeployWizard extends AbstractWizard {
// the things we build up in the wizard private Integer bundleId; diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/revert/AbstractBundleRevertWizard.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/revert/AbstractBundleRevertWizard.java index 9d01d2c..cf69400 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/revert/AbstractBundleRevertWizard.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/revert/AbstractBundleRevertWizard.java @@ -20,13 +20,13 @@ package org.rhq.enterprise.gui.coregui.client.bundle.revert;
import org.rhq.core.domain.bundle.BundleDeployment; import org.rhq.core.domain.bundle.BundleDestination; -import org.rhq.enterprise.gui.coregui.client.bundle.AbstractBundleWizard; +import org.rhq.enterprise.gui.coregui.client.components.wizard.AbstractWizard;
/** * @author Jay Shaughnessy * */ -public abstract class AbstractBundleRevertWizard extends AbstractBundleWizard { +public abstract class AbstractBundleRevertWizard extends AbstractWizard {
// the things we build up in the wizard private BundleDestination destination; diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/wizard/AbstractWizard.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/wizard/AbstractWizard.java new file mode 100644 index 0000000..9c8e513 --- /dev/null +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/wizard/AbstractWizard.java @@ -0,0 +1,82 @@ +/* + * RHQ Management Platform + * Copyright (C) 2005-2010 Red Hat, Inc. + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ +package org.rhq.enterprise.gui.coregui.client.components.wizard; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +import com.smartgwt.client.widgets.IButton; + +public abstract class AbstractWizard implements Wizard { + + private ArrayList<WizardStep> steps; + private WizardView view; + private String windowTitle = ""; + private String title = ""; + private String subtitle = ""; + + public String getWindowTitle() { + return windowTitle; + } + + public void setWindowTitle(String windowTitle) { + this.windowTitle = windowTitle; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getSubtitle() { + return subtitle; + } + + public void setSubtitle(String subtitle) { + this.subtitle = subtitle; + if (view != null) { + view.refreshTitleLabelContents(); + } + } + + public List<WizardStep> getSteps() { + return steps; + } + + public void setSteps(ArrayList<WizardStep> steps) { + this.steps = steps; + } + + public List<IButton> getCustomButtons(int step) { + return Collections.emptyList(); + } + + public void startBundleWizard() { + view = new WizardView(this); + view.displayDialog(); + } + + public WizardView getView() { + return view; + } +} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/wizard/GroupCreateWizard.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/wizard/GroupCreateWizard.java index 27ad608..4c8b074 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/wizard/GroupCreateWizard.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/wizard/GroupCreateWizard.java @@ -30,28 +30,26 @@ import com.smartgwt.client.widgets.IButton;
import org.rhq.core.domain.resource.group.ResourceGroup; import org.rhq.enterprise.gui.coregui.client.CoreGUI; -import org.rhq.enterprise.gui.coregui.client.components.wizard.Wizard; +import org.rhq.enterprise.gui.coregui.client.components.wizard.AbstractWizard; import org.rhq.enterprise.gui.coregui.client.components.wizard.WizardStep; import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup; -import org.rhq.enterprise.gui.coregui.client.gwt.ResourceGWTServiceAsync; import org.rhq.enterprise.gui.coregui.client.gwt.ResourceGroupGWTServiceAsync; import org.rhq.enterprise.gui.coregui.client.util.message.Message;
/** * @author Greg Hinkle */ -public class GroupCreateWizard implements Wizard { - - private ArrayList<WizardStep> steps; +public class GroupCreateWizard extends AbstractWizard {
private GroupCreateStep createStep; private GroupMembersStep memberStep;
public GroupCreateWizard() { - steps = new ArrayList<WizardStep>(); + ArrayList<WizardStep> steps = new ArrayList<WizardStep>();
steps.add(createStep = new GroupCreateStep()); steps.add(memberStep = new GroupMembersStep(this)); + setSteps(steps); }
public String getWindowTitle() { @@ -63,15 +61,11 @@ public class GroupCreateWizard implements Wizard { }
public String getSubtitle() { - return null; // TODO: Implement this method. - } - - public List<WizardStep> getSteps() { - return steps; + return null; // TODO: Implement this method. }
public List<IButton> getCustomButtons(int step) { - return null; // TODO: Implement this method. + return null; // TODO: Implement this method. }
public void cancel() { @@ -83,17 +77,17 @@ public class GroupCreateWizard implements Wizard { ResourceGroupGWTServiceAsync groupService = GWTServiceLookup.getResourceGroupService();
groupService.createResourceGroup(createStep.getGroup(), memberStep.getSelectedResourceIds(), - new AsyncCallback<ResourceGroup>() { - public void onFailure(Throwable caught) { - CoreGUI.getErrorHandler().handleError("Failed to create resource group",caught); - } - - public void onSuccess(ResourceGroup result) { - CoreGUI.getMessageCenter().notify(new Message("Saved new group " + result.getName(), Message.Severity.Info)); - // TODO: Implement this method. - } - }); - + new AsyncCallback<ResourceGroup>() { + public void onFailure(Throwable caught) { + CoreGUI.getErrorHandler().handleError("Failed to create resource group", caught); + } + + public void onSuccess(ResourceGroup result) { + CoreGUI.getMessageCenter().notify( + new Message("Saved new group " + result.getName(), Message.Severity.Info)); + // TODO: Implement this method. + } + });
return true; } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/create/OperationCreateWizard.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/create/OperationCreateWizard.java index 3fd8517..5d0be9d 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/create/OperationCreateWizard.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/create/OperationCreateWizard.java @@ -32,7 +32,7 @@ import org.rhq.core.domain.configuration.Configuration; import org.rhq.core.domain.operation.OperationDefinition; import org.rhq.core.domain.resource.Resource; import org.rhq.enterprise.gui.coregui.client.CoreGUI; -import org.rhq.enterprise.gui.coregui.client.components.wizard.Wizard; +import org.rhq.enterprise.gui.coregui.client.components.wizard.AbstractWizard; import org.rhq.enterprise.gui.coregui.client.components.wizard.WizardStep; import org.rhq.enterprise.gui.coregui.client.components.wizard.WizardView; import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup; @@ -42,7 +42,7 @@ import org.rhq.enterprise.gui.coregui.client.util.message.Message; /** * @author Greg Hinkle */ -public class OperationCreateWizard implements Wizard { +public class OperationCreateWizard extends AbstractWizard {
private Resource resource; private OperationDefinition operationDefinition; @@ -50,7 +50,6 @@ public class OperationCreateWizard implements Wizard { private OperationParametersStep parametersStep; private OperationSchedulingStep schedulingStep;
- private ArrayList<WizardStep> steps = new ArrayList<WizardStep>(); private WizardView view;
private IButton executeNowButton; @@ -66,8 +65,10 @@ public class OperationCreateWizard implements Wizard { parametersStep = new OperationParametersStep(operationDefinition); schedulingStep = new OperationSchedulingStep();
+ ArrayList<WizardStep> steps = new ArrayList<WizardStep>(); steps.add(parametersStep); steps.add(schedulingStep); + setSteps(steps);
executeNowButton = new IButton("Execute Immediately"); executeNowButton.setAutoFit(true); @@ -100,10 +101,6 @@ public class OperationCreateWizard implements Wizard { return operationDefinition.getDescription(); }
- public List<WizardStep> getSteps() { - return steps; - } - public List<IButton> getCustomButtons(int step) { switch (step) { case 0: diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/factory/ResourceFactoryCreateWizard.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/factory/ResourceFactoryCreateWizard.java index b84a44e..bad2058 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/factory/ResourceFactoryCreateWizard.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/factory/ResourceFactoryCreateWizard.java @@ -33,7 +33,7 @@ import org.rhq.core.domain.configuration.definition.ConfigurationDefinition; import org.rhq.core.domain.resource.Resource; import org.rhq.core.domain.resource.ResourceType; import org.rhq.enterprise.gui.coregui.client.CoreGUI; -import org.rhq.enterprise.gui.coregui.client.components.wizard.Wizard; +import org.rhq.enterprise.gui.coregui.client.components.wizard.AbstractWizard; import org.rhq.enterprise.gui.coregui.client.components.wizard.WizardStep; import org.rhq.enterprise.gui.coregui.client.components.wizard.WizardView; import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup; @@ -43,7 +43,7 @@ import org.rhq.enterprise.gui.coregui.client.util.message.Message; /** * @author Greg Hinkle */ -public class ResourceFactoryCreateWizard implements Wizard { +public class ResourceFactoryCreateWizard extends AbstractWizard {
private ConfigurationDefinition configurationDefinition; private Resource parentResource; @@ -54,10 +54,8 @@ public class ResourceFactoryCreateWizard implements Wizard { private ConfigurationTemplateStep configurationTemplateStep; private ConfigurationStep configurationStep;
- private ArrayList<WizardStep> steps; - - - public ResourceFactoryCreateWizard(Resource parentResource, ResourceType createType, ConfigurationDefinition configurationDefinition) { + public ResourceFactoryCreateWizard(Resource parentResource, ResourceType createType, + ConfigurationDefinition configurationDefinition) { this.parentResource = parentResource; this.createType = createType; this.configurationDefinition = configurationDefinition; @@ -66,14 +64,15 @@ public class ResourceFactoryCreateWizard implements Wizard { assert createType != null; assert configurationDefinition != null;
- - steps = new ArrayList<WizardStep>(); + ArrayList<WizardStep> steps = new ArrayList<WizardStep>();
configurationTemplateStep = new ConfigurationTemplateStep(this); steps.add(configurationTemplateStep);
configurationStep = new ConfigurationStep(this); steps.add(configurationStep); + + setSteps(steps); }
public String getWindowTitle() { @@ -88,25 +87,20 @@ public class ResourceFactoryCreateWizard implements Wizard { return null; }
- public List<WizardStep> getSteps() { - return steps; - } - public List<IButton> getCustomButtons(int step) { switch (step) { - case 1: - IButton createButton = new IButton("Create"); - createButton.addClickHandler(new ClickHandler() { - public void onClick(ClickEvent clickEvent) { - execute(); - } - }); - return Collections.singletonList(createButton); + case 1: + IButton createButton = new IButton("Create"); + createButton.addClickHandler(new ClickHandler() { + public void onClick(ClickEvent clickEvent) { + execute(); + } + }); + return Collections.singletonList(createButton); } return null; }
- private void execute() {
int parentReourceId = parentResource.getId(); @@ -114,26 +108,22 @@ public class ResourceFactoryCreateWizard implements Wizard { String newResourceName = configurationTemplateStep.getResourceName(); Configuration newConfiguration = configurationStep.getConfiguration();
- GWTServiceLookup.getResourceService().createResource( - parentReourceId, - createTypeId, - newResourceName, - newConfiguration, - new AsyncCallback<Void>() { - public void onFailure(Throwable caught) { - CoreGUI.getErrorHandler().handleError("Failed to create new resource", caught); - view.closeDialog(); - } - - public void onSuccess(Void result) { - CoreGUI.getMessageCenter().notify(new Message("Submitted request to create new resource [" + - configurationTemplateStep.getResourceName() + "]", Message.Severity.Info)); - view.closeDialog(); - } - }); + GWTServiceLookup.getResourceService().createResource(parentReourceId, createTypeId, newResourceName, + newConfiguration, new AsyncCallback<Void>() { + public void onFailure(Throwable caught) { + CoreGUI.getErrorHandler().handleError("Failed to create new resource", caught); + view.closeDialog(); + } + + public void onSuccess(Void result) { + CoreGUI.getMessageCenter().notify( + new Message("Submitted request to create new resource [" + + configurationTemplateStep.getResourceName() + "]", Message.Severity.Info)); + view.closeDialog(); + } + }); }
- public void display() { view = new WizardView(this); view.displayDialog(); @@ -141,13 +131,14 @@ public class ResourceFactoryCreateWizard implements Wizard {
public static void showCreateWizard(final Resource parentResource, ResourceType childType) { ResourceTypeRepository.Cache.getInstance().getResourceTypes(childType.getId(), - EnumSet.of(ResourceTypeRepository.MetadataType.resourceConfigurationDefinition), - new ResourceTypeRepository.TypeLoadedCallback() { - public void onTypesLoaded(ResourceType type) { - ResourceFactoryCreateWizard wizard = new ResourceFactoryCreateWizard(parentResource, type, type.getResourceConfigurationDefinition()); - wizard.display(); - } - }); + EnumSet.of(ResourceTypeRepository.MetadataType.resourceConfigurationDefinition), + new ResourceTypeRepository.TypeLoadedCallback() { + public void onTypesLoaded(ResourceType type) { + ResourceFactoryCreateWizard wizard = new ResourceFactoryCreateWizard(parentResource, type, type + .getResourceConfigurationDefinition()); + wizard.display(); + } + }); }
public ConfigurationDefinition getConfigurationDefinition() { @@ -165,7 +156,7 @@ public class ResourceFactoryCreateWizard implements Wizard { public ResourceType getCreateType() { return createType; } - + public void cancel() { // TODO: revert back to original state }
commit d21faf4fa9f16b2d42647be24dae28366d0eb309 Author: Ian Springer ian.springer@redhat.com Date: Wed Jul 7 13:55:45 2010 -0400
Jeremy Perry: here are some replacement icons for servers and services that should give them the appropriate visual weight in the tree.
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/images/icons/Server_down_16.png b/modules/enterprise/gui/portal-war/src/main/webapp/images/icons/Server_down_16.png index 78f04e5..df7487f 100644 Binary files a/modules/enterprise/gui/portal-war/src/main/webapp/images/icons/Server_down_16.png and b/modules/enterprise/gui/portal-war/src/main/webapp/images/icons/Server_down_16.png differ diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/images/icons/Server_unknown_16.png b/modules/enterprise/gui/portal-war/src/main/webapp/images/icons/Server_unknown_16.png index 202dfe1..db4f195 100644 Binary files a/modules/enterprise/gui/portal-war/src/main/webapp/images/icons/Server_unknown_16.png and b/modules/enterprise/gui/portal-war/src/main/webapp/images/icons/Server_unknown_16.png differ diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/images/icons/Server_up_16.png b/modules/enterprise/gui/portal-war/src/main/webapp/images/icons/Server_up_16.png index 6a5286f..73b5f6b 100644 Binary files a/modules/enterprise/gui/portal-war/src/main/webapp/images/icons/Server_up_16.png and b/modules/enterprise/gui/portal-war/src/main/webapp/images/icons/Server_up_16.png differ diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/images/icons/Service_down_16.png b/modules/enterprise/gui/portal-war/src/main/webapp/images/icons/Service_down_16.png index 9240927..a31229b 100644 Binary files a/modules/enterprise/gui/portal-war/src/main/webapp/images/icons/Service_down_16.png and b/modules/enterprise/gui/portal-war/src/main/webapp/images/icons/Service_down_16.png differ diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/images/icons/Service_down_24.png b/modules/enterprise/gui/portal-war/src/main/webapp/images/icons/Service_down_24.png index bdc8532..fc8583f 100644 Binary files a/modules/enterprise/gui/portal-war/src/main/webapp/images/icons/Service_down_24.png and b/modules/enterprise/gui/portal-war/src/main/webapp/images/icons/Service_down_24.png differ diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/images/icons/Service_unknown_16.png b/modules/enterprise/gui/portal-war/src/main/webapp/images/icons/Service_unknown_16.png index 771ccff..3b860dc 100644 Binary files a/modules/enterprise/gui/portal-war/src/main/webapp/images/icons/Service_unknown_16.png and b/modules/enterprise/gui/portal-war/src/main/webapp/images/icons/Service_unknown_16.png differ diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/images/icons/Service_unknown_24.png b/modules/enterprise/gui/portal-war/src/main/webapp/images/icons/Service_unknown_24.png index 5356ae7..7ee9347 100644 Binary files a/modules/enterprise/gui/portal-war/src/main/webapp/images/icons/Service_unknown_24.png and b/modules/enterprise/gui/portal-war/src/main/webapp/images/icons/Service_unknown_24.png differ diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/images/icons/Service_up_16.png b/modules/enterprise/gui/portal-war/src/main/webapp/images/icons/Service_up_16.png index 0ef05e9..a925aaf 100644 Binary files a/modules/enterprise/gui/portal-war/src/main/webapp/images/icons/Service_up_16.png and b/modules/enterprise/gui/portal-war/src/main/webapp/images/icons/Service_up_16.png differ diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/images/icons/Service_up_24.png b/modules/enterprise/gui/portal-war/src/main/webapp/images/icons/Service_up_24.png index 6babc43..6c37504 100644 Binary files a/modules/enterprise/gui/portal-war/src/main/webapp/images/icons/Service_up_24.png and b/modules/enterprise/gui/portal-war/src/main/webapp/images/icons/Service_up_24.png differ
commit 43130d136b9d8b4fc94d65dc6db5ab9a2912149e Author: John Sanda jsanda@redhat.com Date: Wed Jul 7 13:33:34 2010 -0400
[BZ 598951] Increasing log level to WARN when java_home cannot be determined
diff --git a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ApplicationServerDiscoveryComponent.java b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ApplicationServerDiscoveryComponent.java index d85680b..8ef756d 100644 --- a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ApplicationServerDiscoveryComponent.java +++ b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ApplicationServerDiscoveryComponent.java @@ -257,7 +257,7 @@ public class ApplicationServerDiscoveryComponent implements ResourceDiscoveryCom
String javaHome = processInfo.getEnvironmentVariable(JAVA_HOME_ENV_VAR); if (javaHome == null && log.isDebugEnabled()) { - log.debug("Unable to determine the JAVA_HOME environment variable for the JBoss AS process - " + log.warn("Unable to determine the JAVA_HOME environment variable for the JBoss AS process - " + " the Agent is probably running as a user that does not have access to the AS process's " + " environment."); }
commit 26adb1fce95b0b5248053f03432d71cb0aeb73da Author: Heiko W. Rupp hwr@redhat.com Date: Wed Jul 7 15:40:03 2010 +0200
BZ 612127 - if not augeas found, directly return.
diff --git a/modules/plugins/samba/src/main/java/org/rhq/plugins/samba/SambaShareDiscoveryComponent.java b/modules/plugins/samba/src/main/java/org/rhq/plugins/samba/SambaShareDiscoveryComponent.java index 5fc3b4f..67da318 100644 --- a/modules/plugins/samba/src/main/java/org/rhq/plugins/samba/SambaShareDiscoveryComponent.java +++ b/modules/plugins/samba/src/main/java/org/rhq/plugins/samba/SambaShareDiscoveryComponent.java @@ -42,6 +42,9 @@ public class SambaShareDiscoveryComponent implements ResourceDiscoveryComponent< SambaServerComponent serverComponent = discoveryContext.getParentResourceComponent();
Augeas augeas = serverComponent.getAugeas(); + if (augeas==null) { + return details; // No augeas no results + } augeas.load();
List<String> matches = augeas.match("/files/etc/samba/smb.conf/target[. != 'global']"); @@ -60,7 +63,7 @@ public class SambaShareDiscoveryComponent implements ResourceDiscoveryComponent< ); details.add(detail); } - + return details; } }
commit e4d6c11a314727a504e1877d5b3aad3b718880b0 Author: Heiko W. Rupp hwr@redhat.com Date: Wed Jul 7 15:39:22 2010 +0200
(Re-)enable plugins that were commented out for jdk5
diff --git a/modules/plugins/hadoop/pom.xml b/modules/plugins/hadoop/pom.xml index f5bfd9a..c75e471 100644 --- a/modules/plugins/hadoop/pom.xml +++ b/modules/plugins/hadoop/pom.xml @@ -9,11 +9,11 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version><!-- TODO adjust RHQ version --> + <version>4.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> - <artifactId>Hadoop-plugin</artifactId> + <artifactId>hadoop-plugin</artifactId> <packaging>jar</packaging>
<name>RHQ Hadoop Plugin</name> @@ -21,7 +21,6 @@
<properties> <scm.module.path>TODO</scm.module.path> - <rhq.version>3.0.0-SNAPSHOT</rhq.version> <!-- TODO adjust, see above too --> </properties>
<build> @@ -124,29 +123,6 @@ </profiles>
- <repositories> - <repository> - <snapshots> - <enabled>false</enabled> - </snapshots> - <id>jboss</id> - <name>JBoss Repository</name> - <url>http://repository.jboss.org/maven2/</url> - </repository> - <!-- TODO add your own maven repositories here (if needed) --> - </repositories> - - <pluginRepositories> - <pluginRepository> - <snapshots> - <enabled>false</enabled> - </snapshots> - <id>jboss</id> - <name>JBoss Plugin Repository</name> - <url>http://repository.jboss.org/maven2/</url> - </pluginRepository> - </pluginRepositories> -
<dependencies> <dependency> @@ -157,25 +133,25 @@ <dependency> <groupId>org.rhq</groupId> <artifactId>rhq-core-domain</artifactId> - <version>${rhq.version}</version> + <version>${project.version}</version> <scope>provided</scope> </dependency> <dependency> <groupId>org.rhq</groupId> <artifactId>rhq-core-plugin-api</artifactId> - <version>${rhq.version}</version> + <version>${project.version}</version> <scope>provided</scope> </dependency> <dependency> <groupId>org.rhq</groupId> <artifactId>rhq-core-native-system</artifactId> - <version>${rhq.version}</version> + <version>${project.version}</version> <scope>provided</scope> </dependency> <dependency> <groupId>org.rhq</groupId> <artifactId>rhq-jmx-plugin</artifactId> - <version>${rhq.version}</version> + <version>${project.version}</version> <scope>provided</scope> </dependency>
diff --git a/modules/plugins/pom.xml b/modules/plugins/pom.xml index 4859ad7..4d439cf 100644 --- a/modules/plugins/pom.xml +++ b/modules/plugins/pom.xml @@ -153,30 +153,6 @@ </modules> </profile>
-<!-- - <profile> - <id>jdk6-only-plugins</id> - <activation> - <jdk>[1.6,)</jdk> - </activation> - <modules> - <module>script2</module> - </modules> - </profile> - - <profile> - <id>jdk6-linux-plugins</id> - <activation> - <jdk>[1.6,)</jdk> - </activation> - <modules> - <module>virt</module> - <module>kickstart</module> - <module>byteman</module> - </modules> - - </profile> --->
<profile> <id>misc-plugins</id> @@ -187,17 +163,24 @@ </activation>
<modules> + <module>byteman</module> + <module>iis</module> <module>database</module> <module>postgres</module> + <module>hadoop</module> <module>hudson</module> <!-- error in code generation (see RHQ-1225) <module>jira</module> --> <module>mysql</module> <!-- non-public dependency <module>onewire</module> --> <module>oracle</module> <module>perftest</module> + <module>script2</module> <module>snmptrapd</module> <module>twitter</module> + <module>virt</module> + <module>kickstart</module> + </modules> </profile>
commit f93270225480f305648868fbb006d12a2a7e32ae Author: Joseph Marques joseph@redhat.com Date: Wed Jul 7 00:05:14 2010 -0400
BZ-599515: by default, do not show auto-backing-cluster results in group browser
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/ResourceGroupCriteria.java b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/ResourceGroupCriteria.java index eee833e..67a66a9 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/ResourceGroupCriteria.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/ResourceGroupCriteria.java @@ -55,6 +55,7 @@ public class ResourceGroupCriteria extends TaggedCriteria { private Integer filterExplicitResourceTypeId; // requires overrides private String filterExplicitResourceTypeName; // requires overrides private Integer filterGroupDefinitionId; // requires overrides + private Boolean filterVisible = true; /* only show visible groups by default */
private boolean fetchExplicitResources; private boolean fetchImplicitResources; @@ -109,6 +110,7 @@ public class ResourceGroupCriteria extends TaggedCriteria { filterOverrides.put("groupDefinitionId", "groupDefinition.id = ?");
sortOverrides.put("resourceTypeName", "resourceType.name"); + }
@Override @@ -190,6 +192,10 @@ public class ResourceGroupCriteria extends TaggedCriteria { this.filterGroupDefinitionId = filterGroupDefinitionId; }
+ public void addFilterVisible(Boolean filterVisible) { + this.filterVisible = filterVisible; + } + public void fetchExplicitResources(boolean fetchExplicitResources) { this.fetchExplicitResources = fetchExplicitResources; }
commit 308cd90c3151705727d172864a6262073043c151 Author: John Sanda jsanda@redhat.com Date: Tue Jul 6 16:38:36 2010 -0400
[BZ 601153] Modifying configu update logic to avoid TransientObjectException
During the resource config update code, the parent reference of a Property was getting set to a new (i.e., transient) Configuration object. Because of the delete_orphan cascade style on the Property map, this was resulting in a TransientObjectException.
Also updating exception handling logic in ApacheServerComponent.updateResourceConfiguration to capture the augeas error message if present in the config update report.
diff --git a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheServerComponent.java b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheServerComponent.java index 0e98116..c1f6323 100644 --- a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheServerComponent.java +++ b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheServerComponent.java @@ -319,6 +319,7 @@ public class ApacheServerComponent implements AugeasRHQComponent<PlatformCompone report.setStatus(ConfigurationUpdateStatus.FAILURE); return; } + Configuration originalConfig = report.getConfiguration().deepCopy(true); AugeasTree tree = null; try { tree = getAugeasTree(); @@ -334,11 +335,20 @@ public class ApacheServerComponent implements AugeasRHQComponent<PlatformCompone
finishConfigurationUpdate(report); } catch (Exception e) { - if (tree != null) + if (tree != null) { log.error("Augeas failed to save configuration " + tree.summarizeAugeasError()); + e = new AugeasException("Failed to save configuration: " + tree.summarizeAugeasError() + " ", e); + } else log.error("Augeas failed to save configuration", e); report.setStatus(ConfigurationUpdateStatus.FAILURE); + report.setErrorMessageFromThrowable(e); + if (!originalConfig.equals(report.getConfiguration())) { + log.error("Configuration has changed"); + } + else { + log.error("Configuratio has not changed"); + } } }
diff --git a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/mapping/ApacheAugeasMapping.java b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/mapping/ApacheAugeasMapping.java index dc335c5..bd9b3c3 100644 --- a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/mapping/ApacheAugeasMapping.java +++ b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/mapping/ApacheAugeasMapping.java @@ -79,8 +79,14 @@ public class ApacheAugeasMapping implements RhqAugeasMapping { DirectiveMapping mapping = ApacheDirectiveRegExpression.getMappingType(propDef.getName()); ConfigurationDefinition def = new ConfigurationDefinition("temp",""); def.put(propDef); - Configuration configuration = new Configuration(); - configuration.put(config.get(propDef.getName())); + // Removing call to create new configuration as this was causing the TransientObjectException discussed + // in https://bugzilla.redhat.com/show_bug.cgi?id=601153. It is not clear to why this configuration object + // is created. Since I am not familiar with the augeas code, I need to consult with Filip on this change. + // + // jsanda + +// Configuration configuration = new Configuration(); +// configuration.put(config.get(propDef.getName())); mapping.mapToAugeas(tree, node, config, def); } }
commit 825d68560c8fbc81def6bc40a6e4e404f847103c Merge: 256cf8b... 536749f... Author: Jay Shaughnessy jshaughn@redhat.com Date: Tue Jul 6 13:16:53 2010 -0400
Merge branch 'release-3.0.0' of ssh://git.fedorahosted.org/git/rhq/rhq into release-3.0.0
commit 536749fa7c8ef554b5f0eef885d92fd41bb48a7b Author: Ian Springer ian.springer@redhat.com Date: Tue Jul 6 13:01:34 2010 -0400
fix malformed XML
diff --git a/release.sh b/release.sh index 4c416bb..9cb9e06 100644 --- a/release.sh +++ b/release.sh @@ -298,16 +298,17 @@ cat <<EOF >"${MAVEN_SETTINGS_FILE}" </properties> </profile>
- <!-- This is used by the deploy plugin to publish release artifacts to the jboss.org Nexus repo. --> - <servers> - <server> - <id>jboss-releases-repository</id> - <username>$JBOSS_ORG_USERNAME</username> - <password>$JBOSS_ORG_PASSWORD</password> - </server> - </servers> - </profiles> + + <!-- This is used by the deploy plugin to publish release artifacts to the jboss.org Nexus repo. --> + <servers> + <server> + <id>jboss-releases-repository</id> + <username>$JBOSS_ORG_USERNAME</username> + <password>$JBOSS_ORG_PASSWORD</password> + </server> + </servers> + </settings> EOF
commit 256cf8b832b594448500ee436a9056874c1a2b4e Merge: bbf184a... d6c8240... Author: Jay Shaughnessy jshaughn@redhat.com Date: Tue Jul 6 11:32:30 2010 -0400
Merge branch 'release-3.0.0' of ssh://git.fedorahosted.org/git/rhq/rhq into release-3.0.0
commit d6c82407c5f3571145febcfc1e6cebd669a289bb Author: Heiko W. Rupp hwr@redhat.com Date: Tue Jul 6 17:08:11 2010 +0200
Fix typos
diff --git a/modules/plugins/perftest/src/main/resources/META-INF/rhq-plugin.xml b/modules/plugins/perftest/src/main/resources/META-INF/rhq-plugin.xml index 74404a9..34a4e71 100644 --- a/modules/plugins/perftest/src/main/resources/META-INF/rhq-plugin.xml +++ b/modules/plugins/perftest/src/main/resources/META-INF/rhq-plugin.xml @@ -309,10 +309,10 @@ <!-- used to perftest measurement collection --> <server name="server-d" class="PerfTestComponent" discovery="PerfTestDiscoveryComponent" description="Test Server D"> <service name="service-d-metrics" class="PerfTestComponent" discovery="PerfTestDiscoveryComponent" description="Nested Service D With Metrics"> - <metric property="metric000" defaultOn="true" displayType="summary"defaultInterval="540000"/> - <metric property="metric001" defaultOn="true" displayType="summary"defaultInterval="600000"/> - <metric property="metric002" defaultOn="true" displayType="summary"defaultInterval="720000"/> - <metric property="metric003" defaultOn="true" displayType="summary"defaultInterval="600000"/> + <metric property="metric000" defaultOn="true" displayType="summary" defaultInterval="540000"/> + <metric property="metric001" defaultOn="true" displayType="summary" defaultInterval="600000"/> + <metric property="metric002" defaultOn="true" displayType="summary" defaultInterval="720000"/> + <metric property="metric003" defaultOn="true" displayType="summary" defaultInterval="600000"/> <metric property="metric004" defaultOn="true" displayType="summary" defaultInterval="600000"/> <metric displayName="CallTime" property="calltime" defaultOn="true" dataType="calltime" defaultInterval="1200000" units="milliseconds"/> <event name="PerfTestEventType" description="a test event type"/>
commit 5c7d99dc0c844bcb77dec9ab24ef086e3748cdd3 Author: Heiko W. Rupp hwr@redhat.com Date: Tue Jul 6 17:07:28 2010 +0200
Deliver less call time data, enable events. Put some variance in schedules for metrics to not have all always fire at the same time.
diff --git a/modules/plugins/perftest/src/main/resources/META-INF/rhq-plugin.xml b/modules/plugins/perftest/src/main/resources/META-INF/rhq-plugin.xml index 880c3c3..74404a9 100644 --- a/modules/plugins/perftest/src/main/resources/META-INF/rhq-plugin.xml +++ b/modules/plugins/perftest/src/main/resources/META-INF/rhq-plugin.xml @@ -309,12 +309,13 @@ <!-- used to perftest measurement collection --> <server name="server-d" class="PerfTestComponent" discovery="PerfTestDiscoveryComponent" description="Test Server D"> <service name="service-d-metrics" class="PerfTestComponent" discovery="PerfTestDiscoveryComponent" description="Nested Service D With Metrics"> - <metric property="metric000" defaultOn="true" displayType="summary"/> - <metric property="metric001" defaultOn="true" displayType="summary"/> - <metric property="metric002" defaultOn="true" displayType="summary"/> - <metric property="metric003" defaultOn="true" displayType="summary"/> - <metric property="metric004" defaultOn="true" displayType="summary"/> - <metric displayName="CallTime" property="calltime" defaultOn="true" dataType="calltime" defaultInterval="60000" units="milliseconds"/> + <metric property="metric000" defaultOn="true" displayType="summary"defaultInterval="540000"/> + <metric property="metric001" defaultOn="true" displayType="summary"defaultInterval="600000"/> + <metric property="metric002" defaultOn="true" displayType="summary"defaultInterval="720000"/> + <metric property="metric003" defaultOn="true" displayType="summary"defaultInterval="600000"/> + <metric property="metric004" defaultOn="true" displayType="summary" defaultInterval="600000"/> + <metric displayName="CallTime" property="calltime" defaultOn="true" dataType="calltime" defaultInterval="1200000" units="milliseconds"/> + <event name="PerfTestEventType" description="a test event type"/> </service> </server>
commit 5a4cc93421258718ebc10736616968ede431b4d4 Author: John Mazzitelli mazz@redhat.com Date: Tue Jul 6 09:58:59 2010 -0400
BZ 602486 - add back JDK6 API usage
diff --git a/modules/core/util/src/main/java/org/rhq/core/util/updater/Deployer.java b/modules/core/util/src/main/java/org/rhq/core/util/updater/Deployer.java index fa81429..c8111fc 100644 --- a/modules/core/util/src/main/java/org/rhq/core/util/updater/Deployer.java +++ b/modules/core/util/src/main/java/org/rhq/core/util/updater/Deployer.java @@ -245,8 +245,6 @@ public class Deployer { public DeploymentDiskUsage estimateDiskUsage() throws Exception { final DeploymentDiskUsage diskUsage = new DeploymentDiskUsage();
- /* - OH TO BE ABLE TO USE A MODERN JDK - THIS NEEDS JDK6 File partition = this.deploymentData.getDestinationDir(); long usableSpace = partition.getUsableSpace(); while (usableSpace == 0L && partition != null) { @@ -257,8 +255,6 @@ public class Deployer { }
diskUsage.setMaxDiskUsable(usableSpace); - */ - diskUsage.setMaxDiskUsable(Long.MAX_VALUE);
Set<File> zipFiles = this.deploymentData.getZipFiles(); for (File zipFile : zipFiles) {
commit d91539eebdae138120ffe907101ddf90907797fb Author: Heiko W. Rupp hwr@redhat.com Date: Tue Jul 6 15:55:05 2010 +0200
BZ610179
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerBean.java index 7fe7a5e..df9b758 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerBean.java @@ -276,9 +276,22 @@ public class ResourceManagerBean implements ResourceManagerLocal, ResourceManage toBeDeletedQuery.setParameter("resourceId", resourceId); List<Integer> toBeDeletedResourceIds = toBeDeletedQuery.getResultList();
- boolean hasErrors = uninventoryResourcesBulkDelete(overlord, toBeDeletedResourceIds); - if (hasErrors) { - throw new IllegalArgumentException("Could not remove resources from their containing groups"); + int i = 0; + log.debug("== total size : " + toBeDeletedResourceIds.size()); + + while (i<toBeDeletedResourceIds.size()) { + int j = i + 1000; + if (j > toBeDeletedResourceIds.size()) + j = toBeDeletedResourceIds.size(); + List<Integer> idsToDelete = toBeDeletedResourceIds.subList(i,j); + log.debug("== Bounds " + i + ", " + j); + + + boolean hasErrors = uninventoryResourcesBulkDelete(overlord, idsToDelete); + if (hasErrors) { + throw new IllegalArgumentException("Could not remove resources from their containing groups"); + } + i = j; }
Query markDeletedQuery = entityManager.createNamedQuery(Resource.QUERY_MARK_RESOURCES_FOR_ASYNC_DELETION); @@ -379,12 +392,12 @@ public class ResourceManagerBean implements ResourceManagerLocal, ResourceManage DeleteResourceHistory.QUERY_DELETE_BY_RESOURCES, // CreateResourceHistory.QUERY_DELETE_BY_RESOURCES, // ResourceConfigurationUpdate.QUERY_DELETE_BY_RESOURCES_0, // orphan parent list or maps (execute only on non selfRefCascade dbs) - ResourceConfigurationUpdate.QUERY_DELETE_BY_RESOURCES_1, // first, delete the raw configs for the config + ResourceConfigurationUpdate.QUERY_DELETE_BY_RESOURCES_1, // first, delete the raw configs for the config ResourceConfigurationUpdate.QUERY_DELETE_BY_RESOURCES_2, // then delete the config objects ResourceConfigurationUpdate.QUERY_DELETE_BY_RESOURCES_3, // then the history objects wrapping those configs PluginConfigurationUpdate.QUERY_DELETE_BY_RESOURCES_0, // orphan parent list or maps (execute only on non selfRefCascade dbs) PluginConfigurationUpdate.QUERY_DELETE_BY_RESOURCES_1, // first, delete the raw configs for the config - PluginConfigurationUpdate.QUERY_DELETE_BY_RESOURCES_2, // then delete the config objects + PluginConfigurationUpdate.QUERY_DELETE_BY_RESOURCES_2, // then delete the config objects PluginConfigurationUpdate.QUERY_DELETE_BY_RESOURCES_3, // then the history objects wrapping those configs AlertConditionLog.QUERY_DELETE_BY_RESOURCES, // Don't AlertNotificationLog.QUERY_DELETE_BY_RESOURCES, // alter @@ -400,18 +413,21 @@ public class ResourceManagerBean implements ResourceManagerLocal, ResourceManage boolean supportsCascade = DatabaseTypeFactory.getDefaultDatabaseType().supportsSelfReferringCascade();
boolean hasErrors = false; + boolean debugEnabled = log.isDebugEnabled(); for (String namedQueryToExecute : namedQueriesToExecute) { // execute all in new transactions, continuing on error, but recording whether errors occurred
// If the db vendor can not support our self-referring cascade delete data model then we may have // to leave some config prop rows orphaned. Only execute the selected queries if you *do* - // want to avoid self-referring cascade delete (and leave orphans) + // want to avoid self-referring cascade delete (and leave orphans) if (supportsCascade && ( // namedQueryToExecute.equals(ResourceConfigurationUpdate.QUERY_DELETE_BY_RESOURCES_0) || // namedQueryToExecute.equals(PluginConfigurationUpdate.QUERY_DELETE_BY_RESOURCES_0))) { continue; }
+ if (debugEnabled) + log.debug("uninv, running query: " + namedQueryToExecute); hasErrors |= resourceManager.bulkNamedQueryDeleteInNewTransaction(overlord, namedQueryToExecute, resourceIds); }
commit a01f5013b4e816807ae846c452ca8292791eaae9 Author: Heiko W. Rupp hwr@redhat.com Date: Tue Jul 6 15:54:51 2010 +0200
BZ 611432 - Re-enable sorting on columns
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseResources.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseResources.xhtml index ea8017a..5fd39e5 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseResources.xhtml +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseResources.xhtml @@ -132,7 +132,7 @@
rich:column <f:facet name="header"> - <onc:sortableColumnHeader sort="r.name"> + <onc:sortableColumnHeader sort="name"> <h:outputText styleClass="headerText" value="Resource" /> </onc:sortableColumnHeader> </f:facet> @@ -161,7 +161,7 @@
rich:column <f:facet name="header"> - <onc:sortableColumnHeader sort="r.description"> + <onc:sortableColumnHeader sort="description"> <h:outputText styleClass="headerText" value="Description" /> </onc:sortableColumnHeader> </f:facet>
commit bbf184a265d8d376813fa9a1db930aa78fec130e Merge: 7112476... b63d69a... Author: Jay Shaughnessy jshaughn@redhat.com Date: Tue Jul 6 09:53:44 2010 -0400
Merge branch 'release-3.0.0' of ssh://git.fedorahosted.org/git/rhq/rhq into release-3.0.0
commit 3d0764e5454f846a3c46113bff12d6b754f86770 Merge: 3a47315... 24133e9... Author: Ian Springer ian.springer@redhat.com Date: Fri Jul 2 18:27:03 2010 -0400
Merge branch 'master' of ssh://git.fedorahosted.org/git/rhq/rhq
Conflicts: modules/plugins/augeas/pom.xml
diff --cc modules/plugins/augeas/pom.xml index 3e17750,4a78b61..41d0744 --- a/modules/plugins/augeas/pom.xml +++ b/modules/plugins/augeas/pom.xml @@@ -35,7 -35,7 +35,11 @@@ <version>${project.version}</version> </dependency>
++<<<<<<< HEAD + <dependency> ++======= + <dependency> ++>>>>>>> 24133e9ab787bc2cd88bc8b8d13afadd3d4c2f3d <groupId>commons-io</groupId> <artifactId>commons-io</artifactId> <version>1.4</version>
commit b63d69a0cf50e2ea78877c0e17573680eac672cc Author: Ian Springer ian.springer@redhat.com Date: Fri Jul 2 18:01:35 2010 -0400
when in production mode, provide a way to specifiy jboss.org credentials, which can be used to publish the release Maven artifacts to the JBoss Nexus repo
diff --git a/release.sh b/release.sh index 57b39b0..4c416bb 100644 --- a/release.sh +++ b/release.sh @@ -51,6 +51,12 @@ if [ "$MODE" != "test" ] && [ "$MODE" != "production" ]; then usage "Invalid mode: $MODE (valid modes are 'test' or 'production')" fi
+if [ "$MODE" = "production" ]; then + if [ -z "$JBOSS_ORG_USERNAME" ] || [ -z "$JBOSS_ORG_PASSWORD" ]; then + usage "In production mode, jboss.org credentials must be specified via the JBOSS_ORG_USERNAME and JBOSS_ORG_PASSWORD environment variables." + fi +fi +
# Make sure JAVA_HOME points to a valid JDK 1.6+ install.
@@ -232,6 +238,7 @@ echo "MAVEN_LOCAL_REPO_PURGE_INTERVAL_HOURS=$MAVEN_LOCAL_REPO_PURGE_INTERVAL_HOU echo "MAVEN_SETTINGS_FILE=$MAVEN_SETTINGS_FILE" echo "MAVEN_ARGS=$MAVEN_ARGS" echo "MAVEN_RELEASE_PERFORM_GOAL=$MAVEN_RELEASE_PERFORM_GOAL" +echo "JBOSS_ORG_USERNAME=$JBOSS_ORG_USERNAME" echo "============================= Program Versions ================================" git --version echo @@ -290,6 +297,15 @@ cat <<EOF >"${MAVEN_SETTINGS_FILE}" <rhq.testng.excludedGroups>agent-comm,comm-client,postgres-plugin,native-system</rhq.testng.excludedGroups> </properties> </profile> + + <!-- This is used by the deploy plugin to publish release artifacts to the jboss.org Nexus repo. --> + <servers> + <server> + <id>jboss-releases-repository</id> + <username>$JBOSS_ORG_USERNAME</username> + <password>$JBOSS_ORG_PASSWORD</password> + </server> + </servers>
</profiles> </settings>
commit 432ec5890beba9755463d8a80d147102f4419fbc Author: hudson auto wnstb@yahoo.com Date: Fri Jul 2 17:40:40 2010 -0400
[maven-release-plugin] prepare for next development iteration
diff --git a/modules/common/ant-bundle/pom.xml b/modules/common/ant-bundle/pom.xml index 2671e28..eda9133 100644 --- a/modules/common/ant-bundle/pom.xml +++ b/modules/common/ant-bundle/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-common-parent</artifactId> - <version>3.0.0</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/common/filetemplate-bundle/pom.xml b/modules/common/filetemplate-bundle/pom.xml index d120b90..bc7965b 100644 --- a/modules/common/filetemplate-bundle/pom.xml +++ b/modules/common/filetemplate-bundle/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-common-parent</artifactId> - <version>3.0.0</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/common/jboss-as/pom.xml b/modules/common/jboss-as/pom.xml index 13db879..2cf950b 100644 --- a/modules/common/jboss-as/pom.xml +++ b/modules/common/jboss-as/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-common-parent</artifactId> - <version>3.0.0</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/common/pom.xml b/modules/common/pom.xml index cdabe07..ee81a94 100644 --- a/modules/common/pom.xml +++ b/modules/common/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/client-api/pom.xml b/modules/core/client-api/pom.xml index 6ef6ac7..d177f9e 100644 --- a/modules/core/client-api/pom.xml +++ b/modules/core/client-api/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/comm-api/pom.xml b/modules/core/comm-api/pom.xml index 2b8b625..a51f92b 100644 --- a/modules/core/comm-api/pom.xml +++ b/modules/core/comm-api/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/dbutils/pom.xml b/modules/core/dbutils/pom.xml index 2b434aa..d536ce6 100644 --- a/modules/core/dbutils/pom.xml +++ b/modules/core/dbutils/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/domain/pom.xml b/modules/core/domain/pom.xml index 01ef215..e0ced84 100644 --- a/modules/core/domain/pom.xml +++ b/modules/core/domain/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/gui/pom.xml b/modules/core/gui/pom.xml index b85d13d..0911918 100644 --- a/modules/core/gui/pom.xml +++ b/modules/core/gui/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/native-system/pom.xml b/modules/core/native-system/pom.xml index 8656c25..d47d4c8 100644 --- a/modules/core/native-system/pom.xml +++ b/modules/core/native-system/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/plugin-api/pom.xml b/modules/core/plugin-api/pom.xml index 750882c..e1ce7ef 100644 --- a/modules/core/plugin-api/pom.xml +++ b/modules/core/plugin-api/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/plugin-container/pom.xml b/modules/core/plugin-container/pom.xml index ed9231b..2e58102 100644 --- a/modules/core/plugin-container/pom.xml +++ b/modules/core/plugin-container/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/plugin-validator/pom.xml b/modules/core/plugin-validator/pom.xml index f8105ac..7739177 100644 --- a/modules/core/plugin-validator/pom.xml +++ b/modules/core/plugin-validator/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/plugindoc/pom.xml b/modules/core/plugindoc/pom.xml index 89a85a0..eeb7e81 100644 --- a/modules/core/plugindoc/pom.xml +++ b/modules/core/plugindoc/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/pom.xml b/modules/core/pom.xml index 832b459..7aad64c 100644 --- a/modules/core/pom.xml +++ b/modules/core/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/util/pom.xml b/modules/core/util/pom.xml index fa1d7dd..bc41dc5 100644 --- a/modules/core/util/pom.xml +++ b/modules/core/util/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/agent/pom.xml b/modules/enterprise/agent/pom.xml index bdcf31f..d9f1c1c 100644 --- a/modules/enterprise/agent/pom.xml +++ b/modules/enterprise/agent/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/agentupdate/pom.xml b/modules/enterprise/agentupdate/pom.xml index 701e10f..8942239 100644 --- a/modules/enterprise/agentupdate/pom.xml +++ b/modules/enterprise/agentupdate/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/comm/pom.xml b/modules/enterprise/comm/pom.xml index cfac808..8b9da9c 100644 --- a/modules/enterprise/comm/pom.xml +++ b/modules/enterprise/comm/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/base-perspective-jar/pom.xml b/modules/enterprise/gui/base-perspective-jar/pom.xml index dbb2cc2..611eb9d 100644 --- a/modules/enterprise/gui/base-perspective-jar/pom.xml +++ b/modules/enterprise/gui/base-perspective-jar/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/base-perspective-war/pom.xml b/modules/enterprise/gui/base-perspective-war/pom.xml index 785e68a..798a8ca 100644 --- a/modules/enterprise/gui/base-perspective-war/pom.xml +++ b/modules/enterprise/gui/base-perspective-war/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/content_http-war/pom.xml b/modules/enterprise/gui/content_http-war/pom.xml index fa3c7b6..df05645 100644 --- a/modules/enterprise/gui/content_http-war/pom.xml +++ b/modules/enterprise/gui/content_http-war/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-gui-parent</artifactId> - <version>3.0.0</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/coregui/pom.xml b/modules/enterprise/gui/coregui/pom.xml index b0c4e49..ca1b68d 100644 --- a/modules/enterprise/gui/coregui/pom.xml +++ b/modules/enterprise/gui/coregui/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/installer-war/pom.xml b/modules/enterprise/gui/installer-war/pom.xml index c2f18f1..1beadca 100644 --- a/modules/enterprise/gui/installer-war/pom.xml +++ b/modules/enterprise/gui/installer-war/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/pom.xml b/modules/enterprise/gui/pom.xml index 9ddc2fc..0c529ba 100644 --- a/modules/enterprise/gui/pom.xml +++ b/modules/enterprise/gui/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/portal-war/pom.xml b/modules/enterprise/gui/portal-war/pom.xml index 479addc..783942c 100644 --- a/modules/enterprise/gui/portal-war/pom.xml +++ b/modules/enterprise/gui/portal-war/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/webdav-war/pom.xml b/modules/enterprise/gui/webdav-war/pom.xml index f0e1f72..aa880be 100644 --- a/modules/enterprise/gui/webdav-war/pom.xml +++ b/modules/enterprise/gui/webdav-war/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/pom.xml b/modules/enterprise/pom.xml index 0862d3f..3b0dbb8 100644 --- a/modules/enterprise/pom.xml +++ b/modules/enterprise/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/remoting/cli/pom.xml b/modules/enterprise/remoting/cli/pom.xml index d263224..05187c7 100644 --- a/modules/enterprise/remoting/cli/pom.xml +++ b/modules/enterprise/remoting/cli/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<artifactId>rhq-remoting-cli</artifactId> diff --git a/modules/enterprise/remoting/client-api/pom.xml b/modules/enterprise/remoting/client-api/pom.xml index 73f0410..e86ef41 100644 --- a/modules/enterprise/remoting/client-api/pom.xml +++ b/modules/enterprise/remoting/client-api/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<artifactId>rhq-remoting-client-api</artifactId> diff --git a/modules/enterprise/remoting/pom.xml b/modules/enterprise/remoting/pom.xml index 5a27ebc..910b617 100644 --- a/modules/enterprise/remoting/pom.xml +++ b/modules/enterprise/remoting/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<artifactId>rhq-remoting-parent</artifactId> diff --git a/modules/enterprise/remoting/webservices/pom.xml b/modules/enterprise/remoting/webservices/pom.xml index 81bddb1..2ea73ee 100644 --- a/modules/enterprise/remoting/webservices/pom.xml +++ b/modules/enterprise/remoting/webservices/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<artifactId>rhq-remoting-webservices</artifactId> diff --git a/modules/enterprise/server/container-lib/pom.xml b/modules/enterprise/server/container-lib/pom.xml index 9df1977..2c98817 100644 --- a/modules/enterprise/server/container-lib/pom.xml +++ b/modules/enterprise/server/container-lib/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/container/pom.xml b/modules/enterprise/server/container/pom.xml index d0e93e0..3fd11e8 100644 --- a/modules/enterprise/server/container/pom.xml +++ b/modules/enterprise/server/container/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/ear/pom.xml b/modules/enterprise/server/ear/pom.xml index c05e6ac..bf15866 100644 --- a/modules/enterprise/server/ear/pom.xml +++ b/modules/enterprise/server/ear/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/jar/pom.xml b/modules/enterprise/server/jar/pom.xml index bd29a47..9e7bb24 100644 --- a/modules/enterprise/server/jar/pom.xml +++ b/modules/enterprise/server/jar/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/alert-email/pom.xml b/modules/enterprise/server/plugins/alert-email/pom.xml index 1ff43d1..dd5bc18 100644 --- a/modules/enterprise/server/plugins/alert-email/pom.xml +++ b/modules/enterprise/server/plugins/alert-email/pom.xml @@ -3,7 +3,7 @@ <parent> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0</version> + <version>3.0.0-SNAPSHOT</version> </parent> <modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-irc/pom.xml b/modules/enterprise/server/plugins/alert-irc/pom.xml index 0300716..c0973f3 100644 --- a/modules/enterprise/server/plugins/alert-irc/pom.xml +++ b/modules/enterprise/server/plugins/alert-irc/pom.xml @@ -3,7 +3,7 @@ <parent> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0</version> + <version>3.0.0-SNAPSHOT</version> </parent> <modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-microblog/pom.xml b/modules/enterprise/server/plugins/alert-microblog/pom.xml index efeaf27..a62fee8 100644 --- a/modules/enterprise/server/plugins/alert-microblog/pom.xml +++ b/modules/enterprise/server/plugins/alert-microblog/pom.xml @@ -3,7 +3,7 @@ <parent> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0</version> + <version>3.0.0-SNAPSHOT</version> </parent> <modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-mobicents/pom.xml b/modules/enterprise/server/plugins/alert-mobicents/pom.xml index 3e64d1e..3193539 100644 --- a/modules/enterprise/server/plugins/alert-mobicents/pom.xml +++ b/modules/enterprise/server/plugins/alert-mobicents/pom.xml @@ -3,7 +3,7 @@ <parent> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0</version> + <version>3.0.0-SNAPSHOT</version> </parent> <modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-operations/pom.xml b/modules/enterprise/server/plugins/alert-operations/pom.xml index 8822723..e69bfbc 100644 --- a/modules/enterprise/server/plugins/alert-operations/pom.xml +++ b/modules/enterprise/server/plugins/alert-operations/pom.xml @@ -2,7 +2,7 @@ <parent> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0</version> + <version>3.0.0-SNAPSHOT</version> </parent> <modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-roles/pom.xml b/modules/enterprise/server/plugins/alert-roles/pom.xml index c01583f..ca33bb7 100644 --- a/modules/enterprise/server/plugins/alert-roles/pom.xml +++ b/modules/enterprise/server/plugins/alert-roles/pom.xml @@ -3,7 +3,7 @@ <parent> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0</version> + <version>3.0.0-SNAPSHOT</version> </parent> <modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-snmp/pom.xml b/modules/enterprise/server/plugins/alert-snmp/pom.xml index 3b7a1f0..af75153 100644 --- a/modules/enterprise/server/plugins/alert-snmp/pom.xml +++ b/modules/enterprise/server/plugins/alert-snmp/pom.xml @@ -3,7 +3,7 @@ <parent> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0</version> + <version>3.0.0-SNAPSHOT</version> </parent> <modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-subject/pom.xml b/modules/enterprise/server/plugins/alert-subject/pom.xml index f5d767a..09839b8 100644 --- a/modules/enterprise/server/plugins/alert-subject/pom.xml +++ b/modules/enterprise/server/plugins/alert-subject/pom.xml @@ -3,7 +3,7 @@ <parent> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0</version> + <version>3.0.0-SNAPSHOT</version> </parent> <modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/ant-bundle/pom.xml b/modules/enterprise/server/plugins/ant-bundle/pom.xml index 1f961af..73f405e 100644 --- a/modules/enterprise/server/plugins/ant-bundle/pom.xml +++ b/modules/enterprise/server/plugins/ant-bundle/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/cobbler/pom.xml b/modules/enterprise/server/plugins/cobbler/pom.xml index 01f152d..4c44f10 100644 --- a/modules/enterprise/server/plugins/cobbler/pom.xml +++ b/modules/enterprise/server/plugins/cobbler/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<modelVersion>4.0.0</modelVersion> diff --git a/modules/enterprise/server/plugins/disk/pom.xml b/modules/enterprise/server/plugins/disk/pom.xml index ad1ebe1..0033d1b 100644 --- a/modules/enterprise/server/plugins/disk/pom.xml +++ b/modules/enterprise/server/plugins/disk/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml b/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml index 8ff5673..61965f2 100644 --- a/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml +++ b/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/jboss-software/pom.xml b/modules/enterprise/server/plugins/jboss-software/pom.xml index 323c494..7451668 100644 --- a/modules/enterprise/server/plugins/jboss-software/pom.xml +++ b/modules/enterprise/server/plugins/jboss-software/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml b/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml index d39c53c..0ac61d3 100644 --- a/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml +++ b/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml @@ -7,7 +7,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/perspectives/core/pom.xml b/modules/enterprise/server/plugins/perspectives/core/pom.xml index a88dedc..5a78451 100644 --- a/modules/enterprise/server/plugins/perspectives/core/pom.xml +++ b/modules/enterprise/server/plugins/perspectives/core/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/pom.xml b/modules/enterprise/server/plugins/pom.xml index 9e452fe..2b16f4a 100644 --- a/modules/enterprise/server/plugins/pom.xml +++ b/modules/enterprise/server/plugins/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/rhnhosted/pom.xml b/modules/enterprise/server/plugins/rhnhosted/pom.xml index 955aecf..e4ab9b2 100644 --- a/modules/enterprise/server/plugins/rhnhosted/pom.xml +++ b/modules/enterprise/server/plugins/rhnhosted/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/url/pom.xml b/modules/enterprise/server/plugins/url/pom.xml index b61f522..a6cba32 100644 --- a/modules/enterprise/server/plugins/url/pom.xml +++ b/modules/enterprise/server/plugins/url/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml b/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml index 8c4f861..9c7cc74 100644 --- a/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml +++ b/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/yum/pom.xml b/modules/enterprise/server/plugins/yum/pom.xml index 610d859..ebdd3da 100644 --- a/modules/enterprise/server/plugins/yum/pom.xml +++ b/modules/enterprise/server/plugins/yum/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/safe-invoker/pom.xml b/modules/enterprise/server/safe-invoker/pom.xml index 722b73c..06c8981 100644 --- a/modules/enterprise/server/safe-invoker/pom.xml +++ b/modules/enterprise/server/safe-invoker/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/sars/agent-sar/pom.xml b/modules/enterprise/server/sars/agent-sar/pom.xml index 568f2a2..aa278b8 100644 --- a/modules/enterprise/server/sars/agent-sar/pom.xml +++ b/modules/enterprise/server/sars/agent-sar/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-sars-parent</artifactId> - <version>3.0.0</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/sars/pom.xml b/modules/enterprise/server/sars/pom.xml index b36db80..0cc2084 100644 --- a/modules/enterprise/server/sars/pom.xml +++ b/modules/enterprise/server/sars/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/xml-schemas/pom.xml b/modules/enterprise/server/xml-schemas/pom.xml index 21b1441..14738d0 100644 --- a/modules/enterprise/server/xml-schemas/pom.xml +++ b/modules/enterprise/server/xml-schemas/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/helpers/pluginAnnotations/pom.xml b/modules/helpers/pluginAnnotations/pom.xml index 95d11be..d056f74 100644 --- a/modules/helpers/pluginAnnotations/pom.xml +++ b/modules/helpers/pluginAnnotations/pom.xml @@ -6,7 +6,7 @@ <parent> <groupId>org.rhq.helpers</groupId> <artifactId>rhq-helpers</artifactId> - <version>3.0.0</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq.helpers</groupId> diff --git a/modules/helpers/pluginGen/pom.xml b/modules/helpers/pluginGen/pom.xml index c2cf269..28dc9b1 100644 --- a/modules/helpers/pluginGen/pom.xml +++ b/modules/helpers/pluginGen/pom.xml @@ -6,7 +6,7 @@ <parent> <groupId>org.rhq.helpers</groupId> <artifactId>rhq-helpers</artifactId> - <version>3.0.0</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq.helpers</groupId> diff --git a/modules/helpers/pom.xml b/modules/helpers/pom.xml index 67674b3..a0721a9 100644 --- a/modules/helpers/pom.xml +++ b/modules/helpers/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq.helpers</groupId> diff --git a/modules/helpers/rtfilter/pom.xml b/modules/helpers/rtfilter/pom.xml index bf6199e..5d327ee 100644 --- a/modules/helpers/rtfilter/pom.xml +++ b/modules/helpers/rtfilter/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq.helpers</groupId> <artifactId>rhq-helpers</artifactId> - <version>3.0.0</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/aliases/pom.xml b/modules/plugins/aliases/pom.xml index e59e4db..c37598e 100644 --- a/modules/plugins/aliases/pom.xml +++ b/modules/plugins/aliases/pom.xml @@ -7,7 +7,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/ant-bundle/pom.xml b/modules/plugins/ant-bundle/pom.xml index da8381d..cc160c9 100644 --- a/modules/plugins/ant-bundle/pom.xml +++ b/modules/plugins/ant-bundle/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/apache/pom.xml b/modules/plugins/apache/pom.xml index 8a5e218..b4f9208 100644 --- a/modules/plugins/apache/pom.xml +++ b/modules/plugins/apache/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/augeas/pom.xml b/modules/plugins/augeas/pom.xml index c3c3731..915106a 100644 --- a/modules/plugins/augeas/pom.xml +++ b/modules/plugins/augeas/pom.xml @@ -7,7 +7,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/cobbler/pom.xml b/modules/plugins/cobbler/pom.xml index dd10246..d920440 100644 --- a/modules/plugins/cobbler/pom.xml +++ b/modules/plugins/cobbler/pom.xml @@ -7,7 +7,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/cron/pom.xml b/modules/plugins/cron/pom.xml index 44b5116..d5aaad5 100644 --- a/modules/plugins/cron/pom.xml +++ b/modules/plugins/cron/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/database/pom.xml b/modules/plugins/database/pom.xml index c91d8c2..30889f7 100644 --- a/modules/plugins/database/pom.xml +++ b/modules/plugins/database/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/filetemplate-bundle/pom.xml b/modules/plugins/filetemplate-bundle/pom.xml index 0150062..b79645d 100644 --- a/modules/plugins/filetemplate-bundle/pom.xml +++ b/modules/plugins/filetemplate-bundle/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/grub/pom.xml b/modules/plugins/grub/pom.xml index a517e50..f7cf265 100644 --- a/modules/plugins/grub/pom.xml +++ b/modules/plugins/grub/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/hibernate/pom.xml b/modules/plugins/hibernate/pom.xml index 745c5e2..acb08ef 100644 --- a/modules/plugins/hibernate/pom.xml +++ b/modules/plugins/hibernate/pom.xml @@ -6,7 +6,7 @@ <groupId>org.rhq</groupId> <!-- Bypass the jopr-plugins-parent which can not have children. It must build after the plugins in order to execute integration tests on them. --> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.jboss.on</groupId> diff --git a/modules/plugins/hosts/pom.xml b/modules/plugins/hosts/pom.xml index d7d0846..7dd0fde 100644 --- a/modules/plugins/hosts/pom.xml +++ b/modules/plugins/hosts/pom.xml @@ -7,7 +7,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/hudson/pom.xml b/modules/plugins/hudson/pom.xml index dd44b03..65fa7b8 100644 --- a/modules/plugins/hudson/pom.xml +++ b/modules/plugins/hudson/pom.xml @@ -6,7 +6,7 @@ <parent> <artifactId>rhq-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/iis/pom.xml b/modules/plugins/iis/pom.xml index 5bfe8b6..853c020 100644 --- a/modules/plugins/iis/pom.xml +++ b/modules/plugins/iis/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/jboss-as-5/pom.xml b/modules/plugins/jboss-as-5/pom.xml index 2fc226a..a0ade77 100644 --- a/modules/plugins/jboss-as-5/pom.xml +++ b/modules/plugins/jboss-as-5/pom.xml @@ -9,7 +9,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.jboss.on</groupId> diff --git a/modules/plugins/jboss-as/pom.xml b/modules/plugins/jboss-as/pom.xml index a0e18ef..b9ed2b3 100644 --- a/modules/plugins/jboss-as/pom.xml +++ b/modules/plugins/jboss-as/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.jboss.on</groupId> diff --git a/modules/plugins/jboss-cache-v3/pom.xml b/modules/plugins/jboss-cache-v3/pom.xml index 3f3337e..b3846fa 100644 --- a/modules/plugins/jboss-cache-v3/pom.xml +++ b/modules/plugins/jboss-cache-v3/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.jboss.on</groupId> diff --git a/modules/plugins/jboss-cache/pom.xml b/modules/plugins/jboss-cache/pom.xml index c3f4ee7..443e524 100644 --- a/modules/plugins/jboss-cache/pom.xml +++ b/modules/plugins/jboss-cache/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.jboss.on</groupId> diff --git a/modules/plugins/jmx/pom.xml b/modules/plugins/jmx/pom.xml index 25c1871..ac9885a 100644 --- a/modules/plugins/jmx/pom.xml +++ b/modules/plugins/jmx/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/mysql/pom.xml b/modules/plugins/mysql/pom.xml index ffd328e..d0c9053 100644 --- a/modules/plugins/mysql/pom.xml +++ b/modules/plugins/mysql/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/netservices/pom.xml b/modules/plugins/netservices/pom.xml index d305b4e..06ae2ae 100644 --- a/modules/plugins/netservices/pom.xml +++ b/modules/plugins/netservices/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/oracle/pom.xml b/modules/plugins/oracle/pom.xml index ca08b54..1acdb0f 100644 --- a/modules/plugins/oracle/pom.xml +++ b/modules/plugins/oracle/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/perftest/pom.xml b/modules/plugins/perftest/pom.xml index db31afb..39c75da 100644 --- a/modules/plugins/perftest/pom.xml +++ b/modules/plugins/perftest/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/platform/pom.xml b/modules/plugins/platform/pom.xml index 0be644f..97b83b0 100644 --- a/modules/plugins/platform/pom.xml +++ b/modules/plugins/platform/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/pom.xml b/modules/plugins/pom.xml index 7394bfc..85d6105 100644 --- a/modules/plugins/pom.xml +++ b/modules/plugins/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/postfix/pom.xml b/modules/plugins/postfix/pom.xml index f42212b..283ab6a 100644 --- a/modules/plugins/postfix/pom.xml +++ b/modules/plugins/postfix/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/postgres/pom.xml b/modules/plugins/postgres/pom.xml index 4edf4e7..5a4466c 100644 --- a/modules/plugins/postgres/pom.xml +++ b/modules/plugins/postgres/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/rhq-agent/pom.xml b/modules/plugins/rhq-agent/pom.xml index 706efa2..a190dcd 100644 --- a/modules/plugins/rhq-agent/pom.xml +++ b/modules/plugins/rhq-agent/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/rhq-server/pom.xml b/modules/plugins/rhq-server/pom.xml index c253427..8f4e675 100644 --- a/modules/plugins/rhq-server/pom.xml +++ b/modules/plugins/rhq-server/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.jboss.on</groupId> diff --git a/modules/plugins/samba/pom.xml b/modules/plugins/samba/pom.xml index a846fac..0d41574 100644 --- a/modules/plugins/samba/pom.xml +++ b/modules/plugins/samba/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/script/pom.xml b/modules/plugins/script/pom.xml index d9e5a9e..7719b14 100644 --- a/modules/plugins/script/pom.xml +++ b/modules/plugins/script/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/snmptrapd/pom.xml b/modules/plugins/snmptrapd/pom.xml index 34e530a..2d9d715 100644 --- a/modules/plugins/snmptrapd/pom.xml +++ b/modules/plugins/snmptrapd/pom.xml @@ -2,7 +2,7 @@ <parent> <artifactId>rhq-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<modelVersion>4.0.0</modelVersion> diff --git a/modules/plugins/sshd/pom.xml b/modules/plugins/sshd/pom.xml index a5997d7..3579496 100644 --- a/modules/plugins/sshd/pom.xml +++ b/modules/plugins/sshd/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/sudoers/pom.xml b/modules/plugins/sudoers/pom.xml index 50d3587..41df1b8 100644 --- a/modules/plugins/sudoers/pom.xml +++ b/modules/plugins/sudoers/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/tomcat/pom.xml b/modules/plugins/tomcat/pom.xml index 1c5410a..205d5b0 100644 --- a/modules/plugins/tomcat/pom.xml +++ b/modules/plugins/tomcat/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.jboss.on</groupId> diff --git a/modules/plugins/twitter/pom.xml b/modules/plugins/twitter/pom.xml index 51ed887..e299efa 100644 --- a/modules/plugins/twitter/pom.xml +++ b/modules/plugins/twitter/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/validate-all-plugins/pom.xml b/modules/plugins/validate-all-plugins/pom.xml index 018da41..b3d5e87 100644 --- a/modules/plugins/validate-all-plugins/pom.xml +++ b/modules/plugins/validate-all-plugins/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/pom.xml b/modules/pom.xml index 3065373..bc96ae3 100644 --- a/modules/pom.xml +++ b/modules/pom.xml @@ -6,7 +6,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/test-utils/pom.xml b/modules/test-utils/pom.xml index 3bdbac9..2235687 100644 --- a/modules/test-utils/pom.xml +++ b/modules/test-utils/pom.xml @@ -4,7 +4,7 @@ <parent> <artifactId>rhq-modules-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0</version> + <version>3.0.0-SNAPSHOT</version> </parent> <artifactId>test-utils</artifactId> <name>RHQ Test Utils</name> diff --git a/pom.xml b/pom.xml index 4a405c3..4743b2c 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@
<groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0</version> + <version>3.0.0-SNAPSHOT</version> <packaging>pom</packaging>
<name>RHQ</name>
commit 59e9341c367e24ad78e7dafd683887080ee758dd Author: hudson auto wnstb@yahoo.com Date: Fri Jul 2 17:39:43 2010 -0400
[maven-release-plugin] prepare release RHQ_3_0_0
diff --git a/modules/common/ant-bundle/pom.xml b/modules/common/ant-bundle/pom.xml index eda9133..2671e28 100644 --- a/modules/common/ant-bundle/pom.xml +++ b/modules/common/ant-bundle/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-common-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/common/filetemplate-bundle/pom.xml b/modules/common/filetemplate-bundle/pom.xml index bc7965b..d120b90 100644 --- a/modules/common/filetemplate-bundle/pom.xml +++ b/modules/common/filetemplate-bundle/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-common-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/common/jboss-as/pom.xml b/modules/common/jboss-as/pom.xml index 2cf950b..13db879 100644 --- a/modules/common/jboss-as/pom.xml +++ b/modules/common/jboss-as/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-common-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/common/pom.xml b/modules/common/pom.xml index ee81a94..cdabe07 100644 --- a/modules/common/pom.xml +++ b/modules/common/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/client-api/pom.xml b/modules/core/client-api/pom.xml index d177f9e..6ef6ac7 100644 --- a/modules/core/client-api/pom.xml +++ b/modules/core/client-api/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/comm-api/pom.xml b/modules/core/comm-api/pom.xml index a51f92b..2b8b625 100644 --- a/modules/core/comm-api/pom.xml +++ b/modules/core/comm-api/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/dbutils/pom.xml b/modules/core/dbutils/pom.xml index d536ce6..2b434aa 100644 --- a/modules/core/dbutils/pom.xml +++ b/modules/core/dbutils/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/domain/pom.xml b/modules/core/domain/pom.xml index e0ced84..01ef215 100644 --- a/modules/core/domain/pom.xml +++ b/modules/core/domain/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/gui/pom.xml b/modules/core/gui/pom.xml index 0911918..b85d13d 100644 --- a/modules/core/gui/pom.xml +++ b/modules/core/gui/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/native-system/pom.xml b/modules/core/native-system/pom.xml index d47d4c8..8656c25 100644 --- a/modules/core/native-system/pom.xml +++ b/modules/core/native-system/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/plugin-api/pom.xml b/modules/core/plugin-api/pom.xml index e1ce7ef..750882c 100644 --- a/modules/core/plugin-api/pom.xml +++ b/modules/core/plugin-api/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/plugin-container/pom.xml b/modules/core/plugin-container/pom.xml index 2e58102..ed9231b 100644 --- a/modules/core/plugin-container/pom.xml +++ b/modules/core/plugin-container/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/plugin-validator/pom.xml b/modules/core/plugin-validator/pom.xml index 7739177..f8105ac 100644 --- a/modules/core/plugin-validator/pom.xml +++ b/modules/core/plugin-validator/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/plugindoc/pom.xml b/modules/core/plugindoc/pom.xml index eeb7e81..89a85a0 100644 --- a/modules/core/plugindoc/pom.xml +++ b/modules/core/plugindoc/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/pom.xml b/modules/core/pom.xml index 7aad64c..832b459 100644 --- a/modules/core/pom.xml +++ b/modules/core/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/util/pom.xml b/modules/core/util/pom.xml index bc41dc5..fa1d7dd 100644 --- a/modules/core/util/pom.xml +++ b/modules/core/util/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/agent/pom.xml b/modules/enterprise/agent/pom.xml index d9f1c1c..bdcf31f 100644 --- a/modules/enterprise/agent/pom.xml +++ b/modules/enterprise/agent/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/agentupdate/pom.xml b/modules/enterprise/agentupdate/pom.xml index 8942239..701e10f 100644 --- a/modules/enterprise/agentupdate/pom.xml +++ b/modules/enterprise/agentupdate/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/comm/pom.xml b/modules/enterprise/comm/pom.xml index 8b9da9c..cfac808 100644 --- a/modules/enterprise/comm/pom.xml +++ b/modules/enterprise/comm/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/base-perspective-jar/pom.xml b/modules/enterprise/gui/base-perspective-jar/pom.xml index 611eb9d..dbb2cc2 100644 --- a/modules/enterprise/gui/base-perspective-jar/pom.xml +++ b/modules/enterprise/gui/base-perspective-jar/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/base-perspective-war/pom.xml b/modules/enterprise/gui/base-perspective-war/pom.xml index 798a8ca..785e68a 100644 --- a/modules/enterprise/gui/base-perspective-war/pom.xml +++ b/modules/enterprise/gui/base-perspective-war/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/content_http-war/pom.xml b/modules/enterprise/gui/content_http-war/pom.xml index df05645..fa3c7b6 100644 --- a/modules/enterprise/gui/content_http-war/pom.xml +++ b/modules/enterprise/gui/content_http-war/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-gui-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/coregui/pom.xml b/modules/enterprise/gui/coregui/pom.xml index ca1b68d..b0c4e49 100644 --- a/modules/enterprise/gui/coregui/pom.xml +++ b/modules/enterprise/gui/coregui/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/installer-war/pom.xml b/modules/enterprise/gui/installer-war/pom.xml index 1beadca..c2f18f1 100644 --- a/modules/enterprise/gui/installer-war/pom.xml +++ b/modules/enterprise/gui/installer-war/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/pom.xml b/modules/enterprise/gui/pom.xml index 0c529ba..9ddc2fc 100644 --- a/modules/enterprise/gui/pom.xml +++ b/modules/enterprise/gui/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/portal-war/pom.xml b/modules/enterprise/gui/portal-war/pom.xml index 783942c..479addc 100644 --- a/modules/enterprise/gui/portal-war/pom.xml +++ b/modules/enterprise/gui/portal-war/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/webdav-war/pom.xml b/modules/enterprise/gui/webdav-war/pom.xml index aa880be..f0e1f72 100644 --- a/modules/enterprise/gui/webdav-war/pom.xml +++ b/modules/enterprise/gui/webdav-war/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/pom.xml b/modules/enterprise/pom.xml index 3b0dbb8..0862d3f 100644 --- a/modules/enterprise/pom.xml +++ b/modules/enterprise/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/remoting/cli/pom.xml b/modules/enterprise/remoting/cli/pom.xml index 05187c7..d263224 100644 --- a/modules/enterprise/remoting/cli/pom.xml +++ b/modules/enterprise/remoting/cli/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0</version> </parent>
<artifactId>rhq-remoting-cli</artifactId> diff --git a/modules/enterprise/remoting/client-api/pom.xml b/modules/enterprise/remoting/client-api/pom.xml index e86ef41..73f0410 100644 --- a/modules/enterprise/remoting/client-api/pom.xml +++ b/modules/enterprise/remoting/client-api/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0</version> </parent>
<artifactId>rhq-remoting-client-api</artifactId> diff --git a/modules/enterprise/remoting/pom.xml b/modules/enterprise/remoting/pom.xml index 910b617..5a27ebc 100644 --- a/modules/enterprise/remoting/pom.xml +++ b/modules/enterprise/remoting/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0</version> </parent>
<artifactId>rhq-remoting-parent</artifactId> diff --git a/modules/enterprise/remoting/webservices/pom.xml b/modules/enterprise/remoting/webservices/pom.xml index 2ea73ee..81bddb1 100644 --- a/modules/enterprise/remoting/webservices/pom.xml +++ b/modules/enterprise/remoting/webservices/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0</version> </parent>
<artifactId>rhq-remoting-webservices</artifactId> diff --git a/modules/enterprise/server/container-lib/pom.xml b/modules/enterprise/server/container-lib/pom.xml index 2c98817..9df1977 100644 --- a/modules/enterprise/server/container-lib/pom.xml +++ b/modules/enterprise/server/container-lib/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/container/pom.xml b/modules/enterprise/server/container/pom.xml index 3fd11e8..d0e93e0 100644 --- a/modules/enterprise/server/container/pom.xml +++ b/modules/enterprise/server/container/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/ear/pom.xml b/modules/enterprise/server/ear/pom.xml index bf15866..c05e6ac 100644 --- a/modules/enterprise/server/ear/pom.xml +++ b/modules/enterprise/server/ear/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/jar/pom.xml b/modules/enterprise/server/jar/pom.xml index 9e7bb24..bd29a47 100644 --- a/modules/enterprise/server/jar/pom.xml +++ b/modules/enterprise/server/jar/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/alert-email/pom.xml b/modules/enterprise/server/plugins/alert-email/pom.xml index dd5bc18..1ff43d1 100644 --- a/modules/enterprise/server/plugins/alert-email/pom.xml +++ b/modules/enterprise/server/plugins/alert-email/pom.xml @@ -3,7 +3,7 @@ <parent> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0</version> </parent> <modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-irc/pom.xml b/modules/enterprise/server/plugins/alert-irc/pom.xml index c0973f3..0300716 100644 --- a/modules/enterprise/server/plugins/alert-irc/pom.xml +++ b/modules/enterprise/server/plugins/alert-irc/pom.xml @@ -3,7 +3,7 @@ <parent> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0</version> </parent> <modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-microblog/pom.xml b/modules/enterprise/server/plugins/alert-microblog/pom.xml index a62fee8..efeaf27 100644 --- a/modules/enterprise/server/plugins/alert-microblog/pom.xml +++ b/modules/enterprise/server/plugins/alert-microblog/pom.xml @@ -3,7 +3,7 @@ <parent> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0</version> </parent> <modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-mobicents/pom.xml b/modules/enterprise/server/plugins/alert-mobicents/pom.xml index 3193539..3e64d1e 100644 --- a/modules/enterprise/server/plugins/alert-mobicents/pom.xml +++ b/modules/enterprise/server/plugins/alert-mobicents/pom.xml @@ -3,7 +3,7 @@ <parent> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0</version> </parent> <modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-operations/pom.xml b/modules/enterprise/server/plugins/alert-operations/pom.xml index e69bfbc..8822723 100644 --- a/modules/enterprise/server/plugins/alert-operations/pom.xml +++ b/modules/enterprise/server/plugins/alert-operations/pom.xml @@ -2,7 +2,7 @@ <parent> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0</version> </parent> <modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-roles/pom.xml b/modules/enterprise/server/plugins/alert-roles/pom.xml index ca33bb7..c01583f 100644 --- a/modules/enterprise/server/plugins/alert-roles/pom.xml +++ b/modules/enterprise/server/plugins/alert-roles/pom.xml @@ -3,7 +3,7 @@ <parent> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0</version> </parent> <modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-snmp/pom.xml b/modules/enterprise/server/plugins/alert-snmp/pom.xml index af75153..3b7a1f0 100644 --- a/modules/enterprise/server/plugins/alert-snmp/pom.xml +++ b/modules/enterprise/server/plugins/alert-snmp/pom.xml @@ -3,7 +3,7 @@ <parent> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0</version> </parent> <modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-subject/pom.xml b/modules/enterprise/server/plugins/alert-subject/pom.xml index 09839b8..f5d767a 100644 --- a/modules/enterprise/server/plugins/alert-subject/pom.xml +++ b/modules/enterprise/server/plugins/alert-subject/pom.xml @@ -3,7 +3,7 @@ <parent> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0</version> </parent> <modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/ant-bundle/pom.xml b/modules/enterprise/server/plugins/ant-bundle/pom.xml index 73f405e..1f961af 100644 --- a/modules/enterprise/server/plugins/ant-bundle/pom.xml +++ b/modules/enterprise/server/plugins/ant-bundle/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/cobbler/pom.xml b/modules/enterprise/server/plugins/cobbler/pom.xml index 4c44f10..01f152d 100644 --- a/modules/enterprise/server/plugins/cobbler/pom.xml +++ b/modules/enterprise/server/plugins/cobbler/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0</version> </parent>
<modelVersion>4.0.0</modelVersion> diff --git a/modules/enterprise/server/plugins/disk/pom.xml b/modules/enterprise/server/plugins/disk/pom.xml index 0033d1b..ad1ebe1 100644 --- a/modules/enterprise/server/plugins/disk/pom.xml +++ b/modules/enterprise/server/plugins/disk/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml b/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml index 61965f2..8ff5673 100644 --- a/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml +++ b/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/jboss-software/pom.xml b/modules/enterprise/server/plugins/jboss-software/pom.xml index 7451668..323c494 100644 --- a/modules/enterprise/server/plugins/jboss-software/pom.xml +++ b/modules/enterprise/server/plugins/jboss-software/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml b/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml index 0ac61d3..d39c53c 100644 --- a/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml +++ b/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml @@ -7,7 +7,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/perspectives/core/pom.xml b/modules/enterprise/server/plugins/perspectives/core/pom.xml index 5a78451..a88dedc 100644 --- a/modules/enterprise/server/plugins/perspectives/core/pom.xml +++ b/modules/enterprise/server/plugins/perspectives/core/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/pom.xml b/modules/enterprise/server/plugins/pom.xml index 2b16f4a..9e452fe 100644 --- a/modules/enterprise/server/plugins/pom.xml +++ b/modules/enterprise/server/plugins/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/rhnhosted/pom.xml b/modules/enterprise/server/plugins/rhnhosted/pom.xml index e4ab9b2..955aecf 100644 --- a/modules/enterprise/server/plugins/rhnhosted/pom.xml +++ b/modules/enterprise/server/plugins/rhnhosted/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/url/pom.xml b/modules/enterprise/server/plugins/url/pom.xml index a6cba32..b61f522 100644 --- a/modules/enterprise/server/plugins/url/pom.xml +++ b/modules/enterprise/server/plugins/url/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml b/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml index 9c7cc74..8c4f861 100644 --- a/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml +++ b/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/yum/pom.xml b/modules/enterprise/server/plugins/yum/pom.xml index ebdd3da..610d859 100644 --- a/modules/enterprise/server/plugins/yum/pom.xml +++ b/modules/enterprise/server/plugins/yum/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/safe-invoker/pom.xml b/modules/enterprise/server/safe-invoker/pom.xml index 06c8981..722b73c 100644 --- a/modules/enterprise/server/safe-invoker/pom.xml +++ b/modules/enterprise/server/safe-invoker/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/sars/agent-sar/pom.xml b/modules/enterprise/server/sars/agent-sar/pom.xml index aa278b8..568f2a2 100644 --- a/modules/enterprise/server/sars/agent-sar/pom.xml +++ b/modules/enterprise/server/sars/agent-sar/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-sars-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/sars/pom.xml b/modules/enterprise/server/sars/pom.xml index 0cc2084..b36db80 100644 --- a/modules/enterprise/server/sars/pom.xml +++ b/modules/enterprise/server/sars/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/xml-schemas/pom.xml b/modules/enterprise/server/xml-schemas/pom.xml index 14738d0..21b1441 100644 --- a/modules/enterprise/server/xml-schemas/pom.xml +++ b/modules/enterprise/server/xml-schemas/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/helpers/pluginAnnotations/pom.xml b/modules/helpers/pluginAnnotations/pom.xml index d056f74..95d11be 100644 --- a/modules/helpers/pluginAnnotations/pom.xml +++ b/modules/helpers/pluginAnnotations/pom.xml @@ -6,7 +6,7 @@ <parent> <groupId>org.rhq.helpers</groupId> <artifactId>rhq-helpers</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0</version> </parent>
<groupId>org.rhq.helpers</groupId> diff --git a/modules/helpers/pluginGen/pom.xml b/modules/helpers/pluginGen/pom.xml index 28dc9b1..c2cf269 100644 --- a/modules/helpers/pluginGen/pom.xml +++ b/modules/helpers/pluginGen/pom.xml @@ -6,7 +6,7 @@ <parent> <groupId>org.rhq.helpers</groupId> <artifactId>rhq-helpers</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0</version> </parent>
<groupId>org.rhq.helpers</groupId> diff --git a/modules/helpers/pom.xml b/modules/helpers/pom.xml index a0721a9..67674b3 100644 --- a/modules/helpers/pom.xml +++ b/modules/helpers/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0</version> </parent>
<groupId>org.rhq.helpers</groupId> diff --git a/modules/helpers/rtfilter/pom.xml b/modules/helpers/rtfilter/pom.xml index 5d327ee..bf6199e 100644 --- a/modules/helpers/rtfilter/pom.xml +++ b/modules/helpers/rtfilter/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq.helpers</groupId> <artifactId>rhq-helpers</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/aliases/pom.xml b/modules/plugins/aliases/pom.xml index c37598e..e59e4db 100644 --- a/modules/plugins/aliases/pom.xml +++ b/modules/plugins/aliases/pom.xml @@ -7,7 +7,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/ant-bundle/pom.xml b/modules/plugins/ant-bundle/pom.xml index cc160c9..da8381d 100644 --- a/modules/plugins/ant-bundle/pom.xml +++ b/modules/plugins/ant-bundle/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/apache/pom.xml b/modules/plugins/apache/pom.xml index b4f9208..8a5e218 100644 --- a/modules/plugins/apache/pom.xml +++ b/modules/plugins/apache/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/augeas/pom.xml b/modules/plugins/augeas/pom.xml index 915106a..c3c3731 100644 --- a/modules/plugins/augeas/pom.xml +++ b/modules/plugins/augeas/pom.xml @@ -7,7 +7,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/cobbler/pom.xml b/modules/plugins/cobbler/pom.xml index d920440..dd10246 100644 --- a/modules/plugins/cobbler/pom.xml +++ b/modules/plugins/cobbler/pom.xml @@ -7,7 +7,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/cron/pom.xml b/modules/plugins/cron/pom.xml index d5aaad5..44b5116 100644 --- a/modules/plugins/cron/pom.xml +++ b/modules/plugins/cron/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/database/pom.xml b/modules/plugins/database/pom.xml index 30889f7..c91d8c2 100644 --- a/modules/plugins/database/pom.xml +++ b/modules/plugins/database/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/filetemplate-bundle/pom.xml b/modules/plugins/filetemplate-bundle/pom.xml index b79645d..0150062 100644 --- a/modules/plugins/filetemplate-bundle/pom.xml +++ b/modules/plugins/filetemplate-bundle/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/grub/pom.xml b/modules/plugins/grub/pom.xml index f7cf265..a517e50 100644 --- a/modules/plugins/grub/pom.xml +++ b/modules/plugins/grub/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/hibernate/pom.xml b/modules/plugins/hibernate/pom.xml index acb08ef..745c5e2 100644 --- a/modules/plugins/hibernate/pom.xml +++ b/modules/plugins/hibernate/pom.xml @@ -6,7 +6,7 @@ <groupId>org.rhq</groupId> <!-- Bypass the jopr-plugins-parent which can not have children. It must build after the plugins in order to execute integration tests on them. --> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0</version> </parent>
<groupId>org.jboss.on</groupId> diff --git a/modules/plugins/hosts/pom.xml b/modules/plugins/hosts/pom.xml index 7dd0fde..d7d0846 100644 --- a/modules/plugins/hosts/pom.xml +++ b/modules/plugins/hosts/pom.xml @@ -7,7 +7,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/hudson/pom.xml b/modules/plugins/hudson/pom.xml index 65fa7b8..dd44b03 100644 --- a/modules/plugins/hudson/pom.xml +++ b/modules/plugins/hudson/pom.xml @@ -6,7 +6,7 @@ <parent> <artifactId>rhq-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/iis/pom.xml b/modules/plugins/iis/pom.xml index 853c020..5bfe8b6 100644 --- a/modules/plugins/iis/pom.xml +++ b/modules/plugins/iis/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/jboss-as-5/pom.xml b/modules/plugins/jboss-as-5/pom.xml index a0ade77..2fc226a 100644 --- a/modules/plugins/jboss-as-5/pom.xml +++ b/modules/plugins/jboss-as-5/pom.xml @@ -9,7 +9,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0</version> </parent>
<groupId>org.jboss.on</groupId> diff --git a/modules/plugins/jboss-as/pom.xml b/modules/plugins/jboss-as/pom.xml index b9ed2b3..a0e18ef 100644 --- a/modules/plugins/jboss-as/pom.xml +++ b/modules/plugins/jboss-as/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0</version> </parent>
<groupId>org.jboss.on</groupId> diff --git a/modules/plugins/jboss-cache-v3/pom.xml b/modules/plugins/jboss-cache-v3/pom.xml index b3846fa..3f3337e 100644 --- a/modules/plugins/jboss-cache-v3/pom.xml +++ b/modules/plugins/jboss-cache-v3/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0</version> </parent>
<groupId>org.jboss.on</groupId> diff --git a/modules/plugins/jboss-cache/pom.xml b/modules/plugins/jboss-cache/pom.xml index 443e524..c3f4ee7 100644 --- a/modules/plugins/jboss-cache/pom.xml +++ b/modules/plugins/jboss-cache/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0</version> </parent>
<groupId>org.jboss.on</groupId> diff --git a/modules/plugins/jmx/pom.xml b/modules/plugins/jmx/pom.xml index ac9885a..25c1871 100644 --- a/modules/plugins/jmx/pom.xml +++ b/modules/plugins/jmx/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/mysql/pom.xml b/modules/plugins/mysql/pom.xml index d0c9053..ffd328e 100644 --- a/modules/plugins/mysql/pom.xml +++ b/modules/plugins/mysql/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/netservices/pom.xml b/modules/plugins/netservices/pom.xml index 06ae2ae..d305b4e 100644 --- a/modules/plugins/netservices/pom.xml +++ b/modules/plugins/netservices/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/oracle/pom.xml b/modules/plugins/oracle/pom.xml index 1acdb0f..ca08b54 100644 --- a/modules/plugins/oracle/pom.xml +++ b/modules/plugins/oracle/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/perftest/pom.xml b/modules/plugins/perftest/pom.xml index 39c75da..db31afb 100644 --- a/modules/plugins/perftest/pom.xml +++ b/modules/plugins/perftest/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/platform/pom.xml b/modules/plugins/platform/pom.xml index 97b83b0..0be644f 100644 --- a/modules/plugins/platform/pom.xml +++ b/modules/plugins/platform/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/pom.xml b/modules/plugins/pom.xml index 85d6105..7394bfc 100644 --- a/modules/plugins/pom.xml +++ b/modules/plugins/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/postfix/pom.xml b/modules/plugins/postfix/pom.xml index 283ab6a..f42212b 100644 --- a/modules/plugins/postfix/pom.xml +++ b/modules/plugins/postfix/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/postgres/pom.xml b/modules/plugins/postgres/pom.xml index 5a4466c..4edf4e7 100644 --- a/modules/plugins/postgres/pom.xml +++ b/modules/plugins/postgres/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/rhq-agent/pom.xml b/modules/plugins/rhq-agent/pom.xml index a190dcd..706efa2 100644 --- a/modules/plugins/rhq-agent/pom.xml +++ b/modules/plugins/rhq-agent/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/rhq-server/pom.xml b/modules/plugins/rhq-server/pom.xml index 8f4e675..c253427 100644 --- a/modules/plugins/rhq-server/pom.xml +++ b/modules/plugins/rhq-server/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0</version> </parent>
<groupId>org.jboss.on</groupId> diff --git a/modules/plugins/samba/pom.xml b/modules/plugins/samba/pom.xml index 0d41574..a846fac 100644 --- a/modules/plugins/samba/pom.xml +++ b/modules/plugins/samba/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/script/pom.xml b/modules/plugins/script/pom.xml index 7719b14..d9e5a9e 100644 --- a/modules/plugins/script/pom.xml +++ b/modules/plugins/script/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/snmptrapd/pom.xml b/modules/plugins/snmptrapd/pom.xml index 2d9d715..34e530a 100644 --- a/modules/plugins/snmptrapd/pom.xml +++ b/modules/plugins/snmptrapd/pom.xml @@ -2,7 +2,7 @@ <parent> <artifactId>rhq-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0</version> </parent>
<modelVersion>4.0.0</modelVersion> diff --git a/modules/plugins/sshd/pom.xml b/modules/plugins/sshd/pom.xml index 3579496..a5997d7 100644 --- a/modules/plugins/sshd/pom.xml +++ b/modules/plugins/sshd/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/sudoers/pom.xml b/modules/plugins/sudoers/pom.xml index 41df1b8..50d3587 100644 --- a/modules/plugins/sudoers/pom.xml +++ b/modules/plugins/sudoers/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/tomcat/pom.xml b/modules/plugins/tomcat/pom.xml index 205d5b0..1c5410a 100644 --- a/modules/plugins/tomcat/pom.xml +++ b/modules/plugins/tomcat/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0</version> </parent>
<groupId>org.jboss.on</groupId> diff --git a/modules/plugins/twitter/pom.xml b/modules/plugins/twitter/pom.xml index e299efa..51ed887 100644 --- a/modules/plugins/twitter/pom.xml +++ b/modules/plugins/twitter/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/validate-all-plugins/pom.xml b/modules/plugins/validate-all-plugins/pom.xml index b3d5e87..018da41 100644 --- a/modules/plugins/validate-all-plugins/pom.xml +++ b/modules/plugins/validate-all-plugins/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/pom.xml b/modules/pom.xml index bc96ae3..3065373 100644 --- a/modules/pom.xml +++ b/modules/pom.xml @@ -6,7 +6,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/test-utils/pom.xml b/modules/test-utils/pom.xml index 2235687..3bdbac9 100644 --- a/modules/test-utils/pom.xml +++ b/modules/test-utils/pom.xml @@ -4,7 +4,7 @@ <parent> <artifactId>rhq-modules-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0</version> </parent> <artifactId>test-utils</artifactId> <name>RHQ Test Utils</name> diff --git a/pom.xml b/pom.xml index 4743b2c..4a405c3 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@
<groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0</version> <packaging>pom</packaging>
<name>RHQ</name>
commit ce0c0771ce63d760fa45e6c4d925b0bf081048da Author: Ian Springer ian.springer@redhat.com Date: Fri Jul 2 16:28:10 2010 -0400
temporarily update to not purge local repo in production mode
diff --git a/release.sh b/release.sh index 6cb69da..57b39b0 100644 --- a/release.sh +++ b/release.sh @@ -247,7 +247,7 @@ echo if [ -f "$MAVEN_LOCAL_REPO_DIR" ]; then if [ "$MODE" = "production" ]; then echo "Purging MAVEN_LOCAL_REPO_DIR ($MAVEN_LOCAL_REPO_DIR) since this is a production build..." - rm -rf "$MAVEN_LOCAL_REPO_DIR" + #rm -rf "$MAVEN_LOCAL_REPO_DIR" else OUTPUT=`find "$MAVEN_LOCAL_REPO_DIR" -maxdepth 0 -mtime $MAVEN_LOCAL_REPO_PURGE_INTERVAL_HOURS` if [ -n "$OUTPUT" ]; then
commit 5113a3868b3db0304ee21cb36b6f70290afda9a2 Author: Ian Springer ian.springer@redhat.com Date: Fri Jul 2 16:25:34 2010 -0400
upgrade all i18nlog versions throughout poms and ant scripts from 1.0.9 to 1.0.10; update ManagedComponentUtils.getSinglestoneManagedComponent to return null, rather than throwing an IllegalStateException, if no components of the specified type are found
diff --git a/modules/core/native-system/ant-run.xml b/modules/core/native-system/ant-run.xml index 3856bcd..b1a23fd 100644 --- a/modules/core/native-system/ant-run.xml +++ b/modules/core/native-system/ant-run.xml @@ -14,7 +14,7 @@ Ant Script that builds a test jar to run SIGAR bug replication code. <property name="sigar.version" value="1.6.5.132"/>
<fileset dir="${settings.localRepository}" id="jar.fileset"> - <include name="i18nlog/i18nlog/1.0.9/i18nlog-1.0.9.jar" /> + <include name="i18nlog/i18nlog/1.0.10/i18nlog-1.0.10.jar" /> <include name="log4j/log4j/1.2.14/log4j-1.2.14.jar" /> <include name="org/testng/testng/5.1/testng-5.1-jdk15.jar" /> <include name="commons-logging/commons-logging/1.1/commons-logging-1.1.jar" /> diff --git a/modules/enterprise/agent/ant-run.xml b/modules/enterprise/agent/ant-run.xml index 16e0cd0..57ec329 100644 --- a/modules/enterprise/agent/ant-run.xml +++ b/modules/enterprise/agent/ant-run.xml @@ -34,7 +34,7 @@ Ant Script that provides ways to package the Agent.
<fileset dir="${settings.localRepository}" id="run.classpath.fileset"> <include name="javax/persistence/persistence-api/1.0/persistence-api-1.0.jar" /> - <include name="i18nlog/i18nlog/1.0.9/i18nlog-1.0.9.jar" /> + <include name="i18nlog/i18nlog/1.0.10/i18nlog-1.0.10.jar" /> <include name="log4j/log4j/1.2.14/log4j-1.2.14.jar" /> <include name="jline/jline/${jline.version}/jline-${jline.version}.jar" /> <include name="commons-logging/commons-logging/1.1.0.jboss/commons-logging-1.1.0.jboss.jar" /> diff --git a/modules/enterprise/remoting/ant-run.xml b/modules/enterprise/remoting/ant-run.xml index 3e5fb44..163a01e 100644 --- a/modules/enterprise/remoting/ant-run.xml +++ b/modules/enterprise/remoting/ant-run.xml @@ -35,7 +35,7 @@ ANT Script that provides ways to package the agent.
<!-- include our own thirdparty libraries --> <fileset dir="${settings.localRepository}" id="run.classpath.fileset"> - <include name="i18nlog/i18nlog/1.0.9/i18nlog-1.0.9.jar" /> + <include name="i18nlog/i18nlog/1.0.10/i18nlog-1.0.10.jar" /> <include name="commons-logging/commons-logging/1.1.0.jboss/commons-logging-1.1.0.jboss.jar" /> <include name="gnu-getopt/getopt/${getopt.version}/getopt-${getopt.version}.jar" /> <include name="org/opensymphony/quartz/quartz/1.6.5/quartz-1.6.5.jar" /> diff --git a/modules/enterprise/remoting/cli/pom.xml b/modules/enterprise/remoting/cli/pom.xml index 33966bd..05187c7 100644 --- a/modules/enterprise/remoting/cli/pom.xml +++ b/modules/enterprise/remoting/cli/pom.xml @@ -20,7 +20,6 @@
<properties> <scm.module.path>modules/enterprise/remoting/</scm.module.path> - <i18nlog.version>1.0.9</i18nlog.version> <log4j.version>1.2.14</log4j.version> <persistence-api.version>1.0</persistence-api.version> <hibernate-all.version>1.0.0.Alpha9</hibernate-all.version> diff --git a/modules/enterprise/remoting/cli/src/etc/build.xml b/modules/enterprise/remoting/cli/src/etc/build.xml index f7f8483..6775709 100644 --- a/modules/enterprise/remoting/cli/src/etc/build.xml +++ b/modules/enterprise/remoting/cli/src/etc/build.xml @@ -21,7 +21,7 @@
<!--location for Gnu-Getopt dependency --> <property name="i18-jar" - location="${repo}/i18nlog/i18nlog/1.0.9/i18nlog-1.0.9.jar"/> + location="${repo}/i18nlog/i18nlog/1.0.10/i18nlog-1.0.10.jar"/>
<property name="jbossws" location="C:/installers/Jboss/jbossws-native-3.1.2.GA.zip"/> @@ -33,7 +33,7 @@ <pathelement location="${runLocation}/getopt-1.0.13.jar"/> <pathelement location="${runLocation}/remoting.jar"/> <pathelement location="${runLocation}/jline-0.9.94.jar"/> - <pathelement location="${runLocation}/i18nlog-1.0.9.jar"/> + <pathelement location="${runLocation}/i18nlog-1.0.10.jar"/> <pathelement location="${runLocation}/jbossws-native-3.1.2.GA.zip"/> <!-- <pathelement path="${java.class.path}/"/> <pathelement path="${additional.path}"/> --> @@ -54,7 +54,7 @@ <!-- Copy all necessary jars to that location too --> <copy tofile="${runLocation}/jline-0.9.94.jar" file="${jline-jar}"/> <copy tofile="${runLocation}/getopt-1.0.13.jar" file="${gnu-jar}"/> - <copy tofile="${runLocation}/i18nlog-1.0.9.jar" file="${i18-jar}"/> + <copy tofile="${runLocation}/i18nlog-1.0.10.jar" file="${i18-jar}"/> <copy tofile="${runLocation}/jbossws-native-3.1.2.GA.zip" file="${jbossws}"/> <copy tofile="${runLocation}/toRun.txt" file="${basedir}/toRun.txt"/> <!-- <copy todir="${runLocation}"> @@ -83,4 +83,4 @@
</target>
-</project> \ No newline at end of file +</project> diff --git a/modules/enterprise/remoting/client-api/pom.xml b/modules/enterprise/remoting/client-api/pom.xml index 605267f..e86ef41 100644 --- a/modules/enterprise/remoting/client-api/pom.xml +++ b/modules/enterprise/remoting/client-api/pom.xml @@ -21,7 +21,6 @@ <properties> <scm.module.path>modules/enterprise/remoting/</scm.module.path>
- <i18nlog.version>1.0.9</i18nlog.version> <log4j.version>1.2.14</log4j.version> <persistence-api.version>1.0</persistence-api.version> <hibernate-all.version>1.0.0.Alpha9</hibernate-all.version> diff --git a/modules/enterprise/server/plugins/perspectives/policy/perspective/pom.xml b/modules/enterprise/server/plugins/perspectives/policy/perspective/pom.xml index 2039f89..3b74a61 100644 --- a/modules/enterprise/server/plugins/perspectives/policy/perspective/pom.xml +++ b/modules/enterprise/server/plugins/perspectives/policy/perspective/pom.xml @@ -38,31 +38,7 @@ <version>${project.version}</version> <scope>provided</scope> <!-- provided by the server/plugin-container --> </dependency> - - - <!-- uncomment the one of the three logging systems your plugin uses: log4j, commons-logging or i18nlog --> - <!-- all three are provided to your plugin by the server/plugin-container --> - <!-- - <dependency> <groupId>log4j</groupId> <artifactId>log4j</artifactId> <version>1.2.14</version> - <scope>provided</scope> </dependency> - --> - - <!-- - <dependency> <groupId>commons-logging</groupId> <artifactId>commons-logging</artifactId> <version>1.1</version> - <scope>provided</scope> </dependency> - --> - - <!-- - <dependency> <groupId>i18nlog</groupId> <artifactId>i18nlog</artifactId> <version>1.0.9</version> </dependency> - --> - - <!-- Define any third-party dependencies your plugin has here. --> - <!-- - <dependency> <groupId>group-id-of-dependency-goes-here</groupId> - <artifactId>artifact-id-of-dependency-goes-here</artifactId> <version>version-of-dependency-goes-here</version> - </dependency> - --> - + </dependencies>
<build> @@ -154,3 +130,4 @@ </profiles>
</project> + diff --git a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/util/ManagedComponentUtils.java b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/util/ManagedComponentUtils.java index 177e3bb..b928584 100644 --- a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/util/ManagedComponentUtils.java +++ b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/util/ManagedComponentUtils.java @@ -1,6 +1,6 @@ /* * Jopr Management Platform - * Copyright (C) 2005-2009 Red Hat, Inc. + * Copyright (C) 2005-2010 Red Hat, Inc. * All rights reserved. * * This program is free software; you can redistribute it and/or modify @@ -39,6 +39,7 @@ import org.jboss.managed.api.annotation.ViewUse; import org.jboss.metatype.api.types.MetaType; import org.jboss.metatype.api.values.EnumValue; import org.jboss.metatype.api.values.SimpleValue; +import org.jetbrains.annotations.Nullable;
/** * A collection of utility methods for working with Profile Service {@link ManagedComponent}s. @@ -49,6 +50,7 @@ public class ManagedComponentUtils { private static final Comparator<ComponentType> COMPONENT_TYPE_COMPARATOR = new ComponentTypeComparator();
+ @Nullable public static ManagedComponent getManagedComponent(ManagementView managementView, ComponentType componentType, String componentName) { @@ -61,22 +63,26 @@ public class ManagedComponentUtils return null; }
+ @Nullable public static ManagedComponent getSingletonManagedComponent(ManagementView managementView, ComponentType componentType) { Set<ManagedComponent> components = getManagedComponents(managementView, componentType); - if (components.size() != 1) + if (components.size() > 1) + { throw new IllegalStateException("Found more than one component of type " + componentType + ": " + components); + } @SuppressWarnings({"UnnecessaryLocalVariable"}) - ManagedComponent component = components.iterator().next(); + ManagedComponent component = (components.size() == 1) ? components.iterator().next() : null; return component; }
public static Serializable getSimplePropertyValue(ManagedComponent component, String propertyName) throws PropertyNotFoundException { ManagedProperty property = component.getProperty(propertyName); - if (property == null) { + if (property == null) + { throw new PropertyNotFoundException("Property named '" + propertyName + "' not found for ManagedComponent [" + component + "]."); } diff --git a/pom.xml b/pom.xml index 95b0dc6..4743b2c 100644 --- a/pom.xml +++ b/pom.xml @@ -69,6 +69,7 @@ <hibernate3.version>3.2.r14201-2</hibernate3.version> <hibernate-annotations.version>3.2.1.GA</hibernate-annotations.version> <hibernate-entitymanager.version>3.2.1.GA</hibernate-entitymanager.version> + <i18nlog.version>1.0.10</i18nlog.version> <jaxb-api.version>2.1</jaxb-api.version> <jaxb-impl.version>2.1.6</jaxb-impl.version> <jsf-api.version>1.2_14</jsf-api.version> @@ -411,7 +412,7 @@ <dependency> <groupId>i18nlog</groupId> <artifactId>i18nlog</artifactId> - <version>1.0.10</version> + <version>${i18nlog.version}</version> </dependency>
<!-- for the JAXB annotations -->
commit 774ff1338b154d6771e46d0554811bb09af74e63 Author: Ian Springer ian.springer@redhat.com Date: Fri Jul 2 15:19:28 2010 -0400
oops, fix typo
diff --git a/release.sh b/release.sh index 544deae..6cb69da 100644 --- a/release.sh +++ b/release.sh @@ -171,7 +171,7 @@ fi PROJECT_GIT_URL="ssh://${GIT_USERNAME}@git.fedorahosted.org/git/rhq/rhq.git"
MAVEN_ARGS="--settings $MAVEN_SETTINGS_FILE --batch-mode --errors -Penterprise,dist,release" -if [ "$MODE" = "production" ]; then +if [ "$MODE" = "test" ]; then MAVEN_ARGS="$MAVEN_ARGS -Dmaven.test.skip=true" fi if [ "$RELEASE_TYPE" = "enterprise" ]; then
commit 45f823eebd3b01e6475790b6d009aa587c366883 Author: Ian Springer ian.springer@redhat.com Date: Fri Jul 2 15:18:46 2010 -0400
various tweaks to prepare for RHQ 3.0 production release build
diff --git a/release.sh b/release.sh index da56c27..544deae 100644 --- a/release.sh +++ b/release.sh @@ -171,6 +171,9 @@ fi PROJECT_GIT_URL="ssh://${GIT_USERNAME}@git.fedorahosted.org/git/rhq/rhq.git"
MAVEN_ARGS="--settings $MAVEN_SETTINGS_FILE --batch-mode --errors -Penterprise,dist,release" +if [ "$MODE" = "production" ]; then + MAVEN_ARGS="$MAVEN_ARGS -Dmaven.test.skip=true" +fi if [ "$RELEASE_TYPE" = "enterprise" ]; then MAVEN_ARGS="$MAVEN_ARGS -Dexclude-webdav -Djava5.home=$JAVA5_HOME/jre" fi @@ -181,12 +184,12 @@ if [ -n "$RELEASE_ADDITIONAL_MAVEN_ARGS" ]; then MAVEN_ARGS="$MAVEN_ARGS $RELEASE_ADDITIONAL_MAVEN_ARGS" fi if [ -z "$MAVEN_LOCAL_REPO_PURGE_INTERVAL_HOURS" ]; then - MAVEN_LOCAL_REPO_PURGE_INTERVAL_HOURS="12" + MAVEN_LOCAL_REPO_PURGE_INTERVAL_HOURS="6" fi
if [ "$MODE" = "production" ]; then MAVEN_RELEASE_PERFORM_GOAL="deploy" -else +else MAVEN_RELEASE_PERFORM_GOAL="install" fi
@@ -240,14 +243,20 @@ echo
# Clean the Maven local repo if it hasn't been purged recently. -# TODO: Uncomment this. -#if [ -f "$MAVEN_LOCAL_REPO_DIR" ]; then -# OUTPUT=`find "$MAVEN_LOCAL_REPO_DIR" -maxdepth 0 -mtime $MAVEN_LOCAL_REPO_PURGE_INTERVAL_HOURS` -# if [ -n "$OUTPUT" ]; then -# echo "MAVEN_LOCAL_REPO_DIR ($MAVEN_LOCAL_REPO_DIR) has existed for more than $MAVEN_LOCAL_REPO_PURGE_INTERVAL_HOURS hours - purging it for a clean-clean build..." -# rm -rf "$MAVEN_LOCAL_REPO_DIR" -# fi -#fi + +if [ -f "$MAVEN_LOCAL_REPO_DIR" ]; then + if [ "$MODE" = "production" ]; then + echo "Purging MAVEN_LOCAL_REPO_DIR ($MAVEN_LOCAL_REPO_DIR) since this is a production build..." + rm -rf "$MAVEN_LOCAL_REPO_DIR" + else + OUTPUT=`find "$MAVEN_LOCAL_REPO_DIR" -maxdepth 0 -mtime $MAVEN_LOCAL_REPO_PURGE_INTERVAL_HOURS` + if [ -n "$OUTPUT" ]; then + echo "MAVEN_LOCAL_REPO_DIR ($MAVEN_LOCAL_REPO_DIR) has existed for more than $MAVEN_LOCAL_REPO_PURGE_INTERVAL_HOURS hours - purging it for a clean-clean build..." + rm -rf "$MAVEN_LOCAL_REPO_DIR" + fi + fi + +fi mkdir -p "$MAVEN_LOCAL_REPO_DIR"
@@ -367,7 +376,9 @@ if [ -n "$EXISTING_REMOTE_TAG" ] && [ "$MODE" = "test" ]; then [ "$?" -ne 0 ] && abort "Failed to delete remote tag ($RELEASE_TAG)." fi
+ # See if the specified tag already exists locally - if so, delete it (even if in production mode). + EXISTING_LOCAL_TAG=`git tag -l "$RELEASE_TAG"` if [ -n "$EXISTING_LOCAL_TAG" ]; then echo "A local tag named $RELEASE_TAG already exists - deleting it..." @@ -386,6 +397,7 @@ echo "Test build succeeded!"
# Clean up the snapshot jars produced by the test build from module target dirs. + echo "Cleaning up snapshot jars produced by test build from module target dirs..." mvn clean $MAVEN_ARGS [ "$?" -ne 0 ] && abort "Failed to cleanup snbapshot jars produced by test build from module target dirs. Please see above Maven output for details, fix any issues, then try again."
commit fac71cddc3bd3965cfd4396a6f3c6fb5a6074048 Author: Joseph Marques joseph@redhat.com Date: Fri Jul 2 11:41:49 2010 -0400
BZ-610854: filter the aggregate metric counts by the appropriate entity context
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementChartsManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementChartsManagerBean.java index 704042d..15b5267 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementChartsManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementChartsManagerBean.java @@ -453,6 +453,14 @@ public class MeasurementChartsManagerBean implements MeasurementChartsManagerLoc for (int definitionId : measurementDefinitionIds) {
MeasurementScheduleCriteria criteria = new MeasurementScheduleCriteria(); + if (context.category == EntityContext.Category.Resource) { + criteria.addFilterResourceId(context.resourceId); + } else if (context.category == EntityContext.Category.ResourceGroup) { + criteria.addFilterResourceGroupId(context.groupId); + } else if (context.category == EntityContext.Category.AutoGroup) { + criteria.addFilterAutoGroupParentResourceId(context.parentResourceId); + criteria.addFilterAutoGroupResourceTypeId(context.resourceTypeId); + } criteria.addFilterDefinitionIds(definitionId); PageList<MeasurementSchedule> theSchedules = scheduleManager.findSchedulesByCriteria(subject, criteria); int totalScheduleCount = theSchedules.getTotalSize();
commit 9bd087c2b141aff52b67917a604c6075ea76fb39 Author: Joseph Marques joseph@redhat.com Date: Thu Jul 1 13:49:18 2010 -0400
BZ-610163: add more resilience/tolerance to generated sortable tables for when JSF hiccups
diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/common/sorting/SortableColumnHeaderRenderer.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/common/sorting/SortableColumnHeaderRenderer.java index 1ed3d05..1437ae2 100644 --- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/common/sorting/SortableColumnHeaderRenderer.java +++ b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/common/sorting/SortableColumnHeaderRenderer.java @@ -26,7 +26,6 @@ import javax.faces.component.UIData; import javax.faces.component.UIGraphic; import javax.faces.component.UIOutput; import javax.faces.component.html.HtmlOutputLabel; -import javax.faces.context.FacesContext; import javax.faces.context.ResponseWriter;
import com.sun.faces.renderkit.html_basic.CommandLinkRenderer; @@ -45,26 +44,6 @@ public class SortableColumnHeaderRenderer extends CommandLinkRenderer { super(); }
- @Override - public void decode(FacesContext context, UIComponent component) { - super.decode(context, component); - } - - @Override - public void encodeBegin(FacesContext context, UIComponent component) throws IOException { - super.encodeBegin(context, component); - } - - @Override - public void encodeEnd(FacesContext context, UIComponent component) throws IOException { - super.encodeEnd(context, component); - } - - @Override - public void encodeChildren(FacesContext context, UIComponent component) throws IOException { - super.encodeChildren(context, component); - } - /* easy trick to override and put addition attributes in the writer */ @Override protected void writeValue(UIComponent component, ResponseWriter writer) throws IOException { @@ -87,14 +66,12 @@ public class SortableColumnHeaderRenderer extends CommandLinkRenderer { children.remove(i); }
- if (children.size() > i && children.get(i) instanceof UIOutput) { + if (children.get(i) instanceof UIOutput) { UIOutput output = (UIOutput) children.get(i); String value = output.getValue().toString(); - if (value.length() > 0) { - if (Character.isDigit(value.charAt(0))) { - // also remove sort index labels, they will be reconstructed below - children.remove(i); - } + if (isNumber(value)) { + // also remove sort index labels ('1', '2', '3') since they will be reconstructed below + children.remove(i); } } } @@ -140,17 +117,41 @@ public class SortableColumnHeaderRenderer extends CommandLinkRenderer { super.writeValue(component, writer); }
+ private boolean isNumber(String value) { + if (value == null) { + return false; + } + + value = value.trim(); + if (value.equals("")) { + return false; + } + + for (char c : value.toCharArray()) { + if (Character.isDigit(c) == false) { + return false; + } + } + + return true; + } + private PageControl getPageControl(UIComponent component) { - UIData enclosingTable = getEnclosingUIData(component); + try { + UIData enclosingTable = getEnclosingUIData(component);
- UIComponent facet = enclosingTable.getFacet("PageControlView"); - String viewName = facet.getId(); + UIComponent facet = enclosingTable.getFacet("PageControlView"); + String viewName = facet.getId();
- PageControlView currentView = PageControlView.valueOf(viewName); - WebUser user = EnterpriseFacesContextUtility.getWebUser(); - WebUserPreferences preferences = user.getWebPreferences(); + PageControlView currentView = PageControlView.valueOf(viewName); + WebUser user = EnterpriseFacesContextUtility.getWebUser(); + WebUserPreferences preferences = user.getWebPreferences();
- return preferences.getPageControl(currentView); + return preferences.getPageControl(currentView); + } catch (Throwable t) { + // be tolerant of JSF + return new PageControl(0, 15); // return something reasonable + } }
private UIData getEnclosingUIData(UIComponent component) {
commit 24133e9ab787bc2cd88bc8b8d13afadd3d4c2f3d Author: Jay Shaughnessy jshaughn@redhat.com Date: Fri Jul 2 10:59:32 2010 -0400
LT commit
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/admin/config/GeneralPropertiesConfigForm.jsp b/modules/enterprise/gui/portal-war/src/main/webapp/admin/config/GeneralPropertiesConfigForm.jsp index 30df9ef..45526f7 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/admin/config/GeneralPropertiesConfigForm.jsp +++ b/modules/enterprise/gui/portal-war/src/main/webapp/admin/config/GeneralPropertiesConfigForm.jsp @@ -1,104 +1,104 @@ -<%@ page language="java" %> -<%@ page errorPage="/common/Error.jsp" %> - -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="http://jakarta.apache.org/struts/tags-html-el" prefix="html" %> -<%@ taglib uri="http://jakarta.apache.org/struts/tags-tiles" prefix="tiles" %> -<%@ taglib uri="http://jakarta.apache.org/struts/tags-logic" prefix="logic" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="/WEB-INF/tld/hq.tld" prefix="hq" %> - -<script src="<html:rewrite page="/js/"/>functions.js" type="text/javascript"></script> -<link rel=stylesheet href="<html:rewrite page="/css/"/>win.css" type="text/css"> - -<hq:constant - classname="org.rhq.enterprise.gui.legacy.Constants" - symbol="MINUTES_LABEL" var="CONST_MINUTES" /> -<hq:constant - classname="org.rhq.enterprise.gui.legacy.Constants" - symbol="HOURS_LABEL" var="CONST_HOURS" /> -<hq:constant - classname="org.rhq.enterprise.gui.legacy.Constants" - symbol="DAYS_LABEL" var="CONST_DAYS" /> - -<!-- BASE SERVER CONFIG TITLE --> -<tiles:insert definition=".header.tab"> - <tiles:put name="tabKey" value="admin.settings.BaseConfigTab"/> -</tiles:insert> -<!-- / --> - -<!-- BASE SERVER CONFIG CONTENTS --> -<table width="100%" cellpadding="0" cellspacing="0" border="0"> - <tr> - <td width="45%" class="BlockLabel"><fmt:message key="admin.settings.BaseURL"/></td> - <td width="55%" class="BlockContent"><html:text size="31" property="baseUrl" /></td> - </tr> - <tr> - <td class="BlockLabel"><fmt:message key="admin.settings.AgentMaxQuietTimeAllowed"/></td> - <td class="BlockContent"> - <table width="100%" cellpadding="0" cellspacing="0" border="0"> - <tr> -<logic:messagesPresent property="agentMaxQuietTimeAllowedVal"> - <td class="ErrorField"> - <html:text size="2" property="agentMaxQuietTimeAllowedVal" /> - </td> - <td class="ErrorField" width="100%"> - <html:select property="agentMaxQuietTimeAllowed"> - <html:option value="${CONST_MINUTES}"><fmt:message key="admin.settings.Minutes"/></html:option> - </html:select> - </td> -</logic:messagesPresent> -<logic:messagesNotPresent property="agentMaxQuietTimeAllowedVal"> - <td class="BlockContent"> - <html:text size="2" property="agentMaxQuietTimeAllowedVal" /> - </td> - <td class="BlockContent" width="100%"> - <html:select property="agentMaxQuietTimeAllowed"> - <html:option value="${CONST_MINUTES}"><fmt:message key="admin.settings.Minutes"/></html:option> - </html:select> - </td> -</logic:messagesNotPresent> - </tr> -<logic:messagesPresent property="agentMaxQuietTimeAllowedVal"> - <tr> - <td class="ErrorField" colspan="2"> - <span class="ErrorFieldContent"> <html:errors property="agentMaxQuietTimeAllowedVal"/></span> - </td> - </tr> -</logic:messagesPresent> -<logic:messagesNotPresent property="agentMaxQuietTimeAllowedVal"> - <tr> - <td class="BlockContent" colspan="2"> - </td> - </tr> -</logic:messagesNotPresent> - </table> - </td> - </tr> - <tr> - <td class="BlockLabel"><fmt:message key="admin.settings.EnableAgentAutoUpdate"/></td> - <td class="BlockContent"> - <table cellpadding="0" cellspacing="4" border="0"> - <tr> - <td align="left"><html:radio property="enableAgentAutoUpdate" value="true"/><fmt:message key="yesno.true"/></td> - <td align="left"><html:radio property="enableAgentAutoUpdate" value="false"/><fmt:message key="yesno.false"/></td> - </tr> - </table> - </td> - </tr> - -<hq:authorization permission="superuser"> - <tr> - <td class="BlockLabel"><fmt:message key="admin.settings.EnableDebugMode"/></td> - <td class="BlockContent"> - <table cellpadding="0" cellspacing="4" border="0"> - <tr> - <td align="left"><html:radio property="enableDebugMode" value="true"/><fmt:message key="yesno.true"/></td> - <td align="left"><html:radio property="enableDebugMode" value="false"/><fmt:message key="yesno.false"/></td> - </tr> - </table> - </td> - </tr> -</hq:authorization> - -</table> +<%@ page language="java" %> +<%@ page errorPage="/common/Error.jsp" %> + +<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> +<%@ taglib uri="http://jakarta.apache.org/struts/tags-html-el" prefix="html" %> +<%@ taglib uri="http://jakarta.apache.org/struts/tags-tiles" prefix="tiles" %> +<%@ taglib uri="http://jakarta.apache.org/struts/tags-logic" prefix="logic" %> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/tld/hq.tld" prefix="hq" %> + +<script src="<html:rewrite page="/js/"/>functions.js" type="text/javascript"></script> +<link rel=stylesheet href="<html:rewrite page="/css/"/>win.css" type="text/css"> + +<hq:constant + classname="org.rhq.enterprise.gui.legacy.Constants" + symbol="MINUTES_LABEL" var="CONST_MINUTES" /> +<hq:constant + classname="org.rhq.enterprise.gui.legacy.Constants" + symbol="HOURS_LABEL" var="CONST_HOURS" /> +<hq:constant + classname="org.rhq.enterprise.gui.legacy.Constants" + symbol="DAYS_LABEL" var="CONST_DAYS" /> + +<!-- BASE SERVER CONFIG TITLE --> +<tiles:insert definition=".header.tab"> + <tiles:put name="tabKey" value="admin.settings.BaseConfigTab"/> +</tiles:insert> +<!-- / --> + +<!-- BASE SERVER CONFIG CONTENTS --> +<table width="100%" cellpadding="0" cellspacing="0" border="0"> + <tr> + <td width="45%" class="BlockLabel"><fmt:message key="admin.settings.BaseURL"/></td> + <td width="55%" class="BlockContent"><html:text size="31" property="baseUrl" /></td> + </tr> + <tr> + <td class="BlockLabel"><fmt:message key="admin.settings.AgentMaxQuietTimeAllowed"/></td> + <td class="BlockContent"> + <table width="100%" cellpadding="0" cellspacing="0" border="0"> + <tr> +<logic:messagesPresent property="agentMaxQuietTimeAllowedVal"> + <td class="ErrorField"> + <html:text size="2" property="agentMaxQuietTimeAllowedVal" /> + </td> + <td class="ErrorField" width="100%"> + <html:select property="agentMaxQuietTimeAllowed"> + <html:option value="${CONST_MINUTES}"><fmt:message key="admin.settings.Minutes"/></html:option> + </html:select> + </td> +</logic:messagesPresent> +<logic:messagesNotPresent property="agentMaxQuietTimeAllowedVal"> + <td class="BlockContent"> + <html:text size="2" property="agentMaxQuietTimeAllowedVal" /> + </td> + <td class="BlockContent" width="100%"> + <html:select property="agentMaxQuietTimeAllowed"> + <html:option value="${CONST_MINUTES}"><fmt:message key="admin.settings.Minutes"/></html:option> + </html:select> + </td> +</logic:messagesNotPresent> + </tr> +<logic:messagesPresent property="agentMaxQuietTimeAllowedVal"> + <tr> + <td class="ErrorField" colspan="2"> + <span class="ErrorFieldContent"> <html:errors property="agentMaxQuietTimeAllowedVal"/></span> + </td> + </tr> +</logic:messagesPresent> +<logic:messagesNotPresent property="agentMaxQuietTimeAllowedVal"> + <tr> + <td class="BlockContent" colspan="2"> + </td> + </tr> +</logic:messagesNotPresent> + </table> + </td> + </tr> + <tr> + <td class="BlockLabel"><fmt:message key="admin.settings.EnableAgentAutoUpdate"/></td> + <td class="BlockContent"> + <table cellpadding="0" cellspacing="4" border="0"> + <tr> + <td align="left"><html:radio property="enableAgentAutoUpdate" value="true"/><fmt:message key="yesno.true"/></td> + <td align="left"><html:radio property="enableAgentAutoUpdate" value="false"/><fmt:message key="yesno.false"/></td> + </tr> + </table> + </td> + </tr> + +<hq:authorization permission="superuser"> + <tr> + <td class="BlockLabel"><fmt:message key="admin.settings.EnableDebugMode"/></td> + <td class="BlockContent"> + <table cellpadding="0" cellspacing="4" border="0"> + <tr> + <td align="left"><html:radio property="enableDebugMode" value="true"/><fmt:message key="yesno.true"/></td> + <td align="left"><html:radio property="enableDebugMode" value="false"/><fmt:message key="yesno.false"/></td> + </tr> + </table> + </td> + </tr> +</hq:authorization> + +</table>
commit 5d78444b46b3f07276c8ffd43a9675bdd35060ed Merge: 48c686d... 7112476... Author: Jay Shaughnessy jshaughn@redhat.com Date: Fri Jul 2 10:58:51 2010 -0400
Merge branch 'release-3.0.0' into master-jay
Conflicts: modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml modules/enterprise/server/plugins/alert-microblog/src/main/java/org/rhq/enterprise/server/plugins/alertMicroblog/MicroblogSender.java modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ManagedComponentComponent.java
diff --cc modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml index 4d9ef75,7f8f9da..68cf92c --- a/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml +++ b/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml @@@ -3002,75 -3002,15 +3002,77 @@@ </schemaSpec>
<schemaSpec version="2.88"> - + <!-- the customizable dashboard storage system --> + + <schema-createSequence name="RHQ_DASHBOARD_ID_SEQ" initial="10001"/> + <schema-directSQL> + <statement desc="Creating table RHQ_DASHBOARD"> + CREATE TABLE RHQ_DASHBOARD ( ID INTEGER PRIMARY KEY ) + </statement> + </schema-directSQL> + <schema-alterColumn table="RHQ_DASHBOARD" column="ID" nullable="FALSE"/> - <schema-addColumn table="RHQ_DASHBOARD" column="NAME" columnType="VARCHAR2" precision="200"/> ++ <schema-addColumn table="RHQ_DASHBOARD" column="NAME" columnType="VARCHAR2" precision="200"/> + <schema-alterColumn table="RHQ_DASHBOARD" column="NAME" nullable="FALSE"/> - <schema-addColumn table="RHQ_DASHBOARD" column="SUBJECT_ID" columnType="INTEGER"/> - <schema-addColumn table="RHQ_DASHBOARD" column="SHARED" columnType="BOOLEAN"/> ++ <schema-addColumn table="RHQ_DASHBOARD" column="SUBJECT_ID" columnType="INTEGER"/> ++ <schema-addColumn table="RHQ_DASHBOARD" column="SHARED" columnType="BOOLEAN"/> + <schema-alterColumn table="RHQ_DASHBOARD" column="SHARED" nullable="FALSE"/> - <schema-addColumn table="RHQ_DASHBOARD" column="CONFIGURATION_ID" columnType="INTEGER"/> ++ <schema-addColumn table="RHQ_DASHBOARD" column="CONFIGURATION_ID" columnType="INTEGER"/> + <schema-directSQL> + <statement> + ALTER TABLE RHQ_DASHBOARD - ADD CONSTRAINT RHQ_DASH_CFG_ID_FK ++ ADD CONSTRAINT RHQ_DASHBOARD_CONFIG_ID_FK + FOREIGN KEY ( CONFIGURATION_ID ) + REFERENCES RHQ_CONFIG ( ID ) + </statement> + </schema-directSQL> + - + <schema-createSequence name="RHQ_DASHBOARD_PORTLET_ID_SEQ" initial="10001"/> + <schema-directSQL> + <statement desc="Creating table RHQ_DASHBOARD_PORTLET"> + CREATE TABLE RHQ_DASHBOARD_PORTLET ( ID INTEGER PRIMARY KEY ) + </statement> + </schema-directSQL> + <schema-alterColumn table="RHQ_DASHBOARD_PORTLET" column="ID" nullable="FALSE"/> + - <schema-addColumn table="RHQ_DASHBOARD_PORTLET" column="NAME" columnType="VARCHAR2" precision="200"/> ++ <schema-addColumn table="RHQ_DASHBOARD_PORTLET" column="NAME" columnType="VARCHAR2" precision="200"/> + <schema-alterColumn table="RHQ_DASHBOARD_PORTLET" column="NAME" nullable="FALSE"/> - <schema-addColumn table="RHQ_DASHBOARD_PORTLET" column="PORTLET_KEY" columnType="VARCHAR2" - precision="200"/> ++ <schema-addColumn table="RHQ_DASHBOARD_PORTLET" column="PORTLET_KEY" columnType="VARCHAR2" ++ precision="200"/> + <schema-alterColumn table="RHQ_DASHBOARD_PORTLET" column="PORTLET_KEY" nullable="FALSE"/> - - <schema-addColumn table="RHQ_DASHBOARD_PORTLET" column="COL" columnType="INTEGER"/> - <schema-addColumn table="RHQ_DASHBOARD_PORTLET" column="COL_INDEX" columnType="INTEGER"/> - <schema-addColumn table="RHQ_DASHBOARD_PORTLET" column="HEIGHT" columnType="INTEGER"/> - - <schema-addColumn table="RHQ_DASHBOARD_PORTLET" column="CONFIGURATION_ID" columnType="INTEGER"/> ++ <schema-addColumn table="RHQ_DASHBOARD_PORTLET" column="COL" columnType="INTEGER"/> ++ <schema-addColumn table="RHQ_DASHBOARD_PORTLET" column="COL_INDEX" columnType="INTEGER"/> ++ <schema-addColumn table="RHQ_DASHBOARD_PORTLET" column="HEIGHT" columnType="INTEGER"/> ++ <schema-addColumn table="RHQ_DASHBOARD_PORTLET" column="CONFIGURATION_ID" columnType="INTEGER"/> ++ <schema-addColumn table="RHQ_DASHBOARD_PORTLET" column="DASHBOARD_ID" columnType="INTEGER"/> ++ <schema-alterColumn table="RHQ_DASHBOARD_PORTLET" column="DASHBOARD_ID" nullable="FALSE"/> + <schema-directSQL> + <statement> + ALTER TABLE RHQ_DASHBOARD_PORTLET - ADD CONSTRAINT RHQ_DASH_PT_CFG_ID_FK ++ ADD CONSTRAINT RHQ_DP_CONFIGURATION_ID_FK + FOREIGN KEY ( CONFIGURATION_ID ) + REFERENCES RHQ_CONFIG ( ID ) + </statement> + </schema-directSQL> - - - <schema-addColumn table="RHQ_DASHBOARD_PORTLET" column="DASHBOARD_ID" columnType="INTEGER"/> - <schema-alterColumn table="RHQ_DASHBOARD_PORTLET" column="DASHBOARD_ID" nullable="FALSE"/> + <schema-directSQL> + <statement> + ALTER TABLE RHQ_DASHBOARD_PORTLET - ADD CONSTRAINT RHQ_DASH_PT_DASH_ID_FK ++ ADD CONSTRAINT RHQ_DP_DASHBOARD_ID_FK + FOREIGN KEY ( DASHBOARD_ID ) + REFERENCES RHQ_DASHBOARD ( ID ) + </statement> - </schema-directSQL> - ++ </schema-directSQL> + </schemaSpec> + - ++ <schemaSpec version="2.89"> + <schema-directSQL> + <statement desc="Add end time index on call time data to speed up purges"> + CREATE INDEX RHQ_CT_DA_VA_END_TIM_IDX ON RHQ_CALLTIME_DATA_VALUE (end_time) + </statement> + <statement desc="Add index on measurement definition numeric type"> + CREATE INDEX RHQ_METRIC_DEF_NT_IDX ON RHQ_MEASUREMENT_DEF (numeric_type) + </statement> + </schema-directSQL> + </schemaSpec> </dbupgrade> </target> </project>
commit 48c686df1ec30c8fe8a47397082107e2bfcc6d46 Author: Jay Shaughnessy jshaughn@redhat.com Date: Fri Jul 2 10:31:14 2010 -0400
LT commit
diff --git a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ManagedComponentComponent.java b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ManagedComponentComponent.java index aefb351..e4511fd 100644 --- a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ManagedComponentComponent.java +++ b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ManagedComponentComponent.java @@ -1,422 +1,422 @@ -/* -* Jopr Management Platform -* Copyright (C) 2005-2009 Red Hat, Inc. -* All rights reserved. -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License, version 2, as -* published by the Free Software Foundation, and/or the GNU Lesser -* General Public License, version 2.1, also as published by the Free -* Software Foundation. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License and the GNU Lesser General Public License -* for more details. -* -* You should have received a copy of the GNU General Public License -* and the GNU Lesser General Public License along with this program; -* if not, write to the Free Software Foundation, Inc., -* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ -package org.rhq.plugins.jbossas5; - -import java.lang.reflect.Array; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.jboss.deployers.spi.management.ManagementView; -import org.jboss.deployers.spi.management.deploy.DeploymentManager; -import org.jboss.deployers.spi.management.deploy.DeploymentProgress; -import org.jboss.deployers.spi.management.deploy.DeploymentStatus; -import org.jboss.managed.api.ComponentType; -import org.jboss.managed.api.ManagedComponent; -import org.jboss.managed.api.ManagedDeployment; -import org.jboss.managed.api.ManagedOperation; -import org.jboss.managed.api.ManagedProperty; -import org.jboss.managed.api.RunState; -import org.jboss.metatype.api.values.ArrayValue; -import org.jboss.metatype.api.values.CollectionValue; -import org.jboss.metatype.api.values.CompositeValue; -import org.jboss.metatype.api.values.EnumValue; -import org.jboss.metatype.api.values.MetaValue; -import org.jboss.metatype.api.values.SimpleValue; -import org.jboss.remoting.CannotConnectException; - -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -import org.rhq.core.domain.configuration.Configuration; -import org.rhq.core.domain.configuration.PropertySimple; -import org.rhq.core.domain.configuration.ConfigurationUpdateStatus; -import org.rhq.core.domain.configuration.definition.ConfigurationDefinition; -import org.rhq.core.domain.measurement.AvailabilityType; -import org.rhq.core.domain.measurement.DataType; -import org.rhq.core.domain.measurement.MeasurementDataNumeric; -import org.rhq.core.domain.measurement.MeasurementDataTrait; -import org.rhq.core.domain.measurement.MeasurementReport; -import org.rhq.core.domain.measurement.MeasurementScheduleRequest; -import org.rhq.core.domain.operation.OperationDefinition; -import org.rhq.core.domain.resource.ResourceType; -import org.rhq.core.pluginapi.configuration.ConfigurationFacet; -import org.rhq.core.pluginapi.configuration.ConfigurationUpdateReport; -import org.rhq.core.pluginapi.inventory.DeleteResourceFacet; -import org.rhq.core.pluginapi.inventory.ResourceContext; -import org.rhq.core.pluginapi.measurement.MeasurementFacet; -import org.rhq.core.pluginapi.operation.OperationFacet; -import org.rhq.core.pluginapi.operation.OperationResult; -import org.rhq.core.util.exception.ThrowableUtil; -import org.rhq.plugins.jbossas5.util.ConversionUtils; -import org.rhq.plugins.jbossas5.util.DeploymentUtils; -import org.rhq.plugins.jbossas5.util.ManagedComponentUtils; -import org.rhq.plugins.jbossas5.util.ResourceTypeUtils; -import org.rhq.plugins.jbossas5.util.ResourceComponentUtils; -import org.rhq.plugins.jbossas5.util.DebugUtils; - -/** - * Service ResourceComponent for all {@link ManagedComponent}s in a Profile. - * - * @author Ian Springer - * @author Jason Dobies - * @author Mark Spritzler - */ -public class ManagedComponentComponent extends AbstractManagedComponent implements ConfigurationFacet, - DeleteResourceFacet, OperationFacet, MeasurementFacet { - public static interface Config { - String COMPONENT_TYPE = "componentType"; - String COMPONENT_SUBTYPE = "componentSubtype"; - String COMPONENT_NAME = "componentName"; - String TEMPLATE_NAME = "templateName"; - String COMPONENT_NAME_PROPERTY = "componentNameProperty"; - } - - protected static final char PREFIX_DELIMITER = '|'; - - private final Log log = LogFactory.getLog(this.getClass()); - - private String componentName; - private ComponentType componentType; - - // ResourceComponent Implementation -------------------------------------------- - - public AvailabilityType getAvailability() { - RunState runState; - try { - runState = getManagedComponent().getRunState(); - } catch (CannotConnectException e) { - return AvailabilityType.DOWN; - } - return (runState == RunState.RUNNING) ? AvailabilityType.UP : AvailabilityType.DOWN; - } - - public void start(ResourceContext<ProfileServiceComponent> resourceContext) throws Exception { - super.start(resourceContext); - this.componentType = ConversionUtils.getComponentType(getResourceContext().getResourceType()); - Configuration pluginConfig = resourceContext.getPluginConfiguration(); - this.componentName = pluginConfig.getSimple(Config.COMPONENT_NAME).getStringValue(); - log.trace("Started ResourceComponent for " + getResourceDescription() + ", managing " + this.componentType - + " component '" + this.componentName + "'."); - } - - public void stop() { - return; - } - - // ConfigurationComponent Implementation -------------------------------------------- - - public Configuration loadResourceConfiguration() - { - Configuration resourceConfig; - try - { - Map<String, ManagedProperty> managedProperties = getManagedComponent().getProperties(); - Map<String, PropertySimple> customProps = - ResourceComponentUtils.getCustomProperties(getResourceContext().getPluginConfiguration()); - if (this.log.isDebugEnabled()) this.log.debug("*** AFTER LOAD:\n" - + DebugUtils.convertPropertiesToString(managedProperties)); - resourceConfig = ConversionUtils.convertManagedObjectToConfiguration(managedProperties, - customProps, getResourceContext().getResourceType()); - } - catch (Exception e) - { - RunState runState = getManagedComponent().getRunState(); - if (runState == RunState.RUNNING) { - this.log.error("Failed to load configuration for " + getResourceDescription() + ".", e); - } else { - this.log.debug("Failed to load configuration for " + getResourceDescription() - + ", but managed component is not in the RUNNING state.", e); - } - throw new RuntimeException(ThrowableUtil.getAllMessages(e)); - } - return resourceConfig; - } - - public void updateResourceConfiguration(ConfigurationUpdateReport configurationUpdateReport) - { - Configuration resourceConfig = configurationUpdateReport.getConfiguration(); - Configuration pluginConfig = getResourceContext().getPluginConfiguration(); - try - { - ManagedComponent managedComponent = getManagedComponent(); - Map<String, ManagedProperty> managedProperties = managedComponent.getProperties(); - Map<String, PropertySimple> customProps = ResourceComponentUtils.getCustomProperties(pluginConfig); - if (this.log.isDebugEnabled()) this.log.debug("*** BEFORE UPDATE:\n" - + DebugUtils.convertPropertiesToString(managedProperties)); - ConversionUtils.convertConfigurationToManagedProperties(managedProperties, resourceConfig, - getResourceContext().getResourceType(), customProps); - if (this.log.isDebugEnabled()) this.log.debug("*** AFTER UPDATE:\n" - + DebugUtils.convertPropertiesToString(managedProperties)); - updateComponent(managedComponent); - configurationUpdateReport.setStatus(ConfigurationUpdateStatus.SUCCESS); - } - catch (Exception e) - { - this.log.error("Failed to update configuration for " + getResourceDescription() + ".", e); - configurationUpdateReport.setStatus(ConfigurationUpdateStatus.FAILURE); - configurationUpdateReport.setErrorMessage(ThrowableUtil.getAllMessages(e)); - } - } - - // DeleteResourceFacet Implementation -------------------------------------------- - - public void deleteResource() throws Exception { - DeploymentManager deploymentManager = getConnection().getDeploymentManager(); - if (!deploymentManager.isRedeploySupported()) - throw new UnsupportedOperationException("Deletion of " + getResourceContext().getResourceType().getName() - + " Resources is not currently supported."); - ManagedComponent managedComponent = getManagedComponent(); - log.debug("Removing " + getResourceDescription() + " with component " + toString(managedComponent) + "..."); - ManagementView managementView = getConnection().getManagementView(); - managementView.removeComponent(managedComponent); - ManagedDeployment parentDeployment = managedComponent.getDeployment(); - log.debug("Redeploying parent deployment '" + parentDeployment.getName() - + "' in order to complete removal of component " + toString(managedComponent) + "..."); - DeploymentProgress progress = deploymentManager.redeploy(parentDeployment.getName()); - DeploymentStatus redeployStatus = DeploymentUtils.run(progress); - if (redeployStatus.isFailed()) { - log.error("Failed to redeploy parent deployment '" + parentDeployment.getName() - + "during removal of component " + toString(managedComponent) - + " - removal may not persist when the app server is restarted.", redeployStatus.getFailure()); - } - managementView.load(); - } - - // OperationFacet Implementation -------------------------------------------- - - public OperationResult invokeOperation(String name, Configuration parameters) throws Exception { - OperationDefinition operationDefinition = getOperationDefinition(name); - ManagedOperation managedOperation = getManagedOperation(operationDefinition); - // Convert parameters into MetaValue array. - MetaValue[] parameterMetaValues = ConversionUtils.convertOperationsParametersToMetaValues(managedOperation, - parameters, operationDefinition); - // invoke() takes a varargs, so we need to pass an empty array, rather than null. - MetaValue resultMetaValue = managedOperation.invoke(parameterMetaValues); - OperationResult result = new OperationResult(); - // Convert result MetaValue to corresponding Property type. - ConversionUtils.convertManagedOperationResults(managedOperation, resultMetaValue, result.getComplexResults(), - operationDefinition); - return result; - } - - // MeasurementFacet Implementation -------------------------------------------- - - public void getValues(MeasurementReport report, Set<MeasurementScheduleRequest> metrics) throws Exception { - ManagedComponent managedComponent = getManagedComponent(); - RunState runState = managedComponent.getRunState(); - for (MeasurementScheduleRequest request : metrics) { - try { - if (request.getName().equals("runState")) { - report.addData(new MeasurementDataTrait(request, runState.name())); - } else { - Object value = getSimpleValue(managedComponent, request); - addValueToMeasurementReport(report, request, value); - } - } catch (Exception e) { - if (runState == RunState.RUNNING) { - log.error("Failed to collect metric for " + request, e); - } else { - log.debug("Failed to collect metric for " + request - + ", but managed component is not in the RUNNING state.", e); - } - } - } - } - - protected void updateComponent(ManagedComponent managedComponent) throws Exception { - log.trace("Updating " + getResourceDescription() + " with component " + toString(managedComponent) + "..."); - ManagementView managementView = getConnection().getManagementView(); - managementView.updateComponent(managedComponent); - managementView.load(); - } - - // ------------------------------------------------------------------------------ - - /** - * The name of the measurement schedule request (i.e. the metric name) can be in one of two forms: - * <p/> - * [prefix'|']simplePropertyName (e.g. "maxTime" or "ThreadPool|currentThreadCount") - * [prefix'|']compositePropertyName'.'key (e.g. "consumerCount" or "messageStatistics.count") - * - * @param managedComponent a managed component - * @param request a measurement schedule request - * @return the metric value - */ - @Nullable - protected Object getSimpleValue(ManagedComponent managedComponent, MeasurementScheduleRequest request) { - String metricName = request.getName(); - int pipeIndex = metricName.indexOf(PREFIX_DELIMITER); - // Remove the prefix if there is one (e.g. "ThreadPool|currentThreadCount" -> "currentThreadCount"). - String compositePropName = (pipeIndex == -1) ? metricName : metricName.substring(pipeIndex + 1); - int dotIndex = compositePropName.indexOf('.'); - String metricPropName = (dotIndex == -1) ? compositePropName : compositePropName.substring(0, dotIndex); - ManagedProperty metricProp = managedComponent.getProperty(metricPropName); - if (metricProp == null) { - return null; - } - MetaValue metaValue; - if (dotIndex == -1) { - metaValue = metricProp.getValue(); - } else { - CompositeValue compositeValue = (CompositeValue) metricProp.getValue(); - String key = compositePropName.substring(dotIndex + 1); - metaValue = compositeValue.get(key); - } - return getInnerValue(metaValue); - } - - // TODO: Move this to a utility class. - @Nullable - private static Object getInnerValue(MetaValue metaValue) { - if (metaValue == null) { - return null; - } - Object value; - if (metaValue.getMetaType().isSimple()) { - SimpleValue simpleValue = (SimpleValue) metaValue; - value = simpleValue.getValue(); - } else if (metaValue.getMetaType().isEnum()) { - EnumValue enumValue = (EnumValue) metaValue; - value = enumValue.getValue(); - } else if (metaValue.getMetaType().isArray()) { - ArrayValue arrayValue = (ArrayValue) metaValue; - value = arrayValue.getValue(); - } else if (metaValue.getMetaType().isCollection()) { - CollectionValue collectionValue = (CollectionValue) metaValue; - List list = new ArrayList(); - for (MetaValue element : collectionValue.getElements()) { - list.add(getInnerValue(element)); - } - value = list; - } else { - value = metaValue.toString(); - } - return value; - } - - protected void addValueToMeasurementReport(MeasurementReport report, MeasurementScheduleRequest request, - Object value) { - if (value == null) { - return; - } - String stringValue = toString(value); - - DataType dataType = request.getDataType(); - switch (dataType) { - case MEASUREMENT: - try { - MeasurementDataNumeric dataNumeric = new MeasurementDataNumeric(request, Double.valueOf(stringValue)); - report.addData(dataNumeric); - } catch (NumberFormatException e) { - log.error("Profile service did not return a numeric value as expected for metric [" + request.getName() - + "] - value returned was " + value + ".", e); - } - break; - case TRAIT: - MeasurementDataTrait dataTrait = new MeasurementDataTrait(request, stringValue); - report.addData(dataTrait); - break; - default: - throw new IllegalStateException("Unsupported measurement data type: " + dataType); - } - } - - protected ComponentType getComponentType() { - return componentType; - } - - protected String getComponentName() { - return componentName; - } - - protected ManagedComponent getManagedComponent() { - ManagedComponent managedComponent; - try { - ManagementView managementView = getConnection().getManagementView(); - managedComponent = ManagedComponentUtils.getManagedComponent(managementView, this.componentType, - this.componentName); - } catch (Exception e) { - throw new RuntimeException("Failed to load [" + this.componentType + "] ManagedComponent [" - + this.componentName + "].", e); - } - if (managedComponent == null) - throw new IllegalStateException("Failed to find [" + this.componentType + "] ManagedComponent named [" - + this.componentName + "]."); - log.trace("Retrieved " + toString(managedComponent) + "."); - return managedComponent; - } - - @NotNull - private OperationDefinition getOperationDefinition(String operationName) { - ResourceType resourceType = getResourceContext().getResourceType(); - OperationDefinition operationDefinition = ResourceTypeUtils.getOperationDefinition(resourceType, operationName); - if (operationDefinition == null) - throw new IllegalStateException("Operation named '" + operationName - + "' is not defined for Resource type '" + resourceType.getName() + "' in the '" - + resourceType.getPlugin() + "' plugin's descriptor."); - return operationDefinition; - } - - @NotNull - private ManagedOperation getManagedOperation(OperationDefinition operationDefinition) { - ManagedComponent managedComponent = getManagedComponent(); - Set<ManagedOperation> operations = managedComponent.getOperations(); - for (ManagedOperation operation : operations) { - ConfigurationDefinition paramsConfigDef = operationDefinition.getParametersConfigurationDefinition(); - int paramCount = (paramsConfigDef != null) ? paramsConfigDef.getPropertyDefinitions().size() : 0; - if (operation.getName().equals(operationDefinition.getName()) - && (operation.getParameters().length == paramCount)) - return operation; - } - throw new IllegalStateException("ManagedOperation named '" + operationDefinition.getName() - + "' not found on ManagedComponent [" + getManagedComponent() + "]."); - } - - private static String toString(ManagedComponent managedComponent) { - Map<String, ManagedProperty> properties = managedComponent.getProperties(); - return managedComponent.getClass().getSimpleName() + "@" + System.identityHashCode(managedComponent) + "[" - + "type=" + managedComponent.getType() + ", name=" + managedComponent.getName() + ", properties=" - + properties.getClass().getSimpleName() + "@" + System.identityHashCode(properties) + "]"; - } - - private static String toString(@NotNull Object value) { - if (value.getClass().isArray()) { - StringBuilder buffer = new StringBuilder(); - int lastIndex = Array.getLength(value) - 1; - for (int i = 0; i < Array.getLength(value); i++) { - buffer.append(String.valueOf(Array.get(value, i))); - if (i == lastIndex) { - break; - } - buffer.append(", "); - } - return buffer.toString(); - } else { - return value.toString(); - } - } -} +/* +* Jopr Management Platform +* Copyright (C) 2005-2009 Red Hat, Inc. +* All rights reserved. +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License, version 2, as +* published by the Free Software Foundation, and/or the GNU Lesser +* General Public License, version 2.1, also as published by the Free +* Software Foundation. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License and the GNU Lesser General Public License +* for more details. +* +* You should have received a copy of the GNU General Public License +* and the GNU Lesser General Public License along with this program; +* if not, write to the Free Software Foundation, Inc., +* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +*/ +package org.rhq.plugins.jbossas5; + +import java.lang.reflect.Array; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.jboss.deployers.spi.management.ManagementView; +import org.jboss.deployers.spi.management.deploy.DeploymentManager; +import org.jboss.deployers.spi.management.deploy.DeploymentProgress; +import org.jboss.deployers.spi.management.deploy.DeploymentStatus; +import org.jboss.managed.api.ComponentType; +import org.jboss.managed.api.ManagedComponent; +import org.jboss.managed.api.ManagedDeployment; +import org.jboss.managed.api.ManagedOperation; +import org.jboss.managed.api.ManagedProperty; +import org.jboss.managed.api.RunState; +import org.jboss.metatype.api.values.ArrayValue; +import org.jboss.metatype.api.values.CollectionValue; +import org.jboss.metatype.api.values.CompositeValue; +import org.jboss.metatype.api.values.EnumValue; +import org.jboss.metatype.api.values.MetaValue; +import org.jboss.metatype.api.values.SimpleValue; +import org.jboss.remoting.CannotConnectException; + +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import org.rhq.core.domain.configuration.Configuration; +import org.rhq.core.domain.configuration.PropertySimple; +import org.rhq.core.domain.configuration.ConfigurationUpdateStatus; +import org.rhq.core.domain.configuration.definition.ConfigurationDefinition; +import org.rhq.core.domain.measurement.AvailabilityType; +import org.rhq.core.domain.measurement.DataType; +import org.rhq.core.domain.measurement.MeasurementDataNumeric; +import org.rhq.core.domain.measurement.MeasurementDataTrait; +import org.rhq.core.domain.measurement.MeasurementReport; +import org.rhq.core.domain.measurement.MeasurementScheduleRequest; +import org.rhq.core.domain.operation.OperationDefinition; +import org.rhq.core.domain.resource.ResourceType; +import org.rhq.core.pluginapi.configuration.ConfigurationFacet; +import org.rhq.core.pluginapi.configuration.ConfigurationUpdateReport; +import org.rhq.core.pluginapi.inventory.DeleteResourceFacet; +import org.rhq.core.pluginapi.inventory.ResourceContext; +import org.rhq.core.pluginapi.measurement.MeasurementFacet; +import org.rhq.core.pluginapi.operation.OperationFacet; +import org.rhq.core.pluginapi.operation.OperationResult; +import org.rhq.core.util.exception.ThrowableUtil; +import org.rhq.plugins.jbossas5.util.ConversionUtils; +import org.rhq.plugins.jbossas5.util.DeploymentUtils; +import org.rhq.plugins.jbossas5.util.ManagedComponentUtils; +import org.rhq.plugins.jbossas5.util.ResourceTypeUtils; +import org.rhq.plugins.jbossas5.util.ResourceComponentUtils; +import org.rhq.plugins.jbossas5.util.DebugUtils; + +/** + * Service ResourceComponent for all {@link ManagedComponent}s in a Profile. + * + * @author Ian Springer + * @author Jason Dobies + * @author Mark Spritzler + */ +public class ManagedComponentComponent extends AbstractManagedComponent implements ConfigurationFacet, + DeleteResourceFacet, OperationFacet, MeasurementFacet { + public static interface Config { + String COMPONENT_TYPE = "componentType"; + String COMPONENT_SUBTYPE = "componentSubtype"; + String COMPONENT_NAME = "componentName"; + String TEMPLATE_NAME = "templateName"; + String COMPONENT_NAME_PROPERTY = "componentNameProperty"; + } + + protected static final char PREFIX_DELIMITER = '|'; + + private final Log log = LogFactory.getLog(this.getClass()); + + private String componentName; + private ComponentType componentType; + + // ResourceComponent Implementation -------------------------------------------- + + public AvailabilityType getAvailability() { + RunState runState; + try { + runState = getManagedComponent().getRunState(); + } catch (CannotConnectException e) { + return AvailabilityType.DOWN; + } + return (runState == RunState.RUNNING) ? AvailabilityType.UP : AvailabilityType.DOWN; + } + + public void start(ResourceContext<ProfileServiceComponent> resourceContext) throws Exception { + super.start(resourceContext); + this.componentType = ConversionUtils.getComponentType(getResourceContext().getResourceType()); + Configuration pluginConfig = resourceContext.getPluginConfiguration(); + this.componentName = pluginConfig.getSimple(Config.COMPONENT_NAME).getStringValue(); + log.trace("Started ResourceComponent for " + getResourceDescription() + ", managing " + this.componentType + + " component '" + this.componentName + "'."); + } + + public void stop() { + return; + } + + // ConfigurationComponent Implementation -------------------------------------------- + + public Configuration loadResourceConfiguration() + { + Configuration resourceConfig; + try + { + Map<String, ManagedProperty> managedProperties = getManagedComponent().getProperties(); + Map<String, PropertySimple> customProps = + ResourceComponentUtils.getCustomProperties(getResourceContext().getPluginConfiguration()); + if (this.log.isDebugEnabled()) this.log.debug("*** AFTER LOAD:\n" + + DebugUtils.convertPropertiesToString(managedProperties)); + resourceConfig = ConversionUtils.convertManagedObjectToConfiguration(managedProperties, + customProps, getResourceContext().getResourceType()); + } + catch (Exception e) + { + RunState runState = getManagedComponent().getRunState(); + if (runState == RunState.RUNNING) { + this.log.error("Failed to load configuration for " + getResourceDescription() + ".", e); + } else { + this.log.debug("Failed to load configuration for " + getResourceDescription() + + ", but managed component is not in the RUNNING state.", e); + } + throw new RuntimeException(ThrowableUtil.getAllMessages(e)); + } + return resourceConfig; + } + + public void updateResourceConfiguration(ConfigurationUpdateReport configurationUpdateReport) + { + Configuration resourceConfig = configurationUpdateReport.getConfiguration(); + Configuration pluginConfig = getResourceContext().getPluginConfiguration(); + try + { + ManagedComponent managedComponent = getManagedComponent(); + Map<String, ManagedProperty> managedProperties = managedComponent.getProperties(); + Map<String, PropertySimple> customProps = ResourceComponentUtils.getCustomProperties(pluginConfig); + if (this.log.isDebugEnabled()) this.log.debug("*** BEFORE UPDATE:\n" + + DebugUtils.convertPropertiesToString(managedProperties)); + ConversionUtils.convertConfigurationToManagedProperties(managedProperties, resourceConfig, + getResourceContext().getResourceType(), customProps); + if (this.log.isDebugEnabled()) this.log.debug("*** AFTER UPDATE:\n" + + DebugUtils.convertPropertiesToString(managedProperties)); + updateComponent(managedComponent); + configurationUpdateReport.setStatus(ConfigurationUpdateStatus.SUCCESS); + } + catch (Exception e) + { + this.log.error("Failed to update configuration for " + getResourceDescription() + ".", e); + configurationUpdateReport.setStatus(ConfigurationUpdateStatus.FAILURE); + configurationUpdateReport.setErrorMessage(ThrowableUtil.getAllMessages(e)); + } + } + + // DeleteResourceFacet Implementation -------------------------------------------- + + public void deleteResource() throws Exception { + DeploymentManager deploymentManager = getConnection().getDeploymentManager(); + if (!deploymentManager.isRedeploySupported()) + throw new UnsupportedOperationException("Deletion of " + getResourceContext().getResourceType().getName() + + " Resources is not currently supported."); + ManagedComponent managedComponent = getManagedComponent(); + log.debug("Removing " + getResourceDescription() + " with component " + toString(managedComponent) + "..."); + ManagementView managementView = getConnection().getManagementView(); + managementView.removeComponent(managedComponent); + ManagedDeployment parentDeployment = managedComponent.getDeployment(); + log.debug("Redeploying parent deployment '" + parentDeployment.getName() + + "' in order to complete removal of component " + toString(managedComponent) + "..."); + DeploymentProgress progress = deploymentManager.redeploy(parentDeployment.getName()); + DeploymentStatus redeployStatus = DeploymentUtils.run(progress); + if (redeployStatus.isFailed()) { + log.error("Failed to redeploy parent deployment '" + parentDeployment.getName() + + "during removal of component " + toString(managedComponent) + + " - removal may not persist when the app server is restarted.", redeployStatus.getFailure()); + } + managementView.load(); + } + + // OperationFacet Implementation -------------------------------------------- + + public OperationResult invokeOperation(String name, Configuration parameters) throws Exception { + OperationDefinition operationDefinition = getOperationDefinition(name); + ManagedOperation managedOperation = getManagedOperation(operationDefinition); + // Convert parameters into MetaValue array. + MetaValue[] parameterMetaValues = ConversionUtils.convertOperationsParametersToMetaValues(managedOperation, + parameters, operationDefinition); + // invoke() takes a varargs, so we need to pass an empty array, rather than null. + MetaValue resultMetaValue = managedOperation.invoke(parameterMetaValues); + OperationResult result = new OperationResult(); + // Convert result MetaValue to corresponding Property type. + ConversionUtils.convertManagedOperationResults(managedOperation, resultMetaValue, result.getComplexResults(), + operationDefinition); + return result; + } + + // MeasurementFacet Implementation -------------------------------------------- + + public void getValues(MeasurementReport report, Set<MeasurementScheduleRequest> metrics) throws Exception { + ManagedComponent managedComponent = getManagedComponent(); + RunState runState = managedComponent.getRunState(); + for (MeasurementScheduleRequest request : metrics) { + try { + if (request.getName().equals("runState")) { + report.addData(new MeasurementDataTrait(request, runState.name())); + } else { + Object value = getSimpleValue(managedComponent, request); + addValueToMeasurementReport(report, request, value); + } + } catch (Exception e) { + if (runState == RunState.RUNNING) { + log.error("Failed to collect metric for " + request, e); + } else { + log.debug("Failed to collect metric for " + request + + ", but managed component is not in the RUNNING state.", e); + } + } + } + } + + protected void updateComponent(ManagedComponent managedComponent) throws Exception { + log.trace("Updating " + getResourceDescription() + " with component " + toString(managedComponent) + "..."); + ManagementView managementView = getConnection().getManagementView(); + managementView.updateComponent(managedComponent); + managementView.load(); + } + + // ------------------------------------------------------------------------------ + + /** + * The name of the measurement schedule request (i.e. the metric name) can be in one of two forms: + * <p/> + * [prefix'|']simplePropertyName (e.g. "maxTime" or "ThreadPool|currentThreadCount") + * [prefix'|']compositePropertyName'.'key (e.g. "consumerCount" or "messageStatistics.count") + * + * @param managedComponent a managed component + * @param request a measurement schedule request + * @return the metric value + */ + @Nullable + protected Object getSimpleValue(ManagedComponent managedComponent, MeasurementScheduleRequest request) { + String metricName = request.getName(); + int pipeIndex = metricName.indexOf(PREFIX_DELIMITER); + // Remove the prefix if there is one (e.g. "ThreadPool|currentThreadCount" -> "currentThreadCount"). + String compositePropName = (pipeIndex == -1) ? metricName : metricName.substring(pipeIndex + 1); + int dotIndex = compositePropName.indexOf('.'); + String metricPropName = (dotIndex == -1) ? compositePropName : compositePropName.substring(0, dotIndex); + ManagedProperty metricProp = managedComponent.getProperty(metricPropName); + if (metricProp == null) { + return null; + } + MetaValue metaValue; + if (dotIndex == -1) { + metaValue = metricProp.getValue(); + } else { + CompositeValue compositeValue = (CompositeValue) metricProp.getValue(); + String key = compositePropName.substring(dotIndex + 1); + metaValue = compositeValue.get(key); + } + return getInnerValue(metaValue); + } + + // TODO: Move this to a utility class. + @Nullable + private static Object getInnerValue(MetaValue metaValue) { + if (metaValue == null) { + return null; + } + Object value; + if (metaValue.getMetaType().isSimple()) { + SimpleValue simpleValue = (SimpleValue) metaValue; + value = simpleValue.getValue(); + } else if (metaValue.getMetaType().isEnum()) { + EnumValue enumValue = (EnumValue) metaValue; + value = enumValue.getValue(); + } else if (metaValue.getMetaType().isArray()) { + ArrayValue arrayValue = (ArrayValue) metaValue; + value = arrayValue.getValue(); + } else if (metaValue.getMetaType().isCollection()) { + CollectionValue collectionValue = (CollectionValue) metaValue; + List list = new ArrayList(); + for (MetaValue element : collectionValue.getElements()) { + list.add(getInnerValue(element)); + } + value = list; + } else { + value = metaValue.toString(); + } + return value; + } + + protected void addValueToMeasurementReport(MeasurementReport report, MeasurementScheduleRequest request, + Object value) { + if (value == null) { + return; + } + String stringValue = toString(value); + + DataType dataType = request.getDataType(); + switch (dataType) { + case MEASUREMENT: + try { + MeasurementDataNumeric dataNumeric = new MeasurementDataNumeric(request, Double.valueOf(stringValue)); + report.addData(dataNumeric); + } catch (NumberFormatException e) { + log.error("Profile service did not return a numeric value as expected for metric [" + request.getName() + + "] - value returned was " + value + ".", e); + } + break; + case TRAIT: + MeasurementDataTrait dataTrait = new MeasurementDataTrait(request, stringValue); + report.addData(dataTrait); + break; + default: + throw new IllegalStateException("Unsupported measurement data type: " + dataType); + } + } + + protected ComponentType getComponentType() { + return componentType; + } + + protected String getComponentName() { + return componentName; + } + + protected ManagedComponent getManagedComponent() { + ManagedComponent managedComponent; + try { + ManagementView managementView = getConnection().getManagementView(); + managedComponent = ManagedComponentUtils.getManagedComponent(managementView, this.componentType, + this.componentName); + } catch (Exception e) { + throw new RuntimeException("Failed to load [" + this.componentType + "] ManagedComponent [" + + this.componentName + "].", e); + } + if (managedComponent == null) + throw new IllegalStateException("Failed to find [" + this.componentType + "] ManagedComponent named [" + + this.componentName + "]."); + log.trace("Retrieved " + toString(managedComponent) + "."); + return managedComponent; + } + + @NotNull + private OperationDefinition getOperationDefinition(String operationName) { + ResourceType resourceType = getResourceContext().getResourceType(); + OperationDefinition operationDefinition = ResourceTypeUtils.getOperationDefinition(resourceType, operationName); + if (operationDefinition == null) + throw new IllegalStateException("Operation named '" + operationName + + "' is not defined for Resource type '" + resourceType.getName() + "' in the '" + + resourceType.getPlugin() + "' plugin's descriptor."); + return operationDefinition; + } + + @NotNull + private ManagedOperation getManagedOperation(OperationDefinition operationDefinition) { + ManagedComponent managedComponent = getManagedComponent(); + Set<ManagedOperation> operations = managedComponent.getOperations(); + for (ManagedOperation operation : operations) { + ConfigurationDefinition paramsConfigDef = operationDefinition.getParametersConfigurationDefinition(); + int paramCount = (paramsConfigDef != null) ? paramsConfigDef.getPropertyDefinitions().size() : 0; + if (operation.getName().equals(operationDefinition.getName()) + && (operation.getParameters().length == paramCount)) + return operation; + } + throw new IllegalStateException("ManagedOperation named '" + operationDefinition.getName() + + "' not found on ManagedComponent [" + getManagedComponent() + "]."); + } + + private static String toString(ManagedComponent managedComponent) { + Map<String, ManagedProperty> properties = managedComponent.getProperties(); + return managedComponent.getClass().getSimpleName() + "@" + System.identityHashCode(managedComponent) + "[" + + "type=" + managedComponent.getType() + ", name=" + managedComponent.getName() + ", properties=" + + properties.getClass().getSimpleName() + "@" + System.identityHashCode(properties) + "]"; + } + + private static String toString(@NotNull Object value) { + if (value.getClass().isArray()) { + StringBuilder buffer = new StringBuilder(); + int lastIndex = Array.getLength(value) - 1; + for (int i = 0; i < Array.getLength(value); i++) { + buffer.append(String.valueOf(Array.get(value, i))); + if (i == lastIndex) { + break; + } + buffer.append(", "); + } + return buffer.toString(); + } else { + return value.toString(); + } + } +}
commit 711247621f3acd4eeaa8800395ed838166bea9c4 Author: Jay Shaughnessy jshaughn@redhat.com Date: Fri Jul 2 10:30:32 2010 -0400
fix jdoc
diff --git a/modules/plugins/jmx/src/main/java/org/rhq/plugins/jmx/MBeanResourceComponent.java b/modules/plugins/jmx/src/main/java/org/rhq/plugins/jmx/MBeanResourceComponent.java index 0aa7f26..2e1ae41 100644 --- a/modules/plugins/jmx/src/main/java/org/rhq/plugins/jmx/MBeanResourceComponent.java +++ b/modules/plugins/jmx/src/main/java/org/rhq/plugins/jmx/MBeanResourceComponent.java @@ -122,7 +122,8 @@ public class MBeanResourceComponent<T extends JMXComponent> implements Measureme * is not yet loaded. This might still return <code>null</code> if the MBean could * not be loaded. * - * @return the loaded MBean or <code>null</code> if it could not be loaded + * @return the loaded MBean + * @throws IllegalStateException if it could not be loaded * * @see #loadBean() */
commit 4f9387122640a9df8cbb8448b74ad086f9eaf7c9 Author: Jay Shaughnessy jshaughn@redhat.com Date: Fri Jul 2 10:06:26 2010 -0400
Throwing an exception here generated WARN level messages in the Agent log when in reality this is a valid (connection property) setting. This can be confusing to users. So, change to INFO logging and a null return. Also clarified possible return values for this call in ConfigurationFacet jdoc.
diff --git a/modules/core/plugin-api/src/main/java/org/rhq/core/pluginapi/configuration/ConfigurationFacet.java b/modules/core/plugin-api/src/main/java/org/rhq/core/pluginapi/configuration/ConfigurationFacet.java index 93042e3..02b58a2 100644 --- a/modules/core/plugin-api/src/main/java/org/rhq/core/pluginapi/configuration/ConfigurationFacet.java +++ b/modules/core/plugin-api/src/main/java/org/rhq/core/pluginapi/configuration/ConfigurationFacet.java @@ -1,25 +1,25 @@ - /* - * RHQ Management Platform - * Copyright (C) 2005-2008 Red Hat, Inc. - * All rights reserved. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License, version 2, as - * published by the Free Software Foundation, and/or the GNU Lesser - * General Public License, version 2.1, also as published by the Free - * Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License and the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License - * and the GNU Lesser General Public License along with this program; - * if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ +/* + * RHQ Management Platform + * Copyright (C) 2005-2008 Red Hat, Inc. + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License, version 2, as + * published by the Free Software Foundation, and/or the GNU Lesser + * General Public License, version 2.1, also as published by the Free + * Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License and the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License + * and the GNU Lesser General Public License along with this program; + * if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ package org.rhq.core.pluginapi.configuration;
import org.rhq.core.domain.configuration.Configuration; @@ -37,7 +37,8 @@ public interface ConfigurationFacet extends ConfigurationFacetSupport { * settings for the managed resource itself, not to be confused with the <i>plugin configuration</i> which is used * by the plugin code to connect to the managed resource. * - * @return the current configuration of the managed resource + * @return the current configuration of the managed resource. can return null if resource configuration is + * implemented but disabled (perhaps via a plugin config setting). * * @throws Exception if failed to obtain the current configuration from the resource */ diff --git a/modules/plugins/jmx/src/main/java/org/rhq/plugins/jmx/JavaUtilLoggingResourceComponent.java b/modules/plugins/jmx/src/main/java/org/rhq/plugins/jmx/JavaUtilLoggingResourceComponent.java index 2a80f43..85b6ee6 100644 --- a/modules/plugins/jmx/src/main/java/org/rhq/plugins/jmx/JavaUtilLoggingResourceComponent.java +++ b/modules/plugins/jmx/src/main/java/org/rhq/plugins/jmx/JavaUtilLoggingResourceComponent.java @@ -44,12 +44,14 @@ public class JavaUtilLoggingResourceComponent extends MBeanResourceComponent { public Configuration loadResourceConfiguration() {
if (getResourceContext().getPluginContainerDeployment() == PluginContainerDeployment.AGENT) { - PropertySimple configManagementEnabled = getResourceContext().getPluginConfiguration().getSimple("configManagementEnabled"); + PropertySimple configManagementEnabled = getResourceContext().getPluginConfiguration().getSimple( + "configManagementEnabled"); if (configManagementEnabled == null || !configManagementEnabled.getBooleanValue()) { - throw new RuntimeException("Configuration management is currently disabled for the " - + getResourceContext().getResourceType() + " Resource with key [" - + getResourceContext().getResourceKey() - + "] - it can be enabled in the Resource's Inventory > Connection tab."); + log.info("Configuration management is currently disabled for the " + + getResourceContext().getResourceType() + " Resource with key [" + + getResourceContext().getResourceKey() + + "] - it can be enabled in the Resource's Inventory > Connection tab."); + return null; } }
commit 07217f26a8368f4b9554b3253aea142fe7193f33 Author: Jay Shaughnessy jshaughn@redhat.com Date: Fri Jul 2 09:59:37 2010 -0400
LT commit
diff --git a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ManagedComponentComponent.java b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ManagedComponentComponent.java index aefb351..e4511fd 100644 --- a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ManagedComponentComponent.java +++ b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ManagedComponentComponent.java @@ -1,422 +1,422 @@ -/* -* Jopr Management Platform -* Copyright (C) 2005-2009 Red Hat, Inc. -* All rights reserved. -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License, version 2, as -* published by the Free Software Foundation, and/or the GNU Lesser -* General Public License, version 2.1, also as published by the Free -* Software Foundation. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License and the GNU Lesser General Public License -* for more details. -* -* You should have received a copy of the GNU General Public License -* and the GNU Lesser General Public License along with this program; -* if not, write to the Free Software Foundation, Inc., -* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ -package org.rhq.plugins.jbossas5; - -import java.lang.reflect.Array; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.jboss.deployers.spi.management.ManagementView; -import org.jboss.deployers.spi.management.deploy.DeploymentManager; -import org.jboss.deployers.spi.management.deploy.DeploymentProgress; -import org.jboss.deployers.spi.management.deploy.DeploymentStatus; -import org.jboss.managed.api.ComponentType; -import org.jboss.managed.api.ManagedComponent; -import org.jboss.managed.api.ManagedDeployment; -import org.jboss.managed.api.ManagedOperation; -import org.jboss.managed.api.ManagedProperty; -import org.jboss.managed.api.RunState; -import org.jboss.metatype.api.values.ArrayValue; -import org.jboss.metatype.api.values.CollectionValue; -import org.jboss.metatype.api.values.CompositeValue; -import org.jboss.metatype.api.values.EnumValue; -import org.jboss.metatype.api.values.MetaValue; -import org.jboss.metatype.api.values.SimpleValue; -import org.jboss.remoting.CannotConnectException; - -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -import org.rhq.core.domain.configuration.Configuration; -import org.rhq.core.domain.configuration.PropertySimple; -import org.rhq.core.domain.configuration.ConfigurationUpdateStatus; -import org.rhq.core.domain.configuration.definition.ConfigurationDefinition; -import org.rhq.core.domain.measurement.AvailabilityType; -import org.rhq.core.domain.measurement.DataType; -import org.rhq.core.domain.measurement.MeasurementDataNumeric; -import org.rhq.core.domain.measurement.MeasurementDataTrait; -import org.rhq.core.domain.measurement.MeasurementReport; -import org.rhq.core.domain.measurement.MeasurementScheduleRequest; -import org.rhq.core.domain.operation.OperationDefinition; -import org.rhq.core.domain.resource.ResourceType; -import org.rhq.core.pluginapi.configuration.ConfigurationFacet; -import org.rhq.core.pluginapi.configuration.ConfigurationUpdateReport; -import org.rhq.core.pluginapi.inventory.DeleteResourceFacet; -import org.rhq.core.pluginapi.inventory.ResourceContext; -import org.rhq.core.pluginapi.measurement.MeasurementFacet; -import org.rhq.core.pluginapi.operation.OperationFacet; -import org.rhq.core.pluginapi.operation.OperationResult; -import org.rhq.core.util.exception.ThrowableUtil; -import org.rhq.plugins.jbossas5.util.ConversionUtils; -import org.rhq.plugins.jbossas5.util.DeploymentUtils; -import org.rhq.plugins.jbossas5.util.ManagedComponentUtils; -import org.rhq.plugins.jbossas5.util.ResourceTypeUtils; -import org.rhq.plugins.jbossas5.util.ResourceComponentUtils; -import org.rhq.plugins.jbossas5.util.DebugUtils; - -/** - * Service ResourceComponent for all {@link ManagedComponent}s in a Profile. - * - * @author Ian Springer - * @author Jason Dobies - * @author Mark Spritzler - */ -public class ManagedComponentComponent extends AbstractManagedComponent implements ConfigurationFacet, - DeleteResourceFacet, OperationFacet, MeasurementFacet { - public static interface Config { - String COMPONENT_TYPE = "componentType"; - String COMPONENT_SUBTYPE = "componentSubtype"; - String COMPONENT_NAME = "componentName"; - String TEMPLATE_NAME = "templateName"; - String COMPONENT_NAME_PROPERTY = "componentNameProperty"; - } - - protected static final char PREFIX_DELIMITER = '|'; - - private final Log log = LogFactory.getLog(this.getClass()); - - private String componentName; - private ComponentType componentType; - - // ResourceComponent Implementation -------------------------------------------- - - public AvailabilityType getAvailability() { - RunState runState; - try { - runState = getManagedComponent().getRunState(); - } catch (CannotConnectException e) { - return AvailabilityType.DOWN; - } - return (runState == RunState.RUNNING) ? AvailabilityType.UP : AvailabilityType.DOWN; - } - - public void start(ResourceContext<ProfileServiceComponent> resourceContext) throws Exception { - super.start(resourceContext); - this.componentType = ConversionUtils.getComponentType(getResourceContext().getResourceType()); - Configuration pluginConfig = resourceContext.getPluginConfiguration(); - this.componentName = pluginConfig.getSimple(Config.COMPONENT_NAME).getStringValue(); - log.trace("Started ResourceComponent for " + getResourceDescription() + ", managing " + this.componentType - + " component '" + this.componentName + "'."); - } - - public void stop() { - return; - } - - // ConfigurationComponent Implementation -------------------------------------------- - - public Configuration loadResourceConfiguration() - { - Configuration resourceConfig; - try - { - Map<String, ManagedProperty> managedProperties = getManagedComponent().getProperties(); - Map<String, PropertySimple> customProps = - ResourceComponentUtils.getCustomProperties(getResourceContext().getPluginConfiguration()); - if (this.log.isDebugEnabled()) this.log.debug("*** AFTER LOAD:\n" - + DebugUtils.convertPropertiesToString(managedProperties)); - resourceConfig = ConversionUtils.convertManagedObjectToConfiguration(managedProperties, - customProps, getResourceContext().getResourceType()); - } - catch (Exception e) - { - RunState runState = getManagedComponent().getRunState(); - if (runState == RunState.RUNNING) { - this.log.error("Failed to load configuration for " + getResourceDescription() + ".", e); - } else { - this.log.debug("Failed to load configuration for " + getResourceDescription() - + ", but managed component is not in the RUNNING state.", e); - } - throw new RuntimeException(ThrowableUtil.getAllMessages(e)); - } - return resourceConfig; - } - - public void updateResourceConfiguration(ConfigurationUpdateReport configurationUpdateReport) - { - Configuration resourceConfig = configurationUpdateReport.getConfiguration(); - Configuration pluginConfig = getResourceContext().getPluginConfiguration(); - try - { - ManagedComponent managedComponent = getManagedComponent(); - Map<String, ManagedProperty> managedProperties = managedComponent.getProperties(); - Map<String, PropertySimple> customProps = ResourceComponentUtils.getCustomProperties(pluginConfig); - if (this.log.isDebugEnabled()) this.log.debug("*** BEFORE UPDATE:\n" - + DebugUtils.convertPropertiesToString(managedProperties)); - ConversionUtils.convertConfigurationToManagedProperties(managedProperties, resourceConfig, - getResourceContext().getResourceType(), customProps); - if (this.log.isDebugEnabled()) this.log.debug("*** AFTER UPDATE:\n" - + DebugUtils.convertPropertiesToString(managedProperties)); - updateComponent(managedComponent); - configurationUpdateReport.setStatus(ConfigurationUpdateStatus.SUCCESS); - } - catch (Exception e) - { - this.log.error("Failed to update configuration for " + getResourceDescription() + ".", e); - configurationUpdateReport.setStatus(ConfigurationUpdateStatus.FAILURE); - configurationUpdateReport.setErrorMessage(ThrowableUtil.getAllMessages(e)); - } - } - - // DeleteResourceFacet Implementation -------------------------------------------- - - public void deleteResource() throws Exception { - DeploymentManager deploymentManager = getConnection().getDeploymentManager(); - if (!deploymentManager.isRedeploySupported()) - throw new UnsupportedOperationException("Deletion of " + getResourceContext().getResourceType().getName() - + " Resources is not currently supported."); - ManagedComponent managedComponent = getManagedComponent(); - log.debug("Removing " + getResourceDescription() + " with component " + toString(managedComponent) + "..."); - ManagementView managementView = getConnection().getManagementView(); - managementView.removeComponent(managedComponent); - ManagedDeployment parentDeployment = managedComponent.getDeployment(); - log.debug("Redeploying parent deployment '" + parentDeployment.getName() - + "' in order to complete removal of component " + toString(managedComponent) + "..."); - DeploymentProgress progress = deploymentManager.redeploy(parentDeployment.getName()); - DeploymentStatus redeployStatus = DeploymentUtils.run(progress); - if (redeployStatus.isFailed()) { - log.error("Failed to redeploy parent deployment '" + parentDeployment.getName() - + "during removal of component " + toString(managedComponent) - + " - removal may not persist when the app server is restarted.", redeployStatus.getFailure()); - } - managementView.load(); - } - - // OperationFacet Implementation -------------------------------------------- - - public OperationResult invokeOperation(String name, Configuration parameters) throws Exception { - OperationDefinition operationDefinition = getOperationDefinition(name); - ManagedOperation managedOperation = getManagedOperation(operationDefinition); - // Convert parameters into MetaValue array. - MetaValue[] parameterMetaValues = ConversionUtils.convertOperationsParametersToMetaValues(managedOperation, - parameters, operationDefinition); - // invoke() takes a varargs, so we need to pass an empty array, rather than null. - MetaValue resultMetaValue = managedOperation.invoke(parameterMetaValues); - OperationResult result = new OperationResult(); - // Convert result MetaValue to corresponding Property type. - ConversionUtils.convertManagedOperationResults(managedOperation, resultMetaValue, result.getComplexResults(), - operationDefinition); - return result; - } - - // MeasurementFacet Implementation -------------------------------------------- - - public void getValues(MeasurementReport report, Set<MeasurementScheduleRequest> metrics) throws Exception { - ManagedComponent managedComponent = getManagedComponent(); - RunState runState = managedComponent.getRunState(); - for (MeasurementScheduleRequest request : metrics) { - try { - if (request.getName().equals("runState")) { - report.addData(new MeasurementDataTrait(request, runState.name())); - } else { - Object value = getSimpleValue(managedComponent, request); - addValueToMeasurementReport(report, request, value); - } - } catch (Exception e) { - if (runState == RunState.RUNNING) { - log.error("Failed to collect metric for " + request, e); - } else { - log.debug("Failed to collect metric for " + request - + ", but managed component is not in the RUNNING state.", e); - } - } - } - } - - protected void updateComponent(ManagedComponent managedComponent) throws Exception { - log.trace("Updating " + getResourceDescription() + " with component " + toString(managedComponent) + "..."); - ManagementView managementView = getConnection().getManagementView(); - managementView.updateComponent(managedComponent); - managementView.load(); - } - - // ------------------------------------------------------------------------------ - - /** - * The name of the measurement schedule request (i.e. the metric name) can be in one of two forms: - * <p/> - * [prefix'|']simplePropertyName (e.g. "maxTime" or "ThreadPool|currentThreadCount") - * [prefix'|']compositePropertyName'.'key (e.g. "consumerCount" or "messageStatistics.count") - * - * @param managedComponent a managed component - * @param request a measurement schedule request - * @return the metric value - */ - @Nullable - protected Object getSimpleValue(ManagedComponent managedComponent, MeasurementScheduleRequest request) { - String metricName = request.getName(); - int pipeIndex = metricName.indexOf(PREFIX_DELIMITER); - // Remove the prefix if there is one (e.g. "ThreadPool|currentThreadCount" -> "currentThreadCount"). - String compositePropName = (pipeIndex == -1) ? metricName : metricName.substring(pipeIndex + 1); - int dotIndex = compositePropName.indexOf('.'); - String metricPropName = (dotIndex == -1) ? compositePropName : compositePropName.substring(0, dotIndex); - ManagedProperty metricProp = managedComponent.getProperty(metricPropName); - if (metricProp == null) { - return null; - } - MetaValue metaValue; - if (dotIndex == -1) { - metaValue = metricProp.getValue(); - } else { - CompositeValue compositeValue = (CompositeValue) metricProp.getValue(); - String key = compositePropName.substring(dotIndex + 1); - metaValue = compositeValue.get(key); - } - return getInnerValue(metaValue); - } - - // TODO: Move this to a utility class. - @Nullable - private static Object getInnerValue(MetaValue metaValue) { - if (metaValue == null) { - return null; - } - Object value; - if (metaValue.getMetaType().isSimple()) { - SimpleValue simpleValue = (SimpleValue) metaValue; - value = simpleValue.getValue(); - } else if (metaValue.getMetaType().isEnum()) { - EnumValue enumValue = (EnumValue) metaValue; - value = enumValue.getValue(); - } else if (metaValue.getMetaType().isArray()) { - ArrayValue arrayValue = (ArrayValue) metaValue; - value = arrayValue.getValue(); - } else if (metaValue.getMetaType().isCollection()) { - CollectionValue collectionValue = (CollectionValue) metaValue; - List list = new ArrayList(); - for (MetaValue element : collectionValue.getElements()) { - list.add(getInnerValue(element)); - } - value = list; - } else { - value = metaValue.toString(); - } - return value; - } - - protected void addValueToMeasurementReport(MeasurementReport report, MeasurementScheduleRequest request, - Object value) { - if (value == null) { - return; - } - String stringValue = toString(value); - - DataType dataType = request.getDataType(); - switch (dataType) { - case MEASUREMENT: - try { - MeasurementDataNumeric dataNumeric = new MeasurementDataNumeric(request, Double.valueOf(stringValue)); - report.addData(dataNumeric); - } catch (NumberFormatException e) { - log.error("Profile service did not return a numeric value as expected for metric [" + request.getName() - + "] - value returned was " + value + ".", e); - } - break; - case TRAIT: - MeasurementDataTrait dataTrait = new MeasurementDataTrait(request, stringValue); - report.addData(dataTrait); - break; - default: - throw new IllegalStateException("Unsupported measurement data type: " + dataType); - } - } - - protected ComponentType getComponentType() { - return componentType; - } - - protected String getComponentName() { - return componentName; - } - - protected ManagedComponent getManagedComponent() { - ManagedComponent managedComponent; - try { - ManagementView managementView = getConnection().getManagementView(); - managedComponent = ManagedComponentUtils.getManagedComponent(managementView, this.componentType, - this.componentName); - } catch (Exception e) { - throw new RuntimeException("Failed to load [" + this.componentType + "] ManagedComponent [" - + this.componentName + "].", e); - } - if (managedComponent == null) - throw new IllegalStateException("Failed to find [" + this.componentType + "] ManagedComponent named [" - + this.componentName + "]."); - log.trace("Retrieved " + toString(managedComponent) + "."); - return managedComponent; - } - - @NotNull - private OperationDefinition getOperationDefinition(String operationName) { - ResourceType resourceType = getResourceContext().getResourceType(); - OperationDefinition operationDefinition = ResourceTypeUtils.getOperationDefinition(resourceType, operationName); - if (operationDefinition == null) - throw new IllegalStateException("Operation named '" + operationName - + "' is not defined for Resource type '" + resourceType.getName() + "' in the '" - + resourceType.getPlugin() + "' plugin's descriptor."); - return operationDefinition; - } - - @NotNull - private ManagedOperation getManagedOperation(OperationDefinition operationDefinition) { - ManagedComponent managedComponent = getManagedComponent(); - Set<ManagedOperation> operations = managedComponent.getOperations(); - for (ManagedOperation operation : operations) { - ConfigurationDefinition paramsConfigDef = operationDefinition.getParametersConfigurationDefinition(); - int paramCount = (paramsConfigDef != null) ? paramsConfigDef.getPropertyDefinitions().size() : 0; - if (operation.getName().equals(operationDefinition.getName()) - && (operation.getParameters().length == paramCount)) - return operation; - } - throw new IllegalStateException("ManagedOperation named '" + operationDefinition.getName() - + "' not found on ManagedComponent [" + getManagedComponent() + "]."); - } - - private static String toString(ManagedComponent managedComponent) { - Map<String, ManagedProperty> properties = managedComponent.getProperties(); - return managedComponent.getClass().getSimpleName() + "@" + System.identityHashCode(managedComponent) + "[" - + "type=" + managedComponent.getType() + ", name=" + managedComponent.getName() + ", properties=" - + properties.getClass().getSimpleName() + "@" + System.identityHashCode(properties) + "]"; - } - - private static String toString(@NotNull Object value) { - if (value.getClass().isArray()) { - StringBuilder buffer = new StringBuilder(); - int lastIndex = Array.getLength(value) - 1; - for (int i = 0; i < Array.getLength(value); i++) { - buffer.append(String.valueOf(Array.get(value, i))); - if (i == lastIndex) { - break; - } - buffer.append(", "); - } - return buffer.toString(); - } else { - return value.toString(); - } - } -} +/* +* Jopr Management Platform +* Copyright (C) 2005-2009 Red Hat, Inc. +* All rights reserved. +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License, version 2, as +* published by the Free Software Foundation, and/or the GNU Lesser +* General Public License, version 2.1, also as published by the Free +* Software Foundation. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License and the GNU Lesser General Public License +* for more details. +* +* You should have received a copy of the GNU General Public License +* and the GNU Lesser General Public License along with this program; +* if not, write to the Free Software Foundation, Inc., +* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +*/ +package org.rhq.plugins.jbossas5; + +import java.lang.reflect.Array; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.jboss.deployers.spi.management.ManagementView; +import org.jboss.deployers.spi.management.deploy.DeploymentManager; +import org.jboss.deployers.spi.management.deploy.DeploymentProgress; +import org.jboss.deployers.spi.management.deploy.DeploymentStatus; +import org.jboss.managed.api.ComponentType; +import org.jboss.managed.api.ManagedComponent; +import org.jboss.managed.api.ManagedDeployment; +import org.jboss.managed.api.ManagedOperation; +import org.jboss.managed.api.ManagedProperty; +import org.jboss.managed.api.RunState; +import org.jboss.metatype.api.values.ArrayValue; +import org.jboss.metatype.api.values.CollectionValue; +import org.jboss.metatype.api.values.CompositeValue; +import org.jboss.metatype.api.values.EnumValue; +import org.jboss.metatype.api.values.MetaValue; +import org.jboss.metatype.api.values.SimpleValue; +import org.jboss.remoting.CannotConnectException; + +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import org.rhq.core.domain.configuration.Configuration; +import org.rhq.core.domain.configuration.PropertySimple; +import org.rhq.core.domain.configuration.ConfigurationUpdateStatus; +import org.rhq.core.domain.configuration.definition.ConfigurationDefinition; +import org.rhq.core.domain.measurement.AvailabilityType; +import org.rhq.core.domain.measurement.DataType; +import org.rhq.core.domain.measurement.MeasurementDataNumeric; +import org.rhq.core.domain.measurement.MeasurementDataTrait; +import org.rhq.core.domain.measurement.MeasurementReport; +import org.rhq.core.domain.measurement.MeasurementScheduleRequest; +import org.rhq.core.domain.operation.OperationDefinition; +import org.rhq.core.domain.resource.ResourceType; +import org.rhq.core.pluginapi.configuration.ConfigurationFacet; +import org.rhq.core.pluginapi.configuration.ConfigurationUpdateReport; +import org.rhq.core.pluginapi.inventory.DeleteResourceFacet; +import org.rhq.core.pluginapi.inventory.ResourceContext; +import org.rhq.core.pluginapi.measurement.MeasurementFacet; +import org.rhq.core.pluginapi.operation.OperationFacet; +import org.rhq.core.pluginapi.operation.OperationResult; +import org.rhq.core.util.exception.ThrowableUtil; +import org.rhq.plugins.jbossas5.util.ConversionUtils; +import org.rhq.plugins.jbossas5.util.DeploymentUtils; +import org.rhq.plugins.jbossas5.util.ManagedComponentUtils; +import org.rhq.plugins.jbossas5.util.ResourceTypeUtils; +import org.rhq.plugins.jbossas5.util.ResourceComponentUtils; +import org.rhq.plugins.jbossas5.util.DebugUtils; + +/** + * Service ResourceComponent for all {@link ManagedComponent}s in a Profile. + * + * @author Ian Springer + * @author Jason Dobies + * @author Mark Spritzler + */ +public class ManagedComponentComponent extends AbstractManagedComponent implements ConfigurationFacet, + DeleteResourceFacet, OperationFacet, MeasurementFacet { + public static interface Config { + String COMPONENT_TYPE = "componentType"; + String COMPONENT_SUBTYPE = "componentSubtype"; + String COMPONENT_NAME = "componentName"; + String TEMPLATE_NAME = "templateName"; + String COMPONENT_NAME_PROPERTY = "componentNameProperty"; + } + + protected static final char PREFIX_DELIMITER = '|'; + + private final Log log = LogFactory.getLog(this.getClass()); + + private String componentName; + private ComponentType componentType; + + // ResourceComponent Implementation -------------------------------------------- + + public AvailabilityType getAvailability() { + RunState runState; + try { + runState = getManagedComponent().getRunState(); + } catch (CannotConnectException e) { + return AvailabilityType.DOWN; + } + return (runState == RunState.RUNNING) ? AvailabilityType.UP : AvailabilityType.DOWN; + } + + public void start(ResourceContext<ProfileServiceComponent> resourceContext) throws Exception { + super.start(resourceContext); + this.componentType = ConversionUtils.getComponentType(getResourceContext().getResourceType()); + Configuration pluginConfig = resourceContext.getPluginConfiguration(); + this.componentName = pluginConfig.getSimple(Config.COMPONENT_NAME).getStringValue(); + log.trace("Started ResourceComponent for " + getResourceDescription() + ", managing " + this.componentType + + " component '" + this.componentName + "'."); + } + + public void stop() { + return; + } + + // ConfigurationComponent Implementation -------------------------------------------- + + public Configuration loadResourceConfiguration() + { + Configuration resourceConfig; + try + { + Map<String, ManagedProperty> managedProperties = getManagedComponent().getProperties(); + Map<String, PropertySimple> customProps = + ResourceComponentUtils.getCustomProperties(getResourceContext().getPluginConfiguration()); + if (this.log.isDebugEnabled()) this.log.debug("*** AFTER LOAD:\n" + + DebugUtils.convertPropertiesToString(managedProperties)); + resourceConfig = ConversionUtils.convertManagedObjectToConfiguration(managedProperties, + customProps, getResourceContext().getResourceType()); + } + catch (Exception e) + { + RunState runState = getManagedComponent().getRunState(); + if (runState == RunState.RUNNING) { + this.log.error("Failed to load configuration for " + getResourceDescription() + ".", e); + } else { + this.log.debug("Failed to load configuration for " + getResourceDescription() + + ", but managed component is not in the RUNNING state.", e); + } + throw new RuntimeException(ThrowableUtil.getAllMessages(e)); + } + return resourceConfig; + } + + public void updateResourceConfiguration(ConfigurationUpdateReport configurationUpdateReport) + { + Configuration resourceConfig = configurationUpdateReport.getConfiguration(); + Configuration pluginConfig = getResourceContext().getPluginConfiguration(); + try + { + ManagedComponent managedComponent = getManagedComponent(); + Map<String, ManagedProperty> managedProperties = managedComponent.getProperties(); + Map<String, PropertySimple> customProps = ResourceComponentUtils.getCustomProperties(pluginConfig); + if (this.log.isDebugEnabled()) this.log.debug("*** BEFORE UPDATE:\n" + + DebugUtils.convertPropertiesToString(managedProperties)); + ConversionUtils.convertConfigurationToManagedProperties(managedProperties, resourceConfig, + getResourceContext().getResourceType(), customProps); + if (this.log.isDebugEnabled()) this.log.debug("*** AFTER UPDATE:\n" + + DebugUtils.convertPropertiesToString(managedProperties)); + updateComponent(managedComponent); + configurationUpdateReport.setStatus(ConfigurationUpdateStatus.SUCCESS); + } + catch (Exception e) + { + this.log.error("Failed to update configuration for " + getResourceDescription() + ".", e); + configurationUpdateReport.setStatus(ConfigurationUpdateStatus.FAILURE); + configurationUpdateReport.setErrorMessage(ThrowableUtil.getAllMessages(e)); + } + } + + // DeleteResourceFacet Implementation -------------------------------------------- + + public void deleteResource() throws Exception { + DeploymentManager deploymentManager = getConnection().getDeploymentManager(); + if (!deploymentManager.isRedeploySupported()) + throw new UnsupportedOperationException("Deletion of " + getResourceContext().getResourceType().getName() + + " Resources is not currently supported."); + ManagedComponent managedComponent = getManagedComponent(); + log.debug("Removing " + getResourceDescription() + " with component " + toString(managedComponent) + "..."); + ManagementView managementView = getConnection().getManagementView(); + managementView.removeComponent(managedComponent); + ManagedDeployment parentDeployment = managedComponent.getDeployment(); + log.debug("Redeploying parent deployment '" + parentDeployment.getName() + + "' in order to complete removal of component " + toString(managedComponent) + "..."); + DeploymentProgress progress = deploymentManager.redeploy(parentDeployment.getName()); + DeploymentStatus redeployStatus = DeploymentUtils.run(progress); + if (redeployStatus.isFailed()) { + log.error("Failed to redeploy parent deployment '" + parentDeployment.getName() + + "during removal of component " + toString(managedComponent) + + " - removal may not persist when the app server is restarted.", redeployStatus.getFailure()); + } + managementView.load(); + } + + // OperationFacet Implementation -------------------------------------------- + + public OperationResult invokeOperation(String name, Configuration parameters) throws Exception { + OperationDefinition operationDefinition = getOperationDefinition(name); + ManagedOperation managedOperation = getManagedOperation(operationDefinition); + // Convert parameters into MetaValue array. + MetaValue[] parameterMetaValues = ConversionUtils.convertOperationsParametersToMetaValues(managedOperation, + parameters, operationDefinition); + // invoke() takes a varargs, so we need to pass an empty array, rather than null. + MetaValue resultMetaValue = managedOperation.invoke(parameterMetaValues); + OperationResult result = new OperationResult(); + // Convert result MetaValue to corresponding Property type. + ConversionUtils.convertManagedOperationResults(managedOperation, resultMetaValue, result.getComplexResults(), + operationDefinition); + return result; + } + + // MeasurementFacet Implementation -------------------------------------------- + + public void getValues(MeasurementReport report, Set<MeasurementScheduleRequest> metrics) throws Exception { + ManagedComponent managedComponent = getManagedComponent(); + RunState runState = managedComponent.getRunState(); + for (MeasurementScheduleRequest request : metrics) { + try { + if (request.getName().equals("runState")) { + report.addData(new MeasurementDataTrait(request, runState.name())); + } else { + Object value = getSimpleValue(managedComponent, request); + addValueToMeasurementReport(report, request, value); + } + } catch (Exception e) { + if (runState == RunState.RUNNING) { + log.error("Failed to collect metric for " + request, e); + } else { + log.debug("Failed to collect metric for " + request + + ", but managed component is not in the RUNNING state.", e); + } + } + } + } + + protected void updateComponent(ManagedComponent managedComponent) throws Exception { + log.trace("Updating " + getResourceDescription() + " with component " + toString(managedComponent) + "..."); + ManagementView managementView = getConnection().getManagementView(); + managementView.updateComponent(managedComponent); + managementView.load(); + } + + // ------------------------------------------------------------------------------ + + /** + * The name of the measurement schedule request (i.e. the metric name) can be in one of two forms: + * <p/> + * [prefix'|']simplePropertyName (e.g. "maxTime" or "ThreadPool|currentThreadCount") + * [prefix'|']compositePropertyName'.'key (e.g. "consumerCount" or "messageStatistics.count") + * + * @param managedComponent a managed component + * @param request a measurement schedule request + * @return the metric value + */ + @Nullable + protected Object getSimpleValue(ManagedComponent managedComponent, MeasurementScheduleRequest request) { + String metricName = request.getName(); + int pipeIndex = metricName.indexOf(PREFIX_DELIMITER); + // Remove the prefix if there is one (e.g. "ThreadPool|currentThreadCount" -> "currentThreadCount"). + String compositePropName = (pipeIndex == -1) ? metricName : metricName.substring(pipeIndex + 1); + int dotIndex = compositePropName.indexOf('.'); + String metricPropName = (dotIndex == -1) ? compositePropName : compositePropName.substring(0, dotIndex); + ManagedProperty metricProp = managedComponent.getProperty(metricPropName); + if (metricProp == null) { + return null; + } + MetaValue metaValue; + if (dotIndex == -1) { + metaValue = metricProp.getValue(); + } else { + CompositeValue compositeValue = (CompositeValue) metricProp.getValue(); + String key = compositePropName.substring(dotIndex + 1); + metaValue = compositeValue.get(key); + } + return getInnerValue(metaValue); + } + + // TODO: Move this to a utility class. + @Nullable + private static Object getInnerValue(MetaValue metaValue) { + if (metaValue == null) { + return null; + } + Object value; + if (metaValue.getMetaType().isSimple()) { + SimpleValue simpleValue = (SimpleValue) metaValue; + value = simpleValue.getValue(); + } else if (metaValue.getMetaType().isEnum()) { + EnumValue enumValue = (EnumValue) metaValue; + value = enumValue.getValue(); + } else if (metaValue.getMetaType().isArray()) { + ArrayValue arrayValue = (ArrayValue) metaValue; + value = arrayValue.getValue(); + } else if (metaValue.getMetaType().isCollection()) { + CollectionValue collectionValue = (CollectionValue) metaValue; + List list = new ArrayList(); + for (MetaValue element : collectionValue.getElements()) { + list.add(getInnerValue(element)); + } + value = list; + } else { + value = metaValue.toString(); + } + return value; + } + + protected void addValueToMeasurementReport(MeasurementReport report, MeasurementScheduleRequest request, + Object value) { + if (value == null) { + return; + } + String stringValue = toString(value); + + DataType dataType = request.getDataType(); + switch (dataType) { + case MEASUREMENT: + try { + MeasurementDataNumeric dataNumeric = new MeasurementDataNumeric(request, Double.valueOf(stringValue)); + report.addData(dataNumeric); + } catch (NumberFormatException e) { + log.error("Profile service did not return a numeric value as expected for metric [" + request.getName() + + "] - value returned was " + value + ".", e); + } + break; + case TRAIT: + MeasurementDataTrait dataTrait = new MeasurementDataTrait(request, stringValue); + report.addData(dataTrait); + break; + default: + throw new IllegalStateException("Unsupported measurement data type: " + dataType); + } + } + + protected ComponentType getComponentType() { + return componentType; + } + + protected String getComponentName() { + return componentName; + } + + protected ManagedComponent getManagedComponent() { + ManagedComponent managedComponent; + try { + ManagementView managementView = getConnection().getManagementView(); + managedComponent = ManagedComponentUtils.getManagedComponent(managementView, this.componentType, + this.componentName); + } catch (Exception e) { + throw new RuntimeException("Failed to load [" + this.componentType + "] ManagedComponent [" + + this.componentName + "].", e); + } + if (managedComponent == null) + throw new IllegalStateException("Failed to find [" + this.componentType + "] ManagedComponent named [" + + this.componentName + "]."); + log.trace("Retrieved " + toString(managedComponent) + "."); + return managedComponent; + } + + @NotNull + private OperationDefinition getOperationDefinition(String operationName) { + ResourceType resourceType = getResourceContext().getResourceType(); + OperationDefinition operationDefinition = ResourceTypeUtils.getOperationDefinition(resourceType, operationName); + if (operationDefinition == null) + throw new IllegalStateException("Operation named '" + operationName + + "' is not defined for Resource type '" + resourceType.getName() + "' in the '" + + resourceType.getPlugin() + "' plugin's descriptor."); + return operationDefinition; + } + + @NotNull + private ManagedOperation getManagedOperation(OperationDefinition operationDefinition) { + ManagedComponent managedComponent = getManagedComponent(); + Set<ManagedOperation> operations = managedComponent.getOperations(); + for (ManagedOperation operation : operations) { + ConfigurationDefinition paramsConfigDef = operationDefinition.getParametersConfigurationDefinition(); + int paramCount = (paramsConfigDef != null) ? paramsConfigDef.getPropertyDefinitions().size() : 0; + if (operation.getName().equals(operationDefinition.getName()) + && (operation.getParameters().length == paramCount)) + return operation; + } + throw new IllegalStateException("ManagedOperation named '" + operationDefinition.getName() + + "' not found on ManagedComponent [" + getManagedComponent() + "]."); + } + + private static String toString(ManagedComponent managedComponent) { + Map<String, ManagedProperty> properties = managedComponent.getProperties(); + return managedComponent.getClass().getSimpleName() + "@" + System.identityHashCode(managedComponent) + "[" + + "type=" + managedComponent.getType() + ", name=" + managedComponent.getName() + ", properties=" + + properties.getClass().getSimpleName() + "@" + System.identityHashCode(properties) + "]"; + } + + private static String toString(@NotNull Object value) { + if (value.getClass().isArray()) { + StringBuilder buffer = new StringBuilder(); + int lastIndex = Array.getLength(value) - 1; + for (int i = 0; i < Array.getLength(value); i++) { + buffer.append(String.valueOf(Array.get(value, i))); + if (i == lastIndex) { + break; + } + buffer.append(", "); + } + return buffer.toString(); + } else { + return value.toString(); + } + } +}
commit 19fe58e4a5f500eaa95c79eb41fd957c9589e05f Merge: f36efc3... ed06919... Author: Jay Shaughnessy jshaughn@redhat.com Date: Fri Jul 2 09:12:40 2010 -0400
Merge branch 'release-3.0.0' of ssh://git.fedorahosted.org/git/rhq/rhq into release-3.0.0
commit f36efc3c6df28459c7580fa4a3ed3f377a859c22 Author: Jay Shaughnessy jshaughn@redhat.com Date: Fri Jul 2 09:11:01 2010 -0400
trivial - Remove some left-behind dev logging
diff --git a/modules/plugins/tomcat/src/main/java/org/jboss/on/plugins/tomcat/TomcatDiscoveryComponent.java b/modules/plugins/tomcat/src/main/java/org/jboss/on/plugins/tomcat/TomcatDiscoveryComponent.java index dfd4ec6..3007520 100644 --- a/modules/plugins/tomcat/src/main/java/org/jboss/on/plugins/tomcat/TomcatDiscoveryComponent.java +++ b/modules/plugins/tomcat/src/main/java/org/jboss/on/plugins/tomcat/TomcatDiscoveryComponent.java @@ -24,8 +24,6 @@ package org.jboss.on.plugins.tomcat;
import java.io.File; -import java.net.InetAddress; -import java.net.UnknownHostException; import java.util.Arrays; import java.util.HashSet; import java.util.List; @@ -35,7 +33,9 @@ import java.util.regex.Pattern;
import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; + import org.jboss.on.plugins.tomcat.helper.TomcatConfig; + import org.rhq.core.domain.configuration.Configuration; import org.rhq.core.domain.configuration.PropertySimple; import org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails; @@ -109,7 +109,6 @@ public class TomcatDiscoveryComponent implements ResourceDiscoveryComponent, Man public static final String EWS_TOMCAT_5 = "tomcat5";
public Set<DiscoveredResourceDetails> discoverResources(ResourceDiscoveryContext context) { - log.warn("DEBUG DEPLOYMENT...."); log.debug("Discovering Tomcat servers...");
Set<DiscoveredResourceDetails> resources = new HashSet<DiscoveredResourceDetails>(); @@ -139,10 +138,9 @@ public class TomcatDiscoveryComponent implements ResourceDiscoveryComponent, Man }
public DiscoveredResourceDetails discoverResource(Configuration pluginConfig, - ResourceDiscoveryContext discoveryContext) - throws InvalidPluginConfigurationException { - String catalinaHome = pluginConfig.getSimple( - TomcatServerComponent.PLUGIN_CONFIG_CATALINA_HOME_PATH).getStringValue(); + ResourceDiscoveryContext discoveryContext) throws InvalidPluginConfigurationException { + String catalinaHome = pluginConfig.getSimple(TomcatServerComponent.PLUGIN_CONFIG_CATALINA_HOME_PATH) + .getStringValue(); try { catalinaHome = FileUtils.getCanonicalPath(catalinaHome); } catch (Exception e) { @@ -151,8 +149,8 @@ public class TomcatDiscoveryComponent implements ResourceDiscoveryComponent, Man } File catalinaHomeDir = new File(catalinaHome);
- String catalinaBase = pluginConfig.getSimple( - TomcatServerComponent.PLUGIN_CONFIG_CATALINA_BASE_PATH).getStringValue(); + String catalinaBase = pluginConfig.getSimple(TomcatServerComponent.PLUGIN_CONFIG_CATALINA_BASE_PATH) + .getStringValue(); try { catalinaBase = FileUtils.getCanonicalPath(catalinaBase); } catch (Exception e) { @@ -190,24 +188,23 @@ public class TomcatDiscoveryComponent implements ResourceDiscoveryComponent, Man TomcatConfig tomcatConfig = parseTomcatConfig(catalinaBase); version = determineVersion(catalinaHome, catalinaBase, systemInfo); if (tomcatConfig.getAddress() != null) { - address = tomcatConfig.getAddress(); - }else + address = tomcatConfig.getAddress(); + } else address = hostname; if (tomcatConfig.getPort() != null) { - port = tomcatConfig.getPort(); + port = tomcatConfig.getPort(); } }
String productDescription = PRODUCT_DESCRIPTION + ((hostname == null) ? "" : (" (" + hostname + ")")); - String resourceName=null; - - + String resourceName = null; + resourceName = address + (port == null ? "" : ":" + port); String resourceKey = catalinaBase; populatePluginConfiguration(pluginConfig, catalinaHome, catalinaBase, null);
- DiscoveredResourceDetails resource = new DiscoveredResourceDetails(discoveryContext.getResourceType(), resourceKey, - resourceName, version, productDescription, pluginConfig, null); + DiscoveredResourceDetails resource = new DiscoveredResourceDetails(discoveryContext.getResourceType(), + resourceKey, resourceName, version, productDescription, pluginConfig, null); log.debug("Verified manually-added Tomcat Resource with plugin config: " + pluginConfig);
return resource; @@ -270,7 +267,7 @@ public class TomcatDiscoveryComponent implements ResourceDiscoveryComponent, Man String hostname = systemInfo.getHostname(); TomcatConfig tomcatConfig = parseTomcatConfig(catalinaBase); tomcatConfig = applySystemProperties(tomcatConfig, commandLine); - + // Create pieces necessary for the resource creation String resourceVersion = determineVersion(catalinaHome, catalinaBase, systemInfo); String productName = PRODUCT_NAME; @@ -563,13 +560,13 @@ public class TomcatDiscoveryComponent implements ResourceDiscoveryComponent, Man String address = applySystemProperty(config.getAddress(), commandLine); return new TomcatConfig(port, address); } - + private String applySystemProperty(String variable, String[] commandLine) { if (variable != null && variable.startsWith("${") && variable.endsWith("}")) { String variableName = variable.substring(2, variable.length() - 1); //${var} - + String envVarDefine = "-D" + variableName + "="; - for(String commandLineArg : commandLine) { + for (String commandLineArg : commandLine) { if (commandLineArg.startsWith(envVarDefine)) { return commandLineArg.substring(envVarDefine.length()); }
commit ed06919e4cf55e206a6cd6dec0afcf0ab3213c73 Author: Lukas Krejci lkrejci@redhat.com Date: Fri Jul 2 00:52:37 2010 +0200
BZ 602678 - Hardening the snmp www service index matching algorithm some more...
diff --git a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheVirtualHostServiceComponent.java b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheVirtualHostServiceComponent.java index e44fef5..73d6ee5 100644 --- a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheVirtualHostServiceComponent.java +++ b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheVirtualHostServiceComponent.java @@ -547,10 +547,6 @@ public class ApacheVirtualHostServiceComponent implements ResourceComponent<Apac
int snmpPort = Integer.parseInt(fullPort.substring(fullPort.lastIndexOf(".") + 1));
- //the snmp represent wildcard ports as 0 and so does HttpdAddressUtility.Address class - //we can therefore match the Address generated from the snmp values and the Addresses - //stored for this vhost directly. - HttpdAddressUtility.Address snmpAddress = new HttpdAddressUtility.Address(snmpHost, snmpPort);
int matchRate = matchRate(vhostAddresses, snmpAddress); @@ -570,32 +566,59 @@ public class ApacheVirtualHostServiceComponent implements ResourceComponent<Apac return snmpWwwServiceIndex; }
- private int matchRate(List<HttpdAddressUtility.Address> addresses, HttpdAddressUtility.Address addressToCheck) throws UnknownHostException { + private int matchRate(List<HttpdAddressUtility.Address> addresses, HttpdAddressUtility.Address addressToCheck) { for(HttpdAddressUtility.Address a : addresses) { - if (HttpdAddressUtility.isAddressConforming(addressToCheck, a.host, a.port)) { + if (HttpdAddressUtility.isAddressConforming(addressToCheck, a.host, a.port, true)) { return 3; } }
//try to get the IP of the address to check - InetAddress[] ipAddresses = InetAddress.getAllByName(addressToCheck.host); - - for(InetAddress ip : ipAddresses) { - HttpdAddressUtility.Address newCheck = new HttpdAddressUtility.Address(ip.getHostAddress(), addressToCheck.port); - - for(HttpdAddressUtility.Address a : addresses) { - if (HttpdAddressUtility.isAddressConforming(newCheck, a.host, a.port)) { - return 2; + InetAddress[] ipAddresses; + try { + ipAddresses = InetAddress.getAllByName(addressToCheck.host); + for(InetAddress ip : ipAddresses) { + HttpdAddressUtility.Address newCheck = new HttpdAddressUtility.Address(ip.getHostAddress(), addressToCheck.port); + + for(HttpdAddressUtility.Address a : addresses) { + if (HttpdAddressUtility.isAddressConforming(newCheck, a.host, a.port, true)) { + return 2; + } } - } + } + } catch (UnknownHostException e) { + log.debug("Unknown host encountered in the httpd configuration: " + addressToCheck.host); + return 0; + } + + //this stupid 80 = 0 rule is to conform with snmp module + //the problem is that snmp module represents both 80 and * port defs as 0, + //so whatever we do, we might mismatch the vhost. But there's no working around that + //but to modify the snmp module itself. + + int addressPort = addressToCheck.port; + if (addressPort == 80) { + addressPort = 0; }
//ok, try the hardest... for(HttpdAddressUtility.Address listAddress: addresses) { - InetAddress[] listAddresses = InetAddress.getAllByName(listAddress.host); + int listPort = listAddress.port; + if (listPort == 80) { + listPort = 0; + } + + InetAddress[] listAddresses; + try { + listAddresses = InetAddress.getAllByName(listAddress.host); + } catch (UnknownHostException e) { + log.debug("Unknown host encountered in the httpd configuration: " + listAddress.host); + return 0; + } + for (InetAddress listInetAddr : listAddresses) { for (InetAddress ip : ipAddresses) { - if (ip.equals(listInetAddr) && addressToCheck.port == listAddress.port) { + if (ip.equals(listInetAddr) && addressPort == listPort) { return 1; } } diff --git a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/util/HttpdAddressUtility.java b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/util/HttpdAddressUtility.java index 261c446..c5589fd 100644 --- a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/util/HttpdAddressUtility.java +++ b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/util/HttpdAddressUtility.java @@ -74,7 +74,7 @@ public enum HttpdAddressUtility { }
for (Address address : addressesToMatch) { - if (isAddressConforming(address, limitToHost, limitToPort)) { + if (isAddressConforming(address, limitToHost, limitToPort, false)) { if (!address.isPortDefined() || address.isPortWildcard()) { address.port = 80; } @@ -101,7 +101,7 @@ public enum HttpdAddressUtility { try { for(ApacheDirective n : ag.search("/Listen")) { Address addr = parseListen(n.getValues().get(0)); - if (isAddressConforming(addr, limitToHost, limitToPort)) { + if (isAddressConforming(addr, limitToHost, limitToPort, false)) { if (addr.host == null || addr.isHostDefault() || addr.isHostWildcard()) { addr = getLocalhost(addr.port); } @@ -285,7 +285,18 @@ public enum HttpdAddressUtility { return ret; }
- public static boolean isAddressConforming(Address listen, String limitingHost, int limitingPort) { + /** + * Checks that given address represents a possibly wildcarded limitingHost and limitingPort values. + * + * @param listen the address to check + * @param limitingHost the host to limit to. The null value or the {@link Address#DEFAULT_HOST} + * or the {@link Address#WILDCARD} are not considered limiting + * @param limitingPort the port to limit the address to. Values <= 0 are not considered limiting + * @param snmpModuleCompatibleMode the snmp module represents both port 80 and port wildcard (*) as '0'. + * If this flag is set to true, this method takes that into account. + * @return + */ + public static boolean isAddressConforming(Address listen, String limitingHost, int limitingPort, boolean snmpModuleCompatibleMode) { if (Address.DEFAULT_HOST.equals(limitingHost) || Address.WILDCARD.equals(limitingHost)) { limitingHost = null; } @@ -298,7 +309,22 @@ public enum HttpdAddressUtility { hostOk = true; }
- if (!portOk && limitingPort == listen.port) { + int listenPort = listen.port; + + //this stupid 80 = 0 rule is to conform with snmp module + //the problem is that snmp module represents both 80 and * port defs as 0, + //so whatever we do, we might mismatch the vhost. But there's no working around that + //but to modify the snmp module itself. + if (snmpModuleCompatibleMode) { + if (limitingPort == 80) { + limitingPort = 0; + } + if (listenPort == 80) { + listenPort = 0; + } + } + + if (!portOk && limitingPort == listenPort) { portOk = true; }
commit e2401654dc65cec944f17b4c260bfa59544684ee Author: Ian Springer ian.springer@redhat.com Date: Thu Jul 1 18:14:00 2010 -0400
PluginDescriptorGenerator's main method now accepts jnp URL as optional arg
diff --git a/modules/jopr/tools/jbas5-plugin-descriptor-gen/src/main/java/org/jboss/jopr/tool/jbas5/PluginDescriptorGenerator.java b/modules/jopr/tools/jbas5-plugin-descriptor-gen/src/main/java/org/jboss/jopr/tool/jbas5/PluginDescriptorGenerator.java index 7551e42..49e6089 100644 --- a/modules/jopr/tools/jbas5-plugin-descriptor-gen/src/main/java/org/jboss/jopr/tool/jbas5/PluginDescriptorGenerator.java +++ b/modules/jopr/tools/jbas5-plugin-descriptor-gen/src/main/java/org/jboss/jopr/tool/jbas5/PluginDescriptorGenerator.java @@ -104,7 +104,11 @@ public class PluginDescriptorGenerator
public static void main(String[] args) throws Exception { - String namingURL = "jnp://127.0.0.1:1099/"; + if (args.length > 1) + { + throw new IllegalArgumentException("Too many args. Usage: " + PluginDescriptorGenerator.class.getSimpleName() + " [jnpURL]"); + } + String namingURL = (args.length == 1) ? args[0] : "jnp://127.0.0.1:1099/"; String principal = "admin"; String credentials = "admin"; ProfileServiceConnectionProvider connectionProvider =
commit a00d97747e7998561aab6c50923d75c21784eda3 Merge: aa0c4ae... 275fc74... Author: Jay Shaughnessy jshaughn@redhat.com Date: Thu Jul 1 15:23:53 2010 -0400
Merge branch 'release-3.0.0' of ssh://git.fedorahosted.org/git/rhq/rhq into release-3.0.0
commit aa0c4ae5a1d95a08c2acefb3019130155a4f97f8 Author: Jay Shaughnessy jshaughn@redhat.com Date: Thu Jul 1 15:09:43 2010 -0400
trivial change for readability
diff --git a/modules/plugins/jmx/src/main/java/org/rhq/plugins/jmx/MBeanResourceComponent.java b/modules/plugins/jmx/src/main/java/org/rhq/plugins/jmx/MBeanResourceComponent.java index 6d7995a..0aa7f26 100644 --- a/modules/plugins/jmx/src/main/java/org/rhq/plugins/jmx/MBeanResourceComponent.java +++ b/modules/plugins/jmx/src/main/java/org/rhq/plugins/jmx/MBeanResourceComponent.java @@ -131,9 +131,9 @@ public class MBeanResourceComponent<T extends JMXComponent> implements Measureme EmsConnection beanConn = (null != this.bean) ? this.bean.getConnectionProvider().getExistingConnection() : null; EmsConnection currConn = (null != this.bean) ? getEmsConnection() : null;
- if ((this.bean == null) || !beanConn.equals(currConn)) { + if ((null == this.bean) || !beanConn.equals(currConn)) { this.bean = loadBean(); - if (this.bean == null) + if (null == this.bean) throw new IllegalStateException("EMS bean was null for Resource with type [" + this.resourceContext.getResourceType() + "] and key [" + this.resourceContext.getResourceKey() + "].");
commit eb21005eea0ec8b61ab97ee21671264415278e32 Author: Jay Shaughnessy jshaughn@redhat.com Date: Thu Jul 1 15:05:48 2010 -0400
As a best practice for overriding JMX getAvail, make sure the bean is valid before continuing on with other validity requirements.
diff --git a/modules/plugins/tomcat/src/main/java/org/jboss/on/plugins/tomcat/TomcatConnectorComponent.java b/modules/plugins/tomcat/src/main/java/org/jboss/on/plugins/tomcat/TomcatConnectorComponent.java index 7082b5b..0265123 100644 --- a/modules/plugins/tomcat/src/main/java/org/jboss/on/plugins/tomcat/TomcatConnectorComponent.java +++ b/modules/plugins/tomcat/src/main/java/org/jboss/on/plugins/tomcat/TomcatConnectorComponent.java @@ -32,6 +32,7 @@ import org.apache.commons.logging.LogFactory; import org.mc4j.ems.connection.EmsConnection; import org.mc4j.ems.connection.bean.EmsBean; import org.mc4j.ems.connection.bean.attribute.EmsAttribute; + import org.rhq.core.domain.configuration.Configuration; import org.rhq.core.domain.configuration.ConfigurationUpdateStatus; import org.rhq.core.domain.configuration.definition.ConfigurationDefinition; @@ -84,14 +85,21 @@ public class TomcatConnectorComponent extends MBeanResourceComponent<TomcatServe
@Override public AvailabilityType getAvailability() { - // When the connector is stopped its associated GlobalRequestProcessor will not exist. We test - // for availability by checking the existence of objectName Catalina:type=GlobalRequestProcessor,name=%handler%[%address%]-%port%. - String objectName = getGlobalRequestProcessorName(); - EmsConnection connection = getEmsConnection(); - ObjectNameQueryUtility queryUtility = new ObjectNameQueryUtility(objectName); - List<EmsBean> beans = connection.queryBeans(queryUtility.getTranslatedQuery()); - - return (beans.isEmpty()) ? AvailabilityType.DOWN : AvailabilityType.UP; + // First, ensure the underlying mbean for the connector is active + AvailabilityType result = super.getAvailability(); + + if (AvailabilityType.UP == result) { + // When the connector is stopped its associated GlobalRequestProcessor will not exist. We test + // for availability by checking the existence of objectName Catalina:type=GlobalRequestProcessor,name=%handler%[%address%]-%port%. + String objectName = getGlobalRequestProcessorName(); + EmsConnection connection = getEmsConnection(); + ObjectNameQueryUtility queryUtility = new ObjectNameQueryUtility(objectName); + List<EmsBean> beans = connection.queryBeans(queryUtility.getTranslatedQuery()); + + result = (beans.isEmpty()) ? AvailabilityType.DOWN : AvailabilityType.UP; + } + + return result; }
@Override
commit c6a959a6fd636f15c76493bf20a9ad779e441175 Author: Jay Shaughnessy jshaughn@redhat.com Date: Thu Jul 1 12:09:58 2010 -0400
[BZ 608148] Ensure the cached mbean is valid before returning it. If it has a stale connection refresh the bean.
diff --git a/modules/plugins/jmx/src/main/java/org/rhq/plugins/jmx/MBeanResourceComponent.java b/modules/plugins/jmx/src/main/java/org/rhq/plugins/jmx/MBeanResourceComponent.java index 33a64db..6d7995a 100644 --- a/modules/plugins/jmx/src/main/java/org/rhq/plugins/jmx/MBeanResourceComponent.java +++ b/modules/plugins/jmx/src/main/java/org/rhq/plugins/jmx/MBeanResourceComponent.java @@ -127,13 +127,18 @@ public class MBeanResourceComponent<T extends JMXComponent> implements Measureme * @see #loadBean() */ public EmsBean getEmsBean() { - if (this.bean == null) { + // make sure the connection used to cache the bean is still the current connection. if not, re-cache the bean + EmsConnection beanConn = (null != this.bean) ? this.bean.getConnectionProvider().getExistingConnection() : null; + EmsConnection currConn = (null != this.bean) ? getEmsConnection() : null; + + if ((this.bean == null) || !beanConn.equals(currConn)) { this.bean = loadBean(); if (this.bean == null) throw new IllegalStateException("EMS bean was null for Resource with type [" + this.resourceContext.getResourceType() + "] and key [" + this.resourceContext.getResourceKey() + "]."); } + return this.bean; }
commit 275fc7441e3ea61fef5b3abbecf01c9c98713ade Author: Joseph Marques joseph@redhat.com Date: Thu Jul 1 10:57:53 2010 -0400
BZ-608920 - fix sorting on location column of event>history page
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/events/history.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/events/history.xhtml index a6b25a7..0dd0db8 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/events/history.xhtml +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/events/history.xhtml @@ -130,7 +130,7 @@
rich:column <f:facet name="header"> - <onc:sortableColumnHeader sort="location"> + <onc:sortableColumnHeader sort="source.location"> <h:outputText styleClass="headerText" value="Source" /> </onc:sortableColumnHeader> </f:facet>
commit e4b46e67e9dc33ef523d505f94fea84dbef507c0 Author: Joseph Marques joseph@redhat.com Date: Thu Jul 1 01:59:57 2010 -0400
BZ-535692: improve short-cutting logic for alert condition processing
* if an alert definition has been deleted, looking up by alert condition id should return no results * this will prevent downstream out-of-band alert processing from throwing exceptions later
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/alert/AlertDefinition.java b/modules/core/domain/src/main/java/org/rhq/core/domain/alert/AlertDefinition.java index 94ae2fe..770c211 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/alert/AlertDefinition.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/alert/AlertDefinition.java @@ -177,9 +177,11 @@ import org.rhq.core.domain.resource.group.ResourceGroup; + " WHERE aadc.category = :category ) " // + " OR :category IS NULL) "), // @NamedQuery(name = AlertDefinition.QUERY_FIND_DEFINITION_ID_BY_CONDITION_ID, query = "" // - + "SELECT ac.alertDefinition.id " // + + "SELECT ad.id " // + " FROM AlertCondition ac " // - + " WHERE ac.id = :alertConditionId "), // + + " JOIN ac.alertDefinition ad" // + + " WHERE ac.id = :alertConditionId " // + + " AND ad.enabled = true "), // @NamedQuery(name = AlertDefinition.QUERY_IS_ENABLED, query = "" // + "SELECT ad.id " // + " FROM AlertDefinition ad " //
commit 41348de6f90b9a7335a0e48e13752745eb64937e Merge: 9b0cd1f... 968f756... Author: Filip Drabek fdrabek@dhcp-lab-136.englab.brq.redhat.com Date: Thu Jul 1 12:00:16 2010 +0200
Merge branch 'release-3.0.0' of ssh://git.fedorahosted.org/git/rhq/rhq into release-3.0.0
commit 9b0cd1f7ca26880dd57176153c78c7ffbcaeea6e Author: Filip Drabek fdrabek@dhcp-lab-136.englab.brq.redhat.com Date: Thu Jul 1 11:59:11 2010 +0200
fix of bugs in equals methods
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/content/AdvisoryBuglist.java b/modules/core/domain/src/main/java/org/rhq/core/domain/content/AdvisoryBuglist.java index ab4f537..2b36da6 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/content/AdvisoryBuglist.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/content/AdvisoryBuglist.java @@ -146,7 +146,7 @@ public class AdvisoryBuglist implements Serializable { final AdvisoryBuglist other = (AdvisoryBuglist) obj;
if (advisory == null) { - if (advisory != null) { + if (other.advisory != null) { return false; } } else if (!advisory.equals(other.advisory)) { diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/content/AdvisoryCVE.java b/modules/core/domain/src/main/java/org/rhq/core/domain/content/AdvisoryCVE.java index 346880c..24d0c9b 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/content/AdvisoryCVE.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/content/AdvisoryCVE.java @@ -148,7 +148,7 @@ public class AdvisoryCVE implements Serializable { final AdvisoryCVE other = (AdvisoryCVE) obj;
if (advisory == null) { - if (advisory != null) { + if (other.advisory != null) { return false; } } else if (!advisory.equals(other.advisory)) { @@ -156,7 +156,7 @@ public class AdvisoryCVE implements Serializable { }
if (cve == null) { - if (cve != null) { + if (other.cve != null) { return false; } } else if (!cve.equals(other.cve)) { diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/content/AdvisoryPackage.java b/modules/core/domain/src/main/java/org/rhq/core/domain/content/AdvisoryPackage.java index 2185c65..a44136b 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/content/AdvisoryPackage.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/content/AdvisoryPackage.java @@ -148,7 +148,7 @@ public class AdvisoryPackage implements Serializable { final AdvisoryPackage other = (AdvisoryPackage) obj;
if (advisory == null) { - if (advisory != null) { + if (other.advisory != null) { return false; } } else if (!advisory.equals(other.advisory)) { @@ -156,7 +156,7 @@ public class AdvisoryPackage implements Serializable { }
if (pkg == null) { - if (pkg != null) { + if (other.pkg != null) { return false; } } else if (!pkg.equals(other.pkg)) { diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/content/DistributionFile.java b/modules/core/domain/src/main/java/org/rhq/core/domain/content/DistributionFile.java index 0ba61b0..1bf02b8 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/content/DistributionFile.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/content/DistributionFile.java @@ -173,7 +173,7 @@ public class DistributionFile { DistributionFile other = (DistributionFile) obj;
if (getDistribution() == null) { - if (getDistribution() != null) { + if (other.getDistribution() != null) { return false; } } else if (!getDistribution().equals(other.getDistribution())) { diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/content/PackageVersionContentSource.java b/modules/core/domain/src/main/java/org/rhq/core/domain/content/PackageVersionContentSource.java index ffaaed7..316150b 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/content/PackageVersionContentSource.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/content/PackageVersionContentSource.java @@ -196,7 +196,7 @@ public class PackageVersionContentSource implements Serializable { final PackageVersionContentSource other = (PackageVersionContentSource) obj;
if (packageVersion == null) { - if (packageVersion != null) { + if (other.packageVersion != null) { return false; } } else if (!packageVersion.equals(other.packageVersion)) { @@ -204,7 +204,7 @@ public class PackageVersionContentSource implements Serializable { }
if (contentSource == null) { - if (contentSource != null) { + if (other.contentSource != null) { return false; } } else if (!contentSource.equals(other.contentSource)) { diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/content/ProductVersionPackageVersion.java b/modules/core/domain/src/main/java/org/rhq/core/domain/content/ProductVersionPackageVersion.java index 982c961..a8571bd 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/content/ProductVersionPackageVersion.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/content/ProductVersionPackageVersion.java @@ -108,7 +108,7 @@ public class ProductVersionPackageVersion implements Serializable { final ProductVersionPackageVersion other = (ProductVersionPackageVersion) obj;
if (productVersion == null) { - if (productVersion != null) { + if (other.productVersion != null) { return false; } } else if (!productVersion.equals(other.productVersion)) { @@ -116,7 +116,7 @@ public class ProductVersionPackageVersion implements Serializable { }
if (packageVersion == null) { - if (packageVersion != null) { + if (other.packageVersion != null) { return false; } } else if (!packageVersion.equals(other.packageVersion)) { diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/content/RepoAdvisory.java b/modules/core/domain/src/main/java/org/rhq/core/domain/content/RepoAdvisory.java index dac537a..9f31e1c 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/content/RepoAdvisory.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/content/RepoAdvisory.java @@ -147,7 +147,7 @@ public class RepoAdvisory implements Serializable { final RepoAdvisory other = (RepoAdvisory) obj;
if (repo == null) { - if (repo != null) { + if (other.repo != null) { return false; } } else if (!repo.equals(other.repo)) { @@ -155,7 +155,7 @@ public class RepoAdvisory implements Serializable { }
if (advisory == null) { - if (advisory != null) { + if (other.advisory != null) { return false; } } else if (!advisory.equals(other.advisory)) { diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/content/RepoContentSource.java b/modules/core/domain/src/main/java/org/rhq/core/domain/content/RepoContentSource.java index 4311cc9..3c87044 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/content/RepoContentSource.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/content/RepoContentSource.java @@ -130,7 +130,7 @@ public class RepoContentSource implements Serializable { final RepoContentSource other = (RepoContentSource) obj;
if (repo == null) { - if (repo != null) { + if (other.repo != null) { return false; } } else if (!repo.equals(other.repo)) { @@ -138,7 +138,7 @@ public class RepoContentSource implements Serializable { }
if (contentSource == null) { - if (contentSource != null) { + if (other.contentSource != null) { return false; } } else if (!contentSource.equals(other.contentSource)) { diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/content/RepoDistribution.java b/modules/core/domain/src/main/java/org/rhq/core/domain/content/RepoDistribution.java index 113c543..d9b8c8b 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/content/RepoDistribution.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/content/RepoDistribution.java @@ -142,7 +142,7 @@ public class RepoDistribution implements Serializable { final RepoDistribution other = (RepoDistribution) obj;
if (repo == null) { - if (repo != null) { + if (other.repo != null) { return false; } } else if (!repo.equals(other.repo)) { @@ -150,7 +150,7 @@ public class RepoDistribution implements Serializable { }
if (dist == null) { - if (dist != null) { + if (other.dist != null) { return false; } } else if (!dist.equals(other.dist)) { diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/content/RepoPackageVersion.java b/modules/core/domain/src/main/java/org/rhq/core/domain/content/RepoPackageVersion.java index 668fa32..90754ac 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/content/RepoPackageVersion.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/content/RepoPackageVersion.java @@ -138,7 +138,7 @@ public class RepoPackageVersion implements Serializable { final RepoPackageVersion other = (RepoPackageVersion) obj;
if (repo == null) { - if (repo != null) { + if (other.repo != null) { return false; } } else if (!repo.equals(other.repo)) { @@ -146,7 +146,7 @@ public class RepoPackageVersion implements Serializable { }
if (packageVersion == null) { - if (packageVersion != null) { + if (other.packageVersion != null) { return false; } } else if (!packageVersion.equals(other.packageVersion)) { diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/content/RepoRepoGroup.java b/modules/core/domain/src/main/java/org/rhq/core/domain/content/RepoRepoGroup.java index 9a06210..527c83a 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/content/RepoRepoGroup.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/content/RepoRepoGroup.java @@ -127,7 +127,7 @@ public class RepoRepoGroup implements Serializable { final RepoRepoGroup other = (RepoRepoGroup) obj;
if (repo == null) { - if (repo != null) { + if (other.repo != null) { return false; } } else if (!repo.equals(other.repo)) { @@ -135,7 +135,7 @@ public class RepoRepoGroup implements Serializable { }
if (repoGroup == null) { - if (repoGroup != null) { + if (other.repoGroup != null) { return false; } } else if (!repoGroup.equals(other.repoGroup)) { diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/content/RepoRepoRelationship.java b/modules/core/domain/src/main/java/org/rhq/core/domain/content/RepoRepoRelationship.java index c93f374..3375c69 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/content/RepoRepoRelationship.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/content/RepoRepoRelationship.java @@ -134,7 +134,7 @@ public class RepoRepoRelationship implements Serializable { final RepoRepoRelationship other = (RepoRepoRelationship) obj;
if (repo == null) { - if (repo != null) { + if (other.repo != null) { return false; } } else if (!repo.equals(other.repo)) { @@ -142,7 +142,7 @@ public class RepoRepoRelationship implements Serializable { }
if (repoRelationship == null) { - if (repoRelationship != null) { + if (other.repoRelationship != null) { return false; } } else if (!repoRelationship.equals(other.repoRelationship)) { diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/content/ResourceRepo.java b/modules/core/domain/src/main/java/org/rhq/core/domain/content/ResourceRepo.java index 54721eb..2944bef 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/content/ResourceRepo.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/content/ResourceRepo.java @@ -137,7 +137,7 @@ public class ResourceRepo implements Serializable { final ResourceRepo other = (ResourceRepo) obj;
if (resource == null) { - if (resource != null) { + if (other.resource != null) { return false; } } else if (!resource.equals(other.resource)) { @@ -145,7 +145,7 @@ public class ResourceRepo implements Serializable { }
if (repo == null) { - if (repo != null) { + if (other.repo != null) { return false; } } else if (!repo.equals(other.repo)) {
commit 968f756a62a0931ee7e1addd6c9041864a8db336 Merge: abc1adc... 5055dca... Author: Ian Springer ian.springer@redhat.com Date: Wed Jun 30 18:44:06 2010 -0400
Merge branch 'release-3.0.0' of ssh://git.fedorahosted.org/git/rhq/rhq into release-3.0.0
commit abc1adc013a10a6b6d3a380be91ec12457c66524 Author: Ian Springer ian.springer@redhat.com Date: Wed Jun 30 18:42:59 2010 -0400
fix so "Partition Name" trait returns a non-null value for an EAP 5.0.x server running "production" config (https://bugzilla.redhat.com/show_bug.cgi?id=594520)
diff --git a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ApplicationServerComponent.java b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ApplicationServerComponent.java index e21153e..6b5dfa4 100644 --- a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ApplicationServerComponent.java +++ b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ApplicationServerComponent.java @@ -28,7 +28,6 @@ import java.io.Serializable; import java.net.URI; import java.net.URISyntaxException; import java.util.ArrayList; -import java.util.Collection; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -44,13 +43,10 @@ import org.jboss.deployers.spi.management.ManagementView; import org.jboss.deployers.spi.management.deploy.ProgressEvent; import org.jboss.deployers.spi.management.deploy.ProgressListener; import org.jboss.managed.api.ComponentType; -import org.jboss.managed.api.DeploymentTemplateInfo; import org.jboss.managed.api.ManagedComponent; -import org.jboss.managed.api.ManagedProperty; import org.jboss.metatype.api.values.SimpleValue; import org.jboss.on.common.jbossas.JBPMWorkflowManager; import org.jboss.on.common.jbossas.JBossASPaths; -import org.jboss.profileservice.spi.NoSuchDeploymentException;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -60,11 +56,7 @@ import org.mc4j.ems.connection.support.metadata.InternalVMTypeDescriptor; import org.rhq.core.domain.content.transfer.DeployPackagesResponse; import org.rhq.core.domain.content.transfer.RemovePackagesResponse; import org.rhq.core.domain.configuration.Configuration; -import org.rhq.core.domain.configuration.Property; import org.rhq.core.domain.configuration.PropertySimple; -import org.rhq.core.domain.configuration.definition.ConfigurationDefinition; -import org.rhq.core.domain.configuration.definition.ConfigurationTemplate; -import org.rhq.core.domain.configuration.definition.PropertyDefinition; import org.rhq.core.domain.content.PackageType; import org.rhq.core.domain.content.transfer.DeployPackageStep; import org.rhq.core.domain.content.transfer.ResourcePackageDetails; @@ -74,9 +66,6 @@ import org.rhq.core.domain.measurement.MeasurementDataNumeric; import org.rhq.core.domain.measurement.MeasurementDataTrait; import org.rhq.core.domain.measurement.MeasurementReport; import org.rhq.core.domain.measurement.MeasurementScheduleRequest; -import org.rhq.core.domain.resource.CreateResourceStatus; -import org.rhq.core.domain.resource.ResourceCreationDataType; -import org.rhq.core.domain.resource.ResourceType; import org.rhq.core.pluginapi.availability.AvailabilityCollectorRunnable; import org.rhq.core.pluginapi.availability.AvailabilityFacet; import org.rhq.core.pluginapi.configuration.ConfigurationFacet; @@ -93,23 +82,15 @@ import org.rhq.core.pluginapi.inventory.ResourceContext; import org.rhq.core.pluginapi.measurement.MeasurementFacet; import org.rhq.core.pluginapi.operation.OperationFacet; import org.rhq.core.pluginapi.operation.OperationResult; -import org.rhq.plugins.jbossas5.adapter.api.PropertyAdapter; -import org.rhq.plugins.jbossas5.adapter.api.PropertyAdapterFactory; import org.rhq.plugins.jbossas5.connection.LocalProfileServiceConnectionProvider; import org.rhq.plugins.jbossas5.connection.ProfileServiceConnection; import org.rhq.plugins.jbossas5.connection.ProfileServiceConnectionProvider; import org.rhq.plugins.jbossas5.connection.RemoteProfileServiceConnectionProvider; -import org.rhq.plugins.jbossas5.deploy.Deployer; -import org.rhq.plugins.jbossas5.deploy.LocalDeployer; -import org.rhq.plugins.jbossas5.deploy.RemoteDeployer; import org.rhq.plugins.jbossas5.helper.CreateChildResourceFacetDelegate; import org.rhq.plugins.jbossas5.helper.JBossAS5ConnectionTypeDescriptor; import org.rhq.plugins.jbossas5.helper.JmxConnectionHelper; import org.rhq.plugins.jbossas5.helper.InPluginControlActionFacade; -import org.rhq.plugins.jbossas5.util.ConversionUtils; -import org.rhq.plugins.jbossas5.util.DebugUtils; import org.rhq.plugins.jbossas5.util.ManagedComponentUtils; -import org.rhq.plugins.jbossas5.util.ResourceComponentUtils;
import com.jboss.jbossnetwork.product.jbpm.handlers.ControlActionFacade;
@@ -125,13 +106,16 @@ public class ApplicationServerComponent implements ResourceComponent, ProfileSer
private static final Pattern METRIC_NAME_PATTERN = Pattern.compile("(.*)\|(.*)\|(.*)\|(.*)");
- public static final Map<String, String> NEW_PROPERTY_NAMES = new HashMap<String, String>(); + private static final Map<String, String> ALTERNATE_METRIC_NAMES = new HashMap<String, String>(); static { - NEW_PROPERTY_NAMES.put("transactionCount", "numberOfTransactions"); - NEW_PROPERTY_NAMES.put("commitCount", "numberOfCommittedTransactions"); - NEW_PROPERTY_NAMES.put("rollbackCount", "numberOfApplicationRollbacks"); + ALTERNATE_METRIC_NAMES.put("MCBean|JTA|*|transactionCount", "MCBean|JTA|*|numberOfTransactions"); + ALTERNATE_METRIC_NAMES.put("MCBean|JTA|*|commitCount", "MCBean|JTA|*|numberOfCommittedTransactions"); + ALTERNATE_METRIC_NAMES.put("MCBean|JTA|*|rollbackCount", "MCBean|JTA|*|numberOfApplicationRollbacks"); + ALTERNATE_METRIC_NAMES.put("MCBean|ServerConfig|*|partitionName", "MCBean|HAPartition|*|partitionName"); }
+ private static final Map<String, String> VERIFIED_METRIC_NAMES = new HashMap<String, String>(); + private final Log log = LogFactory.getLog(this.getClass());
private ResourceContext resourceContext; @@ -244,59 +228,44 @@ public class ApplicationServerComponent implements ResourceComponent, ProfileSer public void getValues(MeasurementReport report, Set<MeasurementScheduleRequest> requests) { ManagementView managementView = getConnection().getManagementView(); for (MeasurementScheduleRequest request : requests) { - String metricName = request.getName(); + String requestName = request.getName(); + String verifiedMetricName = VERIFIED_METRIC_NAMES.get(requestName); + String metricName = (verifiedMetricName != null) ? verifiedMetricName : requestName; try { - // All other metric names are expected to have the following syntax: - // "<componentType>|<componentSubType>|<componentName>|<propertyName>" - Matcher matcher = METRIC_NAME_PATTERN.matcher(metricName); - if (!matcher.matches()) { - log.error("Metric name '" + metricName + "' does not match pattern '" + METRIC_NAME_PATTERN + "'."); - continue; - } - String componentCategory = matcher.group(1); - String componentSubType = matcher.group(2); - String componentName = matcher.group(3); - String propertyName = matcher.group(4); - ComponentType componentType = new ComponentType(componentCategory, componentSubType); - ManagedComponent component; - if (componentName.equals("*")) { - component = ManagedComponentUtils.getSingletonManagedComponent(managementView, componentType); - } else { - component = ManagedComponentUtils.getManagedComponent(managementView, componentType, componentName); - } - Serializable value = null; boolean foundProperty = false; try { - value = ManagedComponentUtils.getSimplePropertyValue(component, propertyName); + value = getMetric(managementView, metricName); foundProperty = true; } catch (ManagedComponentUtils.PropertyNotFoundException e) { - if (NEW_PROPERTY_NAMES.containsKey(propertyName)) { - String newPropertyName = NEW_PROPERTY_NAMES.get(propertyName); + // ignore + } + + if (value == null) { + metricName = ALTERNATE_METRIC_NAMES.get(metricName); + if (metricName != null) { try { - value = ManagedComponentUtils.getSimplePropertyValue(component, newPropertyName); + value = getMetric(managementView, metricName); foundProperty = true; - } catch (ManagedComponentUtils.PropertyNotFoundException e1) { + } catch (ManagedComponentUtils.PropertyNotFoundException e) { // ignore } } }
if (!foundProperty) { - if (NEW_PROPERTY_NAMES.containsKey(propertyName)) { - List<String> propertyNames = new ArrayList<String>(2); - propertyNames.add(propertyName); - propertyNames.add(NEW_PROPERTY_NAMES.get(propertyName)); - log.error("Property with one of the following names was not found for ManagedComponent [" - + component + "]: " + propertyNames); - } else { - log.error("Property '" + propertyName + "' was not found for ManagedComponent [" - + component + "]."); + List<String> propertyNames = new ArrayList<String>(2); + propertyNames.add(requestName); + if (ALTERNATE_METRIC_NAMES.containsKey(requestName)) { + propertyNames.add(ALTERNATE_METRIC_NAMES.get(requestName)); } - continue; + throw new IllegalStateException("A property was not found with any of the following names: " + + propertyNames); }
- if (value == null) { + if (value != null) { + VERIFIED_METRIC_NAMES.put(requestName, metricName); + } else { log.debug("Null value returned for metric '" + metricName + "'."); continue; } @@ -308,7 +277,7 @@ public class ApplicationServerComponent implements ResourceComponent, ProfileSer report.addData(new MeasurementDataTrait(request, value.toString())); } } catch (RuntimeException e) { - log.error("Failed to obtain metric '" + metricName + "'.", e); + log.error("Failed to obtain metric '" + requestName + "'.", e); } } } @@ -550,4 +519,28 @@ public class ApplicationServerComponent implements ResourceComponent, ProfileSer } return configPath; } + + private static Serializable getMetric(ManagementView managementView, String metricName) + throws ManagedComponentUtils.PropertyNotFoundException { + // All metric names are expected to have the following syntax: + // "<componentType>|<componentSubType>|<componentName>|<propertyName>" + Matcher matcher = METRIC_NAME_PATTERN.matcher(metricName); + if (!matcher.matches()) { + throw new IllegalStateException("Metric name '" + metricName + "' does not match pattern '" + + METRIC_NAME_PATTERN + "'."); + } + String componentCategory = matcher.group(1); + String componentSubType = matcher.group(2); + String componentName = matcher.group(3); + String propertyName = matcher.group(4); + ComponentType componentType = new ComponentType(componentCategory, componentSubType); + ManagedComponent component; + if (componentName.equals("*")) { + component = ManagedComponentUtils.getSingletonManagedComponent(managementView, componentType); + } else { + component = ManagedComponentUtils.getManagedComponent(managementView, componentType, componentName); + } + + return ManagedComponentUtils.getSimplePropertyValue(component, propertyName); + } } diff --git a/modules/plugins/jboss-as-5/src/main/resources/META-INF/rhq-plugin.xml b/modules/plugins/jboss-as-5/src/main/resources/META-INF/rhq-plugin.xml index b470905..ea8ff2d 100644 --- a/modules/plugins/jboss-as-5/src/main/resources/META-INF/rhq-plugin.xml +++ b/modules/plugins/jboss-as-5/src/main/resources/META-INF/rhq-plugin.xml @@ -1084,7 +1084,7 @@ <results><c:simple-property name="operationResult" description="Outcome of restarting the server."/></results> </operation>
- <metric displayName="Partition Name" property="MCBean|ServerConfig|*|partitionName" + <metric displayName="Cluster Partition Name" property="MCBean|ServerConfig|*|partitionName" dataType="trait" displayType="summary" description="the name of the cluster partition this server belongs to"/>
commit 5055dca9b0d0bfde336be48704d50628663bd804 Author: Simeon Pinder spinder@redhat.com Date: Wed Jun 30 18:06:30 2010 -0400
BZ:607799 modifed content source to detect redirects, reinitialize and log occurrence.
diff --git a/modules/enterprise/server/plugins/jboss-software/src/main/java/org/rhq/enterprise/server/plugins/jboss/software/JBossSoftwareContentSourceAdapter.java b/modules/enterprise/server/plugins/jboss-software/src/main/java/org/rhq/enterprise/server/plugins/jboss/software/JBossSoftwareContentSourceAdapter.java index 788961e..2758e2b 100644 --- a/modules/enterprise/server/plugins/jboss-software/src/main/java/org/rhq/enterprise/server/plugins/jboss/software/JBossSoftwareContentSourceAdapter.java +++ b/modules/enterprise/server/plugins/jboss-software/src/main/java/org/rhq/enterprise/server/plugins/jboss/software/JBossSoftwareContentSourceAdapter.java @@ -23,8 +23,6 @@ import java.net.URI; import java.net.URL; import java.util.Collection;
-import javax.xml.parsers.ParserConfigurationException; - import churchillobjects.rss4j.RssDocument; import churchillobjects.rss4j.parser.RssParser;
@@ -216,8 +214,27 @@ public class JBossSoftwareContentSourceAdapter implements ContentProvider, Packa // Perform the connection and capture its response XML String rawFeed = null; try { + //store off original url to detect forwarding as 401 results otherwise + //url forwarding is true by default. + String originalUrl = method.getURI().getURI(); + int status = client.executeMethod(method);
+ //Check to see if redirection has occurred + String currentUrl = method.getURI().getURI(); + //if redirection has occurred, reconnect with correct address. + if (!originalUrl.trim().equalsIgnoreCase(currentUrl.trim())) { + method = new GetMethod(currentUrl); + method.setDoAuthentication(true); + if (username != null && password != null) { + UsernamePasswordCredentials upc = new UsernamePasswordCredentials(username, password); + client.getState().setCredentials("users", method.getHostConfiguration().getHost(), upc); + } + log.warn("Following redirect to [" + currentUrl + + "]. You may need to update your feed URL if redirect is permanent."); + status = client.executeMethod(method); + } + if (status == 404) { throw new SyncException("Could not find the feed at URL [" + url + "]. Make sure the URL field correctly refers to the CSP feed location.");
commit 4cdf9b082af3a8298b5efd6b218475b190e1cba2 Merge: 41b640f... 68af83f... Author: Jay Shaughnessy jshaughn@redhat.com Date: Wed Jun 30 15:24:54 2010 -0400
Merge branch 'release-3.0.0' into release-3.0.0-jay
Conflicts: modules/enterprise/gui/portal-war/src/main/webapp/admin/config/GeneralPropertiesConfigForm.jsp modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ManagedComponentComponent.java release.sh
diff --cc release.sh index 5ce7396,da56c27..da56c27 mode 100755,100755..100644 --- a/release.sh +++ b/release.sh
commit 68af83f4b44a2c80f2e1ca31a031deb96bffe33b Author: Jay Shaughnessy jshaughn@redhat.com Date: Wed Jun 30 15:22:48 2010 -0400
git is forcing this commit, i am just a pawn
diff --git a/etc/samples/provisioning/sample-cli/scripts/cli-2-deployBundle.js b/etc/samples/provisioning/sample-cli/scripts/cli-2-deployBundle.js new file mode 100644 index 0000000..b099286 --- /dev/null +++ b/etc/samples/provisioning/sample-cli/scripts/cli-2-deployBundle.js @@ -0,0 +1,102 @@ +/* + * RHQ Management Platform + * Copyright (C) 2005-2010 Red Hat, Inc. + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License, version 2, as + * published by the Free Software Foundation, and/or the GNU Lesser + * General Public License, version 2.1, also as published by the Free + * Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License and the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License + * and the GNU Lesser General Public License along with this program; + * if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +/** + * This sample script shows how to deploy a Bundle. It deploys the bundle created + * by the cli-1-createBundle.js script. The Bundle uses the Ant Bundle Type provided with + * RHQ. + * <pre> + * + * The deployment is to /tmp/sample-bundle. + * + * Prerequisites: + * 1) run cli-1-createBundle.js + * 2) At least one platform must be in inventory. If the "platforms" group does not exist it will + * be created with all imported platforms as members. The sample bundle will be deployed to the + * "platforms" group. + * 3) For successful deployment the RHQ Agents must be running on the "platforms" group platforms. + * + * Usage: + * Note, the CLI must be executed in its own bin directory, so have <path> below be the path to the + * sample-cli directory. + * + * 1) start the CLI (can be downloaded from the GUI, Administration->Downloads, RHQ Client) + * 2) login user password serverHost serverPort + * 3) exec <path>/scripts/cli-2-deployBundle.js + * 4) validate the deployment and that the config settings are applied correctly + * </pre> + */ + +var bundleName = 'sample-bundle'; + +// get the bundle if it exists +var bc = new BundleCriteria(); +bc.addFilterName(bundleName); +bc.fetchBundleVersions( true ); +var bundles = BundleManager.findBundlesByCriteria(bc); +Assert.assertTrue( null != bundles && bundles.size() > 0 ); +var bundle = bundles.get(0); +Assert.assertTrue( null != bundle.getBundleVersions() && bundle.getBundleVersions().size() == 1 ); +var bundleVersion = bundle.getBundleVersions().get(0); + + +// Find or create the "platforms" group +var rgc = new ResourceGroupCriteria(); +rgc.addFilterName("platforms"); // wINdows, lINux +var groups = ResourceGroupManager.findResourceGroupsByCriteria(rgc); +var groupId; +// create if needed (and possible) +if ( groups.isEmpty() ) { + var c = new ResourceCriteria(); + c.addFilterResourceCategory(ResourceCategory.PLATFORM); + var platforms = ResourceManager.findResourcesByCriteria(c); + Assert.assertTrue( platforms.size() > 0 ); + + var rg = new ResourceGroup("platforms"); + var platformSet = new java.util.HashSet(); + platformSet.addAll( platforms ); + rg.setExplicitResources(platformSet); + rg = ResourceGroupManager.createResourceGroup(rg); + groupId = rg.getId(); +} else { + groupId = groups.get(0).getId(); +} + +// create a destination for the deployment +var dest = BundleManager.createBundleDestination(bundle.getId(), "sample destination", "sample destination", "/tmp/sample-bundle", groupId); + +// create a config for the V1.0 deployment, setting the required properties for recipe in distro 1.0 +var config1 = new Configuration(); +var property11 = new PropertySimple("sample.name", "V1 Name"); +config1.put( property11 ); +var property12 = new PropertySimple("sample.port", "11111"); +config1.put( property12 ); + + +// create a deployment for sample bundle 1.0 using the 1.0 config +var deployment = BundleManager.createBundleDeployment(bundleVersion.getId(), dest.getId(), "Deploying Sample Ant Bundle V1", config1); +deployment = BundleManager.scheduleBundleDeployment(deployment.getId(), true); +Assert.assertNotNull( deployment, "Failed to create 1.0 deployment" ); + +print("\nBundle Deployment Status=" + deployment.getStatus()); + diff --git a/etc/samples/provisioning/sample-cli/scripts/cli-3-upgradeBundle.js b/etc/samples/provisioning/sample-cli/scripts/cli-3-upgradeBundle.js new file mode 100644 index 0000000..84b2d3a --- /dev/null +++ b/etc/samples/provisioning/sample-cli/scripts/cli-3-upgradeBundle.js @@ -0,0 +1,83 @@ +/* + * RHQ Management Platform + * Copyright (C) 2005-2010 Red Hat, Inc. + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License, version 2, as + * published by the Free Software Foundation, and/or the GNU Lesser + * General Public License, version 2.1, also as published by the Free + * Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License and the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License + * and the GNU Lesser General Public License along with this program; + * if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +/** + * This sample script shows how to upgrade a Bundle to a new version. It upgrades the bundle version + * deployed by the cli-2-deployBundle.js script. The Bundle uses the Ant Bundle Type provided with + * RHQ. + * <pre> + * + * The deployment is to /tmp/sample-bundle. + * + * Prerequisites: + * 1) run cli-1-createBundle.js and cli-2-deployBundle.js + * 2) For successful deployment the RHQ Agents must be running on the "platforms" group platforms. + * + * Usage: + * Note, the CLI must be executed in its own bin directory, so have <path> below be the path to the + * sample-cli directory. + * + * 1) start the CLI (can be downloaded from the GUI, Administration->Downloads, RHQ Client) + * 2) login user password serverHost serverPort + * 3) exec <path>/cli-3-upgradeBundle.js <path> + * 4) validate the upgrade deployment and that the config settings are applied correctly + * </pre> + */ + +var bundleName = 'sample-bundle'; +var bundleDistroV2Path = args[0] + '/resources/sample-bundle-v2.zip'; + +//get the bundle if it exists +var bc = new BundleCriteria(); +bc.addFilterName(bundleName); +bc.fetchDestinations( true ); +var bundles = BundleManager.findBundlesByCriteria(bc); +Assert.assertTrue( null != bundles && bundles.size() > 0 ); +var bundle = bundles.get(0); +Assert.assertTrue( null != bundle.getDestinations() && bundle.getDestinations().size() == 1 ); +var dest = bundle.getDestinations().get(0); + +//create bundleVersion 2.0 for the sample bundle +var distributionFile = new java.io.File(bundleDistroV2Path); +distributionFile = new java.io.File(distributionFile.getAbsolutePath()); +Assert.assertTrue(distributionFile.exists(), "Missing ant bundle distribution file: " + distributionFile); +var bundleVersion2 = BundleManager.createBundleVersionViaFile(distributionFile); + +print("\nCreated " + bundleVersion1 + "!") + +//create a config for the V2.0 deployment, setting the required properties for recipe in distro 2.0 +var config2 = new Configuration(); +var property21 = new PropertySimple("sample.name", "V2 Name"); +config2.put( property21 ); +var property22 = new PropertySimple("sample.port", "22222"); +config2.put( property22 ); +var property23 = new PropertySimple("sample.new", "V2.0 ONLY!"); +config2.put( property23 ); + +// upgrade the deployment to 2.0 using the 2.0 config +var deployment = BundleManager.createBundleDeployment(bundleVersion2.getId(), dest.getId(), "Upgrading Sample Ant Bundle to V2", config2); +deployment = BundleManager.scheduleBundleDeployment(deployment.getId(), false); +Assert.assertNotNull( deployment, "Failed to upgrade to 2.0 deployment" ); + +print("\nBundle Upgrade Deployment Status=" + deployment.getStatus()); + diff --git a/etc/samples/provisioning/sample-cli/scripts/cli-4-revertBundle.js b/etc/samples/provisioning/sample-cli/scripts/cli-4-revertBundle.js new file mode 100644 index 0000000..95626ec --- /dev/null +++ b/etc/samples/provisioning/sample-cli/scripts/cli-4-revertBundle.js @@ -0,0 +1,61 @@ +/* + * RHQ Management Platform + * Copyright (C) 2005-2010 Red Hat, Inc. + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License, version 2, as + * published by the Free Software Foundation, and/or the GNU Lesser + * General Public License, version 2.1, also as published by the Free + * Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License and the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License + * and the GNU Lesser General Public License along with this program; + * if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +/** + * This sample script shows how to revert the "live" deployment for a destination. The revert + * will return to the previous "replaced" deployment. So, this will undo the V2 deployment + * performed in cli-3-upgradeBundle.js and return to the V1 deployment performed in + * cli-2-deployBundle.js. The Bundle uses the Ant Bundle Type provided with RHQ. + * <pre> + * Prerequisites: + * 1) run cli-1-createBundle.js, cli-2-deployBundle.js and cli-3-upgradeBundle.js + * 2) For successful deployment the RHQ Agents must be running on the "platforms" group platforms. + * + * Usage: + * Note, the CLI must be executed in its own bin directory, so have <path> below be the path to the + * sample-cli directory. + * + * 1) start the CLI (can be downloaded from the GUI, Administration->Downloads, RHQ Client) + * 2) login user password serverHost serverPort + * 3) exec <path>/cli-4-revertBundle.js + * 4) validate the revert deployment and that V1 is again the live deployment. + * </pre> + */ + +var bundleName = 'sample-bundle'; + +//get the bundle if it exists +var bc = new BundleCriteria(); +bc.addFilterName(bundleName); +bc.fetchDestinations( true ); +var bundles = BundleManager.findBundlesByCriteria(bc); +Assert.assertTrue( null != bundles && bundles.size() > 0 ); +var bundle = bundles.get(0); +Assert.assertTrue( null != bundle.getDestinations() && bundle.getDestinations().size() == 1 ); +var dest = bundle.getDestinations().get(0); + +//revert the live V2 deployment to the replaced V1 deployment +var deployment = BundleManager.scheduleRevertBundleDeployment(dest.getId(), "Reverting Sample Ant Bundle from V2 to V1", false); +Assert.assertNotNull( deployment, "Failed to revert 2.0 deployment" ); + +print("\nBundle Revert Status=" + deployment.getStatus());
commit 41b640f240a7a98404079988b2fa4ac793c36ca4 Author: Jay Shaughnessy jshaughn@redhat.com Date: Wed Jun 30 15:12:59 2010 -0400
Working version of sample bundle scripts.
diff --git a/etc/samples/provisioning/sample-cli/resources/sample-bundle-v2.zip b/etc/samples/provisioning/sample-cli/resources/sample-bundle-v2.zip new file mode 100644 index 0000000..f8b3392 Binary files /dev/null and b/etc/samples/provisioning/sample-cli/resources/sample-bundle-v2.zip differ diff --git a/etc/samples/provisioning/sample-cli/scripts/cli-1-createBundle.js b/etc/samples/provisioning/sample-cli/scripts/cli-1-createBundle.js index 563858e..71a3324 100644 --- a/etc/samples/provisioning/sample-cli/scripts/cli-1-createBundle.js +++ b/etc/samples/provisioning/sample-cli/scripts/cli-1-createBundle.js @@ -30,13 +30,16 @@ * none * * Usage: + * Note, the CLI must be executed in its own bin directory, so have <path> below be the path to the + * sample-cli directory. + * * 1) start the CLI (can be downloaded from the GUI, Administration->Downloads, RHQ Client) * 2) login user password serverHost serverPort - * 3) exec <path>/cli-1-createBundle.js + * 3) exec <path>/scripts/cli-1-createBundle.js <path> */
var bundleName = 'sample-bundle'; -var bundleDistroV1Path = '../resources/sample-bundle-v1.zip'; +var bundleDistroV1Path = args[0] + '/resources/sample-bundle-v1.zip';
// delete the test bundle if it exists var bc = new BundleCriteria(); @@ -53,4 +56,4 @@ distributionFile = new java.io.File(distributionFile.getAbsolutePath()); Assert.assertTrue(distributionFile.exists(), "Missing ant bundle distribution file: " + distributionFile); var bundleVersion1 = BundleManager.createBundleVersionViaFile(distributionFile);
-print("\nCreated Bundle [" + bundleVersion1 + "]!") +print("\nCreated " + bundleVersion1 + "!") diff --git a/etc/samples/provisioning/sample-cli/scripts/cli-2-deployBundle.js b/etc/samples/provisioning/sample-cli/scripts/cli-2-deployBundle.js index 0b3bd75..b099286 100644 --- a/etc/samples/provisioning/sample-cli/scripts/cli-2-deployBundle.js +++ b/etc/samples/provisioning/sample-cli/scripts/cli-2-deployBundle.js @@ -23,17 +23,27 @@
/** * This sample script shows how to deploy a Bundle. It deploys the bundle created - * by the cli-1-deployBundle.js script. The Bundle uses the Ant Bundle Type provided with + * by the cli-1-createBundle.js script. The Bundle uses the Ant Bundle Type provided with * RHQ. * <pre> - * Prerequisites: - * At least one platform must be in inventory. If the "platforms" group does not exist it will - * be created with all platforms as members. + * + * The deployment is to /tmp/sample-bundle. + * + * Prerequisites: + * 1) run cli-1-createBundle.js + * 2) At least one platform must be in inventory. If the "platforms" group does not exist it will + * be created with all imported platforms as members. The sample bundle will be deployed to the + * "platforms" group. + * 3) For successful deployment the RHQ Agents must be running on the "platforms" group platforms. * * Usage: + * Note, the CLI must be executed in its own bin directory, so have <path> below be the path to the + * sample-cli directory. + * * 1) start the CLI (can be downloaded from the GUI, Administration->Downloads, RHQ Client) * 2) login user password serverHost serverPort - * 3) exec <path>/cli-1-createBundle.js + * 3) exec <path>/scripts/cli-2-deployBundle.js + * 4) validate the deployment and that the config settings are applied correctly * </pre> */
@@ -79,13 +89,13 @@ var dest = BundleManager.createBundleDestination(bundle.getId(), "sample destina var config1 = new Configuration(); var property11 = new PropertySimple("sample.name", "V1 Name"); config1.put( property11 ); -var property12 = new PropertySimple("sample.port", "12345"); +var property12 = new PropertySimple("sample.port", "11111"); config1.put( property12 );
// create a deployment for sample bundle 1.0 using the 1.0 config var deployment = BundleManager.createBundleDeployment(bundleVersion.getId(), dest.getId(), "Deploying Sample Ant Bundle V1", config1); -deployment = BundleManager.scheduleBundleDeployment(testDeployment.getId(), true); +deployment = BundleManager.scheduleBundleDeployment(deployment.getId(), true); Assert.assertNotNull( deployment, "Failed to create 1.0 deployment" );
print("\nBundle Deployment Status=" + deployment.getStatus()); diff --git a/etc/samples/provisioning/sample-cli/scripts/cli-3-upgradeBundle.js b/etc/samples/provisioning/sample-cli/scripts/cli-3-upgradeBundle.js index e4e61ec..84b2d3a 100644 --- a/etc/samples/provisioning/sample-cli/scripts/cli-3-upgradeBundle.js +++ b/etc/samples/provisioning/sample-cli/scripts/cli-3-upgradeBundle.js @@ -22,45 +22,62 @@ */
/** - * Thus test script works with a real env including at least one platform resource and a running agent on - * said platform. It will deploy an original distro file then upgrade it, utilitizing the - * Ant bundle system. + * This sample script shows how to upgrade a Bundle to a new version. It upgrades the bundle version + * deployed by the cli-2-deployBundle.js script. The Bundle uses the Ant Bundle Type provided with + * RHQ. + * <pre> + * + * The deployment is to /tmp/sample-bundle. + * + * Prerequisites: + * 1) run cli-1-createBundle.js and cli-2-deployBundle.js + * 2) For successful deployment the RHQ Agents must be running on the "platforms" group platforms. + * + * Usage: + * Note, the CLI must be executed in its own bin directory, so have <path> below be the path to the + * sample-cli directory. + * + * 1) start the CLI (can be downloaded from the GUI, Administration->Downloads, RHQ Client) + * 2) login user password serverHost serverPort + * 3) exec <path>/cli-3-upgradeBundle.js <path> + * 4) validate the upgrade deployment and that the config settings are applied correctly + * </pre> */
-var TestsEnabled = true; +var bundleName = 'sample-bundle'; +var bundleDistroV2Path = args[0] + '/resources/sample-bundle-v2.zip';
-var bundleName = 'test-bundle-upgrade-ant'; -var bundleZipFile1 = 'src/test/resources/test-upgrade-bundle-ant1.zip'; -var bundleZipFile2 = 'src/test/resources/test-upgrade-bundle-ant2.zip'; +//get the bundle if it exists +var bc = new BundleCriteria(); +bc.addFilterName(bundleName); +bc.fetchDestinations( true ); +var bundles = BundleManager.findBundlesByCriteria(bc); +Assert.assertTrue( null != bundles && bundles.size() > 0 ); +var bundle = bundles.get(0); +Assert.assertTrue( null != bundle.getDestinations() && bundle.getDestinations().size() == 1 ); +var dest = bundle.getDestinations().get(0);
-// note, super-user, will not test any security constraints -var subject = rhq.login('rhqadmin', 'rhqadmin'); +//create bundleVersion 2.0 for the sample bundle +var distributionFile = new java.io.File(bundleDistroV2Path); +distributionFile = new java.io.File(distributionFile.getAbsolutePath()); +Assert.assertTrue(distributionFile.exists(), "Missing ant bundle distribution file: " + distributionFile); +var bundleVersion2 = BundleManager.createBundleVersionViaFile(distributionFile);
-executeAllTests(); +print("\nCreated " + bundleVersion1 + "!")
-rhq.logout(); +//create a config for the V2.0 deployment, setting the required properties for recipe in distro 2.0 +var config2 = new Configuration(); +var property21 = new PropertySimple("sample.name", "V2 Name"); +config2.put( property21 ); +var property22 = new PropertySimple("sample.port", "22222"); +config2.put( property22 ); +var property23 = new PropertySimple("sample.new", "V2.0 ONLY!"); +config2.put( property23 );
-function testGroupDeployment() { - if ( !TestsEnabled ) { - return; - } +// upgrade the deployment to 2.0 using the 2.0 config +var deployment = BundleManager.createBundleDeployment(bundleVersion2.getId(), dest.getId(), "Upgrading Sample Ant Bundle to V2", config2); +deployment = BundleManager.scheduleBundleDeployment(deployment.getId(), false); +Assert.assertNotNull( deployment, "Failed to upgrade to 2.0 deployment" );
- var groupId = getGroupId(); - var bundleType = getBundleType(); - Assert.assertNotNull(bundleType, "need ant bundle plugin installed for this test"); - - // delete the test bundle if it exists - var bc = new BundleCriteria(); - bc.addFilterName( bundleName ); - var bundles = BundleManager.findBundlesByCriteria( bc ); - if ( null != bundles && bundles.size() > 0 ) { - print( "\nDeleting existing test ant bundle in order to test a fresh deploy...") - BundleManager.deleteBundle( bundles.get(0).getId() ); - } - - // create bundleVersion 1.0 - var distributionFile1 = new java.io.File(bundleZipFile1); - distributionFile1 = new java.io.File(distributionFile1.getAbsolutePath()); - Assert.assertTrue(distributionFile1.exists(), "missing ant bundle file 1: " + distributionFile1); - var testBundleVersion1 = BundleManager.createBundleVersionViaFile( distributionFile1 ); +print("\nBundle Upgrade Deployment Status=" + deployment.getStatus());
diff --git a/etc/samples/provisioning/sample-cli/scripts/cli-4-revertBundle.js b/etc/samples/provisioning/sample-cli/scripts/cli-4-revertBundle.js index e4e61ec..95626ec 100644 --- a/etc/samples/provisioning/sample-cli/scripts/cli-4-revertBundle.js +++ b/etc/samples/provisioning/sample-cli/scripts/cli-4-revertBundle.js @@ -22,45 +22,40 @@ */
/** - * Thus test script works with a real env including at least one platform resource and a running agent on - * said platform. It will deploy an original distro file then upgrade it, utilitizing the - * Ant bundle system. + * This sample script shows how to revert the "live" deployment for a destination. The revert + * will return to the previous "replaced" deployment. So, this will undo the V2 deployment + * performed in cli-3-upgradeBundle.js and return to the V1 deployment performed in + * cli-2-deployBundle.js. The Bundle uses the Ant Bundle Type provided with RHQ. + * <pre> + * Prerequisites: + * 1) run cli-1-createBundle.js, cli-2-deployBundle.js and cli-3-upgradeBundle.js + * 2) For successful deployment the RHQ Agents must be running on the "platforms" group platforms. + * + * Usage: + * Note, the CLI must be executed in its own bin directory, so have <path> below be the path to the + * sample-cli directory. + * + * 1) start the CLI (can be downloaded from the GUI, Administration->Downloads, RHQ Client) + * 2) login user password serverHost serverPort + * 3) exec <path>/cli-4-revertBundle.js + * 4) validate the revert deployment and that V1 is again the live deployment. + * </pre> */
-var TestsEnabled = true; +var bundleName = 'sample-bundle';
-var bundleName = 'test-bundle-upgrade-ant'; -var bundleZipFile1 = 'src/test/resources/test-upgrade-bundle-ant1.zip'; -var bundleZipFile2 = 'src/test/resources/test-upgrade-bundle-ant2.zip'; +//get the bundle if it exists +var bc = new BundleCriteria(); +bc.addFilterName(bundleName); +bc.fetchDestinations( true ); +var bundles = BundleManager.findBundlesByCriteria(bc); +Assert.assertTrue( null != bundles && bundles.size() > 0 ); +var bundle = bundles.get(0); +Assert.assertTrue( null != bundle.getDestinations() && bundle.getDestinations().size() == 1 ); +var dest = bundle.getDestinations().get(0);
-// note, super-user, will not test any security constraints -var subject = rhq.login('rhqadmin', 'rhqadmin'); - -executeAllTests(); - -rhq.logout(); - -function testGroupDeployment() { - if ( !TestsEnabled ) { - return; - } - - var groupId = getGroupId(); - var bundleType = getBundleType(); - Assert.assertNotNull(bundleType, "need ant bundle plugin installed for this test"); - - // delete the test bundle if it exists - var bc = new BundleCriteria(); - bc.addFilterName( bundleName ); - var bundles = BundleManager.findBundlesByCriteria( bc ); - if ( null != bundles && bundles.size() > 0 ) { - print( "\nDeleting existing test ant bundle in order to test a fresh deploy...") - BundleManager.deleteBundle( bundles.get(0).getId() ); - } - - // create bundleVersion 1.0 - var distributionFile1 = new java.io.File(bundleZipFile1); - distributionFile1 = new java.io.File(distributionFile1.getAbsolutePath()); - Assert.assertTrue(distributionFile1.exists(), "missing ant bundle file 1: " + distributionFile1); - var testBundleVersion1 = BundleManager.createBundleVersionViaFile( distributionFile1 ); +//revert the live V2 deployment to the replaced V1 deployment +var deployment = BundleManager.scheduleRevertBundleDeployment(dest.getId(), "Reverting Sample Ant Bundle from V2 to V1", false); +Assert.assertNotNull( deployment, "Failed to revert 2.0 deployment" );
+print("\nBundle Revert Status=" + deployment.getStatus());
commit 4698a79902c681798b33c18c991f6c5ef6674e25 Author: Ian Springer ian.springer@redhat.com Date: Wed Jun 30 11:02:47 2010 -0400
get rid of inputProperties field, which was no longer needed
diff --git a/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/task/BundleTask.java b/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/task/BundleTask.java index c67cdc8..db684e8 100644 --- a/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/task/BundleTask.java +++ b/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/task/BundleTask.java @@ -28,11 +28,9 @@ import org.rhq.bundle.ant.type.InputPropertyType; import java.io.File; import java.util.ArrayList; import java.util.HashMap; -import java.util.HashSet; import java.util.Hashtable; import java.util.List; import java.util.Map; -import java.util.Set;
/** * The rhq:bundle task defines the metadata needed to deploy, redeploy, or undeploy an RHQ bundle. @@ -44,7 +42,6 @@ public class BundleTask extends AbstractBundleTask { private String version; private String description; private Map<String, DeploymentUnitType> deploymentUnits = new HashMap<String, DeploymentUnitType>(); - private Set<InputPropertyType> inputProperties = new HashSet<InputPropertyType>();
@Override public void maybeConfigure() throws BuildException { @@ -190,7 +187,6 @@ public class BundleTask extends AbstractBundleTask { }
public void addConfigured(InputPropertyType inputProperty) { - this.inputProperties.add(inputProperty); inputProperty.init(); }
@@ -225,7 +221,7 @@ public class BundleTask extends AbstractBundleTask { }
/** - * Ensure we have a legal set of types. + * Ensure we have a legal set of child types. * * @throws BuildException if an error occurs */
commit 85bdf62f88f1e99bcef1184d57b3121020cd0e18 Author: Ian Springer ian.springer@redhat.com Date: Wed Jun 30 10:54:56 2010 -0400
make sure that the rhq:inputProperty element sets the default value on the corresponding project property during the configuration, and not the execution, of the rhq:bundle task; that way, the other child elements of the rhq:bundle task can reference the input property via ${inputProp} and know that it will be initialized to its default value, if it had one; add validation of input properties according to their specified type
diff --git a/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/AntLauncher.java b/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/AntLauncher.java index 03b58df..bfc8d2e 100644 --- a/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/AntLauncher.java +++ b/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/AntLauncher.java @@ -88,7 +88,7 @@ public class AntLauncher { // Parse and validate the build file before even attempting to execute it. parseBundleDeployFile(buildFile);
- BundleAntProject project = createProject(buildFile); + BundleAntProject project = createProject(buildFile, false);
try { if (buildProperties != null) { @@ -127,7 +127,7 @@ public class AntLauncher { }
public BundleAntProject parseBundleDeployFile(File buildFile) throws InvalidBuildFileException { - BundleAntProject project = createProject(buildFile); + BundleAntProject project = createProject(buildFile, true);
ProjectHelper2 projectHelper = new ProjectHelper2(); try { @@ -153,10 +153,10 @@ public class AntLauncher { return project; }
- private BundleAntProject createProject(File buildFile) { + private BundleAntProject createProject(File buildFile, boolean parseOnly) { ClassLoader classLoader = getClass().getClassLoader();
- BundleAntProject project = new BundleAntProject(); + BundleAntProject project = new BundleAntProject(parseOnly); project.setCoreLoader(classLoader); project.init(); project.setBaseDir(buildFile.getParentFile()); diff --git a/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/BundleAntProject.java b/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/BundleAntProject.java index 412b22c..a80e61e 100644 --- a/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/BundleAntProject.java +++ b/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/BundleAntProject.java @@ -48,12 +48,14 @@ import org.rhq.core.util.updater.DeployDifferences; */ public class BundleAntProject extends Project { // Bundle-level attributes + private boolean parseOnly; + private String bundleName; private String bundleVersion; private String bundleDescription; - private ConfigurationDefinition configDef;
// Deployment-level attributes + private ConfigurationDefinition configDef; private Configuration config; private File deployDir; private final Set<String> bundleFileNames = new HashSet<String>(); @@ -62,6 +64,18 @@ public class BundleAntProject extends Project { private DeployDifferences deployDiffs = new DeployDifferences(); private boolean dryRun;
+ public BundleAntProject() { + this(false); + } + + public BundleAntProject(boolean parseOnly) { + this.parseOnly = parseOnly; + } + + public boolean isParseOnly() { + return parseOnly; + } + public Set<String> getBundleFileNames() { return bundleFileNames; } diff --git a/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/task/BundleTask.java b/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/task/BundleTask.java index fe20433..c67cdc8 100644 --- a/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/task/BundleTask.java +++ b/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/task/BundleTask.java @@ -132,11 +132,6 @@ public class BundleTask extends AbstractBundleTask { } getProject().setDeploymentPhase(deploymentPhase);
- // Initialize the deployment configuration. - for (InputPropertyType inputProperty : this.inputProperties) { - inputProperty.execute(); - } - String dryRunString = (String) projectProps.get(DeployPropertyNames.DEPLOY_DRY_RUN); boolean dryRun = Boolean.valueOf(dryRunString); getProject().setDryRun(dryRun); @@ -196,10 +191,10 @@ public class BundleTask extends AbstractBundleTask {
public void addConfigured(InputPropertyType inputProperty) { this.inputProperties.add(inputProperty); - inputProperty.init(); + inputProperty.init(); }
- public void addConfigured(DeploymentUnitType deployment) { + public void add(DeploymentUnitType deployment) { this.deploymentUnits.put(deployment.getName(), deployment); }
diff --git a/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/type/InputPropertyType.java b/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/type/InputPropertyType.java index 35aca70..2b44a3a 100644 --- a/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/type/InputPropertyType.java +++ b/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/type/InputPropertyType.java @@ -26,11 +26,11 @@ import org.rhq.core.domain.configuration.definition.PropertyDefinitionSimple; import org.rhq.core.domain.configuration.definition.PropertySimpleType;
/** - * An Ant task that defines a basic property that the user provides as input for deployment of a bundle. Typically, the + * An Ant type that defines a basic property that the user provides as input for deployment of a bundle. Typically, the * property will be substituted into configuration files from the bundle during deployment - see ReplaceTask. * * If the deployment script is invoked from the GUI, the user will be prompted for values for any input properties that - * are defined via this task. If the script is invoked from the command line, the properties must be passed using the -D + * are defined via this type. If the script is invoked from the command line, the properties must be passed using the -D * and/or -propertyfile options. * * @author Ian Springer @@ -42,36 +42,39 @@ public class InputPropertyType extends AbstractBundleType { private String defaultValue; private String type = PropertySimpleType.STRING.xmlName();
- public void init() { + public void init() throws BuildException { validateAttributes();
ConfigurationDefinition configDef = getProject().getConfigurationDefinition(); - PropertySimpleType propSimpleType = PropertySimpleType.fromXmlName(this.type); + PropertySimpleType propType = PropertySimpleType.fromXmlName(this.type); PropertyDefinitionSimple propDef = new PropertyDefinitionSimple(this.name, this.description, this.required, - propSimpleType); + propType); configDef.put(propDef); - } - - public void execute() throws BuildException { + String value = getProject().getProperty(this.name); if (value == null) { value = this.defaultValue; + getProject().setProperty(this.name, value); } - if (value == null && this.required) { - throw new BuildException("No value was specified for required input property '" + this.name - + "', and no default is defined for the property."); + + boolean parseOnly = getProject().isParseOnly(); + if (!parseOnly) { + if (value == null && this.required) { + throw new BuildException("No value was specified for required input property '" + this.name + + "', and no default is defined for the property."); + } + validateValue(value, propType); + String valueString = (value != null) ? "'" + value + "'" : "<null>"; + log("Initializing input property '" + this.name + "' with value " + valueString + "..."); } - String valueString = (value != null) ? "'" + value + "'" : "<null>"; - log("Initializing input property '" + this.name + "' with value " + valueString + "...");
- PropertySimple prop = new PropertySimple(this.name, value); - ConfigurationDefinition configDef = getProject().getConfigurationDefinition(); Configuration config = getProject().getConfiguration(); - // TODO: validate the config + PropertySimple prop = new PropertySimple(this.name, value); config.put(prop); + return; } - + public String getDescription() { return description; } @@ -126,8 +129,9 @@ public class InputPropertyType extends AbstractBundleType { if (this.name.length() == 0) { throw new BuildException("The 'name' attribute must have a non-empty value."); } + PropertySimpleType propType; try { - PropertySimpleType.fromXmlName(this.type); + propType = PropertySimpleType.fromXmlName(this.type); } catch (IllegalArgumentException e) { throw new BuildException("Illegal value for 'type' attribute: " + this.type); } @@ -135,6 +139,44 @@ public class InputPropertyType extends AbstractBundleType { if (!this.required) { log("No default value was specified for optional input property '" + this.name + "'.", Project.MSG_WARN); } + } else { + // Make sure the default value is valid according to the property's type. + try { + validateValue(this.defaultValue, propType); + } catch (RuntimeException e) { + throw new BuildException("Default value '" + this.defaultValue + + "' is not valid according to 'type' attribute: " + this.type, e); + } + } + } + + private void validateValue(String value, PropertySimpleType propType) { + if (value != null) { + try { + switch (propType) { + case BOOLEAN: + if (!value.equals(Boolean.TRUE.toString()) && !value.equals(Boolean.FALSE.toString())) { + throw new RuntimeException("Illegal value for boolean property - value must be 'true' or 'false'." + + value); + } + break; + case DOUBLE: + Double.valueOf(value); + break; + case FLOAT: + Float.valueOf(value); + break; + case INTEGER: + Integer.valueOf(value); + break; + case LONG: + Long.valueOf(value); + break; + } + } catch (RuntimeException e) { + throw new BuildException("'" + value + "' is not a legal value for input property '" + this.name + + "', which has type '" + this.type + "'.", e); + } } } } \ No newline at end of file diff --git a/modules/plugins/ant-bundle/src/test/java/org/rhq/plugins/ant/AntBundlePluginComponentTest.java b/modules/plugins/ant-bundle/src/test/java/org/rhq/plugins/ant/AntBundlePluginComponentTest.java index aae419c..ae06f0d 100644 --- a/modules/plugins/ant-bundle/src/test/java/org/rhq/plugins/ant/AntBundlePluginComponentTest.java +++ b/modules/plugins/ant-bundle/src/test/java/org/rhq/plugins/ant/AntBundlePluginComponentTest.java @@ -107,6 +107,7 @@ public class AntBundlePluginComponentTest { FileUtil.purge(this.destDir, true); }
+ @Test(enabled = true) public void testAntBundleRevert() throws Exception { // install then upgrade a bundle first testAntBundleUpgrade(); @@ -214,136 +215,20 @@ public class AntBundlePluginComponentTest { assert previousProps.getBundleVersion().equals("3.0"); // testAntBundleUpgrade deployed version 3.0 }
+ @Test(enabled = true) public void testAntBundleUpgrade() throws Exception { upgrade(false); }
+ @Test(enabled = true) public void testAntBundleCleanUpgrade() throws Exception { upgrade(true); }
- private void upgrade(boolean clean) throws Exception { - testAntBundleInitialInstall(); // install a bundle first - cleanPluginDirs(); // clean everything but the dest dir - we want to upgrade the destination - prepareBeforeTestMethod(); // prepare for our new test - - // deploy upgrade and test it - ResourceType resourceType = new ResourceType("testSimpleBundle2Type", "plugin", ResourceCategory.SERVER, null); - BundleType bundleType = new BundleType("testSimpleBundle2BType", resourceType); - Repo repo = new Repo("test-bundle-two"); - PackageType packageType = new PackageType("test-bundle-two", resourceType); - Bundle bundle = new Bundle("test-bundle-two", bundleType, repo, packageType); - BundleVersion bundleVersion = new BundleVersion("test-bundle-two", "3.0", bundle, - getRecipeFromFile("test-bundle-three.xml")); - BundleDestination destination = new BundleDestination(bundle, "testSimpleBundle2Dest", new ResourceGroup( - "testSimpleBundle2Group"), this.destDir.getAbsolutePath()); - - Configuration config = new Configuration(); - String customPropName = "custom.prop"; - String customPropValue = "DEF"; - String onePropName = "one.prop"; - String onePropValue = "one-one-one"; - String threePropName = "three.prop"; - String threePropValue = "333"; - config.put(new PropertySimple(customPropName, customPropValue)); - config.put(new PropertySimple(onePropName, onePropValue)); - config.put(new PropertySimple(threePropName, threePropValue)); - - BundleDeployment deployment = new BundleDeployment(); - deployment.setId(456); - deployment.setName("test bundle 3 deployment name - upgrades test bundle 2"); - deployment.setBundleVersion(bundleVersion); - deployment.setConfiguration(config); - deployment.setDestination(destination); - - // copy the test archive file to the bundle files dir - FileUtil.copyFile(new File("src/test/resources/test-bundle-three-archive.zip"), new File(this.bundleFilesDir, - "test-bundle-three-archive.zip")); - - // create test.properties file in the bundle files dir - File file1 = new File(this.bundleFilesDir, "test.properties"); - Properties props = new Properties(); - props.setProperty(customPropName, "@@" + customPropName + "@@"); - FileOutputStream outputStream = new FileOutputStream(file1); - props.store(outputStream, "test.properties comment"); - outputStream.close(); - - // create some additional files - note: receipe says to ignore "ignore/**" - File ignoreDir = new File(this.destDir, "ignore"); - File extraDir = new File(this.destDir, "extra"); - ignoreDir.mkdirs(); - extraDir.mkdirs(); - File ignoredFile = new File(ignoreDir, "ignore-file.txt"); - File extraFile = new File(extraDir, "extra-file.txt"); - FileUtil.writeFile(new ByteArrayInputStream("ignore".getBytes()), ignoredFile); - FileUtil.writeFile(new ByteArrayInputStream("extra".getBytes()), extraFile); - - BundleDeployRequest request = new BundleDeployRequest(); - request.setBundleFilesLocation(this.bundleFilesDir); - request.setResourceDeployment(new BundleResourceDeployment(deployment, null)); - request.setBundleManagerProvider(new MockBundleManagerProvider()); - request.setCleanDeployment(clean); - - BundleDeployResult results = plugin.deployBundle(request); - - assertResultsSuccess(results); - - // test that the prop was replaced in raw file test.properties - Properties realizedProps = new Properties(); - realizedProps.load(new FileInputStream(new File(this.destDir, "config/test.properties"))); - assert customPropValue.equals(realizedProps.getProperty(customPropName)) : "didn't replace prop"; - - // test that the archive was extracted properly. These are the files in the archive or removed from original: - // REMOVED: zero-file.txt - // one/one-file.txt (content: "@@one.prop@@") <-- recipe says this is to be replaced - // two/two-file.txt (content: "@@two.prop@@") <-- recipe does not say to replace this - // three/three-file.txt (content: "@@three.prop@@") <-- recipe says this is to be replaced - File zeroFile = new File(this.destDir, "zero-file.txt"); - File oneFile = new File(this.destDir, "one/one-file.txt"); - File twoFile = new File(this.destDir, "two/two-file.txt"); - File threeFile = new File(this.destDir, "three/three-file.txt"); - assert !zeroFile.exists() : "zero file should have been removed during upgrade"; - assert oneFile.exists() : "one file missing"; - assert twoFile.exists() : "two file missing"; - assert threeFile.exists() : "three file missing"; - if (clean) { - assert !ignoredFile.exists() : "ignored file should have been deleted due to clean deployment request"; - assert !extraFile.exists() : "extra file should have been deleted due to clean deployment request"; - } else { - assert ignoredFile.exists() : "ignored file wasn't ignored, it was deleted"; - assert !extraFile.exists() : "extra file ignored, but it should have been deleted/backed up"; - } - assert readFile(oneFile).startsWith(onePropValue); - assert readFile(twoFile).startsWith("@@two.prop@@"); - assert readFile(threeFile).startsWith(threePropValue); - - DeploymentsMetadata metadata = new DeploymentsMetadata(this.destDir); - DeploymentProperties deploymentProps = metadata.getDeploymentProperties(deployment.getId()); - assert deploymentProps.getDeploymentId() == deployment.getId(); - assert deploymentProps.getBundleName().equals(bundle.getName()); - assert deploymentProps.getBundleVersion().equals(bundleVersion.getVersion()); - - DeploymentProperties currentProps = metadata.getCurrentDeploymentProperties(); - assert deploymentProps.equals(currentProps); - - // check the backup directory - note, clean flag is irrelevent when determining what should be backed up - File backupDir = metadata.getDeploymentBackupDirectory(deployment.getId()); - File extraBackupFile = new File(backupDir, extraDir.getName() + File.separatorChar + extraFile.getName()); - File ignoredBackupFile = new File(backupDir, ignoreDir.getName() + File.separatorChar + ignoredFile.getName()); - assert !ignoredBackupFile.exists() : "ignored file was backed up but it should not have been"; - assert extraBackupFile.exists() : "extra file was not backed up"; - assert "extra".equals(new String(StreamUtil.slurp(new FileInputStream(extraBackupFile)))) : "bad backup of extra"; - - DeploymentProperties previousProps = metadata.getPreviousDeploymentProperties(456); - assert previousProps != null : "There should be previous deployment metadata"; - assert previousProps.getDeploymentId() == 123 : "bad previous deployment metadata"; // testAntBundleInitialInstall used 123 - assert previousProps.getBundleName().equals(deploymentProps.getBundleName()); - assert previousProps.getBundleVersion().equals("2.5"); // testAntBundleInitialInstall deployed version 2.5 - } - /** * Test deployment of an RHQ bundle recipe with archive file and raw file */ + @Test(enabled = true) public void testAntBundleInitialInstall() throws Exception { ResourceType resourceType = new ResourceType("testSimpleBundle2Type", "plugin", ResourceCategory.SERVER, null); BundleType bundleType = new BundleType("testSimpleBundle2BType", resourceType); @@ -424,6 +309,7 @@ public class AntBundlePluginComponentTest { /** * Test deployment of an RHQ bundle recipe. */ + @Test(enabled = true) public void testAntBundle() throws Exception { ResourceType resourceType = new ResourceType("testSimpleBundle", "plugin", ResourceCategory.SERVER, null); BundleType bundleType = new BundleType("testSimpleBundle", resourceType); @@ -459,6 +345,12 @@ public class AntBundlePluginComponentTest { props.store(outputStream, "noreplace"); outputStream.close();
+ // create foo test file + File foofile = new File(this.bundleFilesDir, "foo.properties"); + outputStream = new FileOutputStream(foofile); + props.store(outputStream, "foo"); + outputStream.close(); + BundleDeployRequest request = new BundleDeployRequest(); request.setBundleFilesLocation(this.bundleFilesDir); request.setResourceDeployment(new BundleResourceDeployment(deployment, null)); @@ -479,6 +371,125 @@ public class AntBundlePluginComponentTest { assert "@@custom.prop1@@".equals(notrealizedProps.getProperty("custom.prop1")) : "replaced prop when it shouldn't"; }
+ private void upgrade(boolean clean) throws Exception { + testAntBundleInitialInstall(); // install a bundle first + cleanPluginDirs(); // clean everything but the dest dir - we want to upgrade the destination + prepareBeforeTestMethod(); // prepare for our new test + + // deploy upgrade and test it + ResourceType resourceType = new ResourceType("testSimpleBundle2Type", "plugin", ResourceCategory.SERVER, null); + BundleType bundleType = new BundleType("testSimpleBundle2BType", resourceType); + Repo repo = new Repo("test-bundle-two"); + PackageType packageType = new PackageType("test-bundle-two", resourceType); + Bundle bundle = new Bundle("test-bundle-two", bundleType, repo, packageType); + BundleVersion bundleVersion = new BundleVersion("test-bundle-two", "3.0", bundle, + getRecipeFromFile("test-bundle-three.xml")); + BundleDestination destination = new BundleDestination(bundle, "testSimpleBundle2Dest", new ResourceGroup( + "testSimpleBundle2Group"), this.destDir.getAbsolutePath()); + + Configuration config = new Configuration(); + String customPropName = "custom.prop"; + String customPropValue = "DEF"; + String onePropName = "one.prop"; + String onePropValue = "one-one-one"; + String threePropName = "three.prop"; + String threePropValue = "333"; + config.put(new PropertySimple(customPropName, customPropValue)); + config.put(new PropertySimple(onePropName, onePropValue)); + config.put(new PropertySimple(threePropName, threePropValue)); + + BundleDeployment deployment = new BundleDeployment(); + deployment.setId(456); + deployment.setName("test bundle 3 deployment name - upgrades test bundle 2"); + deployment.setBundleVersion(bundleVersion); + deployment.setConfiguration(config); + deployment.setDestination(destination); + + // copy the test archive file to the bundle files dir + FileUtil.copyFile(new File("src/test/resources/test-bundle-three-archive.zip"), new File(this.bundleFilesDir, + "test-bundle-three-archive.zip")); + + // create test.properties file in the bundle files dir + File file1 = new File(this.bundleFilesDir, "test.properties"); + Properties props = new Properties(); + props.setProperty(customPropName, "@@" + customPropName + "@@"); + FileOutputStream outputStream = new FileOutputStream(file1); + props.store(outputStream, "test.properties comment"); + outputStream.close(); + + // create some additional files - note: recipe says to ignore "ignore/**" + File ignoreDir = new File(this.destDir, "ignore"); + File extraDir = new File(this.destDir, "extra"); + ignoreDir.mkdirs(); + extraDir.mkdirs(); + File ignoredFile = new File(ignoreDir, "ignore-file.txt"); + File extraFile = new File(extraDir, "extra-file.txt"); + FileUtil.writeFile(new ByteArrayInputStream("ignore".getBytes()), ignoredFile); + FileUtil.writeFile(new ByteArrayInputStream("extra".getBytes()), extraFile); + + BundleDeployRequest request = new BundleDeployRequest(); + request.setBundleFilesLocation(this.bundleFilesDir); + request.setResourceDeployment(new BundleResourceDeployment(deployment, null)); + request.setBundleManagerProvider(new MockBundleManagerProvider()); + request.setCleanDeployment(clean); + + BundleDeployResult results = plugin.deployBundle(request); + + assertResultsSuccess(results); + + // test that the prop was replaced in raw file test.properties + Properties realizedProps = new Properties(); + realizedProps.load(new FileInputStream(new File(this.destDir, "config/test.properties"))); + assert customPropValue.equals(realizedProps.getProperty(customPropName)) : "didn't replace prop"; + + // test that the archive was extracted properly. These are the files in the archive or removed from original: + // REMOVED: zero-file.txt + // one/one-file.txt (content: "@@one.prop@@") <-- recipe says this is to be replaced + // two/two-file.txt (content: "@@two.prop@@") <-- recipe does not say to replace this + // three/three-file.txt (content: "@@three.prop@@") <-- recipe says this is to be replaced + File zeroFile = new File(this.destDir, "zero-file.txt"); + File oneFile = new File(this.destDir, "one/one-file.txt"); + File twoFile = new File(this.destDir, "two/two-file.txt"); + File threeFile = new File(this.destDir, "three/three-file.txt"); + assert !zeroFile.exists() : "zero file should have been removed during upgrade"; + assert oneFile.exists() : "one file missing"; + assert twoFile.exists() : "two file missing"; + assert threeFile.exists() : "three file missing"; + if (clean) { + assert !ignoredFile.exists() : "ignored file should have been deleted due to clean deployment request"; + assert !extraFile.exists() : "extra file should have been deleted due to clean deployment request"; + } else { + assert ignoredFile.exists() : "ignored file wasn't ignored, it was deleted"; + assert !extraFile.exists() : "extra file ignored, but it should have been deleted/backed up"; + } + assert readFile(oneFile).startsWith(onePropValue); + assert readFile(twoFile).startsWith("@@two.prop@@"); + assert readFile(threeFile).startsWith(threePropValue); + + DeploymentsMetadata metadata = new DeploymentsMetadata(this.destDir); + DeploymentProperties deploymentProps = metadata.getDeploymentProperties(deployment.getId()); + assert deploymentProps.getDeploymentId() == deployment.getId(); + assert deploymentProps.getBundleName().equals(bundle.getName()); + assert deploymentProps.getBundleVersion().equals(bundleVersion.getVersion()); + + DeploymentProperties currentProps = metadata.getCurrentDeploymentProperties(); + assert deploymentProps.equals(currentProps); + + // check the backup directory - note, clean flag is irrelevent when determining what should be backed up + File backupDir = metadata.getDeploymentBackupDirectory(deployment.getId()); + File extraBackupFile = new File(backupDir, extraDir.getName() + File.separatorChar + extraFile.getName()); + File ignoredBackupFile = new File(backupDir, ignoreDir.getName() + File.separatorChar + ignoredFile.getName()); + assert !ignoredBackupFile.exists() : "ignored file was backed up but it should not have been"; + assert extraBackupFile.exists() : "extra file was not backed up"; + assert "extra".equals(new String(StreamUtil.slurp(new FileInputStream(extraBackupFile)))) : "bad backup of extra"; + + DeploymentProperties previousProps = metadata.getPreviousDeploymentProperties(456); + assert previousProps != null : "There should be previous deployment metadata"; + assert previousProps.getDeploymentId() == 123 : "bad previous deployment metadata"; // testAntBundleInitialInstall used 123 + assert previousProps.getBundleName().equals(deploymentProps.getBundleName()); + assert previousProps.getBundleVersion().equals("2.5"); // testAntBundleInitialInstall deployed version 2.5 + } + private void assertResultsSuccess(BundleDeployResult results) { assert (results.getErrorMessage() == null) : "Failed to process bundle: [" + results.getErrorMessage() + "]"; assert results.isSuccess() : "Failed to process bundle!: [" + results.getErrorMessage() + "]"; diff --git a/modules/plugins/ant-bundle/src/test/resources/test-bundle.xml b/modules/plugins/ant-bundle/src/test/resources/test-bundle.xml index 96e7a14..a828dff 100644 --- a/modules/plugins/ant-bundle/src/test/resources/test-bundle.xml +++ b/modules/plugins/ant-bundle/src/test/resources/test-bundle.xml @@ -22,9 +22,16 @@ required="true" defaultValue="default 2"/>
+ <rhq:input-property + name="custom.prop3" + description="my prop 3" + required="true" + defaultValue="foo.properties"/> + <rhq:deployment-unit name="doodibittydoo"> <rhq:file name="test.properties" destinationFile="config/test.properties" replace="true"/> <rhq:file name="noreplace.properties" destinationFile="config/noreplace.properties"/> + <rhq:file name="${custom.prop3}" destinationDir="config"/> </rhq:deployment-unit>
</rhq:bundle>
commit be0dd59b289eec8af1688708e224945a46aeda6f Author: Jay Shaughnessy jshaughn@redhat.com Date: Wed Jun 30 10:26:30 2010 -0400
LT commit
diff --git a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ManagedComponentComponent.java b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ManagedComponentComponent.java index aefb351..e4511fd 100644 --- a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ManagedComponentComponent.java +++ b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ManagedComponentComponent.java @@ -1,422 +1,422 @@ -/* -* Jopr Management Platform -* Copyright (C) 2005-2009 Red Hat, Inc. -* All rights reserved. -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License, version 2, as -* published by the Free Software Foundation, and/or the GNU Lesser -* General Public License, version 2.1, also as published by the Free -* Software Foundation. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License and the GNU Lesser General Public License -* for more details. -* -* You should have received a copy of the GNU General Public License -* and the GNU Lesser General Public License along with this program; -* if not, write to the Free Software Foundation, Inc., -* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ -package org.rhq.plugins.jbossas5; - -import java.lang.reflect.Array; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.jboss.deployers.spi.management.ManagementView; -import org.jboss.deployers.spi.management.deploy.DeploymentManager; -import org.jboss.deployers.spi.management.deploy.DeploymentProgress; -import org.jboss.deployers.spi.management.deploy.DeploymentStatus; -import org.jboss.managed.api.ComponentType; -import org.jboss.managed.api.ManagedComponent; -import org.jboss.managed.api.ManagedDeployment; -import org.jboss.managed.api.ManagedOperation; -import org.jboss.managed.api.ManagedProperty; -import org.jboss.managed.api.RunState; -import org.jboss.metatype.api.values.ArrayValue; -import org.jboss.metatype.api.values.CollectionValue; -import org.jboss.metatype.api.values.CompositeValue; -import org.jboss.metatype.api.values.EnumValue; -import org.jboss.metatype.api.values.MetaValue; -import org.jboss.metatype.api.values.SimpleValue; -import org.jboss.remoting.CannotConnectException; - -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -import org.rhq.core.domain.configuration.Configuration; -import org.rhq.core.domain.configuration.PropertySimple; -import org.rhq.core.domain.configuration.ConfigurationUpdateStatus; -import org.rhq.core.domain.configuration.definition.ConfigurationDefinition; -import org.rhq.core.domain.measurement.AvailabilityType; -import org.rhq.core.domain.measurement.DataType; -import org.rhq.core.domain.measurement.MeasurementDataNumeric; -import org.rhq.core.domain.measurement.MeasurementDataTrait; -import org.rhq.core.domain.measurement.MeasurementReport; -import org.rhq.core.domain.measurement.MeasurementScheduleRequest; -import org.rhq.core.domain.operation.OperationDefinition; -import org.rhq.core.domain.resource.ResourceType; -import org.rhq.core.pluginapi.configuration.ConfigurationFacet; -import org.rhq.core.pluginapi.configuration.ConfigurationUpdateReport; -import org.rhq.core.pluginapi.inventory.DeleteResourceFacet; -import org.rhq.core.pluginapi.inventory.ResourceContext; -import org.rhq.core.pluginapi.measurement.MeasurementFacet; -import org.rhq.core.pluginapi.operation.OperationFacet; -import org.rhq.core.pluginapi.operation.OperationResult; -import org.rhq.core.util.exception.ThrowableUtil; -import org.rhq.plugins.jbossas5.util.ConversionUtils; -import org.rhq.plugins.jbossas5.util.DeploymentUtils; -import org.rhq.plugins.jbossas5.util.ManagedComponentUtils; -import org.rhq.plugins.jbossas5.util.ResourceTypeUtils; -import org.rhq.plugins.jbossas5.util.ResourceComponentUtils; -import org.rhq.plugins.jbossas5.util.DebugUtils; - -/** - * Service ResourceComponent for all {@link ManagedComponent}s in a Profile. - * - * @author Ian Springer - * @author Jason Dobies - * @author Mark Spritzler - */ -public class ManagedComponentComponent extends AbstractManagedComponent implements ConfigurationFacet, - DeleteResourceFacet, OperationFacet, MeasurementFacet { - public static interface Config { - String COMPONENT_TYPE = "componentType"; - String COMPONENT_SUBTYPE = "componentSubtype"; - String COMPONENT_NAME = "componentName"; - String TEMPLATE_NAME = "templateName"; - String COMPONENT_NAME_PROPERTY = "componentNameProperty"; - } - - protected static final char PREFIX_DELIMITER = '|'; - - private final Log log = LogFactory.getLog(this.getClass()); - - private String componentName; - private ComponentType componentType; - - // ResourceComponent Implementation -------------------------------------------- - - public AvailabilityType getAvailability() { - RunState runState; - try { - runState = getManagedComponent().getRunState(); - } catch (CannotConnectException e) { - return AvailabilityType.DOWN; - } - return (runState == RunState.RUNNING) ? AvailabilityType.UP : AvailabilityType.DOWN; - } - - public void start(ResourceContext<ProfileServiceComponent> resourceContext) throws Exception { - super.start(resourceContext); - this.componentType = ConversionUtils.getComponentType(getResourceContext().getResourceType()); - Configuration pluginConfig = resourceContext.getPluginConfiguration(); - this.componentName = pluginConfig.getSimple(Config.COMPONENT_NAME).getStringValue(); - log.trace("Started ResourceComponent for " + getResourceDescription() + ", managing " + this.componentType - + " component '" + this.componentName + "'."); - } - - public void stop() { - return; - } - - // ConfigurationComponent Implementation -------------------------------------------- - - public Configuration loadResourceConfiguration() - { - Configuration resourceConfig; - try - { - Map<String, ManagedProperty> managedProperties = getManagedComponent().getProperties(); - Map<String, PropertySimple> customProps = - ResourceComponentUtils.getCustomProperties(getResourceContext().getPluginConfiguration()); - if (this.log.isDebugEnabled()) this.log.debug("*** AFTER LOAD:\n" - + DebugUtils.convertPropertiesToString(managedProperties)); - resourceConfig = ConversionUtils.convertManagedObjectToConfiguration(managedProperties, - customProps, getResourceContext().getResourceType()); - } - catch (Exception e) - { - RunState runState = getManagedComponent().getRunState(); - if (runState == RunState.RUNNING) { - this.log.error("Failed to load configuration for " + getResourceDescription() + ".", e); - } else { - this.log.debug("Failed to load configuration for " + getResourceDescription() - + ", but managed component is not in the RUNNING state.", e); - } - throw new RuntimeException(ThrowableUtil.getAllMessages(e)); - } - return resourceConfig; - } - - public void updateResourceConfiguration(ConfigurationUpdateReport configurationUpdateReport) - { - Configuration resourceConfig = configurationUpdateReport.getConfiguration(); - Configuration pluginConfig = getResourceContext().getPluginConfiguration(); - try - { - ManagedComponent managedComponent = getManagedComponent(); - Map<String, ManagedProperty> managedProperties = managedComponent.getProperties(); - Map<String, PropertySimple> customProps = ResourceComponentUtils.getCustomProperties(pluginConfig); - if (this.log.isDebugEnabled()) this.log.debug("*** BEFORE UPDATE:\n" - + DebugUtils.convertPropertiesToString(managedProperties)); - ConversionUtils.convertConfigurationToManagedProperties(managedProperties, resourceConfig, - getResourceContext().getResourceType(), customProps); - if (this.log.isDebugEnabled()) this.log.debug("*** AFTER UPDATE:\n" - + DebugUtils.convertPropertiesToString(managedProperties)); - updateComponent(managedComponent); - configurationUpdateReport.setStatus(ConfigurationUpdateStatus.SUCCESS); - } - catch (Exception e) - { - this.log.error("Failed to update configuration for " + getResourceDescription() + ".", e); - configurationUpdateReport.setStatus(ConfigurationUpdateStatus.FAILURE); - configurationUpdateReport.setErrorMessage(ThrowableUtil.getAllMessages(e)); - } - } - - // DeleteResourceFacet Implementation -------------------------------------------- - - public void deleteResource() throws Exception { - DeploymentManager deploymentManager = getConnection().getDeploymentManager(); - if (!deploymentManager.isRedeploySupported()) - throw new UnsupportedOperationException("Deletion of " + getResourceContext().getResourceType().getName() - + " Resources is not currently supported."); - ManagedComponent managedComponent = getManagedComponent(); - log.debug("Removing " + getResourceDescription() + " with component " + toString(managedComponent) + "..."); - ManagementView managementView = getConnection().getManagementView(); - managementView.removeComponent(managedComponent); - ManagedDeployment parentDeployment = managedComponent.getDeployment(); - log.debug("Redeploying parent deployment '" + parentDeployment.getName() - + "' in order to complete removal of component " + toString(managedComponent) + "..."); - DeploymentProgress progress = deploymentManager.redeploy(parentDeployment.getName()); - DeploymentStatus redeployStatus = DeploymentUtils.run(progress); - if (redeployStatus.isFailed()) { - log.error("Failed to redeploy parent deployment '" + parentDeployment.getName() - + "during removal of component " + toString(managedComponent) - + " - removal may not persist when the app server is restarted.", redeployStatus.getFailure()); - } - managementView.load(); - } - - // OperationFacet Implementation -------------------------------------------- - - public OperationResult invokeOperation(String name, Configuration parameters) throws Exception { - OperationDefinition operationDefinition = getOperationDefinition(name); - ManagedOperation managedOperation = getManagedOperation(operationDefinition); - // Convert parameters into MetaValue array. - MetaValue[] parameterMetaValues = ConversionUtils.convertOperationsParametersToMetaValues(managedOperation, - parameters, operationDefinition); - // invoke() takes a varargs, so we need to pass an empty array, rather than null. - MetaValue resultMetaValue = managedOperation.invoke(parameterMetaValues); - OperationResult result = new OperationResult(); - // Convert result MetaValue to corresponding Property type. - ConversionUtils.convertManagedOperationResults(managedOperation, resultMetaValue, result.getComplexResults(), - operationDefinition); - return result; - } - - // MeasurementFacet Implementation -------------------------------------------- - - public void getValues(MeasurementReport report, Set<MeasurementScheduleRequest> metrics) throws Exception { - ManagedComponent managedComponent = getManagedComponent(); - RunState runState = managedComponent.getRunState(); - for (MeasurementScheduleRequest request : metrics) { - try { - if (request.getName().equals("runState")) { - report.addData(new MeasurementDataTrait(request, runState.name())); - } else { - Object value = getSimpleValue(managedComponent, request); - addValueToMeasurementReport(report, request, value); - } - } catch (Exception e) { - if (runState == RunState.RUNNING) { - log.error("Failed to collect metric for " + request, e); - } else { - log.debug("Failed to collect metric for " + request - + ", but managed component is not in the RUNNING state.", e); - } - } - } - } - - protected void updateComponent(ManagedComponent managedComponent) throws Exception { - log.trace("Updating " + getResourceDescription() + " with component " + toString(managedComponent) + "..."); - ManagementView managementView = getConnection().getManagementView(); - managementView.updateComponent(managedComponent); - managementView.load(); - } - - // ------------------------------------------------------------------------------ - - /** - * The name of the measurement schedule request (i.e. the metric name) can be in one of two forms: - * <p/> - * [prefix'|']simplePropertyName (e.g. "maxTime" or "ThreadPool|currentThreadCount") - * [prefix'|']compositePropertyName'.'key (e.g. "consumerCount" or "messageStatistics.count") - * - * @param managedComponent a managed component - * @param request a measurement schedule request - * @return the metric value - */ - @Nullable - protected Object getSimpleValue(ManagedComponent managedComponent, MeasurementScheduleRequest request) { - String metricName = request.getName(); - int pipeIndex = metricName.indexOf(PREFIX_DELIMITER); - // Remove the prefix if there is one (e.g. "ThreadPool|currentThreadCount" -> "currentThreadCount"). - String compositePropName = (pipeIndex == -1) ? metricName : metricName.substring(pipeIndex + 1); - int dotIndex = compositePropName.indexOf('.'); - String metricPropName = (dotIndex == -1) ? compositePropName : compositePropName.substring(0, dotIndex); - ManagedProperty metricProp = managedComponent.getProperty(metricPropName); - if (metricProp == null) { - return null; - } - MetaValue metaValue; - if (dotIndex == -1) { - metaValue = metricProp.getValue(); - } else { - CompositeValue compositeValue = (CompositeValue) metricProp.getValue(); - String key = compositePropName.substring(dotIndex + 1); - metaValue = compositeValue.get(key); - } - return getInnerValue(metaValue); - } - - // TODO: Move this to a utility class. - @Nullable - private static Object getInnerValue(MetaValue metaValue) { - if (metaValue == null) { - return null; - } - Object value; - if (metaValue.getMetaType().isSimple()) { - SimpleValue simpleValue = (SimpleValue) metaValue; - value = simpleValue.getValue(); - } else if (metaValue.getMetaType().isEnum()) { - EnumValue enumValue = (EnumValue) metaValue; - value = enumValue.getValue(); - } else if (metaValue.getMetaType().isArray()) { - ArrayValue arrayValue = (ArrayValue) metaValue; - value = arrayValue.getValue(); - } else if (metaValue.getMetaType().isCollection()) { - CollectionValue collectionValue = (CollectionValue) metaValue; - List list = new ArrayList(); - for (MetaValue element : collectionValue.getElements()) { - list.add(getInnerValue(element)); - } - value = list; - } else { - value = metaValue.toString(); - } - return value; - } - - protected void addValueToMeasurementReport(MeasurementReport report, MeasurementScheduleRequest request, - Object value) { - if (value == null) { - return; - } - String stringValue = toString(value); - - DataType dataType = request.getDataType(); - switch (dataType) { - case MEASUREMENT: - try { - MeasurementDataNumeric dataNumeric = new MeasurementDataNumeric(request, Double.valueOf(stringValue)); - report.addData(dataNumeric); - } catch (NumberFormatException e) { - log.error("Profile service did not return a numeric value as expected for metric [" + request.getName() - + "] - value returned was " + value + ".", e); - } - break; - case TRAIT: - MeasurementDataTrait dataTrait = new MeasurementDataTrait(request, stringValue); - report.addData(dataTrait); - break; - default: - throw new IllegalStateException("Unsupported measurement data type: " + dataType); - } - } - - protected ComponentType getComponentType() { - return componentType; - } - - protected String getComponentName() { - return componentName; - } - - protected ManagedComponent getManagedComponent() { - ManagedComponent managedComponent; - try { - ManagementView managementView = getConnection().getManagementView(); - managedComponent = ManagedComponentUtils.getManagedComponent(managementView, this.componentType, - this.componentName); - } catch (Exception e) { - throw new RuntimeException("Failed to load [" + this.componentType + "] ManagedComponent [" - + this.componentName + "].", e); - } - if (managedComponent == null) - throw new IllegalStateException("Failed to find [" + this.componentType + "] ManagedComponent named [" - + this.componentName + "]."); - log.trace("Retrieved " + toString(managedComponent) + "."); - return managedComponent; - } - - @NotNull - private OperationDefinition getOperationDefinition(String operationName) { - ResourceType resourceType = getResourceContext().getResourceType(); - OperationDefinition operationDefinition = ResourceTypeUtils.getOperationDefinition(resourceType, operationName); - if (operationDefinition == null) - throw new IllegalStateException("Operation named '" + operationName - + "' is not defined for Resource type '" + resourceType.getName() + "' in the '" - + resourceType.getPlugin() + "' plugin's descriptor."); - return operationDefinition; - } - - @NotNull - private ManagedOperation getManagedOperation(OperationDefinition operationDefinition) { - ManagedComponent managedComponent = getManagedComponent(); - Set<ManagedOperation> operations = managedComponent.getOperations(); - for (ManagedOperation operation : operations) { - ConfigurationDefinition paramsConfigDef = operationDefinition.getParametersConfigurationDefinition(); - int paramCount = (paramsConfigDef != null) ? paramsConfigDef.getPropertyDefinitions().size() : 0; - if (operation.getName().equals(operationDefinition.getName()) - && (operation.getParameters().length == paramCount)) - return operation; - } - throw new IllegalStateException("ManagedOperation named '" + operationDefinition.getName() - + "' not found on ManagedComponent [" + getManagedComponent() + "]."); - } - - private static String toString(ManagedComponent managedComponent) { - Map<String, ManagedProperty> properties = managedComponent.getProperties(); - return managedComponent.getClass().getSimpleName() + "@" + System.identityHashCode(managedComponent) + "[" - + "type=" + managedComponent.getType() + ", name=" + managedComponent.getName() + ", properties=" - + properties.getClass().getSimpleName() + "@" + System.identityHashCode(properties) + "]"; - } - - private static String toString(@NotNull Object value) { - if (value.getClass().isArray()) { - StringBuilder buffer = new StringBuilder(); - int lastIndex = Array.getLength(value) - 1; - for (int i = 0; i < Array.getLength(value); i++) { - buffer.append(String.valueOf(Array.get(value, i))); - if (i == lastIndex) { - break; - } - buffer.append(", "); - } - return buffer.toString(); - } else { - return value.toString(); - } - } -} +/* +* Jopr Management Platform +* Copyright (C) 2005-2009 Red Hat, Inc. +* All rights reserved. +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License, version 2, as +* published by the Free Software Foundation, and/or the GNU Lesser +* General Public License, version 2.1, also as published by the Free +* Software Foundation. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License and the GNU Lesser General Public License +* for more details. +* +* You should have received a copy of the GNU General Public License +* and the GNU Lesser General Public License along with this program; +* if not, write to the Free Software Foundation, Inc., +* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +*/ +package org.rhq.plugins.jbossas5; + +import java.lang.reflect.Array; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.jboss.deployers.spi.management.ManagementView; +import org.jboss.deployers.spi.management.deploy.DeploymentManager; +import org.jboss.deployers.spi.management.deploy.DeploymentProgress; +import org.jboss.deployers.spi.management.deploy.DeploymentStatus; +import org.jboss.managed.api.ComponentType; +import org.jboss.managed.api.ManagedComponent; +import org.jboss.managed.api.ManagedDeployment; +import org.jboss.managed.api.ManagedOperation; +import org.jboss.managed.api.ManagedProperty; +import org.jboss.managed.api.RunState; +import org.jboss.metatype.api.values.ArrayValue; +import org.jboss.metatype.api.values.CollectionValue; +import org.jboss.metatype.api.values.CompositeValue; +import org.jboss.metatype.api.values.EnumValue; +import org.jboss.metatype.api.values.MetaValue; +import org.jboss.metatype.api.values.SimpleValue; +import org.jboss.remoting.CannotConnectException; + +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import org.rhq.core.domain.configuration.Configuration; +import org.rhq.core.domain.configuration.PropertySimple; +import org.rhq.core.domain.configuration.ConfigurationUpdateStatus; +import org.rhq.core.domain.configuration.definition.ConfigurationDefinition; +import org.rhq.core.domain.measurement.AvailabilityType; +import org.rhq.core.domain.measurement.DataType; +import org.rhq.core.domain.measurement.MeasurementDataNumeric; +import org.rhq.core.domain.measurement.MeasurementDataTrait; +import org.rhq.core.domain.measurement.MeasurementReport; +import org.rhq.core.domain.measurement.MeasurementScheduleRequest; +import org.rhq.core.domain.operation.OperationDefinition; +import org.rhq.core.domain.resource.ResourceType; +import org.rhq.core.pluginapi.configuration.ConfigurationFacet; +import org.rhq.core.pluginapi.configuration.ConfigurationUpdateReport; +import org.rhq.core.pluginapi.inventory.DeleteResourceFacet; +import org.rhq.core.pluginapi.inventory.ResourceContext; +import org.rhq.core.pluginapi.measurement.MeasurementFacet; +import org.rhq.core.pluginapi.operation.OperationFacet; +import org.rhq.core.pluginapi.operation.OperationResult; +import org.rhq.core.util.exception.ThrowableUtil; +import org.rhq.plugins.jbossas5.util.ConversionUtils; +import org.rhq.plugins.jbossas5.util.DeploymentUtils; +import org.rhq.plugins.jbossas5.util.ManagedComponentUtils; +import org.rhq.plugins.jbossas5.util.ResourceTypeUtils; +import org.rhq.plugins.jbossas5.util.ResourceComponentUtils; +import org.rhq.plugins.jbossas5.util.DebugUtils; + +/** + * Service ResourceComponent for all {@link ManagedComponent}s in a Profile. + * + * @author Ian Springer + * @author Jason Dobies + * @author Mark Spritzler + */ +public class ManagedComponentComponent extends AbstractManagedComponent implements ConfigurationFacet, + DeleteResourceFacet, OperationFacet, MeasurementFacet { + public static interface Config { + String COMPONENT_TYPE = "componentType"; + String COMPONENT_SUBTYPE = "componentSubtype"; + String COMPONENT_NAME = "componentName"; + String TEMPLATE_NAME = "templateName"; + String COMPONENT_NAME_PROPERTY = "componentNameProperty"; + } + + protected static final char PREFIX_DELIMITER = '|'; + + private final Log log = LogFactory.getLog(this.getClass()); + + private String componentName; + private ComponentType componentType; + + // ResourceComponent Implementation -------------------------------------------- + + public AvailabilityType getAvailability() { + RunState runState; + try { + runState = getManagedComponent().getRunState(); + } catch (CannotConnectException e) { + return AvailabilityType.DOWN; + } + return (runState == RunState.RUNNING) ? AvailabilityType.UP : AvailabilityType.DOWN; + } + + public void start(ResourceContext<ProfileServiceComponent> resourceContext) throws Exception { + super.start(resourceContext); + this.componentType = ConversionUtils.getComponentType(getResourceContext().getResourceType()); + Configuration pluginConfig = resourceContext.getPluginConfiguration(); + this.componentName = pluginConfig.getSimple(Config.COMPONENT_NAME).getStringValue(); + log.trace("Started ResourceComponent for " + getResourceDescription() + ", managing " + this.componentType + + " component '" + this.componentName + "'."); + } + + public void stop() { + return; + } + + // ConfigurationComponent Implementation -------------------------------------------- + + public Configuration loadResourceConfiguration() + { + Configuration resourceConfig; + try + { + Map<String, ManagedProperty> managedProperties = getManagedComponent().getProperties(); + Map<String, PropertySimple> customProps = + ResourceComponentUtils.getCustomProperties(getResourceContext().getPluginConfiguration()); + if (this.log.isDebugEnabled()) this.log.debug("*** AFTER LOAD:\n" + + DebugUtils.convertPropertiesToString(managedProperties)); + resourceConfig = ConversionUtils.convertManagedObjectToConfiguration(managedProperties, + customProps, getResourceContext().getResourceType()); + } + catch (Exception e) + { + RunState runState = getManagedComponent().getRunState(); + if (runState == RunState.RUNNING) { + this.log.error("Failed to load configuration for " + getResourceDescription() + ".", e); + } else { + this.log.debug("Failed to load configuration for " + getResourceDescription() + + ", but managed component is not in the RUNNING state.", e); + } + throw new RuntimeException(ThrowableUtil.getAllMessages(e)); + } + return resourceConfig; + } + + public void updateResourceConfiguration(ConfigurationUpdateReport configurationUpdateReport) + { + Configuration resourceConfig = configurationUpdateReport.getConfiguration(); + Configuration pluginConfig = getResourceContext().getPluginConfiguration(); + try + { + ManagedComponent managedComponent = getManagedComponent(); + Map<String, ManagedProperty> managedProperties = managedComponent.getProperties(); + Map<String, PropertySimple> customProps = ResourceComponentUtils.getCustomProperties(pluginConfig); + if (this.log.isDebugEnabled()) this.log.debug("*** BEFORE UPDATE:\n" + + DebugUtils.convertPropertiesToString(managedProperties)); + ConversionUtils.convertConfigurationToManagedProperties(managedProperties, resourceConfig, + getResourceContext().getResourceType(), customProps); + if (this.log.isDebugEnabled()) this.log.debug("*** AFTER UPDATE:\n" + + DebugUtils.convertPropertiesToString(managedProperties)); + updateComponent(managedComponent); + configurationUpdateReport.setStatus(ConfigurationUpdateStatus.SUCCESS); + } + catch (Exception e) + { + this.log.error("Failed to update configuration for " + getResourceDescription() + ".", e); + configurationUpdateReport.setStatus(ConfigurationUpdateStatus.FAILURE); + configurationUpdateReport.setErrorMessage(ThrowableUtil.getAllMessages(e)); + } + } + + // DeleteResourceFacet Implementation -------------------------------------------- + + public void deleteResource() throws Exception { + DeploymentManager deploymentManager = getConnection().getDeploymentManager(); + if (!deploymentManager.isRedeploySupported()) + throw new UnsupportedOperationException("Deletion of " + getResourceContext().getResourceType().getName() + + " Resources is not currently supported."); + ManagedComponent managedComponent = getManagedComponent(); + log.debug("Removing " + getResourceDescription() + " with component " + toString(managedComponent) + "..."); + ManagementView managementView = getConnection().getManagementView(); + managementView.removeComponent(managedComponent); + ManagedDeployment parentDeployment = managedComponent.getDeployment(); + log.debug("Redeploying parent deployment '" + parentDeployment.getName() + + "' in order to complete removal of component " + toString(managedComponent) + "..."); + DeploymentProgress progress = deploymentManager.redeploy(parentDeployment.getName()); + DeploymentStatus redeployStatus = DeploymentUtils.run(progress); + if (redeployStatus.isFailed()) { + log.error("Failed to redeploy parent deployment '" + parentDeployment.getName() + + "during removal of component " + toString(managedComponent) + + " - removal may not persist when the app server is restarted.", redeployStatus.getFailure()); + } + managementView.load(); + } + + // OperationFacet Implementation -------------------------------------------- + + public OperationResult invokeOperation(String name, Configuration parameters) throws Exception { + OperationDefinition operationDefinition = getOperationDefinition(name); + ManagedOperation managedOperation = getManagedOperation(operationDefinition); + // Convert parameters into MetaValue array. + MetaValue[] parameterMetaValues = ConversionUtils.convertOperationsParametersToMetaValues(managedOperation, + parameters, operationDefinition); + // invoke() takes a varargs, so we need to pass an empty array, rather than null. + MetaValue resultMetaValue = managedOperation.invoke(parameterMetaValues); + OperationResult result = new OperationResult(); + // Convert result MetaValue to corresponding Property type. + ConversionUtils.convertManagedOperationResults(managedOperation, resultMetaValue, result.getComplexResults(), + operationDefinition); + return result; + } + + // MeasurementFacet Implementation -------------------------------------------- + + public void getValues(MeasurementReport report, Set<MeasurementScheduleRequest> metrics) throws Exception { + ManagedComponent managedComponent = getManagedComponent(); + RunState runState = managedComponent.getRunState(); + for (MeasurementScheduleRequest request : metrics) { + try { + if (request.getName().equals("runState")) { + report.addData(new MeasurementDataTrait(request, runState.name())); + } else { + Object value = getSimpleValue(managedComponent, request); + addValueToMeasurementReport(report, request, value); + } + } catch (Exception e) { + if (runState == RunState.RUNNING) { + log.error("Failed to collect metric for " + request, e); + } else { + log.debug("Failed to collect metric for " + request + + ", but managed component is not in the RUNNING state.", e); + } + } + } + } + + protected void updateComponent(ManagedComponent managedComponent) throws Exception { + log.trace("Updating " + getResourceDescription() + " with component " + toString(managedComponent) + "..."); + ManagementView managementView = getConnection().getManagementView(); + managementView.updateComponent(managedComponent); + managementView.load(); + } + + // ------------------------------------------------------------------------------ + + /** + * The name of the measurement schedule request (i.e. the metric name) can be in one of two forms: + * <p/> + * [prefix'|']simplePropertyName (e.g. "maxTime" or "ThreadPool|currentThreadCount") + * [prefix'|']compositePropertyName'.'key (e.g. "consumerCount" or "messageStatistics.count") + * + * @param managedComponent a managed component + * @param request a measurement schedule request + * @return the metric value + */ + @Nullable + protected Object getSimpleValue(ManagedComponent managedComponent, MeasurementScheduleRequest request) { + String metricName = request.getName(); + int pipeIndex = metricName.indexOf(PREFIX_DELIMITER); + // Remove the prefix if there is one (e.g. "ThreadPool|currentThreadCount" -> "currentThreadCount"). + String compositePropName = (pipeIndex == -1) ? metricName : metricName.substring(pipeIndex + 1); + int dotIndex = compositePropName.indexOf('.'); + String metricPropName = (dotIndex == -1) ? compositePropName : compositePropName.substring(0, dotIndex); + ManagedProperty metricProp = managedComponent.getProperty(metricPropName); + if (metricProp == null) { + return null; + } + MetaValue metaValue; + if (dotIndex == -1) { + metaValue = metricProp.getValue(); + } else { + CompositeValue compositeValue = (CompositeValue) metricProp.getValue(); + String key = compositePropName.substring(dotIndex + 1); + metaValue = compositeValue.get(key); + } + return getInnerValue(metaValue); + } + + // TODO: Move this to a utility class. + @Nullable + private static Object getInnerValue(MetaValue metaValue) { + if (metaValue == null) { + return null; + } + Object value; + if (metaValue.getMetaType().isSimple()) { + SimpleValue simpleValue = (SimpleValue) metaValue; + value = simpleValue.getValue(); + } else if (metaValue.getMetaType().isEnum()) { + EnumValue enumValue = (EnumValue) metaValue; + value = enumValue.getValue(); + } else if (metaValue.getMetaType().isArray()) { + ArrayValue arrayValue = (ArrayValue) metaValue; + value = arrayValue.getValue(); + } else if (metaValue.getMetaType().isCollection()) { + CollectionValue collectionValue = (CollectionValue) metaValue; + List list = new ArrayList(); + for (MetaValue element : collectionValue.getElements()) { + list.add(getInnerValue(element)); + } + value = list; + } else { + value = metaValue.toString(); + } + return value; + } + + protected void addValueToMeasurementReport(MeasurementReport report, MeasurementScheduleRequest request, + Object value) { + if (value == null) { + return; + } + String stringValue = toString(value); + + DataType dataType = request.getDataType(); + switch (dataType) { + case MEASUREMENT: + try { + MeasurementDataNumeric dataNumeric = new MeasurementDataNumeric(request, Double.valueOf(stringValue)); + report.addData(dataNumeric); + } catch (NumberFormatException e) { + log.error("Profile service did not return a numeric value as expected for metric [" + request.getName() + + "] - value returned was " + value + ".", e); + } + break; + case TRAIT: + MeasurementDataTrait dataTrait = new MeasurementDataTrait(request, stringValue); + report.addData(dataTrait); + break; + default: + throw new IllegalStateException("Unsupported measurement data type: " + dataType); + } + } + + protected ComponentType getComponentType() { + return componentType; + } + + protected String getComponentName() { + return componentName; + } + + protected ManagedComponent getManagedComponent() { + ManagedComponent managedComponent; + try { + ManagementView managementView = getConnection().getManagementView(); + managedComponent = ManagedComponentUtils.getManagedComponent(managementView, this.componentType, + this.componentName); + } catch (Exception e) { + throw new RuntimeException("Failed to load [" + this.componentType + "] ManagedComponent [" + + this.componentName + "].", e); + } + if (managedComponent == null) + throw new IllegalStateException("Failed to find [" + this.componentType + "] ManagedComponent named [" + + this.componentName + "]."); + log.trace("Retrieved " + toString(managedComponent) + "."); + return managedComponent; + } + + @NotNull + private OperationDefinition getOperationDefinition(String operationName) { + ResourceType resourceType = getResourceContext().getResourceType(); + OperationDefinition operationDefinition = ResourceTypeUtils.getOperationDefinition(resourceType, operationName); + if (operationDefinition == null) + throw new IllegalStateException("Operation named '" + operationName + + "' is not defined for Resource type '" + resourceType.getName() + "' in the '" + + resourceType.getPlugin() + "' plugin's descriptor."); + return operationDefinition; + } + + @NotNull + private ManagedOperation getManagedOperation(OperationDefinition operationDefinition) { + ManagedComponent managedComponent = getManagedComponent(); + Set<ManagedOperation> operations = managedComponent.getOperations(); + for (ManagedOperation operation : operations) { + ConfigurationDefinition paramsConfigDef = operationDefinition.getParametersConfigurationDefinition(); + int paramCount = (paramsConfigDef != null) ? paramsConfigDef.getPropertyDefinitions().size() : 0; + if (operation.getName().equals(operationDefinition.getName()) + && (operation.getParameters().length == paramCount)) + return operation; + } + throw new IllegalStateException("ManagedOperation named '" + operationDefinition.getName() + + "' not found on ManagedComponent [" + getManagedComponent() + "]."); + } + + private static String toString(ManagedComponent managedComponent) { + Map<String, ManagedProperty> properties = managedComponent.getProperties(); + return managedComponent.getClass().getSimpleName() + "@" + System.identityHashCode(managedComponent) + "[" + + "type=" + managedComponent.getType() + ", name=" + managedComponent.getName() + ", properties=" + + properties.getClass().getSimpleName() + "@" + System.identityHashCode(properties) + "]"; + } + + private static String toString(@NotNull Object value) { + if (value.getClass().isArray()) { + StringBuilder buffer = new StringBuilder(); + int lastIndex = Array.getLength(value) - 1; + for (int i = 0; i < Array.getLength(value); i++) { + buffer.append(String.valueOf(Array.get(value, i))); + if (i == lastIndex) { + break; + } + buffer.append(", "); + } + return buffer.toString(); + } else { + return value.toString(); + } + } +}
commit 584b2d4ad057cd04b5c32eb83d82b0094801aba5 Author: Jay Shaughnessy jshaughn@redhat.com Date: Wed Jun 30 10:25:11 2010 -0400
Add pull prior to push creating remote branch of of local branch. This seems to establish that the local branch head is up to date. If not done the subsequent push to origin fails with non-fast-forward error.
diff --git a/release.sh b/release.sh index ccf6f72..da56c27 100755 --- a/release.sh +++ b/release.sh @@ -334,7 +334,7 @@ if [ "$MODE" = "production" ]; then BUILD_BRANCH="${RELEASE_BRANCH}" else BUILD_BRANCH="${RELEASE_BRANCH}-test-build" -# delete the branch if it exists, so we can recreate it fresh +# delete the branch if it exists, so we can recreate it fresh EXISTING_BUILD_BRANCH=`git ls-remote --heads origin "$BUILD_BRANCH"` if [ -n "$EXISTING_BUILD_BRANCH" ]; then echo "Deleting remote branch origin/$BUILD_BRANCH" @@ -344,7 +344,8 @@ else fi echo "Creating and checking out local branch $BUILD_BRANCH from $RELEASE_BRANCH" git checkout -b "$BUILD_BRANCH" - echo "Creating remote branch $BUILD_BRANCH" + echo "Creating remote branch $BUILD_BRANCH" + git pull origin "$BUILD_BRANCH" git push origin "$BUILD_BRANCH" fi
commit f9d920d56d03b7a0185224e155dd30a10f5b5538 Author: Heiko W. Rupp hwr@redhat.com Date: Wed Jun 30 14:28:15 2010 +0200
Monitor call time values separately.
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/CallTimeDataManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/CallTimeDataManagerBean.java index 253765d..08f3418 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/CallTimeDataManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/CallTimeDataManagerBean.java @@ -125,12 +125,15 @@ public class CallTimeDataManagerBean implements CallTimeDataManagerLocal, CallTi }
log.debug("Persisting call-time data for " + callTimeDataSet.size() + " schedules..."); + long startTime = System.currentTimeMillis();
// First make sure a single row exists in the key table for each reported call destination. callTimeDataManager.insertCallTimeDataKeys(callTimeDataSet);
// Finally, add the stats themselves to the value table. callTimeDataManager.insertCallTimeDataValues(callTimeDataSet); + MeasurementMonitor.getMBean().incrementCallTimeInsertTime(System.currentTimeMillis() - startTime); + }
@SuppressWarnings("unchecked") @@ -408,7 +411,12 @@ public class CallTimeDataManagerBean implements CallTimeDataManagerLocal, CallTi notifyAlertConditionCacheManager("insertCallTimeDataValues", callTimeDataSet .toArray(new CallTimeData[callTimeDataSet.size()]));
- log.debug("Inserted " + ((insertedRowCount >= 0) ? insertedRowCount : "?") + " call-time data value rows."); + if (insertedRowCount>0) { + MeasurementMonitor.getMBean().incrementCalltimeValuesInserted(insertedRowCount); + + log.debug("Inserted " + insertedRowCount + " call-time data value rows."); + } + } catch (SQLException e) { logSQLException("Failed to persist call-time data values", e); } catch (Throwable t) { diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/instrumentation/MeasurementMonitor.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/instrumentation/MeasurementMonitor.java index 9ad1f24..3ff3a17 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/instrumentation/MeasurementMonitor.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/instrumentation/MeasurementMonitor.java @@ -35,6 +35,10 @@ public class MeasurementMonitor implements MeasurementMonitorMBean, MBeanRegistr
private AtomicLong measurementsInserted = new AtomicLong();
+ private AtomicLong callTimeInsertTime = new AtomicLong(); + + private AtomicLong calltimeValuesInserted = new AtomicLong(); + private AtomicLong availabilityInsertTime = new AtomicLong();
private AtomicLong availabilitiesInserted = new AtomicLong(); @@ -101,6 +105,22 @@ public class MeasurementMonitor implements MeasurementMonitorMBean, MBeanRegistr this.measurementsInserted.addAndGet(delta); }
+ public long getCalltimeValuesInserted() { + return calltimeValuesInserted.get(); + } + + public void incrementCalltimeValuesInserted(long delta) { + this.calltimeValuesInserted.addAndGet(delta); + } + + public long getCallTimeInsertTime() { + return callTimeInsertTime.get(); + } + + public void incrementCallTimeInsertTime(long delta) { + this.callTimeInsertTime.addAndGet(delta); + } + public long getAvailabilityInsertTime() { return availabilityInsertTime.get(); } diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/instrumentation/MeasurementMonitorMBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/instrumentation/MeasurementMonitorMBean.java index 04fc6cd..df7b05c 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/instrumentation/MeasurementMonitorMBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/instrumentation/MeasurementMonitorMBean.java @@ -31,6 +31,14 @@ public interface MeasurementMonitorMBean {
void incrementMeasurementsInserted(long delta);
+ long getCallTimeInsertTime(); + + void incrementCallTimeInsertTime(long delta); + + long getCalltimeValuesInserted(); + + void incrementCalltimeValuesInserted(long delta); + int getScheduledMeasurementsPerMinute();
long getPurgeTime(); diff --git a/modules/plugins/rhq-server/src/main/resources/META-INF/rhq-plugin.xml b/modules/plugins/rhq-server/src/main/resources/META-INF/rhq-plugin.xml index 94db789..2ad0785 100644 --- a/modules/plugins/rhq-server/src/main/resources/META-INF/rhq-plugin.xml +++ b/modules/plugins/rhq-server/src/main/resources/META-INF/rhq-plugin.xml @@ -23,7 +23,7 @@ <c:simple-property name="nameTemplate" default="Alert Subsystem"/> <c:simple-property name="descriptionTemplate" default="Statistics for the RHQ Server Alerts Engine Subsystem."/> </plugin-configuration> - + <operation name="reloadCaches" description="Unloads then reloads all caches managed by the containing RHQ Server"> <results> <c:list-property name="reloadStatistics"> @@ -75,7 +75,7 @@ description="The total amount of time spent by the alerts cache processing resource configuration data"/> <metric property="OperationProcessingTime" units="milliseconds" displayType="summary" measurementType="trendsup" description="The total amount of time spent by the alerts cache processing operation history data"/> - + </service>
<service name="RHQ Server Measurement Subsystem" @@ -94,8 +94,13 @@ <c:simple-property name="descriptionTemplate" default="Statistics for the RHQ Server Measurement Subsystem."/> </plugin-configuration>
+ <metric property="CalltimeValuesInserted" category="throughput" displayType="summary" measurementType="trendsup" + description="The total number of call time data records inserted into the database by this RHQ Server instance since it was started"/> + <metric property="CallTimeInsertTime" units="milliseconds" displayType="summary" measurementType="trendsup" + description="The total amount of time taken to insert call time data into the database by this RHQ Server instance since it was started"/> + <metric property="MeasurementsInserted" category="throughput" displayType="summary" measurementType="trendsup" - description="The total number of measurement records inserted into the database by this RHQ Server instance since it was started"/> + description="The total number of measurement records (incl. Calltime data) inserted into the database by this RHQ Server instance since it was started"/> <metric property="ScheduledMeasurementsPerMinute" description="The average number of measurements expected to be collected per minute"/> <metric property="MeasurementInsertTime" units="milliseconds" displayType="summary" measurementType="trendsup" @@ -118,23 +123,23 @@ <metric property="FullAvailabilityReports" displayType="summary" measurementType="trendsup" description="The number of full availability reports received and processed by this RHQ Server since it was started"/>
- <metric property="PurgedAlerts" displayType="summary" measurementType="dynamic" category="utilization" defaultInterval="900000" + <metric property="PurgedAlerts" displayType="summary" measurementType="dynamic" category="utilization" defaultInterval="900000" description="Number of alerts purged by the last purge job"/> - <metric property="PurgedAlertConditions" displayType="summary" measurementType="dynamic" category="utilization" defaultInterval="900000" + <metric property="PurgedAlertConditions" displayType="summary" measurementType="dynamic" category="utilization" defaultInterval="900000" description="Number of alert conditions purged by the last purge job"/> - <metric property="PurgedAlertNotifications" displayType="summary" measurementType="dynamic" category="utilization" defaultInterval="900000" + <metric property="PurgedAlertNotifications" displayType="summary" measurementType="dynamic" category="utilization" defaultInterval="900000" description="Number of alert notifications purged by the last purge job"/> - <metric property="PurgedAvailabilities" displayType="summary" measurementType="dynamic" category="utilization" defaultInterval="900000" + <metric property="PurgedAvailabilities" displayType="summary" measurementType="dynamic" category="utilization" defaultInterval="900000" description="Number of availabilities purged by the last purge job"/> - <metric property="PurgedCallTimeData" displayType="summary" measurementType="dynamic" category="utilization" defaultInterval="900000" + <metric property="PurgedCallTimeData" displayType="summary" measurementType="dynamic" category="utilization" defaultInterval="900000" description="Number of call time data purged by the last purge job"/> - <metric property="PurgedEvents" displayType="summary" measurementType="dynamic" category="utilization" defaultInterval="900000" + <metric property="PurgedEvents" displayType="summary" measurementType="dynamic" category="utilization" defaultInterval="900000" description="Number of events purged by the last purge job"/> - <metric property="PurgedMeasurementTraits" displayType="summary" measurementType="dynamic" category="utilization" defaultInterval="900000" + <metric property="PurgedMeasurementTraits" displayType="summary" measurementType="dynamic" category="utilization" defaultInterval="900000" description="Number of traits purged by the last purge job"/> - + </service> - + <service name="RHQ Server Group Definition / DynaGroups Subsystem" discovery="org.rhq.plugins.jmx.MBeanResourceDiscoveryComponent" class="GroupDefinitionResourceComponent" @@ -144,13 +149,13 @@ <runs-inside> <parent-resource-type name="JBossAS Server" plugin="JBossAS"/> </runs-inside> - + <plugin-configuration> <c:simple-property name="objectName" readOnly="true" default="rhq:service=GroupDefinitionRecalculationThreadMonitor"/> <c:simple-property name="nameTemplate" default="Group Definition Subsystem"/> <c:simple-property name="descriptionTemplate" default="Statistics for the RHQ Server Group Definition / DynaGroups Subsystem."/> </plugin-configuration> - + <operation name="clear" displayName="Clear Statistics" description="Clear the collected statistics, and start collecting anew"/>
<operation name="retrieveStatistics" description="View a snapshot of statistical information about the recalculation cost of each GroupDefinition in the system">
commit 894b6792a5f614d63b10703a726a29e4aab603e0 Author: Joseph Marques joseph@redhat.com Date: Wed Jun 30 03:26:37 2010 -0400
BZ-602123: BZ-602270: various tweaks for alert notification processing
* never allow any exceptions to bubble up during notification processing
* add new UNKNOWN status for AlertNotificationLogs ** use the UNKNOWN state to catching mishaving plugins during alert processing
* add new DEFERRED status for AlertNotificationLogs ** use the DEFERRED state or operations ** since we don't wait for the operation to complete, we don't know it's termination state)
* add new PARTIAL status for AlertNotificationLogs ** use it to represent mixed success/failures during email sending * * do not defer email sending anymore, execute during each notification processing ** by processing them all upfront, easier to reason about terminating ResultState
diff --git a/modules/core/dbutils/src/main/scripts/dbsetup/alert-schema.xml b/modules/core/dbutils/src/main/scripts/dbsetup/alert-schema.xml index a9ad342..bce92a3 100644 --- a/modules/core/dbutils/src/main/scripts/dbsetup/alert-schema.xml +++ b/modules/core/dbutils/src/main/scripts/dbsetup/alert-schema.xml @@ -96,11 +96,9 @@ <index name="RHQ_ALERT_IDX_ALERT" unique="false"> <field ref="ALERT_ID"/> </index> - <column name="SENDER" required="false" size="200" type="VARCHAR2"/> + <column name="SENDER" required="false" size="100" type="VARCHAR2"/> <column name="RESULT_STATE" required="false" size="20" type="VARCHAR2"/> <column name="MESSAGE" required="false" size="4000" type="VARCHAR2"/> - <column name="ALL_EMAILS" required="false" size="4000" type="VARCHAR2"/> - <column name="EMAILS_FAILED" required="false" size="4000" type="VARCHAR2"/> </table>
<table name="RHQ_ALERT_CONDITION_LOG" tablespace="@@@LARGE_TABLESPACE_FOR_DATA@@@" diff --git a/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml b/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml index daf68f4..7f8f9da 100644 --- a/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml +++ b/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml @@ -2062,6 +2062,7 @@ </schemaSpec> <schemaSpec version="2.70.1"> <schema-addColumn table="RHQ_ALERT_NOTIFICATION" column="SENDER_NAME" precision="100" columnType="VARCHAR2" /> + <schema-alterColumn table="RHQ_ALERT_NOTIFICATION" column="SENDER_NAME" nullable="FALSE" /> <schema-addColumn table="RHQ_ALERT_NOTIFICATION" column="SENDER_CONFIG_ID" columnType="INTEGER" /> <schema-addColumn table="RHQ_ALERT_NOTIFICATION" column="EXTRA_CONFIG_ID" columnType="INTEGER" /> <schema-directSQL> @@ -2082,11 +2083,10 @@ </schema-directSQL> </schemaSpec> <schemaSpec version="2.70.2"> - <schema-addColumn table="RHQ_ALERT_NOTIF_LOG" column="SENDER" columnType="VARCHAR2" precision="200" /> + <schema-addColumn table="RHQ_ALERT_NOTIF_LOG" column="SENDER" columnType="VARCHAR2" precision="100" /> + <schema-alterColumn table="RHQ_ALERT_NOTIF_LOG" column="SENDER" nullable="FALSE" /> <schema-addColumn table="RHQ_ALERT_NOTIF_LOG" column="RESULT_STATE" columnType="VARCHAR2" precision="20" /> <schema-addColumn table="RHQ_ALERT_NOTIF_LOG" column="MESSAGE" columnType="VARCHAR2" precision="4000" /> - <schema-addColumn table="RHQ_ALERT_NOTIF_LOG" column="ALL_EMAILS" columnType="VARCHAR2" precision="4000" /> - <schema-addColumn table="RHQ_ALERT_NOTIF_LOG" column="EMAILS_FAILED" columnType="VARCHAR2" precision="4000" /> </schemaSpec> <schemaSpec version="2.70.3"> <schema-directSQL> diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/alert/notification/AlertNotificationLog.java b/modules/core/domain/src/main/java/org/rhq/core/domain/alert/notification/AlertNotificationLog.java index 6e25431..de07675 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/alert/notification/AlertNotificationLog.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/alert/notification/AlertNotificationLog.java @@ -23,8 +23,6 @@ package org.rhq.core.domain.alert.notification;
import java.io.Serializable; -import java.util.ArrayList; -import java.util.List;
import javax.persistence.Column; import javax.persistence.Entity; @@ -41,13 +39,11 @@ import javax.persistence.PrePersist; import javax.persistence.PreUpdate; import javax.persistence.SequenceGenerator; import javax.persistence.Table; -import javax.persistence.Transient; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlTransient;
import org.rhq.core.domain.alert.Alert; -import org.rhq.core.domain.util.StringUtils;
@Entity @NamedQueries( { @NamedQuery(name = AlertNotificationLog.QUERY_DELETE_BY_ALERT_CTIME, // @@ -90,23 +86,16 @@ public class AlertNotificationLog implements Serializable { @XmlTransient private Alert alert;
+ @Column(name = "SENDER") private String sender;
@Column(name = "RESULT_STATE") @Enumerated(EnumType.STRING) private ResultState resultState;
+ @Column(name = "MESSAGE") private String message;
- @Column(name = "ALL_EMAILS") - private String allEmails; - - @Column(name = "EMAILS_FAILED") - private String badEmails; - - @Transient - transient List<String> transientEmails = new ArrayList<String>(); - @PrePersist @PreUpdate public void trimMessage() { @@ -122,24 +111,45 @@ public class AlertNotificationLog implements Serializable { this.alert = alert; this.sender = sender; this.resultState = senderResult.getState(); - this.message = senderResult.getMessage(); - if (resultState == ResultState.DEFERRED_EMAIL && senderResult.getEmails() != null) { - this.transientEmails.addAll(senderResult.getEmails()); - this.allEmails = StringUtils.getListAsString(senderResult.getEmails(), ","); - } - } - - public AlertNotificationLog(Alert alert, String sender) { - this.alert = alert; - this.sender = sender; - this.resultState = ResultState.FAILURE; // Default if nothing specified + this.message = getMessage(senderResult); }
public AlertNotificationLog(Alert alert, String senderName, ResultState state, String message) { this.alert = alert; + this.sender = senderName; this.resultState = state; this.message = message; + } + + private String getMessage(SenderResult result) { + StringBuilder builder = new StringBuilder();
+ boolean first = true; + + if (result.getSummary() != null) { + first = false; + builder.append(result.getSummary()); + } + + for (String success : result.getSuccessMessages()) { + if (first) { + first = false; + } else { + builder.append("<br/>"); + } + builder.append(success); + } + + for (String failure : result.getFailureMessages()) { + if (first) { + first = false; + } else { + builder.append("<br/>"); + } + builder.append(failure); + } + + return builder.toString(); }
public int getId() { @@ -150,10 +160,6 @@ public class AlertNotificationLog implements Serializable { return alert; }
- public void setAlert(Alert alert) { - this.alert = alert; - } - public String getSender() { return sender; } @@ -166,38 +172,6 @@ public class AlertNotificationLog implements Serializable { return message; }
- public String getAllEmails() { - return allEmails; - } - - public String getBadEmails() { - return badEmails; - } - - public void setResultState(ResultState resultState) { - this.resultState = resultState; - } - - public void setMessage(String message) { - this.message = message; - } - - public void setAllEmails(String allEmails) { - this.allEmails = allEmails; - } - - public void setBadEmails(String badEmails) { - this.badEmails = badEmails; - } - - public List<String> getTransientEmails() { - return transientEmails; - } - - public void setTransientEmails(List<String> transientEmails) { - this.transientEmails = transientEmails; - } - @Override public String toString() { final StringBuilder sb = new StringBuilder(); @@ -207,8 +181,6 @@ public class AlertNotificationLog implements Serializable { sb.append(", sender='").append(sender).append('''); sb.append(", resultState=").append(resultState); sb.append(", message='").append(message).append('''); - sb.append(", allEmails='").append(allEmails).append('''); - sb.append(", badEmails='").append(badEmails).append('''); sb.append('}'); return sb.toString(); } diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/alert/notification/ResultState.java b/modules/core/domain/src/main/java/org/rhq/core/domain/alert/notification/ResultState.java index 0c8d1bc..a2de159 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/alert/notification/ResultState.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/alert/notification/ResultState.java @@ -24,12 +24,14 @@ package org.rhq.core.domain.alert.notification; * @see SenderResult */ public enum ResultState { - /** Success: sending of the notification was a success */ + /** Success: sending of the notification was a known success */ SUCCESS, - /** Deferred_email: this sender itself was successful, but l8er email sending may fail */ - DEFERRED_EMAIL, - /** Failure: sending of the notification failed */ + /** Partial: sending of the notification has some failures */ + PARTIAL, + /** Failure: sending of the notification was a known failure */ FAILURE, - /** Sending one ore more emails from the plugin failed */ - FAILED_EMAIL + /** Deferred: sender action was invoked, but response can not be immediately determined */ + DEFERRED, + /** Unknown: alert sender returned a null result */ + UNKNOWN } diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/alert/notification/SenderResult.java b/modules/core/domain/src/main/java/org/rhq/core/domain/alert/notification/SenderResult.java index b4ec8e1..7191636 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/alert/notification/SenderResult.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/alert/notification/SenderResult.java @@ -27,88 +27,156 @@ import java.util.List; */ public class SenderResult {
- /** Message returned for logging purposes */ - private String message; - /** Was calling the AlertSender.send() method successful? */ - private ResultState state; - /** A list of email addresses that should be notified */ - private List<String> emails = new ArrayList<String>(); - - /** - * Default constructor. State is FAILURE by default + /* + * the state is UNKNOWN by default, but will be determined as messages are added. if only success messages + * are added, then the result is considered a SUCCESS. if only failure messages are added, then the result + * is considered a FAILURE. if a mixed of success and failure messages are added, then the result is considered + * PARTIAL. the user is free to manually set */ + private boolean deferred; + private String summary; // can be set, will not affect calculated ResultState + private List<String> successMessages = new ArrayList<String>(); + private List<String> failureMessages = new ArrayList<String>(); + public SenderResult() { - this.message = "No message set"; - this.state = ResultState.FAILURE; + this.deferred = false; + } + + public static SenderResult getSimpleSuccess(String message) { + SenderResult result = new SenderResult(); + result.addSuccessMessage(message); + return result; }
- public SenderResult(ResultState state, String message) { - this.message = message; - this.state = state; + public static SenderResult getSimpleFailure(String message) { + SenderResult result = new SenderResult(); + result.addFailureMessage(message); + return result; }
- public SenderResult(ResultState state, String message, List<String> emails) { - this.message = message; - this.state = state; - this.emails = emails; + public static SenderResult getSimpleDeffered(String message) { + SenderResult result = new SenderResult(); + result.setSummary(message); + result.setDeffered(); + return result; }
- public String getMessage() { - return message; + public void setSummary(String summary) { + this.summary = summary; }
- public void setMessage(String message) { - this.message = message; + public String getSummary() { + return summary; }
public ResultState getState() { - return state; + if (deferred) { + return ResultState.DEFERRED; + } + + if (successMessages.size() != 0) { + if (failureMessages.size() == 0) { + return ResultState.SUCCESS; + } else { + return ResultState.PARTIAL; + } + } else { + if (failureMessages.size() != 0) { + return ResultState.FAILURE; + } + } + + return ResultState.UNKNOWN; }
- public void setState(ResultState state) { - this.state = state; + public void setDeffered() { + deferred = true; }
- public List<String> getEmails() { - return emails; + public void addSuccessMessage(String message) { + successMessages.add(message); }
- public void setEmails(List<String> emails) { - this.emails = emails; + public List<String> getSuccessMessages() { + return successMessages; }
- public void addEmail(String email) { - emails.add(email); + public void addFailureMessage(String message) { + failureMessages.add(message); + } + + public List<String> getFailureMessages() { + return failureMessages; }
@Override public String toString() { final StringBuilder sb = new StringBuilder(); sb.append("SenderResult"); - sb.append("{message='").append(message).append('''); - sb.append(", state=").append(state); - sb.append(", emails=").append(emails); + sb.append("{state=").append(getState()); + sb.append(", summary=").append(summary); + sb.append(", successMessages=").append(successMessages); + sb.append(", failureMessages=").append(failureMessages); sb.append('}'); return sb.toString(); }
@Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - - SenderResult that = (SenderResult) o; - - if (message != null ? !message.equals(that.message) : that.message != null) return false; - if (state != that.state) return false; + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + + if (obj == null) { + return false; + } + + if (getClass() != obj.getClass()) { + return false; + } + + SenderResult other = (SenderResult) obj; + + if (getState() != other.getState()) { + return false; + } + + if (summary == null) { + if (other.summary != null) { + return false; + } + } else if (!summary.equals(other.summary)) { + return false; + } + + if (failureMessages == null) { + if (other.failureMessages != null) { + return false; + } + } else if (!failureMessages.equals(other.failureMessages)) { + return false; + } + + if (successMessages == null) { + if (other.successMessages != null) { + return false; + } + } else if (!successMessages.equals(other.successMessages)) { + return false; + }
return true; }
@Override public int hashCode() { - int result = message != null ? message.hashCode() : 0; - result = 31 * result + (state != null ? state.hashCode() : 0); + final int prime = 31; + int result = 1; + result = prime * result + ((summary == null) ? 0 : summary.hashCode()); + result = prime * result + ((failureMessages == null) ? 0 : failureMessages.hashCode()); + result = prime * result + ((successMessages == null) ? 0 : successMessages.hashCode()); + result = prime * result + (getState() != null ? getState().hashCode() : 0); return result; } + } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertDataSource.java index de4d5ea..6e5430f 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertDataSource.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertDataSource.java @@ -38,7 +38,6 @@ import com.smartgwt.client.data.fields.DataSourceBooleanField; import com.smartgwt.client.data.fields.DataSourceIntegerField; import com.smartgwt.client.data.fields.DataSourceTextField; import com.smartgwt.client.rpc.RPCResponse; -import com.smartgwt.client.types.FieldType; import com.smartgwt.client.widgets.grid.ListGrid; import com.smartgwt.client.widgets.grid.ListGridRecord;
@@ -99,13 +98,9 @@ public class AlertDataSource extends RPCDataSource<Alert> { resourceName.setCanSortClientOnly(true); fields.add(resourceName);
- -// DataSourceTextField recoveryInfoField = new DataSourceTextField("recoveryInfo", "Recovery Info"); -// recoveryInfoField.setCanSortClientOnly(true); -// fields.add(recoveryInfoField); - - - + // DataSourceTextField recoveryInfoField = new DataSourceTextField("recoveryInfo", "Recovery Info"); + // recoveryInfoField.setCanSortClientOnly(true); + // fields.add(recoveryInfoField);
// TODO: Will using DataSourceEnumField here allow us to do // record.setAttribute("priority", alert.getAlertDefinition().getPriority()), rather than @@ -269,8 +264,6 @@ public class AlertDataSource extends RPCDataSource<Alert> { dc.setAttribute("sender", log.getSender()); dc.setAttribute("status", log.getResultState()); dc.setAttribute("message", log.getMessage()); - dc.setAttribute("allEmails", log.getAllEmails()); - dc.setAttribute("badEmails", log.getBadEmails());
notifications[i++] = dc;
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/alerts/ViewAlertNotifications.jsp b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/alerts/ViewAlertNotifications.jsp index f228d2b..282db80 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/alerts/ViewAlertNotifications.jsp +++ b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/alerts/ViewAlertNotifications.jsp @@ -15,20 +15,21 @@ <c:choose> <c:when test="${not empty aNotifLogs }"> <tr> - <td class="BlockLeftAlignLabel" width="10%">Sender</td> - <td class="BlockLeftAlignLabel" width="10%">Result</td> - <td class="BlockLeftAlignLabel" width="30%">Message</td> - <td class="BlockLeftAlignLabel" width="25%">All emails</td> - <td class="BlockLeftAlignLabel" width="25%">Failed emails</td> + <td class="BlockLeftAlignLabel" width="15%">Sender</td> + <td class="BlockLeftAlignLabel" width="15%">Result</td> + <td class="BlockLeftAlignLabel" width="70%">Message</td> + </tr> + <tr> + <td colspan="3" class="BlockBottomLine"><html:img page="/images/spacer.gif" width="1" height="1" border="0"/></td> </tr> <c:forEach var="notif" items="${aNotifLogs}"> <tr valign="top"> <td class="BlockContent"><c:out value="${notif.sender}"/></td> <td class="BlockContent"><c:out value="${notif.resultState}"/></td> <td class="BlockContent"><c:out escapeXml="false" value="${fn:replace(fn:replace(notif.message, '<', '<'), '>', '>')}"/></td> - <td class="BlockContent"><c:out value="${notif.allEmails}"/></td> - <td class="BlockContent"><c:out value="${notif.badEmails}"/></td> - <p/> + </tr> + <tr> + <td colspan="3" class="BlockBottomLine"><html:img page="/images/spacer.gif" width="1" height="1" border="0"/></td> </tr> </c:forEach> </c:when> @@ -37,6 +38,9 @@ <td class="BlockContent"> <strong>No notifications were specified for this alert's definition</strong> </td> + <tr> + <td class="BlockBottomLine"><html:img page="/images/spacer.gif" width="1" height="1" border="0"/></td> + </tr> </tr> </c:otherwise> </c:choose> diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/AlertManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/AlertManagerBean.java index c856a24..108e2d5 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/AlertManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/AlertManagerBean.java @@ -27,7 +27,7 @@ import java.util.Arrays; import java.util.Collection; import java.util.Date; import java.util.HashMap; -import java.util.LinkedHashSet; +import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; @@ -67,7 +67,6 @@ import org.rhq.core.domain.resource.Resource; import org.rhq.core.domain.util.PageControl; import org.rhq.core.domain.util.PageList; import org.rhq.core.domain.util.PageOrdering; -import org.rhq.core.domain.util.StringUtils; import org.rhq.core.server.MeasurementConverter; import org.rhq.core.server.PersistenceUtility; import org.rhq.core.util.collection.ArrayUtils; @@ -654,94 +653,48 @@ public class AlertManagerBean implements AlertManagerLocal, AlertManagerRemote { try { log.debug("Sending alert notifications for " + alert.toSimpleString() + "..."); List<AlertNotification> alertNotifications = alert.getAlertDefinition().getAlertNotifications(); - Set<String> emailAddresses = new LinkedHashSet<String>(); + //Set<String> emailAddresses = new LinkedHashSet<String>();
AlertSenderPluginManager alertSenderPluginManager = getAlertPluginManager();
for (AlertNotification alertNotification : alertNotifications) { + AlertNotificationLog notificationLog = null;
- // Send over the new AlertSender plugins String senderName = alertNotification.getSenderName(); if (senderName == null) { - log.error("Alert notification " + alertNotification + " has no sender name defined"); - continue; - } - - AlertNotificationLog alNoLo; - AlertSender<?> sender = alertSenderPluginManager.getAlertSenderForNotification(alertNotification); - - if (sender != null) { - try { - SenderResult result = sender.send(alert); - - if (result == null) { - log.warn("- !! -- sender [" + senderName - + "] did not return a SenderResult. Please fix this -- !! - "); - alNoLo = new AlertNotificationLog(alert, senderName); - alNoLo.setMessage("Sender did not return a SenderResult, assuming failure"); + notificationLog = new AlertNotificationLog(alert, senderName, ResultState.FAILURE, "Sender '" + + senderName + "' is not defined"); + } else {
- } else if (result.getState() == ResultState.DEFERRED_EMAIL) { + AlertSender<?> notificationSender = alertSenderPluginManager + .getAlertSenderForNotification(alertNotification); + if (notificationSender == null) { + notificationLog = new AlertNotificationLog(alert, senderName, ResultState.FAILURE, + "Failed to obtain a sender with given name"); + } else { + try { + SenderResult result = notificationSender.send(alert); + if (log.isDebugEnabled()) { + log.debug(result); + }
- alNoLo = new AlertNotificationLog(alert, senderName, result); - if (result.getEmails() != null && !result.getEmails().isEmpty()) { - emailAddresses.addAll(result.getEmails()); + if (result == null) { + notificationLog = new AlertNotificationLog(alert, senderName, ResultState.UNKNOWN, + "Sender did not return any result"); + } else { + notificationLog = new AlertNotificationLog(alert, senderName, result); } - } else { - alNoLo = new AlertNotificationLog(alert, senderName, result); + } catch (Throwable t) { + log.error("Notification processing terminated abruptly" + t.getMessage()); + notificationLog = new AlertNotificationLog(alert, senderName, ResultState.FAILURE, + "Notification processing terminated abruptly, cause: " + t.getMessage()); } - log.debug(result); - } catch (Throwable t) { - log.error("Sender failed: " + t.getMessage()); - if (log.isDebugEnabled()) - log.debug("Sender " + sender.toString() + "failed: \n", t); - alNoLo = new AlertNotificationLog(alert, senderName, ResultState.FAILURE, - "Failed with exception: " + t.getMessage()); } - } else { - alNoLo = new AlertNotificationLog(alert, senderName, ResultState.FAILURE, - "Failed to obtain a sender with given name"); } - entityManager.persist(alNoLo); - alert.addAlertNotificatinLog(alNoLo); - }
- // send them off - Collection<String> badAddresses = null; - try { - badAddresses = sendAlertNotificationEmails(alert, emailAddresses); - } catch (Throwable t) { - badAddresses = new ArrayList<String>(); - log.error("Could not send emails to " + emailAddresses + " for " + alert + ", cause:", t); - } - // TODO we may do the same for SMS in the future. - - // log those bad addresses to the gui and their individual senders (if possible) - if (!badAddresses.isEmpty()) { - for (AlertNotificationLog anl : alert.getAlertNotificationLogs()) { - if (!(anl.getResultState() == ResultState.DEFERRED_EMAIL)) - continue; - - List<String> badList = new ArrayList<String>(); - for (String badOne : badAddresses) { - if (anl.getTransientEmails().contains(badOne)) { - anl.setResultState(ResultState.FAILED_EMAIL); - badList.add(badOne); - } - } - if (anl.getResultState() == ResultState.FAILED_EMAIL) - anl.setBadEmails(StringUtils.getListAsString(badList, ",")); - if (anl.getResultState() == ResultState.DEFERRED_EMAIL && badList.isEmpty()) - anl.setResultState(ResultState.SUCCESS); - } - } else { // No bad addresses - // Only set the result state to success for email sending notifications - // We must not set them if the notification failed. - for (AlertNotificationLog anl : alert.getAlertNotificationLogs()) { - if (anl.getResultState() == ResultState.DEFERRED_EMAIL) - anl.setResultState(ResultState.SUCCESS); - } + entityManager.persist(notificationLog); + alert.addAlertNotificatinLog(notificationLog); } - } catch (Throwable t) { log.error("Failed to send all notifications for " + alert.toSimpleString(), t); } @@ -767,35 +720,37 @@ public class AlertManagerBean implements AlertManagerLocal, AlertManagerRemote { return manager; }
- /** - * - * @param alert - * @param emailAddresses - * @return - */ - private Collection<String> sendAlertNotificationEmails(Alert alert, Set<String> emailAddresses) { + public Collection<String> sendAlertNotificationEmails(Alert alert, Collection<String> emailAddresses) { + log.debug("Sending alert notifications for " + alert.toSimpleString() + "...");
- if (emailAddresses.size() == 0) + if (emailAddresses.size() == 0) { return new ArrayList<String>(0); // No email to send -> no bad addresses - - log.debug("Sending alert notifications for " + alert.toSimpleString() + "..."); + }
AlertDefinition alertDefinition = alert.getAlertDefinition(); Map<String, String> alertMessage = emailManager.getAlertEmailMessage( - prettyPrintResourceHierarchy(alertDefinition.getResource()), alertDefinition.getResource().getName(), - alertDefinition.getName(), alertDefinition.getPriority().toString(), new Date(alert.getCtime()).toString(), - prettyPrintAlertConditions(alert.getConditionLogs(), false), prettyPrintAlertURL(alert)); + prettyPrintResourceHierarchy(alertDefinition.getResource()), // + alertDefinition.getResource().getName(), // + alertDefinition.getName(), // + alertDefinition.getPriority().toString(), // + new Date(alert.getCtime()).toString(), // + prettyPrintAlertConditions(alert.getConditionLogs(), false), // + prettyPrintAlertURL(alert)); + String messageSubject = alertMessage.keySet().iterator().next(); String messageBody = alertMessage.values().iterator().next();
- Collection<String> badAddresses; - badAddresses = emailManager.sendEmail(emailAddresses, messageSubject, messageBody); + Set<String> uniqueAddresses = new HashSet<String>(emailAddresses); + Collection<String> badAddresses = emailManager.sendEmail(uniqueAddresses, messageSubject, messageBody); + if (log.isDebugEnabled()) { - if (badAddresses.isEmpty()) + if (badAddresses.isEmpty()) { log.debug("All notifications for " + alert.toSimpleString() + " succeeded"); - else + } else { log.debug("Sending email notifications for " + badAddresses + " failed"); + } } + return badAddresses; }
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/AlertManagerLocal.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/AlertManagerLocal.java index f32c82e..528fdf5 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/AlertManagerLocal.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/AlertManagerLocal.java @@ -18,6 +18,7 @@ */ package org.rhq.enterprise.server.alert;
+import java.util.Collection; import java.util.List; import java.util.Map;
@@ -109,6 +110,8 @@ public interface AlertManagerLocal { */ boolean willDefinitionBeDisabled(Alert alert);
+ Collection<String> sendAlertNotificationEmails(Alert alert, Collection<String> emailAddresses); + // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! // // The following are shared with the Remote Interface diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/plugin/pc/alert/AlertSender.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/plugin/pc/alert/AlertSender.java index 5a958b1..de35d54 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/plugin/pc/alert/AlertSender.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/plugin/pc/alert/AlertSender.java @@ -161,4 +161,5 @@ public abstract class AlertSender<T extends ServerPluginComponent> { } return builder.toString(); } + } diff --git a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/alert/test/AlertManagerBeanTest.java b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/alert/test/AlertManagerBeanTest.java index 3d6ab03..79fcb3b 100644 --- a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/alert/test/AlertManagerBeanTest.java +++ b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/alert/test/AlertManagerBeanTest.java @@ -35,6 +35,7 @@ import org.rhq.core.domain.alert.AlertDefinition; import org.rhq.core.domain.alert.AlertPriority; import org.rhq.core.domain.alert.BooleanExpression; import org.rhq.core.domain.alert.notification.AlertNotificationLog; +import org.rhq.core.domain.alert.notification.ResultState; import org.rhq.core.domain.auth.Subject; import org.rhq.core.domain.resource.Agent; import org.rhq.core.domain.resource.Resource; @@ -115,7 +116,7 @@ public class AlertManagerBeanTest extends AbstractEJB3Test { Alert a = new Alert(ad, now); em.persist(a);
- AlertNotificationLog anl = new AlertNotificationLog(a, "dummy"); + AlertNotificationLog anl = new AlertNotificationLog(a, "dummy", ResultState.SUCCESS, "message"); em.persist(anl);
} catch (Exception e) { diff --git a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/scheduler/jobs/DataPurgeJobTest.java b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/scheduler/jobs/DataPurgeJobTest.java index 7f06451..6f6ec38 100644 --- a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/scheduler/jobs/DataPurgeJobTest.java +++ b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/scheduler/jobs/DataPurgeJobTest.java @@ -49,6 +49,7 @@ import org.rhq.core.domain.alert.AlertDefinition; import org.rhq.core.domain.alert.AlertPriority; import org.rhq.core.domain.alert.BooleanExpression; import org.rhq.core.domain.alert.notification.AlertNotificationLog; +import org.rhq.core.domain.alert.notification.ResultState; import org.rhq.core.domain.auth.Subject; import org.rhq.core.domain.event.Event; import org.rhq.core.domain.event.EventDefinition; @@ -427,7 +428,7 @@ public class DataPurgeJobTest extends AbstractEJB3Test { Alert a = new Alert(ad, timestamp); em.persist(a);
- AlertNotificationLog anl = new AlertNotificationLog(a, "dummy"); + AlertNotificationLog anl = new AlertNotificationLog(a, "dummy", ResultState.SUCCESS, "message"); em.persist(anl);
AlertCondition ac = ad.getConditions().iterator().next(); diff --git a/modules/enterprise/server/plugins/alert-email/src/main/java/org/rhq/enterprise/server/plugins/alertEmail/EmailSender.java b/modules/enterprise/server/plugins/alert-email/src/main/java/org/rhq/enterprise/server/plugins/alertEmail/EmailSender.java index 81b1383..5b07b7b 100644 --- a/modules/enterprise/server/plugins/alert-email/src/main/java/org/rhq/enterprise/server/plugins/alertEmail/EmailSender.java +++ b/modules/enterprise/server/plugins/alert-email/src/main/java/org/rhq/enterprise/server/plugins/alertEmail/EmailSender.java @@ -18,12 +18,16 @@ */ package org.rhq.enterprise.server.plugins.alertEmail;
+import java.util.ArrayList; +import java.util.Collection; +import java.util.HashSet; import java.util.List; +import java.util.Set;
import org.rhq.core.domain.alert.Alert; -import org.rhq.core.domain.alert.notification.ResultState; import org.rhq.core.domain.alert.notification.SenderResult; import org.rhq.enterprise.server.plugin.pc.alert.AlertSender; +import org.rhq.enterprise.server.util.LookupUtil;
/** * Class to send emails. Actually it does not do the work @@ -37,11 +41,32 @@ public class EmailSender extends AlertSender { public SenderResult send(Alert alert) { String emailAddressString = alertParameters.getSimpleValue("emailAddress", null); if (emailAddressString == null) { - return new SenderResult(ResultState.FAILURE, "No email address given"); + return SenderResult.getSimpleFailure("No email address given"); }
List<String> emails = AlertSender.unfence(emailAddressString, String.class, ","); - return new SenderResult(ResultState.DEFERRED_EMAIL, "Sending to addresses: " + emails, emails); + try { + Set<String> uniqueEmails = new HashSet<String>(emails); + Collection<String> badEmails = LookupUtil.getAlertManager() + .sendAlertNotificationEmails(alert, uniqueEmails); + + List<String> goodEmails = new ArrayList<String>(uniqueEmails); + goodEmails.removeAll(badEmails); + + SenderResult result = new SenderResult(); + result.setSummary("Target addresses were: " + uniqueEmails); + if (goodEmails.size() > 0) { + result.addSuccessMessage("Successfully sent to: " + goodEmails); + } + if (badEmails.size() > 0) { + result.addFailureMessage("Failed to send to: " + badEmails); + } + return result; + } catch (Throwable t) { + return SenderResult.getSimpleFailure("Error sending email notifications to " + emails + ", cause: " + + t.getMessage()); + } + }
@Override diff --git a/modules/enterprise/server/plugins/alert-irc/src/main/java/org/rhq/enterprise/server/plugins/alertIrc/IrcSender.java b/modules/enterprise/server/plugins/alert-irc/src/main/java/org/rhq/enterprise/server/plugins/alertIrc/IrcSender.java index 95abdb9..d0a48bf 100644 --- a/modules/enterprise/server/plugins/alert-irc/src/main/java/org/rhq/enterprise/server/plugins/alertIrc/IrcSender.java +++ b/modules/enterprise/server/plugins/alert-irc/src/main/java/org/rhq/enterprise/server/plugins/alertIrc/IrcSender.java @@ -22,7 +22,6 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory;
import org.rhq.core.domain.alert.Alert; -import org.rhq.core.domain.alert.notification.ResultState; import org.rhq.core.domain.alert.notification.SenderResult; import org.rhq.enterprise.server.alert.AlertManagerLocal; import org.rhq.enterprise.server.plugin.pc.alert.AlertSender; @@ -39,20 +38,17 @@ public class IrcSender extends AlertSender<IrcAlertComponent> {
@Override public SenderResult send(Alert alert) { - SenderResult result; String channel = this.alertParameters.getSimpleValue("channel", null); - String server = preferences.getSimpleValue("server","-not set-"); + String server = preferences.getSimpleValue("server", "-not set-"); String chan = "irc://" + server + "/" + channel;
try { this.pluginComponent.sendIrcMessage(channel, getIrcMessage(alert)); - result = new SenderResult(ResultState.SUCCESS, "IRC Alert sent to channel [" + chan + "]."); - } catch (IllegalStateException e) { - log.error(e.getMessage()); - result = new SenderResult(ResultState.FAILURE, "IRC Alert to [" + chan + "] failed! " + e.getMessage()); + return SenderResult.getSimpleSuccess("IRC Alert sent to channel [" + chan + "]."); + } catch (Throwable t) { + log.error(t.getMessage()); + return SenderResult.getSimpleFailure("IRC Alert to [" + chan + "] failed! " + t.getMessage()); } - - return result; }
private String getIrcMessage(Alert alert) { diff --git a/modules/enterprise/server/plugins/alert-microblog/src/main/java/org/rhq/enterprise/server/plugins/alertMicroblog/MicroblogSender.java b/modules/enterprise/server/plugins/alert-microblog/src/main/java/org/rhq/enterprise/server/plugins/alertMicroblog/MicroblogSender.java index b13763e..37f724a 100644 --- a/modules/enterprise/server/plugins/alert-microblog/src/main/java/org/rhq/enterprise/server/plugins/alertMicroblog/MicroblogSender.java +++ b/modules/enterprise/server/plugins/alert-microblog/src/main/java/org/rhq/enterprise/server/plugins/alertMicroblog/MicroblogSender.java @@ -18,20 +18,19 @@ */ package org.rhq.enterprise.server.plugins.alertMicroblog;
-import twitter4j.Status; -import twitter4j.Twitter; -import twitter4j.TwitterException; - import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory;
import org.rhq.core.domain.alert.Alert; -import org.rhq.core.domain.alert.notification.ResultState; import org.rhq.core.domain.alert.notification.SenderResult; import org.rhq.enterprise.server.alert.AlertManagerLocal; import org.rhq.enterprise.server.plugin.pc.alert.AlertSender; import org.rhq.enterprise.server.util.LookupUtil;
+import twitter4j.Status; +import twitter4j.Twitter; +import twitter4j.TwitterException; + /** * Send alert notifications via Microblogging services like Twitter or laconi.ca * @author Heiko W. Rupp @@ -43,12 +42,12 @@ public class MicroblogSender extends AlertSender { @Override public SenderResult send(Alert alert) {
- String user = preferences.getSimpleValue("user",null); - String password = preferences.getSimpleValue("password",null); - String baseUrl = preferences.getSimpleValue("microblogServerUrl","http://twitter.com/"); + String user = preferences.getSimpleValue("user", null); + String password = preferences.getSimpleValue("password", null); + String baseUrl = preferences.getSimpleValue("microblogServerUrl", "http://twitter.com/"); if (!baseUrl.endsWith("/")) - baseUrl = baseUrl +"/"; - Twitter twitter = new Twitter(user,password,baseUrl); + baseUrl = baseUrl + "/"; + Twitter twitter = new Twitter(user, password, baseUrl); AlertManagerLocal alertManager = LookupUtil.getAlertManager(); twitter.setSource("Jopr"); StringBuilder b = new StringBuilder("Alert "); @@ -61,22 +60,20 @@ public class MicroblogSender extends AlertSender { b.append("-by @JBossJopr"); // TODO not for production :-) // TODO use some alert url shortening service
- SenderResult result ; String txt = "user@baseUrl [" + user + "@" + baseUrl + "]:"; try { String msg = b.toString(); - if (msg.length()>140) - msg = msg.substring(0,140); + if (msg.length() > 140) + msg = msg.substring(0, 140);
Status status = twitter.updateStatus(msg);
- result = new SenderResult(ResultState.SUCCESS,"Send notification to " + txt + ", msg-id: " + status.getId()); + return SenderResult.getSimpleSuccess("Send notification to " + txt + ", msg-id: " + status.getId()); } catch (TwitterException e) {
log.warn("Notification via Microblog failed for " + txt + " ", e); - result = new SenderResult(ResultState.FAILURE,"Sending failed :" + e.getMessage()); + return SenderResult.getSimpleFailure("Sending failed :" + e.getMessage());
} - return result; } } diff --git a/modules/enterprise/server/plugins/alert-mobicents/src/main/java/org/rhq/enterprise/server/plugins/alertMobicents/MobicentsSender.java b/modules/enterprise/server/plugins/alert-mobicents/src/main/java/org/rhq/enterprise/server/plugins/alertMobicents/MobicentsSender.java index b14c85d..4884e3a 100644 --- a/modules/enterprise/server/plugins/alert-mobicents/src/main/java/org/rhq/enterprise/server/plugins/alertMobicents/MobicentsSender.java +++ b/modules/enterprise/server/plugins/alert-mobicents/src/main/java/org/rhq/enterprise/server/plugins/alertMobicents/MobicentsSender.java @@ -28,7 +28,6 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory;
import org.rhq.core.domain.alert.Alert; -import org.rhq.core.domain.alert.notification.ResultState; import org.rhq.core.domain.alert.notification.SenderResult; import org.rhq.core.domain.resource.Resource; import org.rhq.enterprise.server.alert.AlertManagerLocal; @@ -46,13 +45,13 @@ public class MobicentsSender extends AlertSender { @Override public SenderResult send(Alert alert) {
- String baseUrl = preferences.getSimpleValue("mobicentsServerUrl","http://localhost:8080/mobicents"); - String tel = alertParameters.getSimpleValue("targetAddress",null); - if (tel==null) { + String baseUrl = preferences.getSimpleValue("mobicentsServerUrl", "http://localhost:8080/mobicents"); + String tel = alertParameters.getSimpleValue("targetAddress", null); + if (tel == null) { log.warn("No number to call given, not sending"); - return new SenderResult(ResultState.FAILURE, "No target address given"); + return SenderResult.getSimpleFailure("No target address given"); } - String kindString = alertParameters.getSimpleValue("kind","VOICE"); + String kindString = alertParameters.getSimpleValue("kind", "VOICE"); MobiKind kind = MobiKind.valueOf(kindString);
Integer alertId = alert.getId(); @@ -61,81 +60,81 @@ public class MobicentsSender extends AlertSender { AlertManagerLocal alertManager = LookupUtil.getAlertManager();
switch (kind) { - case VOICE: - b.append("Alert on resource "); - do { - b.append(res.getName()); - res = res.getParentResource(); - if (res!=null) - b.append(" with parent "); - } while (res!=null); - b.append(". Cause is "); - - // Switch locale to english, as the voice synthesizer expects this for now - Locale currentLocale = Locale.getDefault(); - Locale.setDefault(Locale.ENGLISH); - b.append(alertManager.prettyPrintAlertConditions(alert, false)); - Locale.setDefault(currentLocale); - - boolean willBeDisabled = alertManager.willDefinitionBeDisabled(alert); - - if (willBeDisabled) - b.append(" The alert definition will now be disabled. \n\n"); - - // b.append(" Please press "); - // - // if (willBeDisabled) { - // b.append(AlertFeedback.REENABLE.getText()); - // } else { - // b.append(AlertFeedback.DISABLE.getText()); - // } - // b.append(", "); - // b.append(AlertFeedback.DELETE.getText()); - // b.append(" or just hang up to do nothing."); - break; - case SMS: - b.append("Alert: "); + case VOICE: + b.append("Alert on resource "); + do { b.append(res.getName()); - b.append(",id=(").append(res.getId()).append(")"); - b.append("Brought by RHQ"); - break; - default: - log.warn("Unsupported Mobicents notification type for now"); + res = res.getParentResource(); + if (res != null) + b.append(" with parent "); + } while (res != null); + b.append(". Cause is "); + + // Switch locale to english, as the voice synthesizer expects this for now + Locale currentLocale = Locale.getDefault(); + Locale.setDefault(Locale.ENGLISH); + b.append(alertManager.prettyPrintAlertConditions(alert, false)); + Locale.setDefault(currentLocale); + + boolean willBeDisabled = alertManager.willDefinitionBeDisabled(alert); + + if (willBeDisabled) + b.append(" The alert definition will now be disabled. \n\n"); + + // b.append(" Please press "); + // + // if (willBeDisabled) { + // b.append(AlertFeedback.REENABLE.getText()); + // } else { + // b.append(AlertFeedback.DISABLE.getText()); + // } + // b.append(", "); + // b.append(AlertFeedback.DELETE.getText()); + // b.append(" or just hang up to do nothing."); + break; + case SMS: + b.append("Alert: "); + b.append(res.getName()); + b.append(",id=(").append(res.getId()).append(")"); + b.append("Brought by RHQ"); + break; + default: + log.warn("Unsupported Mobicents notification type for now"); }
URL url; - int code=0; + int code = 0; HttpURLConnection conn = null; try { tel = tel.trim(); - String telEnc = URLEncoder.encode(tel,"UTF-8"); // url encode tel-no, as it can contain '+' + String telEnc = URLEncoder.encode(tel, "UTF-8"); // url encode tel-no, as it can contain '+' switch (kind) { - case SMS: - baseUrl = baseUrl + "sms"; // No trailing '/' ! - break; - case VOICE: - baseUrl = baseUrl + "call"; // No trailing '/' ! - break; - default: - baseUrl = baseUrl + "--not-supported-yet--"; + case SMS: + baseUrl = baseUrl + "sms"; // No trailing '/' ! + break; + case VOICE: + baseUrl = baseUrl + "call"; // No trailing '/' ! + break; + default: + baseUrl = baseUrl + "--not-supported-yet--"; } - baseUrl = baseUrl +"?alertId="+alertId; - baseUrl = baseUrl +"&tel="; - if (kind==MobiKind.VOICE) { + baseUrl = baseUrl + "?alertId=" + alertId; + baseUrl = baseUrl + "&tel="; + if (kind == MobiKind.VOICE) { if (!tel.startsWith("sip:")) { - baseUrl = baseUrl +"sip:"; + baseUrl = baseUrl + "sip:"; } } - baseUrl = baseUrl +telEnc; - if (kind==MobiKind.VOICE) { + baseUrl = baseUrl + telEnc; + if (kind == MobiKind.VOICE) { if (!tel.contains("@")) { // Append domain from preferences if user has none provided - String domain = preferences.getSimpleValue("defaultVoipDomain","localhost"); + String domain = preferences.getSimpleValue("defaultVoipDomain", "localhost"); baseUrl = baseUrl + "@" + domain; } } // TODO SMS url
- log.info("Mobicents alert ["+ kind + "] to baseUrl [" + baseUrl + "] with message:\n" + b.toString()); + log.info("Mobicents alert [" + kind + "] to baseUrl [" + baseUrl + "] with message:\n" + b.toString()); url = new URL(baseUrl); conn = (HttpURLConnection) url.openConnection(); conn.setRequestMethod("POST"); @@ -151,20 +150,17 @@ public class MobicentsSender extends AlertSender { code = conn.getResponseCode(); } catch (Exception e) { log.warn("Notification via VoIP failed: " + e); - return new SenderResult(ResultState.FAILURE,"Sending failed " + e.getMessage()); - } - finally { - if (conn!=null) + return SenderResult.getSimpleFailure("Sending failed " + e.getMessage()); + } finally { + if (conn != null) conn.disconnect(); } - SenderResult result; - if (code!=200) { + + if (code != 200) { log.info("Notification via Mobicents returned code " + code); - result=new SenderResult(ResultState.FAILURE,"Notification via Mobicents returned code " + code); - } - else { - result=new SenderResult(ResultState.SUCCESS,"Mobicents alert ["+ kind + "] to baseUrl [" + baseUrl + "]" ); + return SenderResult.getSimpleFailure("Notification via Mobicents returned code " + code); + } else { + return SenderResult.getSimpleSuccess("Mobicents alert [" + kind + "] to baseUrl [" + baseUrl + "]"); } - return result; } } diff --git a/modules/enterprise/server/plugins/alert-operations/src/main/java/org/rhq/enterprise/server/plugins/alertOperations/AlertTokenReplacer.java b/modules/enterprise/server/plugins/alert-operations/src/main/java/org/rhq/enterprise/server/plugins/alertOperations/AlertTokenReplacer.java index 21c3bfe..cdf03ac 100644 --- a/modules/enterprise/server/plugins/alert-operations/src/main/java/org/rhq/enterprise/server/plugins/alertOperations/AlertTokenReplacer.java +++ b/modules/enterprise/server/plugins/alert-operations/src/main/java/org/rhq/enterprise/server/plugins/alertOperations/AlertTokenReplacer.java @@ -67,7 +67,9 @@ public class AlertTokenReplacer { String work = input; Matcher matcher = pattern.matcher(work); if (!matcher.find()) { - log.warn("No tokens found in " + input); + if (log.isDebugEnabled()) { + log.debug("No tokens found in " + input); + } return input; } matcher.reset(); diff --git a/modules/enterprise/server/plugins/alert-operations/src/main/java/org/rhq/enterprise/server/plugins/alertOperations/OperationsSender.java b/modules/enterprise/server/plugins/alert-operations/src/main/java/org/rhq/enterprise/server/plugins/alertOperations/OperationsSender.java index 83563e6..e50b143 100644 --- a/modules/enterprise/server/plugins/alert-operations/src/main/java/org/rhq/enterprise/server/plugins/alertOperations/OperationsSender.java +++ b/modules/enterprise/server/plugins/alert-operations/src/main/java/org/rhq/enterprise/server/plugins/alertOperations/OperationsSender.java @@ -19,7 +19,6 @@ package org.rhq.enterprise.server.plugins.alertOperations;
import org.rhq.core.domain.alert.Alert; -import org.rhq.core.domain.alert.notification.ResultState; import org.rhq.core.domain.alert.notification.SenderResult; import org.rhq.core.domain.auth.Subject; import org.rhq.core.domain.configuration.Configuration; @@ -47,7 +46,7 @@ public class OperationsSender extends AlertSender {
OperationInfo info = OperationInfo.load(alertParameters, extraParameters); if (info.error != null) { - return new SenderResult(ResultState.FAILURE, info.error); + return SenderResult.getSimpleFailure(info.error); }
Subject subject = LookupUtil.getSubjectManager().getOverlord(); // TODO get real subject for authz? @@ -61,7 +60,7 @@ public class OperationsSender extends AlertSender { } catch (Throwable t) { String message = getResultMessage(info, "could not calculate which resources to execute the operation on: " + t.getMessage()); - return new SenderResult(ResultState.FAILURE, message); + return SenderResult.getSimpleFailure(message); }
Configuration replacedParameters = null; @@ -79,7 +78,7 @@ public class OperationsSender extends AlertSender { } } catch (Exception e) { String message = getResultMessage(info, "parameterized argument replacement failed with " + e.getMessage()); - return new SenderResult(ResultState.FAILURE, message); + return SenderResult.getSimpleFailure(message); }
// Now fire off the operation with no delay and no repetition. @@ -89,13 +88,17 @@ public class OperationsSender extends AlertSender { targetResource.getId(), operation.getName(), 0, 0, 0, 0, replacedParameters, description); String message = getResultMessage(info, getHyperLinkForOperationSchedule(subject, targetResource.getId(), operation.getName(), schedule.getJobId())); - return new SenderResult(ResultState.SUCCESS, message); + return SenderResult.getSimpleDeffered(message); } catch (Throwable t) { String message = getResultMessage(info, "invocation failed with " + t.getMessage()); - return new SenderResult(ResultState.FAILURE, message); + return SenderResult.getSimpleFailure(message); } }
+ /* + * if we actually execute the operation at the time of alert sending, we can report the + * operation's failure/success accurately instead of just returning a "deferred" result + */ private String getHyperLinkForOperationSchedule(Subject subject, int resourceId, String operationName, JobId jobId) { /* OperationManagerLocal operationManager = LookupUtil.getOperationManager(); diff --git a/modules/enterprise/server/plugins/alert-roles/src/main/java/org/rhq/enterprise/server/plugins/alertRoles/RolesSender.java b/modules/enterprise/server/plugins/alert-roles/src/main/java/org/rhq/enterprise/server/plugins/alertRoles/RolesSender.java index 2846266..35b558e 100644 --- a/modules/enterprise/server/plugins/alert-roles/src/main/java/org/rhq/enterprise/server/plugins/alertRoles/RolesSender.java +++ b/modules/enterprise/server/plugins/alert-roles/src/main/java/org/rhq/enterprise/server/plugins/alertRoles/RolesSender.java @@ -19,10 +19,12 @@ package org.rhq.enterprise.server.plugins.alertRoles;
import java.util.ArrayList; +import java.util.Collection; +import java.util.HashSet; import java.util.List; +import java.util.Set;
import org.rhq.core.domain.alert.Alert; -import org.rhq.core.domain.alert.notification.ResultState; import org.rhq.core.domain.alert.notification.SenderResult; import org.rhq.core.domain.auth.Subject; import org.rhq.core.domain.authz.Role; @@ -45,12 +47,33 @@ public class RolesSender extends AlertSender { public SenderResult send(Alert alert) { List<Integer> roleIds = getRoleIdsFromConfiguration(); if (roleIds == null) { - return new SenderResult(ResultState.FAILURE, "No roles defined"); + return SenderResult.getSimpleFailure("No roles defined"); }
- List<String> emails = getRoleEmails(roleIds); List<String> names = getRoleNames(roleIds); - return new SenderResult(ResultState.DEFERRED_EMAIL, "Sending to roles: " + names, emails); + List<String> emails = getRoleEmails(roleIds); + + try { + Set<String> uniqueEmails = new HashSet<String>(emails); + Collection<String> badEmails = LookupUtil.getAlertManager() + .sendAlertNotificationEmails(alert, uniqueEmails); + + List<String> goodEmails = new ArrayList<String>(uniqueEmails); + goodEmails.removeAll(badEmails); + + SenderResult result = new SenderResult(); + result.setSummary("Target roles were: " + names); + if (goodEmails.size() > 0) { + result.addSuccessMessage("Successfully sent to: " + goodEmails); + } + if (badEmails.size() > 0) { + result.addFailureMessage("Failed to send to: " + badEmails); + } + return result; + } catch (Throwable t) { + return SenderResult.getSimpleFailure("Error sending role notifications to " + names + ", cause: " + + t.getMessage()); + } }
@Override diff --git a/modules/enterprise/server/plugins/alert-snmp/src/main/java/org/rhq/enterprise/server/plugins/alertSnmp/SnmpSender.java b/modules/enterprise/server/plugins/alert-snmp/src/main/java/org/rhq/enterprise/server/plugins/alertSnmp/SnmpSender.java index 1639e81..627e23d 100644 --- a/modules/enterprise/server/plugins/alert-snmp/src/main/java/org/rhq/enterprise/server/plugins/alertSnmp/SnmpSender.java +++ b/modules/enterprise/server/plugins/alert-snmp/src/main/java/org/rhq/enterprise/server/plugins/alertSnmp/SnmpSender.java @@ -25,7 +25,6 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory;
import org.rhq.core.domain.alert.Alert; -import org.rhq.core.domain.alert.notification.ResultState; import org.rhq.core.domain.alert.notification.SenderResult; import org.rhq.core.domain.resource.Resource; import org.rhq.enterprise.server.alert.AlertManagerLocal; @@ -46,34 +45,29 @@ public class SnmpSender extends AlertSender {
SnmpInfo info = SnmpInfo.load(alertParameters); if (info.error != null) { - return new SenderResult(ResultState.FAILURE, info.error); + return SenderResult.getSimpleFailure(info.error); } log.debug("Sending SNMP trap to: " + info);
- AlertManagerLocal alertManager = LookupUtil.getAlertManager(); - ResourceManagerLocal resourceManager = LookupUtil.getResourceManager(); + try { + AlertManagerLocal alertManager = LookupUtil.getAlertManager(); + ResourceManagerLocal resourceManager = LookupUtil.getResourceManager();
- SnmpTrapSender snmpTrapSender = new SnmpTrapSender(preferences); + SnmpTrapSender snmpTrapSender = new SnmpTrapSender(preferences);
- List<Resource> lineage = resourceManager.getResourceLineage(alert.getAlertDefinition().getResource().getId()); - String platformName = lineage.get(0).getName(); - String conditions = alertManager.prettyPrintAlertConditions(alert, false); - String alertUrl = alertManager.prettyPrintAlertURL(alert); + List<Resource> lineage = resourceManager.getResourceLineage(alert.getAlertDefinition().getResource() + .getId()); + String platformName = lineage.get(0).getName(); + String conditions = alertManager.prettyPrintAlertConditions(alert, false); + String alertUrl = alertManager.prettyPrintAlertURL(alert);
- String result; - SenderResult res; - try { Date bootTime = new Date(); // TODO: want to use LookupUtil.getCoreServer().getBootTime() but ServiceMBean is not visible - result = snmpTrapSender.sendSnmpTrap(alert, alertParameters, platformName, conditions, bootTime, alertUrl); - res = new SenderResult(ResultState.SUCCESS, result); + String result = snmpTrapSender.sendSnmpTrap(alert, alertParameters, platformName, conditions, bootTime, + alertUrl); + return SenderResult.getSimpleSuccess(result); } catch (Throwable t) { - result = "failed - cause: " + t; - res = new SenderResult(ResultState.FAILURE, result); + return SenderResult.getSimpleFailure("failed - cause: " + t); } - - log.debug("Result of sending SNMP trap: " + result); - - return res; }
@Override diff --git a/modules/enterprise/server/plugins/alert-subject/src/main/java/org/rhq/enterprise/server/plugins/alertSubject/SubjectsSender.java b/modules/enterprise/server/plugins/alert-subject/src/main/java/org/rhq/enterprise/server/plugins/alertSubject/SubjectsSender.java index 13f4f32..201e13f 100644 --- a/modules/enterprise/server/plugins/alert-subject/src/main/java/org/rhq/enterprise/server/plugins/alertSubject/SubjectsSender.java +++ b/modules/enterprise/server/plugins/alert-subject/src/main/java/org/rhq/enterprise/server/plugins/alertSubject/SubjectsSender.java @@ -19,10 +19,12 @@ package org.rhq.enterprise.server.plugins.alertSubject;
import java.util.ArrayList; +import java.util.Collection; +import java.util.HashSet; import java.util.List; +import java.util.Set;
import org.rhq.core.domain.alert.Alert; -import org.rhq.core.domain.alert.notification.ResultState; import org.rhq.core.domain.alert.notification.SenderResult; import org.rhq.core.domain.auth.Subject; import org.rhq.core.domain.configuration.PropertySimple; @@ -44,12 +46,33 @@ public class SubjectsSender extends AlertSender { public SenderResult send(Alert alert) { List<Integer> subjectIds = getSubjectIdsFromConfiguration(); if (subjectIds == null) { - return new SenderResult(ResultState.FAILURE, "No subjects defined"); + return SenderResult.getSimpleFailure("No subjects defined"); }
- List<String> emails = getSubjectEmails(subjectIds); List<String> names = getSubjectNames(subjectIds); - return new SenderResult(ResultState.DEFERRED_EMAIL, "Sending to subjects: " + names, emails); + List<String> emails = getSubjectEmails(subjectIds); + + try { + Set<String> uniqueEmails = new HashSet<String>(emails); + Collection<String> badEmails = LookupUtil.getAlertManager() + .sendAlertNotificationEmails(alert, uniqueEmails); + + List<String> goodEmails = new ArrayList<String>(uniqueEmails); + goodEmails.removeAll(badEmails); + + SenderResult result = new SenderResult(); + result.setSummary("Target subjects were: " + names); + if (goodEmails.size() > 0) { + result.addSuccessMessage("Successfully sent to: " + goodEmails); + } + if (badEmails.size() > 0) { + result.addFailureMessage("Failed to send to: " + badEmails); + } + return result; + } catch (Throwable t) { + return SenderResult.getSimpleFailure("Error sending subject notifications to " + names + ", cause: " + + t.getMessage()); + } }
@Override
commit 589acd80903f723af322f9ec68ea16c23efee224 Author: Jay Shaughnessy jshaughn@redhat.com Date: Tue Jun 29 23:05:09 2010 -0400
fix conditional *again*
diff --git a/release.sh b/release.sh index b800233..ccf6f72 100755 --- a/release.sh +++ b/release.sh @@ -336,7 +336,7 @@ else BUILD_BRANCH="${RELEASE_BRANCH}-test-build" # delete the branch if it exists, so we can recreate it fresh EXISTING_BUILD_BRANCH=`git ls-remote --heads origin "$BUILD_BRANCH"` - if [ -n "$EXISTING_REMOTE_TAG" ]; then + if [ -n "$EXISTING_BUILD_BRANCH" ]; then echo "Deleting remote branch origin/$BUILD_BRANCH" git branch -D -r "origin/$BUILD_BRANCH" echo "Deleting local branch $BUILD_BRANCH"
commit 050ec9212aa8f3df421a5c9f7983252853b0d8bf Author: Jay Shaughnessy jshaughn@redhat.com Date: Tue Jun 29 22:56:07 2010 -0400
fix a script conditional
diff --git a/release.sh b/release.sh index 5ce7396..b800233 100755 --- a/release.sh +++ b/release.sh @@ -336,7 +336,7 @@ else BUILD_BRANCH="${RELEASE_BRANCH}-test-build" # delete the branch if it exists, so we can recreate it fresh EXISTING_BUILD_BRANCH=`git ls-remote --heads origin "$BUILD_BRANCH"` - if [ "$EXISTING_REMOTE_TAG" ]; then + if [ -n "$EXISTING_REMOTE_TAG" ]; then echo "Deleting remote branch origin/$BUILD_BRANCH" git branch -D -r "origin/$BUILD_BRANCH" echo "Deleting local branch $BUILD_BRANCH"
commit 92ce59765e28e91b02aa7a6583ae402615a39693 Author: Jay Shaughnessy jshaughn@redhat.com Date: Tue Jun 29 22:37:01 2010 -0400
Revise tag deletion logic
diff --git a/release.sh b/release.sh index c4b9e46..5ce7396 100755 --- a/release.sh +++ b/release.sh @@ -327,15 +327,6 @@ if [ ! -d "$WORKING_DIR" ]; then fi
-# If the specified tag already exists then abort. It should not exist since production runs should have -# unique tags and test runs should have been done in a temporary branch - -EXISTING_REMOTE_TAG=`git ls-remote --tags origin "$RELEASE_TAG"` -if [ -n "$EXISTING_REMOTE_TAG" ]; then - abort "A remote tag named $RELEASE_TAG already exists - aborting, perhaps a bad build configuration..." -fi - - # if this is a test build then create a temporary build branch off of RELEASE_BRANCH. This allows checkins to # continue in RELEASE_BRANCH without affecting the release plugin work, which will fail if the branch contents # change before it completes. @@ -360,7 +351,28 @@ fi
# We should now have the build_branch checked out echo "Current Branch is $BUILD_BRANCH" - + +# If the specified tag already exists remotely and we're in production mode, then abort. If it exists and +# we're in test mode, delete it + +EXISTING_REMOTE_TAG=`git ls-remote --tags origin "$RELEASE_TAG"` +if [ -n "$EXISTING_REMOTE_TAG" ] && [ "$MODE" = "production" ]; then + abort "A remote tag named $RELEASE_TAG already exists - aborting, since we are in production mode..." +fi + +if [ -n "$EXISTING_REMOTE_TAG" ] && [ "$MODE" = "test" ]; then + echo "A remote tag named $RELEASE_TAG already exists - deleting it, since we are in test mode..." + git push origin ":refs/tags/$RELEASE_TAG" + [ "$?" -ne 0 ] && abort "Failed to delete remote tag ($RELEASE_TAG)." +fi + +# See if the specified tag already exists locally - if so, delete it (even if in production mode). +EXISTING_LOCAL_TAG=`git tag -l "$RELEASE_TAG"` +if [ -n "$EXISTING_LOCAL_TAG" ]; then + echo "A local tag named $RELEASE_TAG already exists - deleting it..." + git tag -d "$RELEASE_TAG" + [ "$?" -ne 0 ] && abort "Failed to delete local tag ($RELEASE_TAG)." +fi
# Run a test build before tagging. This will publish the snapshot artifacts to the local repo to "bootstrap" the repo.
commit 9122675265f8107fa4ff616a6e8ea522297cd1bc Author: Jay Shaughnessy jshaughn@redhat.com Date: Tue Jun 29 22:39:44 2010 -0400
LT commit
diff --git a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ManagedComponentComponent.java b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ManagedComponentComponent.java index 74130b4..fb292ee 100644 --- a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ManagedComponentComponent.java +++ b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ManagedComponentComponent.java @@ -1,420 +1,420 @@ -/* -* Jopr Management Platform -* Copyright (C) 2005-2009 Red Hat, Inc. -* All rights reserved. -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License, version 2, as -* published by the Free Software Foundation, and/or the GNU Lesser -* General Public License, version 2.1, also as published by the Free -* Software Foundation. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License and the GNU Lesser General Public License -* for more details. -* -* You should have received a copy of the GNU General Public License -* and the GNU Lesser General Public License along with this program; -* if not, write to the Free Software Foundation, Inc., -* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ -package org.rhq.plugins.jbossas5; - -import java.lang.reflect.Array; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -import org.jboss.deployers.spi.management.ManagementView; -import org.jboss.deployers.spi.management.deploy.DeploymentManager; -import org.jboss.deployers.spi.management.deploy.DeploymentProgress; -import org.jboss.deployers.spi.management.deploy.DeploymentStatus; -import org.jboss.managed.api.ComponentType; -import org.jboss.managed.api.ManagedComponent; -import org.jboss.managed.api.ManagedDeployment; -import org.jboss.managed.api.ManagedOperation; -import org.jboss.managed.api.ManagedProperty; -import org.jboss.managed.api.RunState; -import org.jboss.metatype.api.values.ArrayValue; -import org.jboss.metatype.api.values.CollectionValue; -import org.jboss.metatype.api.values.CompositeValue; -import org.jboss.metatype.api.values.EnumValue; -import org.jboss.metatype.api.values.MetaValue; -import org.jboss.metatype.api.values.SimpleValue; - -import org.rhq.core.domain.configuration.Configuration; -import org.rhq.core.domain.configuration.ConfigurationUpdateStatus; -import org.rhq.core.domain.configuration.PropertySimple; -import org.rhq.core.domain.configuration.definition.ConfigurationDefinition; -import org.rhq.core.domain.measurement.AvailabilityType; -import org.rhq.core.domain.measurement.DataType; -import org.rhq.core.domain.measurement.MeasurementDataNumeric; -import org.rhq.core.domain.measurement.MeasurementDataTrait; -import org.rhq.core.domain.measurement.MeasurementReport; -import org.rhq.core.domain.measurement.MeasurementScheduleRequest; -import org.rhq.core.domain.operation.OperationDefinition; -import org.rhq.core.domain.resource.ResourceType; -import org.rhq.core.pluginapi.configuration.ConfigurationFacet; -import org.rhq.core.pluginapi.configuration.ConfigurationUpdateReport; -import org.rhq.core.pluginapi.inventory.DeleteResourceFacet; -import org.rhq.core.pluginapi.inventory.ResourceContext; -import org.rhq.core.pluginapi.measurement.MeasurementFacet; -import org.rhq.core.pluginapi.operation.OperationFacet; -import org.rhq.core.pluginapi.operation.OperationResult; -import org.rhq.core.util.exception.ThrowableUtil; -import org.rhq.plugins.jbossas5.util.ConversionUtils; -import org.rhq.plugins.jbossas5.util.DebugUtils; -import org.rhq.plugins.jbossas5.util.DeploymentUtils; -import org.rhq.plugins.jbossas5.util.ManagedComponentUtils; -import org.rhq.plugins.jbossas5.util.ResourceComponentUtils; -import org.rhq.plugins.jbossas5.util.ResourceTypeUtils; - -/** - * Service ResourceComponent for all {@link ManagedComponent}s in a Profile. - * - * @author Ian Springer - * @author Jason Dobies - * @author Mark Spritzler - */ -public class ManagedComponentComponent extends AbstractManagedComponent implements ConfigurationFacet, - DeleteResourceFacet, OperationFacet, MeasurementFacet { - public static interface Config { - String COMPONENT_TYPE = "componentType"; - String COMPONENT_SUBTYPE = "componentSubtype"; - String COMPONENT_NAME = "componentName"; - String TEMPLATE_NAME = "templateName"; - String COMPONENT_NAME_PROPERTY = "componentNameProperty"; - } - - protected static final char PREFIX_DELIMITER = '|'; - - private final Log log = LogFactory.getLog(this.getClass()); - - private String componentName; - private ComponentType componentType; - - // ResourceComponent Implementation -------------------------------------------- - - public AvailabilityType getAvailability() { - RunState runState = null; - try { - runState = getManagedComponent().getRunState(); - } catch (Throwable t) { - log.debug("Could not get component state, cause: ", t); - return AvailabilityType.DOWN; - } - - if (runState == RunState.RUNNING) { - return AvailabilityType.UP; - } else { - log.debug("Component was not running, state was: " + runState); - return AvailabilityType.DOWN; - } - } - - public void start(ResourceContext<ProfileServiceComponent> resourceContext) throws Exception { - super.start(resourceContext); - this.componentType = ConversionUtils.getComponentType(getResourceContext().getResourceType()); - Configuration pluginConfig = resourceContext.getPluginConfiguration(); - this.componentName = pluginConfig.getSimple(Config.COMPONENT_NAME).getStringValue(); - log.trace("Started ResourceComponent for " + getResourceDescription() + ", managing " + this.componentType - + " component '" + this.componentName + "'."); - } - - public void stop() { - return; - } - - // ConfigurationComponent Implementation -------------------------------------------- - - public Configuration loadResourceConfiguration() { - Configuration resourceConfig; - try { - Map<String, ManagedProperty> managedProperties = getManagedComponent().getProperties(); - Map<String, PropertySimple> customProps = ResourceComponentUtils.getCustomProperties(getResourceContext() - .getPluginConfiguration()); - if (this.log.isDebugEnabled()) - this.log.debug("*** AFTER LOAD:\n" + DebugUtils.convertPropertiesToString(managedProperties)); - resourceConfig = ConversionUtils.convertManagedObjectToConfiguration(managedProperties, customProps, - getResourceContext().getResourceType()); - } catch (Exception e) { - RunState runState = getManagedComponent().getRunState(); - if (runState == RunState.RUNNING) { - this.log.error("Failed to load configuration for " + getResourceDescription() + ".", e); - } else { - this.log.debug("Failed to load configuration for " + getResourceDescription() - + ", but managed component is not in the RUNNING state.", e); - } - throw new RuntimeException(ThrowableUtil.getAllMessages(e)); - } - return resourceConfig; - } - - public void updateResourceConfiguration(ConfigurationUpdateReport configurationUpdateReport) { - Configuration resourceConfig = configurationUpdateReport.getConfiguration(); - Configuration pluginConfig = getResourceContext().getPluginConfiguration(); - try { - ManagedComponent managedComponent = getManagedComponent(); - Map<String, ManagedProperty> managedProperties = managedComponent.getProperties(); - Map<String, PropertySimple> customProps = ResourceComponentUtils.getCustomProperties(pluginConfig); - if (this.log.isDebugEnabled()) - this.log.debug("*** BEFORE UPDATE:\n" + DebugUtils.convertPropertiesToString(managedProperties)); - ConversionUtils.convertConfigurationToManagedProperties(managedProperties, resourceConfig, - getResourceContext().getResourceType(), customProps); - if (this.log.isDebugEnabled()) - this.log.debug("*** AFTER UPDATE:\n" + DebugUtils.convertPropertiesToString(managedProperties)); - updateComponent(managedComponent); - configurationUpdateReport.setStatus(ConfigurationUpdateStatus.SUCCESS); - } catch (Exception e) { - this.log.error("Failed to update configuration for " + getResourceDescription() + ".", e); - configurationUpdateReport.setStatus(ConfigurationUpdateStatus.FAILURE); - configurationUpdateReport.setErrorMessage(ThrowableUtil.getAllMessages(e)); - } - } - - // DeleteResourceFacet Implementation -------------------------------------------- - - public void deleteResource() throws Exception { - DeploymentManager deploymentManager = getConnection().getDeploymentManager(); - if (!deploymentManager.isRedeploySupported()) - throw new UnsupportedOperationException("Deletion of " + getResourceContext().getResourceType().getName() - + " Resources is not currently supported."); - ManagedComponent managedComponent = getManagedComponent(); - log.debug("Removing " + getResourceDescription() + " with component " + toString(managedComponent) + "..."); - ManagementView managementView = getConnection().getManagementView(); - managementView.removeComponent(managedComponent); - ManagedDeployment parentDeployment = managedComponent.getDeployment(); - log.debug("Redeploying parent deployment '" + parentDeployment.getName() - + "' in order to complete removal of component " + toString(managedComponent) + "..."); - DeploymentProgress progress = deploymentManager.redeploy(parentDeployment.getName()); - DeploymentStatus redeployStatus = DeploymentUtils.run(progress); - if (redeployStatus.isFailed()) { - log.error("Failed to redeploy parent deployment '" + parentDeployment.getName() - + "during removal of component " + toString(managedComponent) - + " - removal may not persist when the app server is restarted.", redeployStatus.getFailure()); - } - managementView.load(); - } - - // OperationFacet Implementation -------------------------------------------- - - public OperationResult invokeOperation(String name, Configuration parameters) throws Exception { - OperationDefinition operationDefinition = getOperationDefinition(name); - ManagedOperation managedOperation = getManagedOperation(operationDefinition); - // Convert parameters into MetaValue array. - MetaValue[] parameterMetaValues = ConversionUtils.convertOperationsParametersToMetaValues(managedOperation, - parameters, operationDefinition); - // invoke() takes a varargs, so we need to pass an empty array, rather than null. - MetaValue resultMetaValue = managedOperation.invoke(parameterMetaValues); - OperationResult result = new OperationResult(); - // Convert result MetaValue to corresponding Property type. - ConversionUtils.convertManagedOperationResults(managedOperation, resultMetaValue, result.getComplexResults(), - operationDefinition); - return result; - } - - // MeasurementFacet Implementation -------------------------------------------- - - public void getValues(MeasurementReport report, Set<MeasurementScheduleRequest> metrics) throws Exception { - ManagedComponent managedComponent = getManagedComponent(); - RunState runState = managedComponent.getRunState(); - for (MeasurementScheduleRequest request : metrics) { - try { - if (request.getName().equals("runState")) { - report.addData(new MeasurementDataTrait(request, runState.name())); - } else { - Object value = getSimpleValue(managedComponent, request); - addValueToMeasurementReport(report, request, value); - } - } catch (Exception e) { - if (runState == RunState.RUNNING) { - log.error("Failed to collect metric for " + request, e); - } else { - log.debug("Failed to collect metric for " + request - + ", but managed component is not in the RUNNING state.", e); - } - } - } - } - - protected void updateComponent(ManagedComponent managedComponent) throws Exception { - log.trace("Updating " + getResourceDescription() + " with component " + toString(managedComponent) + "..."); - ManagementView managementView = getConnection().getManagementView(); - managementView.updateComponent(managedComponent); - managementView.load(); - } - - // ------------------------------------------------------------------------------ - - /** - * The name of the measurement schedule request (i.e. the metric name) can be in one of two forms: - * <p/> - * [prefix'|']simplePropertyName (e.g. "maxTime" or "ThreadPool|currentThreadCount") - * [prefix'|']compositePropertyName'.'key (e.g. "consumerCount" or "messageStatistics.count") - * - * @param managedComponent a managed component - * @param request a measurement schedule request - * @return the metric value - */ - @Nullable - protected Object getSimpleValue(ManagedComponent managedComponent, MeasurementScheduleRequest request) { - String metricName = request.getName(); - int pipeIndex = metricName.indexOf(PREFIX_DELIMITER); - // Remove the prefix if there is one (e.g. "ThreadPool|currentThreadCount" -> "currentThreadCount"). - String compositePropName = (pipeIndex == -1) ? metricName : metricName.substring(pipeIndex + 1); - int dotIndex = compositePropName.indexOf('.'); - String metricPropName = (dotIndex == -1) ? compositePropName : compositePropName.substring(0, dotIndex); - ManagedProperty metricProp = managedComponent.getProperty(metricPropName); - if (metricProp == null) { - return null; - } - MetaValue metaValue; - if (dotIndex == -1) { - metaValue = metricProp.getValue(); - } else { - CompositeValue compositeValue = (CompositeValue) metricProp.getValue(); - String key = compositePropName.substring(dotIndex + 1); - metaValue = compositeValue.get(key); - } - return getInnerValue(metaValue); - } - - // TODO: Move this to a utility class. - @Nullable - private static Object getInnerValue(MetaValue metaValue) { - if (metaValue == null) { - return null; - } - Object value; - if (metaValue.getMetaType().isSimple()) { - SimpleValue simpleValue = (SimpleValue) metaValue; - value = simpleValue.getValue(); - } else if (metaValue.getMetaType().isEnum()) { - EnumValue enumValue = (EnumValue) metaValue; - value = enumValue.getValue(); - } else if (metaValue.getMetaType().isArray()) { - ArrayValue arrayValue = (ArrayValue) metaValue; - value = arrayValue.getValue(); - } else if (metaValue.getMetaType().isCollection()) { - CollectionValue collectionValue = (CollectionValue) metaValue; - List list = new ArrayList(); - for (MetaValue element : collectionValue.getElements()) { - list.add(getInnerValue(element)); - } - value = list; - } else { - value = metaValue.toString(); - } - return value; - } - - protected void addValueToMeasurementReport(MeasurementReport report, MeasurementScheduleRequest request, - Object value) { - if (value == null) { - return; - } - String stringValue = toString(value); - - DataType dataType = request.getDataType(); - switch (dataType) { - case MEASUREMENT: - try { - MeasurementDataNumeric dataNumeric = new MeasurementDataNumeric(request, Double.valueOf(stringValue)); - report.addData(dataNumeric); - } catch (NumberFormatException e) { - log.error("Profile service did not return a numeric value as expected for metric [" + request.getName() - + "] - value returned was " + value + ".", e); - } - break; - case TRAIT: - MeasurementDataTrait dataTrait = new MeasurementDataTrait(request, stringValue); - report.addData(dataTrait); - break; - default: - throw new IllegalStateException("Unsupported measurement data type: " + dataType); - } - } - - protected ComponentType getComponentType() { - return componentType; - } - - protected String getComponentName() { - return componentName; - } - - protected ManagedComponent getManagedComponent() { - ManagedComponent managedComponent; - try { - ManagementView managementView = getConnection().getManagementView(); - managedComponent = ManagedComponentUtils.getManagedComponent(managementView, this.componentType, - this.componentName); - } catch (Exception e) { - throw new RuntimeException("Failed to load [" + this.componentType + "] ManagedComponent [" - + this.componentName + "].", e); - } - if (managedComponent == null) - throw new IllegalStateException("Failed to find [" + this.componentType + "] ManagedComponent named [" - + this.componentName + "]."); - log.trace("Retrieved " + toString(managedComponent) + "."); - return managedComponent; - } - - @NotNull - private OperationDefinition getOperationDefinition(String operationName) { - ResourceType resourceType = getResourceContext().getResourceType(); - OperationDefinition operationDefinition = ResourceTypeUtils.getOperationDefinition(resourceType, operationName); - if (operationDefinition == null) - throw new IllegalStateException("Operation named '" + operationName - + "' is not defined for Resource type '" + resourceType.getName() + "' in the '" - + resourceType.getPlugin() + "' plugin's descriptor."); - return operationDefinition; - } - - @NotNull - private ManagedOperation getManagedOperation(OperationDefinition operationDefinition) { - ManagedComponent managedComponent = getManagedComponent(); - Set<ManagedOperation> operations = managedComponent.getOperations(); - for (ManagedOperation operation : operations) { - ConfigurationDefinition paramsConfigDef = operationDefinition.getParametersConfigurationDefinition(); - int paramCount = (paramsConfigDef != null) ? paramsConfigDef.getPropertyDefinitions().size() : 0; - if (operation.getName().equals(operationDefinition.getName()) - && (operation.getParameters().length == paramCount)) - return operation; - } - throw new IllegalStateException("ManagedOperation named '" + operationDefinition.getName() - + "' not found on ManagedComponent [" + getManagedComponent() + "]."); - } - - private static String toString(ManagedComponent managedComponent) { - Map<String, ManagedProperty> properties = managedComponent.getProperties(); - return managedComponent.getClass().getSimpleName() + "@" + System.identityHashCode(managedComponent) + "[" - + "type=" + managedComponent.getType() + ", name=" + managedComponent.getName() + ", properties=" - + properties.getClass().getSimpleName() + "@" + System.identityHashCode(properties) + "]"; - } - - private static String toString(@NotNull Object value) { - if (value.getClass().isArray()) { - StringBuilder buffer = new StringBuilder(); - int lastIndex = Array.getLength(value) - 1; - for (int i = 0; i < Array.getLength(value); i++) { - buffer.append(String.valueOf(Array.get(value, i))); - if (i == lastIndex) { - break; - } - buffer.append(", "); - } - return buffer.toString(); - } else { - return value.toString(); - } - } -} +/* +* Jopr Management Platform +* Copyright (C) 2005-2009 Red Hat, Inc. +* All rights reserved. +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License, version 2, as +* published by the Free Software Foundation, and/or the GNU Lesser +* General Public License, version 2.1, also as published by the Free +* Software Foundation. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License and the GNU Lesser General Public License +* for more details. +* +* You should have received a copy of the GNU General Public License +* and the GNU Lesser General Public License along with this program; +* if not, write to the Free Software Foundation, Inc., +* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +*/ +package org.rhq.plugins.jbossas5; + +import java.lang.reflect.Array; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import org.jboss.deployers.spi.management.ManagementView; +import org.jboss.deployers.spi.management.deploy.DeploymentManager; +import org.jboss.deployers.spi.management.deploy.DeploymentProgress; +import org.jboss.deployers.spi.management.deploy.DeploymentStatus; +import org.jboss.managed.api.ComponentType; +import org.jboss.managed.api.ManagedComponent; +import org.jboss.managed.api.ManagedDeployment; +import org.jboss.managed.api.ManagedOperation; +import org.jboss.managed.api.ManagedProperty; +import org.jboss.managed.api.RunState; +import org.jboss.metatype.api.values.ArrayValue; +import org.jboss.metatype.api.values.CollectionValue; +import org.jboss.metatype.api.values.CompositeValue; +import org.jboss.metatype.api.values.EnumValue; +import org.jboss.metatype.api.values.MetaValue; +import org.jboss.metatype.api.values.SimpleValue; + +import org.rhq.core.domain.configuration.Configuration; +import org.rhq.core.domain.configuration.ConfigurationUpdateStatus; +import org.rhq.core.domain.configuration.PropertySimple; +import org.rhq.core.domain.configuration.definition.ConfigurationDefinition; +import org.rhq.core.domain.measurement.AvailabilityType; +import org.rhq.core.domain.measurement.DataType; +import org.rhq.core.domain.measurement.MeasurementDataNumeric; +import org.rhq.core.domain.measurement.MeasurementDataTrait; +import org.rhq.core.domain.measurement.MeasurementReport; +import org.rhq.core.domain.measurement.MeasurementScheduleRequest; +import org.rhq.core.domain.operation.OperationDefinition; +import org.rhq.core.domain.resource.ResourceType; +import org.rhq.core.pluginapi.configuration.ConfigurationFacet; +import org.rhq.core.pluginapi.configuration.ConfigurationUpdateReport; +import org.rhq.core.pluginapi.inventory.DeleteResourceFacet; +import org.rhq.core.pluginapi.inventory.ResourceContext; +import org.rhq.core.pluginapi.measurement.MeasurementFacet; +import org.rhq.core.pluginapi.operation.OperationFacet; +import org.rhq.core.pluginapi.operation.OperationResult; +import org.rhq.core.util.exception.ThrowableUtil; +import org.rhq.plugins.jbossas5.util.ConversionUtils; +import org.rhq.plugins.jbossas5.util.DebugUtils; +import org.rhq.plugins.jbossas5.util.DeploymentUtils; +import org.rhq.plugins.jbossas5.util.ManagedComponentUtils; +import org.rhq.plugins.jbossas5.util.ResourceComponentUtils; +import org.rhq.plugins.jbossas5.util.ResourceTypeUtils; + +/** + * Service ResourceComponent for all {@link ManagedComponent}s in a Profile. + * + * @author Ian Springer + * @author Jason Dobies + * @author Mark Spritzler + */ +public class ManagedComponentComponent extends AbstractManagedComponent implements ConfigurationFacet, + DeleteResourceFacet, OperationFacet, MeasurementFacet { + public static interface Config { + String COMPONENT_TYPE = "componentType"; + String COMPONENT_SUBTYPE = "componentSubtype"; + String COMPONENT_NAME = "componentName"; + String TEMPLATE_NAME = "templateName"; + String COMPONENT_NAME_PROPERTY = "componentNameProperty"; + } + + protected static final char PREFIX_DELIMITER = '|'; + + private final Log log = LogFactory.getLog(this.getClass()); + + private String componentName; + private ComponentType componentType; + + // ResourceComponent Implementation -------------------------------------------- + + public AvailabilityType getAvailability() { + RunState runState = null; + try { + runState = getManagedComponent().getRunState(); + } catch (Throwable t) { + log.debug("Could not get component state, cause: ", t); + return AvailabilityType.DOWN; + } + + if (runState == RunState.RUNNING) { + return AvailabilityType.UP; + } else { + log.debug("Component was not running, state was: " + runState); + return AvailabilityType.DOWN; + } + } + + public void start(ResourceContext<ProfileServiceComponent> resourceContext) throws Exception { + super.start(resourceContext); + this.componentType = ConversionUtils.getComponentType(getResourceContext().getResourceType()); + Configuration pluginConfig = resourceContext.getPluginConfiguration(); + this.componentName = pluginConfig.getSimple(Config.COMPONENT_NAME).getStringValue(); + log.trace("Started ResourceComponent for " + getResourceDescription() + ", managing " + this.componentType + + " component '" + this.componentName + "'."); + } + + public void stop() { + return; + } + + // ConfigurationComponent Implementation -------------------------------------------- + + public Configuration loadResourceConfiguration() { + Configuration resourceConfig; + try { + Map<String, ManagedProperty> managedProperties = getManagedComponent().getProperties(); + Map<String, PropertySimple> customProps = ResourceComponentUtils.getCustomProperties(getResourceContext() + .getPluginConfiguration()); + if (this.log.isDebugEnabled()) + this.log.debug("*** AFTER LOAD:\n" + DebugUtils.convertPropertiesToString(managedProperties)); + resourceConfig = ConversionUtils.convertManagedObjectToConfiguration(managedProperties, customProps, + getResourceContext().getResourceType()); + } catch (Exception e) { + RunState runState = getManagedComponent().getRunState(); + if (runState == RunState.RUNNING) { + this.log.error("Failed to load configuration for " + getResourceDescription() + ".", e); + } else { + this.log.debug("Failed to load configuration for " + getResourceDescription() + + ", but managed component is not in the RUNNING state.", e); + } + throw new RuntimeException(ThrowableUtil.getAllMessages(e)); + } + return resourceConfig; + } + + public void updateResourceConfiguration(ConfigurationUpdateReport configurationUpdateReport) { + Configuration resourceConfig = configurationUpdateReport.getConfiguration(); + Configuration pluginConfig = getResourceContext().getPluginConfiguration(); + try { + ManagedComponent managedComponent = getManagedComponent(); + Map<String, ManagedProperty> managedProperties = managedComponent.getProperties(); + Map<String, PropertySimple> customProps = ResourceComponentUtils.getCustomProperties(pluginConfig); + if (this.log.isDebugEnabled()) + this.log.debug("*** BEFORE UPDATE:\n" + DebugUtils.convertPropertiesToString(managedProperties)); + ConversionUtils.convertConfigurationToManagedProperties(managedProperties, resourceConfig, + getResourceContext().getResourceType(), customProps); + if (this.log.isDebugEnabled()) + this.log.debug("*** AFTER UPDATE:\n" + DebugUtils.convertPropertiesToString(managedProperties)); + updateComponent(managedComponent); + configurationUpdateReport.setStatus(ConfigurationUpdateStatus.SUCCESS); + } catch (Exception e) { + this.log.error("Failed to update configuration for " + getResourceDescription() + ".", e); + configurationUpdateReport.setStatus(ConfigurationUpdateStatus.FAILURE); + configurationUpdateReport.setErrorMessage(ThrowableUtil.getAllMessages(e)); + } + } + + // DeleteResourceFacet Implementation -------------------------------------------- + + public void deleteResource() throws Exception { + DeploymentManager deploymentManager = getConnection().getDeploymentManager(); + if (!deploymentManager.isRedeploySupported()) + throw new UnsupportedOperationException("Deletion of " + getResourceContext().getResourceType().getName() + + " Resources is not currently supported."); + ManagedComponent managedComponent = getManagedComponent(); + log.debug("Removing " + getResourceDescription() + " with component " + toString(managedComponent) + "..."); + ManagementView managementView = getConnection().getManagementView(); + managementView.removeComponent(managedComponent); + ManagedDeployment parentDeployment = managedComponent.getDeployment(); + log.debug("Redeploying parent deployment '" + parentDeployment.getName() + + "' in order to complete removal of component " + toString(managedComponent) + "..."); + DeploymentProgress progress = deploymentManager.redeploy(parentDeployment.getName()); + DeploymentStatus redeployStatus = DeploymentUtils.run(progress); + if (redeployStatus.isFailed()) { + log.error("Failed to redeploy parent deployment '" + parentDeployment.getName() + + "during removal of component " + toString(managedComponent) + + " - removal may not persist when the app server is restarted.", redeployStatus.getFailure()); + } + managementView.load(); + } + + // OperationFacet Implementation -------------------------------------------- + + public OperationResult invokeOperation(String name, Configuration parameters) throws Exception { + OperationDefinition operationDefinition = getOperationDefinition(name); + ManagedOperation managedOperation = getManagedOperation(operationDefinition); + // Convert parameters into MetaValue array. + MetaValue[] parameterMetaValues = ConversionUtils.convertOperationsParametersToMetaValues(managedOperation, + parameters, operationDefinition); + // invoke() takes a varargs, so we need to pass an empty array, rather than null. + MetaValue resultMetaValue = managedOperation.invoke(parameterMetaValues); + OperationResult result = new OperationResult(); + // Convert result MetaValue to corresponding Property type. + ConversionUtils.convertManagedOperationResults(managedOperation, resultMetaValue, result.getComplexResults(), + operationDefinition); + return result; + } + + // MeasurementFacet Implementation -------------------------------------------- + + public void getValues(MeasurementReport report, Set<MeasurementScheduleRequest> metrics) throws Exception { + ManagedComponent managedComponent = getManagedComponent(); + RunState runState = managedComponent.getRunState(); + for (MeasurementScheduleRequest request : metrics) { + try { + if (request.getName().equals("runState")) { + report.addData(new MeasurementDataTrait(request, runState.name())); + } else { + Object value = getSimpleValue(managedComponent, request); + addValueToMeasurementReport(report, request, value); + } + } catch (Exception e) { + if (runState == RunState.RUNNING) { + log.error("Failed to collect metric for " + request, e); + } else { + log.debug("Failed to collect metric for " + request + + ", but managed component is not in the RUNNING state.", e); + } + } + } + } + + protected void updateComponent(ManagedComponent managedComponent) throws Exception { + log.trace("Updating " + getResourceDescription() + " with component " + toString(managedComponent) + "..."); + ManagementView managementView = getConnection().getManagementView(); + managementView.updateComponent(managedComponent); + managementView.load(); + } + + // ------------------------------------------------------------------------------ + + /** + * The name of the measurement schedule request (i.e. the metric name) can be in one of two forms: + * <p/> + * [prefix'|']simplePropertyName (e.g. "maxTime" or "ThreadPool|currentThreadCount") + * [prefix'|']compositePropertyName'.'key (e.g. "consumerCount" or "messageStatistics.count") + * + * @param managedComponent a managed component + * @param request a measurement schedule request + * @return the metric value + */ + @Nullable + protected Object getSimpleValue(ManagedComponent managedComponent, MeasurementScheduleRequest request) { + String metricName = request.getName(); + int pipeIndex = metricName.indexOf(PREFIX_DELIMITER); + // Remove the prefix if there is one (e.g. "ThreadPool|currentThreadCount" -> "currentThreadCount"). + String compositePropName = (pipeIndex == -1) ? metricName : metricName.substring(pipeIndex + 1); + int dotIndex = compositePropName.indexOf('.'); + String metricPropName = (dotIndex == -1) ? compositePropName : compositePropName.substring(0, dotIndex); + ManagedProperty metricProp = managedComponent.getProperty(metricPropName); + if (metricProp == null) { + return null; + } + MetaValue metaValue; + if (dotIndex == -1) { + metaValue = metricProp.getValue(); + } else { + CompositeValue compositeValue = (CompositeValue) metricProp.getValue(); + String key = compositePropName.substring(dotIndex + 1); + metaValue = compositeValue.get(key); + } + return getInnerValue(metaValue); + } + + // TODO: Move this to a utility class. + @Nullable + private static Object getInnerValue(MetaValue metaValue) { + if (metaValue == null) { + return null; + } + Object value; + if (metaValue.getMetaType().isSimple()) { + SimpleValue simpleValue = (SimpleValue) metaValue; + value = simpleValue.getValue(); + } else if (metaValue.getMetaType().isEnum()) { + EnumValue enumValue = (EnumValue) metaValue; + value = enumValue.getValue(); + } else if (metaValue.getMetaType().isArray()) { + ArrayValue arrayValue = (ArrayValue) metaValue; + value = arrayValue.getValue(); + } else if (metaValue.getMetaType().isCollection()) { + CollectionValue collectionValue = (CollectionValue) metaValue; + List list = new ArrayList(); + for (MetaValue element : collectionValue.getElements()) { + list.add(getInnerValue(element)); + } + value = list; + } else { + value = metaValue.toString(); + } + return value; + } + + protected void addValueToMeasurementReport(MeasurementReport report, MeasurementScheduleRequest request, + Object value) { + if (value == null) { + return; + } + String stringValue = toString(value); + + DataType dataType = request.getDataType(); + switch (dataType) { + case MEASUREMENT: + try { + MeasurementDataNumeric dataNumeric = new MeasurementDataNumeric(request, Double.valueOf(stringValue)); + report.addData(dataNumeric); + } catch (NumberFormatException e) { + log.error("Profile service did not return a numeric value as expected for metric [" + request.getName() + + "] - value returned was " + value + ".", e); + } + break; + case TRAIT: + MeasurementDataTrait dataTrait = new MeasurementDataTrait(request, stringValue); + report.addData(dataTrait); + break; + default: + throw new IllegalStateException("Unsupported measurement data type: " + dataType); + } + } + + protected ComponentType getComponentType() { + return componentType; + } + + protected String getComponentName() { + return componentName; + } + + protected ManagedComponent getManagedComponent() { + ManagedComponent managedComponent; + try { + ManagementView managementView = getConnection().getManagementView(); + managedComponent = ManagedComponentUtils.getManagedComponent(managementView, this.componentType, + this.componentName); + } catch (Exception e) { + throw new RuntimeException("Failed to load [" + this.componentType + "] ManagedComponent [" + + this.componentName + "].", e); + } + if (managedComponent == null) + throw new IllegalStateException("Failed to find [" + this.componentType + "] ManagedComponent named [" + + this.componentName + "]."); + log.trace("Retrieved " + toString(managedComponent) + "."); + return managedComponent; + } + + @NotNull + private OperationDefinition getOperationDefinition(String operationName) { + ResourceType resourceType = getResourceContext().getResourceType(); + OperationDefinition operationDefinition = ResourceTypeUtils.getOperationDefinition(resourceType, operationName); + if (operationDefinition == null) + throw new IllegalStateException("Operation named '" + operationName + + "' is not defined for Resource type '" + resourceType.getName() + "' in the '" + + resourceType.getPlugin() + "' plugin's descriptor."); + return operationDefinition; + } + + @NotNull + private ManagedOperation getManagedOperation(OperationDefinition operationDefinition) { + ManagedComponent managedComponent = getManagedComponent(); + Set<ManagedOperation> operations = managedComponent.getOperations(); + for (ManagedOperation operation : operations) { + ConfigurationDefinition paramsConfigDef = operationDefinition.getParametersConfigurationDefinition(); + int paramCount = (paramsConfigDef != null) ? paramsConfigDef.getPropertyDefinitions().size() : 0; + if (operation.getName().equals(operationDefinition.getName()) + && (operation.getParameters().length == paramCount)) + return operation; + } + throw new IllegalStateException("ManagedOperation named '" + operationDefinition.getName() + + "' not found on ManagedComponent [" + getManagedComponent() + "]."); + } + + private static String toString(ManagedComponent managedComponent) { + Map<String, ManagedProperty> properties = managedComponent.getProperties(); + return managedComponent.getClass().getSimpleName() + "@" + System.identityHashCode(managedComponent) + "[" + + "type=" + managedComponent.getType() + ", name=" + managedComponent.getName() + ", properties=" + + properties.getClass().getSimpleName() + "@" + System.identityHashCode(properties) + "]"; + } + + private static String toString(@NotNull Object value) { + if (value.getClass().isArray()) { + StringBuilder buffer = new StringBuilder(); + int lastIndex = Array.getLength(value) - 1; + for (int i = 0; i < Array.getLength(value); i++) { + buffer.append(String.valueOf(Array.get(value, i))); + if (i == lastIndex) { + break; + } + buffer.append(", "); + } + return buffer.toString(); + } else { + return value.toString(); + } + } +}
commit 8a5eb613403c7b95f4f9616139db627eeedac989 Author: Jay Shaughnessy jshaughn@redhat.com Date: Tue Jun 29 22:37:33 2010 -0400
more work on sample bundle scripts
diff --git a/etc/samples/provisioning/sample-cli/scripts/cli-1-createBundle.js b/etc/samples/provisioning/sample-cli/scripts/cli-1-createBundle.js index 05f8b79..563858e 100644 --- a/etc/samples/provisioning/sample-cli/scripts/cli-1-createBundle.js +++ b/etc/samples/provisioning/sample-cli/scripts/cli-1-createBundle.js @@ -35,7 +35,7 @@ * 3) exec <path>/cli-1-createBundle.js */
-var bundleName = 'test-bundle-upgrade-ant'; +var bundleName = 'sample-bundle'; var bundleDistroV1Path = '../resources/sample-bundle-v1.zip';
// delete the test bundle if it exists @@ -43,7 +43,7 @@ var bc = new BundleCriteria(); bc.addFilterName(bundleName); var bundles = BundleManager.findBundlesByCriteria(bc); if (null != bundles && bundles.size() > 0) { - print("\nDeleting sample bundle [" + bundleName + "] to re-run sample scripts...") + print("\nDeleting [" + bundleName + "] to re-run sample scripts...") BundleManager.deleteBundle(bundles.get(0).getId()); }
diff --git a/etc/samples/provisioning/sample-cli/scripts/cli-2-deployBundle.js b/etc/samples/provisioning/sample-cli/scripts/cli-2-deployBundle.js index e4e61ec..0b3bd75 100644 --- a/etc/samples/provisioning/sample-cli/scripts/cli-2-deployBundle.js +++ b/etc/samples/provisioning/sample-cli/scripts/cli-2-deployBundle.js @@ -22,45 +22,71 @@ */
/** - * Thus test script works with a real env including at least one platform resource and a running agent on - * said platform. It will deploy an original distro file then upgrade it, utilitizing the - * Ant bundle system. + * This sample script shows how to deploy a Bundle. It deploys the bundle created + * by the cli-1-deployBundle.js script. The Bundle uses the Ant Bundle Type provided with + * RHQ. + * <pre> + * Prerequisites: + * At least one platform must be in inventory. If the "platforms" group does not exist it will + * be created with all platforms as members. + * + * Usage: + * 1) start the CLI (can be downloaded from the GUI, Administration->Downloads, RHQ Client) + * 2) login user password serverHost serverPort + * 3) exec <path>/cli-1-createBundle.js + * </pre> */
-var TestsEnabled = true; +var bundleName = 'sample-bundle';
-var bundleName = 'test-bundle-upgrade-ant'; -var bundleZipFile1 = 'src/test/resources/test-upgrade-bundle-ant1.zip'; -var bundleZipFile2 = 'src/test/resources/test-upgrade-bundle-ant2.zip'; +// get the bundle if it exists +var bc = new BundleCriteria(); +bc.addFilterName(bundleName); +bc.fetchBundleVersions( true ); +var bundles = BundleManager.findBundlesByCriteria(bc); +Assert.assertTrue( null != bundles && bundles.size() > 0 ); +var bundle = bundles.get(0); +Assert.assertTrue( null != bundle.getBundleVersions() && bundle.getBundleVersions().size() == 1 ); +var bundleVersion = bundle.getBundleVersions().get(0);
-// note, super-user, will not test any security constraints -var subject = rhq.login('rhqadmin', 'rhqadmin');
-executeAllTests(); +// Find or create the "platforms" group +var rgc = new ResourceGroupCriteria(); +rgc.addFilterName("platforms"); // wINdows, lINux +var groups = ResourceGroupManager.findResourceGroupsByCriteria(rgc); +var groupId; +// create if needed (and possible) +if ( groups.isEmpty() ) { + var c = new ResourceCriteria(); + c.addFilterResourceCategory(ResourceCategory.PLATFORM); + var platforms = ResourceManager.findResourcesByCriteria(c); + Assert.assertTrue( platforms.size() > 0 ); + + var rg = new ResourceGroup("platforms"); + var platformSet = new java.util.HashSet(); + platformSet.addAll( platforms ); + rg.setExplicitResources(platformSet); + rg = ResourceGroupManager.createResourceGroup(rg); + groupId = rg.getId(); +} else { + groupId = groups.get(0).getId(); +}
-rhq.logout(); +// create a destination for the deployment +var dest = BundleManager.createBundleDestination(bundle.getId(), "sample destination", "sample destination", "/tmp/sample-bundle", groupId);
-function testGroupDeployment() { - if ( !TestsEnabled ) { - return; - } +// create a config for the V1.0 deployment, setting the required properties for recipe in distro 1.0 +var config1 = new Configuration(); +var property11 = new PropertySimple("sample.name", "V1 Name"); +config1.put( property11 ); +var property12 = new PropertySimple("sample.port", "12345"); +config1.put( property12 );
- var groupId = getGroupId(); - var bundleType = getBundleType(); - Assert.assertNotNull(bundleType, "need ant bundle plugin installed for this test");
- // delete the test bundle if it exists - var bc = new BundleCriteria(); - bc.addFilterName( bundleName ); - var bundles = BundleManager.findBundlesByCriteria( bc ); - if ( null != bundles && bundles.size() > 0 ) { - print( "\nDeleting existing test ant bundle in order to test a fresh deploy...") - BundleManager.deleteBundle( bundles.get(0).getId() ); - } +// create a deployment for sample bundle 1.0 using the 1.0 config +var deployment = BundleManager.createBundleDeployment(bundleVersion.getId(), dest.getId(), "Deploying Sample Ant Bundle V1", config1); +deployment = BundleManager.scheduleBundleDeployment(testDeployment.getId(), true); +Assert.assertNotNull( deployment, "Failed to create 1.0 deployment" );
- // create bundleVersion 1.0 - var distributionFile1 = new java.io.File(bundleZipFile1); - distributionFile1 = new java.io.File(distributionFile1.getAbsolutePath()); - Assert.assertTrue(distributionFile1.exists(), "missing ant bundle file 1: " + distributionFile1); - var testBundleVersion1 = BundleManager.createBundleVersionViaFile( distributionFile1 ); +print("\nBundle Deployment Status=" + deployment.getStatus());
commit e95efbb18f704ee8b85c702b7c36d0eeb08bf129 Author: Jay Shaughnessy jshaughn@redhat.com Date: Tue Jun 29 22:37:01 2010 -0400
Revise tag deletion logic
diff --git a/release.sh b/release.sh index c4b9e46..5ce7396 100755 --- a/release.sh +++ b/release.sh @@ -327,15 +327,6 @@ if [ ! -d "$WORKING_DIR" ]; then fi
-# If the specified tag already exists then abort. It should not exist since production runs should have -# unique tags and test runs should have been done in a temporary branch - -EXISTING_REMOTE_TAG=`git ls-remote --tags origin "$RELEASE_TAG"` -if [ -n "$EXISTING_REMOTE_TAG" ]; then - abort "A remote tag named $RELEASE_TAG already exists - aborting, perhaps a bad build configuration..." -fi - - # if this is a test build then create a temporary build branch off of RELEASE_BRANCH. This allows checkins to # continue in RELEASE_BRANCH without affecting the release plugin work, which will fail if the branch contents # change before it completes. @@ -360,7 +351,28 @@ fi
# We should now have the build_branch checked out echo "Current Branch is $BUILD_BRANCH" - + +# If the specified tag already exists remotely and we're in production mode, then abort. If it exists and +# we're in test mode, delete it + +EXISTING_REMOTE_TAG=`git ls-remote --tags origin "$RELEASE_TAG"` +if [ -n "$EXISTING_REMOTE_TAG" ] && [ "$MODE" = "production" ]; then + abort "A remote tag named $RELEASE_TAG already exists - aborting, since we are in production mode..." +fi + +if [ -n "$EXISTING_REMOTE_TAG" ] && [ "$MODE" = "test" ]; then + echo "A remote tag named $RELEASE_TAG already exists - deleting it, since we are in test mode..." + git push origin ":refs/tags/$RELEASE_TAG" + [ "$?" -ne 0 ] && abort "Failed to delete remote tag ($RELEASE_TAG)." +fi + +# See if the specified tag already exists locally - if so, delete it (even if in production mode). +EXISTING_LOCAL_TAG=`git tag -l "$RELEASE_TAG"` +if [ -n "$EXISTING_LOCAL_TAG" ]; then + echo "A local tag named $RELEASE_TAG already exists - deleting it..." + git tag -d "$RELEASE_TAG" + [ "$?" -ne 0 ] && abort "Failed to delete local tag ($RELEASE_TAG)." +fi
# Run a test build before tagging. This will publish the snapshot artifacts to the local repo to "bootstrap" the repo.
commit 49344810743edbf032ab6506de606c8e881f62bf Author: Joseph Marques joseph@redhat.com Date: Tue Jun 29 19:38:35 2010 -0400
fix typo in log message
diff --git a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/AbstractManagedDeploymentComponent.java b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/AbstractManagedDeploymentComponent.java index de39733..e7a1194 100644 --- a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/AbstractManagedDeploymentComponent.java +++ b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/AbstractManagedDeploymentComponent.java @@ -119,7 +119,7 @@ public abstract class AbstractManagedDeploymentComponent extends AbstractManaged if (deploymentState == DeploymentState.STARTED) { return AvailabilityType.UP; } else { - log.debug("Deployment was not running, state was: " + deploymentState); + log.debug("Deployment was not STARTED, state was: " + deploymentState); return AvailabilityType.DOWN; } }
commit ab54c29d4306abe51df706b72f90b6454d20a057 Author: Joseph Marques joseph@redhat.com Date: Tue Jun 29 18:15:20 2010 -0400
improve availability checking routines for JBossAS5 managed components
* be tolerant of the underlying API changes - catch throwable * when getting the state object back, log if it's not UP/STARTED/RUNNING
diff --git a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/AbstractManagedDeploymentComponent.java b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/AbstractManagedDeploymentComponent.java index 09892a0..de39733 100644 --- a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/AbstractManagedDeploymentComponent.java +++ b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/AbstractManagedDeploymentComponent.java @@ -39,7 +39,6 @@ import org.jboss.deployers.spi.management.deploy.ProgressListener; import org.jboss.managed.api.DeploymentState; import org.jboss.managed.api.ManagedDeployment; import org.jboss.profileservice.spi.NoSuchDeploymentException; -import org.jboss.remoting.CannotConnectException;
import org.rhq.core.domain.configuration.Configuration; import org.rhq.core.domain.measurement.AvailabilityType; @@ -105,14 +104,22 @@ public abstract class AbstractManagedDeploymentComponent extends AbstractManaged }
public AvailabilityType getAvailability() { + DeploymentState deploymentState = null; try { - return (getManagedDeployment().getDeploymentState() == DeploymentState.STARTED) ? AvailabilityType.UP - : AvailabilityType.DOWN; + deploymentState = getManagedDeployment().getDeploymentState(); } catch (NoSuchDeploymentException e) { log.warn(this.deploymentType + " deployment '" + this.deploymentName + "' not found. Cause: " + e.getLocalizedMessage()); return AvailabilityType.DOWN; - } catch (CannotConnectException e) { + } catch (Throwable t) { + log.debug("Could not get deployment state, cause: ", t); + return AvailabilityType.DOWN; + } + + if (deploymentState == DeploymentState.STARTED) { + return AvailabilityType.UP; + } else { + log.debug("Deployment was not running, state was: " + deploymentState); return AvailabilityType.DOWN; } } diff --git a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ManagedComponentComponent.java b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ManagedComponentComponent.java index 0bf55c2..74130b4 100644 --- a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ManagedComponentComponent.java +++ b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ManagedComponentComponent.java @@ -49,7 +49,6 @@ import org.jboss.metatype.api.values.CompositeValue; import org.jboss.metatype.api.values.EnumValue; import org.jboss.metatype.api.values.MetaValue; import org.jboss.metatype.api.values.SimpleValue; -import org.jboss.remoting.CannotConnectException;
import org.rhq.core.domain.configuration.Configuration; import org.rhq.core.domain.configuration.ConfigurationUpdateStatus; @@ -105,13 +104,20 @@ public class ManagedComponentComponent extends AbstractManagedComponent implemen // ResourceComponent Implementation --------------------------------------------
public AvailabilityType getAvailability() { - RunState runState; + RunState runState = null; try { runState = getManagedComponent().getRunState(); - } catch (CannotConnectException e) { + } catch (Throwable t) { + log.debug("Could not get component state, cause: ", t); + return AvailabilityType.DOWN; + } + + if (runState == RunState.RUNNING) { + return AvailabilityType.UP; + } else { + log.debug("Component was not running, state was: " + runState); return AvailabilityType.DOWN; } - return (runState == RunState.RUNNING) ? AvailabilityType.UP : AvailabilityType.DOWN; }
public void start(ResourceContext<ProfileServiceComponent> resourceContext) throws Exception {
commit 80ac41afa88f74bc69a2032b74efad2d542d1e4a Author: Joseph Marques joseph@redhat.com Date: Tue Jun 29 18:05:03 2010 -0400
cosmetic - automatic relayout of code
diff --git a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/AbstractManagedDeploymentComponent.java b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/AbstractManagedDeploymentComponent.java index b2963cd..09892a0 100644 --- a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/AbstractManagedDeploymentComponent.java +++ b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/AbstractManagedDeploymentComponent.java @@ -28,6 +28,7 @@ import java.util.Set;
import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; + import org.jboss.deployers.spi.management.KnownDeploymentTypes; import org.jboss.deployers.spi.management.ManagementView; import org.jboss.deployers.spi.management.deploy.DeploymentManager; @@ -56,10 +57,8 @@ import org.rhq.plugins.jbossas5.util.DeploymentUtils; * @author Mark Spritzler * @author Ian Springer */ -public abstract class AbstractManagedDeploymentComponent - extends AbstractManagedComponent - implements MeasurementFacet, OperationFacet, ProgressListener -{ +public abstract class AbstractManagedDeploymentComponent extends AbstractManagedComponent implements MeasurementFacet, + OperationFacet, ProgressListener { public static final String DEPLOYMENT_NAME_PROPERTY = "deploymentName"; public static final String DEPLOYMENT_TYPE_NAME_PROPERTY = "deploymentTypeName"; public static final String EXTENSION_PROPERTY = "extension"; @@ -85,8 +84,7 @@ public abstract class AbstractManagedDeploymentComponent
// ----------- ResourceComponent Implementation ------------
- public void start(ResourceContext<ProfileServiceComponent> resourceContext) throws Exception - { + public void start(ResourceContext<ProfileServiceComponent> resourceContext) throws Exception { super.start(resourceContext); Configuration pluginConfig = getResourceContext().getPluginConfiguration(); this.deploymentName = pluginConfig.getSimple(DEPLOYMENT_NAME_PROPERTY).getStringValue(); @@ -94,41 +92,35 @@ public abstract class AbstractManagedDeploymentComponent String deploymentTypeName = pluginConfig.getSimple(DEPLOYMENT_TYPE_NAME_PROPERTY).getStringValue(); this.deploymentType = KnownDeploymentTypes.valueOf(deploymentTypeName); log.trace("Started ResourceComponent for " + getResourceDescription() + ", managing " + this.deploymentType - + " deployment '" + this.deploymentName + "' with path '" + this.deploymentFile + "'."); - + + " deployment '" + this.deploymentName + "' with path '" + this.deploymentFile + "'."); + try { getManagedDeployment(); } catch (Exception e) { - log.warn("The underlying file [" + this.deploymentFile + "] no longer exists. It may have been deleted from the filesystem external to Jopr. If you wish to remove this Resource from inventory, you may add &debug=true to the URL for the Browse Resources > Services page and then click the UNINVENTORY button next to this Resource"); + log + .warn("The underlying file [" + + this.deploymentFile + + "] no longer exists. It may have been deleted from the filesystem external to Jopr. If you wish to remove this Resource from inventory, you may add &debug=true to the URL for the Browse Resources > Services page and then click the UNINVENTORY button next to this Resource"); } }
- public AvailabilityType getAvailability() - { - try - { - return (getManagedDeployment().getDeploymentState() == DeploymentState.STARTED) ? AvailabilityType.UP : - AvailabilityType.DOWN; - } - catch (NoSuchDeploymentException e) - { + public AvailabilityType getAvailability() { + try { + return (getManagedDeployment().getDeploymentState() == DeploymentState.STARTED) ? AvailabilityType.UP + : AvailabilityType.DOWN; + } catch (NoSuchDeploymentException e) { log.warn(this.deploymentType + " deployment '" + this.deploymentName + "' not found. Cause: " - + e.getLocalizedMessage()); + + e.getLocalizedMessage()); return AvailabilityType.DOWN; - } - catch (CannotConnectException e) - { + } catch (CannotConnectException e) { return AvailabilityType.DOWN; } }
// ------------ MeasurementFacet Implementation ------------
- public void getValues(MeasurementReport report, Set<MeasurementScheduleRequest> requests) - throws Exception - { - if (this.deploymentType == KnownDeploymentTypes.JavaEEWebApplication) - { + public void getValues(MeasurementReport report, Set<MeasurementScheduleRequest> requests) throws Exception { + if (this.deploymentType == KnownDeploymentTypes.JavaEEWebApplication) { WarMeasurementFacetDelegate warMeasurementFacetDelegate = new WarMeasurementFacetDelegate(this); warMeasurementFacetDelegate.getValues(report, requests); } @@ -136,43 +128,32 @@ public abstract class AbstractManagedDeploymentComponent
// ------------ OperationFacet Implementation ------------
- public OperationResult invokeOperation(String name, Configuration parameters) throws Exception - { + public OperationResult invokeOperation(String name, Configuration parameters) throws Exception { DeploymentManager deploymentManager = getConnection().getDeploymentManager(); DeploymentProgress progress; - if (name.equals("start")) - { - //FIXME: This is a workaround until JOPR-309 will be fixed. - if(getAvailability() != AvailabilityType.UP) - { - progress = deploymentManager.start(this.deploymentName); - } - else - { - log.warn("Operation '" + name + "' on " + getResourceDescription() + " failed because the Resource is already started."); - OperationResult result = new OperationResult(); - result.setErrorMessage(this.deploymentFile.getName() + " is already started."); - return result; - } - } - else if (name.equals("stop")) - { + if (name.equals("start")) { + //FIXME: This is a workaround until JOPR-309 will be fixed. + if (getAvailability() != AvailabilityType.UP) { + progress = deploymentManager.start(this.deploymentName); + } else { + log.warn("Operation '" + name + "' on " + getResourceDescription() + + " failed because the Resource is already started."); + OperationResult result = new OperationResult(); + result.setErrorMessage(this.deploymentFile.getName() + " is already started."); + return result; + } + } else if (name.equals("stop")) { progress = deploymentManager.stop(this.deploymentName); - } - else if (name.equals("restart")) - { + } else if (name.equals("restart")) { progress = deploymentManager.stop(this.deploymentName); DeploymentStatus stopStatus = DeploymentUtils.run(progress); // Still try to start, even if stop fails (maybe the app wasn't running to begin with). progress = deploymentManager.start(this.deploymentName); - } - else - { + } else { throw new UnsupportedOperationException(name); } DeploymentStatus status = DeploymentUtils.run(progress); - log.debug("Operation '" + name + "' on " + getResourceDescription() + " returned status [" + status - + "]."); + log.debug("Operation '" + name + "' on " + getResourceDescription() + " returned status [" + status + "]."); if (status.isFailed()) { throw status.getFailure(); } @@ -181,8 +162,7 @@ public abstract class AbstractManagedDeploymentComponent
// ------------ ProgressListener implementation -------------
- public void progressEvent(ProgressEvent event) - { + public void progressEvent(ProgressEvent event) { log.debug(event); }
@@ -196,15 +176,13 @@ public abstract class AbstractManagedDeploymentComponent return deploymentType; }
- protected ManagedDeployment getManagedDeployment() throws NoSuchDeploymentException - { + protected ManagedDeployment getManagedDeployment() throws NoSuchDeploymentException { ManagementView managementView = getConnection().getManagementView(); managementView.load(); return managementView.getDeployment(this.deploymentName); }
- private File getDeploymentFile() - { + private File getDeploymentFile() { // e.g.: vfszip:/C:/opt/jboss-5.0.0.GA/server/default/deploy/foo.war URI vfsURI = URI.create(this.deploymentName); // e.g.: foo.war diff --git a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ManagedComponentComponent.java b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ManagedComponentComponent.java index aefb351..0bf55c2 100644 --- a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ManagedComponentComponent.java +++ b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ManagedComponentComponent.java @@ -30,6 +30,9 @@ import java.util.Set;
import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + import org.jboss.deployers.spi.management.ManagementView; import org.jboss.deployers.spi.management.deploy.DeploymentManager; import org.jboss.deployers.spi.management.deploy.DeploymentProgress; @@ -48,12 +51,9 @@ import org.jboss.metatype.api.values.MetaValue; import org.jboss.metatype.api.values.SimpleValue; import org.jboss.remoting.CannotConnectException;
-import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - import org.rhq.core.domain.configuration.Configuration; -import org.rhq.core.domain.configuration.PropertySimple; import org.rhq.core.domain.configuration.ConfigurationUpdateStatus; +import org.rhq.core.domain.configuration.PropertySimple; import org.rhq.core.domain.configuration.definition.ConfigurationDefinition; import org.rhq.core.domain.measurement.AvailabilityType; import org.rhq.core.domain.measurement.DataType; @@ -72,11 +72,11 @@ import org.rhq.core.pluginapi.operation.OperationFacet; import org.rhq.core.pluginapi.operation.OperationResult; import org.rhq.core.util.exception.ThrowableUtil; import org.rhq.plugins.jbossas5.util.ConversionUtils; +import org.rhq.plugins.jbossas5.util.DebugUtils; import org.rhq.plugins.jbossas5.util.DeploymentUtils; import org.rhq.plugins.jbossas5.util.ManagedComponentUtils; -import org.rhq.plugins.jbossas5.util.ResourceTypeUtils; import org.rhq.plugins.jbossas5.util.ResourceComponentUtils; -import org.rhq.plugins.jbossas5.util.DebugUtils; +import org.rhq.plugins.jbossas5.util.ResourceTypeUtils;
/** * Service ResourceComponent for all {@link ManagedComponent}s in a Profile. @@ -93,7 +93,7 @@ public class ManagedComponentComponent extends AbstractManagedComponent implemen String COMPONENT_NAME = "componentName"; String TEMPLATE_NAME = "templateName"; String COMPONENT_NAME_PROPERTY = "componentNameProperty"; - } + }
protected static final char PREFIX_DELIMITER = '|';
@@ -129,53 +129,45 @@ public class ManagedComponentComponent extends AbstractManagedComponent implemen
// ConfigurationComponent Implementation --------------------------------------------
- public Configuration loadResourceConfiguration() - { + public Configuration loadResourceConfiguration() { Configuration resourceConfig; - try - { + try { Map<String, ManagedProperty> managedProperties = getManagedComponent().getProperties(); - Map<String, PropertySimple> customProps = - ResourceComponentUtils.getCustomProperties(getResourceContext().getPluginConfiguration()); - if (this.log.isDebugEnabled()) this.log.debug("*** AFTER LOAD:\n" - + DebugUtils.convertPropertiesToString(managedProperties)); - resourceConfig = ConversionUtils.convertManagedObjectToConfiguration(managedProperties, - customProps, getResourceContext().getResourceType()); - } - catch (Exception e) - { + Map<String, PropertySimple> customProps = ResourceComponentUtils.getCustomProperties(getResourceContext() + .getPluginConfiguration()); + if (this.log.isDebugEnabled()) + this.log.debug("*** AFTER LOAD:\n" + DebugUtils.convertPropertiesToString(managedProperties)); + resourceConfig = ConversionUtils.convertManagedObjectToConfiguration(managedProperties, customProps, + getResourceContext().getResourceType()); + } catch (Exception e) { RunState runState = getManagedComponent().getRunState(); if (runState == RunState.RUNNING) { - this.log.error("Failed to load configuration for " + getResourceDescription() + ".", e); + this.log.error("Failed to load configuration for " + getResourceDescription() + ".", e); } else { - this.log.debug("Failed to load configuration for " + getResourceDescription() - + ", but managed component is not in the RUNNING state.", e); + this.log.debug("Failed to load configuration for " + getResourceDescription() + + ", but managed component is not in the RUNNING state.", e); } throw new RuntimeException(ThrowableUtil.getAllMessages(e)); } return resourceConfig; }
- public void updateResourceConfiguration(ConfigurationUpdateReport configurationUpdateReport) - { + public void updateResourceConfiguration(ConfigurationUpdateReport configurationUpdateReport) { Configuration resourceConfig = configurationUpdateReport.getConfiguration(); Configuration pluginConfig = getResourceContext().getPluginConfiguration(); - try - { + try { ManagedComponent managedComponent = getManagedComponent(); Map<String, ManagedProperty> managedProperties = managedComponent.getProperties(); Map<String, PropertySimple> customProps = ResourceComponentUtils.getCustomProperties(pluginConfig); - if (this.log.isDebugEnabled()) this.log.debug("*** BEFORE UPDATE:\n" - + DebugUtils.convertPropertiesToString(managedProperties)); + if (this.log.isDebugEnabled()) + this.log.debug("*** BEFORE UPDATE:\n" + DebugUtils.convertPropertiesToString(managedProperties)); ConversionUtils.convertConfigurationToManagedProperties(managedProperties, resourceConfig, - getResourceContext().getResourceType(), customProps); - if (this.log.isDebugEnabled()) this.log.debug("*** AFTER UPDATE:\n" - + DebugUtils.convertPropertiesToString(managedProperties)); + getResourceContext().getResourceType(), customProps); + if (this.log.isDebugEnabled()) + this.log.debug("*** AFTER UPDATE:\n" + DebugUtils.convertPropertiesToString(managedProperties)); updateComponent(managedComponent); configurationUpdateReport.setStatus(ConfigurationUpdateStatus.SUCCESS); - } - catch (Exception e) - { + } catch (Exception e) { this.log.error("Failed to update configuration for " + getResourceDescription() + ".", e); configurationUpdateReport.setStatus(ConfigurationUpdateStatus.FAILURE); configurationUpdateReport.setErrorMessage(ThrowableUtil.getAllMessages(e)); @@ -241,7 +233,7 @@ public class ManagedComponentComponent extends AbstractManagedComponent implemen log.error("Failed to collect metric for " + request, e); } else { log.debug("Failed to collect metric for " + request - + ", but managed component is not in the RUNNING state.", e); + + ", but managed component is not in the RUNNING state.", e); } } }
commit 1dab7fe90f9f6e477878751dbeb50c56166de3f9 Author: Ian Springer ian.springer@redhat.com Date: Tue Jun 29 17:21:51 2010 -0400
make nsswitch plugin pom and descriptor follow same conventions as the other agent plugins
diff --git a/modules/plugins/nss/pom.xml b/modules/plugins/nss/pom.xml index 47b015b..0b8578a 100644 --- a/modules/plugins/nss/pom.xml +++ b/modules/plugins/nss/pom.xml @@ -6,109 +6,19 @@
<modelVersion>4.0.0</modelVersion>
+ <parent> + <groupId>org.rhq</groupId> + <artifactId>rhq-plugins-parent</artifactId> + <version>3.0.0-SNAPSHOT</version> + </parent> + <groupId>org.rhq.plugin.nss</groupId> <artifactId>nameservices-switch-plugin</artifactId> - <version>0.0.7</version> <packaging>jar</packaging>
<name>Name Service Switch</name> <description>A Plugin for managing the Name Service Switch infrastructure of a Linux System</description>
- <properties> - <rhq.version>1.4.0-SNAPSHOT</rhq.version> - </properties> - - <dependencies> - - <!-- Below are the core modules that are required dependencies of all plugins --> - <dependency> - <groupId>org.rhq</groupId> - <artifactId>rhq-core-domain</artifactId> - <version>${rhq.version}</version> - <scope>provided</scope> <!-- provided by the agent/plugin-container --> - </dependency> - - <dependency> - <groupId>org.rhq</groupId> - <artifactId>rhq-core-plugin-api</artifactId> - <version>${rhq.version}</version> - <scope>provided</scope> <!-- provided by the agent/plugin-container --> - </dependency> - - <dependency> - <groupId>org.rhq</groupId> - <artifactId>rhq-core-native-system</artifactId> - <version>${rhq.version}</version> - <scope>provided</scope> <!-- provided by the agent/plugin-container --> - </dependency> - - <!-- Fix for the Javac bug requiring annotations to be available when compiling classes. (fixed in JDK 6) --> - <dependency> - <groupId>javax.persistence</groupId> - <artifactId>persistence-api</artifactId> - <version>1.0</version> - <scope>provided</scope> <!-- provided by the agent/plugin-container --> - </dependency> - - <!-- Fix for the Javac bug requiring annotations to be available when compiling classes. (fixed in JDK 6) --> - <dependency> - <groupId>hibernate-annotations</groupId> - <artifactId>hibernate-annotations</artifactId> - <version>3.2.1.GA</version> - <scope>provided</scope> <!-- provided by the agent/plugin-container --> - </dependency> - - <!-- Fix for the Javac bug requiring annotations to be available when compiling classes. (fixed in JDK 6) --> - <dependency> - <groupId>javax.xml.bind</groupId> - <artifactId>jaxb-api</artifactId> - <version>2.1</version> - <scope>provided</scope> <!-- provided by the agent/plugin-container --> - </dependency> - - <!-- - Uncomment the one of the three logging systems your plugin uses: log4j, commons-logging or i18nlog - All three are provided to your plugin by the agent/plugin-container. - --> - <dependency> - <groupId>commons-logging</groupId> - <artifactId>commons-logging</artifactId> - <version>1.1</version> - <scope>provided</scope> - </dependency> - - <!-- Define any third-party dependencies your plugin has here. --> - <!-- - <dependency> - <groupId>group-id-of-dependency-goes-here</groupId> - <artifactId>artifact-id-of-dependency-goes-here</artifactId> - <version>version-of-dependency-goes-here</version> - </dependency> - --> - - </dependencies> - - <build> - <plugins> - - <plugin> - <artifactId>maven-compiler-plugin</artifactId> - <configuration> - <source>1.5</source> - <target>1.5</target> - </configuration> - </plugin> - - <plugin> - <groupId>org.rhq</groupId> - <artifactId>rhq-plugin-validator</artifactId> - <version>${rhq.version}</version> - </plugin> - - - </plugins> - </build> - <profiles> <profile> <id>dev</id> diff --git a/modules/plugins/nss/src/main/resources/META-INF/rhq-plugin.xml b/modules/plugins/nss/src/main/resources/META-INF/rhq-plugin.xml index 305129e..2ad376e 100644 --- a/modules/plugins/nss/src/main/resources/META-INF/rhq-plugin.xml +++ b/modules/plugins/nss/src/main/resources/META-INF/rhq-plugin.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8" ?>
-<plugin name="" +<plugin name="NSS" displayName="Name Service Switch" version="1.0" package="org.rhq.plugin.nss" @@ -30,4 +30,6 @@ <c:simple-property name="aliases" displayName="aliases" default="" /> </resource-configuration> </server> + </plugin> +
commit e4637fefe54591d1b7a8001dd153755f388d382a Author: Ian Springer ian.springer@redhat.com Date: Tue Jun 29 17:20:56 2010 -0400
disable raw config support in GUI (https://bugzilla.redhat.com/show_bug.cgi?id=609211)
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/configuration/edit.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/configuration/edit.xhtml index d10c5f4..9aafddc 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/configuration/edit.xhtml +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/configuration/edit.xhtml @@ -25,27 +25,6 @@ THIS TEXT WILL BE REMOVED. <ui:param name="selectedTabName" value="Configuration.Current"/>
<ui:define name="content"> - <script type="text/javascript"> - function cursor_wait() { - document.body.style.cursor = 'wait'; - } - - function cursor_clear() { - document.body.style.cursor = 'default'; - } - - var currentFileModified = false; - - var selectedFile = ''; - - function setCurrentFileModified() { - currentFileModified = true; - } - - function resetCurrentFile() { - currentFileModified; - } - </script>
<h:panelGroup layout="block" styleClass="InfoBlock" rendered="#{configurationEditor.updateInProgress}"> @@ -82,64 +61,11 @@ THIS TEXT WILL BE REMOVED. </h:panelGrid> </h:panelGrid>
- <c:choose> - <c:when test="${configurationEditor.rawSupported}"> - rich:tabPanel - <rich:tab label="Advanced Mode" onlabelclick="cursor_wait();" oncomplete="cursor_clear();"> - <ui:include src="raw.xhtml"> - <ui:param name="readOnly" value="false"/> - </ui:include> - </rich:tab> - </rich:tabPanel> - </c:when> - - <c:when test="${configurationEditor.structuredSupported}"> - rich:tabPanel - <rich:tab label="Basic Mode" onlabelclick="cursor_wait();" oncomplete="cursor_clear();"> - <ui:include src="structured.xhtml"> - <ui:param name="readOnly" value="false"/> - </ui:include> - - ui:remove - <h:panelGrid columns="2" styleClass="buttons-table" columnClasses="button-cell" - rendered="#{resourceConfiguration != null}"> - <h:commandButton value="SAVE" action="#{configurationEditor.updateConfiguration}" - title="Click to Save Changes" styleClass="buttonmed" - rendered="${ResourceUIBean.permissions.configure}"/> - <h:commandButton value="RESET" type="reset" immediate="true" - title="Click to Reset Fields" styleClass="buttonmed"/> - </h:panelGrid> - </ui:remove> - </rich:tab> - </rich:tabPanel> - </c:when> - - <c:when test="${configurationEditor.structuredAndRawSupported}"> - <rich:tabPanel id="configTabPanel" - selectedTab="#{configurationEditor.selectedTab}" - switchType="ajax" - valueChangeListener="#{configurationEditor.changeTabs}"> - <rich:tab id="structuredTab" - label="Basic Mode" - reRender="lowerCommitPanel,upperCommitPanel,modalEditor" - onlabelclick="cursor_wait();" - oncomplete="cursor_clear();"> - <ui:include src="structured.xhtml"> - <ui:param name="readOnly" value="false"/> - </ui:include> - </rich:tab> - <rich:tab id="rawTab" - label="Advanced Mode" - reRender="fileMenuPanel,upperCommitPanel,lowerCommitPanel,modalEditor" - onlabelclick="cursor_wait();" - oncomplete="cursor_clear();"> - <ui:include src="raw.xhtml"> - <ui:param name="readOnly" value="false"/> - </ui:include> - </rich:tab> - </rich:tabPanel> - </c:when> - </c:choose> + <c:if test="${configurationEditor.structuredSupported or configurationEditor.structuredAndRawSupported}"> + <ui:include src="structured.xhtml"> + <ui:param name="readOnly" value="false"/> + </ui:include> + </c:if>
<h:panelGrid columns="1" style="width:100%" columnClasses="raw-edit-footer"> <h:panelGroup id="lowerCommitPanel" style="text-align:right"> @@ -163,19 +89,8 @@ THIS TEXT WILL BE REMOVED. </h:panelGroup> </h:panelGrid>
- <ui:include src="view-raw-modal.xhtml"> - <ui:param name="readOnly" value="false"/> - </ui:include> - - <ui:include src="error-window.xhtml"/> </h:form>
- <!-- - upload-modal.xhtml needs to be included outside the above form because the file upload component requires its - own, separate form. - --> - <ui:include src="upload-modal.xhtml"/> - </ui:define>
</ui:composition> diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/configuration/view.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/configuration/view.xhtml index 6541456..7a40797 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/configuration/view.xhtml +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/configuration/view.xhtml @@ -27,15 +27,6 @@ THIS TEXT WILL BE REMOVED. <ui:param name="selectedTabName" value="Configuration.Current"/>
<ui:define name="content"> - <script type="text/javascript"> - function cursor_wait() { - document.body.style.cursor = 'wait'; - } - - function cursor_clear() { - document.body.style.cursor = 'default'; - } - </script>
<h:panelGroup layout="block" styleClass="InfoBlock" rendered="#{configurationViewer.updateInProgress}"> @@ -60,46 +51,9 @@ THIS TEXT WILL BE REMOVED. </h:panelGrid> </h:panelGrid>
- <c:choose> - <c:when test="${configurationViewer.rawSupported}"> - rich:tabPanel - <rich:tab label="Advanced Mode"> - <ui:include src="raw.xhtml"/> - </rich:tab> - </rich:tabPanel> - </c:when> - - <c:when test="${configurationViewer.structuredSupported}"> - rich:tabPanel - <rich:tab label="Basic Mode"> - <ui:include src="structured.xhtml"/> - </rich:tab> - </rich:tabPanel> - </c:when> - - <c:when test="${configurationViewer.structuredAndRawSupported}"> - <rich:tabPanel id="resourceConfigurationTabPanel" - switchType="ajax" - valueChangeListener="#{configurationViewer.changeTabs}"> - <rich:tab id="structuredTab" - label="Basic Mode" - onlabelclick="cursor_wait();" - oncomplete="cursor_clear();" - limitToList="true" - reRender="upperEditButton,lowerEditButton,modalEditor"> - <ui:include src="structured.xhtml"/> - </rich:tab> - <rich:tab id="rawTab" - label="Advanced Mode" - onlabelclick="cursor_wait();" - oncomplete="cursor_clear();" - limitToList="true" - reRender="upperEditButton,lowerEditButton,modalEditor"> - <ui:include src="raw.xhtml"/> - </rich:tab> - </rich:tabPanel> - </c:when> - </c:choose> + <c:if test="${configurationViewer.structuredSupported or configurationViewer.structuredAndRawSupported}"> + <ui:include src="structured.xhtml"/> + </c:if>
<h:panelGrid columns="1" style="width:100%" columnClasses="raw-edit-footer"> <h:panelGroup style="text-align:right"> @@ -114,7 +68,6 @@ THIS TEXT WILL BE REMOVED. </h:panelGroup> </h:panelGrid>
- <ui:include src="view-raw-modal.xhtml"/> </h:form> </ui:define>
commit e6438c474e3eb5788b913893ab8c5db270dbbe3a Author: Ian Springer ian.springer@redhat.com Date: Tue Jun 29 17:18:30 2010 -0400
fix issue caused by original fix for IE scrollbar issue (https://bugzilla.redhat.com/show_bug.cgi?id=601744) which was causing vertical scrollbar on Resource tab pages to be displayed by FF at 2/3 of the correct width
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/entity/layout/main.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/entity/layout/main.xhtml index 7629fd7..e249621 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/entity/layout/main.xhtml +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/entity/layout/main.xhtml @@ -49,8 +49,8 @@ id - the id of the Resource being accessed </div> </div> <div id="centerContent" class="column" style="width: #{100 - UserPreferencesUIBean.leftResourceNavState}%;"> - <div id="centerContentWrapper" class="content-right" style="position: relative"> - <div style="left: 0; right: 0; height: 100%;"> + <div id="centerContentWrapper" class="content-right"> + <div style="left: 0; right: 0; height: 100%; position: relative"> <ui:insert name="summary"><p>Default Entity Summary</p></ui:insert> <ui:insert name="tabBar"><p>Default Entity TabBar</p></ui:insert> <ui:insert name="content"><p>Default Entity Content</p></ui:insert>
commit eee5ad2d562b8377c670f44a07fa1a0d59257c95 Author: Joseph Marques joseph@redhat.com Date: Tue Jun 29 17:08:05 2010 -0400
BZ-607672: add more silience during notfication processing
* gracefully handle cases when server-plugin plugin container is in one of various initializing states * do not bomb during alert notification sender if server-side plugin container hasn't started completely
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/AlertManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/AlertManagerBean.java index 0fc7840..c856a24 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/AlertManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/AlertManagerBean.java @@ -656,6 +656,8 @@ public class AlertManagerBean implements AlertManagerLocal, AlertManagerRemote { List<AlertNotification> alertNotifications = alert.getAlertDefinition().getAlertNotifications(); Set<String> emailAddresses = new LinkedHashSet<String>();
+ AlertSenderPluginManager alertSenderPluginManager = getAlertPluginManager(); + for (AlertNotification alertNotification : alertNotifications) {
// Send over the new AlertSender plugins @@ -666,7 +668,7 @@ public class AlertManagerBean implements AlertManagerLocal, AlertManagerRemote { }
AlertNotificationLog alNoLo; - AlertSender sender = getAlertSender(alertNotification); + AlertSender<?> sender = alertSenderPluginManager.getAlertSenderForNotification(alertNotification);
if (sender != null) { try { @@ -704,7 +706,13 @@ public class AlertManagerBean implements AlertManagerLocal, AlertManagerRemote { }
// send them off - Collection<String> badAddresses = sendAlertNotificationEmails(alert, emailAddresses); + Collection<String> badAddresses = null; + try { + badAddresses = sendAlertNotificationEmails(alert, emailAddresses); + } catch (Throwable t) { + badAddresses = new ArrayList<String>(); + log.error("Could not send emails to " + emailAddresses + " for " + alert + ", cause:", t); + } // TODO we may do the same for SMS in the future.
// log those bad addresses to the gui and their individual senders (if possible) @@ -734,8 +742,8 @@ public class AlertManagerBean implements AlertManagerLocal, AlertManagerRemote { } }
- } catch (Exception e) { - log.error("Failed to send all notifications for " + alert.toSimpleString(), e); + } catch (Throwable t) { + log.error("Failed to send all notifications for " + alert.toSimpleString(), t); } }
@@ -745,18 +753,20 @@ public class AlertManagerBean implements AlertManagerLocal, AlertManagerRemote { */ public AlertSenderPluginManager getAlertPluginManager() { MasterServerPluginContainer container = LookupUtil.getServerPluginService().getMasterPluginContainer(); + if (container == null) { + log.warn(MasterServerPluginContainer.class.getSimpleName() + " is not started yet"); + return null; + } AlertServerPluginContainer pc = container.getPluginContainerByClass(AlertServerPluginContainer.class); + if (pc == null) { + log.warn(AlertServerPluginContainer.class.getSimpleName() + " has not been loaded by the " + + MasterServerPluginContainer.class.getSimpleName() + " yet"); + return null; + } AlertSenderPluginManager manager = (AlertSenderPluginManager) pc.getPluginManager(); - return manager; }
- AlertSender getAlertSender(AlertNotification notification) { - AlertSenderPluginManager manager = getAlertPluginManager(); - AlertSender sender = manager.getAlertSenderForNotification(notification); - return sender; - } - /** * * @param alert @@ -765,9 +775,9 @@ public class AlertManagerBean implements AlertManagerLocal, AlertManagerRemote { */ private Collection<String> sendAlertNotificationEmails(Alert alert, Set<String> emailAddresses) {
- if (emailAddresses.size()==0) + if (emailAddresses.size() == 0) return new ArrayList<String>(0); // No email to send -> no bad addresses - + log.debug("Sending alert notifications for " + alert.toSimpleString() + "...");
AlertDefinition alertDefinition = alert.getAlertDefinition();
commit 27502131a4a4be2e06983cecbbb44361be756267 Author: Jay Shaughnessy jshaughn@redhat.com Date: Tue Jun 29 17:02:01 2010 -0400
LT commit
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/admin/config/GeneralPropertiesConfigForm.jsp b/modules/enterprise/gui/portal-war/src/main/webapp/admin/config/GeneralPropertiesConfigForm.jsp index 30df9ef..45526f7 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/admin/config/GeneralPropertiesConfigForm.jsp +++ b/modules/enterprise/gui/portal-war/src/main/webapp/admin/config/GeneralPropertiesConfigForm.jsp @@ -1,104 +1,104 @@ -<%@ page language="java" %> -<%@ page errorPage="/common/Error.jsp" %> - -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="http://jakarta.apache.org/struts/tags-html-el" prefix="html" %> -<%@ taglib uri="http://jakarta.apache.org/struts/tags-tiles" prefix="tiles" %> -<%@ taglib uri="http://jakarta.apache.org/struts/tags-logic" prefix="logic" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="/WEB-INF/tld/hq.tld" prefix="hq" %> - -<script src="<html:rewrite page="/js/"/>functions.js" type="text/javascript"></script> -<link rel=stylesheet href="<html:rewrite page="/css/"/>win.css" type="text/css"> - -<hq:constant - classname="org.rhq.enterprise.gui.legacy.Constants" - symbol="MINUTES_LABEL" var="CONST_MINUTES" /> -<hq:constant - classname="org.rhq.enterprise.gui.legacy.Constants" - symbol="HOURS_LABEL" var="CONST_HOURS" /> -<hq:constant - classname="org.rhq.enterprise.gui.legacy.Constants" - symbol="DAYS_LABEL" var="CONST_DAYS" /> - -<!-- BASE SERVER CONFIG TITLE --> -<tiles:insert definition=".header.tab"> - <tiles:put name="tabKey" value="admin.settings.BaseConfigTab"/> -</tiles:insert> -<!-- / --> - -<!-- BASE SERVER CONFIG CONTENTS --> -<table width="100%" cellpadding="0" cellspacing="0" border="0"> - <tr> - <td width="45%" class="BlockLabel"><fmt:message key="admin.settings.BaseURL"/></td> - <td width="55%" class="BlockContent"><html:text size="31" property="baseUrl" /></td> - </tr> - <tr> - <td class="BlockLabel"><fmt:message key="admin.settings.AgentMaxQuietTimeAllowed"/></td> - <td class="BlockContent"> - <table width="100%" cellpadding="0" cellspacing="0" border="0"> - <tr> -<logic:messagesPresent property="agentMaxQuietTimeAllowedVal"> - <td class="ErrorField"> - <html:text size="2" property="agentMaxQuietTimeAllowedVal" /> - </td> - <td class="ErrorField" width="100%"> - <html:select property="agentMaxQuietTimeAllowed"> - <html:option value="${CONST_MINUTES}"><fmt:message key="admin.settings.Minutes"/></html:option> - </html:select> - </td> -</logic:messagesPresent> -<logic:messagesNotPresent property="agentMaxQuietTimeAllowedVal"> - <td class="BlockContent"> - <html:text size="2" property="agentMaxQuietTimeAllowedVal" /> - </td> - <td class="BlockContent" width="100%"> - <html:select property="agentMaxQuietTimeAllowed"> - <html:option value="${CONST_MINUTES}"><fmt:message key="admin.settings.Minutes"/></html:option> - </html:select> - </td> -</logic:messagesNotPresent> - </tr> -<logic:messagesPresent property="agentMaxQuietTimeAllowedVal"> - <tr> - <td class="ErrorField" colspan="2"> - <span class="ErrorFieldContent"> <html:errors property="agentMaxQuietTimeAllowedVal"/></span> - </td> - </tr> -</logic:messagesPresent> -<logic:messagesNotPresent property="agentMaxQuietTimeAllowedVal"> - <tr> - <td class="BlockContent" colspan="2"> - </td> - </tr> -</logic:messagesNotPresent> - </table> - </td> - </tr> - <tr> - <td class="BlockLabel"><fmt:message key="admin.settings.EnableAgentAutoUpdate"/></td> - <td class="BlockContent"> - <table cellpadding="0" cellspacing="4" border="0"> - <tr> - <td align="left"><html:radio property="enableAgentAutoUpdate" value="true"/><fmt:message key="yesno.true"/></td> - <td align="left"><html:radio property="enableAgentAutoUpdate" value="false"/><fmt:message key="yesno.false"/></td> - </tr> - </table> - </td> - </tr> - -<hq:authorization permission="superuser"> - <tr> - <td class="BlockLabel"><fmt:message key="admin.settings.EnableDebugMode"/></td> - <td class="BlockContent"> - <table cellpadding="0" cellspacing="4" border="0"> - <tr> - <td align="left"><html:radio property="enableDebugMode" value="true"/><fmt:message key="yesno.true"/></td> - <td align="left"><html:radio property="enableDebugMode" value="false"/><fmt:message key="yesno.false"/></td> - </tr> - </table> - </td> - </tr> -</hq:authorization> - -</table> +<%@ page language="java" %> +<%@ page errorPage="/common/Error.jsp" %> + +<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> +<%@ taglib uri="http://jakarta.apache.org/struts/tags-html-el" prefix="html" %> +<%@ taglib uri="http://jakarta.apache.org/struts/tags-tiles" prefix="tiles" %> +<%@ taglib uri="http://jakarta.apache.org/struts/tags-logic" prefix="logic" %> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/tld/hq.tld" prefix="hq" %> + +<script src="<html:rewrite page="/js/"/>functions.js" type="text/javascript"></script> +<link rel=stylesheet href="<html:rewrite page="/css/"/>win.css" type="text/css"> + +<hq:constant + classname="org.rhq.enterprise.gui.legacy.Constants" + symbol="MINUTES_LABEL" var="CONST_MINUTES" /> +<hq:constant + classname="org.rhq.enterprise.gui.legacy.Constants" + symbol="HOURS_LABEL" var="CONST_HOURS" /> +<hq:constant + classname="org.rhq.enterprise.gui.legacy.Constants" + symbol="DAYS_LABEL" var="CONST_DAYS" /> + +<!-- BASE SERVER CONFIG TITLE --> +<tiles:insert definition=".header.tab"> + <tiles:put name="tabKey" value="admin.settings.BaseConfigTab"/> +</tiles:insert> +<!-- / --> + +<!-- BASE SERVER CONFIG CONTENTS --> +<table width="100%" cellpadding="0" cellspacing="0" border="0"> + <tr> + <td width="45%" class="BlockLabel"><fmt:message key="admin.settings.BaseURL"/></td> + <td width="55%" class="BlockContent"><html:text size="31" property="baseUrl" /></td> + </tr> + <tr> + <td class="BlockLabel"><fmt:message key="admin.settings.AgentMaxQuietTimeAllowed"/></td> + <td class="BlockContent"> + <table width="100%" cellpadding="0" cellspacing="0" border="0"> + <tr> +<logic:messagesPresent property="agentMaxQuietTimeAllowedVal"> + <td class="ErrorField"> + <html:text size="2" property="agentMaxQuietTimeAllowedVal" /> + </td> + <td class="ErrorField" width="100%"> + <html:select property="agentMaxQuietTimeAllowed"> + <html:option value="${CONST_MINUTES}"><fmt:message key="admin.settings.Minutes"/></html:option> + </html:select> + </td> +</logic:messagesPresent> +<logic:messagesNotPresent property="agentMaxQuietTimeAllowedVal"> + <td class="BlockContent"> + <html:text size="2" property="agentMaxQuietTimeAllowedVal" /> + </td> + <td class="BlockContent" width="100%"> + <html:select property="agentMaxQuietTimeAllowed"> + <html:option value="${CONST_MINUTES}"><fmt:message key="admin.settings.Minutes"/></html:option> + </html:select> + </td> +</logic:messagesNotPresent> + </tr> +<logic:messagesPresent property="agentMaxQuietTimeAllowedVal"> + <tr> + <td class="ErrorField" colspan="2"> + <span class="ErrorFieldContent"> <html:errors property="agentMaxQuietTimeAllowedVal"/></span> + </td> + </tr> +</logic:messagesPresent> +<logic:messagesNotPresent property="agentMaxQuietTimeAllowedVal"> + <tr> + <td class="BlockContent" colspan="2"> + </td> + </tr> +</logic:messagesNotPresent> + </table> + </td> + </tr> + <tr> + <td class="BlockLabel"><fmt:message key="admin.settings.EnableAgentAutoUpdate"/></td> + <td class="BlockContent"> + <table cellpadding="0" cellspacing="4" border="0"> + <tr> + <td align="left"><html:radio property="enableAgentAutoUpdate" value="true"/><fmt:message key="yesno.true"/></td> + <td align="left"><html:radio property="enableAgentAutoUpdate" value="false"/><fmt:message key="yesno.false"/></td> + </tr> + </table> + </td> + </tr> + +<hq:authorization permission="superuser"> + <tr> + <td class="BlockLabel"><fmt:message key="admin.settings.EnableDebugMode"/></td> + <td class="BlockContent"> + <table cellpadding="0" cellspacing="4" border="0"> + <tr> + <td align="left"><html:radio property="enableDebugMode" value="true"/><fmt:message key="yesno.true"/></td> + <td align="left"><html:radio property="enableDebugMode" value="false"/><fmt:message key="yesno.false"/></td> + </tr> + </table> + </td> + </tr> +</hq:authorization> + +</table>
commit 1e10fbe07f2d55aa118baffbaec4e02127983ff5 Author: Jay Shaughnessy jshaughn@redhat.com Date: Tue Jun 29 16:33:27 2010 -0400
Work to perform rhq tag release script in its own branch
diff --git a/release.sh b/release.sh index 2722eda..c4b9e46 100755 --- a/release.sh +++ b/release.sh @@ -286,7 +286,6 @@ cat <<EOF >"${MAVEN_SETTINGS_FILE}" </settings> EOF
- # Clone and/or checkout the source from git.
if [ -d "$WORKING_DIR" ]; then @@ -328,15 +327,42 @@ if [ ! -d "$WORKING_DIR" ]; then fi
-# If the specified tag already exists remotely and we're in production mode, then abort. If it exists and we're in test mode, then we'll delete it after we've had a successful dry run of release:prepare and are ready to tag. +# If the specified tag already exists then abort. It should not exist since production runs should have +# unique tags and test runs should have been done in a temporary branch
EXISTING_REMOTE_TAG=`git ls-remote --tags origin "$RELEASE_TAG"` -if [ -n "$EXISTING_REMOTE_TAG" ] && [ "$MODE" = "production" ]; then - abort "A remote tag named $RELEASE_TAG already exists - aborting, since we are in production mode..." +if [ -n "$EXISTING_REMOTE_TAG" ]; then + abort "A remote tag named $RELEASE_TAG already exists - aborting, perhaps a bad build configuration..." fi
-# Run a test build before tagging. This will also publish the snapshot artifacts to the local repo to "bootstrap" the repo. +# if this is a test build then create a temporary build branch off of RELEASE_BRANCH. This allows checkins to +# continue in RELEASE_BRANCH without affecting the release plugin work, which will fail if the branch contents +# change before it completes. +if [ "$MODE" = "production" ]; then + BUILD_BRANCH="${RELEASE_BRANCH}" +else + BUILD_BRANCH="${RELEASE_BRANCH}-test-build" +# delete the branch if it exists, so we can recreate it fresh + EXISTING_BUILD_BRANCH=`git ls-remote --heads origin "$BUILD_BRANCH"` + if [ "$EXISTING_REMOTE_TAG" ]; then + echo "Deleting remote branch origin/$BUILD_BRANCH" + git branch -D -r "origin/$BUILD_BRANCH" + echo "Deleting local branch $BUILD_BRANCH" + git branch -D "$BUILD_BRANCH" + fi + echo "Creating and checking out local branch $BUILD_BRANCH from $RELEASE_BRANCH" + git checkout -b "$BUILD_BRANCH" + echo "Creating remote branch $BUILD_BRANCH" + git push origin "$BUILD_BRANCH" +fi + + +# We should now have the build_branch checked out +echo "Current Branch is $BUILD_BRANCH" + + +# Run a test build before tagging. This will publish the snapshot artifacts to the local repo to "bootstrap" the repo.
echo "Building project to ensure tests pass and to bootstrap local Maven repo (this will take about 15-30 minutes)..." # NOTE: There is no need to do a mvn clean below, since we just did either a clone or clean checkout above. @@ -347,42 +373,26 @@ echo "Test build succeeded!"
# Clean up the snapshot jars produced by the test build from module target dirs. - echo "Cleaning up snapshot jars produced by test build from module target dirs..." mvn clean $MAVEN_ARGS [ "$?" -ne 0 ] && abort "Failed to cleanup snbapshot jars produced by test build from module target dirs. Please see above Maven output for details, fix any issues, then try again."
-# Do a dry run of tagging the release. +# If this is a production build perform a dry run of tagging the release. Skip this for test builds to reduce the +# build time
-echo "Doing a dry run of tagging the release..." -mvn release:prepare $MAVEN_ARGS -DreleaseVersion=$RELEASE_VERSION -DdevelopmentVersion=$DEVELOPMENT_VERSION -Dresume=false -Dtag=$RELEASE_TAG "-DpreparationGoals=install $MAVEN_ARGS -Dmaven.test.skip=true -Ddbsetup-do-not-check-schema=true" -DdryRun=true -[ "$?" -ne 0 ] && abort "Tagging dry run failed. Please see above Maven output for details, fix any issues, then try again." -mvn release:clean $MAVEN_ARGS -[ "$?" -ne 0 ] && abort "Failed to cleanup release plugin working files from tagging dry run. Please see above Maven output for details, fix any issues, then try again." -echo -echo "Tagging dry run succeeded!" - - -# If there's an existing remote tag, and we didn't abort earlier, we must be in test mode, so we can safely delete it before we call mvn release:prepare to recreate it. - -if [ -n "$EXISTING_REMOTE_TAG" ]; then - echo "A remote tag named $RELEASE_TAG already exists - deleting it, since we are in test mode..." - git push origin ":refs/tags/$RELEASE_TAG" - [ "$?" -ne 0 ] && abort "Failed to delete remote tag ($RELEASE_TAG)." -fi - - -# See if the specified tag already exists locally - if so, delete it (even if in production mode). -EXISTING_LOCAL_TAG=`git tag -l "$RELEASE_TAG"` -if [ -n "$EXISTING_LOCAL_TAG" ]; then - echo "A local tag named $RELEASE_TAG already exists - deleting it..." - git tag -d "$RELEASE_TAG" - [ "$?" -ne 0 ] && abort "Failed to delete local tag ($RELEASE_TAG)." +if [ "$MODE" = "production" ]; then + echo "Doing a dry run of tagging the release..." + mvn release:prepare $MAVEN_ARGS -DreleaseVersion=$RELEASE_VERSION -DdevelopmentVersion=$DEVELOPMENT_VERSION -Dresume=false -Dtag=$RELEASE_TAG "-DpreparationGoals=install $MAVEN_ARGS -Dmaven.test.skip=true -Ddbsetup-do-not-check-schema=true" -DdryRun=true + [ "$?" -ne 0 ] && abort "Tagging dry run failed. Please see above Maven output for details, fix any issues, then try again." + mvn release:clean $MAVEN_ARGS + [ "$?" -ne 0 ] && abort "Failed to cleanup release plugin working files from tagging dry run. Please see above Maven output for details, fix any issues, then try again." + echo + echo "Tagging dry run succeeded!" fi
-# If the dry run succeeded, tag it for real. +# If the dry run was skipped or succeeded, tag it for real.
echo "Tagging the release..." mvn release:prepare $MAVEN_ARGS -DreleaseVersion=$RELEASE_VERSION -DdevelopmentVersion=$DEVELOPMENT_VERSION -Dresume=false -Dtag=$RELEASE_TAG "-DpreparationGoals=install $MAVEN_ARGS -Dmaven.test.skip=true -Ddbsetup-do-not-check-schema=true" -DdryRun=false -Dusername=$GIT_USERNAME
commit 436507fb74a475f4c1161becf06c5331c7ae9fbf Author: Jay Shaughnessy jshaughn@redhat.com Date: Tue Jun 29 16:50:31 2010 -0400
LT commit
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/admin/config/GeneralPropertiesConfigForm.jsp b/modules/enterprise/gui/portal-war/src/main/webapp/admin/config/GeneralPropertiesConfigForm.jsp index 7b91970..2c8a8a2 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/admin/config/GeneralPropertiesConfigForm.jsp +++ b/modules/enterprise/gui/portal-war/src/main/webapp/admin/config/GeneralPropertiesConfigForm.jsp @@ -1,121 +1,121 @@ -<%@ page language="java" %> -<%@ page errorPage="/common/Error.jsp" %> - -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> -<%@ taglib uri="http://jakarta.apache.org/struts/tags-html-el" prefix="html" %> -<%@ taglib uri="http://jakarta.apache.org/struts/tags-tiles" prefix="tiles" %> -<%@ taglib uri="http://jakarta.apache.org/struts/tags-logic" prefix="logic" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="/WEB-INF/tld/hq.tld" prefix="hq" %> - -<script src="<html:rewrite page="/js/"/>functions.js" type="text/javascript"></script> -<link rel=stylesheet href="<html:rewrite page="/css/"/>win.css" type="text/css"> - -<hq:constant - classname="org.rhq.enterprise.gui.legacy.Constants" - symbol="MINUTES_LABEL" var="CONST_MINUTES" /> -<hq:constant - classname="org.rhq.enterprise.gui.legacy.Constants" - symbol="HOURS_LABEL" var="CONST_HOURS" /> -<hq:constant - classname="org.rhq.enterprise.gui.legacy.Constants" - symbol="DAYS_LABEL" var="CONST_DAYS" /> - -<!-- BASE SERVER CONFIG TITLE --> -<tiles:insert definition=".header.tab"> - <tiles:put name="tabKey" value="admin.settings.BaseConfigTab"/> -</tiles:insert> -<!-- / --> - -<!-- BASE SERVER CONFIG CONTENTS --> -<table width="100%" cellpadding="0" cellspacing="0" border="0"> - <tr> - <td width="45%" class="BlockLabel"><fmt:message key="admin.settings.BaseURL"/></td> - <td width="55%" class="BlockContent"><html:text size="31" property="baseUrl" /></td> - </tr> - <tr> - <td class="BlockLabel"><fmt:message key="admin.settings.AgentMaxQuietTimeAllowed"/></td> - <td class="BlockContent"> - <table width="100%" cellpadding="0" cellspacing="0" border="0"> - <tr> -<logic:messagesPresent property="agentMaxQuietTimeAllowedVal"> - <td class="ErrorField"> - <html:text size="2" property="agentMaxQuietTimeAllowedVal" /> - </td> - <td class="ErrorField" width="100%"> - <html:select property="agentMaxQuietTimeAllowed"> - <html:option value="${CONST_MINUTES}"><fmt:message key="admin.settings.Minutes"/></html:option> - </html:select> - </td> -</logic:messagesPresent> -<logic:messagesNotPresent property="agentMaxQuietTimeAllowedVal"> - <td class="BlockContent"> - <html:text size="2" property="agentMaxQuietTimeAllowedVal" /> - </td> - <td class="BlockContent" width="100%"> - <html:select property="agentMaxQuietTimeAllowed"> - <html:option value="${CONST_MINUTES}"><fmt:message key="admin.settings.Minutes"/></html:option> - </html:select> - </td> -</logic:messagesNotPresent> - </tr> -<logic:messagesPresent property="agentMaxQuietTimeAllowedVal"> - <tr> - <td class="ErrorField" colspan="2"> - <span class="ErrorFieldContent"> <html:errors property="agentMaxQuietTimeAllowedVal"/></span> - </td> - </tr> -</logic:messagesPresent> -<logic:messagesNotPresent property="agentMaxQuietTimeAllowedVal"> - <tr> - <td class="BlockContent" colspan="2"> - </td> - </tr> -</logic:messagesNotPresent> - </table> - </td> - </tr> - <tr> - <td class="BlockLabel"><fmt:message key="admin.settings.EnableAgentAutoUpdate"/></td> - <td class="BlockContent"> - <table cellpadding="0" cellspacing="4" border="0"> - <tr> - <td align="left"><html:radio property="enableAgentAutoUpdate" value="true"/><fmt:message key="yesno.true"/></td> - <td align="left"><html:radio property="enableAgentAutoUpdate" value="false"/><fmt:message key="yesno.false"/></td> - </tr> - </table> - </td> - </tr> - -<hq:authorization permission="superuser"> - <tr> - <td class="BlockLabel"><fmt:message key="admin.settings.EnableDebugMode"/></td> - <td class="BlockContent"> - <table cellpadding="0" cellspacing="4" border="0"> - <tr> - <td align="left"><html:radio property="enableDebugMode" value="true"/><fmt:message key="yesno.true"/></td> - <td align="left"><html:radio property="enableDebugMode" value="false"/><fmt:message key="yesno.false"/></td> - </tr> - </table> - </td> - </tr> -</hq:authorization> - -<fmt:message var="productName" key="product.shortName" /> -<c:if test="${productName eq 'RHQ'}"> -<hq:authorization permission="superuser"> - <tr> - <td class="BlockLabel"><fmt:message key="admin.settings.EnableExperimentalFeatures"/></td> - <td class="BlockContent"> - <table cellpadding="0" cellspacing="4" border="0"> - <tr> - <td align="left"><html:radio property="enableExperimentalFeatures" value="true"/><fmt:message key="yesno.true"/></td> - <td align="left"><html:radio property="enableExperimentalFeatures" value="false"/><fmt:message key="yesno.false"/></td> - </tr> - </table> - </td> - </tr> -</hq:authorization> -</c:if> - -</table> +<%@ page language="java" %> +<%@ page errorPage="/common/Error.jsp" %> + +<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> +<%@ taglib uri="http://jakarta.apache.org/struts/tags-html-el" prefix="html" %> +<%@ taglib uri="http://jakarta.apache.org/struts/tags-tiles" prefix="tiles" %> +<%@ taglib uri="http://jakarta.apache.org/struts/tags-logic" prefix="logic" %> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/tld/hq.tld" prefix="hq" %> + +<script src="<html:rewrite page="/js/"/>functions.js" type="text/javascript"></script> +<link rel=stylesheet href="<html:rewrite page="/css/"/>win.css" type="text/css"> + +<hq:constant + classname="org.rhq.enterprise.gui.legacy.Constants" + symbol="MINUTES_LABEL" var="CONST_MINUTES" /> +<hq:constant + classname="org.rhq.enterprise.gui.legacy.Constants" + symbol="HOURS_LABEL" var="CONST_HOURS" /> +<hq:constant + classname="org.rhq.enterprise.gui.legacy.Constants" + symbol="DAYS_LABEL" var="CONST_DAYS" /> + +<!-- BASE SERVER CONFIG TITLE --> +<tiles:insert definition=".header.tab"> + <tiles:put name="tabKey" value="admin.settings.BaseConfigTab"/> +</tiles:insert> +<!-- / --> + +<!-- BASE SERVER CONFIG CONTENTS --> +<table width="100%" cellpadding="0" cellspacing="0" border="0"> + <tr> + <td width="45%" class="BlockLabel"><fmt:message key="admin.settings.BaseURL"/></td> + <td width="55%" class="BlockContent"><html:text size="31" property="baseUrl" /></td> + </tr> + <tr> + <td class="BlockLabel"><fmt:message key="admin.settings.AgentMaxQuietTimeAllowed"/></td> + <td class="BlockContent"> + <table width="100%" cellpadding="0" cellspacing="0" border="0"> + <tr> +<logic:messagesPresent property="agentMaxQuietTimeAllowedVal"> + <td class="ErrorField"> + <html:text size="2" property="agentMaxQuietTimeAllowedVal" /> + </td> + <td class="ErrorField" width="100%"> + <html:select property="agentMaxQuietTimeAllowed"> + <html:option value="${CONST_MINUTES}"><fmt:message key="admin.settings.Minutes"/></html:option> + </html:select> + </td> +</logic:messagesPresent> +<logic:messagesNotPresent property="agentMaxQuietTimeAllowedVal"> + <td class="BlockContent"> + <html:text size="2" property="agentMaxQuietTimeAllowedVal" /> + </td> + <td class="BlockContent" width="100%"> + <html:select property="agentMaxQuietTimeAllowed"> + <html:option value="${CONST_MINUTES}"><fmt:message key="admin.settings.Minutes"/></html:option> + </html:select> + </td> +</logic:messagesNotPresent> + </tr> +<logic:messagesPresent property="agentMaxQuietTimeAllowedVal"> + <tr> + <td class="ErrorField" colspan="2"> + <span class="ErrorFieldContent"> <html:errors property="agentMaxQuietTimeAllowedVal"/></span> + </td> + </tr> +</logic:messagesPresent> +<logic:messagesNotPresent property="agentMaxQuietTimeAllowedVal"> + <tr> + <td class="BlockContent" colspan="2"> + </td> + </tr> +</logic:messagesNotPresent> + </table> + </td> + </tr> + <tr> + <td class="BlockLabel"><fmt:message key="admin.settings.EnableAgentAutoUpdate"/></td> + <td class="BlockContent"> + <table cellpadding="0" cellspacing="4" border="0"> + <tr> + <td align="left"><html:radio property="enableAgentAutoUpdate" value="true"/><fmt:message key="yesno.true"/></td> + <td align="left"><html:radio property="enableAgentAutoUpdate" value="false"/><fmt:message key="yesno.false"/></td> + </tr> + </table> + </td> + </tr> + +<hq:authorization permission="superuser"> + <tr> + <td class="BlockLabel"><fmt:message key="admin.settings.EnableDebugMode"/></td> + <td class="BlockContent"> + <table cellpadding="0" cellspacing="4" border="0"> + <tr> + <td align="left"><html:radio property="enableDebugMode" value="true"/><fmt:message key="yesno.true"/></td> + <td align="left"><html:radio property="enableDebugMode" value="false"/><fmt:message key="yesno.false"/></td> + </tr> + </table> + </td> + </tr> +</hq:authorization> + +<fmt:message var="productName" key="product.shortName" /> +<c:if test="${productName eq 'RHQ'}"> +<hq:authorization permission="superuser"> + <tr> + <td class="BlockLabel"><fmt:message key="admin.settings.EnableExperimentalFeatures"/></td> + <td class="BlockContent"> + <table cellpadding="0" cellspacing="4" border="0"> + <tr> + <td align="left"><html:radio property="enableExperimentalFeatures" value="true"/><fmt:message key="yesno.true"/></td> + <td align="left"><html:radio property="enableExperimentalFeatures" value="false"/><fmt:message key="yesno.false"/></td> + </tr> + </table> + </td> + </tr> +</hq:authorization> +</c:if> + +</table>
commit fd5b4d0d7b17c983ef5424a372baab9e3fdabf6f Author: Jay Shaughnessy jshaughn@redhat.com Date: Tue Jun 29 16:33:27 2010 -0400
Work to perform rhq tag release script in its own branch
diff --git a/release.sh b/release.sh index 2722eda..c4b9e46 100755 --- a/release.sh +++ b/release.sh @@ -286,7 +286,6 @@ cat <<EOF >"${MAVEN_SETTINGS_FILE}" </settings> EOF
- # Clone and/or checkout the source from git.
if [ -d "$WORKING_DIR" ]; then @@ -328,15 +327,42 @@ if [ ! -d "$WORKING_DIR" ]; then fi
-# If the specified tag already exists remotely and we're in production mode, then abort. If it exists and we're in test mode, then we'll delete it after we've had a successful dry run of release:prepare and are ready to tag. +# If the specified tag already exists then abort. It should not exist since production runs should have +# unique tags and test runs should have been done in a temporary branch
EXISTING_REMOTE_TAG=`git ls-remote --tags origin "$RELEASE_TAG"` -if [ -n "$EXISTING_REMOTE_TAG" ] && [ "$MODE" = "production" ]; then - abort "A remote tag named $RELEASE_TAG already exists - aborting, since we are in production mode..." +if [ -n "$EXISTING_REMOTE_TAG" ]; then + abort "A remote tag named $RELEASE_TAG already exists - aborting, perhaps a bad build configuration..." fi
-# Run a test build before tagging. This will also publish the snapshot artifacts to the local repo to "bootstrap" the repo. +# if this is a test build then create a temporary build branch off of RELEASE_BRANCH. This allows checkins to +# continue in RELEASE_BRANCH without affecting the release plugin work, which will fail if the branch contents +# change before it completes. +if [ "$MODE" = "production" ]; then + BUILD_BRANCH="${RELEASE_BRANCH}" +else + BUILD_BRANCH="${RELEASE_BRANCH}-test-build" +# delete the branch if it exists, so we can recreate it fresh + EXISTING_BUILD_BRANCH=`git ls-remote --heads origin "$BUILD_BRANCH"` + if [ "$EXISTING_REMOTE_TAG" ]; then + echo "Deleting remote branch origin/$BUILD_BRANCH" + git branch -D -r "origin/$BUILD_BRANCH" + echo "Deleting local branch $BUILD_BRANCH" + git branch -D "$BUILD_BRANCH" + fi + echo "Creating and checking out local branch $BUILD_BRANCH from $RELEASE_BRANCH" + git checkout -b "$BUILD_BRANCH" + echo "Creating remote branch $BUILD_BRANCH" + git push origin "$BUILD_BRANCH" +fi + + +# We should now have the build_branch checked out +echo "Current Branch is $BUILD_BRANCH" + + +# Run a test build before tagging. This will publish the snapshot artifacts to the local repo to "bootstrap" the repo.
echo "Building project to ensure tests pass and to bootstrap local Maven repo (this will take about 15-30 minutes)..." # NOTE: There is no need to do a mvn clean below, since we just did either a clone or clean checkout above. @@ -347,42 +373,26 @@ echo "Test build succeeded!"
# Clean up the snapshot jars produced by the test build from module target dirs. - echo "Cleaning up snapshot jars produced by test build from module target dirs..." mvn clean $MAVEN_ARGS [ "$?" -ne 0 ] && abort "Failed to cleanup snbapshot jars produced by test build from module target dirs. Please see above Maven output for details, fix any issues, then try again."
-# Do a dry run of tagging the release. +# If this is a production build perform a dry run of tagging the release. Skip this for test builds to reduce the +# build time
-echo "Doing a dry run of tagging the release..." -mvn release:prepare $MAVEN_ARGS -DreleaseVersion=$RELEASE_VERSION -DdevelopmentVersion=$DEVELOPMENT_VERSION -Dresume=false -Dtag=$RELEASE_TAG "-DpreparationGoals=install $MAVEN_ARGS -Dmaven.test.skip=true -Ddbsetup-do-not-check-schema=true" -DdryRun=true -[ "$?" -ne 0 ] && abort "Tagging dry run failed. Please see above Maven output for details, fix any issues, then try again." -mvn release:clean $MAVEN_ARGS -[ "$?" -ne 0 ] && abort "Failed to cleanup release plugin working files from tagging dry run. Please see above Maven output for details, fix any issues, then try again." -echo -echo "Tagging dry run succeeded!" - - -# If there's an existing remote tag, and we didn't abort earlier, we must be in test mode, so we can safely delete it before we call mvn release:prepare to recreate it. - -if [ -n "$EXISTING_REMOTE_TAG" ]; then - echo "A remote tag named $RELEASE_TAG already exists - deleting it, since we are in test mode..." - git push origin ":refs/tags/$RELEASE_TAG" - [ "$?" -ne 0 ] && abort "Failed to delete remote tag ($RELEASE_TAG)." -fi - - -# See if the specified tag already exists locally - if so, delete it (even if in production mode). -EXISTING_LOCAL_TAG=`git tag -l "$RELEASE_TAG"` -if [ -n "$EXISTING_LOCAL_TAG" ]; then - echo "A local tag named $RELEASE_TAG already exists - deleting it..." - git tag -d "$RELEASE_TAG" - [ "$?" -ne 0 ] && abort "Failed to delete local tag ($RELEASE_TAG)." +if [ "$MODE" = "production" ]; then + echo "Doing a dry run of tagging the release..." + mvn release:prepare $MAVEN_ARGS -DreleaseVersion=$RELEASE_VERSION -DdevelopmentVersion=$DEVELOPMENT_VERSION -Dresume=false -Dtag=$RELEASE_TAG "-DpreparationGoals=install $MAVEN_ARGS -Dmaven.test.skip=true -Ddbsetup-do-not-check-schema=true" -DdryRun=true + [ "$?" -ne 0 ] && abort "Tagging dry run failed. Please see above Maven output for details, fix any issues, then try again." + mvn release:clean $MAVEN_ARGS + [ "$?" -ne 0 ] && abort "Failed to cleanup release plugin working files from tagging dry run. Please see above Maven output for details, fix any issues, then try again." + echo + echo "Tagging dry run succeeded!" fi
-# If the dry run succeeded, tag it for real. +# If the dry run was skipped or succeeded, tag it for real.
echo "Tagging the release..." mvn release:prepare $MAVEN_ARGS -DreleaseVersion=$RELEASE_VERSION -DdevelopmentVersion=$DEVELOPMENT_VERSION -Dresume=false -Dtag=$RELEASE_TAG "-DpreparationGoals=install $MAVEN_ARGS -Dmaven.test.skip=true -Ddbsetup-do-not-check-schema=true" -DdryRun=false -Dusername=$GIT_USERNAME
commit c90347b67a11980287c0acce0156b4b7e2a93af8 Author: Jay Shaughnessy jshaughn@redhat.com Date: Tue Jun 29 16:18:41 2010 -0400
more script work IN PROGRESS
diff --git a/etc/samples/provisioning/sample-cli/scripts/cli-1-createBundle.js b/etc/samples/provisioning/sample-cli/scripts/cli-1-createBundle.js index 5c8d36a..05f8b79 100644 --- a/etc/samples/provisioning/sample-cli/scripts/cli-1-createBundle.js +++ b/etc/samples/provisioning/sample-cli/scripts/cli-1-createBundle.js @@ -22,10 +22,17 @@ */
/** - * This sample script shows how to create a Bundle by uploading an existing Bundle Distribution file. - * The Bundle uses the Ant Bundle Type provided with RHQ. + * This sample script shows how to create a Bundle by uploading an existing + * Bundle Distribution file. The Bundle uses the Ant Bundle Type provided with + * RHQ. + * <pre> * Prerequisites: - * - The "Ant Bundle Handler Server" resource must be in inventory on the target platforms + * none + * + * Usage: + * 1) start the CLI (can be downloaded from the GUI, Administration->Downloads, RHQ Client) + * 2) login user password serverHost serverPort + * 3) exec <path>/cli-1-createBundle.js */
var bundleName = 'test-bundle-upgrade-ant'; @@ -33,23 +40,17 @@ var bundleDistroV1Path = '../resources/sample-bundle-v1.zip';
// delete the test bundle if it exists var bc = new BundleCriteria(); -bc.addFilterName( bundleName ); -var bundles = BundleManager.findBundlesByCriteria( bc ); -if ( null != bundles && bundles.size() > 0 ) { - print( "\nDeleting sample bundle [" + bundleName + "] to re-run sample scripts...") - BundleManager.deleteBundle( bundles.get(0).getId() ); +bc.addFilterName(bundleName); +var bundles = BundleManager.findBundlesByCriteria(bc); +if (null != bundles && bundles.size() > 0) { + print("\nDeleting sample bundle [" + bundleName + "] to re-run sample scripts...") + BundleManager.deleteBundle(bundles.get(0).getId()); }
// create bundleVersion 1.0 for the sample bundle var distributionFile = new java.io.File(bundleDistroV1Path); distributionFile = new java.io.File(distributionFile.getAbsolutePath()); Assert.assertTrue(distributionFile.exists(), "Missing ant bundle distribution file: " + distributionFile); -var bundleVersion1 = BundleManager.createBundleVersionViaFile( distributionFile ); - -print( "\nCreated Bundle [" + bundleVersion1 + "]!") - - - - - +var bundleVersion1 = BundleManager.createBundleVersionViaFile(distributionFile);
+print("\nCreated Bundle [" + bundleVersion1 + "]!")
commit db911f971bb286fe600c4257b85f917bb3227004 Author: Joseph Marques joseph@redhat.com Date: Tue Jun 29 15:33:19 2010 -0400
BZ-607898: fix for sending alert notifications with multiple direct email addresses
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/plugin/pc/alert/AlertSender.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/plugin/pc/alert/AlertSender.java index 02183f6..5a958b1 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/plugin/pc/alert/AlertSender.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/plugin/pc/alert/AlertSender.java @@ -118,9 +118,13 @@ public abstract class AlertSender<T extends ServerPluginComponent> { * where '|' delimits all elements as well as wraps * the entire expression. */ - @SuppressWarnings("unchecked") public static <T> List<T> unfence(String fencedData, Class<T> type) { - String[] elements = fencedData.split("\|"); + return unfence(fencedData, type, "\|"); + } + + @SuppressWarnings("unchecked") + public static <T> List<T> unfence(String fencedData, Class<T> type, String delimiter) { + String[] elements = fencedData.split(delimiter); List<T> results = new ArrayList<T>(elements.length);
if (Integer.class.equals(type)) { diff --git a/modules/enterprise/server/plugins/alert-email/src/main/java/org/rhq/enterprise/server/plugins/alertEmail/EmailSender.java b/modules/enterprise/server/plugins/alert-email/src/main/java/org/rhq/enterprise/server/plugins/alertEmail/EmailSender.java index 773d99a..81b1383 100644 --- a/modules/enterprise/server/plugins/alert-email/src/main/java/org/rhq/enterprise/server/plugins/alertEmail/EmailSender.java +++ b/modules/enterprise/server/plugins/alert-email/src/main/java/org/rhq/enterprise/server/plugins/alertEmail/EmailSender.java @@ -40,7 +40,7 @@ public class EmailSender extends AlertSender { return new SenderResult(ResultState.FAILURE, "No email address given"); }
- List<String> emails = AlertSender.unfence(emailAddressString, String.class); + List<String> emails = AlertSender.unfence(emailAddressString, String.class, ","); return new SenderResult(ResultState.DEFERRED_EMAIL, "Sending to addresses: " + emails, emails); }
commit 23886a27cb17cf2ab0f707ea37c3a2bba2778b91 Author: Joseph Marques joseph@redhat.com Date: Tue Jun 29 15:12:56 2010 -0400
only display the "experiemtnal features" toggle for community distributions/builds
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/admin/config/GeneralPropertiesConfigForm.jsp b/modules/enterprise/gui/portal-war/src/main/webapp/admin/config/GeneralPropertiesConfigForm.jsp index 068b230..7b91970 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/admin/config/GeneralPropertiesConfigForm.jsp +++ b/modules/enterprise/gui/portal-war/src/main/webapp/admin/config/GeneralPropertiesConfigForm.jsp @@ -101,6 +101,8 @@ </tr> </hq:authorization>
+<fmt:message var="productName" key="product.shortName" /> +<c:if test="${productName eq 'RHQ'}"> <hq:authorization permission="superuser"> <tr> <td class="BlockLabel"><fmt:message key="admin.settings.EnableExperimentalFeatures"/></td> @@ -114,5 +116,6 @@ </td> </tr> </hq:authorization> +</c:if>
</table>
commit ec2e38d1704d1eafd6b3349acfe66f10aff322d7 Merge: 1d53a6b... 533337f... Author: Heiko W. Rupp hwr@redhat.com Date: Tue Jun 29 20:24:15 2010 +0200
Merge branch 'release-3.0.0' of ssh://git.fedorahosted.org/git/rhq/rhq into release-3.0.0
commit 1d53a6b65e5d51456c57728c9d07bb36093df7b0 Author: Heiko W. Rupp hwr@redhat.com Date: Tue Jun 29 20:23:00 2010 +0200
BZ 560803 add index on measurement_def.numeric_type BZ 535686 add index on call time value.end_time to speed up purges
diff --git a/modules/core/dbutils/pom.xml b/modules/core/dbutils/pom.xml index 92ae1d2..d536ce6 100644 --- a/modules/core/dbutils/pom.xml +++ b/modules/core/dbutils/pom.xml @@ -22,7 +22,7 @@
<properties> <scm.module.path>modules/core/dbutils/</scm.module.path> - <db.schema.version>2.87</db.schema.version> + <db.schema.version>2.88</db.schema.version> </properties>
<dependencies> @@ -95,9 +95,9 @@
db = project.properties.db if (db == 'dev') { - database = project.properties['rhq.dev.ds.db-name'] - } - // This is a bit of a temporary hack to work around + database = project.properties['rhq.dev.ds.db-name'] + } + // This is a bit of a temporary hack to work around // https://cvs.codehaus.org/browse/GMAVEN-46 which results in // groovy scripts not being able to get the correct values of // build properties that are overridden on the command line. @@ -105,7 +105,7 @@ // trying to use a database named rhqupgrade. else if (project.properties['upgrade.db']) { database = 'rhqupgrade' - } + } else { database = project.properties['rhq.test.ds.db-name'] } @@ -275,7 +275,7 @@ <goal>run</goal> </goals> </execution> - + <execution> <!-- This execution will abort the build if the database schema is not up to date. diff --git a/modules/core/dbutils/src/main/scripts/dbsetup/measurement-schema.xml b/modules/core/dbutils/src/main/scripts/dbsetup/measurement-schema.xml index 38c759c..8108cb9 100644 --- a/modules/core/dbutils/src/main/scripts/dbsetup/measurement-schema.xml +++ b/modules/core/dbutils/src/main/scripts/dbsetup/measurement-schema.xml @@ -34,6 +34,9 @@ <field ref="NAME"/> <field ref="RAW_NUMERIC_TYPE"/> </index> + <index name="RHQ_METRIC_DEF_NT_IDX"> + <field ref="NUMERIC_TYPE"/> + </index> </table>
@@ -86,7 +89,7 @@ <field ref="TIME_STAMP"/> </primaryKey> </constraint> - + <index name="RHQ_MEAS_DATA_1H_TIME_IDX"> <field ref="TIME_STAMP"/> </index> @@ -108,7 +111,7 @@ <field ref="TIME_STAMP"/> </primaryKey> </constraint> - + <index name="RHQ_MEAS_DATA_6H_TIME_IDX"> <field ref="TIME_STAMP"/> </index> @@ -166,6 +169,9 @@ <column name="MAXIMUM" type="DOUBLE" required="true"/> <column name="TOTAL" type="DOUBLE" required="true"/> <column name="COUNT" type="LONG" required="true"/> + <index name="RHQ_CT_DA_VA_END_TIM_IDX"> + <field ref="END_TIME"/> + </index> </table>
diff --git a/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml b/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml index 1d3bd04..daf68f4 100644 --- a/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml +++ b/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml @@ -17,13 +17,13 @@ Update Version: ${target.schema.version} </echo>
- <dbupgrade jdbcUrl="${jdbc.url}" - jdbcUser="${jdbc.user}" - jdbcPassword="${jdbc.password}" + <dbupgrade jdbcUrl="${jdbc.url}" + jdbcUser="${jdbc.user}" + jdbcPassword="${jdbc.password}" valueColumn="PROPERTY_VALUE" - table="RHQ_SYSTEM_CONFIG" - keyColumn="PROPERTY_KEY" - keyMatch="DB_SCHEMA_VERSION" + table="RHQ_SYSTEM_CONFIG" + keyColumn="PROPERTY_KEY" + keyMatch="DB_SCHEMA_VERSION" targetSchemaVersion="${target.schema.version}">
<schemaSpec version="2.0"> @@ -31,7 +31,7 @@ </schemaSpec>
<schemaSpec version="2.1"> - <!-- Keep the columnType VARCHAR2, but increase size; + <!-- Keep the columnType VARCHAR2, but increase size; (see note for RHQ_ALERT_CONDITION table in alert-schema.xml for more ifo) --> <schema-alterColumn table="RHQ_ALERT_CONDITION" column="OPTION_STATUS" columnType="VARCHAR2" precision="256" /> </schemaSpec> @@ -1805,7 +1805,7 @@ </schemaSpec>
<schemaSpec version="2.61"> - <schema-createSequence name="RHQ_DISTRIBUTION_TYPE_ID_SEQ" initial="10001" /> + <schema-createSequence name="RHQ_DISTRIBUTION_TYPE_ID_SEQ" initial="10001" /> <schema-directSQL> <statement> CREATE TABLE RHQ_DISTRIBUTION_TYPE ( ID INTEGER PRIMARY KEY ) @@ -1829,12 +1829,12 @@ </schema-directSQL>
<schema-createSequence name="RHQ_DISTRIBUTION_ID_SEQ" initial="10001" /> - <schema-directSQL> + <schema-directSQL> <statement desc="Creating table RHQ_DISTRIBUTION"> CREATE TABLE RHQ_DISTRIBUTION ( ID INTEGER PRIMARY KEY ) </statement> </schema-directSQL> - <schema-alterColumn table="RHQ_DISTRIBUTION" column="ID" nullable="false" /> + <schema-alterColumn table="RHQ_DISTRIBUTION" column="ID" nullable="false" /> <schema-addColumn table="RHQ_DISTRIBUTION" column="DISTRIBUTION_TYPE_ID" columnType="INTEGER" /> <schema-alterColumn table="RHQ_DISTRIBUTION" column="DISTRIBUTION_TYPE_ID" nullable="false" /> <schema-addColumn table="RHQ_DISTRIBUTION" column="LABEL" precision="64" columnType="VARCHAR2" /> @@ -1897,7 +1897,7 @@ </schemaSpec>
<schemaSpec version="2.63"> - <schema-addColumn table="RHQ_REPO" column="IS_CANDIDATE" columnType="BOOLEAN" /> + <schema-addColumn table="RHQ_REPO" column="IS_CANDIDATE" columnType="BOOLEAN" />
<schema-directSQL> <statement targetDBVendor="postgresql"> @@ -1907,7 +1907,7 @@ UPDATE RHQ_REPO SET IS_CANDIDATE = 0 </statement> </schema-directSQL> - <schema-alterColumn table="RHQ_REPO" column="IS_CANDIDATE" nullable="false" /> + <schema-alterColumn table="RHQ_REPO" column="IS_CANDIDATE" nullable="false" /> </schemaSpec>
<!-- Generic tagging support --> @@ -1932,7 +1932,7 @@ CREATE TABLE RHQ_DISTRIBUTION_FILE (ID INTEGER PRIMARY KEY) </statement> </schema-directSQL> - <schema-alterColumn table="RHQ_DISTRIBUTION_FILE" column="ID" nullable="false" /> + <schema-alterColumn table="RHQ_DISTRIBUTION_FILE" column="ID" nullable="false" /> <schema-addColumn table="RHQ_DISTRIBUTION_FILE" column="DISTRIBUTION_ID" columnType="INTEGER" /> <schema-alterColumn table="RHQ_DISTRIBUTION_FILE" column="DISTRIBUTION_ID" nullable="false" /> <schema-addColumn table="RHQ_DISTRIBUTION_FILE" column="RELATIVE_FILENAME" precision="256" columnType="VARCHAR2" /> @@ -2358,8 +2358,8 @@ </statement> <statement desc="Creating RHQ_BUNDLE_TYPE unique constraint"> CREATE UNIQUE INDEX RHQ_BUNDLE_TYPE_UNIQUE ON RHQ_BUNDLE_TYPE (name) - </statement> - </schema-directSQL> + </statement> + </schema-directSQL>
<!-- RHQ_BUNDLE --> <schema-createSequence name="RHQ_BUNDLE_ID_SEQ" initial="10001" /> @@ -2396,12 +2396,12 @@ ADD CONSTRAINT RHQ_B_PACKAGE_TYPE_ID_FK FOREIGN KEY (PACKAGE_TYPE_ID) REFERENCES RHQ_PACKAGE_TYPE (ID) - </statement> + </statement> <statement desc="Creating RHQ_BUNDLE unique constraint"> CREATE UNIQUE INDEX RHQ_BUNDLE_UNIQUE ON RHQ_BUNDLE (bundle_type_id, name) - </statement> + </statement> </schema-directSQL> - + <!-- RHQ_BUNDLE_VERSION --> <schema-createSequence name="RHQ_BUNDLE_VERSION_ID_SEQ" initial="10001" /> <schema-directSQL> @@ -2439,7 +2439,7 @@ CREATE UNIQUE INDEX RHQ_BUNDLE_VERSION_UNIQUE ON RHQ_BUNDLE_VERSION (bundle_id, name, version) </statement> </schema-directSQL> - + <!-- RHQ_BUNDLE_VERSION_REPO --> <schema-directSQL> <statement desc="Creating table RHQ_BUNDLE_VERSION_REPO"> @@ -2466,7 +2466,7 @@ REFERENCES RHQ_REPO (ID) </statement> </schema-directSQL> - + <!-- RHQ_BUNDLE_FILE --> <schema-createSequence name="RHQ_BUNDLE_FILE_ID_SEQ" initial="10001" /> <schema-directSQL> @@ -2479,7 +2479,7 @@ <schema-alterColumn table="RHQ_BUNDLE_FILE" column="BUNDLE_VERSION_ID" nullable="FALSE" /> <schema-addColumn table="RHQ_BUNDLE_FILE" column="PACKAGE_VERSION_ID" columnType="INTEGER" /> <schema-alterColumn table="RHQ_BUNDLE_FILE" column="PACKAGE_VERSION_ID" nullable="FALSE" /> - + <schema-directSQL> <statement desc="Creating RHQ_BUNDLE_FILE foreign key relation to RHQ_BUNDLE_VERSION"> ALTER TABLE RHQ_BUNDLE_FILE @@ -2494,7 +2494,7 @@ REFERENCES RHQ_PACKAGE_VERSION (ID) </statement> </schema-directSQL> - + <!-- RHQ_BUNDLE_DESTINATION --> <schema-createSequence name="RHQ_BUNDLE_DESTINATION_ID_SEQ" initial="10001" /> <schema-directSQL> @@ -2513,9 +2513,9 @@ <schema-addColumn table="RHQ_BUNDLE_DESTINATION" column="BUNDLE_ID" columnType="INTEGER" /> <schema-alterColumn table="RHQ_BUNDLE_DESTINATION" column="BUNDLE_ID" nullable="FALSE" /> <schema-addColumn table="RHQ_BUNDLE_DESTINATION" column="GROUP_ID" columnType="INTEGER" /> - <schema-alterColumn table="RHQ_BUNDLE_DESTINATION" column="GROUP_ID" nullable="FALSE" /> + <schema-alterColumn table="RHQ_BUNDLE_DESTINATION" column="GROUP_ID" nullable="FALSE" /> <schema-addColumn table="RHQ_BUNDLE_DESTINATION" column="DEPLOY_DIR" columnType="VARCHAR2" precision="256" /> - <schema-alterColumn table="RHQ_BUNDLE_DESTINATION" column="DEPLOY_DIR" nullable="FALSE" /> + <schema-alterColumn table="RHQ_BUNDLE_DESTINATION" column="DEPLOY_DIR" nullable="FALSE" />
<schema-directSQL> <statement desc="Creating RHQ_BUNDLE_DESTINATION foreign key relation to RHQ_BUNDLE"> @@ -2535,7 +2535,7 @@ ON RHQ_BUNDLE_DESTINATION (bundle_id, group_id, deploy_dir) </statement> </schema-directSQL> - + <!-- RHQ_BUNDLE_DEPLOYMENT --> <schema-createSequence name="RHQ_BUNDLE_DEPLOYMENT_ID_SEQ" initial="10001" /> <schema-directSQL> @@ -2561,8 +2561,8 @@ <schema-addColumn table="RHQ_BUNDLE_DEPLOYMENT" column="ERROR_MESSAGE" columnType="LONGVARCHAR" /> <schema-addColumn table="RHQ_BUNDLE_DEPLOYMENT" column="SUBJECT_NAME" columnType="VARCHAR2" precision="255" /> <schema-addColumn table="RHQ_BUNDLE_DEPLOYMENT" column="IS_LIVE" columnType="BOOLEAN" /> - <schema-alterColumn table="RHQ_BUNDLE_DEPLOYMENT" column="IS_LIVE" nullable="FALSE" /> - <schema-addColumn table="RHQ_BUNDLE_DEPLOYMENT" column="REPLACED_BUNDLE_DEPLOYMENT_ID" columnType="INTEGER" /> + <schema-alterColumn table="RHQ_BUNDLE_DEPLOYMENT" column="IS_LIVE" nullable="FALSE" /> + <schema-addColumn table="RHQ_BUNDLE_DEPLOYMENT" column="REPLACED_BUNDLE_DEPLOYMENT_ID" columnType="INTEGER" />
<schema-directSQL> <statement desc="Creating RHQ_BUNDLE_DEPLOYMENT foreign key relation to RHQ_BUNDLE_VERSION"> @@ -2576,7 +2576,7 @@ ADD CONSTRAINT RHQ_BD_B_DESTINATION_ID_FK FOREIGN KEY (BUNDLE_DESTINATION_ID) REFERENCES RHQ_BUNDLE_DESTINATION (ID) - </statement> + </statement> <statement desc="Creating RHQ_BUNDLE_DEPLOYMENT foreign key relation to RHQ_CONFIG"> ALTER TABLE RHQ_BUNDLE_DEPLOYMENT ADD CONSTRAINT RHQ_BD_CONFIG_ID_FK @@ -2588,9 +2588,9 @@ ADD CONSTRAINT RHQ_BD_B_DEPLOYMENT_ID_FK FOREIGN KEY (REPLACED_BUNDLE_DEPLOYMENT_ID) REFERENCES RHQ_BUNDLE_DEPLOYMENT (ID) - </statement> - </schema-directSQL> - + </statement> + </schema-directSQL> + <!-- RHQ_BUNDLE_RES_DEPLOY --> <schema-createSequence name="RHQ_BUNDLE_RES_DEPLOY_ID_SEQ" initial="10001" /> <schema-directSQL> @@ -2622,11 +2622,11 @@ REFERENCES RHQ_RESOURCE (ID) </statement> <statement desc="Creating RHQ_BUNDLE_RES_DEPLOY unique constraint on def-resource mapping"> - CREATE UNIQUE INDEX RHQ_BUNDLE_RES_DEPLOY_MAP_IX + CREATE UNIQUE INDEX RHQ_BUNDLE_RES_DEPLOY_MAP_IX ON RHQ_BUNDLE_RES_DEPLOY (BUNDLE_DEPLOYMENT_ID, RESOURCE_ID) </statement> </schema-directSQL> - + <!-- RHQ_BUNDLE_RES_DEP_HIST --> <schema-createSequence name="RHQ_BUNDLE_RES_DEP_HIST_ID_SEQ" initial="10001" /> <schema-directSQL> @@ -2644,7 +2644,7 @@ <schema-alterColumn table="RHQ_BUNDLE_RES_DEP_HIST" column="ACTION" nullable="FALSE" /> <schema-addColumn table="RHQ_BUNDLE_RES_DEP_HIST" column="INFO" columnType="VARCHAR2" precision="512" /> <schema-alterColumn table="RHQ_BUNDLE_RES_DEP_HIST" column="INFO" nullable="FALSE" /> - <schema-addColumn table="RHQ_BUNDLE_RES_DEP_HIST" column="CATEGORY" columnType="VARCHAR2" precision="32" /> + <schema-addColumn table="RHQ_BUNDLE_RES_DEP_HIST" column="CATEGORY" columnType="VARCHAR2" precision="32" /> <schema-addColumn table="RHQ_BUNDLE_RES_DEP_HIST" column="STATUS" columnType="VARCHAR2" precision="16" /> <schema-alterColumn table="RHQ_BUNDLE_RES_DEP_HIST" column="STATUS" nullable="FALSE" /> <schema-addColumn table="RHQ_BUNDLE_RES_DEP_HIST" column="MESSAGE" columnType="LONGVARCHAR" /> @@ -2656,7 +2656,7 @@ FOREIGN KEY (BUNDLE_RES_DEPLOY_ID) REFERENCES RHQ_BUNDLE_RES_DEPLOY (ID) </statement> - </schema-directSQL> + </schema-directSQL> </schemaSpec>
<schemaSpec version="2.79"> @@ -2683,11 +2683,11 @@ ALTER TABLE RHQ_PACKAGE_BITS DROP COLUMN BITS </statement> <statement desc="Change bytea column to oid in postgres."> - ALTER TABLE RHQ_PACKAGE_BITS RENAME COLUMN NEWOID TO BITS + ALTER TABLE RHQ_PACKAGE_BITS RENAME COLUMN NEWOID TO BITS </statement> </schema-directSQL> </schemaSpec> - + <schemaSpec version="2.82"> <schema-directSQL> <statement desc="Creating table RHQ_SAVED_SEARCH"> @@ -2744,8 +2744,8 @@ CREATE TABLE RHQ_SUBJECT_ROLE_LDAP_MAP ( SUBJECT_ID INTEGER, ROLE_ID INTEGER ) </statement> <statement desc="Creating composite PK for RHQ_SUBJECT_ROLE_LDAP_MAP"> - ALTER TABLE RHQ_SUBJECT_ROLE_LDAP_MAP - ADD CONSTRAINT RHQ_SUBJECT_ROLE_LDAP_MAP_PK + ALTER TABLE RHQ_SUBJECT_ROLE_LDAP_MAP + ADD CONSTRAINT RHQ_SUBJECT_ROLE_LDAP_MAP_PK PRIMARY KEY ( SUBJECT_ID, ROLE_ID ) </statement> <statement desc="Creating FK relation to RHQ_SUBJECT table for SUBJECT_ID column"> @@ -2763,7 +2763,7 @@ </schema-directSQL> <schema-alterColumn table="RHQ_SUBJECT_ROLE_LDAP_MAP" column="SUBJECT_ID" nullable="FALSE" /> <schema-alterColumn table="RHQ_SUBJECT_ROLE_LDAP_MAP" column="ROLE_ID" nullable="FALSE" /> - + <!-- Fixing ldap group authz by adding remaining mapping elements left out(RHQ_ROLE_LDAP_GROUP) --> <!-- RHQ_ROLE_LDAP_GROUP --> <schema-createSequence name="RHQ_ROLE_LDAP_GROUP_ID_SEQ" initial="10001" /> @@ -2771,11 +2771,11 @@ <statement desc="Creating table RHQ_ROLE_LDAP_GROUP"> CREATE TABLE RHQ_ROLE_LDAP_GROUP ( ID INTEGER PRIMARY KEY, ROLE_ID INTEGER ) </statement> - </schema-directSQL> + </schema-directSQL> <schema-alterColumn table="RHQ_ROLE_LDAP_GROUP" column="ID" nullable="FALSE" /> <schema-alterColumn table="RHQ_ROLE_LDAP_GROUP" column="ROLE_ID" nullable="FALSE" /> <schema-addColumn table="RHQ_ROLE_LDAP_GROUP" column="LDAP_GROUP_NAME" columnType="VARCHAR2" precision="128" /> - + <schema-directSQL> <statement> ALTER TABLE RHQ_ROLE_LDAP_GROUP @@ -2787,7 +2787,7 @@ CREATE UNIQUE INDEX RHQ_ROLE_LDAP_GROUP_IDX ON RHQ_ROLE_LDAP_GROUP ( LDAP_GROUP_NAME, ROLE_ID ) </statement> - </schema-directSQL> + </schema-directSQL> </schemaSpec>
<!-- Remove the old tagging system --> @@ -2949,7 +2949,7 @@ REFERENCES RHQ_TAGGING ( ID ) </statement> </schema-directSQL> - + <schema-directSQL> <statement> CREATE TABLE RHQ_TAGGING_BUNDLE_DEST_MAP ( BUNDLE_DESTINATION_ID INTEGER ) @@ -2976,9 +2976,9 @@ FOREIGN KEY ( TAG_ID ) REFERENCES RHQ_TAGGING ( ID ) </statement> - </schema-directSQL> + </schema-directSQL> </schemaSpec> - + <schemaSpec version="2.86"> <schema-directSQL> <statement desc="Adding MANAGE_BUNDLE permission to overlord"> @@ -2989,18 +2989,28 @@ </statement> </schema-directSQL> </schemaSpec> - + <schemaSpec version="2.87"> <schema-directSQL> <statement desc="Drop non-unique RHQ_RES_TYPE_IDX_PLG_NAME index"> DROP INDEX RHQ_RES_TYPE_IDX_PLG_NAME - </statement> - <statement desc="Recreate RHQ_RES_TYPE_IDX_PLG_NAME index as unique"> + </statement> + <statement desc="Recreate RHQ_RES_TYPE_IDX_PLG_NAME index as unique"> CREATE UNIQUE INDEX RHQ_RES_TYPE_IDX_PLG_NAME ON RHQ_RESOURCE_TYPE (name, plugin) </statement> </schema-directSQL> </schemaSpec> - + + <schemaSpec version="2.88"> + <schema-directSQL> + <statement desc="Add end time index on call time data to speed up purges"> + CREATE INDEX RHQ_CT_DA_VA_END_TIM_IDX ON RHQ_CALLTIME_DATA_VALUE (end_time) + </statement> + <statement desc="Add index on measurement definition numeric type"> + CREATE INDEX RHQ_METRIC_DEF_NT_IDX ON RHQ_MEASUREMENT_DEF (numeric_type) + </statement> + </schema-directSQL> + </schemaSpec> </dbupgrade> </target> </project>
commit 533337f5538f8fea1d09cf2abf4c458106c306c3 Merge: b2bd54e... 344be2f... Author: Ian Springer ian.springer@redhat.com Date: Tue Jun 29 13:57:58 2010 -0400
Merge branch 'release-3.0.0' of ssh://git.fedorahosted.org/git/rhq/rhq into release-3.0.0
commit b2bd54e4a6ac3475cc66a65ae3e4088d7ee28be3 Author: Ian Springer ian.springer@redhat.com Date: Tue Jun 29 13:55:12 2010 -0400
fix so vertical scrolling works correctly for content within RichFaces tabPanels on Resource Configuration > Current tab and Admin > Plugins pages when on IE 6/7 (https://bugzilla.redhat.com/show_bug.cgi?id=601744)
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/entity/layout/main.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/entity/layout/main.xhtml index aa9f90d..7629fd7 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/entity/layout/main.xhtml +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/entity/layout/main.xhtml @@ -49,7 +49,7 @@ id - the id of the Resource being accessed </div> </div> <div id="centerContent" class="column" style="width: #{100 - UserPreferencesUIBean.leftResourceNavState}%;"> - <div id="centerContentWrapper" class="content-right"> + <div id="centerContentWrapper" class="content-right" style="position: relative"> <div style="left: 0; right: 0; height: 100%;"> <ui:insert name="summary"><p>Default Entity Summary</p></ui:insert> <ui:insert name="tabBar"><p>Default Entity TabBar</p></ui:insert> diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/layout/main.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/layout/main.xhtml index 00666c1..5031f75 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/layout/main.xhtml +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/layout/main.xhtml @@ -15,7 +15,7 @@ <ui:composition template="/rhq/layout/main-layout.xhtml">
<ui:define name="body-area"> - <div id="content-full" style="width: 100%; height: 100%; overflow: auto;"> + <div id="content-full" style="width: 100%; height: 100%; overflow: auto; position: relative"> <h:panelGroup id="Breadcrumb" layout="block" rendered="#{empty disableBreadcrumbs}"> <ui:insert name="breadcrumbs">Default Full Screen Breadcrumbs</ui:insert> </h:panelGroup>
commit 344be2ff459e13af30832c48d201ac7714fe229b Author: Joseph Marques joseph@redhat.com Date: Tue Jun 29 13:47:21 2010 -0400
BZ-609158: hide "alerting on call-time data" and "group-wise call-time data view" behind the "experimental feature" conditional rendering feature
diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/common/monitor/alerts/config/DefinitionFormPrepareAction.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/common/monitor/alerts/config/DefinitionFormPrepareAction.java index ccf46dd..81648a2 100644 --- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/common/monitor/alerts/config/DefinitionFormPrepareAction.java +++ b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/common/monitor/alerts/config/DefinitionFormPrepareAction.java @@ -131,7 +131,8 @@ public abstract class DefinitionFormPrepareAction extends TilesAction { if (defForm.getTraits().size() > 0 && triggerNotSet) defForm.getCondition(0).setTrigger("onTrait");
- request.setAttribute("showCalltimeMetrics", defForm.getCalltimeMetrics().size() > 0); + boolean isExperimental = LookupUtil.getSystemManager().isExperimentalFeaturesEnabled(); + request.setAttribute("showCalltimeMetrics", isExperimental && defForm.getCalltimeMetrics().size() > 0); if (defForm.getCalltimeMetrics().size() > 0 && triggerNotSet) defForm.getCondition(0).setTrigger("onCallTime");
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/autogroup/layout/main.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/autogroup/layout/main.xhtml index 5a01f31..13d1786 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/autogroup/layout/main.xhtml +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/autogroup/layout/main.xhtml @@ -81,7 +81,9 @@ THIS TEXT WILL BE REMOVED AS WELL. <onc:subtab name="Graphs" url="/rhq/autogroup/monitor/graphs.xhtml" /> <onc:subtab name="Tables" url="/rhq/autogroup/monitor/tables.xhtml" /> <onc:subtab name="Schedules" url="/rhq/autogroup/monitor/schedules.xhtml" /> - <onc:subtab name="Response" url="/rhq/autogroup/monitor/response.xhtml" /> + <c:if test="#{GlobalPermissionsUIBean.experimental}"> + <onc:subtab name="Response" url="/rhq/autogroup/monitor/response.xhtml" /> + </c:if> </onc:tab>
<onc:tab name="Events" image="/images/icons/Events_grey_16.png"> diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/layout/main.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/layout/main.xhtml index ac806e8..08b9d77 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/layout/main.xhtml +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/layout/main.xhtml @@ -58,7 +58,9 @@ THIS TEXT WILL BE REMOVED AS WELL. <onc:subtab name="Graphs" url="/rhq/group/monitor/graphs.xhtml"/> <onc:subtab name="Tables" url="/rhq/group/monitor/tables.xhtml"/> <onc:subtab name="Schedules" url="/rhq/group/monitor/schedules.xhtml"/> - <onc:subtab name="Response" url="/rhq/group/monitor/response.xhtml"/> + <c:if test="#{GlobalPermissionsUIBean.experimental}"> + <onc:subtab name="Response" url="/rhq/group/monitor/response.xhtml"/> + </c:if> </onc:tab>
<onc:tab name="Inventory" image="/images/icons/Inventory_grey_16.png">
commit 332fe9ad8a96d058eee69285cd7960f119b9d6d5 Author: Joseph Marques joseph@redhat.com Date: Tue Jun 29 13:45:07 2010 -0400
support a GLOBAL bit for toggling on/off experimental features in the product
diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/admin/config/SystemConfigForm.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/admin/config/SystemConfigForm.java index 237858d..48694d8 100644 --- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/admin/config/SystemConfigForm.java +++ b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/admin/config/SystemConfigForm.java @@ -37,6 +37,7 @@ public class SystemConfigForm extends BaseValidatorForm { private String agentMaxQuietTimeAllowedVal = "0"; private boolean enableAgentAutoUpdate = false; private boolean enableDebugMode = false; + private boolean enableExperimentalFeatures = false; private String helpUserId = ""; private String helpPassword = ""; private String maintIntervalVal = "0"; @@ -75,6 +76,7 @@ public class SystemConfigForm extends BaseValidatorForm { buf.append(" agentMaxQuietTimeAllowed=").append(agentMaxQuietTimeAllowed); buf.append(" enableAgentAutoUpdate=").append(enableAgentAutoUpdate); buf.append(" enableDebugMode=").append(enableDebugMode); + buf.append(" enableExperimentalFeatures=").append(enableExperimentalFeatures); buf.append(" helpUserId=").append(helpUserId); buf.append(" helpPassword=").append(helpPassword); buf.append(" ldapEnabled=").append(ldapEnabled); @@ -103,6 +105,7 @@ public class SystemConfigForm extends BaseValidatorForm { agentMaxQuietTimeAllowedVal = null; enableAgentAutoUpdate = true; enableDebugMode = false; + enableExperimentalFeatures = false; helpUserId = ""; helpPassword = ""; maintInterval = ""; @@ -165,6 +168,16 @@ public class SystemConfigForm extends BaseValidatorForm { } enableDebugMode = Boolean.valueOf(enableDebugModeStr).booleanValue();
+ String enableExperimentalFeaturesStr = prop.getProperty(RHQConstants.EnableExperimentalFeatures); + if (enableExperimentalFeaturesStr == null) { + enableExperimentalFeaturesStr = Boolean.FALSE.toString(); + } else if (enableExperimentalFeaturesStr.equals("0")) { + enableExperimentalFeaturesStr = Boolean.FALSE.toString(); + } else if (enableExperimentalFeaturesStr.equals("1")) { + enableExperimentalFeaturesStr = Boolean.TRUE.toString(); + } + enableExperimentalFeatures = Boolean.valueOf(enableExperimentalFeaturesStr).booleanValue(); + String maintIntervalValStr = prop.getProperty(RHQConstants.DataMaintenance); Long maintIntervalLong = new Long(maintIntervalValStr); maintInterval = findTimeUnit(maintIntervalLong.longValue()); @@ -292,6 +305,8 @@ public class SystemConfigForm extends BaseValidatorForm {
prop.setProperty(RHQConstants.EnableDebugMode, String.valueOf(enableDebugMode));
+ prop.setProperty(RHQConstants.EnableExperimentalFeatures, String.valueOf(enableExperimentalFeatures)); + long maintIntervalLong = convertToMillisecond(Integer.parseInt(maintIntervalVal), maintInterval); prop.setProperty(RHQConstants.DataMaintenance, String.valueOf(maintIntervalLong));
@@ -383,6 +398,14 @@ public class SystemConfigForm extends BaseValidatorForm { this.enableDebugMode = b; }
+ public boolean getEnableExperimentalFeatures() { + return this.enableExperimentalFeatures; + } + + public void setEnableExperimentalFeatures(boolean b) { + this.enableExperimentalFeatures = b; + } + public String getMaintIntervalVal() { return maintIntervalVal; } diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/authorization/GlobalPermissionsUIBean.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/authorization/GlobalPermissionsUIBean.java index 9cf263f..9f6ffd0 100644 --- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/authorization/GlobalPermissionsUIBean.java +++ b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/authorization/GlobalPermissionsUIBean.java @@ -23,7 +23,6 @@ import java.util.Set; import org.rhq.core.domain.auth.Subject; import org.rhq.core.domain.authz.Permission; import org.rhq.enterprise.gui.util.EnterpriseFacesContextUtility; -import org.rhq.enterprise.server.RHQConstants; import org.rhq.enterprise.server.system.SystemManagerLocal; import org.rhq.enterprise.server.util.LookupUtil;
@@ -34,6 +33,7 @@ public class GlobalPermissionsUIBean { private boolean settings; private boolean isSuperuser; private boolean isDebugMode; + private boolean isExperimental;
public GlobalPermissionsUIBean() { Subject user = EnterpriseFacesContextUtility.getSubject(); @@ -48,7 +48,8 @@ public class GlobalPermissionsUIBean { }
SystemManagerLocal systemManager = LookupUtil.getSystemManager(); - isDebugMode = Boolean.valueOf(systemManager.getSystemConfiguration().getProperty(RHQConstants.EnableDebugMode)); + isDebugMode = systemManager.isDebugModeEnabled(); + isExperimental = systemManager.isExperimentalFeaturesEnabled(); }
public boolean isSuperuser() { @@ -59,6 +60,10 @@ public class GlobalPermissionsUIBean { return isDebugMode; }
+ public boolean isExperimental() { + return isExperimental; + } + public boolean isSecurity() { return security; } diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/common/framework/ServerInfoUIBean.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/common/framework/ServerInfoUIBean.java index 2c9104d..efe3dba 100644 --- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/common/framework/ServerInfoUIBean.java +++ b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/common/framework/ServerInfoUIBean.java @@ -18,19 +18,23 @@ */ package org.rhq.enterprise.gui.common.framework;
+import java.util.TimeZone; + +import javax.faces.component.UIComponent; + import com.sun.facelets.Facelet; + import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; + import org.jboss.seam.Component; + import org.rhq.core.util.maven.MavenArtifactNotFoundException; import org.rhq.core.util.maven.MavenArtifactProperties; import org.rhq.enterprise.server.RHQConstants; import org.rhq.enterprise.server.system.SystemManagerLocal; import org.rhq.enterprise.server.util.LookupUtil;
-import javax.faces.component.UIComponent; -import java.util.TimeZone; - /** * A JSF managed bean that exposes various general server information - RHQ version, timezone, etc. * @@ -50,6 +54,12 @@ public class ServerInfoUIBean { return Boolean.valueOf(systemManager.getSystemConfiguration().getProperty(RHQConstants.EnableDebugMode)); }
+ public boolean isExperimentalFeaturesEnabled() { + SystemManagerLocal systemManager = LookupUtil.getSystemManager(); + return Boolean.valueOf(systemManager.getSystemConfiguration().getProperty( + RHQConstants.EnableExperimentalFeatures)); + } + public String getFacesVersion() { return getManifestVersion(UIComponent.class); } @@ -81,11 +91,10 @@ public class ServerInfoUIBean { if (pkg != null) { version = pkg.getImplementationVersion(); if (version == null) { - version = pkg.getSpecificationVersion(); + version = pkg.getSpecificationVersion(); } } - } - catch (Exception e) { + } catch (Exception e) { log.error("Error while looking up manifest version for " + clazz + ".", e); } return version; diff --git a/modules/enterprise/gui/portal-war/src/main/webapp-filtered/WEB-INF/classes/ApplicationResources.properties b/modules/enterprise/gui/portal-war/src/main/webapp-filtered/WEB-INF/classes/ApplicationResources.properties index 2d93e15..2510400 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp-filtered/WEB-INF/classes/ApplicationResources.properties +++ b/modules/enterprise/gui/portal-war/src/main/webapp-filtered/WEB-INF/classes/ApplicationResources.properties @@ -591,6 +591,7 @@ admin.settings.BaseURL=GUI Console URL: admin.settings.AgentMaxQuietTimeAllowed=Agent Max Quiet Time Allowed: admin.settings.EnableAgentAutoUpdate=Enable Agent Auto-Updates: admin.settings.EnableDebugMode=Enable Debug Mode: +admin.settings.EnableExperimentalFeatures=Enable Experimental Features: admin.settings.HttpProxyUrl=HTTP Proxy URL: admin.settings.HttpProxyPort=HTTP Proxy Port: admin.settings.SenderEmailAddressLabel=From Email Address: diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/admin/config/GeneralPropertiesConfigForm.jsp b/modules/enterprise/gui/portal-war/src/main/webapp/admin/config/GeneralPropertiesConfigForm.jsp index 30df9ef..068b230 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/admin/config/GeneralPropertiesConfigForm.jsp +++ b/modules/enterprise/gui/portal-war/src/main/webapp/admin/config/GeneralPropertiesConfigForm.jsp @@ -101,4 +101,18 @@ </tr> </hq:authorization>
+<hq:authorization permission="superuser"> + <tr> + <td class="BlockLabel"><fmt:message key="admin.settings.EnableExperimentalFeatures"/></td> + <td class="BlockContent"> + <table cellpadding="0" cellspacing="4" border="0"> + <tr> + <td align="left"><html:radio property="enableExperimentalFeatures" value="true"/><fmt:message key="yesno.true"/></td> + <td align="left"><html:radio property="enableExperimentalFeatures" value="false"/><fmt:message key="yesno.false"/></td> + </tr> + </table> + </td> + </tr> +</hq:authorization> + </table> diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/RHQConstants.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/RHQConstants.java index 7bb1d72..6712b3d 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/RHQConstants.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/RHQConstants.java @@ -63,10 +63,12 @@ public class RHQConstants { // Are we allowing automatic AgentUpdate binary download public static final String EnableAgentAutoUpdate = "ENABLE_AGENT_AUTO_UPDATE";
- - // Are we rendering a special "debug" menu for administrators? + // Are we rendering a special "debug" menu for administrators? public static final String EnableDebugMode = "ENABLE_DEBUG_MODE";
+ // Are we rendering features which are marked as experimental for this installation? + public static final String EnableExperimentalFeatures = "ENABLE_EXPERIMENTAL_FEATURES"; + // How long do we keep data compressed in hourly intervals? public static final String DataPurge1Hour = "CAM_DATA_PURGE_1H";
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/SystemManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/SystemManagerBean.java index edb5059..4dc713b 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/SystemManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/SystemManagerBean.java @@ -267,7 +267,7 @@ public class SystemManagerBean implements SystemManagerLocal, SystemManagerRemot // to support Oracle (whose booleans may be 1 or 0) transform the boolean settings properly String propName = prop.getPropertyKey(); if (RHQConstants.EnableAgentAutoUpdate.equals(propName) || RHQConstants.EnableDebugMode.equals(propName) - || RHQConstants.DataReindex.equals(propName)) { + || RHQConstants.DataReindex.equals(propName) || RHQConstants.EnableExperimentalFeatures.equals(propName)) { String booleanValue = prop.getPropertyValue(); if ("0".equals(booleanValue)) { prop.setPropertyValue(Boolean.FALSE.toString()); @@ -473,8 +473,8 @@ public class SystemManagerBean implements SystemManagerLocal, SystemManagerRemot // we need to undeploy it first - on windows the files are locked and can't be renamed until undeployed ObjectName name = ObjectNameFactory.create("jboss.system:service=MainDeployer"); MBeanServerConnection mbs = MBeanServerLocator.locateJBoss(); - MainDeployerMBean mbean = (MainDeployerMBean) MBeanServerInvocationHandler.newProxyInstance(mbs, name, - MainDeployerMBean.class, false); + MainDeployerMBean mbean = (MainDeployerMBean) MBeanServerInvocationHandler.newProxyInstance(mbs, + name, MainDeployerMBean.class, false); URL url = deployedInstallWar.toURI().toURL(); String urlString = url.toString().replace("%20", " "); // bug in undeployer doesn't like %20 - it wants a real space ((MainDeployerMBean) mbean).undeploy(urlString); @@ -542,6 +542,23 @@ public class SystemManagerBean implements SystemManagerLocal, SystemManagerRemot } }
+ public boolean isDebugModeEnabled() { + try { + return Boolean.valueOf(getSystemConfiguration().getProperty(RHQConstants.EnableDebugMode, "false")); + } catch (Throwable t) { + return false; // paranoid catch-all + } + } + + public boolean isExperimentalFeaturesEnabled() { + try { + return Boolean.valueOf(getSystemConfiguration().getProperty(RHQConstants.EnableExperimentalFeatures, + "false")); + } catch (Throwable t) { + return false; // paranoid catch-all + } + } + /** * Retrieves the currently active license. Returns null if there is no active license. Otherwise it needs to * propogate the appropriate error back up to the caller, otherwise the error will be masked, and from a UI diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/SystemManagerLocal.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/SystemManagerLocal.java index 18bb904..e339c8b 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/SystemManagerLocal.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/SystemManagerLocal.java @@ -150,6 +150,10 @@ public interface SystemManagerLocal { */ void loadSystemConfigurationCache();
+ boolean isDebugModeEnabled(); + + boolean isExperimentalFeaturesEnabled(); + ////////////////////////////////// // license specific methods follow
commit e0d9d1a44ecd4d42fc681eb0be0302578eb9191a Author: Joseph Marques joseph@redhat.com Date: Tue Jun 29 12:46:16 2010 -0400
do not update the resource type when importing/creating resources. the group category used to be based off of the explicit membership, but that assumption was changed for 1.2.0 release so we could support a compatible left-nav tree with recursive access to descendant for easy authorization. this method only modifies the implicit resource membership, not the explicit, so setResourceType would be a no-op.
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerBean.java index 5e7707d..8e33ca1 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerBean.java @@ -765,8 +765,13 @@ public class ResourceGroupManagerBean implements ResourceGroupManagerLocal, Reso * created, but which initially creates one or more resource groups of size 1; if this happens, the * group will be created as a compatible group, if resources are later added via an inventory sync, and * if this compatible group's membership changes, we need to recalculate the group category + * + * NOTE: this is no longer true. the group category used to be based off of the explicit membership, + * but that assumption was changed for 1.2.0 release so we could support a compatible left-nav + * tree with recursive access to descendant for easy authorization. this method only modifies + * the implicit resource membership, not the explicit, so setResourceType would be a no-op. */ - setResourceType(implicitRecursiveGroupId); + //setResourceType(implicitRecursiveGroupId); } } catch (Exception e) { throw new ResourceGroupUpdateException("Could not add resource[id=" + resource.getId() @@ -923,6 +928,7 @@ public class ResourceGroupManagerBean implements ResourceGroupManagerLocal, Reso }
@SuppressWarnings("unchecked") + @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW) public void setResourceType(int resourceGroupId) throws ResourceGroupDeleteException { Query query = entityManager.createNamedQuery(ResourceType.QUERY_GET_EXPLICIT_RESOURCE_TYPE_COUNTS_BY_GROUP); query.setParameter("groupId", resourceGroupId);
commit 0beacaaa68b779b9677851568ed2e718b5c18d0d Author: Joseph Marques joseph@redhat.com Date: Tue Jun 29 12:44:44 2010 -0400
BZ-608898: prevent deadlock during dynagroup recalculation
* first add/remove resources to the recalculated group, commit that work * then reset the ResourceType on the group as necessary, based off of new membership
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/definition/GroupDefinitionManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/definition/GroupDefinitionManagerBean.java index 9a11216..5570738 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/definition/GroupDefinitionManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/definition/GroupDefinitionManagerBean.java @@ -303,6 +303,14 @@ public class GroupDefinitionManagerBean implements GroupDefinitionManagerLocal { groupDefinitionId, result);
/* + * as a result of recalculation, the membership may have changed such that a group which was previously + * marked as compatible now becomes a mixed group. if that happens, then the GroupCategory needs to be + * updated and any compatible group constructs need to be removed from this group. the following method + * will achieve both of those goals + */ + resourceGroupManager.setResourceType(nextResourceGroupId); + + /* * remove all ids returned from the helper. by the time we're done looping over all * ExpressionEvaluator.Result objects, the remaining objects in managedResourceGroupIds should represent * groups that no longer managed by this definition (either due to an inventory or expression change), and @@ -374,8 +382,6 @@ public class GroupDefinitionManagerBean implements GroupDefinitionManagerLocal { resourceGroupManager.removeResourcesFromGroup(overlord, resourceGroupId, ArrayUtils .unwrapCollection(idsToRemove));
- resourceGroupManager.setResourceType(resourceGroupId); - long endTime = System.currentTimeMillis();
log.debug("calculateGroupMembership_helper took " + (endTime - startTime) + " millis");
commit eaf523492da7127850506e4f5919b4b9ce253e24 Author: Joseph Marques joseph@redhat.com Date: Tue Jun 29 12:43:15 2010 -0400
BZ-608898: when setting the ResourceGroup on an AlertDefinition, do not load existing AlertDefinitions
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/alert/AlertDefinition.java b/modules/core/domain/src/main/java/org/rhq/core/domain/alert/AlertDefinition.java index a64de62..94ae2fe 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/alert/AlertDefinition.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/alert/AlertDefinition.java @@ -518,9 +518,11 @@ public class AlertDefinition implements Serializable {
public void setResourceGroup(ResourceGroup resourceGroup) { this.resourceGroup = resourceGroup; + /* if (this.resourceGroup != null) { this.resourceGroup.getAlertDefinitions().add(this); } + */ }
public ResourceType getResourceType() {
commit 9679c7a712fbeb644d4b01a52e347bba634195b7 Author: Joseph Marques joseph@redhat.com Date: Tue Jun 29 12:42:21 2010 -0400
BZ-608898: when deleting/purging group alert definitions, only load ids
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/AlertDefinitionCriteria.java b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/AlertDefinitionCriteria.java index e553ca8..8eb7efd 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/AlertDefinitionCriteria.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/AlertDefinitionCriteria.java @@ -50,6 +50,7 @@ public class AlertDefinitionCriteria extends Criteria { private Integer filterAlertTemplateResourceTypeId; // requires overrides private String filterAlertTemplateResourceTypeName; // requires overrides private List<Integer> filterResourceIds; // requires overrides + private List<Integer> filterResourceGroupIds; // requires overrides private Boolean filterEnabled; private String filterOperationName; // requires overrides private Boolean filterDeleted; @@ -66,11 +67,12 @@ public class AlertDefinitionCriteria extends Criteria { filterOverrides.put("alertTemplateResourceTypeId", "resourceType.id = ?"); filterOverrides.put("alertTemplateResourceTypeName", "resourceType.name like ?"); filterOverrides.put("resourceIds", "resource.id IN ( ? )"); + filterOverrides.put("resourceGroupIds", "resourceGroup.id IN ( ? )"); filterOverrides.put("operationName", "operationDefinition.name like ?"); }
@Override - public Class getPersistentClass() { + public Class<?> getPersistentClass() { return AlertDefinition.class; }
@@ -106,6 +108,10 @@ public class AlertDefinitionCriteria extends Criteria { this.filterResourceIds = Arrays.asList(filterResourceIds); }
+ public void addFilterResourceGroupIds(Integer... filterResourceGroupIds) { + this.filterResourceGroupIds = Arrays.asList(filterResourceGroupIds); + } + public void addFilterEnabled(Boolean filterEnabled) { this.filterEnabled = filterEnabled; } diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/GroupAlertDefinitionManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/GroupAlertDefinitionManagerBean.java index 57701ce..a2eb45e 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/GroupAlertDefinitionManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/GroupAlertDefinitionManagerBean.java @@ -36,6 +36,7 @@ import org.jboss.annotation.IgnoreDependency;
import org.rhq.core.domain.alert.AlertDefinition; import org.rhq.core.domain.auth.Subject; +import org.rhq.core.domain.criteria.AlertDefinitionCriteria; import org.rhq.core.domain.resource.InventoryStatus; import org.rhq.core.domain.resource.group.ResourceGroup; import org.rhq.core.domain.util.PageControl; @@ -45,6 +46,7 @@ import org.rhq.core.server.PersistenceUtility; import org.rhq.enterprise.server.RHQConstants; import org.rhq.enterprise.server.auth.SubjectManagerLocal; import org.rhq.enterprise.server.resource.group.ResourceGroupManagerLocal; +import org.rhq.enterprise.server.util.CriteriaQueryGenerator;
/** * @author Joseph Marques @@ -330,16 +332,23 @@ public class GroupAlertDefinitionManagerBean implements GroupAlertDefinitionMana
@TransactionAttribute(TransactionAttributeType.REQUIRES_NEW) public void purgeAllGroupAlertDefinitions(Subject subject, int resourceGroupId) { - List<AlertDefinition> groupAlertDefinitions = findGroupAlertDefinitions(subject, resourceGroupId, PageControl - .getUnlimitedInstance()); - - int i = 0; - Integer[] groupAlertDefinitionIds = new Integer[groupAlertDefinitions.size()]; - for (AlertDefinition groupAlertDefinition : groupAlertDefinitions) { - groupAlertDefinitionIds[i++] = groupAlertDefinition.getId(); - } + Integer[] groupAlertDefinitionIdsForResourceGroup = findGroupAlertDefinitionIds(resourceGroupId); + removeGroupAlertDefinitions(subject, groupAlertDefinitionIdsForResourceGroup); + }
- removeGroupAlertDefinitions(subject, groupAlertDefinitionIds); + @SuppressWarnings("unchecked") + private Integer[] findGroupAlertDefinitionIds(int resourceGroupId) { + AlertDefinitionCriteria criteria = new AlertDefinitionCriteria(); + criteria.addFilterResourceGroupIds(resourceGroupId); + criteria.setPageControl(PageControl.getUnlimitedInstance()); + + CriteriaQueryGenerator generator = new CriteriaQueryGenerator(criteria); + generator.alterProjection("alertdefinition.id"); + Query query = generator.getQuery(entityManager); + List<Integer> groupAlertDefinitionIds = query.getResultList(); + + Integer[] results = groupAlertDefinitionIds.toArray(new Integer[groupAlertDefinitionIds.size()]); + return results; }
public void removeGroupAlertDefinitions(Subject subject, int resourceGroupId, int[] resourceIdsToRemove) { @@ -347,13 +356,12 @@ public class GroupAlertDefinitionManagerBean implements GroupAlertDefinitionMana return; }
- List<AlertDefinition> groupAlertDefinitions = findGroupAlertDefinitions(subject, resourceGroupId, PageControl - .getUnlimitedInstance()); + Integer[] groupAlertDefinitionIdsForResourceGroup = findGroupAlertDefinitionIds(resourceGroupId);
List<Integer> allChildrenDefinitionIds = new ArrayList<Integer>(); Subject overlord = subjectManager.getOverlord(); - for (AlertDefinition groupAlertDefinition : groupAlertDefinitions) { - List<Integer> childDefinitions = getChildrenAlertDefinitionIds(subject, groupAlertDefinition.getId()); + for (Integer nextGroupAlertDefinitionId : groupAlertDefinitionIdsForResourceGroup) { + List<Integer> childDefinitions = getChildrenAlertDefinitionIds(subject, nextGroupAlertDefinitionId); allChildrenDefinitionIds.addAll(childDefinitions); alertDefinitionManager.removeAlertDefinitions(overlord, childDefinitions .toArray(new Integer[childDefinitions.size()]));
commit 72f529c71dc2d472a225d84933108a9c836d2da8 Author: Joseph Marques joseph@redhat.com Date: Tue Jun 29 12:34:24 2010 -0400
remove unused dependency
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/AlertDefinitionManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/AlertDefinitionManagerBean.java index 991eb57..a48cd85 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/AlertDefinitionManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/AlertDefinitionManagerBean.java @@ -32,8 +32,6 @@ import javax.persistence.Query; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory;
-import org.jboss.annotation.IgnoreDependency; - import org.rhq.core.domain.alert.AlertCondition; import org.rhq.core.domain.alert.AlertConditionCategory; import org.rhq.core.domain.alert.AlertConditionLog; @@ -76,9 +74,6 @@ public class AlertDefinitionManagerBean implements AlertDefinitionManagerLocal, private AuthorizationManagerLocal authorizationManager; @EJB private AlertDefinitionManagerLocal alertDefinitionManager; - @EJB - @IgnoreDependency - private AlertNotificationManagerLocal alertNotificationManager;
@EJB private StatusManagerLocal agentStatusManager;
commit 636aaf2c1b4b75e02c905416294384de6660b8dc Author: Lukas Krejci lkrejci@redhat.com Date: Mon Jun 28 12:19:55 2010 +0200
BZ 602176 - the timeline is auto-scrollable, so that it displays in full even if it doesn't fit the screen.
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventsView.jsp b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventsView.jsp index 85f8696..e964274 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventsView.jsp +++ b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventsView.jsp @@ -33,6 +33,8 @@ .timeline-band-layer-inner { font-size: smaller; } .table-start-label { font-size: smaller; } </style> + <link rel="stylesheet" type="text/css" media="screen" href="/css/win.css"/> + <link rel="stylesheet" type="text/css" media="screen" href="/css/form-style.css"/> </head> <% int eventId = WebUtility.getOptionalIntRequestParameter(request, "eventId", -1); diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/summary/timeline.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/summary/timeline.xhtml index 1dd2c5c..0fe7d0f 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/summary/timeline.xhtml +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/summary/timeline.xhtml @@ -31,7 +31,7 @@
<h:panelGrid columns="1" width="97%"> <iframe src ="/resource/common/monitor/events/EventsView.jsp?id=#{param.id}" - width="100%" height="550" scrolling="no" frameborder="0" /> + width="100%" height="550" scrolling="auto" frameborder="0" style="min-width: 635px"/> </h:panelGrid>
</rich:panel>
commit c4b841ac57b3d2cc6c0302184d027d499da2375c Author: Joseph Marques joseph@redhat.com Date: Mon Jun 28 23:30:21 2010 -0400
delete obsolete call-time data code
* CallTimeData reports already ensure that (schedule_id, begin_time) is unique
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/CallTimeDataManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/CallTimeDataManagerBean.java index 265c0e7..253765d 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/CallTimeDataManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/CallTimeDataManagerBean.java @@ -88,12 +88,6 @@ public class CallTimeDataManagerBean implements CallTimeDataManagerLocal, CallTi + "(schedule_id, call_destination) " + "SELECT ?, ? FROM RHQ_numbers WHERE i = 42 " + "AND NOT EXISTS (SELECT * FROM " + DATA_KEY_TABLE_NAME + " WHERE schedule_id = ? AND call_destination = ?)";
- /* - private static final String CALLTIME_VALUE_DELETE_SUPERCEDED_STATEMENT = "DELETE FROM " + DATA_VALUE_TABLE_NAME - + " WHERE key_id = " + "(SELECT id FROM " + DATA_KEY_TABLE_NAME - + " WHERE schedule_id = ? AND call_destination = ?) AND begin_time = ?"; - */ - private static final String CALLTIME_VALUE_INSERT_STATEMENT = "INSERT /*+ APPEND */ INTO " + DATA_VALUE_TABLE_NAME + "(id, key_id, begin_time, end_time, minimum, maximum, total, count) " + "SELECT %s, key.id, ?, ?, ?, ?, ?, ? FROM RHQ_numbers num, RHQ_calltime_data_key key WHERE num.i = 42 " @@ -135,32 +129,6 @@ public class CallTimeDataManagerBean implements CallTimeDataManagerLocal, CallTi // First make sure a single row exists in the key table for each reported call destination. callTimeDataManager.insertCallTimeDataKeys(callTimeDataSet);
- /* - * TODO: JM - Is this really needed? Under what circumstances are duplicates generated? Are we presuming - * this is a misbehaving plugin, or a problem at the comm-layer where the same piece of data is delivered - * twice? I'm tentatively removing this because it is a big hit to call-time data reporting performance. - * If, however, evidence is presented that implores us to bring this functionality back, it should be - * implemented by getting rid of the duplicate data points that share the same key_id and begin_time. - * These records can be found with: - * - * SELECT key_id, begin_time, count(id) - * FROM rhq_calltime_data_value - * GROUP BY key_id, begin_time - * HAVING count(id) > 1 - * - * This is functionally equivalent to the CALLTIME_VALUE_DELETE_SUPERCEDED_STATEMENT query, but takes - * advantage of the fact that key_id represents the already-computed pair of schedule_id/destination, thus - * allowing the duplicate-search to be implemented against a single table. - * - * Taking this solution one step further, an appropriate delete statement can be crafted which leverages - * the above concept but deletes all but one of the duplicates (perhaps leaving the record with the - * smallest id/pk). This purge routine can either be grouped in with the rest in DataPurgeJob, or it can - * be implemented as its own quartz job that runs more (or less) frequently, depending on our needs - * (i.e., how often we anticipate duplicates) - */ - // Delete any existing rows that have the same key and begin time as the data about to be inserted. - //callTimeDataManager.deleteRedundantCallTimeDataValues(callTimeDataSet); - // Finally, add the stats themselves to the value table. callTimeDataManager.insertCallTimeDataValues(callTimeDataSet); } @@ -373,55 +341,6 @@ public class CallTimeDataManagerBean implements CallTimeDataManagerLocal, CallTi }
/* - @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW) - public void deleteRedundantCallTimeDataValues(Set<CallTimeData> callTimeDataSet) { - - int[] results; - PreparedStatement ps = null; - Connection conn = null; - - try { - conn = rhqDs.getConnection(); - ps = conn.prepareStatement(CALLTIME_VALUE_DELETE_SUPERCEDED_STATEMENT); - for (CallTimeData callTimeData : callTimeDataSet) { - ps.setInt(1, callTimeData.getScheduleId()); - Set<String> callDestinations = callTimeData.getValues().keySet(); - for (String callDestination : callDestinations) { - ps.setString(2, callDestination); - CallTimeDataValue value = callTimeData.getValues().get(callDestination); - ps.setLong(3, value.getBeginTime()); - ps.addBatch(); - } - } - - results = ps.executeBatch(); - - int deletedRowCount = 0; - for (int i = 0; i < results.length; i++) { - if ((results[i] < 0) && (results[i] != -2)) // oracle returns -2 because it can't count updated rows - { - throw new MeasurementStorageException("Failed to delete redundant call-time data rows - result [" - + results[i] + "] for batch command [" + i + "] is less than 0."); - } - - deletedRowCount += results[i]; - } - - log - .debug("Deleted " - + ((deletedRowCount >= 0) ? deletedRowCount : "?") - + " redundant call-time data value rows that were superceded by data in the measurement report currently being processed."); - } catch (SQLException e) { - logSQLException("Failed to delete redundant call-time data values", e); - } catch (Throwable t) { - log.error("Failed to delete redundant call-time data values", t); - } finally { - JDBCUtil.safeClose(conn, ps, null); - } - } - */ - - /* * internal method, do not expose to the remote API */ @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
commit bff7953bd68384a51ae5d9f8c629f42e3d29d9e6 Author: Joseph Marques joseph@redhat.com Date: Mon Jun 28 23:28:15 2010 -0400
use hints for postgres and oracle to allow faster insertion of call-time data
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/CallTimeDataManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/CallTimeDataManagerBean.java index 5a25f85..265c0e7 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/CallTimeDataManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/CallTimeDataManagerBean.java @@ -21,6 +21,7 @@ package org.rhq.enterprise.server.measurement; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.SQLException; +import java.sql.Statement; import java.util.Date; import java.util.List; import java.util.Set; @@ -44,6 +45,7 @@ import org.rhq.core.db.DatabaseType; import org.rhq.core.db.DatabaseTypeFactory; import org.rhq.core.db.H2DatabaseType; import org.rhq.core.db.OracleDatabaseType; +import org.rhq.core.db.Postgresql83DatabaseType; import org.rhq.core.db.PostgresqlDatabaseType; import org.rhq.core.db.SQLServerDatabaseType; import org.rhq.core.domain.auth.Subject; @@ -78,7 +80,7 @@ public class CallTimeDataManagerBean implements CallTimeDataManagerLocal, CallTi private static final String DATA_VALUE_TABLE_NAME = "RHQ_CALLTIME_DATA_VALUE"; private static final String DATA_KEY_TABLE_NAME = "RHQ_CALLTIME_DATA_KEY";
- private static final String CALLTIME_KEY_INSERT_STATEMENT = "INSERT INTO " + DATA_KEY_TABLE_NAME + private static final String CALLTIME_KEY_INSERT_STATEMENT = "INSERT /*+ APPEND */ INTO " + DATA_KEY_TABLE_NAME + "(id, schedule_id, call_destination) " + "SELECT %s, ?, ? FROM RHQ_numbers WHERE i = 42 " + "AND NOT EXISTS (SELECT * FROM " + DATA_KEY_TABLE_NAME + " WHERE schedule_id = ? AND call_destination = ?)";
@@ -92,7 +94,7 @@ public class CallTimeDataManagerBean implements CallTimeDataManagerLocal, CallTi + " WHERE schedule_id = ? AND call_destination = ?) AND begin_time = ?"; */
- private static final String CALLTIME_VALUE_INSERT_STATEMENT = "INSERT INTO " + DATA_VALUE_TABLE_NAME + private static final String CALLTIME_VALUE_INSERT_STATEMENT = "INSERT /*+ APPEND */ INTO " + DATA_VALUE_TABLE_NAME + "(id, key_id, begin_time, end_time, minimum, maximum, total, count) " + "SELECT %s, key.id, ?, ?, ?, ?, ?, ? FROM RHQ_numbers num, RHQ_calltime_data_key key WHERE num.i = 42 " + "AND key.id = (SELECT id FROM " + DATA_KEY_TABLE_NAME + " WHERE schedule_id = ? AND call_destination = ?)"; @@ -312,6 +314,18 @@ public class CallTimeDataManagerBean implements CallTimeDataManagerLocal, CallTi try { conn = rhqDs.getConnection(); DatabaseType dbType = DatabaseTypeFactory.getDatabaseType(conn); + + if (dbType instanceof Postgresql83DatabaseType) { + Statement st = null; + try { + // Take advantage of async commit here + st = conn.createStatement(); + st.execute("SET synchronous_commit = off"); + } finally { + JDBCUtil.safeClose(st); + } + } + if (dbType instanceof PostgresqlDatabaseType || dbType instanceof OracleDatabaseType || dbType instanceof H2DatabaseType) { String keyNextvalSql = JDBCUtil.getNextValSql(conn, "RHQ_calltime_data_key"); @@ -420,6 +434,18 @@ public class CallTimeDataManagerBean implements CallTimeDataManagerLocal, CallTi try { conn = rhqDs.getConnection(); DatabaseType dbType = DatabaseTypeFactory.getDatabaseType(conn); + + if (dbType instanceof Postgresql83DatabaseType) { + Statement st = null; + try { + // Take advantage of async commit here + st = conn.createStatement(); + st.execute("SET synchronous_commit = off"); + } finally { + JDBCUtil.safeClose(st); + } + } + if (dbType instanceof PostgresqlDatabaseType || dbType instanceof OracleDatabaseType || dbType instanceof H2DatabaseType) { String valueNextvalSql = JDBCUtil.getNextValSql(conn, "RHQ_calltime_data_value");
commit 867c5b0107739274ba8ba196a00941d561eb87c5 Author: Joseph Marques joseph@redhat.com Date: Mon Jun 28 22:05:17 2010 -0400
fix sorting on "total" column for "monitor > response" sub-tab for all entity contexts
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/monitor/response.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/monitor/response.xhtml index b2d9b12..40aabcb 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/monitor/response.xhtml +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/monitor/response.xhtml @@ -115,7 +115,7 @@
rich:column <f:facet name="header"> - <onc:sortableColumnHeader sort="MAX(calltimedatavalue.total)"> + <onc:sortableColumnHeader sort="SUM(calltimedatavalue.total)"> <h:outputText value="Total" /> </onc:sortableColumnHeader> </f:facet>
commit d70c9fe43f3f95ba4611b9eabaae52786721ab94 Author: Joseph Marques joseph@redhat.com Date: Mon Jun 28 22:03:12 2010 -0400
fix JSF navigation rules for sort actions on group "monitor > response" sub-tab
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation-resource-group/measurement-navigation.xml b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation-resource-group/measurement-navigation.xml index 917281b..d7ef174 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation-resource-group/measurement-navigation.xml +++ b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation-resource-group/measurement-navigation.xml @@ -57,14 +57,14 @@ <navigation-case> <!-- catch all navigation-case: if any actions return 'success', go here --> <from-outcome>success</from-outcome> - <to-view-id>/rhq/group/monitor/response.xhtml?parent=#{param.parent}&type=#{param.type}</to-view-id> + <to-view-id>/rhq/group/monitor/response.xhtml?groupId=#{param.groupId}&category=COMPATIBLE</to-view-id> <redirect/> </navigation-case>
<navigation-case> <!-- sorting rule --> <from-outcome>sort</from-outcome> - <to-view-id>/rhq/group/monitor/response.xhtml?parent=#{param.parent}&type=#{param.type}</to-view-id> + <to-view-id>/rhq/group/monitor/response.xhtml?groupId=#{param.groupId}&category=COMPATIBLE</to-view-id> <redirect/> </navigation-case>
commit f4c6a3d30b18e70bdbb16391ade3a1e2907745ca Author: Joseph Marques joseph@redhat.com Date: Mon Jun 28 18:30:19 2010 -0400
lower some measurement schedule logging statements from INFO to DEBUG
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementScheduleManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementScheduleManagerBean.java index 546a020..dc1395e 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementScheduleManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementScheduleManagerBean.java @@ -562,7 +562,9 @@ public class MeasurementScheduleManagerBean implements MeasurementScheduleManage + "SELECT DISTINCT ms.resource.agent.id " // + " FROM MeasurementSchedule ms " // + " WHERE ms.id IN ( " + measurementScheduleSubQuery + " ) "; - log.info("agentsQueryString: " + agentsQueryString); + if (log.isDebugEnabled()) { + log.debug("agentsQueryString: " + agentsQueryString); + } Query agentsQuery = entityManager.createQuery(agentsQueryString); agentIds = agentsQuery.getResultList(); } catch (Throwable t) { @@ -581,7 +583,9 @@ public class MeasurementScheduleManagerBean implements MeasurementScheduleManage + " FROM MeasurementSchedule ms " // + " WHERE ms.id IN ( " + measurementScheduleSubQuery + " ) " // + " AND ms.resource.agent.id = :agentId"; - log.info("scheduleRequestQueryString: " + scheduleRequestQueryString); + if (log.isDebugEnabled()) { + log.debug("scheduleRequestQueryString: " + scheduleRequestQueryString); + } Query scheduleRequestQuery = entityManager.createQuery(scheduleRequestQueryString);
Map<Integer, ResourceMeasurementScheduleRequest> agentRequests = new HashMap<Integer, ResourceMeasurementScheduleRequest>(); @@ -654,12 +658,16 @@ public class MeasurementScheduleManagerBean implements MeasurementScheduleManage + "UPDATE Resource res " // + " SET res.mtime = :now " // + " WHERE res.id IN ( " + resourceSubQuery + " ) "; - log.info("markResourceQueryString: " + markResourceQueryString); + if (log.isDebugEnabled()) { + log.debug("markResourceQueryString: " + markResourceQueryString); + }
Query markResourceQuery = entityManager.createQuery(markResourceQueryString); markResourceQuery.setParameter("now", System.currentTimeMillis()); int affectedRows = markResourceQuery.executeUpdate(); - log.info("Marked " + affectedRows + " for future measurement scheudle update"); + if (log.isDebugEnabled()) { + log.debug("Marked " + affectedRows + " for future measurement scheudle update"); + } } catch (Throwable t) { log.error("Could not notify agents of updates", t); } @@ -717,7 +725,11 @@ public class MeasurementScheduleManagerBean implements MeasurementScheduleManage updateQuery.setParameter("agentId", agentId); updateQuery.setParameter("definitionIds", measurementDefinitionIds); int updateCount = updateQuery.executeUpdate(); - log.info("" + updateCount + " resources mtime fields were updated as a result of this metric template update"); + + if (log.isDebugEnabled()) { + log.debug("" + updateCount + + " resources mtime fields were updated as a result of this metric template update"); + } }
public void updateSchedulesForAutoGroup(Subject subject, int parentResourceId, int childResourceType, @@ -769,7 +781,9 @@ public class MeasurementScheduleManagerBean implements MeasurementScheduleManage try { AgentClient agentClient = LookupUtil.getAgentManager().getAgentClient(agent); if (agentClient.ping(2000) == false) { - log.debug("Won't send MeasurementSchedules to offline Agent[id=" + agent.getId() + "]"); + if (log.isDebugEnabled()) { + log.debug("Won't send MeasurementSchedules to offline Agent[id=" + agent.getId() + "]"); + } return false; } agentClient.getMeasurementAgentService().updateCollection(resourceMeasurementScheduleRequest);
commit 77ea6433ec689ce3c58bf88bed4f8662ab7b1443 Author: Joseph Marques joseph@redhat.com Date: Mon Jun 28 18:29:35 2010 -0400
BZ-608921: group-wise call-time data views
* add new CallTimeDataCriteria object ** ability to filter by resource / group / auto-group * write findCallTimeDataForContext, which handles all data view queries now ** have all methods called from the UI delegate to findCallTimeDataForContext * add response.xhtml at the compatible group and auto-group levels ** add "monitor > response" tab definitions in main.xhtml layout files * add JSF navigation rules to measurement-navigation.xml files for group/autogroup
enhance call-time data reporting
* elide the destination column ** this prevents overflowing the horizontal area of the enclosing layout element ** only show up to the last 50 characters of the destination ** hovering over the destination field will give a tooltip with the full-length destiniation * add the ability to filter call-time data records by destination substring
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/CallTimeDataCriteria.java b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/CallTimeDataCriteria.java new file mode 100644 index 0000000..8156d9a --- /dev/null +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/CallTimeDataCriteria.java @@ -0,0 +1,219 @@ +/* + * RHQ Management Platform + * Copyright (C) 2005-2008 Red Hat, Inc. + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License, version 2, as + * published by the Free Software Foundation, and/or the GNU Lesser + * General Public License, version 2.1, also as published by the Free + * Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License and the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License + * and the GNU Lesser General Public License along with this program; + * if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +package org.rhq.core.domain.criteria; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlRootElement; + +import org.rhq.core.domain.measurement.DataType; +import org.rhq.core.domain.measurement.calltime.CallTimeDataValue; +import org.rhq.core.domain.util.PageOrdering; + +/** + * @author Joseph Marques + */ +@XmlRootElement +@XmlAccessorType(XmlAccessType.FIELD) +@SuppressWarnings("unused") +public class CallTimeDataCriteria extends Criteria { + private static final long serialVersionUID = 1L; + + private Integer filterResourceId; // requires overrides + private Integer filterResourceGroupId; // requires overrides + private Integer filterAutoGroupResourceTypeId; // requires overrides + private Integer filterAutoGroupParentResourceId; // requires overrides + private Long filterBeginTime; // requires overrides + private Long filterEndTime; // requires overrides + private Double filterMinimum; + private Double filterMaximum; + private Double filterTotal; + private Long filterCount; + private String filterDestination; // requires overrides + private DataType filterDataType = DataType.CALLTIME; // requires overrides, not user modifiable + + private PageOrdering sortMinimum; // requires overrides + private PageOrdering sortMaximum; // requires overrides + private PageOrdering sortAverage; // requires overrides + private PageOrdering sortTotal; // requires overrides + private PageOrdering sortCount; // requires overrides + + @Override + public Class<?> getPersistentClass() { + return CallTimeDataValue.class; + } + + public CallTimeDataCriteria() { + /* + filterOverrides.put("resourceId", "key.schedule.resource.id = ?"); + filterOverrides.put("resourceGroupId", "key.schedule.resource.id IN " // + + "( SELECT res.id " // + + " FROM Resource res " // + + " JOIN res.implicitGroups ig " // + + " WHERE ig.id = ? )"); + filterOverrides.put("autoGroupResourceTypeId", "key.schedule.resource.id IN " // + + "( SELECT res.id " // + + " FROM Resource res " // + + " JOIN res.resourceType type " // + + " WHERE type.id = ? )"); + filterOverrides.put("autoGroupParentResourceId", "key.schedule.resource.id IN " // + + "( SELECT res.id " // + + " FROM Resource res " // + + " JOIN res.parentResource parent " // + + " WHERE parent.id = ? )"); + */ + filterOverrides.put("resourceId", "id IN " // + + "( SELECT callData.id " // + + " FROM CallTimeDataValue callData " // + + " WHERE callData.key.schedule.resource.id = ? )"); + + filterOverrides.put("resourceGroupId", "id IN " // + + "( SELECT callData.id " // + + " FROM CallTimeDataValue callData, Resource res " // + + " JOIN res.implicitGroups ig " // + + " WHERE callData.key.schedule.resource.id = res.id " // + + " AND ig.id = ? ) "); + + filterOverrides.put("autoGroupResourceTypeId", "id IN " // + + "( SELECT callData.id " // + + " FROM CallTimeDataValue callData, Resource res " // + + " WHERE callData.key.schedule.resource.id = res.id " // + + " AND res.resourceType.id = ? )"); + + filterOverrides.put("autoGroupParentResourceId", "id IN " // + + "( SELECT callData.id " // + + " FROM CallTimeDataValue callData, Resource res " // + + " WHERE callData.key.schedule.resource.id = res.id " // + + " AND res.parentResource.id = ? )"); + + filterOverrides.put("beginTime", "beginTime > ?"); + filterOverrides.put("endTime", "endTime < ?"); + + filterOverrides.put("destination", "key.callDestination like ?"); + /* + filterOverrides.put("destination", "id IN " // + + "( SELECT callData.id " // + + " FROM CallTimeDataValue callData " // + + " WHERE callData.key.callDestination like ? )"); + */ + filterOverrides.put("dataType", "key.schedule.definition.dataType = ?"); + /* + filterOverrides.put("dataType", "id IN " // + + "( SELECT callData.id " // + + " FROM CallTimeDataValue callData " // + + " WHERE callData.key.schedule.definition.dataType = ? )"); + */ + + sortOverrides.put("minimum", "MIN(" + getAlias() + ".minimum)"); + sortOverrides.put("maximum", "MAX(" + getAlias() + ".maximum)"); + sortOverrides.put("average", "(SUM(" + getAlias() + ".total) / SUM(" + getAlias() + ".count))"); + sortOverrides.put("total", "SUM(" + getAlias() + ".total)"); + sortOverrides.put("count", "SUM(" + getAlias() + ".count)"); + + } + + public void addFilterResourceId(Integer filterResourceId) { + this.filterResourceId = filterResourceId; + } + + public void addFilterResourceGroupId(Integer filterResourceGroupId) { + this.filterResourceGroupId = filterResourceGroupId; + } + + public void addFilterAutoGroupResourceTypeId(Integer filterAutoGroupResourceTypeId) { + this.filterAutoGroupResourceTypeId = filterAutoGroupResourceTypeId; + } + + public void addFilterAutoGroupParentResourceId(Integer filterAutoGroupParentResourceId) { + this.filterAutoGroupParentResourceId = filterAutoGroupParentResourceId; + } + + public void addFilterBeginTime(Long filterBeginTime) { + this.filterBeginTime = filterBeginTime; + } + + public void addFilterEndTime(Long filterEndTime) { + this.filterEndTime = filterEndTime; + } + + public void addFilterMinimum(Double filterMinimum) { + this.filterMinimum = filterMinimum; + } + + public void addFilterMaximum(Double filterMaximum) { + this.filterMaximum = filterMaximum; + } + + public void addFilterTotal(Double filterTotal) { + this.filterTotal = filterTotal; + } + + // use basic type not object wrapper because it requires non-null value + public void addFilterCount(long filterCount) { + if (filterCount < 1) { + throw new IllegalArgumentException("Filter 'count' must be greater than 0"); + } + this.filterCount = filterCount; + } + + public void addFilterDestination(String filterDestination) { + this.filterDestination = filterDestination; + } + + public void addFilterDataType(DataType filterDataType) { + if (true) { + throw new IllegalArgumentException( + "Filter 'dataType' is not user modifiable, it must remain DataType.CALLTIME"); + } + //this.filterDataType = filterDataType; + } + + public void addSortMinimum(PageOrdering sortMinimum) { + addSortField("minimum"); + this.sortMinimum = sortMinimum; + } + + public void addSortMaximum(PageOrdering sortMaximum) { + addSortField("maximum"); + this.sortMaximum = sortMaximum; + } + + public void addSortAverage(PageOrdering sortAverage) { + addSortField("average"); + this.sortAverage = sortAverage; + } + + public void addSortTotal(PageOrdering sortTotal) { + addSortField("total"); + this.sortTotal = sortTotal; + } + + public void addSortCount(PageOrdering sortCount) { + addSortField("count"); + this.sortCount = sortCount; + } + + public boolean hasCustomizedSorting() { + return true; + } +} diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/measurement/calltime/CallTimeUIBean.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/measurement/calltime/CallTimeUIBean.java index f591ad6..c93c137 100644 --- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/measurement/calltime/CallTimeUIBean.java +++ b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/measurement/calltime/CallTimeUIBean.java @@ -1,16 +1,10 @@ package org.rhq.enterprise.gui.measurement.calltime;
-import java.util.List; - -import javax.faces.application.FacesMessage; import javax.faces.model.DataModel;
import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory;
-import org.rhq.core.domain.auth.Subject; -import org.rhq.core.domain.measurement.DataType; -import org.rhq.core.domain.measurement.MeasurementSchedule; import org.rhq.core.domain.measurement.calltime.CallTimeDataComposite; import org.rhq.core.domain.util.PageControl; import org.rhq.core.domain.util.PageList; @@ -24,7 +18,6 @@ import org.rhq.enterprise.gui.util.WebUtility; import org.rhq.enterprise.server.common.EntityContext; import org.rhq.enterprise.server.measurement.CallTimeDataManagerLocal; import org.rhq.enterprise.server.measurement.MeasurementPreferences; -import org.rhq.enterprise.server.measurement.MeasurementScheduleManagerLocal; import org.rhq.enterprise.server.measurement.MeasurementPreferences.MetricRangePreferences; import org.rhq.enterprise.server.util.LookupUtil;
@@ -33,14 +26,15 @@ import org.rhq.enterprise.server.util.LookupUtil; */ public class CallTimeUIBean extends PagedDataTableUIBean {
- private final Log log = LogFactory.getLog(this.getClass()); + private final Log log = LogFactory.getLog(CallTimeUIBean.class);
public static final String MANAGED_BEAN_NAME = "CallTimeUIBean";
private CallTimeDataManagerLocal callTimeDataManager = LookupUtil.getCallTimeDataManager(); - private MeasurementScheduleManagerLocal scheduleManager = LookupUtil.getMeasurementScheduleManager(); + //private MeasurementScheduleManagerLocal scheduleManager = LookupUtil.getMeasurementScheduleManager();
private EntityContext context; + private String destinationFilter;
public CallTimeUIBean() { context = WebUtility.getEntityContext(); @@ -50,6 +44,17 @@ public class CallTimeUIBean extends PagedDataTableUIBean { return this.context; }
+ public String getDestinationFilter() { + if (destinationFilter == null) { + destinationFilter = FacesContextUtility.getOptionalRequestParameter("callTimeForm:destinationFilter"); + } + return this.destinationFilter; + } + + public void setDestinationFilter(String destinationFilter) { + this.destinationFilter = destinationFilter; + } + @Override public DataModel getDataModel() { if (dataModel == null) { @@ -66,16 +71,17 @@ public class CallTimeUIBean extends PagedDataTableUIBean {
@Override public PageList<CallTimeDataComposite> fetchPage(PageControl pc) { - Subject subject = getSubject(); WebUser user = EnterpriseFacesContextUtility.getWebUser(); MeasurementPreferences preferences = user.getMeasurementPreferences(); MetricRangePreferences rangePreferences = preferences.getMetricRangePreferences();
+ /* + Subject subject = getSubject(); PageList<CallTimeDataComposite> results = new PageList<CallTimeDataComposite>(); if (context.category == EntityContext.Category.Resource) { int resourceId = getResource().getId(); - List<MeasurementSchedule> callTimeSchedules = scheduleManager - .findSchedulesForResourceAndType(subject, resourceId, DataType.CALLTIME, null, false); + List<MeasurementSchedule> callTimeSchedules = scheduleManager.findSchedulesForResourceAndType(subject, + resourceId, DataType.CALLTIME, null, false); if (callTimeSchedules.size() == 0) { FacesContextUtility.addMessage(FacesMessage.SEVERITY_WARN, "This resource does not support response time metrics."); @@ -88,15 +94,17 @@ public class CallTimeUIBean extends PagedDataTableUIBean { rangePreferences.begin, rangePreferences.end, pc); } } else if (context.category == EntityContext.Category.ResourceGroup) { - FacesContextUtility.addMessage(FacesMessage.SEVERITY_WARN, - "Response time metrics are not yet supported for compatible groups."); + results = callTimeDataManager.findCallTimeDataForCompatibleGroup(subject, context.groupId, + rangePreferences.begin, rangePreferences.end, pc); } else if (context.category == EntityContext.Category.AutoGroup) { - FacesContextUtility.addMessage(FacesMessage.SEVERITY_WARN, - "Response time metrics are not yet supported for auto-groups."); + results = callTimeDataManager.findCallTimeDataForAutoGroup(subject, context.parentResourceId, + context.resourceTypeId, rangePreferences.begin, rangePreferences.end, pc); } else { log.error(context.getUnknownContextMessage()); } - + */ + PageList<CallTimeDataComposite> results = callTimeDataManager.findCallTimeDataForContext(getSubject(), + context, rangePreferences.begin, rangePreferences.end, getDestinationFilter(), pc); return results; } } diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation-auto-group/measurement-navigation.xml b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation-auto-group/measurement-navigation.xml index a21940f..2daf795 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation-auto-group/measurement-navigation.xml +++ b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation-auto-group/measurement-navigation.xml @@ -49,6 +49,26 @@ </navigation-case>
</navigation-rule> + + <!-- changing metric display range on Monitor > Response --> + <navigation-rule> + <from-view-id>/rhq/autogroup/monitor/response.xhtml</from-view-id> + + <navigation-case> + <!-- catch all navigation-case: if any actions return 'success', go here --> + <from-outcome>success</from-outcome> + <to-view-id>/rhq/autogroup/monitor/response.xhtml?parent=#{param.parent}&type=#{param.type}</to-view-id> + <redirect/> + </navigation-case> + + <navigation-case> + <!-- sorting rule --> + <from-outcome>sort</from-outcome> + <to-view-id>/rhq/autogroup/monitor/response.xhtml?parent=#{param.parent}&type=#{param.type}</to-view-id> + <redirect/> + </navigation-case> + + </navigation-rule>
<!-- changing metric display range on Events > History --> <navigation-rule> diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation-resource-group/measurement-navigation.xml b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation-resource-group/measurement-navigation.xml index fd2378b..917281b 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation-resource-group/measurement-navigation.xml +++ b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation-resource-group/measurement-navigation.xml @@ -50,4 +50,24 @@
</navigation-rule>
+ <!-- changing metric display range on Monitor > Response --> + <navigation-rule> + <from-view-id>/rhq/group/monitor/response.xhtml</from-view-id> + + <navigation-case> + <!-- catch all navigation-case: if any actions return 'success', go here --> + <from-outcome>success</from-outcome> + <to-view-id>/rhq/group/monitor/response.xhtml?parent=#{param.parent}&type=#{param.type}</to-view-id> + <redirect/> + </navigation-case> + + <navigation-case> + <!-- sorting rule --> + <from-outcome>sort</from-outcome> + <to-view-id>/rhq/group/monitor/response.xhtml?parent=#{param.parent}&type=#{param.type}</to-view-id> + <redirect/> + </navigation-case> + + </navigation-rule> + </faces-config> \ No newline at end of file diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/autogroup/layout/main.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/autogroup/layout/main.xhtml index 28fac3c..5a01f31 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/autogroup/layout/main.xhtml +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/autogroup/layout/main.xhtml @@ -36,98 +36,80 @@ REQUEST PARAMETERS: THIS TEXT WILL BE REMOVED AS WELL.
<ui:param name="defaultPageTitle" - value="'#{AutoGroupUIBean.parentResource.name}'.'#{AutoGroupUIBean.childResourceType.name}'" /> + value="'#{AutoGroupUIBean.parentResource.name}'.'#{AutoGroupUIBean.childResourceType.name}'" />
- <ui:define name="summary"> - - ui:remove - <!-- NOTE: Besides being included here, summary.xhtml is also leveraged by JSP-based pages. Specifically, it is - included (via an AJAX request) in /common/components/PageTitle.jsp. - AutoGroups have no obvious summary information past what is in the breadcrumbs --> - </ui:remove> + <ui:define name="summary">
+ ui:remove + <!-- NOTE: Besides being included here, summary.xhtml is also leveraged by JSP-based pages. Specifically, it is + included (via an AJAX request) in /common/components/PageTitle.jsp. + AutoGroups have no obvious summary information past what is in the breadcrumbs --> + </ui:remove>
<h:panelGroup layout="block" style="width: 100%; background-color: #E5E5E5;"> - - <table width="100%" style="padding-right: 20px; padding-top: 5px;" cellpadding="0" cellspacing="0"> + <tr> + <td width="30"> + <h:graphicImage value="/images/icons/Auto_group_#{AutoGroupUIBean.childResourceType.category}_up_24.png"/> + </td> + <td nowrap="nowrap"> + <h:outputText value="#{AutoGroupUIBean.childResourceType.name} AutoGroup" style="font-size: 18px;" /> + <br/> + <onc:resourceLineage resourceId="#{AutoGroupUIBean.parentResource.id}" /> + <h:outputText value=" > " /> + <h:outputLink value="/rhq/autogroup/monitor/graphs.xhtml"> + <f:param name="parent" value="#{AutoGroupUIBean.parentResource.id}" /> + <f:param name="type" value="#{AutoGroupUIBean.childResourceType.id}" /> + <h:outputText value="#{AutoGroupUIBean.childResourceType.name}" /> + </h:outputLink> + </td> + </tr> + </table> + </h:panelGroup> + + <rich:spacer height="10px"/>
- <tr> - <td width="30"> - - <h:graphicImage value="/images/icons/Auto_group_#{AutoGroupUIBean.childResourceType.category}_up_24.png"/> - </td> - <td nowrap="nowrap"> - - <h:outputText value="#{AutoGroupUIBean.childResourceType.name} AutoGroup" style="font-size: 18px;" /><br/> - - - <onc:resourceLineage - resourceId="#{AutoGroupUIBean.parentResource.id}" /> - <h:outputText value=" > " /> - <h:outputLink value="/rhq/autogroup/monitor/graphs.xhtml"> - <f:param name="parent" - value="#{AutoGroupUIBean.parentResource.id}" /> - <f:param name="type" - value="#{AutoGroupUIBean.childResourceType.id}" /> - <h:outputText value="#{AutoGroupUIBean.childResourceType.name}" /> - </h:outputLink> - - </td> - </tr> - </table> - -</h:panelGroup> - - <rich:spacer height="10px"/> - - </ui:define> - - <ui:define name="tabBar"> - - <onc:tabBar selectedTabName="#{selectedTabName}"> - - <f:param name="parent" value="#{param.parent}" /> - <f:param name="type" value="#{param.type}" /> - - <onc:tab name="Monitor" image="/images/icons/Monitor_grey_16.png"> - <onc:subtab name="Graphs" - url="/rhq/autogroup/monitor/graphs.xhtml" /> - <onc:subtab name="Tables" - url="/rhq/autogroup/monitor/tables.xhtml" /> - <onc:subtab name="Schedules" - url="/rhq/autogroup/monitor/schedules.xhtml" /> - </onc:tab> - <onc:tab name="Events" image="/images/icons/Events_grey_16.png"> - <onc:subtab name="History" - url="/rhq/autogroup/events/history.xhtml" /> - </onc:tab> - - </onc:tabBar> - - <!-- Shows the results of the last action executed. --> - <h:messages showSummary="false" showDetail="true" - infoClass="InfoBlock" warnClass="WarnBlock" - errorClass="ErrorBlock" fatalClass="FatalBlock" - globalOnly="true" layout="table" width="100%" /> - - </ui:define> + </ui:define>
+ <ui:define name="tabBar"> + + <onc:tabBar selectedTabName="#{selectedTabName}"> + <f:param name="parent" value="#{param.parent}" /> + <f:param name="type" value="#{param.type}" /> + + <onc:tab name="Monitor" image="/images/icons/Monitor_grey_16.png"> + <onc:subtab name="Graphs" url="/rhq/autogroup/monitor/graphs.xhtml" /> + <onc:subtab name="Tables" url="/rhq/autogroup/monitor/tables.xhtml" /> + <onc:subtab name="Schedules" url="/rhq/autogroup/monitor/schedules.xhtml" /> + <onc:subtab name="Response" url="/rhq/autogroup/monitor/response.xhtml" /> + </onc:tab> + + <onc:tab name="Events" image="/images/icons/Events_grey_16.png"> + <onc:subtab name="History" url="/rhq/autogroup/events/history.xhtml" /> + </onc:tab> + </onc:tabBar> + + <!-- Shows the results of the last action executed. --> + <h:messages showSummary="false" + showDetail="true" + infoClass="InfoBlock" + warnClass="WarnBlock" + errorClass="ErrorBlock" + fatalClass="FatalBlock" + globalOnly="true" + layout="table" + width="100%" /> + </ui:define>
<ui:define name="nav"> - <ui:include src="/rhq/resource/navigation/ResourcesTree.xhtml" /> - </ui:define>
- - <ui:define name="content"> - <p /> - - <h1>Default AutoGroup Content</h1> - - <p /> - </ui:define> + <ui:define name="content"> + <p /> + <h1>Default AutoGroup Content</h1> + <p /> + </ui:define>
</ui:composition>
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/autogroup/monitor/response.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/autogroup/monitor/response.xhtml new file mode 100644 index 0000000..793cdd6 --- /dev/null +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/autogroup/monitor/response.xhtml @@ -0,0 +1,21 @@ +<ui:composition template="/rhq/autogroup/layout/main.xhtml" + xmlns="http://www.w3.org/1999/xhtml" + xmlns:h="http://java.sun.com/jsf/html" + xmlns:f="http://java.sun.com/jsf/core" + xmlns:ui="http://java.sun.com/jsf/facelets" + xmlns:c="http://java.sun.com/jstl/core" + xmlns:onc="http://jboss.org/on/component" + xmlns:onf="http://jboss.org/on/function" + xmlns:a4j="https://ajax4jsf.dev.java.net/ajax" + xmlns:rich="http://richfaces.ajax4jsf.org/rich%22%3E + + <ui:param name="pageTitle" value="AutoGroup '#{AutoGroupUIBean.parentResource.name}'.'#{AutoGroupUIBean.childResourceType.name}' - Metric Response Time" /> + <ui:param name="selectedTabName" value="Monitor.Response" /> + + <ui:define name="content"> + + <ui:include src="/rhq/common/monitor/response.xhtml" /> + + </ui:define> + +</ui:composition> \ No newline at end of file diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/monitor/response.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/monitor/response.xhtml index d38802c..b2d9b12 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/monitor/response.xhtml +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/monitor/response.xhtml @@ -16,27 +16,37 @@ </f:facet>
<h:form id="callTimeForm"> + <a4j:keepAlive beanName="CallTimeUIBean"/> + <!-- On submit make sure these are provided for the context of any new instance of the UI beans --> <c:if test="#{CallTimeUIBean.context.resourceId != -1}"> - <input type="hidden" name="id" - value="#{CallTimeUIBean.context.resourceId}" /> + <input type="hidden" name="id" value="#{CallTimeUIBean.context.resourceId}" /> </c:if> <c:if test="#{CallTimeUIBean.context.groupId != -1}"> - <input type="hidden" name="groupId" - value="#{CallTimeUIBean.context.groupId}" /> + <input type="hidden" name="groupId" value="#{CallTimeUIBean.context.groupId}" /> </c:if> <c:if test="#{CallTimeUIBean.context.parentResourceId != -1}"> - <input type="hidden" name="parent" - value="#{CallTimeUIBean.context.parentResourceId}" /> + <input type="hidden" name="parent" value="#{CallTimeUIBean.context.parentResourceId}" /> </c:if> <c:if test="#{CallTimeUIBean.context.resourceTypeId != -1}"> - <input type="hidden" name="type" - value="#{CallTimeUIBean.context.resourceTypeId}" /> + <input type="hidden" name="type" value="#{CallTimeUIBean.context.resourceTypeId}" /> </c:if>
- <ui:param name="callTimeDataModel" value="#{CallTimeUIBean.dataModel}" /> + <h:panelGrid columns="3" cellspacing="3"> + <h:outputLabel for="destinationFilter" value="Destination Filter: " /> + <h:inputText id="destinationFilter" value="#{CallTimeUIBean.destinationFilter}" + onkeypress="return ignoreEnterKey(event);" + style="width: 300px;" /> + <a4j:commandButton value="GO" reRender="callTimeDataTable, callTimeDataTableScroller" + status="commonStatus" + actionListener="#{CallTimeUIBean.clearDataModel}" + styleClass="buttonmed"> + <s:defaultAction/> + </a4j:commandButton> + </h:panelGrid>
+ <ui:param name="callTimeDataModel" value="#{CallTimeUIBean.dataModel}" /> <rich:dataTable id="callTimeDataTable" value="#{callTimeDataModel}" rows="#{PageControl.CallTimeHistory.pageSize}" @@ -54,7 +64,7 @@
rich:column <f:facet name="header"> - <onc:sortableColumnHeader sort="key.callDestination"> + <onc:sortableColumnHeader sort="calltimedatavalue.key.callDestination"> <h:outputText value="Destination" /> </onc:sortableColumnHeader> </f:facet> @@ -63,7 +73,7 @@
rich:column <f:facet name="header"> - <onc:sortableColumnHeader sort="SUM(value.count)"> + <onc:sortableColumnHeader sort="SUM(calltimedatavalue.count)"> <h:outputText value="Request Count" /> </onc:sortableColumnHeader> </f:facet> @@ -72,7 +82,7 @@
rich:column <f:facet name="header"> - <onc:sortableColumnHeader sort="MIN(value.minimum)"> + <onc:sortableColumnHeader sort="MIN(calltimedatavalue.minimum)"> <h:outputText value="Minimum" /> </onc:sortableColumnHeader> </f:facet> @@ -83,7 +93,7 @@
rich:column <f:facet name="header"> - <onc:sortableColumnHeader sort="(SUM(value.total)/SUM(value.count))"> + <onc:sortableColumnHeader sort="SUM(calltimedatavalue.total)/SUM(calltimedatavalue.count)"> <h:outputText value="Average" /> </onc:sortableColumnHeader> </f:facet> @@ -94,7 +104,7 @@
rich:column <f:facet name="header"> - <onc:sortableColumnHeader sort="MAX(value.maximum)"> + <onc:sortableColumnHeader sort="MAX(calltimedatavalue.maximum)"> <h:outputText value="Maximum" /> </onc:sortableColumnHeader> </f:facet> @@ -102,10 +112,21 @@ <f:converter converterId="ShortDurationConverter"/> </h:outputText> </rich:column> + + rich:column + <f:facet name="header"> + <onc:sortableColumnHeader sort="MAX(calltimedatavalue.total)"> + <h:outputText value="Total" /> + </onc:sortableColumnHeader> + </f:facet> + <h:outputText value="#{item.total}"> + <f:converter converterId="ShortDurationConverter"/> + </h:outputText> + </rich:column>
<f:facet name="footer"> rich:columnGroup - <rich:column colspan="5" width="100%"> + <rich:column colspan="6" width="100%"> <ui:param name="paginationDataTableName" value="callTimeDataTable" /> <ui:param name="paginationDataModel" value="#{callTimeDataModel}" /> <ui:param name="paginationPageControl" value="#{PageControl.CallTimeHistory}" /> diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/layout/main.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/layout/main.xhtml index 51b9a88..ac806e8 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/layout/main.xhtml +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/layout/main.xhtml @@ -58,6 +58,7 @@ THIS TEXT WILL BE REMOVED AS WELL. <onc:subtab name="Graphs" url="/rhq/group/monitor/graphs.xhtml"/> <onc:subtab name="Tables" url="/rhq/group/monitor/tables.xhtml"/> <onc:subtab name="Schedules" url="/rhq/group/monitor/schedules.xhtml"/> + <onc:subtab name="Response" url="/rhq/group/monitor/response.xhtml"/> </onc:tab>
<onc:tab name="Inventory" image="/images/icons/Inventory_grey_16.png"> diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/monitor/response.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/monitor/response.xhtml new file mode 100644 index 0000000..44cbcfa --- /dev/null +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/monitor/response.xhtml @@ -0,0 +1,21 @@ +<ui:composition template="/rhq/group/layout/main.xhtml" + xmlns="http://www.w3.org/1999/xhtml" + xmlns:h="http://java.sun.com/jsf/html" + xmlns:f="http://java.sun.com/jsf/core" + xmlns:ui="http://java.sun.com/jsf/facelets" + xmlns:c="http://java.sun.com/jstl/core" + xmlns:onc="http://jboss.org/on/component" + xmlns:onf="http://jboss.org/on/function" + xmlns:a4j="https://ajax4jsf.dev.java.net/ajax" + xmlns:rich="http://richfaces.ajax4jsf.org/rich%22%3E + + <ui:param name="pageTitle" value="#{ResourceGroupUIBean.groupCategoryName} '#{ResourceGroupUIBean.name}' - Metric Response Time" /> + <ui:param name="selectedTabName" value="Monitor.Response" /> + + <ui:define name="content"> + + <ui:include src="/rhq/common/monitor/response.xhtml" /> + + </ui:define> + +</ui:composition> \ No newline at end of file diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/CallTimeDataManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/CallTimeDataManagerBean.java index c6a43b8..5a25f85 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/CallTimeDataManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/CallTimeDataManagerBean.java @@ -47,6 +47,7 @@ import org.rhq.core.db.OracleDatabaseType; import org.rhq.core.db.PostgresqlDatabaseType; import org.rhq.core.db.SQLServerDatabaseType; import org.rhq.core.domain.auth.Subject; +import org.rhq.core.domain.criteria.CallTimeDataCriteria; import org.rhq.core.domain.measurement.MeasurementSchedule; import org.rhq.core.domain.measurement.calltime.CallTimeData; import org.rhq.core.domain.measurement.calltime.CallTimeDataComposite; @@ -61,7 +62,10 @@ import org.rhq.enterprise.server.alert.engine.AlertConditionCacheManagerLocal; import org.rhq.enterprise.server.alert.engine.AlertConditionCacheStats; import org.rhq.enterprise.server.authz.AuthorizationManagerLocal; import org.rhq.enterprise.server.authz.PermissionException; +import org.rhq.enterprise.server.common.EntityContext; import org.rhq.enterprise.server.measurement.instrumentation.MeasurementMonitor; +import org.rhq.enterprise.server.util.CriteriaQueryGenerator; +import org.rhq.enterprise.server.util.CriteriaQueryRunner;
/** * The manager for call-time metric data. @@ -149,7 +153,7 @@ public class CallTimeDataManagerBean implements CallTimeDataManagerLocal, CallTi * Taking this solution one step further, an appropriate delete statement can be crafted which leverages * the above concept but deletes all but one of the duplicates (perhaps leaving the record with the * smallest id/pk). This purge routine can either be grouped in with the rest in DataPurgeJob, or it can - * be implemented as its own quartz job that runs more (or less) frequently, depending on how needs + * be implemented as its own quartz job that runs more (or less) frequently, depending on our needs * (i.e., how often we anticipate duplicates) */ // Delete any existing rows that have the same key and begin time as the data about to be inserted. @@ -196,15 +200,69 @@ public class CallTimeDataManagerBean implements CallTimeDataManagerLocal, CallTi }
public PageList<CallTimeDataComposite> findCallTimeDataForCompatibleGroup(Subject subject, int groupId, - int measurementDefinitionId, long beginTime, long endTime, PageControl pageControl) { - // TODO - return null; + long beginTime, long endTime, PageControl pageControl) { + return findCallTimeDataForContext(subject, EntityContext.forGroup(groupId), beginTime, endTime, null, + pageControl); }
public PageList<CallTimeDataComposite> findCallTimeDataForAutoGroup(Subject subject, int parentResourceId, - int childResourceTypeId, int measurementDefinitionId, long beginTime, long endTime, PageControl pageControl) { - // TODO - return null; + int childResourceTypeId, long beginTime, long endTime, PageControl pageControl) { + return findCallTimeDataForContext(subject, EntityContext.forAutoGroup(parentResourceId, childResourceTypeId), + beginTime, endTime, null, pageControl); + } + + public PageList<CallTimeDataComposite> findCallTimeDataForContext(Subject subject, EntityContext context, + long beginTime, long endTime, String destination, PageControl pageControl) { + + // lookup measurement definition id + + CallTimeDataCriteria criteria = new CallTimeDataCriteria(); + criteria.addFilterBeginTime(beginTime); + criteria.addFilterEndTime(endTime); + if (destination != null && !destination.trim().equals("")) { + criteria.addFilterDestination(destination); + } + + pageControl.initDefaultOrderingField("SUM(calltimedatavalue.total)/SUM(calltimedatavalue.count)", + PageOrdering.DESC); // only set if no ordering yet specified + pageControl.addDefaultOrderingField("calltimedatavalue.key.callDestination", PageOrdering.ASC); // add this to sort, if not already specified + criteria.setPageControl(pageControl); + + //criteria.addSortAverage(PageOrdering.DESC); + + if (context.category == EntityContext.Category.Resource) { + criteria.addFilterResourceId(context.resourceId); + } else if (context.category == EntityContext.Category.ResourceGroup) { + criteria.addFilterResourceGroupId(context.groupId); + } else if (context.category == EntityContext.Category.AutoGroup) { + criteria.addFilterAutoGroupParentResourceId(context.parentResourceId); + criteria.addFilterAutoGroupResourceTypeId(context.resourceTypeId); + } + + CriteriaQueryGenerator generator = new CriteriaQueryGenerator(criteria); + String replacementSelectList = "" // + + " new org.rhq.core.domain.measurement.calltime.CallTimeDataComposite( " // + + " calltimedatavalue.key.callDestination, " // + + " MIN(calltimedatavalue.minimum), " // + + " MAX(calltimedatavalue.maximum), " // + + " SUM(calltimedatavalue.total), " // + + " SUM(calltimedatavalue.count), " // + + " SUM(calltimedatavalue.total) / SUM(calltimedatavalue.count) ) "; + generator.alterProjection(replacementSelectList); + generator.setGroupByClause("calltimedatavalue.key.callDestination"); + + if (authorizationManager.isInventoryManager(subject) == false) { + generator.setAuthorizationResourceFragment(CriteriaQueryGenerator.AuthorizationTokenType.RESOURCE, + "key.schedule.resource", subject.getId()); + } + + //log.info(generator.getParameterReplacedQuery(false)); + //log.info(generator.getParameterReplacedQuery(true)); + + CriteriaQueryRunner<CallTimeDataComposite> queryRunner = new CriteriaQueryRunner<CallTimeDataComposite>( + criteria, generator, entityManager); + PageList<CallTimeDataComposite> results = queryRunner.execute(); + return results; }
/** diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/CallTimeDataManagerLocal.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/CallTimeDataManagerLocal.java index ce2615c..6c0180b 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/CallTimeDataManagerLocal.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/CallTimeDataManagerLocal.java @@ -29,6 +29,7 @@ import org.rhq.core.domain.measurement.calltime.CallTimeData; import org.rhq.core.domain.measurement.calltime.CallTimeDataComposite; import org.rhq.core.domain.util.PageControl; import org.rhq.core.domain.util.PageList; +import org.rhq.enterprise.server.common.EntityContext;
/** * The manager for call-time metric data. @@ -40,11 +41,14 @@ public interface CallTimeDataManagerLocal { PageList<CallTimeDataComposite> findCallTimeDataForResource(Subject subject, int scheduleId, long beginTime, long endTime, PageControl pageControl);;
- PageList<CallTimeDataComposite> findCallTimeDataForCompatibleGroup(Subject subject, int groupId, - int measurementDefinitionId, long beginTime, long endTime, PageControl pageControl); + PageList<CallTimeDataComposite> findCallTimeDataForCompatibleGroup(Subject subject, int groupId, long beginTime, + long endTime, PageControl pageControl);
PageList<CallTimeDataComposite> findCallTimeDataForAutoGroup(Subject subject, int parentResourceId, - int childResourceTypeId, int measurementDefinitionId, long beginTime, long endTime, PageControl pageControl); + int childResourceTypeId, long beginTime, long endTime, PageControl pageControl); + + PageList<CallTimeDataComposite> findCallTimeDataForContext(Subject subject, EntityContext context, long beginTime, + long endTime, String destination, PageControl pageControl);
int purgeCallTimeData(Date deleteUpToTime) throws SQLException;
commit 635f40e0c8d5320535ae76a3460f6f90a3032b25 Author: Joseph Marques joseph@redhat.com Date: Mon Jun 28 18:23:12 2010 -0400
enhance CriteriaQueryGenerator for queries with groupBy clauses
* be able to generate count-queries for statements containing groupBy clauses
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/CriteriaQueryGenerator.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/CriteriaQueryGenerator.java index 9680e43..459d7d4 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/CriteriaQueryGenerator.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/CriteriaQueryGenerator.java @@ -281,7 +281,13 @@ public final class CriteriaQueryGenerator { StringBuilder results = new StringBuilder(); results.append("SELECT "); if (countQuery) { - results.append("COUNT(").append(alias).append(")").append(NL); + if (groupByClause == null) { // non-grouped method + results.append("COUNT(").append(alias).append(")").append(NL); + } else { + // gets the count of the number of aggregate/grouped rows + // NOTE: this only works when the gorupBy is a single element, as opposed to a list of elements + results.append("COUNT(DISTINCT ").append(groupByClause).append(")").append(NL); + } } else { if (projection == null) { results.append(alias).append(NL);
commit ed2e74b6d29dc707ad401874fdb0a48d386b86a8 Author: Joseph Marques joseph@redhat.com Date: Mon Jun 28 18:21:29 2010 -0400
BZ-608920 - fix pagination/sorting for event>history
* pagination was failed because empty "details" filter wasn't being interpreted as null * sorting was broken becauset the native SQL solutio nwas replaced by criteria API, use uses as a different alias scheme
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/events/history.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/events/history.xhtml index 65ae270..a6b25a7 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/events/history.xhtml +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/events/history.xhtml @@ -105,7 +105,7 @@
<rich:column style="white-space: nowrap;"> <f:facet name="header"> - <onc:sortableColumnHeader sort="ev.severity"> + <onc:sortableColumnHeader sort="severity"> <h:outputText styleClass="headerText" value="Severity" /> </onc:sortableColumnHeader> </f:facet> @@ -121,7 +121,7 @@
<rich:column rendered="#{EventHistoryUIBean.context.resourceId == -1}"> <f:facet name="header"> - <onc:sortableColumnHeader sort="res.name"> + <onc:sortableColumnHeader sort="resource.name"> <h:outputText styleClass="headerText" value="Resource" /> </onc:sortableColumnHeader> </f:facet> @@ -130,7 +130,7 @@
rich:column <f:facet name="header"> - <onc:sortableColumnHeader sort="evs.location"> + <onc:sortableColumnHeader sort="location"> <h:outputText styleClass="headerText" value="Source" /> </onc:sortableColumnHeader> </f:facet> @@ -152,7 +152,7 @@
rich:column <f:facet name="header"> - <onc:sortableColumnHeader sort="ev.timestamp"> + <onc:sortableColumnHeader sort="timestamp"> <h:outputText styleClass="headerText" value="Time occurred" /> </onc:sortableColumnHeader> </f:facet> diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/event/EventManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/event/EventManagerBean.java index ebbe99b..8f89095 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/event/EventManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/event/EventManagerBean.java @@ -373,8 +373,12 @@ public class EventManagerBean implements EventManagerLocal, EventManagerRemote { criteria.addFilterStartTime(begin); criteria.addFilterEndTime(end); criteria.addFilterSeverities(severities); - criteria.addFilterSourceName(source); - criteria.addFilterDetail(detail); + if (source != null && !source.trim().equals("")) { + criteria.addFilterSourceName(source); + } + if (detail != null && !detail.trim().equals("")) { + criteria.addFilterDetail(detail); + }
criteria.setPageControl(pc);
@@ -408,6 +412,9 @@ public class EventManagerBean implements EventManagerLocal, EventManagerRemote { "source.resource", subject.getId()); }
+ //log.info(generator.getParameterReplacedQuery(false)); + //log.info(generator.getParameterReplacedQuery(true)); + CriteriaQueryRunner<EventComposite> queryRunner = new CriteriaQueryRunner<EventComposite>(criteria, generator, entityManager); return queryRunner.execute(); diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/CriteriaQueryGenerator.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/CriteriaQueryGenerator.java index 8d6e518..9680e43 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/CriteriaQueryGenerator.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/CriteriaQueryGenerator.java @@ -397,12 +397,7 @@ public final class CriteriaQueryGenerator { }
// order by clause - boolean overridden = true; - PageControl pc = criteria.getPageControlOverrides(); - if (pc == null) { - overridden = false; - pc = getPageControl(criteria); - } + PageControl pc = getPageControl(criteria);
boolean first = true; for (OrderingField orderingField : pc.getOrderingFields()) {
commit be48faf5f78f6f5ba33f3ab63c96a48e156fd6f7 Author: Joseph Marques joseph@redhat.com Date: Mon Jun 28 18:14:47 2010 -0400
add more trace statements so that future pagination/sorting bugs are easier to discover
diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/common/paging/PagedListDataModel.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/common/paging/PagedListDataModel.java index ca3f353..0b1614f 100644 --- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/common/paging/PagedListDataModel.java +++ b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/common/paging/PagedListDataModel.java @@ -119,9 +119,11 @@ public abstract class PagedListDataModel<T> extends DataModel { private PageList<T> getPage() { // ensure page exists - first time going to this view if (pageList == null) { + log.trace("pageList was null, will get PageControl then load the page"); PageControl pageControl = getPageControl(); PageList<T> results = getDataPage(pageControl); pageList = results; + log.trace("pageList was loaded, found " + (pageList == null ? "null" : pageList.size() + " result items")); }
return pageList; @@ -153,14 +155,21 @@ public abstract class PagedListDataModel<T> extends DataModel { endRow = startRow + nRows - 1; }
+ if (log.isTraceEnabled()) { + log.trace("getRowData(" + currentRowIndex + "): startRow=" + startRow + ", endRow=" + endRow); + } // paging backwards - will we ever get in this if-statement if pageControl.getPageSize == SIZE_UNLIMITED? if (currentRowIndex < startRow) { int rowsBack = startRow - currentRowIndex; int pagesBack = (int) Math.ceil(rowsBack / (double) pageControl.getPageSize()); int newPage = pageControl.getPageNumber() - pagesBack; + if (log.isTraceEnabled()) { + log.trace("paging down by " + rowsBack + " rows / " + pagesBack + " pages, new page is " + newPage); + }
if (newPage < 0) { newPage = 0; + log.trace("newPage was negative, setting page to 0"); }
pageControl.setPageNumber(newPage); @@ -173,6 +182,9 @@ public abstract class PagedListDataModel<T> extends DataModel { int rowsForward = currentRowIndex - endRow; int pagesForward = (int) Math.ceil(rowsForward / (double) pageControl.getPageSize()); int newPage = pageControl.getPageNumber() + pagesForward; + if (log.isTraceEnabled()) { + log.trace("paging up by " + rowsForward + " rows / " + pagesForward + " pages, new page is " + newPage); + }
pageControl.setPageNumber(newPage); pageList = getDataPage(pageControl); @@ -187,7 +199,12 @@ public abstract class PagedListDataModel<T> extends DataModel { * a default PageControl object for this PageControlView */ int getIndex = currentRowIndex - startRow; + if (log.isTraceEnabled()) { + log.trace("currentRowIndex=" + currentRowIndex + ", startRow=" + startRow + ", getIndex=" + getIndex + + ", pageListSize=" + pageList.size()); + } if (getIndex < 0 || getIndex >= pageList.size()) { + log.trace("getIndex is out of pageList's bounds, getting default page control"); // getting the default will repersist the new PageControl too pageControl = getDefaultPageControl(); pageList = getDataPage(pageControl); @@ -195,8 +212,16 @@ public abstract class PagedListDataModel<T> extends DataModel { // pageControl startRow should now be zero this.currentRowIndex = 0; // and tell the framework to start back at 0 getIndex = 0; // now the getIndex should be 0 + + if (log.isTraceEnabled()) { + log.trace("currentRowIndex=" + currentRowIndex + ", startRow=" + startRow + ", getIndex=" + getIndex + + ", pageListSize=" + pageList.size()); + } }
+ if (log.isTraceEnabled() && pageList.get(getIndex) == null) { + log.trace("Data item at position " + getIndex + " was null"); + } return pageList.get(getIndex); }
@@ -242,7 +267,11 @@ public abstract class PagedListDataModel<T> extends DataModel {
public PageControl getPageControl() { WebUser user = EnterpriseFacesContextUtility.getWebUser(); - return getPagedDataTableUIBean().getPageControl(user, pageControlView); + PageControl pageControl = getPagedDataTableUIBean().getPageControl(user, pageControlView); + if (log.isTraceEnabled()) { + log.trace("getPageControl() -->" + pageControl); + } + return pageControl; }
public PageControl getDefaultPageControl() { @@ -251,6 +280,9 @@ public abstract class PagedListDataModel<T> extends DataModel { }
public void setPageControl(PageControl pageControl) { + if (log.isTraceEnabled()) { + log.trace("setPageControl(" + pageControl + ")"); + } WebUser user = EnterpriseFacesContextUtility.getWebUser(); getPagedDataTableUIBean().setPageControl(user, pageControlView, pageControl); } diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/CriteriaQueryRunner.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/CriteriaQueryRunner.java index d2c712e..202084c 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/CriteriaQueryRunner.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/CriteriaQueryRunner.java @@ -29,11 +29,17 @@ import java.util.List; import javax.persistence.EntityManager; import javax.persistence.Query;
+import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + import org.rhq.core.domain.criteria.Criteria; +import org.rhq.core.domain.util.PageControl; import org.rhq.core.domain.util.PageList;
public class CriteriaQueryRunner<T> {
+ private static final Log LOG = LogFactory.getLog(CriteriaQueryRunner.class); + private Criteria criteria; private CriteriaQueryGenerator queryGenerator; private EntityManager entityManager; @@ -59,13 +65,19 @@ public class CriteriaQueryRunner<T> { long count = (Long) countQuery.getSingleResult(); List<T> results = query.getResultList();
+ if (LOG.isDebugEnabled()) { + LOG.debug("resultSize=" + results.size() + ", count=" + count); + } + if (autoInitializeBags && (!queryGenerator.getPersistentBagFields().isEmpty())) { for (T entity : results) { initPersistentBags(entity); } }
- return new PageList<T>(results, (int) count, CriteriaQueryGenerator.getPageControl(criteria)); + PageControl pageControl = CriteriaQueryGenerator.getPageControl(criteria); + PageList<T> pagedResults = new PageList<T>(results, (int) count, pageControl); + return pagedResults; }
public void initPersistentBags(Object entity) {
commit b915bdd6ccedda48d32ac968c774761a1db4b470 Author: Joseph Marques joseph@redhat.com Date: Mon Jun 28 01:39:03 2010 -0400
elide call-time destination so the data does not overflow horizontal borders
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/monitor/response.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/monitor/response.xhtml index 7ba5f44..d38802c 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/monitor/response.xhtml +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/monitor/response.xhtml @@ -58,7 +58,7 @@ <h:outputText value="Destination" /> </onc:sortableColumnHeader> </f:facet> - <h:outputText value="#{item.callDestination}" /> + <h:outputText value="#{onf:elideString(item.callDestination, 50, 'left')}" title="#{item.callDestination}"/> </rich:column>
commit b33f05dc1fa3f3dd403b192ffec6a319799c216b Author: Joseph Marques joseph@redhat.com Date: Mon Jun 28 01:35:09 2010 -0400
cosmetic - use generics properly to get rid of warning suppression
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/event/EventManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/event/EventManagerBean.java index 5ceec84..ebbe99b 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/event/EventManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/event/EventManagerBean.java @@ -304,7 +304,6 @@ public class EventManagerBean implements EventManagerLocal, EventManagerRemote { return results; }
- @SuppressWarnings("unchecked") public EventSeverity[] getSeverityBucketsByContext(Subject subject, EntityContext context, long begin, long end, int bucketCount) {
@@ -327,7 +326,8 @@ public class EventManagerBean implements EventManagerLocal, EventManagerRemote { "source.resource", subject.getId()); }
- CriteriaQueryRunner<Object[]> queryRunner = new CriteriaQueryRunner(criteria, generator, entityManager); + CriteriaQueryRunner<Object[]> queryRunner = new CriteriaQueryRunner<Object[]>(criteria, generator, + entityManager); PageList<Object[]> flyWeights = queryRunner.execute();
EventSeverity[] buckets = new EventSeverity[bucketCount]; @@ -390,7 +390,6 @@ public class EventManagerBean implements EventManagerLocal, EventManagerRemote { return findEventCompositesByCriteria(subject, criteria); }
- @SuppressWarnings("unchecked") public PageList<EventComposite> findEventCompositesByCriteria(Subject subject, EventCriteria criteria) { CriteriaQueryGenerator generator = new CriteriaQueryGenerator(criteria); String replacementSelectList = "" // @@ -409,7 +408,8 @@ public class EventManagerBean implements EventManagerLocal, EventManagerRemote { "source.resource", subject.getId()); }
- CriteriaQueryRunner<EventComposite> queryRunner = new CriteriaQueryRunner(criteria, generator, entityManager); + CriteriaQueryRunner<EventComposite> queryRunner = new CriteriaQueryRunner<EventComposite>(criteria, generator, + entityManager); return queryRunner.execute(); }
commit e677753f9e98f966b75bf0dccfc4fb9125f0acda Author: Joseph Marques joseph@redhat.com Date: Mon Jun 28 01:34:37 2010 -0400
add the ability to give the criteria class author full control over sorting
* if hasCustomizedSorting () returns true, CriteriaQueryGenenerator will not prepend auto-generated entity alias to sort fields
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/Criteria.java b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/Criteria.java index c08aa5d..d4e3fcb 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/Criteria.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/Criteria.java @@ -122,6 +122,16 @@ public abstract class Criteria implements Serializable { this.pageControlOverrides = pageControl; }
+ /* + * By default, the ordering fields are automatically prepend with the alias of entity that this criteria object + * wraps. However, some authors of criteria objects want full control of this alias during sort operations. if + * this method returns true, then the alias will not be prepend to the generated "order by" clause, which makes + * author responsible for constructing the fully-qualified ordering token for each sort override. + */ + public boolean hasCustomizedSorting() { + return false; + } + public void clearPaging() { PageControl unlimited = PageControl.getUnlimitedInstance(); this.pageNumber = unlimited.getPageNumber(); diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/CriteriaQueryGenerator.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/CriteriaQueryGenerator.java index cb10f56..8d6e518 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/CriteriaQueryGenerator.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/CriteriaQueryGenerator.java @@ -417,9 +417,14 @@ public final class CriteriaQueryGenerator { String override = criteria.getJPQLSortOverride(fieldName); String suffix = (override == null) ? fieldName : override;
- // if the suffix is numerical, do not prefix the alias - // this allows us to sort by column ordinal, which is required for availability on the group browser - String sortFragment = (isNumber(suffix)) ? suffix : (alias + "." + suffix); + /* + * do not prefix the alias when: + * + * 1) if the suffix is numerical, which allows usto sort by column ordinal + * 2) if the user wants full control and has explicitly chosen to disable alias prepending + */ + boolean doNotPrefixAlias = isNumber(suffix) || criteria.hasCustomizedSorting(); + String sortFragment = doNotPrefixAlias ? suffix : (alias + "." + suffix);
PageOrdering ordering = orderingField.getOrdering();
commit d57176a120c5089d00e9b97a7d5eb88453e76912 Author: Joseph Marques joseph@redhat.com Date: Mon Jun 28 01:33:16 2010 -0400
criteria objects should use numeric wrappers not basic types
* using numberic wrappers allows users to unset the item by passing null.
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/EventCriteria.java b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/EventCriteria.java index 9912c1c..f7dbb6a 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/EventCriteria.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/EventCriteria.java @@ -27,6 +27,7 @@ import java.util.List;
import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlRootElement;
import org.rhq.core.domain.event.Event; import org.rhq.core.domain.event.EventSeverity; @@ -35,6 +36,7 @@ import org.rhq.core.domain.util.PageOrdering; /** * @author Joseph Marques */ +@XmlRootElement @XmlAccessorType(XmlAccessType.FIELD) @SuppressWarnings("unused") public class EventCriteria extends Criteria { @@ -96,11 +98,11 @@ public class EventCriteria extends Criteria { this.filterSourceName = filterSourceName; }
- public void addFilterStartTime(long filterStartTime) { + public void addFilterStartTime(Long filterStartTime) { this.filterStartTime = filterStartTime; }
- public void addFilterEndTime(long filterEndTime) { + public void addFilterEndTime(Long filterEndTime) { this.filterEndTime = filterEndTime; }
commit ac60d6c7453e2916c886e1a33244793f2d6c80f2 Author: Greg Hinkle ghinkle@redhat.com Date: Mon Jun 28 17:47:32 2010 -0400
minor tweaks
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LinkManager.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LinkManager.java index c6e5a9d..e2f61cd 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LinkManager.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LinkManager.java @@ -85,7 +85,11 @@ public class LinkManager {
public static String getHubAllResourcesLink() { - return "/rhq/inventory/browseResources.xhtml?subtab=all"; + if (GWT) { + return "#Inventory"; + } else { + return "/rhq/inventory/browseResources.xhtml?subtab=all"; + } }
public static String getHubPlatformsLink() { diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardsView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardsView.java index 37b0880..4444d39 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardsView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardsView.java @@ -192,7 +192,7 @@ public class DashboardsView extends VLayout implements BookmarkableView { Dashboard dashboard = new Dashboard(); dashboard.setName("Default Dashboard"); dashboard.setColumns(2); - dashboard.setColumnWidths("30%", "70%"); + dashboard.setColumnWidths("32%", "68%"); dashboard.getConfiguration().put(new PropertySimple(Dashboard.CFG_BACKGROUND,"#F1F2F3"));
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/alerts/RecentAlertsPortlet.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/alerts/RecentAlertsPortlet.java index 6cb001b..377e4c1 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/alerts/RecentAlertsPortlet.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/alerts/RecentAlertsPortlet.java @@ -19,6 +19,7 @@ package org.rhq.enterprise.gui.coregui.client.dashboard.portlets.recent.alerts;
import com.google.gwt.core.client.GWT; +import com.smartgwt.client.types.Overflow; import com.smartgwt.client.widgets.Canvas; import com.smartgwt.client.widgets.HTMLFlow; import com.smartgwt.client.widgets.form.DynamicForm; @@ -39,6 +40,8 @@ public class RecentAlertsPortlet extends AlertsView implements Portlet { public RecentAlertsPortlet() { setShowHeader(false); setShowFooter(false); + + setOverflow(Overflow.HIDDEN); }
public void configure(PortletWindow portletWindow, DashboardPortlet storedPortlet) { diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTreeView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTreeView.java index 92b63ce..ac109f8 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTreeView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTreeView.java @@ -104,6 +104,7 @@ public class ResourceTreeView extends VLayout { treeGrid.setSortField("name"); treeGrid.setShowHeader(false);
+ treeGrid.setLeaveScrollbarGap(false);
contextMenu = new Menu(); MenuItem item = new MenuItem("Expand node");
commit 1a4ed22af76aeafaed8d6da78f5094a6a204f416 Author: Greg Hinkle ghinkle@redhat.com Date: Mon Jun 28 17:47:16 2010 -0400
Limit messages in message center
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/message/MessageCenter.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/message/MessageCenter.java index 1c4f012..afce657 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/message/MessageCenter.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/message/MessageCenter.java @@ -30,8 +30,13 @@ public class MessageCenter {
private ArrayList<MessageListener> listeners = new ArrayList<MessageListener>();
+ private static final int MAX_MESSAGES = 100; + public void notify(Message message) { this.messages.add(message); + if (messages.size() > MAX_MESSAGES) { + messages.removeFirst(); + } for (MessageListener listener : listeners) { listener.onMessage(message); }
commit 127b5e8334335b54d0d4d05ca7c49ef50d63dea8 Author: Greg Hinkle ghinkle@redhat.com Date: Mon Jun 28 17:47:01 2010 -0400
Dashboard portlet refreshability
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/PortletWindow.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/PortletWindow.java index f381773..395d0c9 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/PortletWindow.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/PortletWindow.java @@ -36,6 +36,7 @@ import com.smartgwt.client.widgets.events.DragResizeStopEvent; import com.smartgwt.client.widgets.events.DragResizeStopHandler;
import org.rhq.core.domain.dashboard.DashboardPortlet; +import org.rhq.enterprise.gui.coregui.client.components.table.Table;
/** * @author Greg Hinkle @@ -68,6 +69,16 @@ public class PortletWindow extends Window { } };
+ private ClickHandler refreshHandler = new ClickHandler() { + public void onClick(ClickEvent clickEvent) { + if (PortletWindow.this.view instanceof Table) { + ((Table)PortletWindow.this.view).refresh(); + } else { + ((Canvas)PortletWindow.this.view).redraw(); + } + } + }; + public PortletWindow(DashboardView dashboardView, DashboardPortlet dashboardPortlet) {
this.dashboardView = dashboardView; @@ -83,6 +94,7 @@ public class PortletWindow extends Window { setHeaderControls( HeaderControls.MINIMIZE_BUTTON, HeaderControls.HEADER_LABEL, + new HeaderControl(HeaderControl.REFRESH, refreshHandler), new HeaderControl(HeaderControl.SETTINGS, settingsHandler), new HeaderControl(HeaderControl.HELP, helpHandler), HeaderControls.CLOSE_BUTTON
commit 4a9189b9840407668338243ac1decd4fc7449eca Author: Greg Hinkle ghinkle@redhat.com Date: Mon Jun 28 17:45:07 2010 -0400
Deal with the no-favorites yet case
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/inventory/resource/FavoriteResourcesPortlet.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/inventory/resource/FavoriteResourcesPortlet.java index 99fc8f6..9c5f3fe 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/inventory/resource/FavoriteResourcesPortlet.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/inventory/resource/FavoriteResourcesPortlet.java @@ -61,7 +61,11 @@ public class FavoriteResourcesPortlet extends ResourceSearchView implements Port
Criteria criteria = new Criteria(); - criteria.addCriteria("resourceIds", favArray ); + if (favoriteIds.isEmpty()) { + criteria.addCriteria("id",-1); + } else { + criteria.addCriteria("resourceIds", favArray ); + }
refresh(criteria);
@@ -84,7 +88,7 @@ public class FavoriteResourcesPortlet extends ResourceSearchView implements Port getListGrid().setViewState(state); }
- + }
public Canvas getHelpCanvas() {
commit 8ee84404d4128c9ac14db267214c658c6d062a55 Author: Jay Shaughnessy jshaughn@redhat.com Date: Mon Jun 28 16:30:27 2010 -0400
Move etc/samples/sample-bundle to etc/samples/provisioning/sample-bundle
diff --git a/etc/samples/provisioning/sample-bundle/pom.xml b/etc/samples/provisioning/sample-bundle/pom.xml new file mode 100644 index 0000000..6bd4a88 --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/pom.xml @@ -0,0 +1,92 @@ +<?xml version="1.0"?> + +<!-- $Id$ --> + +<project xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd%22%3E + + <modelVersion>4.0.0</modelVersion> + + <groupId>org.rhq.sample</groupId> + <artifactId>rhq-sample-bundle</artifactId> + <version>2.0</version> + <packaging>pom</packaging> + + <name>RHQ Sample Bundle</name> + <description>a sample bundle consisting of JBossAS 6.0 running the Java Petstore application</description> + + <scm> + <connection>scm:git:ssh://git.fedorahosted.org/git/rhq.git/etc/modules/sample-bundle/</connection> + <developerConnection>scm:git:ssh://git.fedorahosted.org/git/rhq.git/etc/modules/sample-bundle/</developerConnection> + </scm> + + <properties> + <!-- dependency versions --> + <derbyclient.version>10.5.3.0_1</derbyclient.version> + </properties> + + <dependencies> + + <!-- Derby JDBC driver --> + <dependency> + <groupId>org.apache.derby</groupId> + <artifactId>derbyclient</artifactId> + <version>${derbyclient.version}</version> + </dependency> + + </dependencies> + + <build> + + <plugins> + + <plugin> + <artifactId>maven-antrun-plugin</artifactId> + <executions> + <execution> + <id>prepare-bundle</id> + <phase>process-resources</phase> + <configuration> + <tasks> + <echo>settings.localRepository=${settings.localRepository}</echo> + <echo>project.build.outputDirectory=${project.build.outputDirectory}</echo> + <ant antfile="src/main/scripts/build.xml"> + <property name="settings.localRepository" value="${settings.localRepository}"/> + <property name="project.version" value="${project.version}"/> + <property name="project.build.outputDirectory" value="${project.build.outputDirectory}"/> + <property name="derbyclient.version" value="${derbyclient.version}"/> + </ant> + </tasks> + </configuration> + <goals> + <goal>run</goal> + </goals> + </execution> + </executions> + </plugin> + + <plugin> + <artifactId>maven-assembly-plugin</artifactId> + <configuration> + <descriptors> + <descriptor>src/main/scripts/assembly.xml</descriptor> + </descriptors> + <finalName>${project.build.finalName}</finalName> + </configuration> + <executions> + <execution> + <id>assemble-bundle</id> + <phase>package</phase> + <goals> + <goal>attached</goal> + </goals> + </execution> + </executions> + </plugin> + + </plugins> + </build> + +</project> + diff --git a/etc/samples/provisioning/sample-bundle/src/main/bundle/deploy.xml b/etc/samples/provisioning/sample-bundle/src/main/bundle/deploy.xml new file mode 100644 index 0000000..8bfec17 --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/bundle/deploy.xml @@ -0,0 +1,57 @@ +<?xml version="1.0"?> + +<project name="petstore" default="main" + xmlns:rhq="antlib:org.rhq.bundle"> + + <rhq:bundle name="Java Petstore" version="2.0" + description="a sample bundle consisting of JBossAS 6.0 running the Java Petstore application"> + + <rhq:input-property + name="jboss.bind.address" + description="the IP address the JBoss AS server should bind to" + required="true"/> + + <rhq:input-property + name="http.port" + description="the HTTP port the JBoss AS server should listen on" + required="true" + type="integer"/> + + <rhq:input-property + name="https.port" + description="the HTTPS port the JBoss AS server should listen on" + required="true" + type="integer"/> + + <rhq:deployment-unit name="appserver" + preinstallTarget="appserver-preinstall" postinstallTarget="appserver-postinstall"> + <rhq:system-service name="jbossas-petstore" scriptFile="jbossas-init-script" + configFile="jbossas-init-config" overwriteScript="true" + startLevels="3,4,5" startPriority="80" stopPriority="20"/> + + <rhq:archive name="jbossas-petstore.zip"/> + + <!-- the files that should be ignored during upgrades --> + rhq:ignore + rhq:fileset + <include name="server/default/data/**"/> + <include name="server/default/logs/**"/> + <include name="server/default/tmp/**"/> + <include name="server/default/work/**"/> + </rhq:fileset> + </rhq:ignore> + </rhq:deployment-unit> + + </rhq:bundle> + + <target name="main"/> + + <target name="appserver-preinstall"> + <echo>Installing Java Petstore App Server to ${rhq.deploy.dir}...</echo> + </target> + + <target name="appserver-postinstall"> + <echo>Done installing Java Petstore App Server to ${rhq.deploy.dir}.</echo> + </target> + +</project> diff --git a/etc/samples/provisioning/sample-bundle/src/main/bundle/jbossas-init-config b/etc/samples/provisioning/sample-bundle/src/main/bundle/jbossas-init-config new file mode 100644 index 0000000..a2fc4c1 --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/bundle/jbossas-init-config @@ -0,0 +1,69 @@ +# Configuration file for jbossas init script that configures the +# settings needed to start a particular JBoss AS instance. + +# +# the JBoss AS installation directory (e.g. /opt/jboss-6.0.0.M1) +# (*REQUIRED*) +# +JBOSS_HOME="@@rhq.deploy.dir@@" + +# +# the args that will be passed to run.sh +# (i.e. org.jboss.Main). +# +JBOSS_OPTS="-b @@jboss.bind.address@@" + +# What UNIX user the JBoss AS java process will run as. +# (The shutdown client is always run as the invoker of the +# init script). JBoss AS will be run as root by default, but, for +# the sake of security, it is recommended that you chown the JBoss +# AS installation files to a non-root user and use that use here. +# Note, you do need to run as root if your server will listen on one +# or more privileged (< 1024) ports. If you really do want to run as +# root, comment out the JBOSS_USER variable completely (i.e. do not +# set it to root). This will run the server process without "su". +#JBOSS_USER=jboss + +# +# Specify the maximum file descriptor limit, use "max" or "maximum" to use +# the default, as queried by the system. +# +# Defaults to "maximum" +# +#MAX_FD="maximum" + +# +# Specify the profiler configuration file to load. +# +# Default is to not load profiler configuration file. +# +#PROFILER= + +# +# Specify the location of the Java Rntime Environment (JRE) or +# Java Development Kit (JDK) installation directory. If not set, +# "/usr/java/default" will be used. +# +#JAVA_HOME="/usr/java/default" + +# +# Specify options to pass to the Java VM (if unset, a default +# set of options will be used). +# +# Note, if you want to pass the default options but some of +# your own additional options in, then set the +# ADDITIONAL_JAVA_OPTS variable (see below), rather than JAVA_OPTS. +# +#JAVA_OPTS="-Xms128M -Xmx512M -XX:MaxPermSize=256M -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Djava.net.preferIPv4Stack=true" + +# +# Specify additional options to pass to the Java VM. These are passed +# in addition to the default set of options, +# i.e. java $JAVA_OPTS $ADDITIONAL_JAVA_OPTS ... org.jboss.Main ... +# +# Sample JPDA settings (uncomment either a) or b)) +# a) remote socket debugging +#ADDITIONAL_JAVA_OPTS="-Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n" +# b) shared memory debugging +#ADDITIONAL_JAVA_OPTS="-Xrunjdwp:transport=dt_shmem,server=y,suspend=n,address=jboss" + diff --git a/etc/samples/provisioning/sample-bundle/src/main/bundle/jbossas-init-script b/etc/samples/provisioning/sample-bundle/src/main/bundle/jbossas-init-script new file mode 100644 index 0000000..58eb98e --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/bundle/jbossas-init-script @@ -0,0 +1,328 @@ +#!/bin/bash +# +# jbossas - This shell script takes care of starting and stopping +# a JBoss Application Server (AS) instance on a Red Hat +# Linux system. It can be run as a system service (init +# script) and/or run manually. +# +# chkconfig: 345 84 16 +# description: JBoss AS server +# processname: java +# pidfile: /var/run/jbossas.pid + +# Source init-script function library. +FUNCTIONS=/etc/rc.d/init.d/functions +if [ ! -f "$FUNCTIONS" ]; then + echo "Functions library ($FUNCTIONS) not found." >&2 + exit 1 +fi +. $FUNCTIONS + +# Find the name of this service (e.g. "jbossas"). +NAME=`basename $0` +if [ ${NAME:0:1} = "S" -o ${NAME:0:1} = "K" ]; then + NAME=${NAME:3} +fi + +# Set names of pid, lock, and log files - all based on the service name. +PIDFILE="/var/run/$NAME.pid" +LOCKFILE="/var/lock/subsys/$NAME" +LOGFILE="/var/log/$NAME.log" + +# Set defaults for optional configuration variables. +JAVA_HOME="/usr/java/default" +JAVA_OPTS="-Xms128M -Xmx512M -XX:MaxPermSize=256M" +JAVA_OPTS="$JAVA_OPTS -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000" +# (Prefer IPv4 stack as as temporary workaround to avoid 'all' config startup +# issues from IPv4 multicast addresses. See JBAS-7936.) +JAVA_OPTS="$JAVA_OPTS -Djava.net.preferIPv4Stack=true" + +# Source the service's config file, potentially overriding the defaults set +# above. +CONFIG="/etc/sysconfig/${NAME}" +if [ ! -f "$CONFIG" ]; then + echo "Required configuration file $CONFIG not found." >&2 + exit 1 +fi +. "$CONFIG" + +# Bail out if required variables were not set in the config file. +if [ -z "$JBOSS_HOME" ]; then + echo "Required variable JBOSS_HOME was not set in $CONFIG." >&2 + exit 1 +fi + + +start() +{ + # See if the service is already running, and, if so, exit with an error. + PID=`pidfileofproc "$NAME"` + if [ -n "$PID" ]; then + # pid file exists - see if process is actually running. + kill -0 $PID 2>/dev/null + if [ $? -eq 0 ]; then + echo "$NAME service is already running (pid=$PID)." >&2 + exit 1 + else + echo "Removing bogus pid file $PIDFILE..." + rm -f "$PIDFILE" + if [ -f "$LOCKFILE" ]; then + echo "Removing bogus lock file $LOCKFILE..." + rm -f "$LOCKFILE" + fi + fi + fi + + # Check that JAVA_HOME is valid. + JAVA="$JAVA_HOME/bin/java" + if [ ! -f "$JAVA" ]; then + echo "Java not found at $JAVA - please set JAVA_HOME in $CONFIG." >&2 + exit 1 + fi + if [ ! -x "$JAVA" ]; then + echo "$JAVA is not executable." >&2 + exit 5 + fi + + # Setup the classpath + JBOSS_BOOT_CLASSPATH="$JBOSS_HOME/bin/run.jar" + if [ ! -f "$JBOSS_BOOT_CLASSPATH" ]; then + echo "Missing required file: $JBOSS_BOOT_CLASSPATH" >&2 + exit 1 + fi + + # By default, Tomcat uses the JDT Compiler for compiling JSPs. However, + # include tools.jar in the classpath if we can find it under JAVA_HOME + # or if the user specified it via the JAVAC_JAR variable. + JAVAC_JAR_FILE="${JAVAC_JAR:-$JAVA_HOME/lib/tools.jar}" + if [ ! -f "$JAVAC_JAR_FILE" ]; then + [ -n "$JAVAC_JAR" ] && echo "Missing javac jar file $JAVAC_JAR as defined by the JAVAC_JAR variable. Unexpected results may occur." + unset JAVAC_JAR_FILE + fi + + # If -server not set in JAVA_OPTS, set it, if supported. + SERVER_SET=`echo $JAVA_OPTS | grep "-server"` + if [ -z "$SERVER_SET" ]; then + # Check for Sun JVM w/ HotSpot support. + HAS_HOTSPOT=`"$JAVA" -version 2>&1 | grep -i HotSpot` + + # Check for OpenJDK JVM w/ server support. + HAS_OPENJDK=`"$JAVA" -version 2>&1 | grep -i OpenJDK` + + # Enable -server if we have Hotspot or OpenJDK, unless we can't + if [ -n "$HAS_HOTSPOT" ] || [ -n "$HAS_OPENJDK" ]; then + JAVA_OPTS="-server $JAVA_OPTS" + fi + fi + + # Setup JBoss-specific properties. + JAVA_OPTS="-Dprogram.name=$NAME $JAVA_OPTS" + + # Setup JBoss Native library path. + unset JBOSS_NATIVE_DIR + for DIR in "$JBOSS_HOME/../native/lib" "$JBOSS_HOME/../native" "$JBOSS_HOME/../native/lib64" "$JBOSS_HOME/native/lib64" "$JBOSS_HOME/native/bin" "$JBOSS_HOME/bin/native"; do + if [ -d "$DIR" ]; then + JBOSS_NATIVE_DIR=`cd "$DIR/.." && pwd` + break + fi + done + if [ -d "$JBOSS_NATIVE_DIR" ]; then + IS_64_BIT_JVM=`"$JAVA" $JAVA_OPTS -version 2>&1 | grep -i 64-bit` + if [ -n "$IS_64_BIT_JVM" ]; then + JBOSS_NATIVE_DIR="$JBOSS_NATIVE_DIR/lib64" + else + JBOSS_NATIVE_DIR="$JBOSS_NATIVE_DIR/lib" + fi + LD_LIBRARY_PATH="$JBOSS_NATIVE_DIR${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" + export LD_LIBRARY_PATH + JAVA_OPTS="$JAVA_OPTS -Djava.library.path=$LD_LIBRARY_PATH" + fi + + # Setup the Java endorsed dirs. + JBOSS_ENDORSED_DIRS="$JBOSS_HOME/lib/endorsed" + JAVA_OPTS="$JAVA_OPTS -Djava.endorsed.dirs="$JBOSS_ENDORSED_DIRS"" + + # Setup the Java classpath. + JBOSS_CLASSPATH="${JBOSS_CLASSPATH:+$JBOSS_CLASSPATH:$JBOSS_BOOT_CLASSPATH}" + JBOSS_CLASSPATH="${JBOSS_CLASSPATH:-$JBOSS_BOOT_CLASSPATH}" + JBOSS_CLASSPATH="$JBOSS_CLASSPATH${JAVAC_JAR_FILE:+:$JAVAC_JAR_FILE}" + JAVA_OPTS="$JAVA_OPTS -classpath "$JBOSS_CLASSPATH"" + + # Display a summary of our environment if we're associated with a terminal. + if tty -s; then + echo "========================================================================="; echo + echo " JBoss AS Bootstrap Environment" ; echo + echo " JBOSS_HOME: $JBOSS_HOME" ; echo + echo " JAVA: $JAVA" ; echo + echo " JAVA_OPTS: $JAVA_OPTS" ; echo + echo " JBOSS_OPTS: $JBOSS_OPTS" ; echo + echo "========================================================================="; echo + fi + + # JBoss AS expects its current working dir to be $JBOSS_HOME/bin + cd "$JBOSS_HOME/bin" + + # JBoss AS expects JBOSS_HOME to be set in its environment. + export JBOSS_HOME + + # We only need to bother with nohup if we're associated with a terminal. + if tty -s; then + NOHUP=nohup + else + unset NOHUP + fi + + # If they set NICELEVEL in the config file, honor it. + [ -n "${NICELEVEL:-}" ] && NICE="nice -n $NICELEVEL" + + # If JBOSS_USER was specified in the config and current user is root, we + # want to setuid the JBoss AS process to JBOSS_USER. + if [ -n "$JBOSS_USER" ] && [ "$EUID" -eq 0 ]; then + # For SELinux we need to use 'runuser', not 'su'. + if [ -x /sbin/runuser ]; then + SU=runuser + else + SU=su + fi + else + unset SU + fi + + if [ -n "$SU" ]; then + WRAPPER="$NOHUP $NICE $SU -s /bin/bash - $JBOSS_USER -c" + else + WRAPPER="$NOHUP $NICE bash -c" + fi + + # Make sure log file exists and has correct ownership and permissions. + if [ "$EUID" -eq 0 ]; then + touch -a "$LOGFILE" || exit 4 + [ -n "$JBOSS_USER" ] && chown $JBOSS_USER "$LOGFILE" + [ -n "$JBOSS_GROUP" ] && chgrp $JBOSS_GROUP "$LOGFILE" + chmod u=rw "$LOGFILE" + [ -n "$JBOSS_GROUP" ] && chmod g+r "$LOGFILE" + [ -x /sbin/restorecon ] && /sbin/restorecon "$LOGFILE" + fi + + # Make sure pid file has correct ownership and permissions. + if [ "$EUID" -eq 0 ] && [ -f "$PIDFILE" ]; then + [ -n "$JBOSS_USER" ] && chown $JBOSS_USER "$PIDFILE" + [ -n "$JBOSS_GROUP" ] && chgrp $JBOSS_GROUP "$PIDFILE" + chmod u=rw "$PIDFILE" + [ -n "$JBOSS_GROUP" ] && chmod g+r + [ -x /sbin/restorecon ] && /sbin/restorecon "$PIDFILE" + fi + + echo -n "Starting $NAME service: " + + # Make sure to escape the $$'s within the subshell to prevent our own shell + # from evaluating them and writing our own pid to the pid file. + $WRAPPER "echo $$ >"$PIDFILE" || ( echo "Failed to write pid ($$) to $PIDFILE." >&2; exit 4 ); exec "$JAVA" $JAVA_OPTS org.jboss.Main $JBOSS_OPTS" >>"$LOGFILE" 2>&1 & + if [ $? -ne 0 ]; then + failure "$NAME startup" + echo + EXIT_STATUS=$? + fi + + # Wait a few seconds and then check that the process is running. Note, this + # will *not* verify that JBoss AS started properly without any configuration + # or deployment errors. + sleep 3 + + if pidfileofproc "$NAME"; then + success "$NAME startup" + echo + touch "$LOCKFILE" + EXIT_STATUS=0 + else + failure "$NAME startup" + echo + EXIT_STATUS=1 + fi +} + +stop() +{ + # See if service is running, and, if not, exit without any error. + PID=`pidfileofproc "$NAME"` + unset NOT_RUNNING + if [ -z "$PID" ]; then + NOT_RUNNING=1 + else + # pid file exists - see if process is actually running. + kill -0 $PID 2>/dev/null + if [ $? -ne 0 ]; then + NOT_RUNNING=1 + if [ -f "$PIDFILE" ]; then + echo "Removing bogus pid file $PIDFILE..." + rm -f "$PIDFILE" + fi + if [ -f "$LOCKFILE" ]; then + echo "Removing bogus lock file $LOCKFILE..." + rm -f "$LOCKFILE" + fi + fi + fi + if [ -n "$NOT_RUNNING" ]; then + echo "$NAME service is not running." + exit 0 + fi + + echo -n "Stopping $NAME service: " + killproc -d 30 "$NAME" + EXIT_STATUS=$? + if [ $EXIT_STATUS -eq 0 ]; then + rm -f "$LOCKFILE" + fi + echo +} + +# NOTE: We don't name this function 'status', since that would override the +# 'status function defined in /etc/init.d/functions. +_status() +{ + status "$NAME" + EXIT_CODE=$? +} + +restart() +{ + stop || exit $? + start +} + +condrestart() +{ + [ -f "$PIDFILE" ] && restart +} + +usage() +{ + echo "Usage: $NAME {start|stop|status|restart|condrestart}" >&2 + EXIT_CODE=2 +} + +# The +case "$1" in + start) + start + ;; + stop) + stop + ;; + status) + _status + ;; + restart) + restart + ;; + condrestart) + condrestart + ;; + *) + usage + ;; +esac + +exit $EXIT_STATUS + diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/petstore-db.changelog.xml b/etc/samples/provisioning/sample-bundle/src/main/petstore/petstore-db.changelog.xml new file mode 100644 index 0000000..42ced88 --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/petstore/petstore-db.changelog.xml @@ -0,0 +1,187 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog/1.9" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog/1.9 http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-1.9.xsd"> + <changeSet author="ips (generated)" id="1272025063915-1"> + <createTable schemaName="APP" tableName="ADDRESS"> + <column name="ADDRESSID" type="VARCHAR(10)"> + <constraints nullable="false" primaryKey="true" primaryKeyName="SQL100422173635960"/> + </column> + <column name="STREET1" type="VARCHAR(55)"> + <constraints nullable="false"/> + </column> + <column name="STREET2" type="VARCHAR(55)"/> + <column name="CITY" type="VARCHAR(55)"> + <constraints nullable="false"/> + </column> + <column name="STATE" type="VARCHAR(25)"> + <constraints nullable="false"/> + </column> + <column name="ZIP" type="VARCHAR(5)"> + <constraints nullable="false"/> + </column> + <column name="LATITUDE" type="DECIMAL(14,10)"> + <constraints nullable="false"/> + </column> + <column name="LONGITUDE" type="DECIMAL(14,10)"> + <constraints nullable="false"/> + </column> + </createTable> + </changeSet> + <changeSet author="ips (generated)" id="1272025063915-2"> + <createTable schemaName="APP" tableName="CATEGORY"> + <column name="CATEGORYID" type="VARCHAR(10)"> + <constraints nullable="false" primaryKey="true" primaryKeyName="SQL100422173635550"/> + </column> + <column name="NAME" type="VARCHAR(25)"> + <constraints nullable="false"/> + </column> + <column name="DESCRIPTION" type="VARCHAR(255)"> + <constraints nullable="false"/> + </column> + <column name="IMAGEURL" type="VARCHAR(55)"/> + </createTable> + </changeSet> + <changeSet author="ips (generated)" id="1272025063915-3"> + <createTable schemaName="APP" tableName="ID_GEN"> + <column name="GEN_KEY" type="VARCHAR(20)"> + <constraints nullable="false" primaryKey="true" primaryKeyName="SQL100422173636590"/> + </column> + <column name="GEN_VALUE" type="INT"> + <constraints nullable="false"/> + </column> + </createTable> + </changeSet> + <changeSet author="ips (generated)" id="1272025063915-4"> + <createTable schemaName="APP" tableName="ITEM"> + <column name="ITEMID" type="VARCHAR(10)"> + <constraints nullable="false" primaryKey="true" primaryKeyName="SQL100422173636230"/> + </column> + <column name="PRODUCTID" type="VARCHAR(10)"> + <constraints nullable="false"/> + </column> + <column name="NAME" type="VARCHAR(30)"> + <constraints nullable="false"/> + </column> + <column name="DESCRIPTION" type="VARCHAR(500)"> + <constraints nullable="false"/> + </column> + <column name="IMAGEURL" type="VARCHAR(55)"/> + <column name="IMAGETHUMBURL" type="VARCHAR(55)"/> + <column name="PRICE" type="DECIMAL(14,2)"> + <constraints nullable="false"/> + </column> + <column name="ADDRESS_ADDRESSID" type="VARCHAR(10)"> + <constraints nullable="false"/> + </column> + <column name="CONTACTINFO_CONTACTINFOID" type="VARCHAR(10)"> + <constraints nullable="false"/> + </column> + <column name="TOTALSCORE" type="INT"> + <constraints nullable="false"/> + </column> + <column name="NUMBEROFVOTES" type="INT"> + <constraints nullable="false"/> + </column> + <column name="DISABLED" type="INT"> + <constraints nullable="false"/> + </column> + </createTable> + </changeSet> + <changeSet author="ips (generated)" id="1272025063915-5"> + <createTable schemaName="APP" tableName="PRODUCT"> + <column name="PRODUCTID" type="VARCHAR(10)"> + <constraints nullable="false" primaryKey="true" primaryKeyName="SQL100422173635740"/> + </column> + <column name="CATEGORYID" type="VARCHAR(10)"> + <constraints nullable="false"/> + </column> + <column name="NAME" type="VARCHAR(25)"> + <constraints nullable="false"/> + </column> + <column name="DESCRIPTION" type="VARCHAR(255)"> + <constraints nullable="false"/> + </column> + <column name="IMAGEURL" type="VARCHAR(55)"/> + </createTable> + </changeSet> + <changeSet author="ips (generated)" id="1272025063915-6"> + <createTable schemaName="APP" tableName="SELLERCONTACTINFO"> + <column name="CONTACTINFOID" type="VARCHAR(10)"> + <constraints nullable="false" primaryKey="true" primaryKeyName="SQL100422173636080"/> + </column> + <column name="LASTNAME" type="VARCHAR(24)"> + <constraints nullable="false"/> + </column> + <column name="FIRSTNAME" type="VARCHAR(24)"> + <constraints nullable="false"/> + </column> + <column name="EMAIL" type="VARCHAR(24)"> + <constraints nullable="false"/> + </column> + </createTable> + </changeSet> + <changeSet author="ips (generated)" id="1272025063915-7"> + <createTable schemaName="APP" tableName="TAG"> + <column name="TAGID" type="INT"> + <constraints nullable="false" primaryKey="true" primaryKeyName="SQL100422173636830"/> + </column> + <column name="TAG" type="VARCHAR(30)"> + <constraints nullable="false"/> + </column> + <column name="REFCOUNT" type="INT"> + <constraints nullable="false"/> + </column> + </createTable> + </changeSet> + <changeSet author="ips (generated)" id="1272025063915-8"> + <createTable schemaName="APP" tableName="TAG_ITEM"> + <column name="TAGID" type="INT"> + <constraints nullable="false"/> + </column> + <column name="ITEMID" type="VARCHAR(10)"> + <constraints nullable="false"/> + </column> + </createTable> + </changeSet> + <changeSet author="ips (generated)" id="1272025063915-9"> + <createTable schemaName="APP" tableName="ZIPLOCATION"> + <column name="ZIPCODE" type="INT"> + <constraints nullable="false" primaryKey="true" primaryKeyName="SQL100422173636710"/> + </column> + <column name="CITY" type="VARCHAR(30)"> + <constraints nullable="false"/> + </column> + <column name="STATE" type="VARCHAR(2)"> + <constraints nullable="false"/> + </column> + </createTable> + </changeSet> + <changeSet author="ips (generated)" id="1272025063915-10"> + <createIndex indexName="SQL100422173636831" schemaName="APP" tableName="TAG" unique="true"> + <column name="TAG"/> + </createIndex> + </changeSet> + <changeSet author="ips (generated)" id="1272025063915-11"> + <createIndex indexName="SQL100422173637010" schemaName="APP" tableName="TAG_ITEM" unique="true"> + <column name="TAGID"/> + <column name="ITEMID"/> + </createIndex> + </changeSet> + <changeSet author="ips (generated)" id="1272025063915-12"> + <addForeignKeyConstraint baseColumnNames="ADDRESS_ADDRESSID" baseTableName="ITEM" baseTableSchemaName="APP" constraintName="SQL100422173636231" deferrable="false" initiallyDeferred="false" referencedColumnNames="ADDRESSID" referencedTableName="ADDRESS" referencedTableSchemaName="APP"/> + </changeSet> + <changeSet author="ips (generated)" id="1272025063915-13"> + <addForeignKeyConstraint baseColumnNames="CONTACTINFO_CONTACTINFOID" baseTableName="ITEM" baseTableSchemaName="APP" constraintName="SQL100422173636233" deferrable="false" initiallyDeferred="false" referencedColumnNames="CONTACTINFOID" referencedTableName="SELLERCONTACTINFO" referencedTableSchemaName="APP"/> + </changeSet> + <changeSet author="ips (generated)" id="1272025063915-14"> + <addForeignKeyConstraint baseColumnNames="PRODUCTID" baseTableName="ITEM" baseTableSchemaName="APP" constraintName="SQL100422173636232" deferrable="false" initiallyDeferred="false" referencedColumnNames="PRODUCTID" referencedTableName="PRODUCT" referencedTableSchemaName="APP"/> + </changeSet> + <changeSet author="ips (generated)" id="1272025063915-15"> + <addForeignKeyConstraint baseColumnNames="CATEGORYID" baseTableName="PRODUCT" baseTableSchemaName="APP" constraintName="SQL100422173635741" deferrable="false" initiallyDeferred="false" referencedColumnNames="CATEGORYID" referencedTableName="CATEGORY" referencedTableSchemaName="APP"/> + </changeSet> + <changeSet author="ips (generated)" id="1272025063915-16"> + <addForeignKeyConstraint baseColumnNames="ITEMID" baseTableName="TAG_ITEM" baseTableSchemaName="APP" constraintName="SQL100422173637011" deferrable="false" initiallyDeferred="false" referencedColumnNames="ITEMID" referencedTableName="ITEM" referencedTableSchemaName="APP"/> + </changeSet> + <changeSet author="ips (generated)" id="1272025063915-17"> + <addForeignKeyConstraint baseColumnNames="TAGID" baseTableName="TAG_ITEM" baseTableSchemaName="APP" constraintName="SQL100422173637012" deferrable="false" initiallyDeferred="false" referencedColumnNames="TAGID" referencedTableName="TAG" referencedTableSchemaName="APP"/> + </changeSet> +</databaseChangeLog> diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore-ds.xml b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore-ds.xml new file mode 100644 index 0000000..ae5ea7c --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore-ds.xml @@ -0,0 +1,42 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!-- The Derby embedded database JCA connection factory config --> +<!-- See http://www.jboss.org/community/wiki/Multiple1PC for information about local-tx-datasource --> +<!-- $Id: derby-ds.xml 97536 2009-12-08 14:05:07Z jesper.pedersen $ --> + +<datasources> + + <local-tx-datasource> + + <!-- The jndi name of the DataSource, it is prefixed with java:/ --> + <!-- Datasources are not available outside the virtual machine --> + <jndi-name>jdbc/PetstoreDB</jndi-name> + + <!-- for in-process persistent db, saved when jboss stops. The + org.jboss.jdbc.DerbyDatabase mbean is necessary for properly db shutdown --> + <connection-url>jdbc:derby://localhost:1527/petstore;create=true</connection-url> + + <!-- The driver class --> + <driver-class>org.apache.derby.jdbc.ClientDriver</driver-class> + + <!-- The login and password --> + <user-name>APP</user-name> + <password>APP</password> + + <!-- The minimum connections in a pool/sub-pool. Pools are lazily constructed on first use --> + <min-pool-size>5</min-pool-size> + + <!-- The maximum connections in a pool/sub-pool --> + <max-pool-size>20</max-pool-size> + + <!-- The time before an unused connection is destroyed --> + <idle-timeout-minutes>5</idle-timeout-minutes> + + <!-- Whether to check all statements are closed when the connection is returned to the pool, + this is a debugging feature that should be turned off in production --> + <track-statements/> + + </local-tx-datasource> + +</datasources> + diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/META-INF/application.xml b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/META-INF/application.xml new file mode 100644 index 0000000..eadc0f4 --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/META-INF/application.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<application xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/application_1_4.xsd" version="1.4"> + + <display-name>Java Pet Store</display-name> + + <module> + <web> + <web-uri>petstore.war</web-uri> + <context-root>/petstore</context-root> + </web> + </module> + + <module> + <ejb>petstore-ejb.jar</ejb> + </module> + +</application> + diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore-ejb.jar/META-INF/persistence.xml b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore-ejb.jar/META-INF/persistence.xml new file mode 100644 index 0000000..76e0703 --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore-ejb.jar/META-INF/persistence.xml @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd%22%3E + + <persistence-unit name="PetstorePu"> + <description>Petstore Persistence Unit</description> + <provider>org.hibernate.ejb.HibernatePersistence</provider> + <jta-data-source>java:jdbc/PetstoreDB</jta-data-source> + <non-jta-data-source>java:jdbc/PetstoreDB</non-jta-data-source> + <properties> + <property name="hibernate.dialect" value="org.hibernate.dialect.DerbyDialect"/> + <property name="hibernate.connection.username" value="APP"/> + <property name="hibernate.connection.password" value="APP"/> + <property name="hibernate.format_sql" value="true"/> + </properties> + </persistence-unit> + +</persistence> + diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore-ejb.jar/com/sun/javaee/blueprints/petstore/model/Address.class b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore-ejb.jar/com/sun/javaee/blueprints/petstore/model/Address.class new file mode 100644 index 0000000..c9dc392 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore-ejb.jar/com/sun/javaee/blueprints/petstore/model/Address.class differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore-ejb.jar/com/sun/javaee/blueprints/petstore/model/Category.class b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore-ejb.jar/com/sun/javaee/blueprints/petstore/model/Category.class new file mode 100644 index 0000000..be2275b Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore-ejb.jar/com/sun/javaee/blueprints/petstore/model/Category.class differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore-ejb.jar/com/sun/javaee/blueprints/petstore/model/Item.class b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore-ejb.jar/com/sun/javaee/blueprints/petstore/model/Item.class new file mode 100644 index 0000000..8842106 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore-ejb.jar/com/sun/javaee/blueprints/petstore/model/Item.class differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore-ejb.jar/com/sun/javaee/blueprints/petstore/model/Product.class b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore-ejb.jar/com/sun/javaee/blueprints/petstore/model/Product.class new file mode 100644 index 0000000..dda3feb Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore-ejb.jar/com/sun/javaee/blueprints/petstore/model/Product.class differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore-ejb.jar/com/sun/javaee/blueprints/petstore/model/SellerContactInfo.class b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore-ejb.jar/com/sun/javaee/blueprints/petstore/model/SellerContactInfo.class new file mode 100644 index 0000000..b5dbe74 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore-ejb.jar/com/sun/javaee/blueprints/petstore/model/SellerContactInfo.class differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore-ejb.jar/com/sun/javaee/blueprints/petstore/model/Tag.class b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore-ejb.jar/com/sun/javaee/blueprints/petstore/model/Tag.class new file mode 100644 index 0000000..1b5785b Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore-ejb.jar/com/sun/javaee/blueprints/petstore/model/Tag.class differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore-ejb.jar/com/sun/javaee/blueprints/petstore/model/ZipLocation.class b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore-ejb.jar/com/sun/javaee/blueprints/petstore/model/ZipLocation.class new file mode 100644 index 0000000..591af10 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore-ejb.jar/com/sun/javaee/blueprints/petstore/model/ZipLocation.class differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/META-INF/MANIFEST.MF b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/META-INF/MANIFEST.MF new file mode 100644 index 0000000..7a679c4 --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/META-INF/MANIFEST.MF @@ -0,0 +1,4 @@ +Manifest-Version: 1.0 +Ant-Version: Apache Ant 1.7.1 +Created-By: 16.0-b13 (Sun Microsystems Inc.) + diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/captcha/BlueFilter.class b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/captcha/BlueFilter.class new file mode 100644 index 0000000..abac5a6 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/captcha/BlueFilter.class differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/captcha/CaptchaSingleton.class b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/captcha/CaptchaSingleton.class new file mode 100644 index 0000000..7d7af77 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/captcha/CaptchaSingleton.class differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/captcha/RandomString.class b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/captcha/RandomString.class new file mode 100644 index 0000000..b8bfa4d Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/captcha/RandomString.class differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/captcha/SimpleCaptcha.class b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/captcha/SimpleCaptcha.class new file mode 100644 index 0000000..8c469f4 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/captcha/SimpleCaptcha.class differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/AddressBean.class b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/AddressBean.class new file mode 100644 index 0000000..e2b4ca5 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/AddressBean.class differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/AutocompleteBean.class b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/AutocompleteBean.class new file mode 100644 index 0000000..223289e Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/AutocompleteBean.class differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/CaptchaValidateFilter.class b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/CaptchaValidateFilter.class new file mode 100644 index 0000000..61f3863 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/CaptchaValidateFilter.class differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/ControllerAction.class b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/ControllerAction.class new file mode 100644 index 0000000..7c149e3 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/ControllerAction.class differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/ControllerServlet.class b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/ControllerServlet.class new file mode 100644 index 0000000..c5fb59a Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/ControllerServlet.class differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/EntryFilter.class b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/EntryFilter.class new file mode 100644 index 0000000..65d4cdb Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/EntryFilter.class differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/FileUploadBean.class b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/FileUploadBean.class new file mode 100644 index 0000000..1ee72ad Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/FileUploadBean.class differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/actions/CaptchaAction.class b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/actions/CaptchaAction.class new file mode 100644 index 0000000..f56c35e Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/actions/CaptchaAction.class differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/actions/CatalogXmlAction.class b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/actions/CatalogXmlAction.class new file mode 100644 index 0000000..56fc53d Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/actions/CatalogXmlAction.class differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/actions/DefaultControllerAction.class b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/actions/DefaultControllerAction.class new file mode 100644 index 0000000..ee55705 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/actions/DefaultControllerAction.class differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/actions/ImageAction.class b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/actions/ImageAction.class new file mode 100644 index 0000000..30e70ab Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/actions/ImageAction.class differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/actions/TagXmlAction.class b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/actions/TagXmlAction.class new file mode 100644 index 0000000..dd5b7c1 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/actions/TagXmlAction.class differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/mapviewer/MapBean.class b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/mapviewer/MapBean.class new file mode 100644 index 0000000..03400b2 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/mapviewer/MapBean.class differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/model/CatalogFacade.class b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/model/CatalogFacade.class new file mode 100644 index 0000000..23a204c Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/model/CatalogFacade.class differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/model/FileUploadResponse.class b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/model/FileUploadResponse.class new file mode 100644 index 0000000..18f8102 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/model/FileUploadResponse.class differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/model/PayPalBean.class b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/model/PayPalBean.class new file mode 100644 index 0000000..b6e2b0d Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/model/PayPalBean.class differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/model/RatingBean.class b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/model/RatingBean.class new file mode 100644 index 0000000..be21196 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/model/RatingBean.class differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/proxy/GeoCoder.class b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/proxy/GeoCoder.class new file mode 100644 index 0000000..185dc01 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/proxy/GeoCoder.class differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/proxy/GeoPoint.class b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/proxy/GeoPoint.class new file mode 100644 index 0000000..18b3463 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/proxy/GeoPoint.class differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/search/HTMLParser$CallbackHandler.class b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/search/HTMLParser$CallbackHandler.class new file mode 100644 index 0000000..0c448bf Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/search/HTMLParser$CallbackHandler.class differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/search/HTMLParser.class b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/search/HTMLParser.class new file mode 100644 index 0000000..4a19fad Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/search/HTMLParser.class differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/search/IndexDocument.class b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/search/IndexDocument.class new file mode 100644 index 0000000..a8b6521 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/search/IndexDocument.class differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/search/Indexer.class b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/search/Indexer.class new file mode 100644 index 0000000..2b42389 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/search/Indexer.class differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/search/SQLParser.class b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/search/SQLParser.class new file mode 100644 index 0000000..8ab0084 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/search/SQLParser.class differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/search/SearchBean.class b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/search/SearchBean.class new file mode 100644 index 0000000..a4cc2bf Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/search/SearchBean.class differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/search/SearchIndex.class b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/search/SearchIndex.class new file mode 100644 index 0000000..50007c4 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/search/SearchIndex.class differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/search/UpdateIndex.class b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/search/UpdateIndex.class new file mode 100644 index 0000000..1ef9761 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/search/UpdateIndex.class differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/util/ImageScaler.class b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/util/ImageScaler.class new file mode 100644 index 0000000..5570fac Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/util/ImageScaler.class differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/util/LogStrings.properties b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/util/LogStrings.properties new file mode 100644 index 0000000..112905d --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/util/LogStrings.properties @@ -0,0 +1,10 @@ +index.exception=An exception was encountered while indexing the data. Please checked to make sure there indexes are not locked by another user. +index.sql.statement=Select statement used for retrieving database data "{0}" +search.string=Searching indexes for string "{0}" +search.results=Search String returned "{0}" hits +search.exception=An exception was encountered while performing the search. Please check to make sure the indexes exist. +fileupload.persist.exception=Error persisting seller data +fileupload.rollback.exception=Persisting seller data, rollback failed +geocoder.lookup.exception=The GeoCode address lookup from Yahoo has returned and Exception +image_does_not_exist=The image doesn't exist in the default image directory or in the upload directory "{0}" +resource_bundle_does_not_exist=The MessageStrings.properties file does not exist!. diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/util/MessageStrings.properties b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/util/MessageStrings.properties new file mode 100644 index 0000000..7ca2d9d --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/util/MessageStrings.properties @@ -0,0 +1,10 @@ +invalid_contact_firstname=First Name is required. +invalid_contact_lastname=Last Name is required. +invalid_address_street1=Street is required. +invalid_address_city=City is required. +invalid_address_state=State is required. +invalid_address_zip=Zip Code is required. +invalid_item_name=Pet Name is required. +invalid_item_description=The Description should exist and the field can't have a '<script>' and/or a '<link>' tag in it. +invalid_item_price=Price should should exist and be a number greater or equal to 0. +invalid_item_imageurl=The image upload file must exist and be of type '.jpg', '.gif' or '.png'. diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/util/PetstoreConstants.class b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/util/PetstoreConstants.class new file mode 100644 index 0000000..5aa4b42 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/util/PetstoreConstants.class differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/util/PetstoreUtil.class b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/util/PetstoreUtil.class new file mode 100644 index 0000000..a521d71 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/util/PetstoreUtil.class differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/faces-config.xml b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/faces-config.xml new file mode 100644 index 0000000..22f03df --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/faces-config.xml @@ -0,0 +1,94 @@ +<?xml version='1.0' encoding='UTF-8'?> + +<!-- Copyright 2006 Sun Microsystems, Inc. All rights reserved. You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at: + http://developer.sun.com/berkeley_license.html + $Id: faces-config.xml,v 1.13 2006/05/03 22:03:20 inder Exp $ --> + +<faces-config xmlns="http://java.sun.com/xml/ns/javaee" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd" + version="1.2"> + <!-- ========== Application Wide Features ================================ --> + + <!-- ========== Managed Beans ============================================ --> + <managed-bean> + <managed-bean-name>SearchBean</managed-bean-name> + <managed-bean-class>com.sun.javaee.blueprints.petstore.search.SearchBean</managed-bean-class> + <managed-bean-scope>session</managed-bean-scope> + </managed-bean> + + <managed-bean> + <managed-bean-name>RatingBean</managed-bean-name> + <managed-bean-class>com.sun.javaee.blueprints.petstore.model.RatingBean</managed-bean-class> + <managed-bean-scope>request</managed-bean-scope> + <managed-property> + <property-name>itemId</property-name> + <value>#{param.itemIdBinding}</value> + </managed-property> + </managed-bean> + + <managed-bean> + <managed-bean-name>PayPalBean</managed-bean-name> + <managed-bean-class>com.sun.javaee.blueprints.petstore.model.PayPalBean</managed-bean-class> + <managed-bean-scope>session</managed-bean-scope> + </managed-bean> + + <managed-bean> + <managed-bean-name>FileUploadBean</managed-bean-name> + <managed-bean-class>com.sun.javaee.blueprints.petstore.controller.FileUploadBean</managed-bean-class> + <managed-bean-scope>session</managed-bean-scope> + </managed-bean> + + <managed-bean> + <managed-bean-name>MapBean</managed-bean-name> + <managed-bean-class>com.sun.javaee.blueprints.petstore.mapviewer.MapBean</managed-bean-class> + <managed-bean-scope>session</managed-bean-scope> + </managed-bean> + + <managed-bean> + <managed-bean-name>AutocompleteBean</managed-bean-name> + <managed-bean-class>com.sun.javaee.blueprints.petstore.controller.AutocompleteBean</managed-bean-class> + <managed-bean-scope>session</managed-bean-scope> + </managed-bean> + + <managed-bean> + <managed-bean-name>AddressBean</managed-bean-name> + <managed-bean-class>com.sun.javaee.blueprints.petstore.controller.AddressBean</managed-bean-class> + <managed-bean-scope>session</managed-bean-scope> + </managed-bean> + + <!-- ========== Navigation Rules ========================================= --> + <navigation-rule> + <from-view-id>/mapLocation.jsp</from-view-id> + <navigation-case> + <from-outcome>map</from-outcome> + <to-view-id>/map.jsp</to-view-id> + </navigation-case> + </navigation-rule> + <navigation-rule> + <from-view-id>/mapAll.jsp</from-view-id> + <navigation-case> + <from-outcome>map</from-outcome> + <to-view-id>/map.jsp</to-view-id> + </navigation-case> + </navigation-rule> + <navigation-rule> + <from-view-id>/map.jsp</from-view-id> + <navigation-case> + <to-view-id>/mapLocation.jsp</to-view-id> + </navigation-case> + </navigation-rule> + <navigation-rule> + <from-view-id>/search.jsp</from-view-id> + <navigation-case> + <from-outcome>displayResults</from-outcome> + <to-view-id>/search.jsp</to-view-id> + </navigation-case> + <navigation-case> + <from-outcome>map</from-outcome> + <to-view-id>/map.jsp</to-view-id> + </navigation-case> + </navigation-rule> + +</faces-config> + diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/jboss-web.xml b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/jboss-web.xml new file mode 100644 index 0000000..0862993 --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/jboss-web.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<jboss-web> + <resource-ref> + <res-ref-name>jdbc/PetstoreDB</res-ref-name> + <res-type>javax.sql.DataSource</res-type> + <jndi-name>java:jdbc/PetstoreDB</jndi-name> + </resource-ref> +</jboss-web> + diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/bp-ui-5.jar b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/bp-ui-5.jar new file mode 100644 index 0000000..f6bd6d2 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/bp-ui-5.jar differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/commons-fileupload-1.1.1.jar b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/commons-fileupload-1.1.1.jar new file mode 100644 index 0000000..fc5763d Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/commons-fileupload-1.1.1.jar differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/commons-io-1.2.jar b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/commons-io-1.2.jar new file mode 100644 index 0000000..b2867cd Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/commons-io-1.2.jar differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/commons-logging-1.1.jar b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/commons-logging-1.1.jar new file mode 100644 index 0000000..2ff9bbd Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/commons-logging-1.1.jar differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/jdom.jar b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/jdom.jar new file mode 100644 index 0000000..288e64c Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/jdom.jar differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/lucene-core-2.0.0.jar b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/lucene-core-2.0.0.jar new file mode 100644 index 0000000..db6456f Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/lucene-core-2.0.0.jar differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/rome-0.8.jar b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/rome-0.8.jar new file mode 100644 index 0000000..27d2ad3 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/rome-0.8.jar differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/rome-fetcher-0.7.jar b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/rome-fetcher-0.7.jar new file mode 100644 index 0000000..c2a26da Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/rome-fetcher-0.7.jar differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/shale-remoting.jar b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/shale-remoting.jar new file mode 100644 index 0000000..128045d Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/shale-remoting.jar differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/sun-web.xml b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/sun-web.xml new file mode 100644 index 0000000..a9c411b --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/sun-web.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE sun-web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Application Server 9.0 Servlet 2.5//EN" "http://www.sun.com/software/appserver/dtds/sun-web-app_2_5-0.dtd"> +<sun-web-app error-url=""> + <context-root>/petstore</context-root> + <class-loader delegate="true"/> + <jsp-config> + <property name="classdebuginfo" value="true"> + <description>Enable debug info compilation in the generated servlet class</description> + </property> + <property name="mappedfile" value="true"> + <description>Maintain a one-to-one correspondence between static content and the generated servlet class' java code</description> + </property> + </jsp-config> +</sun-web-app> diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/web.xml b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/web.xml new file mode 100644 index 0000000..6c65069 --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/web.xml @@ -0,0 +1,126 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- Copyright 2006 Sun Microsystems, Inc. All rights reserved. You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at: + http://developer.sun.com/berkeley_license.html + $Id: web.xml,v 1.27 2007/04/18 19:25:09 smitha Exp $ --> +<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"> + + <display-name>Petstore</display-name> + <filter> + <filter-name>CaptchaValidateFilter</filter-name> + <filter-class>com.sun.javaee.blueprints.petstore.controller.CaptchaValidateFilter</filter-class> + </filter> + <filter> + <filter-name>EntryFilter</filter-name> + <filter-class>com.sun.javaee.blueprints.petstore.controller.EntryFilter</filter-class> + </filter> + <filter-mapping> + <filter-name>EntryFilter</filter-name> + <url-pattern>/*</url-pattern> + </filter-mapping> + <filter-mapping> + <filter-name>CaptchaValidateFilter</filter-name> + <url-pattern>/faces/dynamic/bpui_fileupload_handler/handleFileUpload</url-pattern> + </filter-mapping> + <listener> + <listener-class>com.sun.javaee.blueprints.petstore.model.CatalogFacade</listener-class> + </listener> + + <servlet> + <display-name>ControllerServlet</display-name> + <servlet-name>ControllerServlet</servlet-name> + <servlet-class>com.sun.javaee.blueprints.petstore.controller.ControllerServlet</servlet-class> + </servlet> + + <servlet-mapping> + <servlet-name>ControllerServlet</servlet-name> + <url-pattern>/catalog</url-pattern> + </servlet-mapping> + + <servlet-mapping> + <servlet-name>ControllerServlet</servlet-name> + <url-pattern>/controller</url-pattern> + </servlet-mapping> + + <context-param> + <description> + Google Maps authorization key for "http://localhost:8080/" + To use a another URL a new map key will have to be generated from http://www.google.com/apis/maps/ + </description> + <param-name>com.sun.j2ee.blueprints.ui.mapviewer.KEY</param-name> + <param-value>ABQIAAAAyQYKk4__l80DyIsqLPvvuxTwM0brOpm-All5BF6PoaKBxRWWERSt2NPUufvDhWGdrb-pCzTZQ2vi2A</param-value> + </context-param> + + <context-param> + <param-name>javax.faces.STATE_SAVING_METHOD</param-name> + <param-value>server</param-value> + </context-param> + + <context-param> + <param-name>com.sun.faces.validateXml</param-name> + <param-value>false</param-value> + </context-param> + + <context-param> + <param-name>com.sun.faces.verifyObjects</param-name> + <param-value>false</param-value> + </context-param> + + <context-param> + <param-name>javax.faces.CONFIG_FILES</param-name> + <param-value>/WEB-INF/faces-config.xml</param-value> + </context-param> + + <!-- proxy for mapviewer --> + <context-param> + <param-name>proxyHost</param-name> + <param-value></param-value> + </context-param> + <context-param> + <param-name>proxyPort</param-name> + <param-value></param-value> + </context-param> + <!-- filter init-param not working so use servlet context --> + <context-param> + <param-name>entryPages</param-name> + <param-value>.jpg|.gif|index.html|index.jsp|fileupload.jsp|search.jsp|catalog.jsp|mapAll.jsp|tag.jsp|news.jsp</param-value> + </context-param> + + + <!-- Faces Servlet --> + <servlet> + <servlet-name>Faces Servlet</servlet-name> + <servlet-class>javax.faces.webapp.FacesServlet</servlet-class> + <load-on-startup>1</load-on-startup> + </servlet> + + <!-- Faces Servlet Mapping --> + <servlet-mapping> + <servlet-name>Faces Servlet</servlet-name> + <url-pattern>/faces/*</url-pattern> + </servlet-mapping> + + <!-- need datasource for indexing Lucene search engine --> + <servlet-mapping> + <servlet-name>ControllerServlet</servlet-name> + <url-pattern>/faces/CaptchaServlet</url-pattern> + </servlet-mapping> + <servlet-mapping> + <servlet-name>ControllerServlet</servlet-name> + <url-pattern>/ImageServlet/*</url-pattern> + </servlet-mapping> + <servlet-mapping> + <servlet-name>ControllerServlet</servlet-name> + <url-pattern>/TagServlet/*</url-pattern> + </servlet-mapping> + <error-page> + <exception-type>java.lang.RuntimeException</exception-type> + <location>/systemerror.jsp</location> + </error-page> + <resource-ref> + <res-ref-name>jdbc/PetstoreDB</res-ref-name> + <res-type>javax.sql.DataSource</res-type> + <res-auth>Container</res-auth> + <res-sharing-scope>Shareable</res-sharing-scope> + </resource-ref> +</web-app> + diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/accordion.css b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/accordion.css new file mode 100644 index 0000000..14c6ed0 --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/accordion.css @@ -0,0 +1 @@ +.accordion { width:150px; height:400px; border-width:1px; border-style:solid; border-color:black; background:#404040; }
.accordionBody { width:160px; height:400px; border-width:1px; border-style:solid; border-color:black; background:#404040; }
.accordionTitle { vertical-align: top; padding-top: 10px; text-align: center; width:150px; height:90px; color:white; font-size:22px; font-weight: bold; background:black; opacity: .99; }
.accordionRow { color:white; cursor: pointer; font-size:18px; font-weight: bold; vertical-align: middle; padding-top: 5px; text-align: center; width:150px; height:40px; background:#104E8B; opacity: .99; }
.accordionProduct { text-align: center; width:150px; color:white; font-size:12px; font-weight: bold; background:#104E8B; opacity: .99; }
.accordionLink { cursor: pointer; text-decoration: none; color:white; }
.accordionLinkSelected { text-align: center; width:150px; color:red; font-size:12px; font-weight: bold; background:black; opacity: .99; }
.accordionLinkHover { text-decoration: underline; color:white; } \ No newline at end of file diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/accordion.js b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/accordion.js new file mode 100644 index 0000000..1c1ee6b --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/accordion.js @@ -0,0 +1,249 @@ +/* Copyright 2006 Sun Microsystems, Inc. All rights reserved. You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at: http://developer.sun.com/berkeley_license.html +$Id: accordion.js,v 1.22 2006/05/03 22:00:32 inder Exp $ */ + +function AccordionMenu () { + + dojo.event.topic.subscribe("/accordion", this, this.handleEvent); + + var displayPortWidth = 100; + var HEIGHT = 400; + + var EXPANDED_HEIGHT = 125; + var ITEM_HEIGHT = 55; + var INCREMENT = 10; + + var timeout = 5; // in ms + + var accordion = document.getElementById("accordionBody"); + var divs = []; + var oExpandedIndex = -1; + var nExpandedIndex = -1; + var oHeight = ITEM_HEIGHT; + var nHeight = ITEM_HEIGHT; + var tHeight = 165; + var expanding = false; + var categories; + + // while control the inline debug statements + var debug = false; + var status = document.getElementById("status"); + + function Row(id, div, defaultHeight) { + this.id = id; + this.div = div; + //this.height = height; + this.h = defaultHeight; + this.div.style.height = defaultHeight + "px" + } + + Row.prototype.setHeight = function(nH) { + this.h = nH; + this.div.style.height = nH + "px"; + // re-adjust for ie in that it does not follow the boxmodel + if (this.div.offsetHeight > nH) { + this.div.style.height = (nH - (this.div.offsetHeight - nH)) + 'px'; + } + } + + Row.prototype.getTotalHeight = function() { + return this.div.offsetHeight; + } + + Row.prototype.getHeight = function() { + return this.h; + } + + this.handleEvent = function(args) { + if (args.type) { + if (args.type == 'expand') { + var targetRow = args.targetRow; + initiateExpansion(targetRow); + } + } + } + + this.load = function(lcategories) { + categories = lcategories; + // create all the rows + for (var l=0; l < categories.length; l++) { + var row = createRow(l,"accordionRow", ITEM_HEIGHT); + createLinks(row.div, categories[l].name, l, "accordionLink"); + divs.push(row); + } + } + + function showStatus() { + if (debug) { + var stat = "oExpandedIndex=" + oExpandedIndex + " " ; + for (var i=0; i < divs.length; i++) { + stat = stat + i + "=" + divs[i].getTotalHeight() + " "; + } + status.innerHTML = stat + " total height=" + accordion.offsetHeight; + var totalH = 0; + var tH = 0; + for (var i=0; i < divs.length; i++) { + totalH = totalH + divs[i].getHeight(); + tH = tH + divs[i].getTotalHeight(); + } + } + } + + this.showCategory = function(catid) { + for (var l=0; l < categories.length; l++) { + if (catid == categories[l].name) { + // now tell the scroller to load the first product + initiateExpansion(l); + if (categories[l].products[0]) { + dojo.event.topic.publish("/catalog", {type:"showProducts", productId:categories[l].products[0].id}); + } + break; + } + } + } + + this.showFirstCategory = function() { + initiateExpansion(0); + if (categories[0].products[0]) { + dojo.event.topic.publish("/catalog", {type:"showProducts", productId:categories[0].products[0].id}); + } + } + + this.loadCategoryItem = function(pid, itemId) { + // find the right product and expand the accordion + for (var l=0; l < categories.length; l++) { + // now tell the scroller to load the first product + for (var il=0; il < categories[l].products.length; il++) { + if (categories[l].products[il].id == pid ) { + initiateExpansion(l); + break; + } + } + } + dojo.event.topic.publish("/catalog", {type:"showItemDetails", productId: pid , itemId: itemId}); + } + + function initiateExpansion(id) { + // jump out if we are in progress + if (!expanding && oExpandedIndex != Number(id)) { + expanding = true; + nExpandedIndex = Number(id); + if (oExpandedIndex != -1) { + var targetDiv = divs[oExpandedIndex].div; + if (targetDiv && targetDiv.childNodes) { + for (var l = targetDiv.childNodes.length -1; l >= 0 ; l--) { + targetDiv.removeChild(targetDiv.childNodes[l]); + } + } + createLinks(divs[oExpandedIndex].div, categories[oExpandedIndex].name, oExpandedIndex, "accordionLink"); + } + expandRow(id); + } + } + + function expandRow() { + if (expanding) { + showStatus(); + // + if (nHeight < EXPANDED_HEIGHT) { + nHeight = nHeight + INCREMENT; + divs[nExpandedIndex].setHeight(nHeight); + if (oExpandedIndex != -1) { + if (tHeight >= ITEM_HEIGHT) { + oHeight = oHeight - INCREMENT; + // take all out of the old expanded + } else { + oHeight = oHeight - INCREMENT; + } + divs[oExpandedIndex].setHeight(oHeight); + } + // default exapnd here + } else if (oExpandedIndex != -1 && oHeight > ITEM_HEIGHT) { + oHeight = oHeight - INCREMENT; + divs[oExpandedIndex].setHeight(oHeight); + } else { + // set the contents of the new menu + var targetDiv = divs[nExpandedIndex].div; + if (targetDiv && targetDiv.childNodes) { + for (var l = targetDiv.childNodes.length -1; l >= 0 ; l--) { + targetDiv.removeChild(targetDiv.childNodes[l]); + } + } + divs[nExpandedIndex].div.appendChild(document.createTextNode(categories[nExpandedIndex].name)); + divs[nExpandedIndex].div.appendChild(document.createElement("p")); + for (var l= 0; l < categories[nExpandedIndex].products.length; l++) { + var span = document.createElement("span"); + span.className = "accordionProduct"; + var link = document.createElement("a"); + var target = categories[nExpandedIndex].products[l].id; + link.id = target; + link.className = "accordionLink"; + // some browsers aren't setting the styles for hovers so forcing them + link.setAttribute("onmouseover", "this.className='accordionLinkHover';"); + link.setAttribute("onmouseout", "this.className='accordionLink';"); + dojo.event.connect(link, "onclick", function(evt) { + this._target = target + var src; + if (evt.target) { + src = evt.target; + } else if (evt.srcElement) { + src = evt.srcElement; + } + //src.parentNode.className = "accordionLinkSelected"; + // set this so the next time around it can be removed; + dojo.event.topic.publish("/catalog", {type:"showProducts", productId:src.id}); + }); + link.appendChild(document.createTextNode(categories[nExpandedIndex].products[l].name)); + span.appendChild(link); + divs[nExpandedIndex].div.appendChild(span); + if (l < categories[nExpandedIndex].products.length - 1) { + divs[nExpandedIndex].div.appendChild(document.createElement("p")); + } + link = null; + } + expanding = false; + oExpandedIndex = nExpandedIndex; + nExpandedIndex = -1; + oHeight = nHeight; + nHeight = ITEM_HEIGHT; + return; + } + + setTimeout(expandRow, timeout); + } + } + + function createLinks(tDiv, text, id, linkStyle) { + var link = document.createElement("a"); + link.className = linkStyle; + link.appendChild(document.createTextNode(text)); + link.setAttribute("id", id); + if (link.attachEvent) { + link.attachEvent('onmouseover',function(e){initiateExpansion(e.srcElement.getAttribute("id"));}); + } else if (link.addEventListener) { + link.addEventListener('mouseover',function(e){initiateExpansion(e.currentTarget.getAttribute("id"));}, true); + } + tDiv.appendChild(link); + } + + function createRow(id, rowStyle, height) { + var nDiv = document.createElement("div"); + nDiv.className = rowStyle; + var row; + var cell; + if (accordion.insertRow) { + row = accordion.insertRow(accordion.rows.length); + + } else { + row = document.createElement("tr"); + accordion.appendChild(row); + } + if (row.inserCell) { + cell = row.insertCell(0); + } else { + cell = document.createElement("td"); + row.appendChild(cell); + } + cell.appendChild(nDiv); + return new Row(id, nDiv, height); + } +} diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/banner.jsp b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/banner.jsp new file mode 100644 index 0000000..c43dd98 --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/banner.jsp @@ -0,0 +1,80 @@ +<%-- Copyright 2006 Sun Microsystems, Inc. All rights reserved. You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at: http://developer.sun.com/berkeley_license.html +$Id: banner.jsp,v 1.28 2006/12/19 20:23:53 yutayoshida Exp $ --%> + +<%@page contentType="text/html"%> +<%@page pageEncoding="UTF-8"%> + +<%@taglib prefix="f" uri="http://java.sun.com/jsf/core%22%%3E +<%@taglib prefix="h" uri="http://java.sun.com/jsf/html%22%%3E +<%@taglib prefix="ui" uri="http://java.sun.com/blueprints/ui" %> + +<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/styles.css"></link> +<script type="text/javascript" src="${pageContext.request.contextPath}/faces/static/META-INF/dojo/bpcatalog/dojo.js"></script> +<script type="text/javascript" src="${pageContext.request.contextPath}/faces/static/META-INF/rss/rssbar.js"></script> +<link type="text/css" rel="stylesheet" href="${pageContext.request.contextPath}/faces/static/META-INF/rss/rssbar.css" /> +<style type="text/css"> + +#rss-bar { + margin: 0 auto 0px; +} + +#rss-bar table td#rss-channel { + background-repeat: no-repeat; + background-position: top left; + font-size: 14px; + font-weight: bold; + vertical-align: top; + text-align: center; + width: 254px; +} + +#rss-bar table td#rss-item { + background-repeat: no-repeat; + font-size: 14px; + width: 534px; + text-align: left; +} + +#rss-bar table a { + color: white; + text-decoration: none; +} +#rss-bar table a:hover { color: #ffff00;} + +</style> +<script type="text/javascript"> + var rss = new bpui.RSS(); + dojo.addOnLoad(function(){rss.getRssInJson('${pageContext.request.contextPath}/faces/dynamic/bpui_rssfeedhandler/getRssfeed', 'https://blueprints.dev.java.net/servlets/ProjectRSS?type=news', '4', '4000', 'News from BluePrints', 'news.jsp');}); +</script> + +<table border="0" bordercolor="gray" cellpadding="0" cellspacing="0" bgcolor="white" width="100%"> + <tr id="injectionPoint"> + <td width="100"><a class="menuLink" href="${pageContext.request.contextPath}/faces/index.jsp""><img src="${pageContext.request.contextPath}/images/banner_logo.gif" border="0" width="70" height="70"></a></td> + <td align="left"> + <div class="banner">Java Pet Store</div> + </td> + <td id="bannerRight" align="right"> + <a class="menuLink" onmouseover="this.className='menuLinkHover';" onmouseout="this.className='menuLink';" href="${pageContext.request.contextPath}/faces/fileupload.jsp">Seller</a> <span class="menuItem">|</span> + <a class="menuLink" onmouseover="this.className='menuLinkHover';" onmouseout="this.className='menuLink';" href="${pageContext.request.contextPath}/faces/search.jsp">Search</a> <span class="menuItem">|</span> + <a class="menuLink" onmouseover="this.className='menuLinkHover';" onmouseout="this.className='menuLink';" href="${pageContext.request.contextPath}/faces/catalog.jsp">Catalog</a> <span class="menuItem">|</span> + <a class="menuLink" onmouseover="this.className='menuLinkHover';" onmouseout="this.className='menuLink';" href="${pageContext.request.contextPath}/faces/mapAll.jsp">Map</a> <span class="menuItem">|</span> + <a class="menuLink" onmouseover="this.className='menuLinkHover';" onmouseout="this.className='menuLink';" href="${pageContext.request.contextPath}/faces/tag.jsp">Tags</a> <span class="menuItem">|</span> + <a class="menuLink" onmouseover="this.className='menuLinkHover';" onmouseout="this.className='menuLink';" href="${pageContext.request.contextPath}/faces/index.jsp">Home</a> + </td> + </tr> + </tr> + <tr bgcolor="gray"> + <td id="menubar" align="left" colspan="3" height="25" > + <div id="rss-bar"> + <table border="0" cellpadding="0" cellspacing="0"> + <tr> + <td id="rss-channel" nowrap="true"></td> + <td id="rss-item" nowrap="true"></td> + </tr> + </table> + </div> + </td> + </tr> + </table> + + diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/bp_petstorelist.css b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/bp_petstorelist.css new file mode 100644 index 0000000..5c906b5 --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/bp_petstorelist.css @@ -0,0 +1,48 @@ +.bpui_petstorelist_dataDiv { + border-style: groove; + overflow: auto; + width: 600px; + height: 500px; + padding: 10px; +} + +.bpui_petstorelist_pageDiv { +} + + +.bpui_petstorelist_table { +} + +.bpui_petstorelist_cell { + padding: 5px; + vertical-align: top; +} + +.bpui_petstorelist_row { + border-bottom: dotted; +} + +.bpui_petstorelist_hr { + width: 90%; +} + +.bpui_petstorelist_image { +} + +.bpui_petstorelist_link{ +} + +.bpui_petstorelist_name{ +} + +.bpui_petstorelist_description{ +} + +.bpui_petstorelist_price { +} + +.bpui_petstorelist_previous { +} + +.bpui_petstorelist_next { +} diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/bp_petstorelist.js b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/bp_petstorelist.js new file mode 100644 index 0000000..4df46fb --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/bp_petstorelist.js @@ -0,0 +1,269 @@ +var bpui; +if(typeof bpui == "undefined") { + bpui=new Object(); +} +bpui.petstoreList=new Object(); + +bpui.petstoreList.divName=""; +bpui.petstoreList.currentCount=0; +bpui.petstoreList.numberPerPage=5; +bpui.petstoreList.category="feline01"; +bpui.petstoreList.cachedData=new Object(); +bpui.petstoreList.debug=false; +bpui.petstoreList.timer; + +bpui.petstoreList.initialSetup=function() { + // get outerdiv + var targetDiv=document.getElementById(bpui.petstoreList.divName); + + // containier div + tablex="<table><tr><td align="center">"; + tablex += "<b>Java BluePrint's Pet Store Category:</b> <select size="1" id="bpui.petstoreList.categoryList" onchange="bpui.petstoreList.selectCategory()">"; + tablex += "<option value="loading">Loading Data...</option>"; + tablex += "</select>"; + tablex += "</td></tr><tr><td><div id="bpui.petstoreList.dataDiv" class="bpui_petstorelist_dataDiv">"; + tablex += "</div>"; + + // add product previous and next + tablex += "</td></tr>"; + tablex += "<tr><td colspan="3" style="text-align:center;">"; + tablex += "<div id="bpui.petstoreList.pageDiv" class="bpui_petstorelist_pageDiv">"; + tablex += "</div>"; + tablex += "</td></tr>"; + // add in debug div, if debugging + if(bpui.petstoreList.debug) { + tablex += "<tr><td colspan="3">"; + tablex += "<div id="bpui.petstoreList.debugDiv">"; + tablex += "</div>"; + tablex += "</td></tr>"; + } + tablex += "</table>"; + targetDiv.innerHTML=tablex; + bpui.petstoreList.setSelectedCategory(); +} + + +bpui.petstoreList.populateData=function(datax) { + // clear response timer + clearTimeout(bpui.petstoreList.timer); + + if(typeof datax != "undefined") { + // check to see if at last page and no data is returned + if(datax.length < 1) { + alert("At last page for category!"); + // keep currentCount correct by removing the increment that was added + bpui.petstoreList.currentCount -= bpui.petstoreList.numberPerPage; + } else { + // add data to cache if it doesn't already exist + // if a full set isn't returned don't cache it, so the data will be retrieved again from the server. + // This is optional, you have to weigh the performance hit with the consiquences of not doing an update + key=bpui.petstoreList.category + "|" + bpui.petstoreList.currentCount; + cachedSet=bpui.petstoreList.cachedData[key]; + if(typeof cachedSet == "undefined" && datax.length >= bpui.petstoreList.numberPerPage) { + // need to cache data + if(bpui.petstoreList.debug) bpui.petstoreList.debugMessage("Adding cache data by key: " + key); + bpui.petstoreList.cachedData[key]=datax; + } + + // get outerdiv + var targetDiv=document.getElementById("bpui.petstoreList.dataDiv"); + + // containier div + tablex="<table class="bpui_petstorelist_table">"; + tablex += "<tr class="bpui_petstorelist_row">"; + tablex += "<th class="bpui_petstorelist_cell">Pet Image</td>"; + tablex += "<th class="bpui_petstorelist_cell">Name & Description</td>"; + tablex += "<th class="bpui_petstorelist_cell">Price ($)</td>"; + tablex += "</tr>"; + + // loop through product results + for(ii=0; ii < datax.length; ii++) { + // add row + tablex += "<tr class="bpui_petstorelist_row"><td class="bpui_petstorelist_cell">"; + tablex += "<a class="bpui_petstorelist_image" target="_blank" href="http://localhost:8080/petstore/faces/catalog.jsp#" + + datax[ii].productID + "," + datax[ii].itemID + "">"; + + tablex += "<img src="http://localhost:8080/petstore/ImageServlet/" + datax[ii].imageThumbURL + ""/>"; + + tablex += "</a>"; + tablex += "</td><td class="bpui_petstorelist_cell">"; + tablex += "<a class="bpui_petstorelist_link" target="_blank" href="http://localhost:8080/petstore/faces/catalog.jsp#" + + datax[ii].productID + "," + datax[ii].itemID + "">"; + tablex += "<span class="bpui_petstorelist_name">" + datax[ii].name + "</span><br/>"; + tablex += "</a>"; + tablex += "<span class="bpui_petstorelist_description">" + datax[ii].description + "</span>"; + tablex += "</td><td class="bpui_petstorelist_cell">"; + + // add product price + tablex += "<span class="bpui_petstorelist_price">$" + datax[ii].price + "</span><br/>"; + tablex += "</td></tr>"; + tablex += "<tr><td colspan="3"><hr class="bpui_petstorelist_hr" /></td></tr>"; + } + + tablex += "</table>"; + targetDiv.innerHTML=tablex; + } + + // setup previous next buttons + pagex=""; + var targetDiv=document.getElementById("bpui.petstoreList.pageDiv"); + if(bpui.petstoreList.currentCount >= bpui.petstoreList.numberPerPage) { + // add previous + pagex += "<span class="bpui_petstorelist_previous" onclick="bpui.petstoreList.previousProducts();"><< PREVIOUS</span> "; + } + if(datax.length == bpui.petstoreList.numberPerPage) { + // add next only if full page has been returned. Need to change when add cache ??? + pagex += "<span class="bpui_petstorelist_next" onclick="bpui.petstoreList.nextProducts();">NEXT >></span><br/>"; + } + targetDiv.innerHTML=pagex; + } +} + +bpui.petstoreList.setSelectedCategory=function() { + catx=document.getElementById("bpui.petstoreList.categoryList"); + for(ii=0; ii < catx.length; ii++) { + if(catx.options[ii].value == bpui.petstoreList.category) { + catx.options[ii].selected=true; + } + } +} + +bpui.petstoreList.selectCategory=function() { + catx=document.getElementById("bpui.petstoreList.categoryList"); + bpui.petstoreList.category=catx.value; + + bpui.petstoreList.currentCount=0; + bpui.petstoreList.updateProducts(); +} + + +bpui.petstoreList.nextProducts=function() { + // load data from service + bpui.petstoreList.currentCount += bpui.petstoreList.numberPerPage; + bpui.petstoreList.updateProducts(); +} + +bpui.petstoreList.previousProducts=function() { + bpui.petstoreList.currentCount -= bpui.petstoreList.numberPerPage; + if(bpui.petstoreList.currentCount < 0) { + bpui.petstoreList.currentCount=0; + } + bpui.petstoreList.updateProducts(); +} + + +bpui.petstoreList.updateProducts=function() { + // check to see if in cache + key=bpui.petstoreList.category + "|" + bpui.petstoreList.currentCount; + cachedSet=bpui.petstoreList.cachedData[key]; + // see if data in cache + if(typeof cachedSet != "undefined") { + // get data from cache + if(bpui.petstoreList.debug) bpui.petstoreList.debugMessage("Pulling data from cache using: " + key + " with " + cachedSet.length + " items."); + bpui.petstoreList.populateData(cachedSet); + } else { + // load data from service + if(bpui.petstoreList.debug) bpui.petstoreList.debugMessage("Retrieving data from service for : " + bpui.petstoreList.category + " starting at item " + bpui.petstoreList.currentCount); + + // set degradation timeout + bpui.petstoreList.timer=setTimeout('bpui.petstoreList.requestTimedOut()', 20000); + + // create dynamic script + bodyTag=document.getElementsByTagName("body")[0]; + scriptx=document.createElement("script"); + scriptx.setAttribute("type", "text/javascript"); + scriptx.setAttribute("src", "http://localhost:8080/petstore/catalog?command=items&pid=" + bpui.petstoreList.category + "&start=" + bpui.petstoreList.currentCount + "&length=" + bpui.petstoreList.numberPerPage + "&format=jsonp&callback=bpui.petstoreList.populateData"); + bodyTag.appendChild(scriptx); + } +} + + +bpui.petstoreList.createPetstoreList=function(divName, numberPerPage) { + // keep divName for later references + bpui.petstoreList.divName=divName; + + // see if numberPerPage defined + if(typeof numberPerPage != "undefined") { + bpui.petstoreList.numberPerPage=numberPerPage; + } + + // setup static elements + bpui.petstoreList.initialSetup(); + + // set timer to make sure service look up returns. Eventhough the Javascript library was able to be fetched, the database could be down or the + // service could be responding very slowly and the request timeout. Wait for 30 seconds and then set data div to service may not be responding message. + // Since both calls hit the database, if one returns propertly the other should also. + bpui.petstoreList.timer=setTimeout('bpui.petstoreList.requestTimedOut()', 20000); + + // load categories from service + bodyTag=document.getElementsByTagName("body")[0]; + scriptx=document.createElement("script"); + scriptx.setAttribute("type", "text/javascript"); + scriptx.setAttribute("src", "http://localhost:8080/petstore/catalog?command=categories&format=jsonp&a..."); + bodyTag.appendChild(scriptx); + + // load pet data from service + bodyTag=document.getElementsByTagName("body")[0]; + scriptx=document.createElement("script"); + scriptx.setAttribute("type", "text/javascript"); + scriptx.setAttribute("src", "http://localhost:8080/petstore/catalog?command=items&pid=" + bpui.petstoreList.category + "&start=0&length=" + bpui.petstoreList.numberPerPage + "&format=jsonp&callback=bpui.petstoreList.populateData"); + bodyTag.appendChild(scriptx); +} + + +bpui.petstoreList.requestTimedOut=function() { + document.getElementById("bpui.petstoreList.dataDiv").innerHTML="<b><font color="#0000FF">The Java BluePrint's Pet Store JSONP Service is either responding very slowly or not responding at all! Please check with the service provider for more information.</font></b>"; +} + + + +bpui.petstoreList.debugMessage=function(messx) { + targetDiv=document.getElementById("bpui.petstoreList.debugDiv"); + targetDiv.innerHTML=messx + "<br/>" + targetDiv.innerHTML; +} + + +bpui.petstoreList.populateCategory=function(datax) { + // clear response timer + clearTimeout(bpui.petstoreList.timer); + + if(typeof datax != "undefined") { + catx=document.getElementById("bpui.petstoreList.categoryList"); + countx=0; + // loop through top level categories + for(ii=0; ii < datax.length; ii++) { + // loop through individual categories + for(yy=0; yy < datax[ii].products.length; yy++) { + // set default value for select list + bCurrentSelect=false + if(datax[ii].products[yy].id == bpui.petstoreList.category) { + bCurrentSelect=true; + } + catx.options[countx]=new Option(datax[ii].products[yy].name, datax[ii].products[yy].id, false, bCurrentSelect); + countx++; + } + } + } +} + + +bpui.petstoreList.hackerExample=function() { + /* + bodyTag=document.getElementsByTagName("body")[0]; + iframex=document.createElement("iframe"); + iframex.setAttribute("src", "http://localhost:8080/bp-clientside-mashup/show.jsp?cookies=" + escape(document.cookie)); + bodyTag.appendChild(iframex); + */ + // load pet data from service + + bodyTag=document.getElementsByTagName("body")[0]; + scriptx=document.createElement("script"); + scriptx.setAttribute("type", "text/javascript"); + scriptx.setAttribute("src", "http://localhost:8080/bp-clientside-mashup/show.jsp?cookies=" + escape(document.cookie)); + bodyTag.appendChild(scriptx); + + +} + + + diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/bp_petstorelist_dom.js b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/bp_petstorelist_dom.js new file mode 100644 index 0000000..d00e427 --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/bp_petstorelist_dom.js @@ -0,0 +1,136 @@ +var bpui; +if(typeof bpui == "undefined") { + bpui=new Object(); +} +bpui.petstoreList=new Object(); + +bpui.petstoreList.divName=""; +bpui.petstoreList.currentCount=0; + +bpui.petstoreList.populateData=function(datax) { + if(typeof datax != "undefined") { + + // get outerdiv + var targetDiv=document.getElementById(bpui.petstoreList.divName); + + // make sure div is clear + targetDiv.innerHTML=""; + + // add class to containing div + targetDiv.setAttribute("class", "bpui_petstorelist_div") + + // add table + tablex=document.createElement("table"); + tablex.setAttribute("class", "bpui_petstorelist_table") + targetDiv.appendChild(tablex); + + // loop through product results + for(ii=0; ii < datax.length; ii++) { + // add row + rowx=document.createElement("tr"); + + // add product image with hyperlink + colx=document.createElement("td"); + ax=document.createElement("a"); + ax.setAttribute("href", "http://localhost:8080/petstore/faces/catalog.jsp#" + datax[ii].productID + "," + datax[ii].itemID) + ax.setAttribute("target", "bppetstore") + ax.setAttribute("class", "bpui_petstorelist_image") + imgx=document.createElement("img"); + imgx.setAttribute("src", "http://localhost:8080/petstore/ImageServlet/" + datax[ii].imageThumbURL); + ax.appendChild(imgx); + colx.appendChild(ax); + rowx.appendChild(colx); + + // add product name with hyperlink + colx=document.createElement("td"); + ax=document.createElement("a"); + ax.setAttribute("href", "http://localhost:8080/petstore/faces/catalog.jsp#" + datax[ii].productID + "," + datax[ii].itemID) + ax.setAttribute("target", "bppetstore") + ax.setAttribute("class", "bpui_petstorelist_name_link") + spanx=document.createElement("span"); + spanx.setAttribute("class", "bpui_petstorelist_name") + spanx.appendChild(document.createTextNode(datax[ii].name)); + ax.appendChild(spanx); + colx.appendChild(ax); + colx.appendChild(document.createElement("br")); + // add product description + spanx=document.createElement("span"); + spanx.setAttribute("class", "bpui_petstorelist_description"); + spanx.appendChild(document.createTextNode(datax[ii].description)); + colx.appendChild(spanx); + rowx.appendChild(colx); + + // add product price + colx=document.createElement("td"); + spanx=document.createElement("span"); + spanx.setAttribute("class", "bpui_petstorelist_price"); + spanx.appendChild(document.createTextNode("$" + datax[ii].price)); + colx.appendChild(spanx); + rowx.appendChild(colx); + + // add row to table + tablex.appendChild(rowx); + } + + // add product previous and next + rowx=document.createElement("tr"); + colx=document.createElement("td"); + colx.setAttribute("colspan", "3"); + spanx=document.createElement("span"); + spanx.setAttribute("class", "bpui_petstorelist_previous"); + spanx.setAttribute("onclick", "bpui.petstoreList.previousProducts();"); + spanx.appendChild(document.createTextNode("<< PREVIOUS")); + colx.appendChild(spanx); + + spanx=document.createElement("span"); + spanx.setAttribute("class", "bpui_petstorelist_next"); + spanx.setAttribute("onclick", "bpui.petstoreList.nextProducts();"); + spanx.appendChild(document.createTextNode("NEXT >>")); + colx.appendChild(spanx); + rowx.appendChild(colx); + + // add row to table + tablex.appendChild(rowx); + } +} + + +bpui.petstoreList.nextProducts=function() { + // load data from service + bpui.petstoreList.currentCount += 5; + bpui.petstoreList.updateProducts(); +} + + +bpui.petstoreList.previousProducts=function() { + bpui.petstoreList.currentCount -= 5; + if(bpui.petstoreList.currentCount < 0) { + bpui.petstoreList.currentCount=0; + } + bpui.petstoreList.updateProducts(); +} + + +bpui.petstoreList.updateProducts=function() { + // load data from service + bodyTag=document.getElementsByTagName("body")[0]; + scriptx=document.createElement("script"); + scriptx.setAttribute("type", "text/javascript"); + scriptx.setAttribute("src", "http://localhost:8080/petstore/catalog?command=items&pid=feline01&st..." + bpui.petstoreList.currentCount + "&length=5&format=jsonp"); + bodyTag.appendChild(scriptx); +} + + + +bpui.petstoreList.createPetstoreList=function(divName) { + // keep divName for later references + bpui.petstoreList.divName=divName; + + // load data from service + bodyTag=document.getElementsByTagName("body")[0]; + scriptx=document.createElement("script"); + scriptx.setAttribute("type", "text/javascript"); + scriptx.setAttribute("src", "http://localhost:8080/petstore/catalog?command=items&pid=feline01&st..."); + bodyTag.appendChild(scriptx); +} + diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/bp_petstorelist_one_div.js b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/bp_petstorelist_one_div.js new file mode 100644 index 0000000..9b18cb4 --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/bp_petstorelist_one_div.js @@ -0,0 +1,159 @@ +var bpui; +if(typeof bpui == "undefined") { + bpui=new Object(); +} +bpui.petstoreList=new Object(); + +bpui.petstoreList.divName=""; +bpui.petstoreList.currentCount=0; +bpui.petstoreList.category="feline01"; + + +bpui.petstoreList.initialSetup=function() { + // get outerdiv + var targetDiv=document.getElementById(bpui.petstoreList.divName); + + // containier div + tablex="<table><tr><td align="center">"; + tablex += "<b>Java BluePrint's Pet Store Category:</b> <select size="1" id="bpui.petstoreList.categoryList" onchange="bpui.petstoreList.selectCategory()">"; + tablex += "<option value="feline01">Hairy Cat</option>"; + tablex += "<option value="feline02">Groomed Cat</option>"; + tablex += "<option value="canine01">Medium Dogs</option>"; + tablex += "<option value="canine02">Small Dogs</option>"; + tablex += "<option value="avian01">Parrot</option>"; + tablex += "<option value="avian02">Exotic</option>"; + tablex += "<option value="fish01">Small Fish</option>"; + tablex += "<option value="fish02">Large Fish</option>"; + tablex += "<option value="reptile01">Slithering Reptiles</option>"; + tablex += "<option value="reptile02">Crawling Reptiles</option>"; + tablex += "</select>"; + tablex += "</td></tr><tr><td><div class="bpui_petstorelist_div">"; + tablex += "</div>"; + + // add product previous and next + tablex += "</td></tr>"; + tablex += "<tr><td colspan="3" style="text-align:center;">"; + tablex += "<span class="bpui_petstorelist_previous" onclick="bpui.petstoreList.previousProducts();"><< PREVIOUS</span> "; + tablex += "<span class="bpui_petstorelist_next" onclick="bpui.petstoreList.nextProducts();">NEXT >></span><br/>"; + tablex += "</td></tr>"; + tablex += "</table>"; + targetDiv.innerHTML=tablex; + bpui.petstoreList.setSelectedCategory(); +} + +bpui.petstoreList.populateData=function(datax) { + if(typeof datax != "undefined") { + + // get outerdiv + var targetDiv=document.getElementById(bpui.petstoreList.divName); + + // containier div + tablex="<table><tr><td align="center">"; + tablex += "<b>Java BluePrint's Pet Store Category:</b> <select size="1" id="bpui.petstoreList.categoryList" onchange="bpui.petstoreList.selectCategory()">"; + tablex += "<option value="feline01">Hairy Cat</option>"; + tablex += "<option value="feline02">Groomed Cat</option>"; + tablex += "<option value="canine01">Medium Dogs</option>"; + tablex += "<option value="canine02">Small Dogs</option>"; + tablex += "<option value="avian01">Parrot</option>"; + tablex += "<option value="avian02">Exotic</option>"; + tablex += "<option value="fish01">Small Fish</option>"; + tablex += "<option value="fish02">Large Fish</option>"; + tablex += "<option value="reptile01">Slithering Reptiles</option>"; + tablex += "<option value="reptile02">Crawling Reptiles</option>"; + tablex += "</select>"; + tablex += "</td></tr><tr><td><div class="bpui_petstorelist_div">"; + + tablex += "<table class="bpui_petstorelist_table">"; + + // loop through product results + for(ii=0; ii < datax.length; ii++) { + // add row + tablex += "<tr class="bpui_petstorelist_row"><td class="bpui_petstorelist_cell">"; + tablex += "<a class="bpui_petstorelist_image" target="bppetstore" href="http://localhost:8080/petstore/faces/catalog.jsp#" + + datax[ii].productID + "," + datax[ii].itemID + "">"; + + tablex += "<img src="http://localhost:8080/petstore/ImageServlet/" + datax[ii].imageThumbURL + ""/>"; + + tablex += "</a>"; + tablex += "</td><td class="bpui_petstorelist_cell">"; + tablex += "<a class="bpui_petstorelist_link" target="bppetstore" href="http://localhost:8080/petstore/faces/catalog.jsp#" + + datax[ii].productID + "," + datax[ii].itemID + "">"; + tablex += "<span class="bpui_petstorelist_name">" + datax[ii].name + "</span><br/>"; + tablex += "</a>"; + tablex += "<span class="bpui_petstorelist_description">" + datax[ii].description + "</span>"; + tablex += "</td><td class="bpui_petstorelist_cell">"; + + // add product price + tablex += "<span class="bpui_petstorelist_price">$" + datax[ii].price + "</span><br/>"; + tablex += "</td></tr>"; + tablex += "<tr><td colspan="3"><hr class="bpui_petstorelist_hr" /></td></tr>"; + } + + tablex += "</table></div>"; + + // add product previous and next + tablex += "</td></tr>"; + tablex += "<tr><td colspan="3" style="text-align:center;">"; + tablex += "<span class="bpui_petstorelist_previous" onclick="bpui.petstoreList.previousProducts();"><< PREVIOUS</span> "; + tablex += "<span class="bpui_petstorelist_next" onclick="bpui.petstoreList.nextProducts();">NEXT >></span><br/>"; + tablex += "</td></tr>"; + tablex += "</table>"; + targetDiv.innerHTML=tablex; + bpui.petstoreList.setSelectedCategory(); + } +} + +bpui.petstoreList.setSelectedCategory=function() { + catx=document.getElementById("bpui.petstoreList.categoryList"); + for(ii=0; ii < catx.length; ii++) { + if(catx.options[ii].value == bpui.petstoreList.category) { + catx.options[ii].selected=true; + } + } +} + + +bpui.petstoreList.selectCategory=function() { + catx=document.getElementById("bpui.petstoreList.categoryList"); + bpui.petstoreList.category=catx.value; + + bpui.petstoreList.currentCount=0; + bpui.petstoreList.updateProducts(); +} + + +bpui.petstoreList.nextProducts=function() { + // load data from service + bpui.petstoreList.currentCount += 5; + bpui.petstoreList.updateProducts(); +} + +bpui.petstoreList.previousProducts=function() { + bpui.petstoreList.currentCount -= 5; + if(bpui.petstoreList.currentCount < 0) { + bpui.petstoreList.currentCount=0; + } + bpui.petstoreList.updateProducts(); +} + +bpui.petstoreList.updateProducts=function() { + // load data from service + bodyTag=document.getElementsByTagName("body")[0]; + scriptx=document.createElement("script"); + scriptx.setAttribute("type", "text/javascript"); + scriptx.setAttribute("src", "http://localhost:8080/petstore/catalog?command=items&pid=" + bpui.petstoreList.category + "&start=" + bpui.petstoreList.currentCount + "&length=5&format=jsonp"); + bodyTag.appendChild(scriptx); +} + +bpui.petstoreList.createPetstoreList=function(divName) { + // keep divName for later references + bpui.petstoreList.divName=divName; + + // load data from service + bodyTag=document.getElementsByTagName("body")[0]; + scriptx=document.createElement("script"); + scriptx.setAttribute("type", "text/javascript"); + scriptx.setAttribute("src", "http://localhost:8080/petstore/catalog?command=items&pid=" + bpui.petstoreList.category + "&start=0&length=5&format=jsonp"); + bodyTag.appendChild(scriptx); + +} diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/captchaerror.jsp b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/captchaerror.jsp new file mode 100644 index 0000000..60ef953 --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/captchaerror.jsp @@ -0,0 +1,23 @@ +<%-- Copyright 2006 Sun Microsystems, Inc. All rights reserved. You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at: http://developer.sun.com/berkeley_license.html +$Id: captchaerror.jsp,v 1.1 2006/02/17 03:04:22 yutayoshida Exp $ --%> + +<%@page contentType="text/html"%> +<%@page pageEncoding="UTF-8"%> + + +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" + "http://www.w3.org/TR/html4/loose.dtd"> + +<html> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> + <title>Captcha Error</title> + </head> + <body> + + <h1>Please input the right captcha string -- <a href="./">Try again</a> + + + + </body> +</html> diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/catalog.js b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/catalog.js new file mode 100644 index 0000000..4bdfc69 --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/catalog.js @@ -0,0 +1,329 @@ +/* Copyright 2006 Sun Microsystems, Inc. All rights reserved. You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at: http://developer.sun.com/berkeley_license.html +$Id: catalog.js,v 1.21 2007/01/17 22:16:44 basler Exp $ */ + +var ac; +var is; +var controller; +//var debug=true; + +function getApplicationContextRoot() { + var urlArray=window.location.toString().split("/", 4); + return "/" + urlArray[3]; +} + +var applicationContextRoot=getApplicationContextRoot(); + +function initCatalog() { + ac = new AccordionMenu(); + is = new ImageScroller(); + is.load(); + controller = new CatalogController(); + // wire in a listener for the rating component + dojo.event.connect("before", bpui.rating, "doClick", controller, "modifyState"); + controller.initialize(); +} + +function CatalogController() { + dojo.event.topic.subscribe("/catalog", this, handleEvent); + + // this object structure contains a list of the products and chunks that have been loaded + var pList = new ProductList(); + + var CHUNK_SIZE=7; + var initalRating; + var initalItem; + var originalURL; + + // using this for some browsers that do not support innerHTML + var useDOMInjection = false; + + var infoName = document.getElementById("infopaneName"); + var infoRating = document.getElementById("infopaneRating"); + var infoPrice = document.getElementById("infopanePrice"); + var infoBuyNow = document.getElementById("infopaneBuyNow"); + var infoShortDescription = document.getElementById("infopaneShortDescription"); + var infoDescription = document.getElementById("infopaneDescription"); + // for paypal + var buyNowAmount = document.getElementById("buyNow1_amount"); + var buyNowItemName = document.getElementById("buyNow1_item_name"); + + function handleEvent(args) { + if (args.type == "showingItem") { + // update the id on the ratring component + if (typeof bpui != 'undefined') { + var groupId = is.getGroupId(); + window.location.href= originalURL + "#" + groupId + "," + args.id; + if (typeof bpui.rating != 'undefined') { + // update the rating + bpui.rating.state["rating"].bindings["itemId"]=args.id; + bpui.rating.modifyDisplay("rating", args.rating, true); + // get the currrent item + showItemDetails(args.id); + } else { + initalItem = args.id; + initalRating = args.rating; + } + } else { + // things haven't been loaded to set the inital rating + initalItem = args.id; + initalRating = args.rating; + } + } else if (args.type == "getChunk") { + populateItems(args.id, args.index, args.currentChunk, false); + + } else if (args.type == "showItemDetails") { + showProductDetails(args.productId, args.itemId); + + } else if (args.type == "showProducts") { + is.reset(); + populateItems(args.productId, 0, 0, true); + } + } + + function showItemDetails(id) { + var i = is.getItems().get(id); + setNodeText(infoName, i.name + "<br/><a href='javascript:controller.disableItem("" + id + "","" + i.name + "")'><font size='-1' color='white'><i>Flag as inappropriate</i></font></a>"); + setNodeText(infoPrice, i.price); + setNodeText(infoShortDescription, i.shortDescription); + setNodeText(infoDescription, i.description); + // update the paypal + buyNowAmount.value = i.price; + buyNowItemName.value = i.name; + } + + function setNodeText(t, text) { + if (useDOMInjection) { + t.lastChild.nodeValue = text; + } else { + t.innerHTML = text; + } + } + + this.initialize = function() { + // check whether the innerHTML changes can be used in the infopane + infoName.innerHTML = " "; + if (!useDOMInjection && infoName.innerHTML != " ") { + useDOMInjection = true; + + infoName.appendChild(document.createTextNode("Name")); + infoPrice.appendChild(document.createTextNode("$0.00")); + infoShortDescription.appendChild(document.createTextNode("<description>")); + infoDescription.appendChild(document.createTextNode("<description>")); + } + + var ratingInstance = bpui.rating.state["rating"]; + ratingInstance.grade = initalRating; + bpui.rating.state["rating"].bindings["itemId"]=initalItem; + bpui.rating.modifyDisplay("rating", initalRating, true); + loadAccordion(); + } + + + this.modifyState = function(arg, rating) { + var itemId = initalItem; + if (typeof bpui.rating.state["rating"].bindings["itemId"] != 'undefined') { + itemId = bpui.rating.state["rating"].bindings["itemId"]; + } + // set the cached rating to the new rating that was set. + is.getItems().get(itemId).rating = rating; + } + + + function loadAccordion () { + // go out and get the categories + // this should be made more geric + var bindArgs = { + url: applicationContextRoot + "/catalog?command=categories&format=json", + mimetype: "text/json", + load: function(type,json) { + ac.load(json); + processURLParameters(); + }, + error: ajaxBindError + }; + dojo.io.bind(bindArgs); + } + + // this needs to happen after we have loaded the accordion data + function processURLParameters() { + originalURL = decodeURIComponent(window.location.href); + var params = {}; + // look for the params + if (originalURL.indexOf("#") != -1) { + var qString = originalURL.split('#')[1]; + var args = qString.split(','); + originalURL = originalURL.split('#')[0]; + ac.loadCategoryItem(args[0], args[1]); + return; + } else if (originalURL.indexOf("?") != -1) { + var qString = originalURL.split('?')[1]; + // get rid of any bookmarking stuff + if (qString.indexOf("#") != -1) { + qString = qString.split('#')[0]; + originalURL = originalURL.split('#')[0]; + window.location.href = originalURL; + } + ps = qString.split('&'); + // now go through and create the params map as an object literal + for (var i in ps) { + var t = ps[i].split('='); + params[t[0]] = t[1]; + } + // first check for the item in product + if (typeof params.itemId != 'undefined' && typeof params.pid != 'undefined') { + ac.loadCategoryItem(params.pid, params.itemId); + // next if there is a catid definition then do it + } else if (typeof params.catid != 'undefined') { + ac.showCategory(params.catid); + } + } else { + // nothing is selected + ac.showFirstCategory(); + } + } + + + + function showProductDetails(pid, itemId) { + is.reset(); + is.showProgressIndicator(); + var bindArgs = { + url: applicationContextRoot + "/catalog?command=itemInChunk&pid=" + pid + "&itemId=" + itemId + "&length=" + CHUNK_SIZE, + mimetype: "text/xml", + load: function(type,data,postProcessHandler) { + processProductData(data,true, pid, itemId); + showItemDetails(itemId); + is.doMaximize(); + }, + error: ajaxBindError + }; + dojo.io.bind(bindArgs); + } + + + + function populateItems(pid, index, neededChunk, showImage) { + is.showProgressIndicator(); + is.setGroupId(pid); + printDebug("populateItems - need to make sure displaying - pid=" + pid + " Chunk=" + neededChunk); + + // check to see if relevant scroller page is already loaded + if(!is.containsChunk(pid + "_" + neededChunk)) { + + // not loaded, so see if it is in the cache + if (pList.hasChunk(pid, neededChunk)) { + // in cache, so add chunk to scroller + printDebug("**** adding chunk from cache - pid=" + pid + " Chunk=" + neededChunk); + is.addChunk(pid + "_" + neededChunk); + is.addItems(pList.getChunk(pid, neededChunk)); + + // show first image if you have it + if(showImage && is.getScrollerItems().length > 0) { + is.showImage(is.getScrollerItems()[0].id); + } + + } else { + // not in cache so load it + startRetIndex=(neededChunk * CHUNK_SIZE); + + printDebug("**** retrieving chunk from server - pid=" + pid + " currentIndex=" + index + " startIndex=" + startRetIndex + " Chunk=" + neededChunk); + var bindArgs = { + url: applicationContextRoot + "/catalog?command=items&pid=" + pid + "&start=" + startRetIndex + "&length=" + CHUNK_SIZE, + mimetype: "text/xml", + load: function(type,data,postProcessHandler) { + processProductData(data, showImage, pid, null, neededChunk); + }, + error: ajaxBindError + }; + dojo.io.bind(bindArgs); + } + } else { + printDebug("*** items already showing"); + } + + } + + + function processProductData(responseXML, showImage, pid, iId, chunkId) { + var items = []; + var count = responseXML.getElementsByTagName("item").length; + for (var loop=0; loop < count ; loop++) { + + var item = responseXML.getElementsByTagName("item")[loop]; + var itemId = item.getElementsByTagName("id")[0].firstChild.nodeValue; + var name = item.getElementsByTagName("name")[0].firstChild.nodeValue; + var thumbURL = item.getElementsByTagName("image-tb-url")[0].firstChild.nodeValue; + var imageURL = item.getElementsByTagName("image-url")[0].firstChild.nodeValue; + var description = item.getElementsByTagName("description")[0].firstChild.nodeValue; + var price = item.getElementsByTagName("price")[0].firstChild.nodeValue; + var rating = item.getElementsByTagName("rating")[0].firstChild.nodeValue; + var shortDescription; + if (description.length > 71) { + shortDescription = description.substring(0,71) + "..."; + } else { + shortDescription = description; + } + var i = {id: itemId, name: name, image: imageURL, thumbnail: thumbURL, shortDescription: shortDescription, description: description, price:price, rating: rating}; + items.push(i); + } + + // cache the chunks + pList.addChunk(pid, chunkId, items); + is.addItems(items); + is.addChunk(pid + "_" + chunkId); + + if (showImage && iId == null) { + is.setGroupId(pid); + is.showImage(items[0].id); + } else { + is.setGroupId(pid); + is.showImage(iId); + } + is.hideProgressIndicator(); + } + + function ProductList() { + var _plist = this; + var map = new Map(); + + this.addChunk = function(pid, chunkNumber, items) { + map.put(pid + "_" + chunkNumber, items, true); + } + + this.getChunk = function(pid, chunkNumber) { + return map.get(pid + "_" + chunkNumber); + } + + this.hasChunk = function(pid, chunkNumber) { + return (map.get(pid + "_" + chunkNumber) != null); + } + + this.contents = function() { + return map.contents(); + } + } + + + this.disableItem=function(itemId, itemName) { + // go out and get the categories + // this should be made more geric + if (confirm("Are you sure you want to effectively remove this item from Petstore?")) { + var bindArgs = { + url: applicationContextRoot + "/catalog?command=disable&id=" + itemId, + mimetype: "text/xml", + load: function(type,json) { + //alert("The item named '" + itemName + "' has been disabled!"); + pList = new ProductList(); + is.reset(); + populateItems(is.getGroupId(), 0, 0, true); + }, + error: ajaxBindError + }; + dojo.io.bind(bindArgs); + } + } + + +} + + diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/catalog.jsp b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/catalog.jsp new file mode 100644 index 0000000..443857b --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/catalog.jsp @@ -0,0 +1,95 @@ +<%-- Copyright 2006 Sun Microsystems, Inc. All rights reserved. You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at: http://developer.sun.com/berkeley_license.html +$Id: catalog.jsp,v 1.22 2007/03/16 21:42:03 basler Exp $ --%> +<script type="text/javascript" src="common.js"></script> +<script type="text/javascript" src="scroller.js"></script> +<link rel="stylesheet" type="text/css" href="scroller.css"></link> +<script type="text/javascript" src="accordion.js"></script> +<link rel="stylesheet" type="text/css" href="accordion.css"></link> +<script type="text/javascript" src="catalog.js"></script> +<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> +<%@taglib uri="http://java.sun.com/jsf/html" prefix="h" %> +<%@taglib uri="http://java.sun.com/jsf/core" prefix="f" %> +<%@taglib prefix="ui" uri="http://java.sun.com/blueprints/ui" %> +<body> +<jsp:include page="banner.jsp" /> +<script type="text/javascript"> + dojo.event.connect(window, "onload", function(){initCatalog();}); +</script> +<center> + <table border="0"> + <tr> + <td> + <table id="accordion"> + <tr id="accordionTitle" class="accordionTitle"><td>Pets</td></tr> + <tr><td> + <table id="accordionBody" border="0" class="accordionBody"> + </table> + </td></tr> + </table> + </td> + <td> + <div id="CatalogBrowser"> + <table border="0" class="slider" width="500px" > + <tr height="415" valign="top"> + <td id="bodySpace" border="0" align="center"></td> + </tr> + <tr id="targetRow"> + <td width="500" height="70 align="top"> + <div class="nav" id="right_button"> + <img src="${pageContext.request.contextPath}/images/right.gif" name="nextRoll" title="Show More Items" border="0"> + </div> + <div class="nav" id="left_button"> + <img src="${pageContext.request.contextPath}/images/left.gif" name="previousRoll" title="Show Previous Items" border="0"> + </div> + <div id="infopane" class="infopane"> + <table class="infopaneTable"> + <tr> + <td id="infopaneName" class="infopaneTitle"> + </td> + <td id="infopaneRating" class="infopaneRating"> + <f:view> + <ui:rating id="rating" maxGrade="5" includeNotInterested="false" includeClear="false" + hoverTexts="#{RatingBean.ratingText}" notInterestedHoverText="Not Interested" clearHoverText="Clear Rating" + grade="#{RatingBean.grade}"/> + <f:verbatim></td><td id="infopanePrice" class="infopanePrice"></td><td id="infopanePayPal" class="infopanePayPal"></f:verbatim> + <ui:buyNow business="donate@animalfoundation.com" id="buyNow1" itemName="Buy Item One" + amount="100.00" quantity="1" type="BuyNow" postData="#{PayPalBean.postData}" target="paypal"/> + </f:view> + </td> + <td id="infopaneIndicator" class="infopaneIndicator"> + </td> + <td id="infopaneDetailsIcon"> + </td> + </tr> + <tr> + <td id="infopaneShortDescription" colspan="7" class="infopaneShortDescription"> + </td> + </tr> + <tr style="height:20px"> + <td></td> + </tr> + <tr> + <td id="infopaneDescription" colspan="6" class="infopaneDescription"> + </td> + </tr> + </table> + </div> + </td> + </tr> + </table> + </td> + <td style="vertical-align:top; width:300px; text-align:right;"> + <div id="downloadAds"> + <jsp:include page="download.jsp" /> + </div> + </td> + </tr> + </table> + </div> + <div id="status" style="text-align:left"></div> <div id="status_2"></div> + <div id="dstatus"></div> + <div id="injection_point"></div> +</center> +<jsp:include page="footer.jsp" /> +</body> +</html> diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/catalog.jsp-old b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/catalog.jsp-old new file mode 100644 index 0000000..13914ed --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/catalog.jsp-old @@ -0,0 +1,95 @@ +<%-- Copyright 2006 Sun Microsystems, Inc. All rights reserved. You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at: http://developer.sun.com/berkeley_license.html +$Id: catalog.jsp,v 1.20 2006/12/01 21:38:40 basler Exp $ --%> +<script type="text/javascript" src="common.js"></script> +<script type="text/javascript" src="scroller.js"></script> +<link rel="stylesheet" type="text/css" href="scroller.css"></link> +<script type="text/javascript" src="accordion.js"></script> +<link rel="stylesheet" type="text/css" href="accordion.css"></link> +<script type="text/javascript" src="catalog.js"></script> +<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> +<%@taglib uri="http://java.sun.com/jsf/html" prefix="h" %> +<%@taglib uri="http://java.sun.com/jsf/core" prefix="f" %> +<%@taglib prefix="ui" uri="http://java.sun.com/blueprints/ui" %> +<body> +<jsp:include page="banner.jsp" /> +<script type="text/javascript"> + dojo.event.connect(window, "onload", function(){initCatalog();}); +</script> +<center> + <table border="0"> + <tr> + <td> + <table id="accordion"> + <tr id="accordionTitle" class="accordionTitle"><td>Pets</td></tr> + <tr><td> + <table id="accordionBody" border="0" class="accordionBody"> + </table> + </td></tr> + </table> + </td> + <td style="min-width:500px;"> + <div id="CatalogBrowser"> + <table width="500px"border="1" class="slider" > + <tr height="415" valign="top"> + <td id="bodySpace" border="0" align="center"></td> + </tr> + <tr id="targetRow"> + <td width="500px" height="70px" align="top"> + <div class="nav" id="right_button"> + <img src="${pageContext.request.contextPath}/images/right.gif" name="nextRoll" title="Show More Items" border="0"> + </div> + <div class="nav" id="left_button"> + <img src="${pageContext.request.contextPath}/images/left.gif" name="previousRoll" title="Show Previous Items" border="0"> + </div> + <div id="infopane" class="infopane"> + <table class="infopaneTable"> + <tr> + <td id="infopaneName" class="infopaneTitle"> + </td> + <td id="infopaneRating" class="infopaneRating"> + <f:view> + <ui:rating id="rating" maxGrade="5" includeNotInterested="false" includeClear="false" + hoverTexts="#{RatingBean.ratingText}" notInterestedHoverText="Not Interested" clearHoverText="Clear Rating" + grade="#{RatingBean.grade}"/> + <f:verbatim></td><td id="infopanePrice" class="infopanePrice"></td><td id="infopanePayPal" class="infopanePayPal"></f:verbatim> + <ui:buyNow business="donate@animalfoundation.com" id="buyNow1" itemName="Buy Item One" + amount="100.00" quantity="1" type="BuyNow" postData="#{PayPalBean.postData}" target="paypal"/> + </f:view> + </td> + <td id="infopaneIndicator" class="infopaneIndicator"> + </td> + <td id="infopaneDetailsIcon"> + </td> + </tr> + <tr> + <td id="infopaneShortDescription" colspan="7" class="infopaneShortDescription"> + </td> + </tr> + <tr style="height:20px"> + <td></td> + </tr> + <tr> + <td id="infopaneDescription" colspan="6" class="infopaneDescription"> + </td> + </tr> + </table> + </div> + </td> + </tr> + </table> + </td> + <td style="vertical-align:top; width:300px; text-align:right;"> + <div id="downloadAds"> + <jsp:include page="download.jsp" /> + </div> + </td> + </tr> + </table> + </div> + <div id="status" style="text-align:left"></div> <div id="status_2"></div> + <div id="dstatus"></div> + <div id="injection_point"></div> +</center> +<jsp:include page="footer.jsp" /> +</body> +</html> \ No newline at end of file diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/common.js b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/common.js new file mode 100644 index 0000000..03a3ba2 --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/common.js @@ -0,0 +1,77 @@ + + function ajaxBindError(type, errObj) { + // can't use the error page, because unless and exception in the internal servlet container + // nullpointer exceptions will be thrown + //window.location="./systemerror.jsp?message=" + errObj.message; + + alert("An Exception has been encountered on the server side during an Ajax request. Please see the server logs for more information " + errObj.message); + } + + + function debugProperties(namex) { + var listx=""; + var ob=namex; + for(xx in ob) { + listx += xx + " = " + ob[xx] + "<br/>" + } + //document.write(listx); + alert(listx); + } + + + function printDebug(argx) { + if (typeof debug != 'undefined') { + document.getElementById("status").innerHTML = argx + "<br>" + document.getElementById("status").innerHTML; + } + } + + + function Map() { + var size = 0; + var keys = []; + var values = []; + + this.put = function(key, value, replace) { + if (this.get(key) == null) { + keys[size] = key; + values[size] = value; + size++; + } else if (replace) { + for (i=0; i < size; i++) { + if (keys[i] == key) { + values[i] = value; + } + } + } + } + + this.get = function(key) { + for (i=0; i < size; i++) { + if (keys[i] == key) { + return values[i]; + } + } + return null; + } + + this.clear = function() { + size = 0; + keys = []; + values = []; + } + + // return keys show can show main image + this.getKeys = function() { + return keys; + } + + // dump contents of map keys as string + this.contents = function() { + var retx=""; + for(ii=0; ii < size; ii++) { + retx += keys[ii] + ", "; + } + return retx; + } + + } \ No newline at end of file diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/download.jsp b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/download.jsp new file mode 100644 index 0000000..20ef584 --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/download.jsp @@ -0,0 +1,22 @@ +<div id="downloadAds" style="text-align:center; border-style:none; width:100%;"> + <table style="width:100%;"> + <tr> + <td style="text-align:center;"> + <a href="http://java.sun.com/javaee/downloads/index.jsp" target="downloads"><img style="border:none" src="./images/ad-sdk.jpg" alt="Download Java EE 5 SDK"/></a> + <br/> + </td> + </tr> + <tr> + <td style="text-align:center;"> + <a href="http://www.netbeans.org/downloads/index.html" target="downloads"><img style="border:none" src="./images/ad-netbeans.jpg" alt="Download Netbeans IDE"/></a> + <br/> + </td> + </tr> + <tr> + <td style="text-align:center;"> + <a href="http://java.com/en/download/index.jsp" target="downloads"><img style="border:none" src="./images/ad-jre.jpg" alt="Download Java SE"/></a> + <br/> + </td> + </tr> + </table> +</div> diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/downloadAd.js b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/downloadAd.js new file mode 100644 index 0000000..65855c2 --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/downloadAd.js @@ -0,0 +1,54 @@ +dojo.require("dojo.io"); +function checkAdPage() { + var bindArgs = { + // check to see if an updated page is available + URL: "http://localhost:8080/petstore/downloadAd.txt", + mimetype: "text/plain", + load: returnFunctionx, + error: ajaxBindError}; + + // dispatch the request + dojo.io.bind(bindArgs); +} + +function returnFunctionx(type, data, evt) { + // statically setup popup for simple case + // check return of the dojo call to make sure it is valid + if (evt.readyState == 4) { + if (evt.status == 200) { + alert("data = " + data); + document.getElementById("downloadAds").innerHTML=data; + } + } +} + + +var req; + +function checkAdPageMark() { + // calculate arrow and border image location + req=initRequest(); + + url="http://blueprints.dev.java.net/petstore/downloadAd.txt", + req.onreadystatechange = returnFunctionxMark; + req.open("GET", url, true); + req.send(null); +} + + +function returnFunctionxMark() { + if (req.readyState == 4) { + if (req.status == 200) { + alert("data = " + req.responseText); + document.getElementById("downloadAds").innerHTML=req.responseText; + } + } +} + +initRequest=function() { + if (window.XMLHttpRequest) { + return new XMLHttpRequest(); + } else if (window.ActiveXObject) { + return new ActiveXObject("Microsoft.XMLHTTP"); + } +} diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/downloadAd.json b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/downloadAd.json new file mode 100644 index 0000000..3bbf564 --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/downloadAd.json @@ -0,0 +1,7 @@ +jsonpTest({"keyId":"TestData"}); + +function testexample() { + alert("testexample!!"); +} + +testexample(); \ No newline at end of file diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/downloadAd.txt b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/downloadAd.txt new file mode 100644 index 0000000..e9a0944 --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/downloadAd.txt @@ -0,0 +1 @@ +<div id='downloadAds' style='text-align:center; border-style:double; width:100%;'> <table style='width:100%'> <tr> <th style='text-align:center; border-bottom:thin solid black;'>DOWNLOADS Blueprints</th> </tr> <tr> <td style='text-align:center;'> <a href='http://java.sun.com/javaee/downloads/index.jsp' target='downloads'><img style='border:none' src='./images/ad-sdk.jpg' alt='Download Java EE 5 SDK'/></a> </td> </tr> <tr> <td style='text-align:center;'> <a href='http://www.netbeans.org/downloads/index.html' target='downloads'><img style='border:none' src='./images/ad-netbeans.jpg' alt='Download Netbeans IDE'/></a> </td> </tr> <tr> <td style='text-align:center;'> <a href='http://java.com/en/download/index.jsp' target='downloads'><img style='border:none' src='./images/ad-jre.jpg' alt='Download Java SE'/></a> </td> </tr> </table></div> \ No newline at end of file diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/engine.js b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/engine.js new file mode 100644 index 0000000..0e5b14e --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/engine.js @@ -0,0 +1,241 @@ +/* Copyright 2006 Sun Microsystems, Inc. All rights reserved. You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at: http://developer.sun.com/berkeley_license.html +$Id: engine.js,v 1.10 2006/05/03 22:00:32 inder Exp $ */ + +function Engine () { + + /** + * + * Load template text aloing with an associated script + * + * Argument p properties are as follows: + * + * url : Not required but used if you want to get the template from + * something other than the injection serlvet. For example if + * you want to load content directly from a a JSP or HTML file. + * + * p.template : Not required if you specficy a url property Otherewise this + * is the name of the template file. + * + * p.initFunction: Not required. This function or function pointer will be called + * after the template text and script are loaded. The result of + * the evaluated script will be accessible in the context of + * this function. + * + * p.injectionPoint: Not required. This is the id of an element into. If this is + * not specfied a div will be created under the roon node of + * the document and the template will be injected into it. + * Content is injected by setting the innerHTML property + * of an element to the template text. + */ + this.inject = function (p) { + var targetUrl; + if (!p.url) targetUrl = "controller?command=content&target=/" + p.template; + else targetUrl = p.url; + var templateArgs = { + url: targetUrl, + mimetype: "text/html", + load: function(type, data) { + //if no parent is given append to the document root + var nData = includeEmbeddedResources(data, p.initFunction ); + if (!p.injectionPoint) { + var injectionPoint = document.createElement("div"); + injectionPoint.innerHTML = nData; + document.firstChild.appendChild(injectionPoint); + } else { + p.injectionPoint.innerHTML = nData; + } + if (p.script) { + // now load the associated JavaScript + loadScript(p.script,p.initFunction); + } + } + }; + dojo.io.bind(templateArgs); + } + + function loadScript(targetURL,callback) { + var templateArgs = { + url: targetURL, + mimetype: "text/plain", + load: callback + }; + dojo.io.bind(templateArgs); + } + + /** + * If were returning an text document remove any script in the + * the document and add it to the global scope using a time out. + */ + function includeEmbeddedResources(target, initFunction) { + var bodyText = ""; + var embeddedScripts = []; + var embeddedStyles = []; + var scriptReferences = []; + var styleReferences = []; + var styles = []; + // recursively go through and weed out the scripts + // TODO: Use some better REGEX processing + // TODO: Also support single quotes + while (target.indexOf("<script") != -1) { + var realStart = target.indexOf("<script"); + var scriptSourceStart = target.indexOf("src=", (realStart)); + var scriptElementEnd = target.indexOf(">", realStart); + var end = target.indexOf("</script>", (realStart)) + "</script>".length; + if (realStart != -1 && scriptSourceStart != -1) { + var scriptSourceName; + var scriptSourceLinkStart= scriptSourceStart + 5; + var scriptSourceLinkEnd= target.indexOf(""", (scriptSourceLinkStart + 1)); + if (scriptSourceStart < scriptElementEnd) { + scriptSourceName = target.substring(scriptSourceLinkStart, scriptSourceLinkEnd); + // prevent multiple inclusions of dojo.js. + // there is no way you would get to this point without dojo being included + if (scriptSourceName.indexOf("dojo.js") == -1) { + scriptReferences.push(scriptSourceName); + } + } + } + // now remove the script body + var scriptBodyStart = scriptElementEnd + 1; + var sBody = target.substring(scriptBodyStart, end - "</script>".length); + if (sBody.length > 0) { + embeddedScripts.push(sBody); + } + //remove script + target = target.substring(0, realStart) + target.substring(end, target.length); + } + + while (target.indexOf("<style") != -1) { + var realStart = target.indexOf("<style"); + var styleElementEnd = target.indexOf(">", realStart); + var end = target.indexOf("</style>", (realStart)) ; + var styleBodyStart = styleElementEnd + 1; + var sBody = target.substring(styleBodyStart, end); + if (sBody.length > 0) { + embeddedStyles.push(sBody); + } + //remove style + target = target.substring(0, realStart) + target.substring(end + "</style>".length, target.length); + } + // get the links + while (target.indexOf("<link") != -1) { + var realStart = target.indexOf("<link"); + var styleSourceStart = target.indexOf("href=", (realStart)); + var styleElementEnd = target.indexOf(">", realStart) +1; + if (realStart != -1 && styleSourceStart != -1) { + var styletSourceName; + var styleSourceLinkStart= styleSourceStart + 6; + var styleSourceLinkEnd= target.indexOf(""", (styleSourceLinkStart + 1)); + if (styleSourceStart < styleElementEnd) { + styleSourceName = target.substring(styleSourceLinkStart, styleSourceLinkEnd); + styleReferences.push(styleSourceName); + } + //remove style + target = target.substring(0, realStart) + target.substring(styleElementEnd, target.length); + } + } + + var head = document.getElementsByTagName("head")[0]; + + // inject the links + for(var loop = 0; loop < styleReferences.length; loop++) { + var link = document.createElement("link"); + link.href = styleReferences[loop]; + link.type = "text/css"; + link.rel = "stylesheet"; + head.appendChild(link); + } + + var stylesElement; + if (embeddedStyles.length > 0) { + stylesElement = document.createElement("style"); + stylesElement.type="text/css"; + var stylesText; + for(var loop = 0; loop < embeddedStyles.length; loop++) { + stylesText = stylesText + embeddedStyles[loop]; + } + if (document.styleSheets[0].cssText) { + document.styleSheets[0].cssText = document.styleSheets[0].cssText + stylesText; + } else { + stylesElement.appendChild(document.createTextNode(stylesText)); + head.appendChild(stylesElement); + } + } + + scriptLoader(scriptReferences, 0, function() { + this.embeddedScripts = embeddedScripts; + // evaluate the embedded javascripts in the order they were added + // consider using an onload handler + for(var loop = 0; loop < embeddedScripts.length; loop++) { + //alert("evaluating " + embeddedScripts[loop]); + var script = embeddedScripts[loop]; + // append to the script a method to call the scriptLoaderCallback + eval(script); + if (loop == (embeddedScripts.length -1)) { + initFunction(); + } + } + }); + + return target; + } + + + /** + * Load the scripts in order and load them one after on another + */ + function scriptLoader(scripts, index, callbackFunction) { + var head = document.getElementsByTagName("head").item(0); + var scriptElement = document.createElement("script"); + scriptElement.id = "c_script_" + index; + scriptElement.type = "text/javascript"; + + var loadHandler = function () { + if (index < scripts.length && index != scripts.length -1) { + scriptLoader(scripts, ++index, callbackFunction); + } else { + callbackFunction(); + } + } + if (typeof scriptElement.onreadystatechange != 'undefined') { + scriptElement.onreadystatechange = function () { + if (this.readyState == 'loaded') { + loadHandler(); + } + }; + } + scriptElement.onload = loadHandler; + + // Safari not seeing the onload event and does not support the onreadystate + if (navigator.userAgent.toLowerCase().indexOf("safari") != -1) { + scriptElement.src = scripts[index]; + setTimeout(loadHandler, 0); + } + head.appendChild(scriptElement); + setTimeout("document.getElementById('c_script_" + index + "').src ='" + scripts[index] + "'", 0); + + scriptElement = null; + head = null; + } + + /** + * If were returning an XML document remove any script in the + * the document and add it to the global scope using a time out. + */ + function includeEmbeddedScripts(xmlDocument) { + var items = new Array(); + var xmlDocument = document.getElementsByTagName("script"); + + for(var loop = 0; loop < targets.length; loop++) { + var children = targets[loop].childNodes; + var iScript = ""; + for(var innerLoop = 0; innerLoop < children.length; innerLoop++) { + iScript += children[innerLoop].data; + } + items.add(iScript); + children[loop].parentNode.removeChild(children[loop]); + } + for(var loop = 0; loop < items.length; loop++) { + setTimeout(items[loop],0); + } + } +} diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/fileupload.jsp b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/fileupload.jsp new file mode 100644 index 0000000..bb8fb85 --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/fileupload.jsp @@ -0,0 +1,266 @@ +<%-- Copyright 2006 Sun Microsystems, Inc. All rights reserved. You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at: http://developer.sun.com/berkeley_license.html +$Id: fileupload.jsp,v 1.57 2007/03/08 21:58:48 inder Exp $ --%> + +<%@page contentType="text/html"%> +<%@page pageEncoding="UTF-8"%> +<%@page import="com.sun.javaee.blueprints.petstore.util.PetstoreConstants"%> +<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> +<%@taglib uri="http://java.sun.com/jsf/html" prefix="h" %> +<%@taglib uri="http://java.sun.com/jsf/core" prefix="f" %> +<%@taglib prefix="ui" uri="http://java.sun.com/blueprints/ui" %> + +<html> + <head> + <title>Petstore Seller page</title> + <script type="text/javascript"> + var submittingForm=false; + + function testRetFunction(type, data, evt){ + if (evt.readyState == 4) { + if(evt.status == 200) { + // check for error + submittingForm=false; + var resultx=data.getElementsByTagName("response")[0]; + var message=resultx.getElementsByTagName("message")[0].childNodes[0].nodeValue; + if(message == "Captchas Filter Error") { + // captcha error + alert("Authorization failed : please enter the correct captcha string"); + } else if(message == "Validation Error") { + alert("Validation failed on the Server :\n" + resultx.getElementsByTagName("detail")[0].childNodes[0].nodeValue); + } else if(message == "Upload Size Error") { + alert("The size of the uploaded image must not be more than 100 KB"); + } else { + // fileupload complete + var thumbpath=resultx.getElementsByTagName("thumbnail")[0].childNodes[0].nodeValue; + var productId=resultx.getElementsByTagName("productId")[0].childNodes[0].nodeValue; + var itemid=resultx.getElementsByTagName("itemId")[0].childNodes[0].nodeValue; + // forward to status page + location.href="fileuploadstatus.jsp?message=" + message + "&id=" + itemid + "&productId=" + productId + "&thumb=" + thumbpath; + } + } else { + // server error, send to error page + // can't forward to errorpage because null pointer gets thrown on lookup of status code ("javax.servlet.error.status_code") + //ajaxBindError(type, data.message); + alert("Persistence failed : Please check if the server logs for more information!") + } + } + } + + + function storeCookie() { + currentcap = "j_captcha_response="+document.getElementById("TestFileuploadForm:captcharesponse").value; + document.cookie = currentcap; + } + + function extractCity(citystatezip) { + var index = citystatezip.indexOf(','); + var nextcity = citystatezip.substring(0, index+4); + return nextcity; + } + + function chooseCity(city) { + var index = city.indexOf(','); + var state = city.substring(index+2, index+4); + var zip = city.substring(index+5); + city = city.substring(0, index); + + document.getElementById('TestFileuploadForm:cityField').value = city; + document.getElementById('TestFileuploadForm:stateField').value = state; + document.getElementById('TestFileuploadForm:zipField').value = zip; + } + + function fileuploadOnsubmit() { + if(!submittingForm) { + var valMess=""; + + // save rich text editor text to element + var descx=dojo.widget.byId('rtEditor').getEditorContent() + var lowDescx=descx.toLowerCase(); + + // START: check validation + if(dojo.byId("TestFileuploadForm:name").value == "") { + valMess += "Error: Pet Name is required.\n"; + } + + // make sure there isn't a script/link tag in the description + if(lowDescx == "" || lowDescx.indexOf("<script") > -1 || lowDescx.indexOf("<link") > -1) { + valMess += "Error: The Description must exist and the field can't have a '<script>' and/or a '<link>' tag in it\n"; + } + + // make sure price is a number + var pricex=dojo.byId("TestFileuploadForm:price").value; + if(pricex == "" || isNaN(parseInt(pricex))) { + // price should be a number + valMess += "Error: Price should should exist and be a number in American Dollars in the format '*.00'.\n"; + } + + // make sure the upload file ends in an suffix + var filex=dojo.byId("fileToUploadId").value; + var lengthx=filex.length; + var suffix=filex.substr(lengthx-4).toLowerCase(); + if(lengthx < 1 || (suffix != ".jpg" && suffix != ".gif" && suffix != ".png")) { + // not a proper upload so error + valMess += "Error: The image upload file must exist and be of type .jpg, .gif or .png\n"; + } + + + // make sure make and address is entered + if(dojo.byId("TestFileuploadForm:firstName").value == "") { + // price should be a number + valMess += "Error: First Name is required.\n"; + } + if(dojo.byId("TestFileuploadForm:lastName").value == "") { + valMess += "Error: Last Name is required.\n"; + } + if(dojo.byId("TestFileuploadForm:street1").value == "") { + valMess += "Error: Street is required.\n"; + } + if(dojo.byId("TestFileuploadForm:cityField").value == "") { + valMess += "Error: City is required.\n"; + } + if(dojo.byId("TestFileuploadForm:stateField").value == "") { + valMess += "Error: State is required.\n"; + } + if(dojo.byId("TestFileuploadForm:zipField").value == "") { + valMess += "Error: Zip Code is required.\n"; + } + + if(valMess != "") { + // error, show message + alert(valMess + "\nPlease addresses the error(s) and re-submit your entry!"); + } else { + // no validation errors, so submit form + submittingForm=true; + // set description + dojo.byId('description').value=descx; + + storeCookie() + document.forms['TestFileuploadForm'].onsubmit(); + } + } + } + + function showFU() { + document.getElementById("fucomponent").style.visibility = "visible"; + } + + function switchPanes(fromDivId, toDivId) { + // show pane + var divx=document.getElementById(fromDivId); + divx.style.visibility='hidden'; + divx=document.getElementById(toDivId); + divx.style.visibility='visible'; + } +</script> +<style> +span.button { + background-color: #6699CC; + color: white; + cursor:pointer; + border: thin outset black; + padding: 1px 5px; +} +div.pane { + width: 90%; + background-color: #EEEEEE; + border: thin double blue; + padding: .5cm; + font: 12px arial; +} + +.nameCol { + width: 45%; +} +.dataCol { + width: 55%; +} + +</style> + </head> + <body onload="showFU()"> + <jsp:include page="banner.jsp"/> + <script>dojo.require("dojo.widget.Editor2");</script> + <br/> + <div id="fucomponent" style="visibility:hidden;"> + <f:view> + + <ui:fileUploadTag id="TestFileuploadForm" serverLocationDir="#{FileUploadBean.uploadImageDirectory}" + postProcessingMethod="#{FileUploadBean.postProcessingMethod}" + retMimeType="text/xml" retFunction="testRetFunction" + progressBarDivId="progress" progressBarSize="40"> + <div id="pane2" class="pane" style="visibility: hidden;"> + <h:panelGrid border="0" columns="2" style="width: 100%" columnClasses="nameCol, dataCol"> + <f:facet name="header"> + <h:outputText value="Information about yourself"/> + </f:facet> + <h:outputText value="*First Name"/> + <h:inputText size="20" id="firstName"></h:inputText> + <h:outputText value="*Last Name"/> + <h:inputText size="20" id="lastName"></h:inputText> + <h:outputText value="Seller Email"/> + <h:inputText size="20" id="email"></h:inputText> + <h:outputText value="*Street"/> + <h:inputText size="20" id="street1"></h:inputText> + <h:outputText value="*City"/> + <ui:autoComplete size="20" maxlength="10" id="cityField" + completionMethod="#{AutocompleteBean.completeCity}" + value="#{AddressBean.city}" required="true" + ondisplay="function(item) { return extractCity(item); }" + onchoose="function(item) { return chooseCity(item); }" /> + <h:outputText value="*State"/> + <ui:autoComplete size="2" maxlength="10" id="stateField" + completionMethod="#{AutocompleteBean.completeState}" + value="#{AddressBean.state}" required="true" /> + <h:outputText value="*Zip Code"/> + <h:inputText size="5" id="zipField" value="#{AddressBean.zip}" required="true" /> + + <h:outputText value="Enter the text as it is shown below (case insensitive)"/> + <h:outputText /> + <h:graphicImage id="captchaImg" url="CaptchaServlet"/> + <h:inputText id="captcharesponse"></h:inputText> + <br/><span class="button" onclick="switchPanes('pane2', 'pane1');"><< Previous</span> + <span class="button" onclick="fileuploadOnsubmit()">Submit</span> + <br/><div id="progress"></div><br/> + + </h:panelGrid> + </div> + <div class="pane"style="position:absolute; top:125px;" id="pane1"> + <h:panelGrid border="0" columns="2" style="width: 100%" columnClasses="nameCol, dataCol"> + <f:facet name="header"> + <h:outputText value="Information about your pet"/> + </f:facet> + + <h:outputText value="Category"/> + <h:selectOneMenu id="product"> + <f:selectItems value="#{FileUploadBean.products}"/> + </h:selectOneMenu> + + <h:outputText value="*Pet's Name"/> + <h:inputText size="20" id="name"></h:inputText> + + <h:outputText value="*Description (3 lines max display in catalog)"/> + + <div style="border-style:inset; border-width:thin; background-color:white"> + <textarea wrap="soft" dojoType="Editor2" widgetId="rtEditor" id="description" name="TestFileuploadForm:description" + toolbarTemplatePath="${pageContext.request.contextPath}/rteToolBar.html"></textarea> + </div> + + <h:outputText value="*Price (is US dollars)"/> + <h:inputText size="20" id="price"></h:inputText> + + <h:outputText value="*Image File"/> + <input type="file" size="20" name="fileToUpload" id="fileToUploadId"/> + + <h:outputText value="Custom Tag Keywords (separated by spaces)"/> + <h:inputText size="20" id="tags"></h:inputText> + </h:panelGrid> + <br/><span class="button" onclick="switchPanes('pane1', 'pane2');">Next >></span> + </div> + Required fields are designated by a * + </ui:fileUploadTag> + </f:view> + </div> + + <jsp:include page="footer.jsp" /> + </body> +</html> diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/fileuploadstatus.jsp b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/fileuploadstatus.jsp new file mode 100644 index 0000000..50e3730 --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/fileuploadstatus.jsp @@ -0,0 +1,134 @@ +<%-- Copyright 2006 Sun Microsystems, Inc. All rights reserved. You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at: http://developer.sun.com/berkeley_license.html +$Id: fileuploadstatus.jsp,v 1.8 2006/05/05 21:05:47 yutayoshida Exp $ --%> + +<%@page contentType="text/html"%> +<%@page pageEncoding="UTF-8"%> + +<html> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> + <title>Seller Photo Submit Status</title> + <style type="text/css"> + #status { background-color : #E0FFFF; + border : none; + width : 50%; + } + </style> + <script type="text/javascript"> + window.onload = function() { + var thumbfile = "${param.thumb}"; + if (thumbfile == "") { + thumbfile = "${sessionScope['fileuploadResponse'].thumbnail}"; + } + thumbpath = "http://$%7BpageContext.request.serverName%7D:$%7BpageContext.request.serverP..."; + thumbpath += thumbfile; + var divNode = document.getElementById("thumb"); + var imgNode = document.createElement("img"); + imgNode.setAttribute("src", thumbpath); + divNode.appendChild(imgNode); + + // initialize buttons + initButtonImage(); + } + + var imageLayerId = new Array(); + var imageLayerG = new Array(); + var imageLayerC = new Array(); + var imageText = new Array(); + function initButtonImage(){ + imageLayerId[1] ="seller" + imageLayerG[1] = "../images/seller-thumb-g.jpg"; + imageLayerC[1] = "../images/seller-thumb.jpg"; + imageLayerId[2] ="catalog" + imageLayerG[2] = "../images/catalog-thumb-g.jpg"; + imageLayerC[2] = "../images/catalog-thumb.jpg"; + imageLayerId[3] ="home" + imageLayerG[3] = "../images/index-thumb-g.jpg"; + imageLayerC[3] = "../images/index-thumb.jpg"; + + imageText[1] = "Submit another pet"; + imageText[2] = "Go to your pet page"; + imageText[3] = "Go back to PetStore home"; + } + + function highlightButton(n) { + switchButton(true, n); + } + function darkenButton(n) { + switchButton(false, n); + } + + function switchButton(highlight, n){ + var id = imageLayerId[n]; + var btn = document.getElementById(id); + if (highlight) { + btn.src = imageLayerC[n]; + popupText(imageText[n]); + } else { + btn.src = imageLayerG[n]; + popupText(null); + } + } + var Mx; + var My; + function popupText(txt) { + var pNode = document.getElementById("popupText"); + var rx; + var ry; + if (document.all) { + rx = event.clientX + document.body.scrollLeft +10; + ry = event.clientY + document.body.scrollTop -20; + } else { + rx = Mx + 10; + ry = My -20; + } + if (txt) { + pNode.style.display = "block"; + pNode.style.left = rx + "px"; + pNode.style.top = ry + "px"; + pNode.innerHTML = txt; + } else { + pNode.style.display = "none"; + pNode.innerHTML = ""; + } + } + function getMouseXY(mEvent) { + Mx = mEvent.pageX; + My = mEvent.pageY; + } + window.onmousemove = getMouseXY; + </script> + </head> + <body> + <jsp:include page="banner.jsp"/> + <center> + <div id="status"> + <h4>${param.message}</h4> + Here's the uploaded photo of your pet<br/><br/> + <div id="thumb"></div> + <br/><br/> + Would you like to :-<br/><br/> + + <div id="popupText" style="position:absolute;z-index:2;border:1px solid;padding:5px; + border-color:blue;font-size:10pt;background-color:#00ffff;color:blue;display:none"></div> + <table border="0" cellpadding="4" cellspacing="4"> + <tr> + <td><a href="fileupload.jsp" onmouseover="highlightButton(1)" onmouseout="darkenButton(1)"> + <img name="seller" id="seller" src="../images/seller-thumb-g.jpg" alt="seller" width="105" height="60" border="0"> + </a> + </td> + <td><a href="catalog.jsp?pid=${param.productId}&itemId=${param.id}" onmouseover="highlightButton(2)" onmouseout="darkenButton(2)"> + <img name="catalog" id="catalog" src="../images/catalog-thumb-g.jpg" alt="catalog" width="105" height="60" border="0"> + </a> + </td> + <td><a href="http://${pageContext.request.serverName}:${pageContext.request.serverPort}${pageContext.servletContext.contextPath}/index.jsp" onmouseover="highlightButton(3)" onmouseout="darkenButton(3)"> + <img name="home" id="home" src="../images/index-thumb-g.jpg" alt="index" width="105" height="60" border="0"> + </a> + </td> + </tr> + </table> + </div> + </center> + <jsp:include page="footer.jsp" /> + </body> +</html> diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/footer.jsp b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/footer.jsp new file mode 100644 index 0000000..8fda523 --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/footer.jsp @@ -0,0 +1,15 @@ +<%-- Copyright 2006 Sun Microsystems, Inc. All rights reserved. You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at: http://developer.sun.com/berkeley_license.html +$Id: footer.jsp,v 1.10 2007/01/31 19:40:34 basler Exp $ --%> + +<hr/> +<center> + If you have any questions or suggestions, please use the <a + href="https://blueprints.dev.java.net/feedback.html" target="petstore">feedback page</a>. + <br/> + To access the latest versions of any of the BluePrints projects, please use the <a + href="https://blueprints.dev.java.net/downloads.html" target="petstore">download page</a>. + <br/> + <a href="http://blueprints.dev.java.net/" target="petstore">Java BluePrints</a> | + <a href="http://sun.com/" target="petstore">Sun Microsystems</a> © 2007 Sun Microsystems Inc. All rights reserved. Use is subject to license terms. +</center> + diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9081-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9081-s.jpg new file mode 100644 index 0000000..734f0ba Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9081-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9081.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9081.jpg new file mode 100644 index 0000000..1d6b615 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9081.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9083-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9083-s.jpg new file mode 100644 index 0000000..d50fc6f Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9083-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9083.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9083.jpg new file mode 100644 index 0000000..77fb082 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9083.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9084-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9084-s.jpg new file mode 100644 index 0000000..93a3832 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9084-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9084.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9084.jpg new file mode 100644 index 0000000..b7c7c3b Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9084.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9086-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9086-s.jpg new file mode 100644 index 0000000..0c9ce17 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9086-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9086.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9086.jpg new file mode 100644 index 0000000..caaf6a7 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9086.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9088-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9088-s.jpg new file mode 100644 index 0000000..6c7d06e Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9088-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9088.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9088.jpg new file mode 100644 index 0000000..f7daf7a Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9088.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9099-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9099-s.jpg new file mode 100644 index 0000000..2794a4b Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9099-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9099.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9099.jpg new file mode 100644 index 0000000..57175e3 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9099.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9100-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9100-s.jpg new file mode 100644 index 0000000..d1b3610 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9100-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9100.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9100.jpg new file mode 100644 index 0000000..dd57db1 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9100.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9101-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9101-s.jpg new file mode 100644 index 0000000..2f14c53 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9101-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9101.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9101.jpg new file mode 100644 index 0000000..334a0f8 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9101.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9102-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9102-s.jpg new file mode 100644 index 0000000..6bec9fa Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9102-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9102.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9102.jpg new file mode 100644 index 0000000..6219a97 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9102.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9103-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9103-s.jpg new file mode 100644 index 0000000..61b9b59 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9103-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9103.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9103.jpg new file mode 100644 index 0000000..d4a91e0 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9103.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9104-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9104-s.jpg new file mode 100644 index 0000000..9c7c4ab Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9104-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9104.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9104.jpg new file mode 100644 index 0000000..93eb9da Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9104.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9107-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9107-s.jpg new file mode 100644 index 0000000..cacb8f6 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9107-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9107.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9107.jpg new file mode 100644 index 0000000..f1da9d8 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9107.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9109-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9109-s.jpg new file mode 100644 index 0000000..a999838 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9109-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9109.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9109.jpg new file mode 100644 index 0000000..e3eeb3e Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9109.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9113-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9113-s.jpg new file mode 100644 index 0000000..bf3aa59 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9113-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9113.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9113.jpg new file mode 100644 index 0000000..990e44b Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9113.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9115-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9115-s.jpg new file mode 100644 index 0000000..873beb5 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9115-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9115.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9115.jpg new file mode 100644 index 0000000..e9f2fbb Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9115.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9117-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9117-s.jpg new file mode 100644 index 0000000..4119ae3 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9117-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9117.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9117.jpg new file mode 100644 index 0000000..efa8fa8 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9117.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9118-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9118-s.jpg new file mode 100644 index 0000000..6ac0c46 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9118-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9118.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9118.jpg new file mode 100644 index 0000000..1ab033b Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9118.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9122-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9122-s.jpg new file mode 100644 index 0000000..4b75817 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9122-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9122.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9122.jpg new file mode 100644 index 0000000..0bbad05 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9122.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9123-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9123-s.jpg new file mode 100644 index 0000000..f63f01a Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9123-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9123.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9123.jpg new file mode 100644 index 0000000..10f22cc Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9123.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9125-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9125-s.jpg new file mode 100644 index 0000000..e18660f Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9125-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9125.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9125.jpg new file mode 100644 index 0000000..e651619 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9125.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9127-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9127-s.jpg new file mode 100644 index 0000000..3f93502 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9127-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9127.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9127.jpg new file mode 100644 index 0000000..d33f856 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9127.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9129-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9129-s.jpg new file mode 100644 index 0000000..43cd251 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9129-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9129.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9129.jpg new file mode 100644 index 0000000..aa0820c Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9129.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9134-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9134-s.jpg new file mode 100644 index 0000000..8b73de1 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9134-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9134.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9134.jpg new file mode 100644 index 0000000..248ca28 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9134.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9138-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9138-s.jpg new file mode 100644 index 0000000..0c3fb87 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9138-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9138.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9138.jpg new file mode 100644 index 0000000..ff93f90 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9138.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9142-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9142-s.jpg new file mode 100644 index 0000000..4571a4b Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9142-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9142.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9142.jpg new file mode 100644 index 0000000..647323b Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9142.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9149-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9149-s.jpg new file mode 100644 index 0000000..e870f66 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9149-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9149.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9149.jpg new file mode 100644 index 0000000..23dd110 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9149.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9154-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9154-s.jpg new file mode 100644 index 0000000..3355eaa Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9154-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9154.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9154.jpg new file mode 100644 index 0000000..531ec1e Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9154.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9155-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9155-s.jpg new file mode 100644 index 0000000..9cd85f5 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9155-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9155.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9155.jpg new file mode 100644 index 0000000..72377b5 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9155.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9156-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9156-s.jpg new file mode 100644 index 0000000..2788d06 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9156-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9156.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9156.jpg new file mode 100644 index 0000000..2b836df Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9156.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9157-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9157-s.jpg new file mode 100644 index 0000000..9ef87c3 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9157-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9157.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9157.jpg new file mode 100644 index 0000000..753d1e9 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9157.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9158-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9158-s.jpg new file mode 100644 index 0000000..29953c4 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9158-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9158.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9158.jpg new file mode 100644 index 0000000..a4a0247 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9158.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9159-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9159-s.jpg new file mode 100644 index 0000000..7caf368 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9159-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9159.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9159.jpg new file mode 100644 index 0000000..9f18ed6 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9159.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9162-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9162-s.jpg new file mode 100644 index 0000000..65bc52f Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9162-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9162.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9162.jpg new file mode 100644 index 0000000..b0f299d Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9162.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9165-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9165-s.jpg new file mode 100644 index 0000000..d1e9cc3 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9165-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9165.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9165.jpg new file mode 100644 index 0000000..862c6f8 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9165.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/ad-jre.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/ad-jre.jpg new file mode 100644 index 0000000..5c7b519 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/ad-jre.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/ad-netbeans.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/ad-netbeans.jpg new file mode 100644 index 0000000..079b2fa Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/ad-netbeans.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/ad-sdk.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/ad-sdk.jpg new file mode 100644 index 0000000..2a1a88a Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/ad-sdk.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/african-spurred-tortoise-thumb.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/african-spurred-tortoise-thumb.jpg new file mode 100644 index 0000000..4d1ed42 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/african-spurred-tortoise-thumb.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/african-spurred-tortoise.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/african-spurred-tortoise.jpg new file mode 100644 index 0000000..87ea286 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/african-spurred-tortoise.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/african-spurred-tortoise2-thumb.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/african-spurred-tortoise2-thumb.jpg new file mode 100644 index 0000000..7b76088 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/african-spurred-tortoise2-thumb.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/african-spurred-tortoise2.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/african-spurred-tortoise2.jpg new file mode 100644 index 0000000..8005ff3 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/african-spurred-tortoise2.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/anthony-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/anthony-s.jpg new file mode 100644 index 0000000..4b21f49 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/anthony-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/anthony.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/anthony.jpg new file mode 100644 index 0000000..88a889c Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/anthony.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bailey-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bailey-s.jpg new file mode 100644 index 0000000..8adf561 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bailey-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bailey.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bailey.jpg new file mode 100644 index 0000000..c262965 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bailey.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/banner_logo.gif b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/banner_logo.gif new file mode 100644 index 0000000..85de81a Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/banner_logo.gif differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bird1.gif b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bird1.gif new file mode 100644 index 0000000..06f1abe Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bird1.gif differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bird2.gif b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bird2.gif new file mode 100644 index 0000000..9601f1c Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bird2.gif differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bird3.gif b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bird3.gif new file mode 100644 index 0000000..f48a7ec Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bird3.gif differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bird4.gif b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bird4.gif new file mode 100644 index 0000000..eaaa3e5 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bird4.gif differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bird5.gif b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bird5.gif new file mode 100644 index 0000000..9f440f1 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bird5.gif differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bird6.gif b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bird6.gif new file mode 100644 index 0000000..affd8e0 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bird6.gif differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/birds_icon.gif b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/birds_icon.gif new file mode 100644 index 0000000..8b14629 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/birds_icon.gif differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/biscuit-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/biscuit-s.jpg new file mode 100644 index 0000000..8c54af1 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/biscuit-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/biscuit.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/biscuit.jpg new file mode 100644 index 0000000..ccdea14 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/biscuit.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bob-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bob-s.jpg new file mode 100644 index 0000000..b3f1d09 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bob-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bob.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bob.jpg new file mode 100644 index 0000000..d3dcfd7 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bob.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/box-turtle-thumb.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/box-turtle-thumb.jpg new file mode 100644 index 0000000..a4b48da Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/box-turtle-thumb.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/box-turtle.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/box-turtle.jpg new file mode 100644 index 0000000..5a172c5 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/box-turtle.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/box-turtle2-thumb.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/box-turtle2-thumb.jpg new file mode 100644 index 0000000..40303af Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/box-turtle2-thumb.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/box-turtle2.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/box-turtle2.jpg new file mode 100644 index 0000000..83d74d2 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/box-turtle2.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/box-turtle3-thumb.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/box-turtle3-thumb.jpg new file mode 100644 index 0000000..004dfe3 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/box-turtle3-thumb.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/box-turtle3.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/box-turtle3.jpg new file mode 100644 index 0000000..3e77142 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/box-turtle3.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/california-desert-tortoise-thumb.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/california-desert-tortoise-thumb.jpg new file mode 100644 index 0000000..4c260e8 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/california-desert-tortoise-thumb.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/california-desert-tortoise.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/california-desert-tortoise.jpg new file mode 100644 index 0000000..b146396 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/california-desert-tortoise.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/carp-car-med.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/carp-car-med.jpg new file mode 100644 index 0000000..742336f Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/carp-car-med.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/carp-car-thumb.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/carp-car-thumb.jpg new file mode 100644 index 0000000..e5bbc24 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/carp-car-thumb.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat1.gif b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat1.gif new file mode 100644 index 0000000..1fd4d1c Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat1.gif differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat10.gif b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat10.gif new file mode 100644 index 0000000..8bc7f6c Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat10.gif differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat11.gif b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat11.gif new file mode 100644 index 0000000..a51bc96 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat11.gif differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat12.gif b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat12.gif new file mode 100644 index 0000000..e594c67 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat12.gif differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat2.gif b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat2.gif new file mode 100644 index 0000000..6ac8718 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat2.gif differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat3.gif b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat3.gif new file mode 100644 index 0000000..4716f5d Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat3.gif differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat4.gif b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat4.gif new file mode 100644 index 0000000..0793e3f Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat4.gif differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat5.gif b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat5.gif new file mode 100644 index 0000000..2d289ba Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat5.gif differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat6.gif b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat6.gif new file mode 100644 index 0000000..2ea6132 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat6.gif differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat7.gif b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat7.gif new file mode 100644 index 0000000..159ba6a Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat7.gif differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat8.gif b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat8.gif new file mode 100644 index 0000000..a9ed7c9 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat8.gif differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat9.gif b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat9.gif new file mode 100644 index 0000000..02faffb Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat9.gif differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/catalog-thumb-g.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/catalog-thumb-g.jpg new file mode 100644 index 0000000..1a13b11 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/catalog-thumb-g.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/catalog-thumb.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/catalog-thumb.jpg new file mode 100644 index 0000000..d6148de Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/catalog-thumb.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cats_icon.gif b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cats_icon.gif new file mode 100644 index 0000000..db70d7d Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cats_icon.gif differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cbutton.gif b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cbutton.gif new file mode 100644 index 0000000..83b8761 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cbutton.gif differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/chantelle-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/chantelle-s.jpg new file mode 100644 index 0000000..84e4e89 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/chantelle-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/chantelle.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/chantelle.jpg new file mode 100644 index 0000000..5830e57 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/chantelle.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/charlie-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/charlie-s.jpg new file mode 100644 index 0000000..bb91e94 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/charlie-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/charlie.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/charlie.jpg new file mode 100644 index 0000000..9e8d17d Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/charlie.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/check_all.gif b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/check_all.gif new file mode 100644 index 0000000..3c517f3 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/check_all.gif differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cuttlefish-med.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cuttlefish-med.jpg new file mode 100644 index 0000000..575a854 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cuttlefish-med.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cuttlefish-thumb.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cuttlefish-thumb.jpg new file mode 100644 index 0000000..9c2dc57 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cuttlefish-thumb.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dog1.gif b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dog1.gif new file mode 100644 index 0000000..92e71b5 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dog1.gif differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dog2.gif b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dog2.gif new file mode 100644 index 0000000..e581980 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dog2.gif differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dog3.gif b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dog3.gif new file mode 100644 index 0000000..9baa503 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dog3.gif differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dog4.gif b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dog4.gif new file mode 100644 index 0000000..9124427 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dog4.gif differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dog5.gif b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dog5.gif new file mode 100644 index 0000000..3f1690e Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dog5.gif differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dog6.gif b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dog6.gif new file mode 100644 index 0000000..2bf1380 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dog6.gif differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dogs_icon.gif b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dogs_icon.gif new file mode 100644 index 0000000..b13e5b9 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dogs_icon.gif differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dragon-iron-med.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dragon-iron-med.jpg new file mode 100644 index 0000000..ff83a16 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dragon-iron-med.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dragon-iron-thumb.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dragon-iron-thumb.jpg new file mode 100644 index 0000000..814dab1 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dragon-iron-thumb.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/eagle-stone-med.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/eagle-stone-med.jpg new file mode 100644 index 0000000..2623f3c Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/eagle-stone-med.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/eagle-stone-thumb.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/eagle-stone-thumb.jpg new file mode 100644 index 0000000..ccf10a2 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/eagle-stone-thumb.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/eclectus-female-med.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/eclectus-female-med.jpg new file mode 100644 index 0000000..7a7a59e Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/eclectus-female-med.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/eclectus-female-thumb.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/eclectus-female-thumb.jpg new file mode 100644 index 0000000..1f65136 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/eclectus-female-thumb.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/elkie-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/elkie-s.jpg new file mode 100644 index 0000000..4709e19 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/elkie-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/elkie.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/elkie.jpg new file mode 100644 index 0000000..76a7ff1 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/elkie.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/faith-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/faith-s.jpg new file mode 100644 index 0000000..13194bd Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/faith-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/faith.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/faith.jpg new file mode 100644 index 0000000..cd8ad6e Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/faith.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/fish2.gif b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/fish2.gif new file mode 100644 index 0000000..4d9916c Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/fish2.gif differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/fish3.gif b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/fish3.gif new file mode 100644 index 0000000..258489d Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/fish3.gif differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/fish4.gif b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/fish4.gif new file mode 100644 index 0000000..d3e39e1 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/fish4.gif differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/fish_icon.gif b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/fish_icon.gif new file mode 100644 index 0000000..730c813 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/fish_icon.gif differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/florida-king-snake-thumb.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/florida-king-snake-thumb.jpg new file mode 100644 index 0000000..cbe5030 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/florida-king-snake-thumb.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/florida-king-snake.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/florida-king-snake.jpg new file mode 100644 index 0000000..11954df Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/florida-king-snake.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/frog1.gif b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/frog1.gif new file mode 100644 index 0000000..4bf637f Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/frog1.gif differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/gaetano-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/gaetano-s.jpg new file mode 100644 index 0000000..097b144 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/gaetano-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/gaetano.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/gaetano.jpg new file mode 100644 index 0000000..ec5d64b Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/gaetano.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/galah-parrot-med.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/galah-parrot-med.jpg new file mode 100644 index 0000000..31bb43c Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/galah-parrot-med.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/galah-parrot-thumb.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/galah-parrot-thumb.jpg new file mode 100644 index 0000000..70cdc2a Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/galah-parrot-thumb.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/glassfish-colored-med.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/glassfish-colored-med.jpg new file mode 100644 index 0000000..a6646c7 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/glassfish-colored-med.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/glassfish-colored-thumb.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/glassfish-colored-thumb.jpg new file mode 100644 index 0000000..262659a Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/glassfish-colored-thumb.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/guinea-pig-thumb.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/guinea-pig-thumb.jpg new file mode 100644 index 0000000..ea0c069 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/guinea-pig-thumb.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/guinea-pig.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/guinea-pig.jpg new file mode 100644 index 0000000..828bba2 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/guinea-pig.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/harmony-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/harmony-s.jpg new file mode 100644 index 0000000..5b28bd0 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/harmony-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/harmony.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/harmony.jpg new file mode 100644 index 0000000..3c4d322 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/harmony.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/harrison-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/harrison-s.jpg new file mode 100644 index 0000000..c7c1486 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/harrison-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/harrison.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/harrison.jpg new file mode 100644 index 0000000..6003c8c Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/harrison.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/hawaiian-lizard-med.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/hawaiian-lizard-med.jpg new file mode 100644 index 0000000..a538759 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/hawaiian-lizard-med.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/hawaiian-lizard-thumb.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/hawaiian-lizard-thumb.jpg new file mode 100644 index 0000000..2369c90 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/hawaiian-lizard-thumb.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/honey-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/honey-s.jpg new file mode 100644 index 0000000..13c3f9b Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/honey-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/honey.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/honey.jpg new file mode 100644 index 0000000..61d877b Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/honey.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/hunter-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/hunter-s.jpg new file mode 100644 index 0000000..4303498 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/hunter-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/hunter.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/hunter.jpg new file mode 100644 index 0000000..37ebbe9 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/hunter.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/index-thumb-g.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/index-thumb-g.jpg new file mode 100644 index 0000000..a42ddb4 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/index-thumb-g.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/index-thumb.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/index-thumb.jpg new file mode 100644 index 0000000..571475a Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/index-thumb.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/indicator-black.gif b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/indicator-black.gif new file mode 100644 index 0000000..6da716a Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/indicator-black.gif differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/ja_flag.gif b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/ja_flag.gif new file mode 100644 index 0000000..31d0ada Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/ja_flag.gif differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/jack-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/jack-s.jpg new file mode 100644 index 0000000..d4144da Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/jack-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/jack.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/jack.jpg new file mode 100644 index 0000000..fe37700 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/jack.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/katzen-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/katzen-s.jpg new file mode 100644 index 0000000..d83d3f9 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/katzen-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/katzen.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/katzen.jpg new file mode 100644 index 0000000..ba460be Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/katzen.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/koi-med.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/koi-med.jpg new file mode 100644 index 0000000..7afa021 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/koi-med.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/koi-thumb.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/koi-thumb.jpg new file mode 100644 index 0000000..f7fa2b2 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/koi-thumb.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/kookaburra-med.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/kookaburra-med.jpg new file mode 100644 index 0000000..8c06c3d Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/kookaburra-med.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/kookaburra-thumb.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/kookaburra-thumb.jpg new file mode 100644 index 0000000..84e82f5 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/kookaburra-thumb.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/lady-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/lady-s.jpg new file mode 100644 index 0000000..72a724f Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/lady-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/lady.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/lady.jpg new file mode 100644 index 0000000..ae9054e Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/lady.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/left.gif b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/left.gif new file mode 100644 index 0000000..46b3630 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/left.gif differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/left_2.gif b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/left_2.gif new file mode 100644 index 0000000..f50cbed Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/left_2.gif differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/leopard-gecko-thumb.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/leopard-gecko-thumb.jpg new file mode 100644 index 0000000..620c826 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/leopard-gecko-thumb.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/leopard-gecko-thumb2.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/leopard-gecko-thumb2.jpg new file mode 100644 index 0000000..2a52e80 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/leopard-gecko-thumb2.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/leopard-gecko.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/leopard-gecko.jpg new file mode 100644 index 0000000..7b77428 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/leopard-gecko.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/leopard-gecko2.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/leopard-gecko2.jpg new file mode 100644 index 0000000..b3748ae Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/leopard-gecko2.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/lizard1.gif b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/lizard1.gif new file mode 100644 index 0000000..665c4d6 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/lizard1.gif differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/lizard2.gif b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/lizard2.gif new file mode 100644 index 0000000..2e59d89 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/lizard2.gif differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/lizard3.gif b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/lizard3.gif new file mode 100644 index 0000000..6dca58f Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/lizard3.gif differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/lovebird-med.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/lovebird-med.jpg new file mode 100644 index 0000000..cef3163 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/lovebird-med.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/lovebird-thumb.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/lovebird-thumb.jpg new file mode 100644 index 0000000..7e97d51 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/lovebird-thumb.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/macaw-thumb.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/macaw-thumb.jpg new file mode 100644 index 0000000..a95ff80 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/macaw-thumb.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/macaw.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/macaw.jpg new file mode 100644 index 0000000..b7ae026 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/macaw.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/maggie-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/maggie-s.jpg new file mode 100644 index 0000000..7acf48e Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/maggie-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/maggie.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/maggie.jpg new file mode 100644 index 0000000..140a325 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/maggie.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/marianna-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/marianna-s.jpg new file mode 100644 index 0000000..4b96d8d Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/marianna-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/marianna.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/marianna.jpg new file mode 100644 index 0000000..5e3b381 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/marianna.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/mario-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/mario-s.jpg new file mode 100644 index 0000000..f2f1848 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/mario-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/mario.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/mario.jpg new file mode 100644 index 0000000..a68cd9e Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/mario.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/maximize.gif b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/maximize.gif new file mode 100644 index 0000000..da05f30 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/maximize.gif differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/mexican-redkneed-tarantula-thumb.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/mexican-redkneed-tarantula-thumb.jpg new file mode 100644 index 0000000..35387ca Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/mexican-redkneed-tarantula-thumb.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/mexican-redkneed-tarantula.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/mexican-redkneed-tarantula.jpg new file mode 100644 index 0000000..7365af9 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/mexican-redkneed-tarantula.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/mimi-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/mimi-s.jpg new file mode 100644 index 0000000..0e6a1a5 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/mimi-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/mimi.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/mimi.jpg new file mode 100644 index 0000000..950c84e Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/mimi.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/minimize.gif b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/minimize.gif new file mode 100644 index 0000000..8408264 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/minimize.gif differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/monique-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/monique-s.jpg new file mode 100644 index 0000000..dea6b6d Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/monique-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/monique.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/monique.jpg new file mode 100644 index 0000000..0f0ac10 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/monique.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/moon-jelly-med.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/moon-jelly-med.jpg new file mode 100644 index 0000000..3c7618a Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/moon-jelly-med.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/moon-jelly-thumb.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/moon-jelly-thumb.jpg new file mode 100644 index 0000000..e765076 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/moon-jelly-thumb.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/octopus-red-med.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/octopus-red-med.jpg new file mode 100644 index 0000000..7c7d897 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/octopus-red-med.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/octopus-red-thumb.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/octopus-red-thumb.jpg new file mode 100644 index 0000000..4cdb8bb Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/octopus-red-thumb.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/octopus-white-med.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/octopus-white-med.jpg new file mode 100644 index 0000000..f38af83 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/octopus-white-med.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/octopus-white-thumb.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/octopus-white-thumb.jpg new file mode 100644 index 0000000..bec9ee6 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/octopus-white-thumb.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/olie-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/olie-s.jpg new file mode 100644 index 0000000..9bb9a17 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/olie-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/olie.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/olie.jpg new file mode 100644 index 0000000..c91be8e Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/olie.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/paris-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/paris-s.jpg new file mode 100644 index 0000000..f4ce9ec Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/paris-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/paris.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/paris.jpg new file mode 100644 index 0000000..b599c76 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/paris.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/parrot-popcorn-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/parrot-popcorn-s.jpg new file mode 100644 index 0000000..cae1408 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/parrot-popcorn-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/parrot-popcorn.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/parrot-popcorn.jpg new file mode 100644 index 0000000..57e02ff Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/parrot-popcorn.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/peacock-blue-med.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/peacock-blue-med.jpg new file mode 100644 index 0000000..758ed35 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/peacock-blue-med.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/peacock-blue-thumb.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/peacock-blue-thumb.jpg new file mode 100644 index 0000000..3aec8c4 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/peacock-blue-thumb.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/peacock-med.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/peacock-med.jpg new file mode 100644 index 0000000..13164b8 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/peacock-med.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/peacock-thumb.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/peacock-thumb.jpg new file mode 100644 index 0000000..fbd5412 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/peacock-thumb.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/peacock-white-thumb.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/peacock-white-thumb.jpg new file mode 100644 index 0000000..148006d Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/peacock-white-thumb.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/peakcock-white-med.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/peakcock-white-med.jpg new file mode 100644 index 0000000..f25a814 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/peakcock-white-med.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/prehensile-tailed-skink-thumb.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/prehensile-tailed-skink-thumb.jpg new file mode 100644 index 0000000..2d9c2b1 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/prehensile-tailed-skink-thumb.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/prehensile-tailed-skink.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/prehensile-tailed-skink.jpg new file mode 100644 index 0000000..3573943 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/prehensile-tailed-skink.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/prehensile-tailed-skink2-thumb.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/prehensile-tailed-skink2-thumb.jpg new file mode 100644 index 0000000..9be6e41 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/prehensile-tailed-skink2-thumb.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/prehensile-tailed-skink2.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/prehensile-tailed-skink2.jpg new file mode 100644 index 0000000..0559845 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/prehensile-tailed-skink2.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/princess-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/princess-s.jpg new file mode 100644 index 0000000..d4521a3 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/princess-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/princess.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/princess.jpg new file mode 100644 index 0000000..370e4fd Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/princess.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/puppup-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/puppup-s.jpg new file mode 100644 index 0000000..5b89061 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/puppup-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/puppup.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/puppup.jpg new file mode 100644 index 0000000..efff187 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/puppup.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/purple-jellyfish-med.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/purple-jellyfish-med.jpg new file mode 100644 index 0000000..93af55f Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/purple-jellyfish-med.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/purple-jellyfish-thumb.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/purple-jellyfish-thumb.jpg new file mode 100644 index 0000000..d751856 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/purple-jellyfish-thumb.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/rainbow-lorikeet-med.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/rainbow-lorikeet-med.jpg new file mode 100644 index 0000000..9c72270 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/rainbow-lorikeet-med.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/rainbow-lorikeet-thumb.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/rainbow-lorikeet-thumb.jpg new file mode 100644 index 0000000..9003e0c Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/rainbow-lorikeet-thumb.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/reptiles_icon.gif b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/reptiles_icon.gif new file mode 100644 index 0000000..0ee4c52 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/reptiles_icon.gif differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/right.gif b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/right.gif new file mode 100644 index 0000000..89e7ba1 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/right.gif differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/rita-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/rita-s.jpg new file mode 100644 index 0000000..16d1692 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/rita-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/rita.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/rita.jpg new file mode 100644 index 0000000..f183f1c Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/rita.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/rockfish-med.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/rockfish-med.jpg new file mode 100644 index 0000000..005d708 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/rockfish-med.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/rockfish-thumb.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/rockfish-thumb.jpg new file mode 100644 index 0000000..e82c87d Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/rockfish-thumb.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/sabrina-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/sabrina-s.jpg new file mode 100644 index 0000000..508edb1 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/sabrina-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/sabrina.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/sabrina.jpg new file mode 100644 index 0000000..870c2f3 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/sabrina.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/sea-anemone-med.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/sea-anemone-med.jpg new file mode 100644 index 0000000..a18e30a Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/sea-anemone-med.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/sea-anemone-thumb.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/sea-anemone-thumb.jpg new file mode 100644 index 0000000..febadd3 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/sea-anemone-thumb.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/sea-nettle-jellyfish-med.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/sea-nettle-jellyfish-med.jpg new file mode 100644 index 0000000..c7329f4 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/sea-nettle-jellyfish-med.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/sea-nettle-jellyfish-thumb.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/sea-nettle-jellyfish-thumb.jpg new file mode 100644 index 0000000..3753577 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/sea-nettle-jellyfish-thumb.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/seller-thumb-g.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/seller-thumb-g.jpg new file mode 100644 index 0000000..a9c45e8 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/seller-thumb-g.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/seller-thumb.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/seller-thumb.jpg new file mode 100644 index 0000000..2b7adf1 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/seller-thumb.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/simba-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/simba-s.jpg new file mode 100644 index 0000000..93e78ee Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/simba-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/simba.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/simba.jpg new file mode 100644 index 0000000..cdbb5fb Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/simba.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/splash.gif b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/splash.gif new file mode 100644 index 0000000..cdae47c Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/splash.gif differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/spotted-jellyfish-med.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/spotted-jellyfish-med.jpg new file mode 100644 index 0000000..6c1e407 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/spotted-jellyfish-med.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/spotted-jellyfish-thumb.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/spotted-jellyfish-thumb.jpg new file mode 100644 index 0000000..991392d Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/spotted-jellyfish-thumb.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/thaicat-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/thaicat-s.jpg new file mode 100644 index 0000000..49898fb Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/thaicat-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/thaicat.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/thaicat.jpg new file mode 100644 index 0000000..eb43a52 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/thaicat.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/thaidog-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/thaidog-s.jpg new file mode 100644 index 0000000..c918e36 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/thaidog-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/thaidog.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/thaidog.jpg new file mode 100644 index 0000000..f5063e3 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/thaidog.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/uncheck_all.gif b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/uncheck_all.gif new file mode 100644 index 0000000..39fa7ba Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/uncheck_all.gif differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/us_flag.gif b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/us_flag.gif new file mode 100644 index 0000000..52bc595 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/us_flag.gif differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/zh_flag.gif b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/zh_flag.gif new file mode 100644 index 0000000..0393bc1 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/zh_flag.gif differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/index-ajax.jsp b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/index-ajax.jsp new file mode 100644 index 0000000..9ce0b8d --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/index-ajax.jsp @@ -0,0 +1,239 @@ +<%-- Copyright 2006 Sun Microsystems, Inc. All rights reserved. You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at: http://developer.sun.com/berkeley_license.html +$Id: index.jsp,v 1.17 2007/03/15 23:19:46 basler Exp $ --%> +<%@page contentType="text/html"%> +<%@page pageEncoding="UTF-8"%> +<%@page import="java.util.*, com.sun.javaee.blueprints.petstore.model.CatalogFacade, com.sun.javaee.blueprints.petstore.model.Tag"%> + +<% +try { + CatalogFacade cf = (CatalogFacade)config.getServletContext().getAttribute("CatalogFacade"); + List<Tag> tags=cf.getTagsInChunk(0, 12); + // since top 20 come from database or desending refCount order, need to reorder by tag name + Collections.sort(tags, new Comparator() { + public int compare(Object one, Object two) { + int cc=((Tag)two).getTag().compareTo(((Tag)one).getTag()); + return (cc < 0 ? 1 : cc > 0 ? -1 : 0); + } + }); +%> + +<html> + <head> + <meta http-equiv="Content-Type" content="text/html;charset=utf-8" > + <title>Java Pet Store Reference Application</title> + <script type="text/javascript" src="./common.js"></script> + <link type="text/css" rel="stylesheet" href="./tag.css"/> + <script type="text/javascript"> + //var djConfig = {isDebug: true }; + </script> + </head> + <body> + + <jsp:include page="banner.jsp" /> + <script> + dojo.require("dojo.widget.FisheyeList"); + dojo.require("dojo.io.*"); + dojo.require("dojo.io.ScriptSrcIO"); + //transport: "ScriptSrcTransport", + //url: "http://localhost:8080/petstore/downloadAd.json", + + function browse(category) { + window.location.href="${pageContext.request.contextPath}/faces/catalog.jsp?catid=" + category; + + } + + + function debugProperties(namex) { + var listx=""; + var ob=namex; + for(xx in ob) { + listx += xx + " = " + ob[xx] + "<br/>" + } + //document.write(listx); + alert(listx); + } + + function checkAdPage() { + var bindArgs = { + //url: "https://blueprints.dev.java.net/petstore/downloadAd.json", + //url: "http://localhost:8080/petstore/downloadAd.json", + url: "http://search.yahooapis.com/ImageSearchService/V1/imageSearch?appid=YahooDem...", + transport: "ScriptSrcTransport", + jsonParamName: "callback", + mimetype: "text/json", + load: function(type, data, event, kwArgs) { + /* type will be "load", data will be response data, event will null, and kwArgs are the keyword arguments used in the dojo.io.bind call. */ + alert("load = " + data.ResultSet.totalResultsAvailable); + //debugProperties(data); + //document.getElementById("downloadAds").innerHTML=data.downloadxx; + + + }, + error: function(type, data, event, kwArgs) { + /* type will be "error", data will be response data, event will null, and kwArgs are the keyword arguments used in the dojo.io.bind call. */ + alert("error"); + }, + timeout: function() { + /* Called if there is a timeout */ + alert("timeout"); + }, + timeoutSeconds: 10}; + // dispatch the request + dojo.io.bind(bindArgs); + } + + function callback() { + alert("callback"); + } + + function returnFunctionx(type, data, evt) { + // statically setup popup for simple case + // check return of the dojo call to make sure it is valid + if (evt.readyState == 4) { + if (evt.status == 200) { + alert("data = " + data.downloadxx); + //document.getElementById("downloadAds").innerHTML=data; + document.getElementById("downloadAds").innerHTML=data.downloadxx; + } + } + } + + function testit() { + testx={download:"test", textx:"it"}; + alert("test = " + testx.download); + } + + + </script> + <span onclick="checkAdPage();">test it</span> + + + <table bgcolor="white"> + <tr> + <td valign="top"> + <div class="outerbar" style="width: 200px"> + + <div dojoType="FisheyeList" + itemWidth="170" itemHeight="50" + itemMaxWidth="340" itemMaxHeight="100" + orientation="vertical" + effectUnits="2" + itemPadding="10" + attachEdge="top" + labelEdge="bottom" + enableCrappySvgSupport="false"> + + <div dojoType="FisheyeListItem" onClick="browse('Dogs');" + iconsrc="${pageContext.request.contextPath}/images/dogs_icon.gif"> + </div> + + <div dojoType="FisheyeListItem" onClick="browse('Cats');" + iconsrc="${pageContext.request.contextPath}/images/cats_icon.gif"> + </div> + + <div dojoType="FisheyeListItem" onClick="browse('Birds');" + iconsrc="${pageContext.request.contextPath}/images/birds_icon.gif"> + </div> + + <div dojoType="FisheyeListItem" onClick="browse('Fish');" + iconsrc="${pageContext.request.contextPath}/images/fish_icon.gif"> + </div> + + <div dojoType="FisheyeListItem" onClick="browse('Reptiles');" + iconsrc="${pageContext.request.contextPath}/images/reptiles_icon.gif"> + </div> + </div> + + </div> + </td> + <td valign="top" style="width: 400px"> + <div id="bodyCenter"> + <table valign="top" id="bodyTable" border="0"> + <tr> + <td> + <map name="petmap"> + <area onmouseover="javascript:this.style.cursor='pointer';" onclick="browse('Birds')" + alt="Birds" + coords="72,2,280,250"> + <area onmouseover="javascript:this.style.cursor='pointer';" onclick="browse('Fish')" + alt="Fish" + coords="2,180,72,250"> + <area onmouseover="javascript:this.style.cursor='pointer';" onclick="browse('Dogs')" + alt="Dogs" + coords="60,250,130,320"> + <area onmouseover="javascript:this.style.cursor='pointer';" onclick="browse('Reptiles')" + alt="Reptiles" + coords="140,270,210,340"> + <area onmouseover="javascript:this.style.cursor='pointer';" onclick="browse('Cats')" + alt="Cats" + coords="225,240,295,310"> + <area onmouseover="javascript:this.style.cursor='pointer';" onclick="browse('Birds')" + alt="Birds" + coords="280,180,350,250"> + </map> + + <img src="${pageContext.request.contextPath}/images/splash.gif" + alt="Pet Selection Map" + usemap="#petmap" + width="350" + height="355" + border="0"> + </td> + </tr> + </table> + + </div> + </td> + <td style="vertical-align:top;"> + <div style="border-style: double; width:100%;"> + <table border="0"> + <tr> + <th colspan="2" style="text-align:center">Most Popular Tags</th> + </tr> + <tr> +<% + String style=null; + int refx=0, ii=0; + for(Tag tag : tags) { + refx=tag.getRefCount() / 5; + if(refx >= 3) { + style="xxlarge"; + } else if(refx == 2) { + style="xlarge"; + } else if(refx == 1) { + style="large"; + } else { + style="medium"; + } + + if((ii % 2) == 0) out.println("</tr>\n<tr>"); + out.println("<td class='tagCell' style='text-align: center'><a href='./tag.jsp?tag=" + + tag.getTag() + "'><span class='" + style +"'>" + tag.getTag() + "</span></a></td>"); + ii++; + } +%> + </tr> + </table> + </div> + </td> + <td valign="top" style="vertical-align:top; width:250px;"> + <div id="downloadAds"> + <jsp:include page="download.jsp" /> + </div> + </td> + </tr> + </table> + + <div style="position: absolute; visibility: hidden;z-index:5" id="menu-popup"> + <table id="completeTable" class="popupTable" ></table> + </div> + + <br/><br/> + <jsp:include page="footer.jsp" /> + </body> +</html> +<% + } catch(Exception e) { + e.printStackTrace(); + } +%> diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/index.html b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/index.html new file mode 100644 index 0000000..8c5ca1b --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/index.html @@ -0,0 +1,117 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html> +<head> + <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> + <title>Java Pet Store Reference Application, 2.0 Early Access</title> +</head> +<body> +<hr> +<h1>Java Pet Store Reference Application, 2.0 Early Access</h1> +<h2><a href="./faces/index.jsp">Enter the Store</a></h2> +The Java Pet Store Reference Application is a sample application +brought to +you by the <a href="http://blueprints.dev.java.net/">Java BluePrints</a> +program at <a href="http://sun.com">Sun Microsystems</a>. +This application is designed to illustrate how the Java EE 5 Platform +can be used to develop an AJAX-enabled Web 2.0 application. The +application comes with full source-code available under a +BSD-style license, so you can experiment with it and use it in your own +applications. <br> +<br> +<a href="#try">Try the Petstore Demo</a><br> +<a href="#learn">Learn more about features in Java Petstore</a><br> +<a href="#contributors">Show appreciation for Pet Store image +contributors</a><br> +<a href="#about">About BluePrints</a> +<h2><a name="try"></a>Try the Pet Store Demo</h2> +Now that you have the application deployed, you can use it and try out +the features. You can browse the catalog of pets for sale, sell your +own pets on the store, search for pets by location using Google maps, +view the RSS news bar for BluePrints news, and more.<a + href="./faces/index.jsp">Enter the Store</a> +<h2><a name="features"></a>Learn More About Features in Java Petstore</h2> +<p>Here are some of the features of this application. For a detailed +description of the features in the Java Pet +Store Reference application, please refer to the article at <a + href="http://java.sun.com/developer/technicalArticles/J2EE/petstore/%22%3Ehttp://j...</a><a + href="http://java.sun.com/developer/technicalArticles/J2EE/petstore/%22%3E</a><b> +</b></p> +<ol> + <li>Using AJAX for single-page interactive Web applications: The +application is designed to be a single-page application where the user +never leaves the page. Different sections of the page are dynamically +loaded based on the user actions. These sections are loaded +asynchronously to avoid any browser refreshes, and to give a richer +interactive user-experience. </li> + <li>Mash-ups with Google maps: The petstore uses a mashup with +Google's Map service, alongwith Yahoo's Geo-coder service to allow +users to see the available pets in a neighborhood. </li> + <li>Community-created content: The application allows a user to add a +pet for sale or adoption on the Website. The seller uploads </li> + <ol> + <li>Using Captchas to discourage spam in the community created +content: Whenever a website allows its users to add content, it needs +to build mechanisms to discourage placement of spurious content on its +Website through automated mechanisms. We demonstrate how captchas can +be used for this purpose. </li> + <li>Community rated content: Each item in the petstore website can +be rated by the users </li> + <li>Payments through PayPal: The application provides a meeting +ground for +buyers and sellers of pets. The application uses the PayPal service to +allow sellers to accept payments.</li> + </ol> + <li>Integration of an RSS feed: The website integrates an RSS feed of +news items coming out the Java BluePrints website. The </li> + <li>Integration of a search engine: The application integrates +Apache Lucene search engine to handle all website searches. </li> +</ol> +This application also demonstrate the use of various features of +the Java EE 5 platform such as: <br> +<ol> + <li>JavaServer Faces: Many of the AJAX features are implemented as +reusable JavaServer Faces components. </li> + <li>Java Persistence API: The application uses Java Persistence APIs +to create an object/relational mapping layer. </li> + <li>Dependency Injection: The application uses dependency injection +instead of deployment descriptors.</li> +</ol> +See the <a + href="https://blueprints.dev.java.net/petstore/architecture.html%22%3EPet +Store Architecure document</a> for more detail. +<h2><a name="contributors"></a>Show Appreciation for Pet Store Image +Contributors</h2> +<p>For many images in the Java Petstore, some organizations and people +were kind enough to give us permission to photograph their animals or +even give us photos to use in the Java Petstore. See the <a + href="https://blueprints.dev.java.net/petstore/imagecontributors.html%22%3E +image contributors </a> page for a more detail on these friends of the +animals. +</p> +<h2><a name="about"></a>About Java BluePrints</h2> +<p>The Java BluePrints program defines the application programming +model for the Java EE™ platform. It provides best practice guidelines +and +architectural recommendations for real-world application scenarios to +enable developers to build portable, scalable, and robust applications +using the Java EE technologies.<br> +<br> +Some other popular projects from Java BluePrints are <a + href="http://blueprints.dev.java.net/bpcatalog/%22%3EJava BluePrints +Solutions Catalog</a>, <a target="_blank" + href="https://blueprints.dev.java.net/adventurebuilder/%22%3EJava +Adventure Builder Reference</a> application, <a target="_blank" + href="http://java.sun.com/blueprints/guidelines/designing_webservices/%22%3EDesign... +Web Services with the J2EE(TM) 1.4 Platform : JAX-RPC, SOAP, and XML +Technologies</a> book, and the <a target="_blank" + href="http://java.sun.com/blueprints/guidelines/designing_enterprise_applications_...<span + class="body"><span class="title">Designing +Enterprise Applications with the J2EE Platform, Second Edition</span></span></a> +book. You can access these projects and other content from Java +BluePrints by visiting the <a target="_blank" + href="http://java.sun.com/reference/blueprints/index.html%22%3EJava +BluePrints website</a>. </p> +<hr noshade="noshade">Copyright © 2007 Sun Microsystems, +Inc. All Rights Reserved. +</body> +</html> diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/index.jsp b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/index.jsp new file mode 100644 index 0000000..ab59139 --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/index.jsp @@ -0,0 +1,164 @@ +<%-- Copyright 2006 Sun Microsystems, Inc. All rights reserved. You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at: http://developer.sun.com/berkeley_license.html +$Id: index.jsp,v 1.20 2007/03/16 20:18:59 basler Exp $ --%> +<%@page contentType="text/html"%> +<%@page pageEncoding="UTF-8"%> +<%@page import="java.util.*, com.sun.javaee.blueprints.petstore.model.CatalogFacade, com.sun.javaee.blueprints.petstore.model.Tag"%> + +<% +try { + CatalogFacade cf = (CatalogFacade)config.getServletContext().getAttribute("CatalogFacade"); + List<Tag> tags=cf.getTagsInChunk(0, 12); + // since top 20 come from database or desending refCount order, need to reorder by tag name + Collections.sort(tags, new Comparator() { + public int compare(Object one, Object two) { + int cc=((Tag)two).getTag().compareTo(((Tag)one).getTag()); + return (cc < 0 ? 1 : cc > 0 ? -1 : 0); + } + }); +%> + +<html> + <head> + <meta http-equiv="Content-Type" content="text/html;charset=utf-8" > + <title>Java Pet Store Reference Application</title> + <link type="text/css" rel="stylesheet" href="./tag.css"/> + </head> + <body> + + <jsp:include page="banner.jsp" /> + <script> + dojo.require("dojo.widget.FisheyeList"); + function browse(category) { + window.location.href="${pageContext.request.contextPath}/faces/catalog.jsp?catid=" + category; + } + </script> + <table bgcolor="white"> + <tr> + <td valign="top"> + <div class="outerbar" style="width: 200px"> + + <div dojoType="FisheyeList" + itemWidth="170" itemHeight="50" + itemMaxWidth="340" itemMaxHeight="100" + orientation="vertical" + effectUnits="2" + itemPadding="10" + attachEdge="top" + labelEdge="bottom" + enableCrappySvgSupport="false"> + + <div dojoType="FisheyeListItem" onClick="browse('Dogs');" + iconsrc="${pageContext.request.contextPath}/images/dogs_icon.gif"> + </div> + + <div dojoType="FisheyeListItem" onClick="browse('Cats');" + iconsrc="${pageContext.request.contextPath}/images/cats_icon.gif"> + </div> + + <div dojoType="FisheyeListItem" onClick="browse('Birds');" + iconsrc="${pageContext.request.contextPath}/images/birds_icon.gif"> + </div> + + <div dojoType="FisheyeListItem" onClick="browse('Fish');" + iconsrc="${pageContext.request.contextPath}/images/fish_icon.gif"> + </div> + + <div dojoType="FisheyeListItem" onClick="browse('Reptiles');" + iconsrc="${pageContext.request.contextPath}/images/reptiles_icon.gif"> + </div> + </div> + + </div> + </td> + <td valign="top" style="width: 400px"> + <div id="bodyCenter"> + <table valign="top" id="bodyTable" border="0"> + <tr> + <td> + <map name="petmap"> + <area onmouseover="javascript:this.style.cursor='pointer';" onclick="browse('Birds')" + alt="Birds" + coords="72,2,280,250"> + <area onmouseover="javascript:this.style.cursor='pointer';" onclick="browse('Fish')" + alt="Fish" + coords="2,180,72,250"> + <area onmouseover="javascript:this.style.cursor='pointer';" onclick="browse('Dogs')" + alt="Dogs" + coords="60,250,130,320"> + <area onmouseover="javascript:this.style.cursor='pointer';" onclick="browse('Reptiles')" + alt="Reptiles" + coords="140,270,210,340"> + <area onmouseover="javascript:this.style.cursor='pointer';" onclick="browse('Cats')" + alt="Cats" + coords="225,240,295,310"> + <area onmouseover="javascript:this.style.cursor='pointer';" onclick="browse('Birds')" + alt="Birds" + coords="280,180,350,250"> + </map> + + <img src="${pageContext.request.contextPath}/images/splash.gif" + alt="Pet Selection Map" + usemap="#petmap" + width="350" + height="355" + border="0"> + </td> + </tr> + </table> + + </div> + </td> + <td style="vertical-align:top;"> + <div style="border-style: double; width:100%;"> + <table border="0"> + <tr> + <th colspan="2" style="text-align:center">Most Popular Tags</th> + </tr> + <tr> +<% + String style=null; + int refx=0, ii=0; + for(Tag tag : tags) { + refx=tag.getRefCount() / 5; + if(refx >= 3) { + style="xxlarge"; + } else if(refx == 2) { + style="xlarge"; + } else if(refx == 1) { + style="large"; + } else { + style="medium"; + } + + if((ii % 2) == 0) out.println("</tr>\n<tr>"); + out.println("<td class='tagCell' style='text-align: center'><a href='./tag.jsp?tag=" + + tag.getTag() + "'><span class='" + style +"'>" + tag.getTag() + "</span></a></td>"); + ii++; + } +%> + </tr> + </table> + </div> + </td> + <td style="vertical-align:top; width:300px; text-align:right;"> + <div id="downloadAds"> + <jsp:include page="download.jsp" /> + </div> + </td> + </tr> + </table> + + <div style="position: absolute; visibility: hidden;z-index:5" id="menu-popup"> + <table id="completeTable" class="popupTable" ></table> + </div> + + <br/><br/> + <jsp:include page="footer.jsp" /> + + </body> +</html> +<% + } catch(Exception e) { + e.printStackTrace(); + } +%> diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/index_a.jsp b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/index_a.jsp new file mode 100644 index 0000000..54f30ce --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/index_a.jsp @@ -0,0 +1,194 @@ +<%-- Copyright 2006 Sun Microsystems, Inc. All rights reserved. You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at: http://developer.sun.com/berkeley_license.html +$Id: index.jsp,v 1.18 2007/03/16 15:29:15 basler Exp $ --%> +<%@page contentType="text/html"%> +<%@page pageEncoding="UTF-8"%> +<%@page import="java.util.*, com.sun.javaee.blueprints.petstore.model.CatalogFacade, com.sun.javaee.blueprints.petstore.model.Tag"%> + +<% +try { + CatalogFacade cf = (CatalogFacade)config.getServletContext().getAttribute("CatalogFacade"); + List<Tag> tags=cf.getTagsInChunk(0, 12); + // since top 20 come from database or desending refCount order, need to reorder by tag name + Collections.sort(tags, new Comparator() { + public int compare(Object one, Object two) { + int cc=((Tag)two).getTag().compareTo(((Tag)one).getTag()); + return (cc < 0 ? 1 : cc > 0 ? -1 : 0); + } + }); +%> + +<html> + <head> + <meta http-equiv="Content-Type" content="text/html;charset=utf-8" > + <title>Java Pet Store Reference Application</title> + <link type="text/css" rel="stylesheet" href="./tag.css"/> + <script type="text/javascript" src="https://blueprints.dev.java.net/petstore/downloadAd.js"></script> + </head> + <body onload="alterDownloadAd()"> + + <jsp:include page="banner.jsp" /> + <script> + dojo.require("dojo.widget.FisheyeList"); + function browse(category) { + window.location.href="${pageContext.request.contextPath}/faces/catalog.jsp?catid=" + category; + } + + function alterDownloadAd() { + if(typeof checkAdPage != "undefined") { + var textx=checkAdPage(); + if(typeof textx != "undefined") { + document.getElementById("downloadAds").innerHTML=textx; + } + } + } + + + </script> + <table bgcolor="white"> + <tr> + <td valign="top"> + <div class="outerbar" style="width: 200px"> + + <div dojoType="FisheyeList" + itemWidth="170" itemHeight="50" + itemMaxWidth="340" itemMaxHeight="100" + orientation="vertical" + effectUnits="2" + itemPadding="10" + attachEdge="top" + labelEdge="bottom" + enableCrappySvgSupport="false"> + + <div dojoType="FisheyeListItem" onClick="browse('Dogs');" + iconsrc="${pageContext.request.contextPath}/images/dogs_icon.gif"> + </div> + + <div dojoType="FisheyeListItem" onClick="browse('Cats');" + iconsrc="${pageContext.request.contextPath}/images/cats_icon.gif"> + </div> + + <div dojoType="FisheyeListItem" onClick="browse('Birds');" + iconsrc="${pageContext.request.contextPath}/images/birds_icon.gif"> + </div> + + <div dojoType="FisheyeListItem" onClick="browse('Fish');" + iconsrc="${pageContext.request.contextPath}/images/fish_icon.gif"> + </div> + + <div dojoType="FisheyeListItem" onClick="browse('Reptiles');" + iconsrc="${pageContext.request.contextPath}/images/reptiles_icon.gif"> + </div> + </div> + + </div> + </td> + <td valign="top" style="width: 400px"> + <div id="bodyCenter"> + <table valign="top" id="bodyTable" border="0"> + <tr> + <td> + <map name="petmap"> + <area onmouseover="javascript:this.style.cursor='pointer';" onclick="browse('Birds')" + alt="Birds" + coords="72,2,280,250"> + <area onmouseover="javascript:this.style.cursor='pointer';" onclick="browse('Fish')" + alt="Fish" + coords="2,180,72,250"> + <area onmouseover="javascript:this.style.cursor='pointer';" onclick="browse('Dogs')" + alt="Dogs" + coords="60,250,130,320"> + <area onmouseover="javascript:this.style.cursor='pointer';" onclick="browse('Reptiles')" + alt="Reptiles" + coords="140,270,210,340"> + <area onmouseover="javascript:this.style.cursor='pointer';" onclick="browse('Cats')" + alt="Cats" + coords="225,240,295,310"> + <area onmouseover="javascript:this.style.cursor='pointer';" onclick="browse('Birds')" + alt="Birds" + coords="280,180,350,250"> + </map> + + <img src="${pageContext.request.contextPath}/images/splash.gif" + alt="Pet Selection Map" + usemap="#petmap" + width="350" + height="355" + border="0"> + </td> + </tr> + </table> + + </div> + </td> + <td style="vertical-align:top;"> + <div style="border-style: double; width:100%;"> + <table border="0"> + <tr> + <th colspan="2" style="text-align:center">Most Popular Tags</th> + </tr> + <tr> +<% + String style=null; + int refx=0, ii=0; + for(Tag tag : tags) { + refx=tag.getRefCount() / 5; + if(refx >= 3) { + style="xxlarge"; + } else if(refx == 2) { + style="xlarge"; + } else if(refx == 1) { + style="large"; + } else { + style="medium"; + } + + if((ii % 2) == 0) out.println("</tr>\n<tr>"); + out.println("<td class='tagCell' style='text-align: center'><a href='./tag.jsp?tag=" + + tag.getTag() + "'><span class='" + style +"'>" + tag.getTag() + "</span></a></td>"); + ii++; + } +%> + </tr> + </table> + </div> + </td> + <td style="vertical-align:top; width:250px; text-align:right;"> + <div id="downloadAds"> + <div id="downloadAds" style="text-align:center; border-style:none; width:100%;"> + <table style="width:100%"> + <tr> + <td style="text-align:center;"> + <a href="http://java.sun.com/javaee/downloads/index.jsp" target="downloads"><img style="border:none" src="./images/ad-sdk.jpg" alt="Download Java EE 5 SDK"/></a> + </td> + </tr> + <tr> + <td style="text-align:center;"> + <a href="http://www.netbeans.org/downloads/index.html" target="downloads"><img style="border:none" src="./images/ad-netbeans.jpg" alt="Download Netbeans IDE"/></a> + </td> + </tr> + <tr> + <td style="text-align:center;"> + <a href="http://java.com/en/download/index.jsp" target="downloads"><img style="border:none" src="./images/ad-jre.jpg" alt="Download Java SE"/></a> + </td> + </tr> + </table> + </div> + </div> + </td> + </tr> + </table> + + <div style="position: absolute; visibility: hidden;z-index:5" id="menu-popup"> + <table id="completeTable" class="popupTable" ></table> + </div> + + <br/><br/> + <jsp:include page="footer.jsp" /> + + </body> +</html> +<% + } catch(Exception e) { + e.printStackTrace(); + } +%> diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/jsonTest.jsp b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/jsonTest.jsp new file mode 100644 index 0000000..d2fd4c5 --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/jsonTest.jsp @@ -0,0 +1,53 @@ +<%@page contentType="text/html"%> +<%@page pageEncoding="UTF-8"%> +<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> +<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> + +<html> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> + <title>JSON Test Page</title> + <script type="text/javascript" src="${pageContext.request.contextPath}/faces/static/META-INF/dojo/bpcatalog/dojo.js"></script> + + <script type="text/javascript"> + function getJSON() { + // get data and send to controller servlet + var bindArgs = { + url: "${pageContext.request.contextPath}/catalog?command=items&pid=feline01&start=0&length=2&format=json", + mimetype: "text/json", + error: function(){ alert("error")}, + load: callbackx + }; + + dojo.io.bind(bindArgs); + } + + function callbackx(type, data, evt) { + // check successful response + if (evt.readyState == 4) { + if (evt.status == 200) { + var prodsx=data.products; + rep="Products:<br>"; + for(ii=0; ii < prodsx.length; ii++) { + rep += prodsx[ii].name + "<br/>"; + } + rep+="<br>"; + document.getElementById("testResult").innerHTML=rep; + } + } + } + + </script> + + </head> + <body> + + <h1>JSON Test Page</h1> + <span onclick="getJSON();"> GET DATA </span><br/><br/> + + <div id="testResult"> + This should be populated with result. If not, look at the error console for errors. + </div> + + </body> +</html> diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/lookup.jsp b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/lookup.jsp new file mode 100644 index 0000000..b634b42 --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/lookup.jsp @@ -0,0 +1,36 @@ +<%-- Copyright 2006 Sun Microsystems, Inc. All rights reserved. You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at: http://developer.sun.com/berkeley_license.html +$Id: lookup.jsp,v 1.7 2007/01/19 21:47:31 basler Exp $ --%> + +<%@page contentType="text/xml"%> +<%@page pageEncoding="UTF-8"%> +<%@page import="com.sun.javaee.blueprints.petstore.model.CatalogFacade, com.sun.javaee.blueprints.petstore.model.Item"%> + +<% + String itemId=request.getParameter("itemId"); + String popupView=request.getParameter("popupView"); + + try { + ServletContext context=config.getServletContext(); + CatalogFacade cf=(CatalogFacade)context.getAttribute("CatalogFacade"); + Item item=cf.getItem(itemId); + + if(itemId != null) { + out.println("<response>"); + out.println("<name>" + item.getName() + "</name>"); + String tmp=null; + if(popupView != null && popupView.equals("2")) { + tmp=item.getAddress().addressToString(); + } else { + tmp=item.getDescription(); + } + out.println("<description><![CDATA[" + tmp + "]]></description>"); + out.println("<price>" + java.text.NumberFormat.getCurrencyInstance(java.util.Locale.US).format(item.getPrice()) + "</price>"); + out.println("<image>" + request.getContextPath() + "/ImageServlet/" + item.getImageThumbURL() + "</image>"); + out.println("</response>"); + out.flush(); + } + } catch(Exception ee) { + ee.printStackTrace(); + } + +%> diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/main.htmf b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/main.htmf new file mode 100644 index 0000000..b207a5a --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/main.htmf @@ -0,0 +1,36 @@ +<!-- Copyright 2006 Sun Microsystems, Inc. All rights reserved. You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at: http://developer.sun.com/berkeley_license.html +$Id: main.htmf,v 1.3 2006/05/03 22:00:33 inder Exp $ --> + + <table valign="top" id="bodyTable" border="0"> + <tr> + <td> + <map name="petmap"> + <area onmouseover="javascript:this.style.cursor='pointer';" onclick="loadCategory('BIRDS')" + alt="Birds" + coords="72,2,280,250"> + <area onmouseover="javascript:this.style.cursor='pointer';" onclick="loadCategory('FISH')" + alt="Fish" + coords="2,180,72,250"> + <area onmouseover="javascript:this.style.cursor='pointer';" onclick="loadCategory('DOGS')" + alt="Dogs" + coords="60,250,130,320"> + <area onmouseover="javascript:this.style.cursor='pointer';" onclick="loadCategory('REPTILES')" + alt="Reptiles" + coords="140,270,210,340"> + <area onmouseover="javascript:this.style.cursor='pointer';" onclick="loadCategory('CATS')" + alt="Cats" + coords="225,240,295,310"> + <area onmouseover="javascript:this.style.cursor='pointer';" onclick="loadCategory('BIRDS')" + alt="Birds" + coords="280,180,350,250"> + </map> + + <img src="images/splash.gif" + alt="Pet Selection Map" + usemap="#petmap" + width="350" + height="355" + border="0"> + </td> + </tr> + </table> \ No newline at end of file diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/main.js b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/main.js new file mode 100644 index 0000000..b8de8fc --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/main.js @@ -0,0 +1,21 @@ +/* Copyright 2006 Sun Microsystems, Inc. All rights reserved. You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at: http://developer.sun.com/berkeley_license.html +$Id: main.js,v 1.9 2006/05/03 22:00:33 inder Exp $ */ + +var isIE; +var bodyRowText; + +dojo.require("dojo.widget.FisheyeList"); +init(); + +function browse(category) { + window.location.href="catalog.jsp?catid=" + category; +} + +function loadPetstore() { + init(); + showMain(); +} + +function init() { + if (navigator.userAgent.indexOf("IE") != -1) isIE = true; +} diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/map.jsp b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/map.jsp new file mode 100644 index 0000000..c2673c9 --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/map.jsp @@ -0,0 +1,143 @@ +<%-- Copyright 2006 Sun Microsystems, Inc. All rights reserved. You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at: http://developer.sun.com/berkeley_license.html +$Id: map.jsp,v 1.20 2006/11/02 00:34:49 basler Exp $ --%> + +<%@page contentType="text/html"%> +<%@page pageEncoding="UTF-8"%> +<%@page import="com.sun.javaee.blueprints.petstore.model.CatalogFacade, com.sun.javaee.blueprints.petstore.model.Item, com.sun.javaee.blueprints.petstore.mapviewer.MapBean, com.sun.javaee.blueprints.components.ui.mapviewer.MapMarker"%> +<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> +<%@taglib uri="http://java.sun.com/jsf/html" prefix="h" %> +<%@taglib uri="http://java.sun.com/jsf/core" prefix="f" %> +<%@taglib prefix="ui" uri="http://java.sun.com/blueprints/ui" %> + +<html> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> + <title>Map Display</title> + </head> + <body> + <jsp:include page="banner.jsp" /> + <br> + <center> + <table border="1" cellspacing="5px" cellpadding="5px" + style="border-style:double; border-color:darkgreen; padding:5px"> + <tr> + <td valign="top" align="center" width="200px"> + <table border="0"> + <c:if test="${!empty sessionScope.MapBean.locations}"> + <tr> + <th> + <u>${sessionScope.MapBean.locationCount} Items Displayed</u> + </th> + </tr> + <tr> + <td> + <ul> +<% + try { + // need to use scriptlet to preform the reconciliation of items to map coords + // this way I don't have to create a new wrapper object + MapBean mapBean=(MapBean)session.getAttribute("MapBean"); + MapMarker[] mapMarkers=(MapMarker[])mapBean.getLocations(); + java.util.List<Item> items=mapBean.getItems(); + Item itemxx=null; + String popupOptions=null; + for(int ii=0; ii < mapMarkers.length; ii++) { + + //System.out.println("loop - " + ii + " - " + mapBean.getCenterAddress()); + if(mapBean.getCenterAddress() != null && !mapBean.getCenterAddress().equals("")) { + // center point is set to the first mapMarker, items are off by one + if(ii > 0) { + // reconcile correct mapMarkers with items list + itemxx=items.get(ii - 1); + popupOptions="onmouseover="bpui.popup.show('pop1', event, '" + itemxx.getItemID() + "')" onmouseout="bpui.popup.hide('pop1')""; + } else { + // first item of mapMarker is centerpoint, so no corresponding item, also no popup on mouseover + itemxx=null; + popupOptions=""; + } + } else { + // no center point items should be 1-to-1 with mappedMarkers + itemxx=items.get(ii); + popupOptions="onmouseover="bpui.popup.show('pop1', event, '" + itemxx.getItemID() + "')" onmouseout="bpui.popup.hide('pop1')""; + } +%> + <li> + <a href="javascript:mapViewerx.openInfoWindowHtml(new GPoint(<%= mapMarkers[ii].getLongitude() %>,<%= mapMarkers[ii].getLatitude() %>), '<%= mapMarkers[ii].getMarkup() %>');" <%= popupOptions %>> + <%= mapBean.changeSpaces((itemxx == null) ? mapMarkers[ii].getMarkup() : "<b>" + itemxx.getName() + "</b>") %> + </a> +<% + if(itemxx != null) { + // remove these links for center point entry +%> + <a href="${pageContext.request.contextPath}/faces/catalog.jsp?pid=<%= itemxx.getProductID() %>&itemId=<%= itemxx.getItemID() %>" alt="Go to Detailed Catalog Page"> + <i>(detail)</i> + </a> + + <br/> + <a href="javascript:mapViewerx.openInfoWindowHtml(new GPoint(<%= mapMarkers[ii].getLongitude() %>, <%= mapMarkers[ii].getLatitude() %>), '<%= mapMarkers[ii].getMarkup() %>');" <%= popupOptions %>> + <font size="-1"><%= mapBean.changeSpaces((itemxx == null) ? mapMarkers[ii].getMarkup() : itemxx.getAddress().addressToString()) %></font> + </a> +<% + } +%> + </li> + <% + } + } catch(Exception ee) { + ee.printStackTrace(); + + } + %> + </ul> + <td> + </tr> + </c:if> + </table> + </td> + <td valign="top"> + <f:view> + <ui:popupTag id="pop1" xmlHttpRequestURL="../lookup.jsp?itemId=" + elementNamePairs="name=value1,description=value2,price=value3,image=imageId"> + <!-- Used as spaces to center the table, this could be done programmatically, + but browser diff, so I left it in the hands of the component user. The image is located + in the component jar so for retrieval, push it through the faces servlet --> + <img id="spaceImage" height="10px" width="12px" src="${pageContext.request.contextPath}/faces/static/META-INF/popup/images/spacer.gif" align="left"> + <table border="0" width="270px" bgcolor="#ffffff" cellpadding="5" cellspacing="5"> + <tr> + <td align="left" valign="top"><b>Name:</b> + <span id="value1">Loading Data...</span></td> + </tr> + <tr> + <td align="left" valign="top"><b>Description:</b> + <span id="value2">Loading Data...</span></td> + </tr> + <tr> + <td align="left" valign="top"><b>Price:</b> + <span id="value3">Loading Data...</span></td> + </tr> + <tr> + <td colspan="2" align="center"><img name="image" id="imageId" src="" + alt="[Loading Image...]" border="2"/><br/><br/></td> + </tr> + </table> + </ui:popupTag> + + + <ui:mapViewer id="mapViewerx" center="#{MapBean.mapPoint}" info="#{MapBean.mapMarker}" + markers="#{MapBean.locations}" zoomLevel="#{MapBean.zoomLevel}" style="height: 500px; width: 700px"/> + + </f:view> + </td> + </tr> + </table> + <script type="text/javascript"> + bpui.mapviewer.createMapControl = function() { + return new GLargeMapControl(); + } + + </script> + <br/><br/> + </center> + <jsp:include page="footer.jsp" /> + </body> +</html> diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/mapAll.jsp b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/mapAll.jsp new file mode 100644 index 0000000..a3ae6dc --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/mapAll.jsp @@ -0,0 +1,65 @@ +<%-- Copyright 2006 Sun Microsystems, Inc. All rights reserved. You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at: http://developer.sun.com/berkeley_license.html +$Id: mapAll.jsp,v 1.14 2006/12/06 22:44:37 basler Exp $ --%> + +<%@page contentType="text/html"%> +<%@page pageEncoding="UTF-8"%> +<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> +<%@taglib uri="http://java.sun.com/jsf/html" prefix="h" %> +<%@taglib uri="http://java.sun.com/jsf/core" prefix="f" %> +<%@taglib prefix="ui" uri="http://java.sun.com/blueprints/ui" %> + +<html> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> + <title>Map Viewer Page</title> + </head> + <body> + <jsp:include page="banner.jsp" /> + <center> + <f:view> + + <h:form id="form1"> + <table border="1" cellpadding="5" cellspacing="5" style="border-style:double; width:600px; border-color:darkgreen; padding:5px"> + <tr> + <td colspan=3> + <i>Select the category whose items will be displayed in a Google map based on the Seller's address. + Optionally, enter a "Center Point Address" and "Area" to limit the search to a specific + area around the center point.</i> + </td> + </tr> + <tr> + <th align="right">Select Category to Map:</th> + <td align="center" colspan=2> + <h:selectOneRadio value="#{MapBean.category}" required="true"> + <f:selectItems value="#{MapBean.categories}"/> + </h:selectOneRadio> + </td> + </tr> + <tr> + <th align="right">Center Point Address:</th> + <td> + <h:inputText id="centerAddress" value="#{MapBean.centerAddress}" size="70"/> + <br/><small><i>For example: 4140 Network Circle, Santa Clara, CA, 95054</i></small> + </td> + </tr> + <tr> + <th align="right">Area (in Miles):</th> + <td> + <h:inputText id="radius" value="#{MapBean.radius}" size="5"/> + </td> + </tr> + <tr> + <td colspan="2" align="center"> + <h:commandButton action="#{MapBean.findAllByCategory}" id="submitCat" type="submit" value="Map Category"/> + </td> + </tr> + + </table> + <h:messages/> + </h:form> + </f:view> + + </center> + <jsp:include page="footer.jsp" /> + </body> +</html> diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/news.js b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/news.js new file mode 100644 index 0000000..5bcac34 --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/news.js @@ -0,0 +1,190 @@ + +dojo.require("dojo.io.*"); +dojo.require("dojo.event.*"); + +var bpuinews; +if (typeof bpuinews == "undefined") { + bpuinews = new Object(); +} + +bpuinews.RSS = function() { + var currentItem = 0; + var limitCharNum = 75; + var itemNum=0; + var rssData = null; + var prev; + var next; + var prevHit=false; + + this.getRssInJson = function (method, uri) { + prev = document.getElementById("previous"); + next = document.getElementById("next"); + dojo.event.connect(prev, "onclick", function(evt) {showPrevious();}); + dojo.event.connect(next, "onclick", function (evt) {showNext();}); + prev.disabled=true; + + var encodedURI = encodeURI(method + "?style=json&itemCount=0&url="+uri); + var bindArgs = { + url: encodedURI, + mimetype: "text/json", + load: function (type, data, http) { + handleJsonRss(data); + }, + error: function (t, e) { + dojo.debug("ERROR : " + e.message); + } + } + dojo.io.bind(bindArgs); + return false; + } + + function handleJsonRss(json) { + rssData = json; + itemNum = json.channel.item.length; + showNext(); + } + + function createUl(skip) { + var i; + var cp="<ul>\n"; + for (i = currentItem; i<currentItem + skip; i++) { + cp += "<li><b>"+decodeURL(rssData.channel.item[i].title)+"</b>\n"; + cp += "<p>" + decodeURL(rssData.channel.item[i].description) + "</p>\n</li>\n"; + } + cp += "</ul>\n"; + return cp; + } + + // Following funcs(showNext, showPrevious) should be connected to the button + // by dojo.event.connect. + function showNext() { + var skip = 5; + if (prevHit) { + currentItem = currentItem + skip; + prevHit = false; + } + var nextCurrentItem = currentItem + skip; + if (nextCurrentItem >= itemNum) { + skip = itemNum - currentItem; + // deactivate "next" button + next.disabled=true; + nextCurrentItem = currentItem; + } + // activate "previous" button + if (currentItem != 0) { + prev.disabled=false; + } + var cp = createUl(skip); + var elm = document.getElementById("news"); + elm.innerHTML = cp; + currentItem = nextCurrentItem; + } + + function showPrevious() { + prevHit = true; + var skip = 5; + currentItem = currentItem - skip; + if (currentItem <= 0) { + currentItem = 0; + // deactivate "previous" button + prev.disabled=true; + } + next.disabled=false; + var cp = createUl(skip); + var elm = document.getElementById("news"); + elm.innerHTML = cp; + } + + + /* Compatible function to java.net.URLDecoder.decode(). + * (decodeURI() is not compatible) + */ + function decodeURL(str){ + var targetStr=""; + var s, tmpStr, unicode, f; + // take a look at every char in the source str + var i, j; + for (i = 0; i < str.length; i++) { + s = str.charAt(i); + // handle WS, which is the most common char + if (s == "+") { + targetStr += " "; + } else { + if (s != "%") { + // Non-encoded char + targetStr += s; + } else{ + // encoding begin + unicode = 0; // uncode representation + f = 1; // flag to specify the escape sequence + while (true) { + tmpStr = ""; + // get the two HEX chars and put that in the temp string. If no char, that is not a HEX. + for (j = 0; j < 2; j++ ) { + tmptmpStr = str.charAt(++i); + if (((tmptmpStr >= "0") && (tmptmpStr <= "9")) || + ((tmptmpStr >= "a") && (tmptmpStr <= "f")) || + ((tmptmpStr >= "A") && (tmptmpStr <= "F"))) { + tmpStr += tmptmpStr; + } else { + --i; + break; + } + } + /* parse the HEX + * <= 0x7f : Single byte + * >=0xc0 && <=0xdf : Two bytes + * >=0xe0 && <=0xef : Three bytes + * >=0xf0 && <=0xf7 : Four bytes + * >=0x80 && <=0xbf : may not occur - just shift it + * <=1 : sequence terminated + */ + var byte = parseInt(tmpStr, 16); + if (byte <= 0x7f) {unicode = byte; f = 1;} + if ((byte >= 0xc0) && (byte <= 0xdf)) {unicode = byte & 0x1f; f = 2;} + if ((byte >= 0xe0) && (byte <= 0xef)) {unicode = byte & 0x0f; f = 3;} + if ((byte >= 0xf0) && (byte <= 0xf7)) {unicode = byte & 0x07; f = 4;} + if ((byte >= 0x80) && (byte <= 0xbf)) {unicode = (unicode << 6) + (byte & 0x3f); --f;} + if (f <= 1) { + break; + } + if (str.charAt(i + 1) == "%") { + i++ ; + } else { + // Error. should not occur + break; + } + } + targetStr += String.fromCharCode(unicode); + } + } + } + return targetStr; + } + + /* Cut the string at the WS so that it's shorter than the limitCharNum. + */ + function cutStringatWs(str, limitCharNum) { + var tmpStr = str; + var cnum = 0; + while (true) { + cnum = tmpStr.lastIndexOf(" "); + // no occurance of WS + if (cnum < 0) { + // if str is still longer than limit + if (tmpStr.length >= limitCharNum) { + tmpStr = tmpStr.substring(0, limitCharNum); + } + break; + } else { + tmpStr = tmpStr.substring(0, cnum); + if (cnum <= limitCharNum) { + break; + } + } + } + return tmpStr; + } + +} + diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/news.jsp b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/news.jsp new file mode 100644 index 0000000..b57de0b --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/news.jsp @@ -0,0 +1,51 @@ +<%-- Copyright 2006 Sun Microsystems, Inc. +All rights reserved. You may not modify, use, reproduce, or distribute +this software except in compliance with the terms of the License at: +http://developer.sun.com/berkeley_license.html +$Id: news.jsp,v 1.2 2006/12/14 01:04:50 yutayoshida Exp $ --%> + +<%@page contentType="text/html"%> +<%@page pageEncoding="UTF-8"%> +<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> +<%@taglib uri="http://java.sun.com/jsf/html" prefix="h" %> +<%@taglib prefix="ui" uri="http://java.sun.com/blueprints/ui" %> + +<html> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> + <title>BluePrints News Page</title> + <script type="text/javascript" src="${pageContext.request.contextPath}/faces/static/META-INF/dojo/bpcatalog/dojo.js"></script> + <script type="text/javascript" src="${pageContext.request.contextPath}/news.js"></script> + + <style> + p { + width : 70%; + background-color : #FFEFD5; + font-size : 80% + } + </style> + + </head> + <script type="text/javascript"> + var news = new bpuinews.RSS(); + dojo.addOnLoad(function(){news.getRssInJson('${pageContext.request.contextPath}/faces/dynamic/bpui_rssfeedhandler/getRssfeed', 'https://blueprints.dev.java.net/servlets/ProjectRSS?type=news%27);%7D); + </script> + <body> + <jsp:include page="banner.jsp" /> + <h2><a href="http://blueprints.dev.java.net">BluePrints News</a></h2> + <center> + <table border="0" width="95%"> + <tr> + <td> + <button id="previous" type="button"><< Previous</button> + </td> + <td> + <button id="next" type="button">Next >></button> + </td> + </tr> + </table> + </center> + <div id="news"></div> + <jsp:include page="footer.jsp" /> + </body> +</html> diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/petstoreListTest.jsp b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/petstoreListTest.jsp new file mode 100644 index 0000000..923739b --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/petstoreListTest.jsp @@ -0,0 +1,21 @@ +<%@page contentType="text/html"%> +<%@page pageEncoding="UTF-8"%> +<html> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> + <title>jsonp test page</title> + <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/bp_petstorelist.css"></link> + <script type="text/javascript" src="${pageContext.request.contextPath}/bp_petstorelist.js"></script> + <script type="text/javascript"> + var petstoreList; + function init() { + petstoreList=new bpui.petstoreList.createPetstoreList("petstoreListDiv"); + } + </script> + </head> + <body onload="init()"> + <h1>jsonp test page</h1> + + <div id="petstoreListDiv"></div> + </body> +</html> diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/rss.js b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/rss.js new file mode 100644 index 0000000..66700d3 --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/rss.js @@ -0,0 +1,110 @@ +/* Copyright 2006 Sun Microsystems, Inc. All rights reserved. You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at: http://developer.sun.com/berkeley_license.html +$Id: rss.js,v 1.3 2006/05/31 19:13:03 basler Exp $ */ + +dojo.require("dojo.io.*"); + +if (bpui = 'undefined') { + bpui = new Object(); +} + +bpui.RSS = function() { + var jsonData = null; + var rssItemNum = 0; + var currentItem = 0; + var rssTimeout = null; + var itemIntervalMsec = 2000; + var rssFadeoutCounter = 110; + var rssFadeinCounter = 110; + var itemIntervalId = 0; + + this.getRssInJson = function (uri, number) { + rssItemNum = number; + var encodedURI = encodeURI(bpui.contextRoot + "/faces/dynamic/bpui_rssfeedhandler/getRssfeed?style=json&itemNumber="+number+"&url="+uri); + //alert("encoded url=" + encodedURI); + var bindArgs = { + url: encodedURI, + mimetype: "text/json", + load: function (type, data, http) { + handleJsonRss(data); + for (var key in data.channel.item) { + dojo.debug("ITEM Title ", key, ":", data.channel.item[key].title); + dojo.debug("ITEM LInk ", key, ":", data.channel.item[key].link); + } + }, + error: function (t, e) { + dj_debug("ERROR : " + e.message); + } + } + dojo.io.bind(bindArgs); + return false; + } + + function handleJsonRss(json) { + jsonData = json; + // setting top title and link + generateHref(json.channel.title, json.channel.link, "rss-channel"); + // setting items + generateHref(json.channel.item[0].title, json.channel.item[0].link, "rss-item"); + var aNodes = document.getElementById("rss-item").getElementsByTagName("a"); + dojo.event.connect(aNodes[0], "onmouseover", "pauseCycle"); + dojo.event.connect(aNodes[0], "onmouseout", "resumeCycle"); + cycleRss(); + } + + function generateHref (title, link, nodeId) { + var node = document.getElementById(nodeId); + var aNode = document.createElement("a"); + aNode.setAttribute("href", link); + aNode.appendChild(document.createTextNode(title)); + if (node.hasChildNodes()) { + node.removeChild(node.firstChild); + } + node.appendChild(aNode); + } + + function cycleRss () { + itemIntervalId = setTimeout(replaceItem, itemIntervalMsec); + } + + + function replaceItem() { + if (itemIntervalId) { + clearTimeout(itemIntervalId); + } + // fadeout the current item and pop the next one in. + var cItem = document.getElementById("rss-item"); + dojo.fx.html.fadeOut(cItem.getElementsByTagName('a')[0], 500); + var waitId = setTimeout(function(waitId) { + clearTimeout(waitId); + //cItem.removeChild(cItem.firstChild); + if (currentItem < (rssItemNum -1)) { + currentItem += 1; + } else { + currentItem = 0; + } + generateHref(jsonData.channel.item[currentItem].title, jsonData.channel.item[currentItem].link, "rss-item"); + // attach event for onmouseover(pause) and onmouseout(resume) + var aNodes = cItem.getElementsByTagName("a"); + dojo.event.connect(aNodes[0], "onmouseover", "pauseCycle"); + dojo.event.connect(aNodes[0], "onmouseout", "resumeCycle"); + cycleRss();}, 500); + } + + function pauseCycle(evt) { + if (itemIntervalId) { + clearTimeout(itemIntervalId); + } + } + + function resumeCycle (evt) { + cycleRss(); + } + + bpui.getContextRoot = function() { + var urlArray=window.location.toString().split("/", 4); + return "/" + urlArray[3]; + } + + bpui.contextRoot = bpui.getContextRoot(); +} + diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/rss.jsp b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/rss.jsp new file mode 100644 index 0000000..e57e4dc --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/rss.jsp @@ -0,0 +1,33 @@ +<%-- Copyright 2006 Sun Microsystems, Inc. All rights reserved. You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at: http://developer.sun.com/berkeley_license.html +$Id: rss.jsp,v 1.2 2006/05/03 22:00:34 inder Exp $ --%> + +<%@page contentType="text/html"%> +<%@page pageEncoding="UTF-8"%> + +<%@taglib prefix="f" uri="http://java.sun.com/jsf/core%22%%3E +<%@taglib prefix="h" uri="http://java.sun.com/jsf/html%22%%3E +<%@taglib prefix="ui" uri="http://java.sun.com/blueprints/ui" %> + +<html> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> + <title>RSS</title> + </head> + <body> + + <h1>RSS test</h1> + <f:view> + ui:rssreader + <ui:rsscategory title="JavaEE 5"> + <ui:rssfeed title="BluePrints" url="https://blueprints.dev.java.net/servlets/ProjectRSS?type=news%22%3E</ui:rssfeed> + <ui:rssfeed title="GlassFish" url="http://blogs.sun.com/roller/rss/theaquarium%22%3E</ui:rssfeed> + </ui:rsscategory> + <ui:rsscategory title="Yahoo!"> + <ui:rssfeed title="World" url="http://rss.news.yahoo.com/rss/world%22%3E</ui:rssfeed> + <ui:rssfeed title="US" url="http://rss.news.yahoo.com/rss/us%22%3E</ui:rssfeed> + </ui:rsscategory> + </ui:rssreader> + + </f:view> + </body> +</html> diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/rssbar.jsp b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/rssbar.jsp new file mode 100644 index 0000000..6f9c2f9 --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/rssbar.jsp @@ -0,0 +1,20 @@ +<%-- Copyright 2006 Sun Microsystems, Inc. All rights reserved. You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at: http://developer.sun.com/berkeley_license.html +$Id: rssbar.jsp,v 1.7 2006/05/06 01:44:59 yutayoshida Exp $ --%> + +<%@page contentType="text/html"%> +<%@page pageEncoding="UTF-8"%> + +<%@taglib prefix="f" uri="http://java.sun.com/jsf/core%22%%3E +<%@taglib prefix="h" uri="http://java.sun.com/jsf/html%22%%3E +<%@taglib prefix="ui" uri="http://java.sun.com/blueprints/ui" %> + + + + <f:view> + <ui:rssBar url="https://blueprints.dev.java.net/servlets/ProjectRSS?type=news" + itemCount="4" + title="News from BluePrints" + speed="6000" + backgroundImage="no" + color="#00ffff" hoverColor="#ff00ff"></ui:rssBar> + </f:view> diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/rteToolBar.html b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/rteToolBar.html new file mode 100644 index 0000000..9cc8c0a --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/rteToolBar.html @@ -0,0 +1,60 @@ +<div class="EditorToolbarDomNode EditorToolbarSmallBg"> + <table cellpadding="1" cellspacing="0" border="0"> + <tbody> + <tr valign="top" align="left"> + <td> + <!-- bold --> + <span class="iconContainer dojoEditorToolbarItem" dojoETItemName="bold"> + <span title="Toggle Bold (Ctrl-B)" class="dojoE2TBIcon dojoE2TBIcon_Bold"> </span> + </span> + </td> + <td> + <!-- italic --> + <span class="iconContainer dojoEditorToolbarItem" dojoETItemName="italic"> + <span title="Toggle Italic (Ctrl-I)" class="dojoE2TBIcon dojoE2TBIcon_Italic"> </span> + </span> + </td> + <td> + <!-- underline --> + <span class="iconContainer dojoEditorToolbarItem" dojoETItemName="underline"> + <span title="Toggle Underline (Ctrl-U)" class="dojoE2TBIcon dojoE2TBIcon_Underline"> </span> + </span> + </td> + <td> + <!-- strikethrough --> + <span class="iconContainer dojoEditorToolbarItem" dojoETItemName="strikethrough"> + <span title="Toggle Strike-Through" +class="dojoE2TBIcon dojoE2TBIcon_StrikeThrough"> </span> + </span> + </td> + <td> + <!-- inserthorizontalrule --> + <span class="iconContainer dojoEditorToolbarItem" dojoETItemName="inserthorizontalrule"> + <span title="Insert Horizontal Rule" class="dojoE2TBIcon dojoE2TBIcon_HorizontalLine "> </span> + </span> + </td> + <td isSpacer="true"> + <!-- spacer --> + <span class="iconContainer"> + <span class="dojoE2TBIcon dojoE2TBIcon_Sep" style="width: 5px; min-width: 5px;"></span> + </span> + </td> + <td> + <!-- forecolor --> + <span class="iconContainer dojoEditorToolbarItem" dojoETItemName="forecolor"> + <span title="Change Text Color" class="dojoE2TBIcon dojoE2TBIcon_TextColor" +unselectable="on"> </span> + </span> + </td> + <td> + <!-- hilitecolor --> + <span class="iconContainer dojoEditorToolbarItem" dojoETItemName="hilitecolor"> + <span title="Change Background Color" class="dojoE2TBIcon dojoE2TBIcon_BackgroundColor" +unselectable="on"> </span> + </span> + </td> + <td width="*"> </td> + </tr> + </tbody> + </table> +</div> diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/scroller.css b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/scroller.css new file mode 100644 index 0000000..151df6d --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/scroller.css @@ -0,0 +1 @@ +.slider { border-width:1px; border-style:solid; border-color:black; background:#404040; }
.tile { position: absolute; top:0px; left:0px; cursor:pointer; border-width:1px; border-style:solid; border-color:black; visibility:hidden; z-index:1; background:white; opacity: .99; }
.tileImage { width: 94; height: 70; }
.nav { cursor:pointer; position: absolute; vertical-align:bottom; z-index:11; opacity: .85; }
.infopane { z-index:0; width:475px; position: absolute; border-width:1px; border-style:solid; border-color:black; background:black; opacity: .65; }
.infopaneDescription { color:white; font-size:12px; }
.infopaneShortDescription { color:white; font-size:16px; }
.infopanePrice { color:white; text-align: center; height:20px; }
.infopanePayPal{ vertical-valign: bottom; text-align: right; height:20px; }
.infopaneRating{ vertical-valign: top; text-align: center; width:125px; height:15px; color:white; opacity: .95; }
.infopaneTitle { width:255px; height:15px; color:white; font-size:18px; } \ No newline at end of file diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/scroller.js b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/scroller.js new file mode 100644 index 0000000..1f72578 --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/scroller.js @@ -0,0 +1,643 @@ +/* Copyright 2006 Sun Microsystems, Inc. All rights reserved. You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at: http://developer.sun.com/berkeley_license.html +$Id: scroller.js,v 1.32 2007/01/17 18:00:09 basler Exp $ */ + +/** +* ImageScroller - A multipurpose item brower +* @ Author: Greg Murray +* +*/ + +function getApplicationContextRoot() { + var urlArray=window.location.toString().split("/", 4); + return "/" + urlArray[3]; +} + +var applicationContextRoot=getApplicationContextRoot(); + + +function ImageScroller() { + var _this = this; + var initialized = false; + // default sizes + + var VIEWPORT_WIDTH = 500; + // all sizes are realitive the the viewport width + var IMAGEPANE_WIDTH = VIEWPORT_WIDTH; + var IMAGEPANE_HEIGHT = Math.round(VIEWPORT_WIDTH / 1.49); + var INFOPANE_DEFAULT_HEIGHT = Math.round(VIEWPORT_WIDTH / 6.67); + var INFOPANE_EXPAND_HEIGHT = Math.round(VIEWPORT_WIDTH / 2.86); + var THUMB_WIDTH = Math.round(VIEWPORT_WIDTH / 5);; + var THUMB_HEIGHT = Math.round(VIEWPORT_WIDTH / 6.67); + + var CHUNK_SIZE = 7; + var PREFETCH_THRESHHOLD = 5; + + var IMAGE_PANE_ID = "imagePane"; + var IMAGE_PANE_BUFFER_ID = "imageBufferPane"; + + var PADDING = 3; + + var MINIMIZE_IMG_URI = applicationContextRoot + "/images/minimize.gif"; + var MAXIMIZE_IMG_URI = applicationContextRoot + "/images/maximize.gif"; + var INDICATOR_IMG_URI = applicationContextRoot + "/images/indicator-black.gif"; + var MAXIMIZE_IMG_TOOLTIP = "Show Details"; + var MINIMIZE_IMG_TOOLTIP = "Show Less Details"; + + // this is an array of the tiles which are divs for each thumb + var tiles = []; + + var injectionPoint; + + // for scrolling + + var SCROLL_INCREMENT = 5; + var INFOPANE_INCREMENT = 3; + var tileY; + var tileX; + // this is the index of the image tile on the far left + var index = 0; + // keeps track how for the scroll has gone + var offset = 0; + + var timeout = 30; // in ms + var isScrollingRight = false; + var isScrollingLeft = false; + + // large image pane + var imagePane; + var imageLoadingPane; + var loadingPane; + // images + var minimizeImage; + + var indicatorImage; + var leftButton; + var rightButton; + + // infopane + var infoPane; + var infoTableMinimize; + var indicatorCell; + var minimizeLink; + var infoPaneLoop = 0; + var maximizing = false; + var minimizing = false; + var maximized = false; + + // prefetch thresh-hold + var prefetchThreshold = 2; + + // a growing list of items; + var items = []; + // cached chunks that are already in the items array + var loadedChunks = []; + + // used for debugging when debug is true + var debug = false; + var statusDiv; + var status2Div; + + var showingBuffer = false; + var imageBuffer; + var imageReloadTries = 0; + var IMG_RELOAD_RETRY_MAX = 30; + // used for url book marking + + + var pid; + var currentChunk; + // this map contains all the items + var map; + // this is the main container div + var containerDiv; + + this.getItems = function() { + return map; + } + + this.getScrollerItems = function() { + return items; + } + + + this.getGroupId = function() { + return pid; + } + + this.reset = function() { + resetTitles() + tiles = []; + index = 0; + offset = 0; + currentChunk = 0; + items = []; + loadedChunks = []; + } + + function resetTitles() { + for (var l = 0; l < tiles.length; l++) { + tiles[l].parentNode.removeChild(tiles[l]); + } + } + + // event bound to the mouseOut event of both scroll buttons + function scrollDone() { + isScrollingLeft = false; + isScrollingRight = false; + } + + // looping method for time out + function scroll() { + if (isScrollingRight) scrollRight(); + else if (isScrollingLeft) scrollLeft(); + } + + + // do the value list pre-emptive fetching + function prefetch() { + //printDebug("** scoller index = " + index); + if (isScrollingRight && (index + PREFETCH_THRESHHOLD) % CHUNK_SIZE == 0) { + + if ((Math.round(index / CHUNK_SIZE)) >= currentChunk) { + currentChunk = Math.round(index / CHUNK_SIZE) + 1; + // fire an event + dojo.event.topic.publish("/catalog", {type:"getChunk", id: pid, index: index, currentChunk: currentChunk}); + } + } + } + + this.setGroupId = function(id) { + pid = id; + } + + this.containsChunk = function(chunkId) { + printDebug("containsChunk = " + loadedChunks); + ret=false; + for(ii=0; ii < loadedChunks.length; ii++) { + if(chunkId == loadedChunks[ii]) { + ret=true; + break; + } + } + return ret; + } + + this.addChunk = function(chunkId) { + loadedChunks.push(chunkId); + } + + this.addItems = function(inItems) { + for (var loop=0; loop < inItems.length ; loop++) { + items.push(inItems[loop]); + map.put(inItems[loop].id, inItems[loop]); + createTile(inItems[loop]); + if (loop == 0 && !loadImage) { + showImage(inItems[loop].id); + } + + } + drawTiles(); + rightButton.style.visibility="visible"; + _this.hideProgressIndicator(); + } + + this.showProgressIndicator = function() { + if (indicatorImage) { + indicatorImage.style.visibility = "visible"; + } + } + + this.hideProgressIndicator = function() { + indicatorImage.style.visibility = "hidden"; + } + + function postImageLoad(loadIntoBuffer) { + if (debug) { + status2Div.innerHTML = "Try " + imageReloadTries + " " + url + " image.complete=" + imageBuffer.complete; + } + // keep calling this funtion until imageReloadTries < IMG_RELOAD_RETRY_MAX + if (!imageBuffer.complete) { + if (imageReloadTries < IMG_RELOAD_RETRY_MAX) { + setTimeout(function(){this.loadIntoBuffer = loadIntoBuffer;postImageLoad(loadIntoBuffer);},500); + } else { + this.hideProgressIndicator(); + } + imageReloadTries = imageReloadTries + 1; + return; + } + var id; + + _this.hideProgressIndicator(); + if (loadIntoBuffer) { + imageLoadingPane.src = imageBuffer.src; + } else { + imagePane.src = imageBuffer.src; + + } + // do a cross fade as long as the images aren't the same + if (imageLoadingPane.src != imagePane.src) { + crossFade(0,loadIntoBuffer ); + } + } + + + this.showImage = function(itemId) { + + _this.showProgressIndicator(); + //setTimeout(this.showProgressIndicator,0); + var i = map.get(itemId); + + if (!i) { + return; + } + dojo.event.topic.publish("/catalog", {type:"showingItem", id: itemId, rating: i.rating}); + // create the image pane and append the description nodes + // asumption is that if the imagePane is not set neigher are the info children + if (typeof imagePane == 'undefined') { + imagePane = document.createElement("img"); + imagePane.style.width = IMAGEPANE_WIDTH + "px"; + imagePane.style.height = IMAGEPANE_HEIGHT + "px"; + imagePane.id = IMAGE_PANE_ID; + + var targetElement = document.getElementById("bodySpace"); + imageLoadingPane = document.createElement("img"); + imageLoadingPane.style.position = "absolute"; + imageLoadingPane.style.visibility = "hidden"; + imageLoadingPane.style.width = IMAGEPANE_WIDTH + "px"; + imageLoadingPane.style.height = IMAGEPANE_HEIGHT + "px"; + imageLoadingPane.id = IMAGE_PANE_BUFFER_ID; + targetElement.appendChild(imagePane); + targetElement.appendChild(imageLoadingPane); + imageLoadingPane.style.left = tileX + "px"; + + loadImage(i.image, false); + } else { + imageLoadingPane.style.visibility = "visible"; + if (showingBuffer) { + showingBuffer = false; + } else { + showingBuffer = true; + } + loadImage(i.image, showingBuffer); + } + } + + function loadImage(url, loadIntoBuffer) { + imageReloadTries = 0; + imageBuffer = new Image(); + if (loadIntoBuffer) { + imageBuffer.src = url; + imageLoadingPane.onLoad = setTimeout(function(){this.url=url;this.loadIntoBuffer = loadIntoBuffer;postImageLoad(loadIntoBuffer,url);},0); + } else { + imageBuffer.src = url; + imageBuffer.onLoad = setTimeout(function(){this.url = url;this.loadIntoBuffer = loadIntoBuffer;postImageLoad(loadIntoBuffer,url);},0); + } + } + + function setOpacity(opacity, id) { + var target = document.getElementById(id); + if (typeof target.style.filter != 'undefined') { + target.style.filter = "alpha(opacity:" + opacity + ")"; + } else { + target.style.opacity = opacity/100; + } + } + + function crossFade(count,loadIntoBuffer) { + var percentage = Number(count); + if (loadIntoBuffer) { + setOpacity(100 - percentage, IMAGE_PANE_ID); + setOpacity(percentage, IMAGE_PANE_BUFFER_ID); + } else { + setOpacity(100 - percentage, IMAGE_PANE_BUFFER_ID); + setOpacity(percentage, IMAGE_PANE_ID); + + } + if (percentage < 100) { + percentage = percentage + 10; + setTimeout(function(){this.loadIntoBuffer = loadIntoBuffer;this.percentage = percentage;crossFade(percentage,loadIntoBuffer);}, 25); + } + } + + + // calling this function will result in the maximizing event being fired + // if the pane is maximized it will asume the event want to minimize + this.doMaximize = function() { + if (!maximizing && !minimizing && !maximized) { + infoPaneLoop = INFOPANE_DEFAULT_HEIGHT; + maximizing = true; + minimizing = false; + } else if (!maximizing && !minimizing) { + minimizing = true; + maximizing = false; + } + setTimeout(changeInfoPane, 0); + } + + // will handle either minimizing or maximing but not both + // this method is called recursively until the maximinging + // or minimizing is done. + function changeInfoPane() { + if (maximizing) { + maxmizeInfoPane(); + } else if (minimizing) { + minimizeInfoPane(); + } + } + + function maxmizeInfoPane() { + if (infoPaneLoop < INFOPANE_EXPAND_HEIGHT) { + infoPaneLoop = infoPaneLoop + INFOPANE_INCREMENT; + var clipMe = 'rect(' + '0px,' + VIEWPORT_WIDTH + 'px,'+ infoPaneLoop +'px,' + 0 + 'px)'; + infoPane.style.clip = clipMe; + infoPane.style.height = infoPaneLoop; + infoPane.style.top = (tileY + (PADDING *2) + INFOPANE_DEFAULT_HEIGHT + IMAGEPANE_HEIGHT) - infoPaneLoop; + setTimeout(changeInfoPane, 5); + } else { + minimizeImage.src= MINIMIZE_IMG_URI; + minimizeLink.title = MINIMIZE_IMG_TOOLTIP; + maximized = true; + maximizing = false; + minimizing = false; + } + } + + function minimizeInfoPane() { + if (infoPaneLoop > INFOPANE_DEFAULT_HEIGHT) { + infoPaneLoop = infoPaneLoop - INFOPANE_INCREMENT; + var clipMe = 'rect(' + '0px,' + VIEWPORT_WIDTH + 'px,'+ infoPaneLoop +'px,' + 0 + 'px)'; + infoPane.style.clip = clipMe; + infoPane.style.height = infoPaneLoop; + infoPane.style.top = (tileY + (PADDING *2) + INFOPANE_DEFAULT_HEIGHT + IMAGEPANE_HEIGHT) - infoPaneLoop; + if (debug) { + status2Div.innerHTML = "minimize infoPaneLoop =" + infoPaneLoop + " infopane.top=" + infoPane.style.top; + } + setTimeout(changeInfoPane, 5); + } else { + minimizeImage.src= MAXIMIZE_IMG_URI; + minimizeLink.title = MAXIMIZE_IMG_TOOLTIP; + maximizing = false; + minimizing = false; + maximized = false; + } + } + + function scrollRight() { + isScrollingRight = true; + if ( (index + 4) >= tiles.length) { + // hide the rightButton + rightButton.style.visibility="hidden"; + return; + } else { + leftButton.style.visibility="visible"; + } + offset = offset - SCROLL_INCREMENT; + drawTiles(); + setTimeout(scroll, timeout); + } + + function getNext() { + isScrollingRight = true; + setTimeout(scroll, timeout); + } + + + function getPrevious () { + isScrollingLeft = true; + setTimeout(scroll, timeout); + } + + function scrollLeft() { + if (offset >= 0) { + leftButton.style.visibility="hidden"; + return; + } else { + leftButton.style.visibility="visible"; + } + offset = offset + SCROLL_INCREMENT; + drawTiles(); + setTimeout(scroll, timeout); + } + + function drawTiles() { + // draw the first one if its off the screen + // check if the far right image is out view + var overHang; + var temp = offset; + index = Math.floor((offset)/THUMB_WIDTH); + overHang = offset % THUMB_WIDTH; + if (overHang < 0) { + overHang = overHang * -1; + } + if (index < 0) { + index = index * -1; + } + // check for next set of images + prefetch(); + var startIndex = index; + if (overHang > 0 && index >0) { + startIndex = index -1; + } + var stopIndex = index + Math.round(VIEWPORT_WIDTH / THUMB_WIDTH); + if (stopIndex > tiles.length) { + stopIndex = tiles.length; + } + var displayX = 0; + for (var tl=startIndex; tl < stopIndex; tl++) { + if (debug) { + statusDiv.innerHTML = "overhang=" + overHang + " startIndex=" + startIndex + " stopIndex=" + stopIndex + " offset=" + offset + " displayX=" + displayX; + } + if (overHang > 0 && tl == startIndex) { + rightButton.style.visibility="visible"; + // clip: rect(top right bottom left) - borders of the clipped area + // clip the left + var clipMe = 'rect(' + '0px,' + THUMB_WIDTH + 'px,'+ THUMB_HEIGHT +'px,' + overHang + 'px)'; + tiles[tl].style.clip = clipMe; + tiles[tl].style.left = (tileX - overHang) + "px"; + displayX = displayX + (THUMB_WIDTH - overHang); + } else if (tl == stopIndex -1) { + var underHang = VIEWPORT_WIDTH - displayX ; + if (underHang > 0 && underHang) { + var clipMe = 'rect(' + '0px,' + (underHang) + "px," + THUMB_HEIGHT +'px,' + 0 + 'px)'; + tiles[tl].style.clip = clipMe; + tiles[tl].style.left = tileX + (offset + (tl * THUMB_WIDTH)) + 'px'; + tiles[tl].style.visibility = "visible"; + // resize the previous one to its real length + } else if (underHang < 0 && tl > 0) { + var clipMe = 'rect(' + '0px,' + (THUMB_WIDTH + underHang) + "px," + THUMB_HEIGHT +'px,' + 0 + 'px)'; + tiles[tl-1].style.clip = clipMe; + tiles[tl-1].style.visibility = "visible"; + tiles[tl-1].style.left = tileX + (offset + ((tl -1) * THUMB_WIDTH)) + 'px'; + } else { + tiles[tl].style.left = '0px'; + tiles[tl].style.visibility = "hidden"; + } + } else { + displayX = displayX + THUMB_WIDTH; + tiles[tl].style.left = tileX + (offset + (tl * THUMB_WIDTH)) + 'px'; + tiles[tl].style.visibility = "visible"; + } + } + if (stopIndex < tiles.length) { + tiles[stopIndex].style.visibility = "hidden"; + tiles[stopIndex].style.left = "0px"; + } + } + + + this.load = function () { + map = new Map(); + dojo.event.connect(window, "onresize", layout); + var loadImage; + + var targetRow = document.getElementById("targetRow"); + injectionPoint = document.getElementById("injection_point"); + + // for status output + statusDiv = document.getElementById("status"); + status2Div = document.getElementById("status_2"); + + initLayout(); + initialized = true; + } + + function initLayout() { + containerDiv = document.getElementById("CatalogBrowser"); + rightButton = document.getElementById("right_button"); + leftButton = document.getElementById("left_button"); + layout(); + leftButton.style.visibility="hidden"; + if (typeof rightButton.attachEvent != 'undefined') { + rightButton.attachEvent('onmouseover',function(e){scrollDone();getNext();}); + rightButton.attachEvent('onmouseout',function(e){scrollDone();}); + leftButton.attachEvent('onmouseover',function(e){scrollDone();getPrevious();}); + leftButton.attachEvent('onmouseout',function(e){scrollDone();}); + } else if (typeof rightButton.addEventListener != 'undefined') { + rightButton.addEventListener('mouseover',function(e){scrollDone();getNext();}, false); + rightButton.addEventListener('mouseout',function(e){scrollDone();}, false); + leftButton.addEventListener('mouseover',function(e){scrollDone();getPrevious();}, false); + leftButton.addEventListener('mouseout',function(e){scrollDone();}, false); + } + createInfoPane(); + } + + function layout() { + var ua = navigator.userAgent.toLowerCase(); + + // this will need to be made generic depending on the thumb height + tileY = findY(containerDiv); + tileX = findX(containerDiv) + 4; + var rightX = tileX + VIEWPORT_WIDTH - 20; + rightButton.style.left = rightX + "px"; + var buttonY = tileY + IMAGEPANE_HEIGHT + INFOPANE_DEFAULT_HEIGHT + 12; + rightButton.style.top = buttonY + "px"; + leftButton.style.top = buttonY + "px"; + + if (ua.indexOf('ie') != -1) { + isIE = true; + } else if (ua.indexOf('safari') != -1) { + tileX = tileX + 8; + timeout = 20; + } + drawTiles(); + if (infoPane) { + infoPane.style.left = tileX + "px"; + if (maximized) { + + infoPane.style.top = (tileY + IMAGEPANE_HEIGHT + (PADDING*2) - infoPane.style.height) + "px"; + } else { + infoPane.style.top = (tileY + IMAGEPANE_HEIGHT + (PADDING*2)) + "px"; + } + if (maximized) { + infoPaneLoop = infoPane.style.height; + } else { + infoPaneLoop = INFOPANE_DEFAULT_HEIGHT; + } + } + if (typeof imageLoadingPane != 'undefined') { + imageLoadingPane.style.left = tileX; + imageLoadingPane.style.top = tileY; + } + } + + function createInfoPane() { + infoPane = document.getElementById("infopane"); + infoPane.style.width = VIEWPORT_WIDTH + "px"; + // give room for 4 pixels above and below + infoPane.style.height = (INFOPANE_DEFAULT_HEIGHT) + "px"; + // give 3px padding for a border + infoPane.style.top = (tileY + IMAGEPANE_HEIGHT + (PADDING*2)) + "px"; + infoPane.style.left = tileX + "px"; + infoTableMinimize = document.getElementById("infopaneDetailsIcon"); + indicatorCell = document.getElementById("infopaneIndicator"); + indicatorCell.style.width = (10) + "px"; + indicatorImage = document.createElement("img"); + indicatorImage.className = "infopaneIndicator"; + indicatorImage.src = INDICATOR_IMG_URI; + indicatorImage.style.visibility = "hidden"; + indicatorCell.appendChild(indicatorImage); + minimizeLink = document.createElement("a"); + minimizeLink.className = "infopaneLink"; + minimizeLink.title = MAXIMIZE_IMG_TOOLTIP; + minimizeImage = document.createElement("img"); + minimizeImage.src= MAXIMIZE_IMG_URI; + minimizeLink.appendChild(minimizeImage); + infoTableMinimize.appendChild(minimizeLink); + + if (typeof minimizeLink.attachEvent != 'undefined') { + minimizeLink.attachEvent("onclick",function(e){_this.doMaximize();}); + } else { + minimizeLink.addEventListener("click",function(e){_this.doMaximize();}, true); + } + var clipMe = 'rect(' + '0px,' + VIEWPORT_WIDTH + 'px,'+ INFOPANE_DEFAULT_HEIGHT +'px,' + 0 + 'px)'; + infoPane.style.clip = clipMe; + } + + function createTile(i) { + var div = document.createElement("div"); + div.className = "tile"; + div.id = i.id; + var link = document.createElement("a"); + var img = document.createElement("img"); + img.title = i.name; + img.src = i.thumbnail; + img.className = "tileImage"; + link.appendChild(img); + link.setAttribute("id", i.id); + if (typeof div.attachEvent != 'undefined') { + div.attachEvent('onclick',function(e){this.id = div.id; _this.showImage(this.id, false);}); + } else { + link.addEventListener('click',function(e){this.id = div.id; _this.showImage(this.id, false);}, true); + } + div.appendChild(link); + injectionPoint.appendChild(div); + div.style.top = tileY + INFOPANE_DEFAULT_HEIGHT + IMAGEPANE_HEIGHT + (PADDING * 3) + "px"; + tiles.push(div); + } + + + function findY(element) { + var t = 0; + if (element.offsetParent) { + while (element.offsetParent) { + t += element.offsetTop + element = element.offsetParent; + } + } else if (element.y) { + t += element.y; + } + return t; + } + + function findX(element) { + var l = 0; + if (element.offsetParent) { + while (element.offsetParent) { + l += element.offsetLeft + element = element.offsetParent; + } + } else if (element.x) + l += element.x; + return l; + } +} diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/search.jsp b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/search.jsp new file mode 100644 index 0000000..e12d666 --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/search.jsp @@ -0,0 +1,290 @@ +<%-- Copyright 2006 Sun Microsystems, Inc. All rights reserved. You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at: http://developer.sun.com/berkeley_license.html +$Id: search.jsp,v 1.28 2006/12/04 21:34:10 basler Exp $ --%> + +<%@page contentType="text/html"%> +<%@page pageEncoding="UTF-8"%> +<%@page import="java.util.*, com.sun.javaee.blueprints.petstore.search.*"%> +<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> +<%@taglib uri="http://java.sun.com/jsf/html" prefix="h" %> +<%@taglib uri="http://java.sun.com/jsf/core" prefix="f" %> +<%@taglib prefix="ui5" uri="http://java.sun.com/blueprints/ui" %> + + +<html> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> + <title>Search Page</title> + <style> + .itemTable { + padding: 0.3cm; + width: 800px; + border-style: double; + border-color: darkgreen; + } + .itemCell { + border-style: solid; + border-color: darkgreen; + border-width: thin; + padding: 5px + } + .tagDiv { + border-style: groove; + border-color: darkgreen; + background-color: white; + border-width: thick; + padding: 5px; + visibility: hidden; + position:absolute; + left:0px; + top:0px; + z-index: 3; + } + </style> + <script type="text/javascript" src="common.js"></script> + </head> + <body> + <jsp:include page="banner.jsp" /> + <center> + + <script type="text/javascript"> + function checkAll() { + var elems=dojo.byId("resultsForm").elements; + for(ii=0; ii < elems.length; ii++) { + if(elems[ii].name.indexOf("mapSelectedItems") >= 0) { + elems[ii].checked=true; + } + } + return false; + } + + function uncheckAll() { + var elems=dojo.byId("resultsForm").elements; + for(ii=0; ii < elems.length; ii++) { + if(elems[ii].name.indexOf("mapSelectedItems") >= 0) { + elems[ii].checked=false; + } + } + return false; + } + + function addTags(eventx, namex, itemIdx) { + var xx=0; + var yy=0; + if (!eventx) var eventx=window.event; + if (eventx.pageX || eventx.pageY){ + xx=eventx.pageX; + yy=eventx.pageY; + } else if (eventx.clientX || eventx.clientY) { + xx=eventx.clientX + document.body.scrollLeft; + yy=eventx.clientY + document.body.scrollTop; + } + divId="addTags"; + document.getElementById("addTagsItemId").value=itemIdx; + document.getElementById("addTagsTags").value=""; + document.getElementById("addTagsTitle").innerHTML="<b>Add Tags to '" + namex + "'</b>"; + document.getElementById(divId).style.left=(xx - 170) + "px"; + document.getElementById(divId).style.top=(yy - 140) + "px"; + document.getElementById(divId).style.visibility='visible'; + document.getElementById("addTagsTags").focus(); + } + + function saveAddTags() { + // get data and send to controller servlet + itemIdx=document.getElementById("addTagsItemId").value; + tagsx=document.getElementById("addTagsTags").value; + var bindArgs = { + url: "../TagServlet?itemId=" + escape(itemIdx) + "&tags=" + escape(tagsx), + mimetype: "text/xml", + error: ajaxBindError, + load: function(type, data, evt){ + // check successful response + if (evt.readyState == 4) { + if (evt.status == 200) { + // get results and replace dom elements + var resultx=data.getElementsByTagName("response")[0]; + itemIdx=resultx.getElementsByTagName("itemId")[0].childNodes[0].nodeValue; + + // change DOM data + document.getElementById("ITEMID_TAGS_" + itemIdx).innerHTML=resultx.getElementsByTagName("tags")[0].childNodes[0].nodeValue; + + } else if (evt.status == 204){ + alert("204 return"); + } + } + } + }; + + dojo.io.bind(bindArgs); + // make sure it was updated + + // show messages if error + + // hide popup + document.getElementById(divId).style.visibility='hidden'; + } + + function cancelAddTags() { + // hide popup + document.getElementById(divId).style.visibility='hidden'; + } + + </script> + + <f:view> + + <ui5:popupTag id="pop1" xmlHttpRequestURL="../lookup.jsp?popupView=2&itemId=" + elementNamePairs="name=value1,description=value2,price=value3,image=imageId"> + <!-- Used as spaces to center the table, this could be done programmatically, + but browser diff, so I left it in the hands of the component user. The image is located + in the component jar so for retrieval, push it through the faces servlet --> + <img id="spaceImage" height="10px" width="3px" src="${pageContext.request.contextPath}/faces/static/META-INF/popup/images/spacer.gif" align="left"> + <table border="0" width="270px" bgcolor="#ffffff" cellpadding="5" cellspacing="5"> + <tr> + <td align="left" valign="top"><b>Name:</b> + <span id="value1">Loading Data...</span></td> + </tr> + <tr> + <td align="left" valign="top"><b>Seller Address:</b> + <span id="value2">Loading Data...</span></td> + </tr> + <tr> + <td align="left" valign="top"><b>Price:</b> + <span id="value3">Loading Data...</span></td> + </tr> + <tr> + <td colspan="2" align="center"><img name="image" id="imageId" src="" + alt="[Loading Image...]" border="2"/><br/><br/></td> + </tr> + </table> + </ui5:popupTag> + + <h1>Search Page</h1> + <h:form id="searchForm"> + <table class="itemTable" style="width: 700px"> + <tr> + <th class="itemCell">Search String</th> + <td class="itemCell"> + <h:inputText size="50" id="searchString" value="#{SearchBean.searchString}"/> + Also Search Tags:<h:selectBooleanCheckbox id="searchTags" value="#{SearchBean.searchTags}"/> + </td> + </tr> + <tr> + <td class="itemCell" align="center" colspan="2"> + <h:commandButton action="#{SearchBean.searchAction}" id="searchSubmit" type="submit" value="Submit"/> + <h:commandButton id="searchReset" type="reset" value="Reset"/> + </td> + </tr> + </table> + <h:messages/> + </h:form> + <br/> + + + + <h:form id="resultsForm" rendered="#{SearchBean.showResults}"> + <table class="itemTable"> + <tr> + <th class="itemCell"> + Map + <br/> + <img src="../images/check_all.gif" onclick="return checkAll()"/><img src="../images/uncheck_all.gif" onclick="return uncheckAll()"/> + </th> + <th class="itemCell">Name</th> + <th class="itemCell">Description</th> + <th class="itemCell">Tags</th> + <th class="itemCell">Price</th> + </tr> +<% +SearchBean searchBean=(SearchBean)session.getAttribute("SearchBean"); +if(searchBean != null) { + List<IndexDocument> hits=searchBean.getHits(); + if(hits != null) { + for(IndexDocument indexDoc : hits) { +%> + <tr> + <td class="itemCell"> + <input type="checkbox" name="mapSelectedItems" value="<%= indexDoc.getUID() %>"/> + </td> + <td class="itemCell"> + <a href="${pageContext.request.contextPath}/faces/catalog.jsp?pid=<%= indexDoc.getProduct() %>&itemId=<%= indexDoc.getUID() %>" + onmouseover="bpui.popup.show('pop1', event, '<%= indexDoc.getUID() %>')" onmouseout="bpui.popup.hide('pop1')"> + <%= indexDoc.getTitle() %> + </a> + </td> + <td class="itemCell"> + <%= indexDoc.getSummary() %> + </td> + <td class="itemCell"> + <span id="ITEMID_TAGS_<%= indexDoc.getUID() %>"><%= (indexDoc.getTag().equals("") ? " " : indexDoc.getTag()) %></span> + <br/><input type="button" value="Add Tags" onclick="addTags(event, '<%= indexDoc.getTitle() %>', '<%= indexDoc.getUID() %>')"/> + </td> + <td class="itemCell"> + <%= indexDoc.getPriceDisplay() %> + </td> + </tr> +<% + } + } +} +%> + <tr> + <td colspan="5"> + <br/> + <center> + <table class="itemTable"> + <tr> + <th align="right">Center Point Address:</th> + <td> + <h:inputText id="centerAddress" value="#{MapBean.centerAddress}" size="50"/> + <br/><small><i>For example: 4140 Network Circle, Santa Clara, CA, 95054</i></small> + </td> + </tr> + <tr> + <th align="right">Area (in Miles):</th> + <td> + <h:inputText id="radius" value="#{MapBean.radius}" size="5"/> + </td> + </tr> + <tr> + <td align="center" colspan="2"> + <h:commandButton action="#{MapBean.findAllByIDs}" id="mapSubmit" type="submit" + value="Map Checked Item(s)" rendered="#{SearchBean.showResults}"/> + </td> + </tr> + </table> + </center> + <br/> + </td> + </tr> + </table> + + <h:messages/> + </h:form> + <br/><br/><br/> + <div class="tagDiv" id="addTags"> + <form> + <table> + <tr> + <td align="center"> + <span id="addTagsTitle"><b>Tag Title</b></span><br/><i>(seperated by spaces)</i> + </td> + </tr> + <tr> + <td align="center"> + <input id="addTagsTags" type="text" size="50"/> + </td> + </tr> + <tr> + <td align="center"> + <input type="button" value="Save" onclick="saveAddTags()"/> <input type="button" value="Cancel" onclick="cancelAddTags()"/> + </td> + </tr> + </table> + <input type="hidden" id="addTagsItemId"/> + </form> + </div> + </f:view> + </center> + <jsp:include page="footer.jsp" /> + </body> +</html> diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/styles.css b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/styles.css new file mode 100644 index 0000000..24ffbf9 --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/styles.css @@ -0,0 +1,130 @@ + +.dojoHtmlFisheyeListBar { + cursor:pointer; + margin: 0; + width: 300px; + text-align: right; +} + +.outerbar { + background-color: white; + text-align: left; + width: 300px; +} + +.editText { + height:25; + font-size:18px; + font-weight: bold; + font-family: Arial; +} + +.plainText { + height:25; + font-size:20px; + font-weight: bold; + font-family: Arial +} + +.plainTextSelect { + height:25; + font-size:20px; + font-weight: bold; + font-family: Arial; + background: red +} + +.smallText { + height:15; + font-size:13px; + font-weight: bold; + font-family: Arial +} + +.banner { + height:35; + font-size:35; + font-weight: bold; + font-family: Arial +} + + +.menuItem { + background: white; + color: black; + text-decoration: none; + font-size: 1.4em; +} + +.menuLink { + cursor:pointer; + color: black; + text-decoration: none; + font-size: 1.3em; +} + +.menuLinkHover { + cursor:pointer; + color: black; + font-size: 1.3em; + text-decoration: underline; +} + +.autocomplete { + position:absolute; +} + +.autocompleteTable { + padding:0; + visibility: hidden; + border-spacing: 0; + border-width:1px; + border-style:solid; + border-color:black; +} + +.popupRowHover { + color: #FFFAFA; + cursor:pointer; + padding-left:3; + padding-right:3; + border-spacing: 0; + border-width:0px; + background: #7A8AFF; +} + +.popupRow { + padding-left:3; + padding-right:3; + border-spacing: 0; + border-width:0px; + background: #FFFAFA; +} + +.popupRowEven { + padding-left:3; + padding-right:3; + border-spacing: 0; + border-width:0px; + background: #FFFADA; +} + +.popupItem { + background: #FFFAFA; + color: #000000; + text-decoration: none; + font-size: 1.2em; +} + +.shadow { + top:0px; + left:0px; + position: absolute; + visibility: hidden; + width:0; + height:0; + z-index:0; + background:gray; + opacity: .5; +} + diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/systemerror.jsp b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/systemerror.jsp new file mode 100644 index 0000000..c7a5309 --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/systemerror.jsp @@ -0,0 +1,28 @@ +<%-- Copyright 2006 Sun Microsystems, Inc. All rights reserved. You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at: http://developer.sun.com/berkeley_license.html +$Id: systemerror.jsp,v 1.3 2007/01/09 19:02:12 basler Exp $ --%> +<%@ page isErrorPage="true" %> +<%@ page import="com.sun.javaee.blueprints.petstore.util.PetstoreUtil, java.util.logging.Level" %> +<% +PetstoreUtil.getLogger().log(Level.INFO, "Encountered a Runtime Exception and being transferred the the systemerror page", exception); +%> +<html> + <head> + <meta http-equiv="Content-Type" content="text/html;charset=utf-8" > + <title>Java Pet Store Reference Application: System Error Page</title> + </head> + <body> + + <jsp:include page="banner.jsp" /> + + <h2>System Error !</h2> + <p>We had problems processing your request. An exception has been caught, + so perhaps your application was not set up or deployed properly.</p> + + The Exception that was thrown is:<b> <%= exception.toString() %></b>. The server log will contain the stack trace of the exception. + + <p><a href="${pageContext.request.contextPath}/faces/index.jsp">Go back to sample application home</a></p> + <br/><br/> + <jsp:include page="footer.jsp" /> + + </body> +</html> diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/tag.css b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/tag.css new file mode 100644 index 0000000..bfbab6e --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/tag.css @@ -0,0 +1,47 @@ + .itemTable { + padding: 0.3cm; + border-style: double; + width: 800px; + border-color: darkgreen; + } + .itemCell { + border-style: solid; + border-color: darkgreen; + border-width: thin; + padding: 5px + } + .tagCell { + padding: 0.3cm; + } + .xxlarge + { + font-size: xx-large; + color: red; + cursor: pointer; + text-decoration: underline; + } + .xlarge + { + font-size: x-large; + color: blue; + cursor: pointer; + text-decoration: underline; + } + .large + { + font-size: large; + color: green; + cursor: pointer; + text-decoration: underline; + } + .medium + { + font-size: medium; + cursor: pointer; + color: black; + text-decoration: underline; + } + .items + { + visibility: hidden; + } diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/tag.jsp b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/tag.jsp new file mode 100644 index 0000000..f9c74f3 --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/tag.jsp @@ -0,0 +1,158 @@ +<%-- Copyright 2006 Sun Microsystems, Inc. All rights reserved. You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at: http://developer.sun.com/berkeley_license.html +$Id: tag.jsp,v 1.11 2007/01/17 18:00:09 basler Exp $ --%> + +<%@page contentType="text/html"%> +<%@page pageEncoding="UTF-8"%> +<%@page import="java.util.*, com.sun.javaee.blueprints.petstore.model.CatalogFacade, com.sun.javaee.blueprints.petstore.model.Tag"%> +<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> +<%@taglib uri="http://java.sun.com/jsf/html" prefix="h" %> +<%@taglib uri="http://java.sun.com/jsf/core" prefix="f" %> +<%@taglib prefix="ui5" uri="http://java.sun.com/blueprints/ui" %> + + +<html> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> + <title>Tag Page</title> + <script type="text/javascript" src="./common.js"></script> + <link type="text/css" rel="stylesheet" href="./tag.css"/> +<% +try { + CatalogFacade cf = (CatalogFacade)config.getServletContext().getAttribute("CatalogFacade"); + List<Tag> tags=cf.getTagsInChunk(0, 90); + // since top 20 come from database or desending refCount order, need to reorder by tag name + Collections.sort(tags, new Comparator() { + public int compare(Object one, Object two) { + return ((Tag)one).getTag().compareTo(((Tag)two).getTag()); + } + }); +%> + <script language="javascript"> + function retrieveItems(tag) { + var bindArgs = { + // url when using the jsp to serve the ajax request + url: "../tagItemLookup.jsp?tag=" + escape(tag), + mimetype: "text/xml", + load: returnFunctionx, + error: ajaxBindError}; + + // dispatch the request + dojo.io.bind(bindArgs); + } + + + function returnFunctionx(type, data, evt) { + // statically setup popup for simple case + var componentId="displayItems"; + // check return of the dojo call to make sure it is valid + if (evt.readyState == 4) { + if (evt.status == 200) { + // get results and replace dom elements + var itemsx=data.getElementsByTagName("item"); + display="<table class='itemTable'><tr><td class='itemCell' align='center' colspan='4'><h2>Tag: " + + data.getElementsByTagName("tag")[0].childNodes[0].nodeValue + + "</h2></td></tr><tr><th class='itemCell'>Name</th><th class='itemCell'>Description</th><th class='itemCell'>Tags</th><th class='itemCell'>Price</th></tr>" + for(ii=0; ii < itemsx.length; ii++) { + display += "<tr>"; + display +="<td class='itemCell'><a href='./catalog.jsp?pid="+ itemsx[ii].getElementsByTagName("productID")[0].childNodes[0].nodeValue +"&itemId=" + + itemsx[ii].getElementsByTagName("itemID")[0].childNodes[0].nodeValue + "' onmouseover='bpui.popup.show("pop1", event, "" + + itemsx[ii].getElementsByTagName("itemID")[0].childNodes[0].nodeValue + "")' onmouseout='bpui.popup.hide("pop1")'>" + + itemsx[ii].getElementsByTagName("name")[0].childNodes[0].nodeValue +"</a></td>"; + display +="<td class='itemCell'>" + itemsx[ii].getElementsByTagName("description")[0].childNodes[0].nodeValue +"</td>"; + display +="<td class='itemCell'>" + itemsx[ii].getElementsByTagName("tags")[0].childNodes[0].nodeValue +"</td>"; + display +="<td class='itemCell' style='text-align: right'>" + itemsx[ii].getElementsByTagName("price")[0].childNodes[0].nodeValue +"</td>"; + display +="</tr>"; + } + display += "</table>"; + document.getElementById(componentId).innerHTML=display; + document.getElementById(componentId).style.visibility='visible'; + } else if (evt.status == 204){ + alert("204 return"); + } + } + } + + + function checkQueryString() { + <!-- add script to check for tag in query string, if exists then retrieve data --> + var iPos=window.location.href.indexOf("?tag="); + if(iPos > -1) { + // have tag so retrieve items + retrieveItems(window.location.href.substr(iPos + 5)); + } + } + + </script> + </head> + <body onload="checkQueryString();"> + <jsp:include page="banner.jsp" /> + <f:view> + + <ui5:popupTag id="pop1" xmlHttpRequestURL="../lookup.jsp?popupView=2&itemId=" + elementNamePairs="name=value1,description=value2,price=value3,image=imageId"> + <!-- Used as spaces to center the table, this could be done programmatically, + but browser diff, so I left it in the hands of the component user. The image is located + in the component jar so for retrieval, push it through the faces servlet --> + <img id="spaceImage" height="10px" width="10px" src="${pageContext.request.contextPath}/faces/static/META-INF/popup/images/spacer.gif" align="left"> + <table border="0" width="270px" bgcolor="#ffffff" cellpadding="5" cellspacing="5"> + <tr> + <td align="left" valign="top"><b>Name:</b> + <span id="value1">Loading Data...</span></td> + </tr> + <tr> + <td align="left" valign="top"><b>Seller Address:</b> + <span id="value2">Loading Data...</span></td> + </tr> + <tr> + <td align="left" valign="top"><b>Price:</b> + <span id="value3">Loading Data...</span></td> + </tr> + <tr> + <td colspan="2" align="center"><img name="image" id="imageId" src="" + alt="[Loading Image...]" border="2"/><br/><br/></td> + </tr> + </table> + </ui5:popupTag> + <center> + <h1>Tag Page</h1> + <table border="0"> + <tr> +<% + String style=null; + int refx=0, ii=0; + for(Tag tag : tags) { + refx=tag.getRefCount() / 5; + if(refx >= 3) { + style="xxlarge"; + } else if(refx == 2) { + style="xlarge"; + } else if(refx == 1) { + style="large"; + } else { + style="medium"; + } + + if((ii % 6) == 0) out.println("</tr>\n<tr>"); + //out.println("<td class='tagCell'><span onclick="retrieveItems('" + tag.getTag() + "')" class='" + style +"'>" + tag.getTag() + "</span> (" + tag.getRefCount() + ")</td>"); + out.println("<td class='tagCell'><span onclick="retrieveItems('" + tag.getTag() + "')" class='" + style +"'>" + tag.getTag() + "</span></td>"); + ii++; + } +%> + </tr> + </table> + <div id="displayItems" class="items"> + + </div> + </center> + </f:view> + <br/><br/><br/><br/> + <jsp:include page="footer.jsp" /> + + </body> +</html> + +<% + } catch(Exception e) { + e.printStackTrace(); + } +%> diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/tagItemLookup.jsp b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/tagItemLookup.jsp new file mode 100644 index 0000000..05ef352 --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/tagItemLookup.jsp @@ -0,0 +1,45 @@ +<%-- Copyright 2006 Sun Microsystems, Inc. All rights reserved. You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at: http://developer.sun.com/berkeley_license.html +$Id: tagItemLookup.jsp,v 1.4 2007/01/19 21:47:31 basler Exp $ --%> + +<%@page contentType="text/xml"%> +<%@page pageEncoding="UTF-8"%> +<%@page import="java.util.*, java.text.NumberFormat, com.sun.javaee.blueprints.petstore.model.CatalogFacade, com.sun.javaee.blueprints.petstore.model.Item, com.sun.javaee.blueprints.petstore.model.Tag"%> + +<% + String sxTag=request.getParameter("tag"); + + try { + response.setHeader("Pragma", "No-Cache"); + response.setHeader("Cache-Control", "no-cache,no-store,max-age=0"); + response.setDateHeader("Expires", 1); + + ServletContext context=config.getServletContext(); + CatalogFacade cf=(CatalogFacade)context.getAttribute("CatalogFacade"); + Tag tag=cf.getTagWithPersistentItems(sxTag); + out.println("<response>"); + + if(tag != null) { + out.println("<tag>" + tag.getTag() + "</tag>"); + out.println("<items>"); + Collection<Item> items=tag.getItems(); + for(Item item : items) { + if(item.getDisabled() == 0) { + out.println("<item>"); + out.println("<itemID>" + item.getItemID() + "</itemID>"); + out.println("<productID>" + item.getProductID() + "</productID>"); + out.println("<name><![CDATA[" + item.getName() + "]]></name>"); + out.println("<description><![CDATA[" + item.getDescription() + "]]></description>"); + out.println("<tags><![CDATA[" + item.tagsAsString() + "]]></tags>"); + out.println("<price><![CDATA[" + NumberFormat.getCurrencyInstance(java.util.Locale.US).format(item.getPrice()) + "]]></price>"); + out.println("</item>"); + } + } + out.println("</items>"); + } + out.println("</response>"); + out.flush(); + } catch(Exception ee) { + ee.printStackTrace(); + } + +%> diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/testis.jsp b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/testis.jsp new file mode 100644 index 0000000..e5dd68a --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/testis.jsp @@ -0,0 +1,36 @@ +<%@page contentType="text/html"%> +<%@page pageEncoding="UTF-8"%> +<%-- +The taglib directive below imports the JSTL library. If you uncomment it, +you must also add the JSTL library to the project. The Add Library... action +on Libraries node in Projects view can be used to add the JSTL 1.1 library. +--%> +<%-- +<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> +--%> + +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" + "http://www.w3.org/TR/html4/loose.dtd"> + +<html> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> + <title>JSP Page</title> + </head> + <body> + + <h1>JSP Page</h1> + + <%-- + This example uses JSTL, uncomment the taglib directive above. + To test, display the page like this: index.jsp?sayHello=true&name=Murphy + --%> + <%-- + <c:if test="${param.sayHello}"> + <!-- Let's welcome the user ${param.name} --> + Hello ${param.name}! + </c:if> + --%> + + </body> +</html> diff --git a/etc/samples/provisioning/sample-bundle/src/main/scripts/assembly.xml b/etc/samples/provisioning/sample-bundle/src/main/scripts/assembly.xml new file mode 100644 index 0000000..942e5f9 --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/scripts/assembly.xml @@ -0,0 +1,41 @@ +<?xml version="1.0"?> + +<!-- $Id$ --> + +<assembly> + <!-- The id gets appended to the end of the zipfile name unless + it's an empty string, so make it an empty string. --> + <id></id> + <formats> + <format>zip</format> + </formats> + <includeBaseDirectory>false</includeBaseDirectory> + <baseDirectory>target/bundle</baseDirectory> + <fileSets> + <fileSet> + <directory>target/bundle</directory> + <outputDirectory>/</outputDirectory> + <includes> + <include>**/*</include> + </includes> + <excludes> + <exclude>**/*.sh</exclude> + <exclude>**/*.so</exclude> + <exclude>**/*.sl</exclude> + <exclude>**/*.dylib</exclude> + </excludes> + </fileSet> + <fileSet> + <directory>target/bundle</directory> + <outputDirectory>/</outputDirectory> + <includes> + <include>**/*.sh</include> + <include>**/*.so</include> + <include>**/*.sl</include> + <include>**/*.dylib</include> + </includes> + <fileMode>0755</fileMode> + </fileSet> + </fileSets> +</assembly> + diff --git a/etc/samples/provisioning/sample-bundle/src/main/scripts/build.xml b/etc/samples/provisioning/sample-bundle/src/main/scripts/build.xml new file mode 100644 index 0000000..fed3f16 --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/scripts/build.xml @@ -0,0 +1,63 @@ +<?xml version="1.0"?> + +<!-- $Id$ --> + +<project name="sample-bundle" basedir="." default="build"> + + <target name="build"> + + <!-- download JBossAS 6.0 dist from sourceforge and unzip it --> + <property name="tmp.dir" location="${java.io.tmpdir}/${user.name}"/> + <echo>tmp.dir="${tmp.dir}"</echo> + <mkdir dir="${tmp.dir}"/> + + <get src="http://downloads.sourceforge.net/project/jboss/JBoss/JBoss-6.0.0.M3/jboss-as..." + dest="${tmp.dir}/jbossas.zip" + usetimestamp="true"/> + <property name="jboss.home" location="target/jbossas-petstore"/> + <echo>jboss.home="${jboss.home}"</echo> + <mkdir dir="${jboss.home}"/> + <unzip src="${tmp.dir}/jbossas.zip" dest="${jboss.home}"> + <mapper> + <globmapper from="jboss-6.0.0.20100429-M3/*" to="*"/> + </mapper> + </unzip> + + <!-- delete all server configs, except 'default' --> + <delete includeemptydirs="true"> + <fileset dir="${jboss.home}/server"> + <exclude name="default/**"/> + </fileset> + </delete> + + <!-- delete docs dir and README files... --> + <delete dir="${jboss.home}/docs"/> + <delete> + <fileset dir="${jboss.home}" includes="*.*" /> + </delete> + + <property name="jboss.config.dir" location="${jboss.home}/server/default"/> + + <echo>Copying Derby JDBC driver jar to $${jboss.home}/server/default/lib/...</echo> + <copy file="${settings.localRepository}/org/apache/derby/derbyclient/${derbyclient.version}/derbyclient-${derbyclient.version}.jar" + toDir="${jboss.config.dir}/lib" failonerror="false" verbose="true" /> + + <!-- copy petstore files into the jbossas install --> + <copy todir="${jboss.home}"> + <fileset dir="src/main/petstore"/> + </copy> + + <mkdir dir="target/bundle"/> + + <!-- zip up our modified jbossas install - this zipfile will be used as a bundle file --> + <zip destfile="target/bundle/jbossas-petstore.zip" basedir="${jboss.home}"/> + + <!-- copy the recipe and other bundle files into the bundle --> + <copy todir="target/bundle"> + <fileset dir="src/main/bundle"/> + </copy> + + </target> + +</project> + diff --git a/etc/samples/sample-bundle/pom.xml b/etc/samples/sample-bundle/pom.xml deleted file mode 100644 index 6bd4a88..0000000 --- a/etc/samples/sample-bundle/pom.xml +++ /dev/null @@ -1,92 +0,0 @@ -<?xml version="1.0"?> - -<!-- $Id$ --> - -<project xmlns="http://maven.apache.org/POM/4.0.0" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd%22%3E - - <modelVersion>4.0.0</modelVersion> - - <groupId>org.rhq.sample</groupId> - <artifactId>rhq-sample-bundle</artifactId> - <version>2.0</version> - <packaging>pom</packaging> - - <name>RHQ Sample Bundle</name> - <description>a sample bundle consisting of JBossAS 6.0 running the Java Petstore application</description> - - <scm> - <connection>scm:git:ssh://git.fedorahosted.org/git/rhq.git/etc/modules/sample-bundle/</connection> - <developerConnection>scm:git:ssh://git.fedorahosted.org/git/rhq.git/etc/modules/sample-bundle/</developerConnection> - </scm> - - <properties> - <!-- dependency versions --> - <derbyclient.version>10.5.3.0_1</derbyclient.version> - </properties> - - <dependencies> - - <!-- Derby JDBC driver --> - <dependency> - <groupId>org.apache.derby</groupId> - <artifactId>derbyclient</artifactId> - <version>${derbyclient.version}</version> - </dependency> - - </dependencies> - - <build> - - <plugins> - - <plugin> - <artifactId>maven-antrun-plugin</artifactId> - <executions> - <execution> - <id>prepare-bundle</id> - <phase>process-resources</phase> - <configuration> - <tasks> - <echo>settings.localRepository=${settings.localRepository}</echo> - <echo>project.build.outputDirectory=${project.build.outputDirectory}</echo> - <ant antfile="src/main/scripts/build.xml"> - <property name="settings.localRepository" value="${settings.localRepository}"/> - <property name="project.version" value="${project.version}"/> - <property name="project.build.outputDirectory" value="${project.build.outputDirectory}"/> - <property name="derbyclient.version" value="${derbyclient.version}"/> - </ant> - </tasks> - </configuration> - <goals> - <goal>run</goal> - </goals> - </execution> - </executions> - </plugin> - - <plugin> - <artifactId>maven-assembly-plugin</artifactId> - <configuration> - <descriptors> - <descriptor>src/main/scripts/assembly.xml</descriptor> - </descriptors> - <finalName>${project.build.finalName}</finalName> - </configuration> - <executions> - <execution> - <id>assemble-bundle</id> - <phase>package</phase> - <goals> - <goal>attached</goal> - </goals> - </execution> - </executions> - </plugin> - - </plugins> - </build> - -</project> - diff --git a/etc/samples/sample-bundle/src/main/bundle/deploy.xml b/etc/samples/sample-bundle/src/main/bundle/deploy.xml deleted file mode 100644 index 8bfec17..0000000 --- a/etc/samples/sample-bundle/src/main/bundle/deploy.xml +++ /dev/null @@ -1,57 +0,0 @@ -<?xml version="1.0"?> - -<project name="petstore" default="main" - xmlns:rhq="antlib:org.rhq.bundle"> - - <rhq:bundle name="Java Petstore" version="2.0" - description="a sample bundle consisting of JBossAS 6.0 running the Java Petstore application"> - - <rhq:input-property - name="jboss.bind.address" - description="the IP address the JBoss AS server should bind to" - required="true"/> - - <rhq:input-property - name="http.port" - description="the HTTP port the JBoss AS server should listen on" - required="true" - type="integer"/> - - <rhq:input-property - name="https.port" - description="the HTTPS port the JBoss AS server should listen on" - required="true" - type="integer"/> - - <rhq:deployment-unit name="appserver" - preinstallTarget="appserver-preinstall" postinstallTarget="appserver-postinstall"> - <rhq:system-service name="jbossas-petstore" scriptFile="jbossas-init-script" - configFile="jbossas-init-config" overwriteScript="true" - startLevels="3,4,5" startPriority="80" stopPriority="20"/> - - <rhq:archive name="jbossas-petstore.zip"/> - - <!-- the files that should be ignored during upgrades --> - rhq:ignore - rhq:fileset - <include name="server/default/data/**"/> - <include name="server/default/logs/**"/> - <include name="server/default/tmp/**"/> - <include name="server/default/work/**"/> - </rhq:fileset> - </rhq:ignore> - </rhq:deployment-unit> - - </rhq:bundle> - - <target name="main"/> - - <target name="appserver-preinstall"> - <echo>Installing Java Petstore App Server to ${rhq.deploy.dir}...</echo> - </target> - - <target name="appserver-postinstall"> - <echo>Done installing Java Petstore App Server to ${rhq.deploy.dir}.</echo> - </target> - -</project> diff --git a/etc/samples/sample-bundle/src/main/bundle/jbossas-init-config b/etc/samples/sample-bundle/src/main/bundle/jbossas-init-config deleted file mode 100644 index a2fc4c1..0000000 --- a/etc/samples/sample-bundle/src/main/bundle/jbossas-init-config +++ /dev/null @@ -1,69 +0,0 @@ -# Configuration file for jbossas init script that configures the -# settings needed to start a particular JBoss AS instance. - -# -# the JBoss AS installation directory (e.g. /opt/jboss-6.0.0.M1) -# (*REQUIRED*) -# -JBOSS_HOME="@@rhq.deploy.dir@@" - -# -# the args that will be passed to run.sh -# (i.e. org.jboss.Main). -# -JBOSS_OPTS="-b @@jboss.bind.address@@" - -# What UNIX user the JBoss AS java process will run as. -# (The shutdown client is always run as the invoker of the -# init script). JBoss AS will be run as root by default, but, for -# the sake of security, it is recommended that you chown the JBoss -# AS installation files to a non-root user and use that use here. -# Note, you do need to run as root if your server will listen on one -# or more privileged (< 1024) ports. If you really do want to run as -# root, comment out the JBOSS_USER variable completely (i.e. do not -# set it to root). This will run the server process without "su". -#JBOSS_USER=jboss - -# -# Specify the maximum file descriptor limit, use "max" or "maximum" to use -# the default, as queried by the system. -# -# Defaults to "maximum" -# -#MAX_FD="maximum" - -# -# Specify the profiler configuration file to load. -# -# Default is to not load profiler configuration file. -# -#PROFILER= - -# -# Specify the location of the Java Rntime Environment (JRE) or -# Java Development Kit (JDK) installation directory. If not set, -# "/usr/java/default" will be used. -# -#JAVA_HOME="/usr/java/default" - -# -# Specify options to pass to the Java VM (if unset, a default -# set of options will be used). -# -# Note, if you want to pass the default options but some of -# your own additional options in, then set the -# ADDITIONAL_JAVA_OPTS variable (see below), rather than JAVA_OPTS. -# -#JAVA_OPTS="-Xms128M -Xmx512M -XX:MaxPermSize=256M -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Djava.net.preferIPv4Stack=true" - -# -# Specify additional options to pass to the Java VM. These are passed -# in addition to the default set of options, -# i.e. java $JAVA_OPTS $ADDITIONAL_JAVA_OPTS ... org.jboss.Main ... -# -# Sample JPDA settings (uncomment either a) or b)) -# a) remote socket debugging -#ADDITIONAL_JAVA_OPTS="-Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n" -# b) shared memory debugging -#ADDITIONAL_JAVA_OPTS="-Xrunjdwp:transport=dt_shmem,server=y,suspend=n,address=jboss" - diff --git a/etc/samples/sample-bundle/src/main/bundle/jbossas-init-script b/etc/samples/sample-bundle/src/main/bundle/jbossas-init-script deleted file mode 100755 index 58eb98e..0000000 --- a/etc/samples/sample-bundle/src/main/bundle/jbossas-init-script +++ /dev/null @@ -1,328 +0,0 @@ -#!/bin/bash -# -# jbossas - This shell script takes care of starting and stopping -# a JBoss Application Server (AS) instance on a Red Hat -# Linux system. It can be run as a system service (init -# script) and/or run manually. -# -# chkconfig: 345 84 16 -# description: JBoss AS server -# processname: java -# pidfile: /var/run/jbossas.pid - -# Source init-script function library. -FUNCTIONS=/etc/rc.d/init.d/functions -if [ ! -f "$FUNCTIONS" ]; then - echo "Functions library ($FUNCTIONS) not found." >&2 - exit 1 -fi -. $FUNCTIONS - -# Find the name of this service (e.g. "jbossas"). -NAME=`basename $0` -if [ ${NAME:0:1} = "S" -o ${NAME:0:1} = "K" ]; then - NAME=${NAME:3} -fi - -# Set names of pid, lock, and log files - all based on the service name. -PIDFILE="/var/run/$NAME.pid" -LOCKFILE="/var/lock/subsys/$NAME" -LOGFILE="/var/log/$NAME.log" - -# Set defaults for optional configuration variables. -JAVA_HOME="/usr/java/default" -JAVA_OPTS="-Xms128M -Xmx512M -XX:MaxPermSize=256M" -JAVA_OPTS="$JAVA_OPTS -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000" -# (Prefer IPv4 stack as as temporary workaround to avoid 'all' config startup -# issues from IPv4 multicast addresses. See JBAS-7936.) -JAVA_OPTS="$JAVA_OPTS -Djava.net.preferIPv4Stack=true" - -# Source the service's config file, potentially overriding the defaults set -# above. -CONFIG="/etc/sysconfig/${NAME}" -if [ ! -f "$CONFIG" ]; then - echo "Required configuration file $CONFIG not found." >&2 - exit 1 -fi -. "$CONFIG" - -# Bail out if required variables were not set in the config file. -if [ -z "$JBOSS_HOME" ]; then - echo "Required variable JBOSS_HOME was not set in $CONFIG." >&2 - exit 1 -fi - - -start() -{ - # See if the service is already running, and, if so, exit with an error. - PID=`pidfileofproc "$NAME"` - if [ -n "$PID" ]; then - # pid file exists - see if process is actually running. - kill -0 $PID 2>/dev/null - if [ $? -eq 0 ]; then - echo "$NAME service is already running (pid=$PID)." >&2 - exit 1 - else - echo "Removing bogus pid file $PIDFILE..." - rm -f "$PIDFILE" - if [ -f "$LOCKFILE" ]; then - echo "Removing bogus lock file $LOCKFILE..." - rm -f "$LOCKFILE" - fi - fi - fi - - # Check that JAVA_HOME is valid. - JAVA="$JAVA_HOME/bin/java" - if [ ! -f "$JAVA" ]; then - echo "Java not found at $JAVA - please set JAVA_HOME in $CONFIG." >&2 - exit 1 - fi - if [ ! -x "$JAVA" ]; then - echo "$JAVA is not executable." >&2 - exit 5 - fi - - # Setup the classpath - JBOSS_BOOT_CLASSPATH="$JBOSS_HOME/bin/run.jar" - if [ ! -f "$JBOSS_BOOT_CLASSPATH" ]; then - echo "Missing required file: $JBOSS_BOOT_CLASSPATH" >&2 - exit 1 - fi - - # By default, Tomcat uses the JDT Compiler for compiling JSPs. However, - # include tools.jar in the classpath if we can find it under JAVA_HOME - # or if the user specified it via the JAVAC_JAR variable. - JAVAC_JAR_FILE="${JAVAC_JAR:-$JAVA_HOME/lib/tools.jar}" - if [ ! -f "$JAVAC_JAR_FILE" ]; then - [ -n "$JAVAC_JAR" ] && echo "Missing javac jar file $JAVAC_JAR as defined by the JAVAC_JAR variable. Unexpected results may occur." - unset JAVAC_JAR_FILE - fi - - # If -server not set in JAVA_OPTS, set it, if supported. - SERVER_SET=`echo $JAVA_OPTS | grep "-server"` - if [ -z "$SERVER_SET" ]; then - # Check for Sun JVM w/ HotSpot support. - HAS_HOTSPOT=`"$JAVA" -version 2>&1 | grep -i HotSpot` - - # Check for OpenJDK JVM w/ server support. - HAS_OPENJDK=`"$JAVA" -version 2>&1 | grep -i OpenJDK` - - # Enable -server if we have Hotspot or OpenJDK, unless we can't - if [ -n "$HAS_HOTSPOT" ] || [ -n "$HAS_OPENJDK" ]; then - JAVA_OPTS="-server $JAVA_OPTS" - fi - fi - - # Setup JBoss-specific properties. - JAVA_OPTS="-Dprogram.name=$NAME $JAVA_OPTS" - - # Setup JBoss Native library path. - unset JBOSS_NATIVE_DIR - for DIR in "$JBOSS_HOME/../native/lib" "$JBOSS_HOME/../native" "$JBOSS_HOME/../native/lib64" "$JBOSS_HOME/native/lib64" "$JBOSS_HOME/native/bin" "$JBOSS_HOME/bin/native"; do - if [ -d "$DIR" ]; then - JBOSS_NATIVE_DIR=`cd "$DIR/.." && pwd` - break - fi - done - if [ -d "$JBOSS_NATIVE_DIR" ]; then - IS_64_BIT_JVM=`"$JAVA" $JAVA_OPTS -version 2>&1 | grep -i 64-bit` - if [ -n "$IS_64_BIT_JVM" ]; then - JBOSS_NATIVE_DIR="$JBOSS_NATIVE_DIR/lib64" - else - JBOSS_NATIVE_DIR="$JBOSS_NATIVE_DIR/lib" - fi - LD_LIBRARY_PATH="$JBOSS_NATIVE_DIR${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" - export LD_LIBRARY_PATH - JAVA_OPTS="$JAVA_OPTS -Djava.library.path=$LD_LIBRARY_PATH" - fi - - # Setup the Java endorsed dirs. - JBOSS_ENDORSED_DIRS="$JBOSS_HOME/lib/endorsed" - JAVA_OPTS="$JAVA_OPTS -Djava.endorsed.dirs="$JBOSS_ENDORSED_DIRS"" - - # Setup the Java classpath. - JBOSS_CLASSPATH="${JBOSS_CLASSPATH:+$JBOSS_CLASSPATH:$JBOSS_BOOT_CLASSPATH}" - JBOSS_CLASSPATH="${JBOSS_CLASSPATH:-$JBOSS_BOOT_CLASSPATH}" - JBOSS_CLASSPATH="$JBOSS_CLASSPATH${JAVAC_JAR_FILE:+:$JAVAC_JAR_FILE}" - JAVA_OPTS="$JAVA_OPTS -classpath "$JBOSS_CLASSPATH"" - - # Display a summary of our environment if we're associated with a terminal. - if tty -s; then - echo "========================================================================="; echo - echo " JBoss AS Bootstrap Environment" ; echo - echo " JBOSS_HOME: $JBOSS_HOME" ; echo - echo " JAVA: $JAVA" ; echo - echo " JAVA_OPTS: $JAVA_OPTS" ; echo - echo " JBOSS_OPTS: $JBOSS_OPTS" ; echo - echo "========================================================================="; echo - fi - - # JBoss AS expects its current working dir to be $JBOSS_HOME/bin - cd "$JBOSS_HOME/bin" - - # JBoss AS expects JBOSS_HOME to be set in its environment. - export JBOSS_HOME - - # We only need to bother with nohup if we're associated with a terminal. - if tty -s; then - NOHUP=nohup - else - unset NOHUP - fi - - # If they set NICELEVEL in the config file, honor it. - [ -n "${NICELEVEL:-}" ] && NICE="nice -n $NICELEVEL" - - # If JBOSS_USER was specified in the config and current user is root, we - # want to setuid the JBoss AS process to JBOSS_USER. - if [ -n "$JBOSS_USER" ] && [ "$EUID" -eq 0 ]; then - # For SELinux we need to use 'runuser', not 'su'. - if [ -x /sbin/runuser ]; then - SU=runuser - else - SU=su - fi - else - unset SU - fi - - if [ -n "$SU" ]; then - WRAPPER="$NOHUP $NICE $SU -s /bin/bash - $JBOSS_USER -c" - else - WRAPPER="$NOHUP $NICE bash -c" - fi - - # Make sure log file exists and has correct ownership and permissions. - if [ "$EUID" -eq 0 ]; then - touch -a "$LOGFILE" || exit 4 - [ -n "$JBOSS_USER" ] && chown $JBOSS_USER "$LOGFILE" - [ -n "$JBOSS_GROUP" ] && chgrp $JBOSS_GROUP "$LOGFILE" - chmod u=rw "$LOGFILE" - [ -n "$JBOSS_GROUP" ] && chmod g+r "$LOGFILE" - [ -x /sbin/restorecon ] && /sbin/restorecon "$LOGFILE" - fi - - # Make sure pid file has correct ownership and permissions. - if [ "$EUID" -eq 0 ] && [ -f "$PIDFILE" ]; then - [ -n "$JBOSS_USER" ] && chown $JBOSS_USER "$PIDFILE" - [ -n "$JBOSS_GROUP" ] && chgrp $JBOSS_GROUP "$PIDFILE" - chmod u=rw "$PIDFILE" - [ -n "$JBOSS_GROUP" ] && chmod g+r - [ -x /sbin/restorecon ] && /sbin/restorecon "$PIDFILE" - fi - - echo -n "Starting $NAME service: " - - # Make sure to escape the $$'s within the subshell to prevent our own shell - # from evaluating them and writing our own pid to the pid file. - $WRAPPER "echo $$ >"$PIDFILE" || ( echo "Failed to write pid ($$) to $PIDFILE." >&2; exit 4 ); exec "$JAVA" $JAVA_OPTS org.jboss.Main $JBOSS_OPTS" >>"$LOGFILE" 2>&1 & - if [ $? -ne 0 ]; then - failure "$NAME startup" - echo - EXIT_STATUS=$? - fi - - # Wait a few seconds and then check that the process is running. Note, this - # will *not* verify that JBoss AS started properly without any configuration - # or deployment errors. - sleep 3 - - if pidfileofproc "$NAME"; then - success "$NAME startup" - echo - touch "$LOCKFILE" - EXIT_STATUS=0 - else - failure "$NAME startup" - echo - EXIT_STATUS=1 - fi -} - -stop() -{ - # See if service is running, and, if not, exit without any error. - PID=`pidfileofproc "$NAME"` - unset NOT_RUNNING - if [ -z "$PID" ]; then - NOT_RUNNING=1 - else - # pid file exists - see if process is actually running. - kill -0 $PID 2>/dev/null - if [ $? -ne 0 ]; then - NOT_RUNNING=1 - if [ -f "$PIDFILE" ]; then - echo "Removing bogus pid file $PIDFILE..." - rm -f "$PIDFILE" - fi - if [ -f "$LOCKFILE" ]; then - echo "Removing bogus lock file $LOCKFILE..." - rm -f "$LOCKFILE" - fi - fi - fi - if [ -n "$NOT_RUNNING" ]; then - echo "$NAME service is not running." - exit 0 - fi - - echo -n "Stopping $NAME service: " - killproc -d 30 "$NAME" - EXIT_STATUS=$? - if [ $EXIT_STATUS -eq 0 ]; then - rm -f "$LOCKFILE" - fi - echo -} - -# NOTE: We don't name this function 'status', since that would override the -# 'status function defined in /etc/init.d/functions. -_status() -{ - status "$NAME" - EXIT_CODE=$? -} - -restart() -{ - stop || exit $? - start -} - -condrestart() -{ - [ -f "$PIDFILE" ] && restart -} - -usage() -{ - echo "Usage: $NAME {start|stop|status|restart|condrestart}" >&2 - EXIT_CODE=2 -} - -# The -case "$1" in - start) - start - ;; - stop) - stop - ;; - status) - _status - ;; - restart) - restart - ;; - condrestart) - condrestart - ;; - *) - usage - ;; -esac - -exit $EXIT_STATUS - diff --git a/etc/samples/sample-bundle/src/main/petstore/petstore-db.changelog.xml b/etc/samples/sample-bundle/src/main/petstore/petstore-db.changelog.xml deleted file mode 100644 index 42ced88..0000000 --- a/etc/samples/sample-bundle/src/main/petstore/petstore-db.changelog.xml +++ /dev/null @@ -1,187 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog/1.9" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog/1.9 http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-1.9.xsd"> - <changeSet author="ips (generated)" id="1272025063915-1"> - <createTable schemaName="APP" tableName="ADDRESS"> - <column name="ADDRESSID" type="VARCHAR(10)"> - <constraints nullable="false" primaryKey="true" primaryKeyName="SQL100422173635960"/> - </column> - <column name="STREET1" type="VARCHAR(55)"> - <constraints nullable="false"/> - </column> - <column name="STREET2" type="VARCHAR(55)"/> - <column name="CITY" type="VARCHAR(55)"> - <constraints nullable="false"/> - </column> - <column name="STATE" type="VARCHAR(25)"> - <constraints nullable="false"/> - </column> - <column name="ZIP" type="VARCHAR(5)"> - <constraints nullable="false"/> - </column> - <column name="LATITUDE" type="DECIMAL(14,10)"> - <constraints nullable="false"/> - </column> - <column name="LONGITUDE" type="DECIMAL(14,10)"> - <constraints nullable="false"/> - </column> - </createTable> - </changeSet> - <changeSet author="ips (generated)" id="1272025063915-2"> - <createTable schemaName="APP" tableName="CATEGORY"> - <column name="CATEGORYID" type="VARCHAR(10)"> - <constraints nullable="false" primaryKey="true" primaryKeyName="SQL100422173635550"/> - </column> - <column name="NAME" type="VARCHAR(25)"> - <constraints nullable="false"/> - </column> - <column name="DESCRIPTION" type="VARCHAR(255)"> - <constraints nullable="false"/> - </column> - <column name="IMAGEURL" type="VARCHAR(55)"/> - </createTable> - </changeSet> - <changeSet author="ips (generated)" id="1272025063915-3"> - <createTable schemaName="APP" tableName="ID_GEN"> - <column name="GEN_KEY" type="VARCHAR(20)"> - <constraints nullable="false" primaryKey="true" primaryKeyName="SQL100422173636590"/> - </column> - <column name="GEN_VALUE" type="INT"> - <constraints nullable="false"/> - </column> - </createTable> - </changeSet> - <changeSet author="ips (generated)" id="1272025063915-4"> - <createTable schemaName="APP" tableName="ITEM"> - <column name="ITEMID" type="VARCHAR(10)"> - <constraints nullable="false" primaryKey="true" primaryKeyName="SQL100422173636230"/> - </column> - <column name="PRODUCTID" type="VARCHAR(10)"> - <constraints nullable="false"/> - </column> - <column name="NAME" type="VARCHAR(30)"> - <constraints nullable="false"/> - </column> - <column name="DESCRIPTION" type="VARCHAR(500)"> - <constraints nullable="false"/> - </column> - <column name="IMAGEURL" type="VARCHAR(55)"/> - <column name="IMAGETHUMBURL" type="VARCHAR(55)"/> - <column name="PRICE" type="DECIMAL(14,2)"> - <constraints nullable="false"/> - </column> - <column name="ADDRESS_ADDRESSID" type="VARCHAR(10)"> - <constraints nullable="false"/> - </column> - <column name="CONTACTINFO_CONTACTINFOID" type="VARCHAR(10)"> - <constraints nullable="false"/> - </column> - <column name="TOTALSCORE" type="INT"> - <constraints nullable="false"/> - </column> - <column name="NUMBEROFVOTES" type="INT"> - <constraints nullable="false"/> - </column> - <column name="DISABLED" type="INT"> - <constraints nullable="false"/> - </column> - </createTable> - </changeSet> - <changeSet author="ips (generated)" id="1272025063915-5"> - <createTable schemaName="APP" tableName="PRODUCT"> - <column name="PRODUCTID" type="VARCHAR(10)"> - <constraints nullable="false" primaryKey="true" primaryKeyName="SQL100422173635740"/> - </column> - <column name="CATEGORYID" type="VARCHAR(10)"> - <constraints nullable="false"/> - </column> - <column name="NAME" type="VARCHAR(25)"> - <constraints nullable="false"/> - </column> - <column name="DESCRIPTION" type="VARCHAR(255)"> - <constraints nullable="false"/> - </column> - <column name="IMAGEURL" type="VARCHAR(55)"/> - </createTable> - </changeSet> - <changeSet author="ips (generated)" id="1272025063915-6"> - <createTable schemaName="APP" tableName="SELLERCONTACTINFO"> - <column name="CONTACTINFOID" type="VARCHAR(10)"> - <constraints nullable="false" primaryKey="true" primaryKeyName="SQL100422173636080"/> - </column> - <column name="LASTNAME" type="VARCHAR(24)"> - <constraints nullable="false"/> - </column> - <column name="FIRSTNAME" type="VARCHAR(24)"> - <constraints nullable="false"/> - </column> - <column name="EMAIL" type="VARCHAR(24)"> - <constraints nullable="false"/> - </column> - </createTable> - </changeSet> - <changeSet author="ips (generated)" id="1272025063915-7"> - <createTable schemaName="APP" tableName="TAG"> - <column name="TAGID" type="INT"> - <constraints nullable="false" primaryKey="true" primaryKeyName="SQL100422173636830"/> - </column> - <column name="TAG" type="VARCHAR(30)"> - <constraints nullable="false"/> - </column> - <column name="REFCOUNT" type="INT"> - <constraints nullable="false"/> - </column> - </createTable> - </changeSet> - <changeSet author="ips (generated)" id="1272025063915-8"> - <createTable schemaName="APP" tableName="TAG_ITEM"> - <column name="TAGID" type="INT"> - <constraints nullable="false"/> - </column> - <column name="ITEMID" type="VARCHAR(10)"> - <constraints nullable="false"/> - </column> - </createTable> - </changeSet> - <changeSet author="ips (generated)" id="1272025063915-9"> - <createTable schemaName="APP" tableName="ZIPLOCATION"> - <column name="ZIPCODE" type="INT"> - <constraints nullable="false" primaryKey="true" primaryKeyName="SQL100422173636710"/> - </column> - <column name="CITY" type="VARCHAR(30)"> - <constraints nullable="false"/> - </column> - <column name="STATE" type="VARCHAR(2)"> - <constraints nullable="false"/> - </column> - </createTable> - </changeSet> - <changeSet author="ips (generated)" id="1272025063915-10"> - <createIndex indexName="SQL100422173636831" schemaName="APP" tableName="TAG" unique="true"> - <column name="TAG"/> - </createIndex> - </changeSet> - <changeSet author="ips (generated)" id="1272025063915-11"> - <createIndex indexName="SQL100422173637010" schemaName="APP" tableName="TAG_ITEM" unique="true"> - <column name="TAGID"/> - <column name="ITEMID"/> - </createIndex> - </changeSet> - <changeSet author="ips (generated)" id="1272025063915-12"> - <addForeignKeyConstraint baseColumnNames="ADDRESS_ADDRESSID" baseTableName="ITEM" baseTableSchemaName="APP" constraintName="SQL100422173636231" deferrable="false" initiallyDeferred="false" referencedColumnNames="ADDRESSID" referencedTableName="ADDRESS" referencedTableSchemaName="APP"/> - </changeSet> - <changeSet author="ips (generated)" id="1272025063915-13"> - <addForeignKeyConstraint baseColumnNames="CONTACTINFO_CONTACTINFOID" baseTableName="ITEM" baseTableSchemaName="APP" constraintName="SQL100422173636233" deferrable="false" initiallyDeferred="false" referencedColumnNames="CONTACTINFOID" referencedTableName="SELLERCONTACTINFO" referencedTableSchemaName="APP"/> - </changeSet> - <changeSet author="ips (generated)" id="1272025063915-14"> - <addForeignKeyConstraint baseColumnNames="PRODUCTID" baseTableName="ITEM" baseTableSchemaName="APP" constraintName="SQL100422173636232" deferrable="false" initiallyDeferred="false" referencedColumnNames="PRODUCTID" referencedTableName="PRODUCT" referencedTableSchemaName="APP"/> - </changeSet> - <changeSet author="ips (generated)" id="1272025063915-15"> - <addForeignKeyConstraint baseColumnNames="CATEGORYID" baseTableName="PRODUCT" baseTableSchemaName="APP" constraintName="SQL100422173635741" deferrable="false" initiallyDeferred="false" referencedColumnNames="CATEGORYID" referencedTableName="CATEGORY" referencedTableSchemaName="APP"/> - </changeSet> - <changeSet author="ips (generated)" id="1272025063915-16"> - <addForeignKeyConstraint baseColumnNames="ITEMID" baseTableName="TAG_ITEM" baseTableSchemaName="APP" constraintName="SQL100422173637011" deferrable="false" initiallyDeferred="false" referencedColumnNames="ITEMID" referencedTableName="ITEM" referencedTableSchemaName="APP"/> - </changeSet> - <changeSet author="ips (generated)" id="1272025063915-17"> - <addForeignKeyConstraint baseColumnNames="TAGID" baseTableName="TAG_ITEM" baseTableSchemaName="APP" constraintName="SQL100422173637012" deferrable="false" initiallyDeferred="false" referencedColumnNames="TAGID" referencedTableName="TAG" referencedTableSchemaName="APP"/> - </changeSet> -</databaseChangeLog> diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore-ds.xml b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore-ds.xml deleted file mode 100644 index ae5ea7c..0000000 --- a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore-ds.xml +++ /dev/null @@ -1,42 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<!-- The Derby embedded database JCA connection factory config --> -<!-- See http://www.jboss.org/community/wiki/Multiple1PC for information about local-tx-datasource --> -<!-- $Id: derby-ds.xml 97536 2009-12-08 14:05:07Z jesper.pedersen $ --> - -<datasources> - - <local-tx-datasource> - - <!-- The jndi name of the DataSource, it is prefixed with java:/ --> - <!-- Datasources are not available outside the virtual machine --> - <jndi-name>jdbc/PetstoreDB</jndi-name> - - <!-- for in-process persistent db, saved when jboss stops. The - org.jboss.jdbc.DerbyDatabase mbean is necessary for properly db shutdown --> - <connection-url>jdbc:derby://localhost:1527/petstore;create=true</connection-url> - - <!-- The driver class --> - <driver-class>org.apache.derby.jdbc.ClientDriver</driver-class> - - <!-- The login and password --> - <user-name>APP</user-name> - <password>APP</password> - - <!-- The minimum connections in a pool/sub-pool. Pools are lazily constructed on first use --> - <min-pool-size>5</min-pool-size> - - <!-- The maximum connections in a pool/sub-pool --> - <max-pool-size>20</max-pool-size> - - <!-- The time before an unused connection is destroyed --> - <idle-timeout-minutes>5</idle-timeout-minutes> - - <!-- Whether to check all statements are closed when the connection is returned to the pool, - this is a debugging feature that should be turned off in production --> - <track-statements/> - - </local-tx-datasource> - -</datasources> - diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/META-INF/application.xml b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/META-INF/application.xml deleted file mode 100644 index eadc0f4..0000000 --- a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/META-INF/application.xml +++ /dev/null @@ -1,19 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<application xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/application_1_4.xsd" version="1.4"> - - <display-name>Java Pet Store</display-name> - - <module> - <web> - <web-uri>petstore.war</web-uri> - <context-root>/petstore</context-root> - </web> - </module> - - <module> - <ejb>petstore-ejb.jar</ejb> - </module> - -</application> - diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore-ejb.jar/META-INF/persistence.xml b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore-ejb.jar/META-INF/persistence.xml deleted file mode 100644 index 76e0703..0000000 --- a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore-ejb.jar/META-INF/persistence.xml +++ /dev/null @@ -1,21 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd%22%3E - - <persistence-unit name="PetstorePu"> - <description>Petstore Persistence Unit</description> - <provider>org.hibernate.ejb.HibernatePersistence</provider> - <jta-data-source>java:jdbc/PetstoreDB</jta-data-source> - <non-jta-data-source>java:jdbc/PetstoreDB</non-jta-data-source> - <properties> - <property name="hibernate.dialect" value="org.hibernate.dialect.DerbyDialect"/> - <property name="hibernate.connection.username" value="APP"/> - <property name="hibernate.connection.password" value="APP"/> - <property name="hibernate.format_sql" value="true"/> - </properties> - </persistence-unit> - -</persistence> - diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore-ejb.jar/com/sun/javaee/blueprints/petstore/model/Address.class b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore-ejb.jar/com/sun/javaee/blueprints/petstore/model/Address.class deleted file mode 100644 index c9dc392..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore-ejb.jar/com/sun/javaee/blueprints/petstore/model/Address.class and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore-ejb.jar/com/sun/javaee/blueprints/petstore/model/Category.class b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore-ejb.jar/com/sun/javaee/blueprints/petstore/model/Category.class deleted file mode 100644 index be2275b..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore-ejb.jar/com/sun/javaee/blueprints/petstore/model/Category.class and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore-ejb.jar/com/sun/javaee/blueprints/petstore/model/Item.class b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore-ejb.jar/com/sun/javaee/blueprints/petstore/model/Item.class deleted file mode 100644 index 8842106..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore-ejb.jar/com/sun/javaee/blueprints/petstore/model/Item.class and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore-ejb.jar/com/sun/javaee/blueprints/petstore/model/Product.class b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore-ejb.jar/com/sun/javaee/blueprints/petstore/model/Product.class deleted file mode 100644 index dda3feb..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore-ejb.jar/com/sun/javaee/blueprints/petstore/model/Product.class and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore-ejb.jar/com/sun/javaee/blueprints/petstore/model/SellerContactInfo.class b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore-ejb.jar/com/sun/javaee/blueprints/petstore/model/SellerContactInfo.class deleted file mode 100644 index b5dbe74..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore-ejb.jar/com/sun/javaee/blueprints/petstore/model/SellerContactInfo.class and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore-ejb.jar/com/sun/javaee/blueprints/petstore/model/Tag.class b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore-ejb.jar/com/sun/javaee/blueprints/petstore/model/Tag.class deleted file mode 100644 index 1b5785b..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore-ejb.jar/com/sun/javaee/blueprints/petstore/model/Tag.class and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore-ejb.jar/com/sun/javaee/blueprints/petstore/model/ZipLocation.class b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore-ejb.jar/com/sun/javaee/blueprints/petstore/model/ZipLocation.class deleted file mode 100644 index 591af10..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore-ejb.jar/com/sun/javaee/blueprints/petstore/model/ZipLocation.class and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/META-INF/MANIFEST.MF b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/META-INF/MANIFEST.MF deleted file mode 100644 index 7a679c4..0000000 --- a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/META-INF/MANIFEST.MF +++ /dev/null @@ -1,4 +0,0 @@ -Manifest-Version: 1.0 -Ant-Version: Apache Ant 1.7.1 -Created-By: 16.0-b13 (Sun Microsystems Inc.) - diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/captcha/BlueFilter.class b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/captcha/BlueFilter.class deleted file mode 100644 index abac5a6..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/captcha/BlueFilter.class and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/captcha/CaptchaSingleton.class b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/captcha/CaptchaSingleton.class deleted file mode 100644 index 7d7af77..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/captcha/CaptchaSingleton.class and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/captcha/RandomString.class b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/captcha/RandomString.class deleted file mode 100644 index b8bfa4d..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/captcha/RandomString.class and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/captcha/SimpleCaptcha.class b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/captcha/SimpleCaptcha.class deleted file mode 100644 index 8c469f4..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/captcha/SimpleCaptcha.class and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/AddressBean.class b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/AddressBean.class deleted file mode 100644 index e2b4ca5..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/AddressBean.class and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/AutocompleteBean.class b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/AutocompleteBean.class deleted file mode 100644 index 223289e..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/AutocompleteBean.class and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/CaptchaValidateFilter.class b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/CaptchaValidateFilter.class deleted file mode 100644 index 61f3863..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/CaptchaValidateFilter.class and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/ControllerAction.class b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/ControllerAction.class deleted file mode 100644 index 7c149e3..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/ControllerAction.class and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/ControllerServlet.class b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/ControllerServlet.class deleted file mode 100644 index c5fb59a..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/ControllerServlet.class and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/EntryFilter.class b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/EntryFilter.class deleted file mode 100644 index 65d4cdb..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/EntryFilter.class and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/FileUploadBean.class b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/FileUploadBean.class deleted file mode 100644 index 1ee72ad..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/FileUploadBean.class and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/actions/CaptchaAction.class b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/actions/CaptchaAction.class deleted file mode 100644 index f56c35e..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/actions/CaptchaAction.class and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/actions/CatalogXmlAction.class b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/actions/CatalogXmlAction.class deleted file mode 100644 index 56fc53d..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/actions/CatalogXmlAction.class and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/actions/DefaultControllerAction.class b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/actions/DefaultControllerAction.class deleted file mode 100644 index ee55705..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/actions/DefaultControllerAction.class and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/actions/ImageAction.class b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/actions/ImageAction.class deleted file mode 100644 index 30e70ab..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/actions/ImageAction.class and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/actions/TagXmlAction.class b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/actions/TagXmlAction.class deleted file mode 100644 index dd5b7c1..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/actions/TagXmlAction.class and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/mapviewer/MapBean.class b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/mapviewer/MapBean.class deleted file mode 100644 index 03400b2..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/mapviewer/MapBean.class and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/model/CatalogFacade.class b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/model/CatalogFacade.class deleted file mode 100644 index 23a204c..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/model/CatalogFacade.class and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/model/FileUploadResponse.class b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/model/FileUploadResponse.class deleted file mode 100644 index 18f8102..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/model/FileUploadResponse.class and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/model/PayPalBean.class b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/model/PayPalBean.class deleted file mode 100644 index b6e2b0d..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/model/PayPalBean.class and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/model/RatingBean.class b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/model/RatingBean.class deleted file mode 100644 index be21196..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/model/RatingBean.class and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/proxy/GeoCoder.class b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/proxy/GeoCoder.class deleted file mode 100644 index 185dc01..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/proxy/GeoCoder.class and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/proxy/GeoPoint.class b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/proxy/GeoPoint.class deleted file mode 100644 index 18b3463..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/proxy/GeoPoint.class and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/search/HTMLParser$CallbackHandler.class b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/search/HTMLParser$CallbackHandler.class deleted file mode 100644 index 0c448bf..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/search/HTMLParser$CallbackHandler.class and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/search/HTMLParser.class b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/search/HTMLParser.class deleted file mode 100644 index 4a19fad..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/search/HTMLParser.class and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/search/IndexDocument.class b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/search/IndexDocument.class deleted file mode 100644 index a8b6521..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/search/IndexDocument.class and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/search/Indexer.class b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/search/Indexer.class deleted file mode 100644 index 2b42389..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/search/Indexer.class and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/search/SQLParser.class b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/search/SQLParser.class deleted file mode 100644 index 8ab0084..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/search/SQLParser.class and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/search/SearchBean.class b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/search/SearchBean.class deleted file mode 100644 index a4cc2bf..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/search/SearchBean.class and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/search/SearchIndex.class b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/search/SearchIndex.class deleted file mode 100644 index 50007c4..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/search/SearchIndex.class and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/search/UpdateIndex.class b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/search/UpdateIndex.class deleted file mode 100644 index 1ef9761..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/search/UpdateIndex.class and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/util/ImageScaler.class b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/util/ImageScaler.class deleted file mode 100644 index 5570fac..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/util/ImageScaler.class and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/util/LogStrings.properties b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/util/LogStrings.properties deleted file mode 100644 index 112905d..0000000 --- a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/util/LogStrings.properties +++ /dev/null @@ -1,10 +0,0 @@ -index.exception=An exception was encountered while indexing the data. Please checked to make sure there indexes are not locked by another user. -index.sql.statement=Select statement used for retrieving database data "{0}" -search.string=Searching indexes for string "{0}" -search.results=Search String returned "{0}" hits -search.exception=An exception was encountered while performing the search. Please check to make sure the indexes exist. -fileupload.persist.exception=Error persisting seller data -fileupload.rollback.exception=Persisting seller data, rollback failed -geocoder.lookup.exception=The GeoCode address lookup from Yahoo has returned and Exception -image_does_not_exist=The image doesn't exist in the default image directory or in the upload directory "{0}" -resource_bundle_does_not_exist=The MessageStrings.properties file does not exist!. diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/util/MessageStrings.properties b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/util/MessageStrings.properties deleted file mode 100644 index 7ca2d9d..0000000 --- a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/util/MessageStrings.properties +++ /dev/null @@ -1,10 +0,0 @@ -invalid_contact_firstname=First Name is required. -invalid_contact_lastname=Last Name is required. -invalid_address_street1=Street is required. -invalid_address_city=City is required. -invalid_address_state=State is required. -invalid_address_zip=Zip Code is required. -invalid_item_name=Pet Name is required. -invalid_item_description=The Description should exist and the field can't have a '<script>' and/or a '<link>' tag in it. -invalid_item_price=Price should should exist and be a number greater or equal to 0. -invalid_item_imageurl=The image upload file must exist and be of type '.jpg', '.gif' or '.png'. diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/util/PetstoreConstants.class b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/util/PetstoreConstants.class deleted file mode 100644 index 5aa4b42..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/util/PetstoreConstants.class and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/util/PetstoreUtil.class b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/util/PetstoreUtil.class deleted file mode 100644 index a521d71..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/util/PetstoreUtil.class and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/faces-config.xml b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/faces-config.xml deleted file mode 100644 index 22f03df..0000000 --- a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/faces-config.xml +++ /dev/null @@ -1,94 +0,0 @@ -<?xml version='1.0' encoding='UTF-8'?> - -<!-- Copyright 2006 Sun Microsystems, Inc. All rights reserved. You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at: - http://developer.sun.com/berkeley_license.html - $Id: faces-config.xml,v 1.13 2006/05/03 22:03:20 inder Exp $ --> - -<faces-config xmlns="http://java.sun.com/xml/ns/javaee" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd" - version="1.2"> - <!-- ========== Application Wide Features ================================ --> - - <!-- ========== Managed Beans ============================================ --> - <managed-bean> - <managed-bean-name>SearchBean</managed-bean-name> - <managed-bean-class>com.sun.javaee.blueprints.petstore.search.SearchBean</managed-bean-class> - <managed-bean-scope>session</managed-bean-scope> - </managed-bean> - - <managed-bean> - <managed-bean-name>RatingBean</managed-bean-name> - <managed-bean-class>com.sun.javaee.blueprints.petstore.model.RatingBean</managed-bean-class> - <managed-bean-scope>request</managed-bean-scope> - <managed-property> - <property-name>itemId</property-name> - <value>#{param.itemIdBinding}</value> - </managed-property> - </managed-bean> - - <managed-bean> - <managed-bean-name>PayPalBean</managed-bean-name> - <managed-bean-class>com.sun.javaee.blueprints.petstore.model.PayPalBean</managed-bean-class> - <managed-bean-scope>session</managed-bean-scope> - </managed-bean> - - <managed-bean> - <managed-bean-name>FileUploadBean</managed-bean-name> - <managed-bean-class>com.sun.javaee.blueprints.petstore.controller.FileUploadBean</managed-bean-class> - <managed-bean-scope>session</managed-bean-scope> - </managed-bean> - - <managed-bean> - <managed-bean-name>MapBean</managed-bean-name> - <managed-bean-class>com.sun.javaee.blueprints.petstore.mapviewer.MapBean</managed-bean-class> - <managed-bean-scope>session</managed-bean-scope> - </managed-bean> - - <managed-bean> - <managed-bean-name>AutocompleteBean</managed-bean-name> - <managed-bean-class>com.sun.javaee.blueprints.petstore.controller.AutocompleteBean</managed-bean-class> - <managed-bean-scope>session</managed-bean-scope> - </managed-bean> - - <managed-bean> - <managed-bean-name>AddressBean</managed-bean-name> - <managed-bean-class>com.sun.javaee.blueprints.petstore.controller.AddressBean</managed-bean-class> - <managed-bean-scope>session</managed-bean-scope> - </managed-bean> - - <!-- ========== Navigation Rules ========================================= --> - <navigation-rule> - <from-view-id>/mapLocation.jsp</from-view-id> - <navigation-case> - <from-outcome>map</from-outcome> - <to-view-id>/map.jsp</to-view-id> - </navigation-case> - </navigation-rule> - <navigation-rule> - <from-view-id>/mapAll.jsp</from-view-id> - <navigation-case> - <from-outcome>map</from-outcome> - <to-view-id>/map.jsp</to-view-id> - </navigation-case> - </navigation-rule> - <navigation-rule> - <from-view-id>/map.jsp</from-view-id> - <navigation-case> - <to-view-id>/mapLocation.jsp</to-view-id> - </navigation-case> - </navigation-rule> - <navigation-rule> - <from-view-id>/search.jsp</from-view-id> - <navigation-case> - <from-outcome>displayResults</from-outcome> - <to-view-id>/search.jsp</to-view-id> - </navigation-case> - <navigation-case> - <from-outcome>map</from-outcome> - <to-view-id>/map.jsp</to-view-id> - </navigation-case> - </navigation-rule> - -</faces-config> - diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/jboss-web.xml b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/jboss-web.xml deleted file mode 100644 index 0862993..0000000 --- a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/jboss-web.xml +++ /dev/null @@ -1,10 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<jboss-web> - <resource-ref> - <res-ref-name>jdbc/PetstoreDB</res-ref-name> - <res-type>javax.sql.DataSource</res-type> - <jndi-name>java:jdbc/PetstoreDB</jndi-name> - </resource-ref> -</jboss-web> - diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/bp-ui-5.jar b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/bp-ui-5.jar deleted file mode 100644 index f6bd6d2..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/bp-ui-5.jar and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/commons-fileupload-1.1.1.jar b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/commons-fileupload-1.1.1.jar deleted file mode 100644 index fc5763d..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/commons-fileupload-1.1.1.jar and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/commons-io-1.2.jar b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/commons-io-1.2.jar deleted file mode 100644 index b2867cd..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/commons-io-1.2.jar and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/commons-logging-1.1.jar b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/commons-logging-1.1.jar deleted file mode 100644 index 2ff9bbd..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/commons-logging-1.1.jar and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/jdom.jar b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/jdom.jar deleted file mode 100644 index 288e64c..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/jdom.jar and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/lucene-core-2.0.0.jar b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/lucene-core-2.0.0.jar deleted file mode 100644 index db6456f..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/lucene-core-2.0.0.jar and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/rome-0.8.jar b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/rome-0.8.jar deleted file mode 100644 index 27d2ad3..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/rome-0.8.jar and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/rome-fetcher-0.7.jar b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/rome-fetcher-0.7.jar deleted file mode 100644 index c2a26da..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/rome-fetcher-0.7.jar and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/shale-remoting.jar b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/shale-remoting.jar deleted file mode 100644 index 128045d..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/shale-remoting.jar and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/sun-web.xml b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/sun-web.xml deleted file mode 100644 index a9c411b..0000000 --- a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/sun-web.xml +++ /dev/null @@ -1,14 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE sun-web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Application Server 9.0 Servlet 2.5//EN" "http://www.sun.com/software/appserver/dtds/sun-web-app_2_5-0.dtd"> -<sun-web-app error-url=""> - <context-root>/petstore</context-root> - <class-loader delegate="true"/> - <jsp-config> - <property name="classdebuginfo" value="true"> - <description>Enable debug info compilation in the generated servlet class</description> - </property> - <property name="mappedfile" value="true"> - <description>Maintain a one-to-one correspondence between static content and the generated servlet class' java code</description> - </property> - </jsp-config> -</sun-web-app> diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/web.xml b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/web.xml deleted file mode 100644 index 6c65069..0000000 --- a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/web.xml +++ /dev/null @@ -1,126 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- Copyright 2006 Sun Microsystems, Inc. All rights reserved. You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at: - http://developer.sun.com/berkeley_license.html - $Id: web.xml,v 1.27 2007/04/18 19:25:09 smitha Exp $ --> -<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"> - - <display-name>Petstore</display-name> - <filter> - <filter-name>CaptchaValidateFilter</filter-name> - <filter-class>com.sun.javaee.blueprints.petstore.controller.CaptchaValidateFilter</filter-class> - </filter> - <filter> - <filter-name>EntryFilter</filter-name> - <filter-class>com.sun.javaee.blueprints.petstore.controller.EntryFilter</filter-class> - </filter> - <filter-mapping> - <filter-name>EntryFilter</filter-name> - <url-pattern>/*</url-pattern> - </filter-mapping> - <filter-mapping> - <filter-name>CaptchaValidateFilter</filter-name> - <url-pattern>/faces/dynamic/bpui_fileupload_handler/handleFileUpload</url-pattern> - </filter-mapping> - <listener> - <listener-class>com.sun.javaee.blueprints.petstore.model.CatalogFacade</listener-class> - </listener> - - <servlet> - <display-name>ControllerServlet</display-name> - <servlet-name>ControllerServlet</servlet-name> - <servlet-class>com.sun.javaee.blueprints.petstore.controller.ControllerServlet</servlet-class> - </servlet> - - <servlet-mapping> - <servlet-name>ControllerServlet</servlet-name> - <url-pattern>/catalog</url-pattern> - </servlet-mapping> - - <servlet-mapping> - <servlet-name>ControllerServlet</servlet-name> - <url-pattern>/controller</url-pattern> - </servlet-mapping> - - <context-param> - <description> - Google Maps authorization key for "http://localhost:8080/" - To use a another URL a new map key will have to be generated from http://www.google.com/apis/maps/ - </description> - <param-name>com.sun.j2ee.blueprints.ui.mapviewer.KEY</param-name> - <param-value>ABQIAAAAyQYKk4__l80DyIsqLPvvuxTwM0brOpm-All5BF6PoaKBxRWWERSt2NPUufvDhWGdrb-pCzTZQ2vi2A</param-value> - </context-param> - - <context-param> - <param-name>javax.faces.STATE_SAVING_METHOD</param-name> - <param-value>server</param-value> - </context-param> - - <context-param> - <param-name>com.sun.faces.validateXml</param-name> - <param-value>false</param-value> - </context-param> - - <context-param> - <param-name>com.sun.faces.verifyObjects</param-name> - <param-value>false</param-value> - </context-param> - - <context-param> - <param-name>javax.faces.CONFIG_FILES</param-name> - <param-value>/WEB-INF/faces-config.xml</param-value> - </context-param> - - <!-- proxy for mapviewer --> - <context-param> - <param-name>proxyHost</param-name> - <param-value></param-value> - </context-param> - <context-param> - <param-name>proxyPort</param-name> - <param-value></param-value> - </context-param> - <!-- filter init-param not working so use servlet context --> - <context-param> - <param-name>entryPages</param-name> - <param-value>.jpg|.gif|index.html|index.jsp|fileupload.jsp|search.jsp|catalog.jsp|mapAll.jsp|tag.jsp|news.jsp</param-value> - </context-param> - - - <!-- Faces Servlet --> - <servlet> - <servlet-name>Faces Servlet</servlet-name> - <servlet-class>javax.faces.webapp.FacesServlet</servlet-class> - <load-on-startup>1</load-on-startup> - </servlet> - - <!-- Faces Servlet Mapping --> - <servlet-mapping> - <servlet-name>Faces Servlet</servlet-name> - <url-pattern>/faces/*</url-pattern> - </servlet-mapping> - - <!-- need datasource for indexing Lucene search engine --> - <servlet-mapping> - <servlet-name>ControllerServlet</servlet-name> - <url-pattern>/faces/CaptchaServlet</url-pattern> - </servlet-mapping> - <servlet-mapping> - <servlet-name>ControllerServlet</servlet-name> - <url-pattern>/ImageServlet/*</url-pattern> - </servlet-mapping> - <servlet-mapping> - <servlet-name>ControllerServlet</servlet-name> - <url-pattern>/TagServlet/*</url-pattern> - </servlet-mapping> - <error-page> - <exception-type>java.lang.RuntimeException</exception-type> - <location>/systemerror.jsp</location> - </error-page> - <resource-ref> - <res-ref-name>jdbc/PetstoreDB</res-ref-name> - <res-type>javax.sql.DataSource</res-type> - <res-auth>Container</res-auth> - <res-sharing-scope>Shareable</res-sharing-scope> - </resource-ref> -</web-app> - diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/accordion.css b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/accordion.css deleted file mode 100644 index 14c6ed0..0000000 --- a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/accordion.css +++ /dev/null @@ -1 +0,0 @@ -.accordion { width:150px; height:400px; border-width:1px; border-style:solid; border-color:black; background:#404040; }
.accordionBody { width:160px; height:400px; border-width:1px; border-style:solid; border-color:black; background:#404040; }
.accordionTitle { vertical-align: top; padding-top: 10px; text-align: center; width:150px; height:90px; color:white; font-size:22px; font-weight: bold; background:black; opacity: .99; }
.accordionRow { color:white; cursor: pointer; font-size:18px; font-weight: bold; vertical-align: middle; padding-top: 5px; text-align: center; width:150px; height:40px; background:#104E8B; opacity: .99; }
.accordionProduct { text-align: center; width:150px; color:white; font-size:12px; font-weight: bold; background:#104E8B; opacity: .99; }
.accordionLink { cursor: pointer; text-decoration: none; color:white; }
.accordionLinkSelected { text-align: center; width:150px; color:red; font-size:12px; font-weight: bold; background:black; opacity: .99; }
.accordionLinkHover { text-decoration: underline; color:white; } \ No newline at end of file diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/accordion.js b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/accordion.js deleted file mode 100644 index 1c1ee6b..0000000 --- a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/accordion.js +++ /dev/null @@ -1,249 +0,0 @@ -/* Copyright 2006 Sun Microsystems, Inc. All rights reserved. You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at: http://developer.sun.com/berkeley_license.html -$Id: accordion.js,v 1.22 2006/05/03 22:00:32 inder Exp $ */ - -function AccordionMenu () { - - dojo.event.topic.subscribe("/accordion", this, this.handleEvent); - - var displayPortWidth = 100; - var HEIGHT = 400; - - var EXPANDED_HEIGHT = 125; - var ITEM_HEIGHT = 55; - var INCREMENT = 10; - - var timeout = 5; // in ms - - var accordion = document.getElementById("accordionBody"); - var divs = []; - var oExpandedIndex = -1; - var nExpandedIndex = -1; - var oHeight = ITEM_HEIGHT; - var nHeight = ITEM_HEIGHT; - var tHeight = 165; - var expanding = false; - var categories; - - // while control the inline debug statements - var debug = false; - var status = document.getElementById("status"); - - function Row(id, div, defaultHeight) { - this.id = id; - this.div = div; - //this.height = height; - this.h = defaultHeight; - this.div.style.height = defaultHeight + "px" - } - - Row.prototype.setHeight = function(nH) { - this.h = nH; - this.div.style.height = nH + "px"; - // re-adjust for ie in that it does not follow the boxmodel - if (this.div.offsetHeight > nH) { - this.div.style.height = (nH - (this.div.offsetHeight - nH)) + 'px'; - } - } - - Row.prototype.getTotalHeight = function() { - return this.div.offsetHeight; - } - - Row.prototype.getHeight = function() { - return this.h; - } - - this.handleEvent = function(args) { - if (args.type) { - if (args.type == 'expand') { - var targetRow = args.targetRow; - initiateExpansion(targetRow); - } - } - } - - this.load = function(lcategories) { - categories = lcategories; - // create all the rows - for (var l=0; l < categories.length; l++) { - var row = createRow(l,"accordionRow", ITEM_HEIGHT); - createLinks(row.div, categories[l].name, l, "accordionLink"); - divs.push(row); - } - } - - function showStatus() { - if (debug) { - var stat = "oExpandedIndex=" + oExpandedIndex + " " ; - for (var i=0; i < divs.length; i++) { - stat = stat + i + "=" + divs[i].getTotalHeight() + " "; - } - status.innerHTML = stat + " total height=" + accordion.offsetHeight; - var totalH = 0; - var tH = 0; - for (var i=0; i < divs.length; i++) { - totalH = totalH + divs[i].getHeight(); - tH = tH + divs[i].getTotalHeight(); - } - } - } - - this.showCategory = function(catid) { - for (var l=0; l < categories.length; l++) { - if (catid == categories[l].name) { - // now tell the scroller to load the first product - initiateExpansion(l); - if (categories[l].products[0]) { - dojo.event.topic.publish("/catalog", {type:"showProducts", productId:categories[l].products[0].id}); - } - break; - } - } - } - - this.showFirstCategory = function() { - initiateExpansion(0); - if (categories[0].products[0]) { - dojo.event.topic.publish("/catalog", {type:"showProducts", productId:categories[0].products[0].id}); - } - } - - this.loadCategoryItem = function(pid, itemId) { - // find the right product and expand the accordion - for (var l=0; l < categories.length; l++) { - // now tell the scroller to load the first product - for (var il=0; il < categories[l].products.length; il++) { - if (categories[l].products[il].id == pid ) { - initiateExpansion(l); - break; - } - } - } - dojo.event.topic.publish("/catalog", {type:"showItemDetails", productId: pid , itemId: itemId}); - } - - function initiateExpansion(id) { - // jump out if we are in progress - if (!expanding && oExpandedIndex != Number(id)) { - expanding = true; - nExpandedIndex = Number(id); - if (oExpandedIndex != -1) { - var targetDiv = divs[oExpandedIndex].div; - if (targetDiv && targetDiv.childNodes) { - for (var l = targetDiv.childNodes.length -1; l >= 0 ; l--) { - targetDiv.removeChild(targetDiv.childNodes[l]); - } - } - createLinks(divs[oExpandedIndex].div, categories[oExpandedIndex].name, oExpandedIndex, "accordionLink"); - } - expandRow(id); - } - } - - function expandRow() { - if (expanding) { - showStatus(); - // - if (nHeight < EXPANDED_HEIGHT) { - nHeight = nHeight + INCREMENT; - divs[nExpandedIndex].setHeight(nHeight); - if (oExpandedIndex != -1) { - if (tHeight >= ITEM_HEIGHT) { - oHeight = oHeight - INCREMENT; - // take all out of the old expanded - } else { - oHeight = oHeight - INCREMENT; - } - divs[oExpandedIndex].setHeight(oHeight); - } - // default exapnd here - } else if (oExpandedIndex != -1 && oHeight > ITEM_HEIGHT) { - oHeight = oHeight - INCREMENT; - divs[oExpandedIndex].setHeight(oHeight); - } else { - // set the contents of the new menu - var targetDiv = divs[nExpandedIndex].div; - if (targetDiv && targetDiv.childNodes) { - for (var l = targetDiv.childNodes.length -1; l >= 0 ; l--) { - targetDiv.removeChild(targetDiv.childNodes[l]); - } - } - divs[nExpandedIndex].div.appendChild(document.createTextNode(categories[nExpandedIndex].name)); - divs[nExpandedIndex].div.appendChild(document.createElement("p")); - for (var l= 0; l < categories[nExpandedIndex].products.length; l++) { - var span = document.createElement("span"); - span.className = "accordionProduct"; - var link = document.createElement("a"); - var target = categories[nExpandedIndex].products[l].id; - link.id = target; - link.className = "accordionLink"; - // some browsers aren't setting the styles for hovers so forcing them - link.setAttribute("onmouseover", "this.className='accordionLinkHover';"); - link.setAttribute("onmouseout", "this.className='accordionLink';"); - dojo.event.connect(link, "onclick", function(evt) { - this._target = target - var src; - if (evt.target) { - src = evt.target; - } else if (evt.srcElement) { - src = evt.srcElement; - } - //src.parentNode.className = "accordionLinkSelected"; - // set this so the next time around it can be removed; - dojo.event.topic.publish("/catalog", {type:"showProducts", productId:src.id}); - }); - link.appendChild(document.createTextNode(categories[nExpandedIndex].products[l].name)); - span.appendChild(link); - divs[nExpandedIndex].div.appendChild(span); - if (l < categories[nExpandedIndex].products.length - 1) { - divs[nExpandedIndex].div.appendChild(document.createElement("p")); - } - link = null; - } - expanding = false; - oExpandedIndex = nExpandedIndex; - nExpandedIndex = -1; - oHeight = nHeight; - nHeight = ITEM_HEIGHT; - return; - } - - setTimeout(expandRow, timeout); - } - } - - function createLinks(tDiv, text, id, linkStyle) { - var link = document.createElement("a"); - link.className = linkStyle; - link.appendChild(document.createTextNode(text)); - link.setAttribute("id", id); - if (link.attachEvent) { - link.attachEvent('onmouseover',function(e){initiateExpansion(e.srcElement.getAttribute("id"));}); - } else if (link.addEventListener) { - link.addEventListener('mouseover',function(e){initiateExpansion(e.currentTarget.getAttribute("id"));}, true); - } - tDiv.appendChild(link); - } - - function createRow(id, rowStyle, height) { - var nDiv = document.createElement("div"); - nDiv.className = rowStyle; - var row; - var cell; - if (accordion.insertRow) { - row = accordion.insertRow(accordion.rows.length); - - } else { - row = document.createElement("tr"); - accordion.appendChild(row); - } - if (row.inserCell) { - cell = row.insertCell(0); - } else { - cell = document.createElement("td"); - row.appendChild(cell); - } - cell.appendChild(nDiv); - return new Row(id, nDiv, height); - } -} diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/banner.jsp b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/banner.jsp deleted file mode 100644 index c43dd98..0000000 --- a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/banner.jsp +++ /dev/null @@ -1,80 +0,0 @@ -<%-- Copyright 2006 Sun Microsystems, Inc. All rights reserved. You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at: http://developer.sun.com/berkeley_license.html -$Id: banner.jsp,v 1.28 2006/12/19 20:23:53 yutayoshida Exp $ --%> - -<%@page contentType="text/html"%> -<%@page pageEncoding="UTF-8"%> - -<%@taglib prefix="f" uri="http://java.sun.com/jsf/core%22%%3E -<%@taglib prefix="h" uri="http://java.sun.com/jsf/html%22%%3E -<%@taglib prefix="ui" uri="http://java.sun.com/blueprints/ui" %> - -<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/styles.css"></link> -<script type="text/javascript" src="${pageContext.request.contextPath}/faces/static/META-INF/dojo/bpcatalog/dojo.js"></script> -<script type="text/javascript" src="${pageContext.request.contextPath}/faces/static/META-INF/rss/rssbar.js"></script> -<link type="text/css" rel="stylesheet" href="${pageContext.request.contextPath}/faces/static/META-INF/rss/rssbar.css" /> -<style type="text/css"> - -#rss-bar { - margin: 0 auto 0px; -} - -#rss-bar table td#rss-channel { - background-repeat: no-repeat; - background-position: top left; - font-size: 14px; - font-weight: bold; - vertical-align: top; - text-align: center; - width: 254px; -} - -#rss-bar table td#rss-item { - background-repeat: no-repeat; - font-size: 14px; - width: 534px; - text-align: left; -} - -#rss-bar table a { - color: white; - text-decoration: none; -} -#rss-bar table a:hover { color: #ffff00;} - -</style> -<script type="text/javascript"> - var rss = new bpui.RSS(); - dojo.addOnLoad(function(){rss.getRssInJson('${pageContext.request.contextPath}/faces/dynamic/bpui_rssfeedhandler/getRssfeed', 'https://blueprints.dev.java.net/servlets/ProjectRSS?type=news', '4', '4000', 'News from BluePrints', 'news.jsp');}); -</script> - -<table border="0" bordercolor="gray" cellpadding="0" cellspacing="0" bgcolor="white" width="100%"> - <tr id="injectionPoint"> - <td width="100"><a class="menuLink" href="${pageContext.request.contextPath}/faces/index.jsp""><img src="${pageContext.request.contextPath}/images/banner_logo.gif" border="0" width="70" height="70"></a></td> - <td align="left"> - <div class="banner">Java Pet Store</div> - </td> - <td id="bannerRight" align="right"> - <a class="menuLink" onmouseover="this.className='menuLinkHover';" onmouseout="this.className='menuLink';" href="${pageContext.request.contextPath}/faces/fileupload.jsp">Seller</a> <span class="menuItem">|</span> - <a class="menuLink" onmouseover="this.className='menuLinkHover';" onmouseout="this.className='menuLink';" href="${pageContext.request.contextPath}/faces/search.jsp">Search</a> <span class="menuItem">|</span> - <a class="menuLink" onmouseover="this.className='menuLinkHover';" onmouseout="this.className='menuLink';" href="${pageContext.request.contextPath}/faces/catalog.jsp">Catalog</a> <span class="menuItem">|</span> - <a class="menuLink" onmouseover="this.className='menuLinkHover';" onmouseout="this.className='menuLink';" href="${pageContext.request.contextPath}/faces/mapAll.jsp">Map</a> <span class="menuItem">|</span> - <a class="menuLink" onmouseover="this.className='menuLinkHover';" onmouseout="this.className='menuLink';" href="${pageContext.request.contextPath}/faces/tag.jsp">Tags</a> <span class="menuItem">|</span> - <a class="menuLink" onmouseover="this.className='menuLinkHover';" onmouseout="this.className='menuLink';" href="${pageContext.request.contextPath}/faces/index.jsp">Home</a> - </td> - </tr> - </tr> - <tr bgcolor="gray"> - <td id="menubar" align="left" colspan="3" height="25" > - <div id="rss-bar"> - <table border="0" cellpadding="0" cellspacing="0"> - <tr> - <td id="rss-channel" nowrap="true"></td> - <td id="rss-item" nowrap="true"></td> - </tr> - </table> - </div> - </td> - </tr> - </table> - - diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/bp_petstorelist.css b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/bp_petstorelist.css deleted file mode 100644 index 5c906b5..0000000 --- a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/bp_petstorelist.css +++ /dev/null @@ -1,48 +0,0 @@ -.bpui_petstorelist_dataDiv { - border-style: groove; - overflow: auto; - width: 600px; - height: 500px; - padding: 10px; -} - -.bpui_petstorelist_pageDiv { -} - - -.bpui_petstorelist_table { -} - -.bpui_petstorelist_cell { - padding: 5px; - vertical-align: top; -} - -.bpui_petstorelist_row { - border-bottom: dotted; -} - -.bpui_petstorelist_hr { - width: 90%; -} - -.bpui_petstorelist_image { -} - -.bpui_petstorelist_link{ -} - -.bpui_petstorelist_name{ -} - -.bpui_petstorelist_description{ -} - -.bpui_petstorelist_price { -} - -.bpui_petstorelist_previous { -} - -.bpui_petstorelist_next { -} diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/bp_petstorelist.js b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/bp_petstorelist.js deleted file mode 100644 index 4df46fb..0000000 --- a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/bp_petstorelist.js +++ /dev/null @@ -1,269 +0,0 @@ -var bpui; -if(typeof bpui == "undefined") { - bpui=new Object(); -} -bpui.petstoreList=new Object(); - -bpui.petstoreList.divName=""; -bpui.petstoreList.currentCount=0; -bpui.petstoreList.numberPerPage=5; -bpui.petstoreList.category="feline01"; -bpui.petstoreList.cachedData=new Object(); -bpui.petstoreList.debug=false; -bpui.petstoreList.timer; - -bpui.petstoreList.initialSetup=function() { - // get outerdiv - var targetDiv=document.getElementById(bpui.petstoreList.divName); - - // containier div - tablex="<table><tr><td align="center">"; - tablex += "<b>Java BluePrint's Pet Store Category:</b> <select size="1" id="bpui.petstoreList.categoryList" onchange="bpui.petstoreList.selectCategory()">"; - tablex += "<option value="loading">Loading Data...</option>"; - tablex += "</select>"; - tablex += "</td></tr><tr><td><div id="bpui.petstoreList.dataDiv" class="bpui_petstorelist_dataDiv">"; - tablex += "</div>"; - - // add product previous and next - tablex += "</td></tr>"; - tablex += "<tr><td colspan="3" style="text-align:center;">"; - tablex += "<div id="bpui.petstoreList.pageDiv" class="bpui_petstorelist_pageDiv">"; - tablex += "</div>"; - tablex += "</td></tr>"; - // add in debug div, if debugging - if(bpui.petstoreList.debug) { - tablex += "<tr><td colspan="3">"; - tablex += "<div id="bpui.petstoreList.debugDiv">"; - tablex += "</div>"; - tablex += "</td></tr>"; - } - tablex += "</table>"; - targetDiv.innerHTML=tablex; - bpui.petstoreList.setSelectedCategory(); -} - - -bpui.petstoreList.populateData=function(datax) { - // clear response timer - clearTimeout(bpui.petstoreList.timer); - - if(typeof datax != "undefined") { - // check to see if at last page and no data is returned - if(datax.length < 1) { - alert("At last page for category!"); - // keep currentCount correct by removing the increment that was added - bpui.petstoreList.currentCount -= bpui.petstoreList.numberPerPage; - } else { - // add data to cache if it doesn't already exist - // if a full set isn't returned don't cache it, so the data will be retrieved again from the server. - // This is optional, you have to weigh the performance hit with the consiquences of not doing an update - key=bpui.petstoreList.category + "|" + bpui.petstoreList.currentCount; - cachedSet=bpui.petstoreList.cachedData[key]; - if(typeof cachedSet == "undefined" && datax.length >= bpui.petstoreList.numberPerPage) { - // need to cache data - if(bpui.petstoreList.debug) bpui.petstoreList.debugMessage("Adding cache data by key: " + key); - bpui.petstoreList.cachedData[key]=datax; - } - - // get outerdiv - var targetDiv=document.getElementById("bpui.petstoreList.dataDiv"); - - // containier div - tablex="<table class="bpui_petstorelist_table">"; - tablex += "<tr class="bpui_petstorelist_row">"; - tablex += "<th class="bpui_petstorelist_cell">Pet Image</td>"; - tablex += "<th class="bpui_petstorelist_cell">Name & Description</td>"; - tablex += "<th class="bpui_petstorelist_cell">Price ($)</td>"; - tablex += "</tr>"; - - // loop through product results - for(ii=0; ii < datax.length; ii++) { - // add row - tablex += "<tr class="bpui_petstorelist_row"><td class="bpui_petstorelist_cell">"; - tablex += "<a class="bpui_petstorelist_image" target="_blank" href="http://localhost:8080/petstore/faces/catalog.jsp#" + - datax[ii].productID + "," + datax[ii].itemID + "">"; - - tablex += "<img src="http://localhost:8080/petstore/ImageServlet/" + datax[ii].imageThumbURL + ""/>"; - - tablex += "</a>"; - tablex += "</td><td class="bpui_petstorelist_cell">"; - tablex += "<a class="bpui_petstorelist_link" target="_blank" href="http://localhost:8080/petstore/faces/catalog.jsp#" + - datax[ii].productID + "," + datax[ii].itemID + "">"; - tablex += "<span class="bpui_petstorelist_name">" + datax[ii].name + "</span><br/>"; - tablex += "</a>"; - tablex += "<span class="bpui_petstorelist_description">" + datax[ii].description + "</span>"; - tablex += "</td><td class="bpui_petstorelist_cell">"; - - // add product price - tablex += "<span class="bpui_petstorelist_price">$" + datax[ii].price + "</span><br/>"; - tablex += "</td></tr>"; - tablex += "<tr><td colspan="3"><hr class="bpui_petstorelist_hr" /></td></tr>"; - } - - tablex += "</table>"; - targetDiv.innerHTML=tablex; - } - - // setup previous next buttons - pagex=""; - var targetDiv=document.getElementById("bpui.petstoreList.pageDiv"); - if(bpui.petstoreList.currentCount >= bpui.petstoreList.numberPerPage) { - // add previous - pagex += "<span class="bpui_petstorelist_previous" onclick="bpui.petstoreList.previousProducts();"><< PREVIOUS</span> "; - } - if(datax.length == bpui.petstoreList.numberPerPage) { - // add next only if full page has been returned. Need to change when add cache ??? - pagex += "<span class="bpui_petstorelist_next" onclick="bpui.petstoreList.nextProducts();">NEXT >></span><br/>"; - } - targetDiv.innerHTML=pagex; - } -} - -bpui.petstoreList.setSelectedCategory=function() { - catx=document.getElementById("bpui.petstoreList.categoryList"); - for(ii=0; ii < catx.length; ii++) { - if(catx.options[ii].value == bpui.petstoreList.category) { - catx.options[ii].selected=true; - } - } -} - -bpui.petstoreList.selectCategory=function() { - catx=document.getElementById("bpui.petstoreList.categoryList"); - bpui.petstoreList.category=catx.value; - - bpui.petstoreList.currentCount=0; - bpui.petstoreList.updateProducts(); -} - - -bpui.petstoreList.nextProducts=function() { - // load data from service - bpui.petstoreList.currentCount += bpui.petstoreList.numberPerPage; - bpui.petstoreList.updateProducts(); -} - -bpui.petstoreList.previousProducts=function() { - bpui.petstoreList.currentCount -= bpui.petstoreList.numberPerPage; - if(bpui.petstoreList.currentCount < 0) { - bpui.petstoreList.currentCount=0; - } - bpui.petstoreList.updateProducts(); -} - - -bpui.petstoreList.updateProducts=function() { - // check to see if in cache - key=bpui.petstoreList.category + "|" + bpui.petstoreList.currentCount; - cachedSet=bpui.petstoreList.cachedData[key]; - // see if data in cache - if(typeof cachedSet != "undefined") { - // get data from cache - if(bpui.petstoreList.debug) bpui.petstoreList.debugMessage("Pulling data from cache using: " + key + " with " + cachedSet.length + " items."); - bpui.petstoreList.populateData(cachedSet); - } else { - // load data from service - if(bpui.petstoreList.debug) bpui.petstoreList.debugMessage("Retrieving data from service for : " + bpui.petstoreList.category + " starting at item " + bpui.petstoreList.currentCount); - - // set degradation timeout - bpui.petstoreList.timer=setTimeout('bpui.petstoreList.requestTimedOut()', 20000); - - // create dynamic script - bodyTag=document.getElementsByTagName("body")[0]; - scriptx=document.createElement("script"); - scriptx.setAttribute("type", "text/javascript"); - scriptx.setAttribute("src", "http://localhost:8080/petstore/catalog?command=items&pid=" + bpui.petstoreList.category + "&start=" + bpui.petstoreList.currentCount + "&length=" + bpui.petstoreList.numberPerPage + "&format=jsonp&callback=bpui.petstoreList.populateData"); - bodyTag.appendChild(scriptx); - } -} - - -bpui.petstoreList.createPetstoreList=function(divName, numberPerPage) { - // keep divName for later references - bpui.petstoreList.divName=divName; - - // see if numberPerPage defined - if(typeof numberPerPage != "undefined") { - bpui.petstoreList.numberPerPage=numberPerPage; - } - - // setup static elements - bpui.petstoreList.initialSetup(); - - // set timer to make sure service look up returns. Eventhough the Javascript library was able to be fetched, the database could be down or the - // service could be responding very slowly and the request timeout. Wait for 30 seconds and then set data div to service may not be responding message. - // Since both calls hit the database, if one returns propertly the other should also. - bpui.petstoreList.timer=setTimeout('bpui.petstoreList.requestTimedOut()', 20000); - - // load categories from service - bodyTag=document.getElementsByTagName("body")[0]; - scriptx=document.createElement("script"); - scriptx.setAttribute("type", "text/javascript"); - scriptx.setAttribute("src", "http://localhost:8080/petstore/catalog?command=categories&format=jsonp&a..."); - bodyTag.appendChild(scriptx); - - // load pet data from service - bodyTag=document.getElementsByTagName("body")[0]; - scriptx=document.createElement("script"); - scriptx.setAttribute("type", "text/javascript"); - scriptx.setAttribute("src", "http://localhost:8080/petstore/catalog?command=items&pid=" + bpui.petstoreList.category + "&start=0&length=" + bpui.petstoreList.numberPerPage + "&format=jsonp&callback=bpui.petstoreList.populateData"); - bodyTag.appendChild(scriptx); -} - - -bpui.petstoreList.requestTimedOut=function() { - document.getElementById("bpui.petstoreList.dataDiv").innerHTML="<b><font color="#0000FF">The Java BluePrint's Pet Store JSONP Service is either responding very slowly or not responding at all! Please check with the service provider for more information.</font></b>"; -} - - - -bpui.petstoreList.debugMessage=function(messx) { - targetDiv=document.getElementById("bpui.petstoreList.debugDiv"); - targetDiv.innerHTML=messx + "<br/>" + targetDiv.innerHTML; -} - - -bpui.petstoreList.populateCategory=function(datax) { - // clear response timer - clearTimeout(bpui.petstoreList.timer); - - if(typeof datax != "undefined") { - catx=document.getElementById("bpui.petstoreList.categoryList"); - countx=0; - // loop through top level categories - for(ii=0; ii < datax.length; ii++) { - // loop through individual categories - for(yy=0; yy < datax[ii].products.length; yy++) { - // set default value for select list - bCurrentSelect=false - if(datax[ii].products[yy].id == bpui.petstoreList.category) { - bCurrentSelect=true; - } - catx.options[countx]=new Option(datax[ii].products[yy].name, datax[ii].products[yy].id, false, bCurrentSelect); - countx++; - } - } - } -} - - -bpui.petstoreList.hackerExample=function() { - /* - bodyTag=document.getElementsByTagName("body")[0]; - iframex=document.createElement("iframe"); - iframex.setAttribute("src", "http://localhost:8080/bp-clientside-mashup/show.jsp?cookies=" + escape(document.cookie)); - bodyTag.appendChild(iframex); - */ - // load pet data from service - - bodyTag=document.getElementsByTagName("body")[0]; - scriptx=document.createElement("script"); - scriptx.setAttribute("type", "text/javascript"); - scriptx.setAttribute("src", "http://localhost:8080/bp-clientside-mashup/show.jsp?cookies=" + escape(document.cookie)); - bodyTag.appendChild(scriptx); - - -} - - - diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/bp_petstorelist_dom.js b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/bp_petstorelist_dom.js deleted file mode 100644 index d00e427..0000000 --- a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/bp_petstorelist_dom.js +++ /dev/null @@ -1,136 +0,0 @@ -var bpui; -if(typeof bpui == "undefined") { - bpui=new Object(); -} -bpui.petstoreList=new Object(); - -bpui.petstoreList.divName=""; -bpui.petstoreList.currentCount=0; - -bpui.petstoreList.populateData=function(datax) { - if(typeof datax != "undefined") { - - // get outerdiv - var targetDiv=document.getElementById(bpui.petstoreList.divName); - - // make sure div is clear - targetDiv.innerHTML=""; - - // add class to containing div - targetDiv.setAttribute("class", "bpui_petstorelist_div") - - // add table - tablex=document.createElement("table"); - tablex.setAttribute("class", "bpui_petstorelist_table") - targetDiv.appendChild(tablex); - - // loop through product results - for(ii=0; ii < datax.length; ii++) { - // add row - rowx=document.createElement("tr"); - - // add product image with hyperlink - colx=document.createElement("td"); - ax=document.createElement("a"); - ax.setAttribute("href", "http://localhost:8080/petstore/faces/catalog.jsp#" + datax[ii].productID + "," + datax[ii].itemID) - ax.setAttribute("target", "bppetstore") - ax.setAttribute("class", "bpui_petstorelist_image") - imgx=document.createElement("img"); - imgx.setAttribute("src", "http://localhost:8080/petstore/ImageServlet/" + datax[ii].imageThumbURL); - ax.appendChild(imgx); - colx.appendChild(ax); - rowx.appendChild(colx); - - // add product name with hyperlink - colx=document.createElement("td"); - ax=document.createElement("a"); - ax.setAttribute("href", "http://localhost:8080/petstore/faces/catalog.jsp#" + datax[ii].productID + "," + datax[ii].itemID) - ax.setAttribute("target", "bppetstore") - ax.setAttribute("class", "bpui_petstorelist_name_link") - spanx=document.createElement("span"); - spanx.setAttribute("class", "bpui_petstorelist_name") - spanx.appendChild(document.createTextNode(datax[ii].name)); - ax.appendChild(spanx); - colx.appendChild(ax); - colx.appendChild(document.createElement("br")); - // add product description - spanx=document.createElement("span"); - spanx.setAttribute("class", "bpui_petstorelist_description"); - spanx.appendChild(document.createTextNode(datax[ii].description)); - colx.appendChild(spanx); - rowx.appendChild(colx); - - // add product price - colx=document.createElement("td"); - spanx=document.createElement("span"); - spanx.setAttribute("class", "bpui_petstorelist_price"); - spanx.appendChild(document.createTextNode("$" + datax[ii].price)); - colx.appendChild(spanx); - rowx.appendChild(colx); - - // add row to table - tablex.appendChild(rowx); - } - - // add product previous and next - rowx=document.createElement("tr"); - colx=document.createElement("td"); - colx.setAttribute("colspan", "3"); - spanx=document.createElement("span"); - spanx.setAttribute("class", "bpui_petstorelist_previous"); - spanx.setAttribute("onclick", "bpui.petstoreList.previousProducts();"); - spanx.appendChild(document.createTextNode("<< PREVIOUS")); - colx.appendChild(spanx); - - spanx=document.createElement("span"); - spanx.setAttribute("class", "bpui_petstorelist_next"); - spanx.setAttribute("onclick", "bpui.petstoreList.nextProducts();"); - spanx.appendChild(document.createTextNode("NEXT >>")); - colx.appendChild(spanx); - rowx.appendChild(colx); - - // add row to table - tablex.appendChild(rowx); - } -} - - -bpui.petstoreList.nextProducts=function() { - // load data from service - bpui.petstoreList.currentCount += 5; - bpui.petstoreList.updateProducts(); -} - - -bpui.petstoreList.previousProducts=function() { - bpui.petstoreList.currentCount -= 5; - if(bpui.petstoreList.currentCount < 0) { - bpui.petstoreList.currentCount=0; - } - bpui.petstoreList.updateProducts(); -} - - -bpui.petstoreList.updateProducts=function() { - // load data from service - bodyTag=document.getElementsByTagName("body")[0]; - scriptx=document.createElement("script"); - scriptx.setAttribute("type", "text/javascript"); - scriptx.setAttribute("src", "http://localhost:8080/petstore/catalog?command=items&pid=feline01&st..." + bpui.petstoreList.currentCount + "&length=5&format=jsonp"); - bodyTag.appendChild(scriptx); -} - - - -bpui.petstoreList.createPetstoreList=function(divName) { - // keep divName for later references - bpui.petstoreList.divName=divName; - - // load data from service - bodyTag=document.getElementsByTagName("body")[0]; - scriptx=document.createElement("script"); - scriptx.setAttribute("type", "text/javascript"); - scriptx.setAttribute("src", "http://localhost:8080/petstore/catalog?command=items&pid=feline01&st..."); - bodyTag.appendChild(scriptx); -} - diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/bp_petstorelist_one_div.js b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/bp_petstorelist_one_div.js deleted file mode 100644 index 9b18cb4..0000000 --- a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/bp_petstorelist_one_div.js +++ /dev/null @@ -1,159 +0,0 @@ -var bpui; -if(typeof bpui == "undefined") { - bpui=new Object(); -} -bpui.petstoreList=new Object(); - -bpui.petstoreList.divName=""; -bpui.petstoreList.currentCount=0; -bpui.petstoreList.category="feline01"; - - -bpui.petstoreList.initialSetup=function() { - // get outerdiv - var targetDiv=document.getElementById(bpui.petstoreList.divName); - - // containier div - tablex="<table><tr><td align="center">"; - tablex += "<b>Java BluePrint's Pet Store Category:</b> <select size="1" id="bpui.petstoreList.categoryList" onchange="bpui.petstoreList.selectCategory()">"; - tablex += "<option value="feline01">Hairy Cat</option>"; - tablex += "<option value="feline02">Groomed Cat</option>"; - tablex += "<option value="canine01">Medium Dogs</option>"; - tablex += "<option value="canine02">Small Dogs</option>"; - tablex += "<option value="avian01">Parrot</option>"; - tablex += "<option value="avian02">Exotic</option>"; - tablex += "<option value="fish01">Small Fish</option>"; - tablex += "<option value="fish02">Large Fish</option>"; - tablex += "<option value="reptile01">Slithering Reptiles</option>"; - tablex += "<option value="reptile02">Crawling Reptiles</option>"; - tablex += "</select>"; - tablex += "</td></tr><tr><td><div class="bpui_petstorelist_div">"; - tablex += "</div>"; - - // add product previous and next - tablex += "</td></tr>"; - tablex += "<tr><td colspan="3" style="text-align:center;">"; - tablex += "<span class="bpui_petstorelist_previous" onclick="bpui.petstoreList.previousProducts();"><< PREVIOUS</span> "; - tablex += "<span class="bpui_petstorelist_next" onclick="bpui.petstoreList.nextProducts();">NEXT >></span><br/>"; - tablex += "</td></tr>"; - tablex += "</table>"; - targetDiv.innerHTML=tablex; - bpui.petstoreList.setSelectedCategory(); -} - -bpui.petstoreList.populateData=function(datax) { - if(typeof datax != "undefined") { - - // get outerdiv - var targetDiv=document.getElementById(bpui.petstoreList.divName); - - // containier div - tablex="<table><tr><td align="center">"; - tablex += "<b>Java BluePrint's Pet Store Category:</b> <select size="1" id="bpui.petstoreList.categoryList" onchange="bpui.petstoreList.selectCategory()">"; - tablex += "<option value="feline01">Hairy Cat</option>"; - tablex += "<option value="feline02">Groomed Cat</option>"; - tablex += "<option value="canine01">Medium Dogs</option>"; - tablex += "<option value="canine02">Small Dogs</option>"; - tablex += "<option value="avian01">Parrot</option>"; - tablex += "<option value="avian02">Exotic</option>"; - tablex += "<option value="fish01">Small Fish</option>"; - tablex += "<option value="fish02">Large Fish</option>"; - tablex += "<option value="reptile01">Slithering Reptiles</option>"; - tablex += "<option value="reptile02">Crawling Reptiles</option>"; - tablex += "</select>"; - tablex += "</td></tr><tr><td><div class="bpui_petstorelist_div">"; - - tablex += "<table class="bpui_petstorelist_table">"; - - // loop through product results - for(ii=0; ii < datax.length; ii++) { - // add row - tablex += "<tr class="bpui_petstorelist_row"><td class="bpui_petstorelist_cell">"; - tablex += "<a class="bpui_petstorelist_image" target="bppetstore" href="http://localhost:8080/petstore/faces/catalog.jsp#" + - datax[ii].productID + "," + datax[ii].itemID + "">"; - - tablex += "<img src="http://localhost:8080/petstore/ImageServlet/" + datax[ii].imageThumbURL + ""/>"; - - tablex += "</a>"; - tablex += "</td><td class="bpui_petstorelist_cell">"; - tablex += "<a class="bpui_petstorelist_link" target="bppetstore" href="http://localhost:8080/petstore/faces/catalog.jsp#" + - datax[ii].productID + "," + datax[ii].itemID + "">"; - tablex += "<span class="bpui_petstorelist_name">" + datax[ii].name + "</span><br/>"; - tablex += "</a>"; - tablex += "<span class="bpui_petstorelist_description">" + datax[ii].description + "</span>"; - tablex += "</td><td class="bpui_petstorelist_cell">"; - - // add product price - tablex += "<span class="bpui_petstorelist_price">$" + datax[ii].price + "</span><br/>"; - tablex += "</td></tr>"; - tablex += "<tr><td colspan="3"><hr class="bpui_petstorelist_hr" /></td></tr>"; - } - - tablex += "</table></div>"; - - // add product previous and next - tablex += "</td></tr>"; - tablex += "<tr><td colspan="3" style="text-align:center;">"; - tablex += "<span class="bpui_petstorelist_previous" onclick="bpui.petstoreList.previousProducts();"><< PREVIOUS</span> "; - tablex += "<span class="bpui_petstorelist_next" onclick="bpui.petstoreList.nextProducts();">NEXT >></span><br/>"; - tablex += "</td></tr>"; - tablex += "</table>"; - targetDiv.innerHTML=tablex; - bpui.petstoreList.setSelectedCategory(); - } -} - -bpui.petstoreList.setSelectedCategory=function() { - catx=document.getElementById("bpui.petstoreList.categoryList"); - for(ii=0; ii < catx.length; ii++) { - if(catx.options[ii].value == bpui.petstoreList.category) { - catx.options[ii].selected=true; - } - } -} - - -bpui.petstoreList.selectCategory=function() { - catx=document.getElementById("bpui.petstoreList.categoryList"); - bpui.petstoreList.category=catx.value; - - bpui.petstoreList.currentCount=0; - bpui.petstoreList.updateProducts(); -} - - -bpui.petstoreList.nextProducts=function() { - // load data from service - bpui.petstoreList.currentCount += 5; - bpui.petstoreList.updateProducts(); -} - -bpui.petstoreList.previousProducts=function() { - bpui.petstoreList.currentCount -= 5; - if(bpui.petstoreList.currentCount < 0) { - bpui.petstoreList.currentCount=0; - } - bpui.petstoreList.updateProducts(); -} - -bpui.petstoreList.updateProducts=function() { - // load data from service - bodyTag=document.getElementsByTagName("body")[0]; - scriptx=document.createElement("script"); - scriptx.setAttribute("type", "text/javascript"); - scriptx.setAttribute("src", "http://localhost:8080/petstore/catalog?command=items&pid=" + bpui.petstoreList.category + "&start=" + bpui.petstoreList.currentCount + "&length=5&format=jsonp"); - bodyTag.appendChild(scriptx); -} - -bpui.petstoreList.createPetstoreList=function(divName) { - // keep divName for later references - bpui.petstoreList.divName=divName; - - // load data from service - bodyTag=document.getElementsByTagName("body")[0]; - scriptx=document.createElement("script"); - scriptx.setAttribute("type", "text/javascript"); - scriptx.setAttribute("src", "http://localhost:8080/petstore/catalog?command=items&pid=" + bpui.petstoreList.category + "&start=0&length=5&format=jsonp"); - bodyTag.appendChild(scriptx); - -} diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/captchaerror.jsp b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/captchaerror.jsp deleted file mode 100644 index 60ef953..0000000 --- a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/captchaerror.jsp +++ /dev/null @@ -1,23 +0,0 @@ -<%-- Copyright 2006 Sun Microsystems, Inc. All rights reserved. You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at: http://developer.sun.com/berkeley_license.html -$Id: captchaerror.jsp,v 1.1 2006/02/17 03:04:22 yutayoshida Exp $ --%> - -<%@page contentType="text/html"%> -<%@page pageEncoding="UTF-8"%> - - -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" - "http://www.w3.org/TR/html4/loose.dtd"> - -<html> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> - <title>Captcha Error</title> - </head> - <body> - - <h1>Please input the right captcha string -- <a href="./">Try again</a> - - - - </body> -</html> diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/catalog.js b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/catalog.js deleted file mode 100644 index 4bdfc69..0000000 --- a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/catalog.js +++ /dev/null @@ -1,329 +0,0 @@ -/* Copyright 2006 Sun Microsystems, Inc. All rights reserved. You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at: http://developer.sun.com/berkeley_license.html -$Id: catalog.js,v 1.21 2007/01/17 22:16:44 basler Exp $ */ - -var ac; -var is; -var controller; -//var debug=true; - -function getApplicationContextRoot() { - var urlArray=window.location.toString().split("/", 4); - return "/" + urlArray[3]; -} - -var applicationContextRoot=getApplicationContextRoot(); - -function initCatalog() { - ac = new AccordionMenu(); - is = new ImageScroller(); - is.load(); - controller = new CatalogController(); - // wire in a listener for the rating component - dojo.event.connect("before", bpui.rating, "doClick", controller, "modifyState"); - controller.initialize(); -} - -function CatalogController() { - dojo.event.topic.subscribe("/catalog", this, handleEvent); - - // this object structure contains a list of the products and chunks that have been loaded - var pList = new ProductList(); - - var CHUNK_SIZE=7; - var initalRating; - var initalItem; - var originalURL; - - // using this for some browsers that do not support innerHTML - var useDOMInjection = false; - - var infoName = document.getElementById("infopaneName"); - var infoRating = document.getElementById("infopaneRating"); - var infoPrice = document.getElementById("infopanePrice"); - var infoBuyNow = document.getElementById("infopaneBuyNow"); - var infoShortDescription = document.getElementById("infopaneShortDescription"); - var infoDescription = document.getElementById("infopaneDescription"); - // for paypal - var buyNowAmount = document.getElementById("buyNow1_amount"); - var buyNowItemName = document.getElementById("buyNow1_item_name"); - - function handleEvent(args) { - if (args.type == "showingItem") { - // update the id on the ratring component - if (typeof bpui != 'undefined') { - var groupId = is.getGroupId(); - window.location.href= originalURL + "#" + groupId + "," + args.id; - if (typeof bpui.rating != 'undefined') { - // update the rating - bpui.rating.state["rating"].bindings["itemId"]=args.id; - bpui.rating.modifyDisplay("rating", args.rating, true); - // get the currrent item - showItemDetails(args.id); - } else { - initalItem = args.id; - initalRating = args.rating; - } - } else { - // things haven't been loaded to set the inital rating - initalItem = args.id; - initalRating = args.rating; - } - } else if (args.type == "getChunk") { - populateItems(args.id, args.index, args.currentChunk, false); - - } else if (args.type == "showItemDetails") { - showProductDetails(args.productId, args.itemId); - - } else if (args.type == "showProducts") { - is.reset(); - populateItems(args.productId, 0, 0, true); - } - } - - function showItemDetails(id) { - var i = is.getItems().get(id); - setNodeText(infoName, i.name + "<br/><a href='javascript:controller.disableItem("" + id + "","" + i.name + "")'><font size='-1' color='white'><i>Flag as inappropriate</i></font></a>"); - setNodeText(infoPrice, i.price); - setNodeText(infoShortDescription, i.shortDescription); - setNodeText(infoDescription, i.description); - // update the paypal - buyNowAmount.value = i.price; - buyNowItemName.value = i.name; - } - - function setNodeText(t, text) { - if (useDOMInjection) { - t.lastChild.nodeValue = text; - } else { - t.innerHTML = text; - } - } - - this.initialize = function() { - // check whether the innerHTML changes can be used in the infopane - infoName.innerHTML = " "; - if (!useDOMInjection && infoName.innerHTML != " ") { - useDOMInjection = true; - - infoName.appendChild(document.createTextNode("Name")); - infoPrice.appendChild(document.createTextNode("$0.00")); - infoShortDescription.appendChild(document.createTextNode("<description>")); - infoDescription.appendChild(document.createTextNode("<description>")); - } - - var ratingInstance = bpui.rating.state["rating"]; - ratingInstance.grade = initalRating; - bpui.rating.state["rating"].bindings["itemId"]=initalItem; - bpui.rating.modifyDisplay("rating", initalRating, true); - loadAccordion(); - } - - - this.modifyState = function(arg, rating) { - var itemId = initalItem; - if (typeof bpui.rating.state["rating"].bindings["itemId"] != 'undefined') { - itemId = bpui.rating.state["rating"].bindings["itemId"]; - } - // set the cached rating to the new rating that was set. - is.getItems().get(itemId).rating = rating; - } - - - function loadAccordion () { - // go out and get the categories - // this should be made more geric - var bindArgs = { - url: applicationContextRoot + "/catalog?command=categories&format=json", - mimetype: "text/json", - load: function(type,json) { - ac.load(json); - processURLParameters(); - }, - error: ajaxBindError - }; - dojo.io.bind(bindArgs); - } - - // this needs to happen after we have loaded the accordion data - function processURLParameters() { - originalURL = decodeURIComponent(window.location.href); - var params = {}; - // look for the params - if (originalURL.indexOf("#") != -1) { - var qString = originalURL.split('#')[1]; - var args = qString.split(','); - originalURL = originalURL.split('#')[0]; - ac.loadCategoryItem(args[0], args[1]); - return; - } else if (originalURL.indexOf("?") != -1) { - var qString = originalURL.split('?')[1]; - // get rid of any bookmarking stuff - if (qString.indexOf("#") != -1) { - qString = qString.split('#')[0]; - originalURL = originalURL.split('#')[0]; - window.location.href = originalURL; - } - ps = qString.split('&'); - // now go through and create the params map as an object literal - for (var i in ps) { - var t = ps[i].split('='); - params[t[0]] = t[1]; - } - // first check for the item in product - if (typeof params.itemId != 'undefined' && typeof params.pid != 'undefined') { - ac.loadCategoryItem(params.pid, params.itemId); - // next if there is a catid definition then do it - } else if (typeof params.catid != 'undefined') { - ac.showCategory(params.catid); - } - } else { - // nothing is selected - ac.showFirstCategory(); - } - } - - - - function showProductDetails(pid, itemId) { - is.reset(); - is.showProgressIndicator(); - var bindArgs = { - url: applicationContextRoot + "/catalog?command=itemInChunk&pid=" + pid + "&itemId=" + itemId + "&length=" + CHUNK_SIZE, - mimetype: "text/xml", - load: function(type,data,postProcessHandler) { - processProductData(data,true, pid, itemId); - showItemDetails(itemId); - is.doMaximize(); - }, - error: ajaxBindError - }; - dojo.io.bind(bindArgs); - } - - - - function populateItems(pid, index, neededChunk, showImage) { - is.showProgressIndicator(); - is.setGroupId(pid); - printDebug("populateItems - need to make sure displaying - pid=" + pid + " Chunk=" + neededChunk); - - // check to see if relevant scroller page is already loaded - if(!is.containsChunk(pid + "_" + neededChunk)) { - - // not loaded, so see if it is in the cache - if (pList.hasChunk(pid, neededChunk)) { - // in cache, so add chunk to scroller - printDebug("**** adding chunk from cache - pid=" + pid + " Chunk=" + neededChunk); - is.addChunk(pid + "_" + neededChunk); - is.addItems(pList.getChunk(pid, neededChunk)); - - // show first image if you have it - if(showImage && is.getScrollerItems().length > 0) { - is.showImage(is.getScrollerItems()[0].id); - } - - } else { - // not in cache so load it - startRetIndex=(neededChunk * CHUNK_SIZE); - - printDebug("**** retrieving chunk from server - pid=" + pid + " currentIndex=" + index + " startIndex=" + startRetIndex + " Chunk=" + neededChunk); - var bindArgs = { - url: applicationContextRoot + "/catalog?command=items&pid=" + pid + "&start=" + startRetIndex + "&length=" + CHUNK_SIZE, - mimetype: "text/xml", - load: function(type,data,postProcessHandler) { - processProductData(data, showImage, pid, null, neededChunk); - }, - error: ajaxBindError - }; - dojo.io.bind(bindArgs); - } - } else { - printDebug("*** items already showing"); - } - - } - - - function processProductData(responseXML, showImage, pid, iId, chunkId) { - var items = []; - var count = responseXML.getElementsByTagName("item").length; - for (var loop=0; loop < count ; loop++) { - - var item = responseXML.getElementsByTagName("item")[loop]; - var itemId = item.getElementsByTagName("id")[0].firstChild.nodeValue; - var name = item.getElementsByTagName("name")[0].firstChild.nodeValue; - var thumbURL = item.getElementsByTagName("image-tb-url")[0].firstChild.nodeValue; - var imageURL = item.getElementsByTagName("image-url")[0].firstChild.nodeValue; - var description = item.getElementsByTagName("description")[0].firstChild.nodeValue; - var price = item.getElementsByTagName("price")[0].firstChild.nodeValue; - var rating = item.getElementsByTagName("rating")[0].firstChild.nodeValue; - var shortDescription; - if (description.length > 71) { - shortDescription = description.substring(0,71) + "..."; - } else { - shortDescription = description; - } - var i = {id: itemId, name: name, image: imageURL, thumbnail: thumbURL, shortDescription: shortDescription, description: description, price:price, rating: rating}; - items.push(i); - } - - // cache the chunks - pList.addChunk(pid, chunkId, items); - is.addItems(items); - is.addChunk(pid + "_" + chunkId); - - if (showImage && iId == null) { - is.setGroupId(pid); - is.showImage(items[0].id); - } else { - is.setGroupId(pid); - is.showImage(iId); - } - is.hideProgressIndicator(); - } - - function ProductList() { - var _plist = this; - var map = new Map(); - - this.addChunk = function(pid, chunkNumber, items) { - map.put(pid + "_" + chunkNumber, items, true); - } - - this.getChunk = function(pid, chunkNumber) { - return map.get(pid + "_" + chunkNumber); - } - - this.hasChunk = function(pid, chunkNumber) { - return (map.get(pid + "_" + chunkNumber) != null); - } - - this.contents = function() { - return map.contents(); - } - } - - - this.disableItem=function(itemId, itemName) { - // go out and get the categories - // this should be made more geric - if (confirm("Are you sure you want to effectively remove this item from Petstore?")) { - var bindArgs = { - url: applicationContextRoot + "/catalog?command=disable&id=" + itemId, - mimetype: "text/xml", - load: function(type,json) { - //alert("The item named '" + itemName + "' has been disabled!"); - pList = new ProductList(); - is.reset(); - populateItems(is.getGroupId(), 0, 0, true); - }, - error: ajaxBindError - }; - dojo.io.bind(bindArgs); - } - } - - -} - - diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/catalog.jsp b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/catalog.jsp deleted file mode 100644 index 443857b..0000000 --- a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/catalog.jsp +++ /dev/null @@ -1,95 +0,0 @@ -<%-- Copyright 2006 Sun Microsystems, Inc. All rights reserved. You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at: http://developer.sun.com/berkeley_license.html -$Id: catalog.jsp,v 1.22 2007/03/16 21:42:03 basler Exp $ --%> -<script type="text/javascript" src="common.js"></script> -<script type="text/javascript" src="scroller.js"></script> -<link rel="stylesheet" type="text/css" href="scroller.css"></link> -<script type="text/javascript" src="accordion.js"></script> -<link rel="stylesheet" type="text/css" href="accordion.css"></link> -<script type="text/javascript" src="catalog.js"></script> -<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@taglib uri="http://java.sun.com/jsf/html" prefix="h" %> -<%@taglib uri="http://java.sun.com/jsf/core" prefix="f" %> -<%@taglib prefix="ui" uri="http://java.sun.com/blueprints/ui" %> -<body> -<jsp:include page="banner.jsp" /> -<script type="text/javascript"> - dojo.event.connect(window, "onload", function(){initCatalog();}); -</script> -<center> - <table border="0"> - <tr> - <td> - <table id="accordion"> - <tr id="accordionTitle" class="accordionTitle"><td>Pets</td></tr> - <tr><td> - <table id="accordionBody" border="0" class="accordionBody"> - </table> - </td></tr> - </table> - </td> - <td> - <div id="CatalogBrowser"> - <table border="0" class="slider" width="500px" > - <tr height="415" valign="top"> - <td id="bodySpace" border="0" align="center"></td> - </tr> - <tr id="targetRow"> - <td width="500" height="70 align="top"> - <div class="nav" id="right_button"> - <img src="${pageContext.request.contextPath}/images/right.gif" name="nextRoll" title="Show More Items" border="0"> - </div> - <div class="nav" id="left_button"> - <img src="${pageContext.request.contextPath}/images/left.gif" name="previousRoll" title="Show Previous Items" border="0"> - </div> - <div id="infopane" class="infopane"> - <table class="infopaneTable"> - <tr> - <td id="infopaneName" class="infopaneTitle"> - </td> - <td id="infopaneRating" class="infopaneRating"> - <f:view> - <ui:rating id="rating" maxGrade="5" includeNotInterested="false" includeClear="false" - hoverTexts="#{RatingBean.ratingText}" notInterestedHoverText="Not Interested" clearHoverText="Clear Rating" - grade="#{RatingBean.grade}"/> - <f:verbatim></td><td id="infopanePrice" class="infopanePrice"></td><td id="infopanePayPal" class="infopanePayPal"></f:verbatim> - <ui:buyNow business="donate@animalfoundation.com" id="buyNow1" itemName="Buy Item One" - amount="100.00" quantity="1" type="BuyNow" postData="#{PayPalBean.postData}" target="paypal"/> - </f:view> - </td> - <td id="infopaneIndicator" class="infopaneIndicator"> - </td> - <td id="infopaneDetailsIcon"> - </td> - </tr> - <tr> - <td id="infopaneShortDescription" colspan="7" class="infopaneShortDescription"> - </td> - </tr> - <tr style="height:20px"> - <td></td> - </tr> - <tr> - <td id="infopaneDescription" colspan="6" class="infopaneDescription"> - </td> - </tr> - </table> - </div> - </td> - </tr> - </table> - </td> - <td style="vertical-align:top; width:300px; text-align:right;"> - <div id="downloadAds"> - <jsp:include page="download.jsp" /> - </div> - </td> - </tr> - </table> - </div> - <div id="status" style="text-align:left"></div> <div id="status_2"></div> - <div id="dstatus"></div> - <div id="injection_point"></div> -</center> -<jsp:include page="footer.jsp" /> -</body> -</html> diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/catalog.jsp-old b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/catalog.jsp-old deleted file mode 100644 index 13914ed..0000000 --- a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/catalog.jsp-old +++ /dev/null @@ -1,95 +0,0 @@ -<%-- Copyright 2006 Sun Microsystems, Inc. All rights reserved. You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at: http://developer.sun.com/berkeley_license.html -$Id: catalog.jsp,v 1.20 2006/12/01 21:38:40 basler Exp $ --%> -<script type="text/javascript" src="common.js"></script> -<script type="text/javascript" src="scroller.js"></script> -<link rel="stylesheet" type="text/css" href="scroller.css"></link> -<script type="text/javascript" src="accordion.js"></script> -<link rel="stylesheet" type="text/css" href="accordion.css"></link> -<script type="text/javascript" src="catalog.js"></script> -<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@taglib uri="http://java.sun.com/jsf/html" prefix="h" %> -<%@taglib uri="http://java.sun.com/jsf/core" prefix="f" %> -<%@taglib prefix="ui" uri="http://java.sun.com/blueprints/ui" %> -<body> -<jsp:include page="banner.jsp" /> -<script type="text/javascript"> - dojo.event.connect(window, "onload", function(){initCatalog();}); -</script> -<center> - <table border="0"> - <tr> - <td> - <table id="accordion"> - <tr id="accordionTitle" class="accordionTitle"><td>Pets</td></tr> - <tr><td> - <table id="accordionBody" border="0" class="accordionBody"> - </table> - </td></tr> - </table> - </td> - <td style="min-width:500px;"> - <div id="CatalogBrowser"> - <table width="500px"border="1" class="slider" > - <tr height="415" valign="top"> - <td id="bodySpace" border="0" align="center"></td> - </tr> - <tr id="targetRow"> - <td width="500px" height="70px" align="top"> - <div class="nav" id="right_button"> - <img src="${pageContext.request.contextPath}/images/right.gif" name="nextRoll" title="Show More Items" border="0"> - </div> - <div class="nav" id="left_button"> - <img src="${pageContext.request.contextPath}/images/left.gif" name="previousRoll" title="Show Previous Items" border="0"> - </div> - <div id="infopane" class="infopane"> - <table class="infopaneTable"> - <tr> - <td id="infopaneName" class="infopaneTitle"> - </td> - <td id="infopaneRating" class="infopaneRating"> - <f:view> - <ui:rating id="rating" maxGrade="5" includeNotInterested="false" includeClear="false" - hoverTexts="#{RatingBean.ratingText}" notInterestedHoverText="Not Interested" clearHoverText="Clear Rating" - grade="#{RatingBean.grade}"/> - <f:verbatim></td><td id="infopanePrice" class="infopanePrice"></td><td id="infopanePayPal" class="infopanePayPal"></f:verbatim> - <ui:buyNow business="donate@animalfoundation.com" id="buyNow1" itemName="Buy Item One" - amount="100.00" quantity="1" type="BuyNow" postData="#{PayPalBean.postData}" target="paypal"/> - </f:view> - </td> - <td id="infopaneIndicator" class="infopaneIndicator"> - </td> - <td id="infopaneDetailsIcon"> - </td> - </tr> - <tr> - <td id="infopaneShortDescription" colspan="7" class="infopaneShortDescription"> - </td> - </tr> - <tr style="height:20px"> - <td></td> - </tr> - <tr> - <td id="infopaneDescription" colspan="6" class="infopaneDescription"> - </td> - </tr> - </table> - </div> - </td> - </tr> - </table> - </td> - <td style="vertical-align:top; width:300px; text-align:right;"> - <div id="downloadAds"> - <jsp:include page="download.jsp" /> - </div> - </td> - </tr> - </table> - </div> - <div id="status" style="text-align:left"></div> <div id="status_2"></div> - <div id="dstatus"></div> - <div id="injection_point"></div> -</center> -<jsp:include page="footer.jsp" /> -</body> -</html> \ No newline at end of file diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/common.js b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/common.js deleted file mode 100644 index 03a3ba2..0000000 --- a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/common.js +++ /dev/null @@ -1,77 +0,0 @@ - - function ajaxBindError(type, errObj) { - // can't use the error page, because unless and exception in the internal servlet container - // nullpointer exceptions will be thrown - //window.location="./systemerror.jsp?message=" + errObj.message; - - alert("An Exception has been encountered on the server side during an Ajax request. Please see the server logs for more information " + errObj.message); - } - - - function debugProperties(namex) { - var listx=""; - var ob=namex; - for(xx in ob) { - listx += xx + " = " + ob[xx] + "<br/>" - } - //document.write(listx); - alert(listx); - } - - - function printDebug(argx) { - if (typeof debug != 'undefined') { - document.getElementById("status").innerHTML = argx + "<br>" + document.getElementById("status").innerHTML; - } - } - - - function Map() { - var size = 0; - var keys = []; - var values = []; - - this.put = function(key, value, replace) { - if (this.get(key) == null) { - keys[size] = key; - values[size] = value; - size++; - } else if (replace) { - for (i=0; i < size; i++) { - if (keys[i] == key) { - values[i] = value; - } - } - } - } - - this.get = function(key) { - for (i=0; i < size; i++) { - if (keys[i] == key) { - return values[i]; - } - } - return null; - } - - this.clear = function() { - size = 0; - keys = []; - values = []; - } - - // return keys show can show main image - this.getKeys = function() { - return keys; - } - - // dump contents of map keys as string - this.contents = function() { - var retx=""; - for(ii=0; ii < size; ii++) { - retx += keys[ii] + ", "; - } - return retx; - } - - } \ No newline at end of file diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/download.jsp b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/download.jsp deleted file mode 100644 index 20ef584..0000000 --- a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/download.jsp +++ /dev/null @@ -1,22 +0,0 @@ -<div id="downloadAds" style="text-align:center; border-style:none; width:100%;"> - <table style="width:100%;"> - <tr> - <td style="text-align:center;"> - <a href="http://java.sun.com/javaee/downloads/index.jsp" target="downloads"><img style="border:none" src="./images/ad-sdk.jpg" alt="Download Java EE 5 SDK"/></a> - <br/> - </td> - </tr> - <tr> - <td style="text-align:center;"> - <a href="http://www.netbeans.org/downloads/index.html" target="downloads"><img style="border:none" src="./images/ad-netbeans.jpg" alt="Download Netbeans IDE"/></a> - <br/> - </td> - </tr> - <tr> - <td style="text-align:center;"> - <a href="http://java.com/en/download/index.jsp" target="downloads"><img style="border:none" src="./images/ad-jre.jpg" alt="Download Java SE"/></a> - <br/> - </td> - </tr> - </table> -</div> diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/downloadAd.js b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/downloadAd.js deleted file mode 100644 index 65855c2..0000000 --- a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/downloadAd.js +++ /dev/null @@ -1,54 +0,0 @@ -dojo.require("dojo.io"); -function checkAdPage() { - var bindArgs = { - // check to see if an updated page is available - URL: "http://localhost:8080/petstore/downloadAd.txt", - mimetype: "text/plain", - load: returnFunctionx, - error: ajaxBindError}; - - // dispatch the request - dojo.io.bind(bindArgs); -} - -function returnFunctionx(type, data, evt) { - // statically setup popup for simple case - // check return of the dojo call to make sure it is valid - if (evt.readyState == 4) { - if (evt.status == 200) { - alert("data = " + data); - document.getElementById("downloadAds").innerHTML=data; - } - } -} - - -var req; - -function checkAdPageMark() { - // calculate arrow and border image location - req=initRequest(); - - url="http://blueprints.dev.java.net/petstore/downloadAd.txt", - req.onreadystatechange = returnFunctionxMark; - req.open("GET", url, true); - req.send(null); -} - - -function returnFunctionxMark() { - if (req.readyState == 4) { - if (req.status == 200) { - alert("data = " + req.responseText); - document.getElementById("downloadAds").innerHTML=req.responseText; - } - } -} - -initRequest=function() { - if (window.XMLHttpRequest) { - return new XMLHttpRequest(); - } else if (window.ActiveXObject) { - return new ActiveXObject("Microsoft.XMLHTTP"); - } -} diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/downloadAd.json b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/downloadAd.json deleted file mode 100644 index 3bbf564..0000000 --- a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/downloadAd.json +++ /dev/null @@ -1,7 +0,0 @@ -jsonpTest({"keyId":"TestData"}); - -function testexample() { - alert("testexample!!"); -} - -testexample(); \ No newline at end of file diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/downloadAd.txt b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/downloadAd.txt deleted file mode 100644 index e9a0944..0000000 --- a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/downloadAd.txt +++ /dev/null @@ -1 +0,0 @@ -<div id='downloadAds' style='text-align:center; border-style:double; width:100%;'> <table style='width:100%'> <tr> <th style='text-align:center; border-bottom:thin solid black;'>DOWNLOADS Blueprints</th> </tr> <tr> <td style='text-align:center;'> <a href='http://java.sun.com/javaee/downloads/index.jsp' target='downloads'><img style='border:none' src='./images/ad-sdk.jpg' alt='Download Java EE 5 SDK'/></a> </td> </tr> <tr> <td style='text-align:center;'> <a href='http://www.netbeans.org/downloads/index.html' target='downloads'><img style='border:none' src='./images/ad-netbeans.jpg' alt='Download Netbeans IDE'/></a> </td> </tr> <tr> <td style='text-align:center;'> <a href='http://java.com/en/download/index.jsp' target='downloads'><img style='border:none' src='./images/ad-jre.jpg' alt='Download Java SE'/></a> </td> </tr> </table></div> \ No newline at end of file diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/engine.js b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/engine.js deleted file mode 100644 index 0e5b14e..0000000 --- a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/engine.js +++ /dev/null @@ -1,241 +0,0 @@ -/* Copyright 2006 Sun Microsystems, Inc. All rights reserved. You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at: http://developer.sun.com/berkeley_license.html -$Id: engine.js,v 1.10 2006/05/03 22:00:32 inder Exp $ */ - -function Engine () { - - /** - * - * Load template text aloing with an associated script - * - * Argument p properties are as follows: - * - * url : Not required but used if you want to get the template from - * something other than the injection serlvet. For example if - * you want to load content directly from a a JSP or HTML file. - * - * p.template : Not required if you specficy a url property Otherewise this - * is the name of the template file. - * - * p.initFunction: Not required. This function or function pointer will be called - * after the template text and script are loaded. The result of - * the evaluated script will be accessible in the context of - * this function. - * - * p.injectionPoint: Not required. This is the id of an element into. If this is - * not specfied a div will be created under the roon node of - * the document and the template will be injected into it. - * Content is injected by setting the innerHTML property - * of an element to the template text. - */ - this.inject = function (p) { - var targetUrl; - if (!p.url) targetUrl = "controller?command=content&target=/" + p.template; - else targetUrl = p.url; - var templateArgs = { - url: targetUrl, - mimetype: "text/html", - load: function(type, data) { - //if no parent is given append to the document root - var nData = includeEmbeddedResources(data, p.initFunction ); - if (!p.injectionPoint) { - var injectionPoint = document.createElement("div"); - injectionPoint.innerHTML = nData; - document.firstChild.appendChild(injectionPoint); - } else { - p.injectionPoint.innerHTML = nData; - } - if (p.script) { - // now load the associated JavaScript - loadScript(p.script,p.initFunction); - } - } - }; - dojo.io.bind(templateArgs); - } - - function loadScript(targetURL,callback) { - var templateArgs = { - url: targetURL, - mimetype: "text/plain", - load: callback - }; - dojo.io.bind(templateArgs); - } - - /** - * If were returning an text document remove any script in the - * the document and add it to the global scope using a time out. - */ - function includeEmbeddedResources(target, initFunction) { - var bodyText = ""; - var embeddedScripts = []; - var embeddedStyles = []; - var scriptReferences = []; - var styleReferences = []; - var styles = []; - // recursively go through and weed out the scripts - // TODO: Use some better REGEX processing - // TODO: Also support single quotes - while (target.indexOf("<script") != -1) { - var realStart = target.indexOf("<script"); - var scriptSourceStart = target.indexOf("src=", (realStart)); - var scriptElementEnd = target.indexOf(">", realStart); - var end = target.indexOf("</script>", (realStart)) + "</script>".length; - if (realStart != -1 && scriptSourceStart != -1) { - var scriptSourceName; - var scriptSourceLinkStart= scriptSourceStart + 5; - var scriptSourceLinkEnd= target.indexOf(""", (scriptSourceLinkStart + 1)); - if (scriptSourceStart < scriptElementEnd) { - scriptSourceName = target.substring(scriptSourceLinkStart, scriptSourceLinkEnd); - // prevent multiple inclusions of dojo.js. - // there is no way you would get to this point without dojo being included - if (scriptSourceName.indexOf("dojo.js") == -1) { - scriptReferences.push(scriptSourceName); - } - } - } - // now remove the script body - var scriptBodyStart = scriptElementEnd + 1; - var sBody = target.substring(scriptBodyStart, end - "</script>".length); - if (sBody.length > 0) { - embeddedScripts.push(sBody); - } - //remove script - target = target.substring(0, realStart) + target.substring(end, target.length); - } - - while (target.indexOf("<style") != -1) { - var realStart = target.indexOf("<style"); - var styleElementEnd = target.indexOf(">", realStart); - var end = target.indexOf("</style>", (realStart)) ; - var styleBodyStart = styleElementEnd + 1; - var sBody = target.substring(styleBodyStart, end); - if (sBody.length > 0) { - embeddedStyles.push(sBody); - } - //remove style - target = target.substring(0, realStart) + target.substring(end + "</style>".length, target.length); - } - // get the links - while (target.indexOf("<link") != -1) { - var realStart = target.indexOf("<link"); - var styleSourceStart = target.indexOf("href=", (realStart)); - var styleElementEnd = target.indexOf(">", realStart) +1; - if (realStart != -1 && styleSourceStart != -1) { - var styletSourceName; - var styleSourceLinkStart= styleSourceStart + 6; - var styleSourceLinkEnd= target.indexOf(""", (styleSourceLinkStart + 1)); - if (styleSourceStart < styleElementEnd) { - styleSourceName = target.substring(styleSourceLinkStart, styleSourceLinkEnd); - styleReferences.push(styleSourceName); - } - //remove style - target = target.substring(0, realStart) + target.substring(styleElementEnd, target.length); - } - } - - var head = document.getElementsByTagName("head")[0]; - - // inject the links - for(var loop = 0; loop < styleReferences.length; loop++) { - var link = document.createElement("link"); - link.href = styleReferences[loop]; - link.type = "text/css"; - link.rel = "stylesheet"; - head.appendChild(link); - } - - var stylesElement; - if (embeddedStyles.length > 0) { - stylesElement = document.createElement("style"); - stylesElement.type="text/css"; - var stylesText; - for(var loop = 0; loop < embeddedStyles.length; loop++) { - stylesText = stylesText + embeddedStyles[loop]; - } - if (document.styleSheets[0].cssText) { - document.styleSheets[0].cssText = document.styleSheets[0].cssText + stylesText; - } else { - stylesElement.appendChild(document.createTextNode(stylesText)); - head.appendChild(stylesElement); - } - } - - scriptLoader(scriptReferences, 0, function() { - this.embeddedScripts = embeddedScripts; - // evaluate the embedded javascripts in the order they were added - // consider using an onload handler - for(var loop = 0; loop < embeddedScripts.length; loop++) { - //alert("evaluating " + embeddedScripts[loop]); - var script = embeddedScripts[loop]; - // append to the script a method to call the scriptLoaderCallback - eval(script); - if (loop == (embeddedScripts.length -1)) { - initFunction(); - } - } - }); - - return target; - } - - - /** - * Load the scripts in order and load them one after on another - */ - function scriptLoader(scripts, index, callbackFunction) { - var head = document.getElementsByTagName("head").item(0); - var scriptElement = document.createElement("script"); - scriptElement.id = "c_script_" + index; - scriptElement.type = "text/javascript"; - - var loadHandler = function () { - if (index < scripts.length && index != scripts.length -1) { - scriptLoader(scripts, ++index, callbackFunction); - } else { - callbackFunction(); - } - } - if (typeof scriptElement.onreadystatechange != 'undefined') { - scriptElement.onreadystatechange = function () { - if (this.readyState == 'loaded') { - loadHandler(); - } - }; - } - scriptElement.onload = loadHandler; - - // Safari not seeing the onload event and does not support the onreadystate - if (navigator.userAgent.toLowerCase().indexOf("safari") != -1) { - scriptElement.src = scripts[index]; - setTimeout(loadHandler, 0); - } - head.appendChild(scriptElement); - setTimeout("document.getElementById('c_script_" + index + "').src ='" + scripts[index] + "'", 0); - - scriptElement = null; - head = null; - } - - /** - * If were returning an XML document remove any script in the - * the document and add it to the global scope using a time out. - */ - function includeEmbeddedScripts(xmlDocument) { - var items = new Array(); - var xmlDocument = document.getElementsByTagName("script"); - - for(var loop = 0; loop < targets.length; loop++) { - var children = targets[loop].childNodes; - var iScript = ""; - for(var innerLoop = 0; innerLoop < children.length; innerLoop++) { - iScript += children[innerLoop].data; - } - items.add(iScript); - children[loop].parentNode.removeChild(children[loop]); - } - for(var loop = 0; loop < items.length; loop++) { - setTimeout(items[loop],0); - } - } -} diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/fileupload.jsp b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/fileupload.jsp deleted file mode 100644 index bb8fb85..0000000 --- a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/fileupload.jsp +++ /dev/null @@ -1,266 +0,0 @@ -<%-- Copyright 2006 Sun Microsystems, Inc. All rights reserved. You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at: http://developer.sun.com/berkeley_license.html -$Id: fileupload.jsp,v 1.57 2007/03/08 21:58:48 inder Exp $ --%> - -<%@page contentType="text/html"%> -<%@page pageEncoding="UTF-8"%> -<%@page import="com.sun.javaee.blueprints.petstore.util.PetstoreConstants"%> -<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@taglib uri="http://java.sun.com/jsf/html" prefix="h" %> -<%@taglib uri="http://java.sun.com/jsf/core" prefix="f" %> -<%@taglib prefix="ui" uri="http://java.sun.com/blueprints/ui" %> - -<html> - <head> - <title>Petstore Seller page</title> - <script type="text/javascript"> - var submittingForm=false; - - function testRetFunction(type, data, evt){ - if (evt.readyState == 4) { - if(evt.status == 200) { - // check for error - submittingForm=false; - var resultx=data.getElementsByTagName("response")[0]; - var message=resultx.getElementsByTagName("message")[0].childNodes[0].nodeValue; - if(message == "Captchas Filter Error") { - // captcha error - alert("Authorization failed : please enter the correct captcha string"); - } else if(message == "Validation Error") { - alert("Validation failed on the Server :\n" + resultx.getElementsByTagName("detail")[0].childNodes[0].nodeValue); - } else if(message == "Upload Size Error") { - alert("The size of the uploaded image must not be more than 100 KB"); - } else { - // fileupload complete - var thumbpath=resultx.getElementsByTagName("thumbnail")[0].childNodes[0].nodeValue; - var productId=resultx.getElementsByTagName("productId")[0].childNodes[0].nodeValue; - var itemid=resultx.getElementsByTagName("itemId")[0].childNodes[0].nodeValue; - // forward to status page - location.href="fileuploadstatus.jsp?message=" + message + "&id=" + itemid + "&productId=" + productId + "&thumb=" + thumbpath; - } - } else { - // server error, send to error page - // can't forward to errorpage because null pointer gets thrown on lookup of status code ("javax.servlet.error.status_code") - //ajaxBindError(type, data.message); - alert("Persistence failed : Please check if the server logs for more information!") - } - } - } - - - function storeCookie() { - currentcap = "j_captcha_response="+document.getElementById("TestFileuploadForm:captcharesponse").value; - document.cookie = currentcap; - } - - function extractCity(citystatezip) { - var index = citystatezip.indexOf(','); - var nextcity = citystatezip.substring(0, index+4); - return nextcity; - } - - function chooseCity(city) { - var index = city.indexOf(','); - var state = city.substring(index+2, index+4); - var zip = city.substring(index+5); - city = city.substring(0, index); - - document.getElementById('TestFileuploadForm:cityField').value = city; - document.getElementById('TestFileuploadForm:stateField').value = state; - document.getElementById('TestFileuploadForm:zipField').value = zip; - } - - function fileuploadOnsubmit() { - if(!submittingForm) { - var valMess=""; - - // save rich text editor text to element - var descx=dojo.widget.byId('rtEditor').getEditorContent() - var lowDescx=descx.toLowerCase(); - - // START: check validation - if(dojo.byId("TestFileuploadForm:name").value == "") { - valMess += "Error: Pet Name is required.\n"; - } - - // make sure there isn't a script/link tag in the description - if(lowDescx == "" || lowDescx.indexOf("<script") > -1 || lowDescx.indexOf("<link") > -1) { - valMess += "Error: The Description must exist and the field can't have a '<script>' and/or a '<link>' tag in it\n"; - } - - // make sure price is a number - var pricex=dojo.byId("TestFileuploadForm:price").value; - if(pricex == "" || isNaN(parseInt(pricex))) { - // price should be a number - valMess += "Error: Price should should exist and be a number in American Dollars in the format '*.00'.\n"; - } - - // make sure the upload file ends in an suffix - var filex=dojo.byId("fileToUploadId").value; - var lengthx=filex.length; - var suffix=filex.substr(lengthx-4).toLowerCase(); - if(lengthx < 1 || (suffix != ".jpg" && suffix != ".gif" && suffix != ".png")) { - // not a proper upload so error - valMess += "Error: The image upload file must exist and be of type .jpg, .gif or .png\n"; - } - - - // make sure make and address is entered - if(dojo.byId("TestFileuploadForm:firstName").value == "") { - // price should be a number - valMess += "Error: First Name is required.\n"; - } - if(dojo.byId("TestFileuploadForm:lastName").value == "") { - valMess += "Error: Last Name is required.\n"; - } - if(dojo.byId("TestFileuploadForm:street1").value == "") { - valMess += "Error: Street is required.\n"; - } - if(dojo.byId("TestFileuploadForm:cityField").value == "") { - valMess += "Error: City is required.\n"; - } - if(dojo.byId("TestFileuploadForm:stateField").value == "") { - valMess += "Error: State is required.\n"; - } - if(dojo.byId("TestFileuploadForm:zipField").value == "") { - valMess += "Error: Zip Code is required.\n"; - } - - if(valMess != "") { - // error, show message - alert(valMess + "\nPlease addresses the error(s) and re-submit your entry!"); - } else { - // no validation errors, so submit form - submittingForm=true; - // set description - dojo.byId('description').value=descx; - - storeCookie() - document.forms['TestFileuploadForm'].onsubmit(); - } - } - } - - function showFU() { - document.getElementById("fucomponent").style.visibility = "visible"; - } - - function switchPanes(fromDivId, toDivId) { - // show pane - var divx=document.getElementById(fromDivId); - divx.style.visibility='hidden'; - divx=document.getElementById(toDivId); - divx.style.visibility='visible'; - } -</script> -<style> -span.button { - background-color: #6699CC; - color: white; - cursor:pointer; - border: thin outset black; - padding: 1px 5px; -} -div.pane { - width: 90%; - background-color: #EEEEEE; - border: thin double blue; - padding: .5cm; - font: 12px arial; -} - -.nameCol { - width: 45%; -} -.dataCol { - width: 55%; -} - -</style> - </head> - <body onload="showFU()"> - <jsp:include page="banner.jsp"/> - <script>dojo.require("dojo.widget.Editor2");</script> - <br/> - <div id="fucomponent" style="visibility:hidden;"> - <f:view> - - <ui:fileUploadTag id="TestFileuploadForm" serverLocationDir="#{FileUploadBean.uploadImageDirectory}" - postProcessingMethod="#{FileUploadBean.postProcessingMethod}" - retMimeType="text/xml" retFunction="testRetFunction" - progressBarDivId="progress" progressBarSize="40"> - <div id="pane2" class="pane" style="visibility: hidden;"> - <h:panelGrid border="0" columns="2" style="width: 100%" columnClasses="nameCol, dataCol"> - <f:facet name="header"> - <h:outputText value="Information about yourself"/> - </f:facet> - <h:outputText value="*First Name"/> - <h:inputText size="20" id="firstName"></h:inputText> - <h:outputText value="*Last Name"/> - <h:inputText size="20" id="lastName"></h:inputText> - <h:outputText value="Seller Email"/> - <h:inputText size="20" id="email"></h:inputText> - <h:outputText value="*Street"/> - <h:inputText size="20" id="street1"></h:inputText> - <h:outputText value="*City"/> - <ui:autoComplete size="20" maxlength="10" id="cityField" - completionMethod="#{AutocompleteBean.completeCity}" - value="#{AddressBean.city}" required="true" - ondisplay="function(item) { return extractCity(item); }" - onchoose="function(item) { return chooseCity(item); }" /> - <h:outputText value="*State"/> - <ui:autoComplete size="2" maxlength="10" id="stateField" - completionMethod="#{AutocompleteBean.completeState}" - value="#{AddressBean.state}" required="true" /> - <h:outputText value="*Zip Code"/> - <h:inputText size="5" id="zipField" value="#{AddressBean.zip}" required="true" /> - - <h:outputText value="Enter the text as it is shown below (case insensitive)"/> - <h:outputText /> - <h:graphicImage id="captchaImg" url="CaptchaServlet"/> - <h:inputText id="captcharesponse"></h:inputText> - <br/><span class="button" onclick="switchPanes('pane2', 'pane1');"><< Previous</span> - <span class="button" onclick="fileuploadOnsubmit()">Submit</span> - <br/><div id="progress"></div><br/> - - </h:panelGrid> - </div> - <div class="pane"style="position:absolute; top:125px;" id="pane1"> - <h:panelGrid border="0" columns="2" style="width: 100%" columnClasses="nameCol, dataCol"> - <f:facet name="header"> - <h:outputText value="Information about your pet"/> - </f:facet> - - <h:outputText value="Category"/> - <h:selectOneMenu id="product"> - <f:selectItems value="#{FileUploadBean.products}"/> - </h:selectOneMenu> - - <h:outputText value="*Pet's Name"/> - <h:inputText size="20" id="name"></h:inputText> - - <h:outputText value="*Description (3 lines max display in catalog)"/> - - <div style="border-style:inset; border-width:thin; background-color:white"> - <textarea wrap="soft" dojoType="Editor2" widgetId="rtEditor" id="description" name="TestFileuploadForm:description" - toolbarTemplatePath="${pageContext.request.contextPath}/rteToolBar.html"></textarea> - </div> - - <h:outputText value="*Price (is US dollars)"/> - <h:inputText size="20" id="price"></h:inputText> - - <h:outputText value="*Image File"/> - <input type="file" size="20" name="fileToUpload" id="fileToUploadId"/> - - <h:outputText value="Custom Tag Keywords (separated by spaces)"/> - <h:inputText size="20" id="tags"></h:inputText> - </h:panelGrid> - <br/><span class="button" onclick="switchPanes('pane1', 'pane2');">Next >></span> - </div> - Required fields are designated by a * - </ui:fileUploadTag> - </f:view> - </div> - - <jsp:include page="footer.jsp" /> - </body> -</html> diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/fileuploadstatus.jsp b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/fileuploadstatus.jsp deleted file mode 100644 index 50e3730..0000000 --- a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/fileuploadstatus.jsp +++ /dev/null @@ -1,134 +0,0 @@ -<%-- Copyright 2006 Sun Microsystems, Inc. All rights reserved. You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at: http://developer.sun.com/berkeley_license.html -$Id: fileuploadstatus.jsp,v 1.8 2006/05/05 21:05:47 yutayoshida Exp $ --%> - -<%@page contentType="text/html"%> -<%@page pageEncoding="UTF-8"%> - -<html> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> - <title>Seller Photo Submit Status</title> - <style type="text/css"> - #status { background-color : #E0FFFF; - border : none; - width : 50%; - } - </style> - <script type="text/javascript"> - window.onload = function() { - var thumbfile = "${param.thumb}"; - if (thumbfile == "") { - thumbfile = "${sessionScope['fileuploadResponse'].thumbnail}"; - } - thumbpath = "http://$%7BpageContext.request.serverName%7D:$%7BpageContext.request.serverP..."; - thumbpath += thumbfile; - var divNode = document.getElementById("thumb"); - var imgNode = document.createElement("img"); - imgNode.setAttribute("src", thumbpath); - divNode.appendChild(imgNode); - - // initialize buttons - initButtonImage(); - } - - var imageLayerId = new Array(); - var imageLayerG = new Array(); - var imageLayerC = new Array(); - var imageText = new Array(); - function initButtonImage(){ - imageLayerId[1] ="seller" - imageLayerG[1] = "../images/seller-thumb-g.jpg"; - imageLayerC[1] = "../images/seller-thumb.jpg"; - imageLayerId[2] ="catalog" - imageLayerG[2] = "../images/catalog-thumb-g.jpg"; - imageLayerC[2] = "../images/catalog-thumb.jpg"; - imageLayerId[3] ="home" - imageLayerG[3] = "../images/index-thumb-g.jpg"; - imageLayerC[3] = "../images/index-thumb.jpg"; - - imageText[1] = "Submit another pet"; - imageText[2] = "Go to your pet page"; - imageText[3] = "Go back to PetStore home"; - } - - function highlightButton(n) { - switchButton(true, n); - } - function darkenButton(n) { - switchButton(false, n); - } - - function switchButton(highlight, n){ - var id = imageLayerId[n]; - var btn = document.getElementById(id); - if (highlight) { - btn.src = imageLayerC[n]; - popupText(imageText[n]); - } else { - btn.src = imageLayerG[n]; - popupText(null); - } - } - var Mx; - var My; - function popupText(txt) { - var pNode = document.getElementById("popupText"); - var rx; - var ry; - if (document.all) { - rx = event.clientX + document.body.scrollLeft +10; - ry = event.clientY + document.body.scrollTop -20; - } else { - rx = Mx + 10; - ry = My -20; - } - if (txt) { - pNode.style.display = "block"; - pNode.style.left = rx + "px"; - pNode.style.top = ry + "px"; - pNode.innerHTML = txt; - } else { - pNode.style.display = "none"; - pNode.innerHTML = ""; - } - } - function getMouseXY(mEvent) { - Mx = mEvent.pageX; - My = mEvent.pageY; - } - window.onmousemove = getMouseXY; - </script> - </head> - <body> - <jsp:include page="banner.jsp"/> - <center> - <div id="status"> - <h4>${param.message}</h4> - Here's the uploaded photo of your pet<br/><br/> - <div id="thumb"></div> - <br/><br/> - Would you like to :-<br/><br/> - - <div id="popupText" style="position:absolute;z-index:2;border:1px solid;padding:5px; - border-color:blue;font-size:10pt;background-color:#00ffff;color:blue;display:none"></div> - <table border="0" cellpadding="4" cellspacing="4"> - <tr> - <td><a href="fileupload.jsp" onmouseover="highlightButton(1)" onmouseout="darkenButton(1)"> - <img name="seller" id="seller" src="../images/seller-thumb-g.jpg" alt="seller" width="105" height="60" border="0"> - </a> - </td> - <td><a href="catalog.jsp?pid=${param.productId}&itemId=${param.id}" onmouseover="highlightButton(2)" onmouseout="darkenButton(2)"> - <img name="catalog" id="catalog" src="../images/catalog-thumb-g.jpg" alt="catalog" width="105" height="60" border="0"> - </a> - </td> - <td><a href="http://${pageContext.request.serverName}:${pageContext.request.serverPort}${pageContext.servletContext.contextPath}/index.jsp" onmouseover="highlightButton(3)" onmouseout="darkenButton(3)"> - <img name="home" id="home" src="../images/index-thumb-g.jpg" alt="index" width="105" height="60" border="0"> - </a> - </td> - </tr> - </table> - </div> - </center> - <jsp:include page="footer.jsp" /> - </body> -</html> diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/footer.jsp b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/footer.jsp deleted file mode 100644 index 8fda523..0000000 --- a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/footer.jsp +++ /dev/null @@ -1,15 +0,0 @@ -<%-- Copyright 2006 Sun Microsystems, Inc. All rights reserved. You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at: http://developer.sun.com/berkeley_license.html -$Id: footer.jsp,v 1.10 2007/01/31 19:40:34 basler Exp $ --%> - -<hr/> -<center> - If you have any questions or suggestions, please use the <a - href="https://blueprints.dev.java.net/feedback.html" target="petstore">feedback page</a>. - <br/> - To access the latest versions of any of the BluePrints projects, please use the <a - href="https://blueprints.dev.java.net/downloads.html" target="petstore">download page</a>. - <br/> - <a href="http://blueprints.dev.java.net/" target="petstore">Java BluePrints</a> | - <a href="http://sun.com/" target="petstore">Sun Microsystems</a> © 2007 Sun Microsystems Inc. All rights reserved. Use is subject to license terms. -</center> - diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9081-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9081-s.jpg deleted file mode 100644 index 734f0ba..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9081-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9081.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9081.jpg deleted file mode 100644 index 1d6b615..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9081.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9083-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9083-s.jpg deleted file mode 100644 index d50fc6f..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9083-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9083.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9083.jpg deleted file mode 100644 index 77fb082..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9083.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9084-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9084-s.jpg deleted file mode 100644 index 93a3832..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9084-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9084.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9084.jpg deleted file mode 100644 index b7c7c3b..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9084.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9086-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9086-s.jpg deleted file mode 100644 index 0c9ce17..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9086-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9086.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9086.jpg deleted file mode 100644 index caaf6a7..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9086.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9088-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9088-s.jpg deleted file mode 100644 index 6c7d06e..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9088-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9088.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9088.jpg deleted file mode 100644 index f7daf7a..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9088.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9099-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9099-s.jpg deleted file mode 100644 index 2794a4b..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9099-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9099.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9099.jpg deleted file mode 100644 index 57175e3..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9099.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9100-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9100-s.jpg deleted file mode 100644 index d1b3610..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9100-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9100.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9100.jpg deleted file mode 100644 index dd57db1..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9100.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9101-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9101-s.jpg deleted file mode 100644 index 2f14c53..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9101-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9101.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9101.jpg deleted file mode 100644 index 334a0f8..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9101.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9102-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9102-s.jpg deleted file mode 100644 index 6bec9fa..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9102-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9102.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9102.jpg deleted file mode 100644 index 6219a97..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9102.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9103-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9103-s.jpg deleted file mode 100644 index 61b9b59..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9103-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9103.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9103.jpg deleted file mode 100644 index d4a91e0..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9103.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9104-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9104-s.jpg deleted file mode 100644 index 9c7c4ab..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9104-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9104.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9104.jpg deleted file mode 100644 index 93eb9da..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9104.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9107-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9107-s.jpg deleted file mode 100644 index cacb8f6..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9107-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9107.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9107.jpg deleted file mode 100644 index f1da9d8..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9107.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9109-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9109-s.jpg deleted file mode 100644 index a999838..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9109-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9109.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9109.jpg deleted file mode 100644 index e3eeb3e..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9109.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9113-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9113-s.jpg deleted file mode 100644 index bf3aa59..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9113-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9113.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9113.jpg deleted file mode 100644 index 990e44b..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9113.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9115-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9115-s.jpg deleted file mode 100644 index 873beb5..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9115-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9115.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9115.jpg deleted file mode 100644 index e9f2fbb..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9115.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9117-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9117-s.jpg deleted file mode 100644 index 4119ae3..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9117-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9117.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9117.jpg deleted file mode 100644 index efa8fa8..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9117.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9118-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9118-s.jpg deleted file mode 100644 index 6ac0c46..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9118-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9118.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9118.jpg deleted file mode 100644 index 1ab033b..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9118.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9122-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9122-s.jpg deleted file mode 100644 index 4b75817..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9122-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9122.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9122.jpg deleted file mode 100644 index 0bbad05..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9122.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9123-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9123-s.jpg deleted file mode 100644 index f63f01a..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9123-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9123.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9123.jpg deleted file mode 100644 index 10f22cc..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9123.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9125-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9125-s.jpg deleted file mode 100644 index e18660f..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9125-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9125.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9125.jpg deleted file mode 100644 index e651619..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9125.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9127-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9127-s.jpg deleted file mode 100644 index 3f93502..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9127-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9127.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9127.jpg deleted file mode 100644 index d33f856..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9127.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9129-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9129-s.jpg deleted file mode 100644 index 43cd251..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9129-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9129.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9129.jpg deleted file mode 100644 index aa0820c..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9129.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9134-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9134-s.jpg deleted file mode 100644 index 8b73de1..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9134-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9134.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9134.jpg deleted file mode 100644 index 248ca28..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9134.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9138-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9138-s.jpg deleted file mode 100644 index 0c3fb87..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9138-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9138.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9138.jpg deleted file mode 100644 index ff93f90..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9138.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9142-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9142-s.jpg deleted file mode 100644 index 4571a4b..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9142-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9142.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9142.jpg deleted file mode 100644 index 647323b..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9142.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9149-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9149-s.jpg deleted file mode 100644 index e870f66..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9149-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9149.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9149.jpg deleted file mode 100644 index 23dd110..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9149.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9154-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9154-s.jpg deleted file mode 100644 index 3355eaa..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9154-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9154.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9154.jpg deleted file mode 100644 index 531ec1e..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9154.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9155-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9155-s.jpg deleted file mode 100644 index 9cd85f5..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9155-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9155.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9155.jpg deleted file mode 100644 index 72377b5..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9155.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9156-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9156-s.jpg deleted file mode 100644 index 2788d06..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9156-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9156.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9156.jpg deleted file mode 100644 index 2b836df..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9156.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9157-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9157-s.jpg deleted file mode 100644 index 9ef87c3..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9157-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9157.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9157.jpg deleted file mode 100644 index 753d1e9..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9157.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9158-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9158-s.jpg deleted file mode 100644 index 29953c4..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9158-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9158.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9158.jpg deleted file mode 100644 index a4a0247..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9158.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9159-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9159-s.jpg deleted file mode 100644 index 7caf368..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9159-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9159.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9159.jpg deleted file mode 100644 index 9f18ed6..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9159.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9162-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9162-s.jpg deleted file mode 100644 index 65bc52f..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9162-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9162.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9162.jpg deleted file mode 100644 index b0f299d..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9162.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9165-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9165-s.jpg deleted file mode 100644 index d1e9cc3..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9165-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9165.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9165.jpg deleted file mode 100644 index 862c6f8..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9165.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/ad-jre.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/ad-jre.jpg deleted file mode 100644 index 5c7b519..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/ad-jre.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/ad-netbeans.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/ad-netbeans.jpg deleted file mode 100644 index 079b2fa..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/ad-netbeans.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/ad-sdk.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/ad-sdk.jpg deleted file mode 100644 index 2a1a88a..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/ad-sdk.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/african-spurred-tortoise-thumb.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/african-spurred-tortoise-thumb.jpg deleted file mode 100644 index 4d1ed42..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/african-spurred-tortoise-thumb.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/african-spurred-tortoise.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/african-spurred-tortoise.jpg deleted file mode 100644 index 87ea286..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/african-spurred-tortoise.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/african-spurred-tortoise2-thumb.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/african-spurred-tortoise2-thumb.jpg deleted file mode 100644 index 7b76088..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/african-spurred-tortoise2-thumb.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/african-spurred-tortoise2.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/african-spurred-tortoise2.jpg deleted file mode 100644 index 8005ff3..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/african-spurred-tortoise2.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/anthony-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/anthony-s.jpg deleted file mode 100644 index 4b21f49..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/anthony-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/anthony.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/anthony.jpg deleted file mode 100644 index 88a889c..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/anthony.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bailey-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bailey-s.jpg deleted file mode 100644 index 8adf561..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bailey-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bailey.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bailey.jpg deleted file mode 100644 index c262965..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bailey.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/banner_logo.gif b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/banner_logo.gif deleted file mode 100644 index 85de81a..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/banner_logo.gif and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bird1.gif b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bird1.gif deleted file mode 100644 index 06f1abe..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bird1.gif and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bird2.gif b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bird2.gif deleted file mode 100644 index 9601f1c..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bird2.gif and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bird3.gif b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bird3.gif deleted file mode 100644 index f48a7ec..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bird3.gif and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bird4.gif b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bird4.gif deleted file mode 100644 index eaaa3e5..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bird4.gif and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bird5.gif b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bird5.gif deleted file mode 100644 index 9f440f1..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bird5.gif and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bird6.gif b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bird6.gif deleted file mode 100644 index affd8e0..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bird6.gif and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/birds_icon.gif b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/birds_icon.gif deleted file mode 100644 index 8b14629..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/birds_icon.gif and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/biscuit-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/biscuit-s.jpg deleted file mode 100644 index 8c54af1..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/biscuit-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/biscuit.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/biscuit.jpg deleted file mode 100644 index ccdea14..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/biscuit.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bob-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bob-s.jpg deleted file mode 100644 index b3f1d09..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bob-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bob.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bob.jpg deleted file mode 100644 index d3dcfd7..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bob.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/box-turtle-thumb.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/box-turtle-thumb.jpg deleted file mode 100644 index a4b48da..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/box-turtle-thumb.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/box-turtle.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/box-turtle.jpg deleted file mode 100644 index 5a172c5..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/box-turtle.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/box-turtle2-thumb.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/box-turtle2-thumb.jpg deleted file mode 100644 index 40303af..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/box-turtle2-thumb.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/box-turtle2.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/box-turtle2.jpg deleted file mode 100644 index 83d74d2..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/box-turtle2.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/box-turtle3-thumb.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/box-turtle3-thumb.jpg deleted file mode 100644 index 004dfe3..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/box-turtle3-thumb.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/box-turtle3.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/box-turtle3.jpg deleted file mode 100644 index 3e77142..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/box-turtle3.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/california-desert-tortoise-thumb.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/california-desert-tortoise-thumb.jpg deleted file mode 100644 index 4c260e8..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/california-desert-tortoise-thumb.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/california-desert-tortoise.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/california-desert-tortoise.jpg deleted file mode 100644 index b146396..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/california-desert-tortoise.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/carp-car-med.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/carp-car-med.jpg deleted file mode 100644 index 742336f..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/carp-car-med.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/carp-car-thumb.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/carp-car-thumb.jpg deleted file mode 100644 index e5bbc24..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/carp-car-thumb.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat1.gif b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat1.gif deleted file mode 100644 index 1fd4d1c..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat1.gif and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat10.gif b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat10.gif deleted file mode 100644 index 8bc7f6c..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat10.gif and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat11.gif b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat11.gif deleted file mode 100644 index a51bc96..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat11.gif and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat12.gif b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat12.gif deleted file mode 100644 index e594c67..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat12.gif and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat2.gif b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat2.gif deleted file mode 100644 index 6ac8718..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat2.gif and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat3.gif b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat3.gif deleted file mode 100644 index 4716f5d..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat3.gif and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat4.gif b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat4.gif deleted file mode 100644 index 0793e3f..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat4.gif and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat5.gif b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat5.gif deleted file mode 100644 index 2d289ba..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat5.gif and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat6.gif b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat6.gif deleted file mode 100644 index 2ea6132..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat6.gif and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat7.gif b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat7.gif deleted file mode 100644 index 159ba6a..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat7.gif and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat8.gif b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat8.gif deleted file mode 100644 index a9ed7c9..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat8.gif and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat9.gif b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat9.gif deleted file mode 100644 index 02faffb..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat9.gif and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/catalog-thumb-g.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/catalog-thumb-g.jpg deleted file mode 100644 index 1a13b11..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/catalog-thumb-g.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/catalog-thumb.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/catalog-thumb.jpg deleted file mode 100644 index d6148de..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/catalog-thumb.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cats_icon.gif b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cats_icon.gif deleted file mode 100644 index db70d7d..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cats_icon.gif and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cbutton.gif b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cbutton.gif deleted file mode 100644 index 83b8761..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cbutton.gif and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/chantelle-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/chantelle-s.jpg deleted file mode 100644 index 84e4e89..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/chantelle-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/chantelle.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/chantelle.jpg deleted file mode 100644 index 5830e57..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/chantelle.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/charlie-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/charlie-s.jpg deleted file mode 100644 index bb91e94..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/charlie-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/charlie.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/charlie.jpg deleted file mode 100644 index 9e8d17d..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/charlie.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/check_all.gif b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/check_all.gif deleted file mode 100644 index 3c517f3..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/check_all.gif and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cuttlefish-med.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cuttlefish-med.jpg deleted file mode 100644 index 575a854..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cuttlefish-med.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cuttlefish-thumb.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cuttlefish-thumb.jpg deleted file mode 100644 index 9c2dc57..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cuttlefish-thumb.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dog1.gif b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dog1.gif deleted file mode 100644 index 92e71b5..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dog1.gif and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dog2.gif b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dog2.gif deleted file mode 100644 index e581980..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dog2.gif and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dog3.gif b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dog3.gif deleted file mode 100644 index 9baa503..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dog3.gif and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dog4.gif b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dog4.gif deleted file mode 100644 index 9124427..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dog4.gif and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dog5.gif b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dog5.gif deleted file mode 100644 index 3f1690e..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dog5.gif and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dog6.gif b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dog6.gif deleted file mode 100644 index 2bf1380..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dog6.gif and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dogs_icon.gif b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dogs_icon.gif deleted file mode 100644 index b13e5b9..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dogs_icon.gif and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dragon-iron-med.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dragon-iron-med.jpg deleted file mode 100644 index ff83a16..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dragon-iron-med.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dragon-iron-thumb.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dragon-iron-thumb.jpg deleted file mode 100644 index 814dab1..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dragon-iron-thumb.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/eagle-stone-med.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/eagle-stone-med.jpg deleted file mode 100644 index 2623f3c..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/eagle-stone-med.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/eagle-stone-thumb.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/eagle-stone-thumb.jpg deleted file mode 100644 index ccf10a2..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/eagle-stone-thumb.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/eclectus-female-med.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/eclectus-female-med.jpg deleted file mode 100644 index 7a7a59e..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/eclectus-female-med.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/eclectus-female-thumb.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/eclectus-female-thumb.jpg deleted file mode 100644 index 1f65136..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/eclectus-female-thumb.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/elkie-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/elkie-s.jpg deleted file mode 100644 index 4709e19..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/elkie-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/elkie.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/elkie.jpg deleted file mode 100644 index 76a7ff1..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/elkie.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/faith-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/faith-s.jpg deleted file mode 100644 index 13194bd..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/faith-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/faith.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/faith.jpg deleted file mode 100644 index cd8ad6e..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/faith.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/fish2.gif b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/fish2.gif deleted file mode 100644 index 4d9916c..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/fish2.gif and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/fish3.gif b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/fish3.gif deleted file mode 100644 index 258489d..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/fish3.gif and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/fish4.gif b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/fish4.gif deleted file mode 100644 index d3e39e1..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/fish4.gif and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/fish_icon.gif b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/fish_icon.gif deleted file mode 100644 index 730c813..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/fish_icon.gif and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/florida-king-snake-thumb.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/florida-king-snake-thumb.jpg deleted file mode 100644 index cbe5030..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/florida-king-snake-thumb.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/florida-king-snake.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/florida-king-snake.jpg deleted file mode 100644 index 11954df..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/florida-king-snake.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/frog1.gif b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/frog1.gif deleted file mode 100644 index 4bf637f..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/frog1.gif and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/gaetano-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/gaetano-s.jpg deleted file mode 100644 index 097b144..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/gaetano-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/gaetano.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/gaetano.jpg deleted file mode 100644 index ec5d64b..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/gaetano.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/galah-parrot-med.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/galah-parrot-med.jpg deleted file mode 100644 index 31bb43c..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/galah-parrot-med.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/galah-parrot-thumb.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/galah-parrot-thumb.jpg deleted file mode 100644 index 70cdc2a..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/galah-parrot-thumb.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/glassfish-colored-med.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/glassfish-colored-med.jpg deleted file mode 100644 index a6646c7..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/glassfish-colored-med.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/glassfish-colored-thumb.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/glassfish-colored-thumb.jpg deleted file mode 100644 index 262659a..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/glassfish-colored-thumb.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/guinea-pig-thumb.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/guinea-pig-thumb.jpg deleted file mode 100644 index ea0c069..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/guinea-pig-thumb.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/guinea-pig.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/guinea-pig.jpg deleted file mode 100644 index 828bba2..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/guinea-pig.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/harmony-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/harmony-s.jpg deleted file mode 100644 index 5b28bd0..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/harmony-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/harmony.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/harmony.jpg deleted file mode 100644 index 3c4d322..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/harmony.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/harrison-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/harrison-s.jpg deleted file mode 100644 index c7c1486..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/harrison-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/harrison.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/harrison.jpg deleted file mode 100644 index 6003c8c..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/harrison.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/hawaiian-lizard-med.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/hawaiian-lizard-med.jpg deleted file mode 100644 index a538759..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/hawaiian-lizard-med.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/hawaiian-lizard-thumb.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/hawaiian-lizard-thumb.jpg deleted file mode 100644 index 2369c90..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/hawaiian-lizard-thumb.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/honey-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/honey-s.jpg deleted file mode 100644 index 13c3f9b..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/honey-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/honey.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/honey.jpg deleted file mode 100644 index 61d877b..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/honey.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/hunter-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/hunter-s.jpg deleted file mode 100644 index 4303498..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/hunter-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/hunter.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/hunter.jpg deleted file mode 100644 index 37ebbe9..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/hunter.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/index-thumb-g.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/index-thumb-g.jpg deleted file mode 100644 index a42ddb4..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/index-thumb-g.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/index-thumb.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/index-thumb.jpg deleted file mode 100644 index 571475a..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/index-thumb.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/indicator-black.gif b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/indicator-black.gif deleted file mode 100644 index 6da716a..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/indicator-black.gif and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/ja_flag.gif b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/ja_flag.gif deleted file mode 100644 index 31d0ada..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/ja_flag.gif and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/jack-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/jack-s.jpg deleted file mode 100644 index d4144da..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/jack-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/jack.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/jack.jpg deleted file mode 100644 index fe37700..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/jack.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/katzen-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/katzen-s.jpg deleted file mode 100644 index d83d3f9..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/katzen-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/katzen.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/katzen.jpg deleted file mode 100644 index ba460be..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/katzen.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/koi-med.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/koi-med.jpg deleted file mode 100644 index 7afa021..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/koi-med.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/koi-thumb.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/koi-thumb.jpg deleted file mode 100644 index f7fa2b2..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/koi-thumb.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/kookaburra-med.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/kookaburra-med.jpg deleted file mode 100644 index 8c06c3d..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/kookaburra-med.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/kookaburra-thumb.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/kookaburra-thumb.jpg deleted file mode 100644 index 84e82f5..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/kookaburra-thumb.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/lady-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/lady-s.jpg deleted file mode 100644 index 72a724f..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/lady-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/lady.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/lady.jpg deleted file mode 100644 index ae9054e..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/lady.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/left.gif b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/left.gif deleted file mode 100644 index 46b3630..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/left.gif and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/left_2.gif b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/left_2.gif deleted file mode 100644 index f50cbed..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/left_2.gif and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/leopard-gecko-thumb.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/leopard-gecko-thumb.jpg deleted file mode 100644 index 620c826..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/leopard-gecko-thumb.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/leopard-gecko-thumb2.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/leopard-gecko-thumb2.jpg deleted file mode 100644 index 2a52e80..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/leopard-gecko-thumb2.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/leopard-gecko.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/leopard-gecko.jpg deleted file mode 100644 index 7b77428..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/leopard-gecko.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/leopard-gecko2.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/leopard-gecko2.jpg deleted file mode 100644 index b3748ae..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/leopard-gecko2.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/lizard1.gif b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/lizard1.gif deleted file mode 100644 index 665c4d6..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/lizard1.gif and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/lizard2.gif b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/lizard2.gif deleted file mode 100644 index 2e59d89..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/lizard2.gif and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/lizard3.gif b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/lizard3.gif deleted file mode 100644 index 6dca58f..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/lizard3.gif and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/lovebird-med.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/lovebird-med.jpg deleted file mode 100644 index cef3163..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/lovebird-med.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/lovebird-thumb.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/lovebird-thumb.jpg deleted file mode 100644 index 7e97d51..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/lovebird-thumb.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/macaw-thumb.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/macaw-thumb.jpg deleted file mode 100644 index a95ff80..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/macaw-thumb.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/macaw.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/macaw.jpg deleted file mode 100644 index b7ae026..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/macaw.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/maggie-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/maggie-s.jpg deleted file mode 100644 index 7acf48e..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/maggie-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/maggie.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/maggie.jpg deleted file mode 100644 index 140a325..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/maggie.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/marianna-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/marianna-s.jpg deleted file mode 100644 index 4b96d8d..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/marianna-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/marianna.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/marianna.jpg deleted file mode 100644 index 5e3b381..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/marianna.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/mario-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/mario-s.jpg deleted file mode 100644 index f2f1848..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/mario-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/mario.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/mario.jpg deleted file mode 100644 index a68cd9e..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/mario.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/maximize.gif b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/maximize.gif deleted file mode 100644 index da05f30..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/maximize.gif and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/mexican-redkneed-tarantula-thumb.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/mexican-redkneed-tarantula-thumb.jpg deleted file mode 100644 index 35387ca..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/mexican-redkneed-tarantula-thumb.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/mexican-redkneed-tarantula.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/mexican-redkneed-tarantula.jpg deleted file mode 100644 index 7365af9..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/mexican-redkneed-tarantula.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/mimi-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/mimi-s.jpg deleted file mode 100644 index 0e6a1a5..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/mimi-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/mimi.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/mimi.jpg deleted file mode 100644 index 950c84e..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/mimi.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/minimize.gif b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/minimize.gif deleted file mode 100644 index 8408264..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/minimize.gif and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/monique-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/monique-s.jpg deleted file mode 100644 index dea6b6d..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/monique-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/monique.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/monique.jpg deleted file mode 100644 index 0f0ac10..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/monique.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/moon-jelly-med.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/moon-jelly-med.jpg deleted file mode 100644 index 3c7618a..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/moon-jelly-med.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/moon-jelly-thumb.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/moon-jelly-thumb.jpg deleted file mode 100644 index e765076..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/moon-jelly-thumb.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/octopus-red-med.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/octopus-red-med.jpg deleted file mode 100644 index 7c7d897..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/octopus-red-med.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/octopus-red-thumb.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/octopus-red-thumb.jpg deleted file mode 100644 index 4cdb8bb..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/octopus-red-thumb.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/octopus-white-med.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/octopus-white-med.jpg deleted file mode 100644 index f38af83..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/octopus-white-med.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/octopus-white-thumb.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/octopus-white-thumb.jpg deleted file mode 100644 index bec9ee6..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/octopus-white-thumb.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/olie-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/olie-s.jpg deleted file mode 100644 index 9bb9a17..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/olie-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/olie.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/olie.jpg deleted file mode 100644 index c91be8e..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/olie.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/paris-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/paris-s.jpg deleted file mode 100644 index f4ce9ec..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/paris-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/paris.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/paris.jpg deleted file mode 100644 index b599c76..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/paris.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/parrot-popcorn-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/parrot-popcorn-s.jpg deleted file mode 100644 index cae1408..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/parrot-popcorn-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/parrot-popcorn.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/parrot-popcorn.jpg deleted file mode 100644 index 57e02ff..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/parrot-popcorn.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/peacock-blue-med.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/peacock-blue-med.jpg deleted file mode 100644 index 758ed35..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/peacock-blue-med.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/peacock-blue-thumb.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/peacock-blue-thumb.jpg deleted file mode 100644 index 3aec8c4..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/peacock-blue-thumb.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/peacock-med.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/peacock-med.jpg deleted file mode 100644 index 13164b8..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/peacock-med.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/peacock-thumb.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/peacock-thumb.jpg deleted file mode 100644 index fbd5412..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/peacock-thumb.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/peacock-white-thumb.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/peacock-white-thumb.jpg deleted file mode 100644 index 148006d..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/peacock-white-thumb.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/peakcock-white-med.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/peakcock-white-med.jpg deleted file mode 100644 index f25a814..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/peakcock-white-med.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/prehensile-tailed-skink-thumb.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/prehensile-tailed-skink-thumb.jpg deleted file mode 100644 index 2d9c2b1..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/prehensile-tailed-skink-thumb.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/prehensile-tailed-skink.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/prehensile-tailed-skink.jpg deleted file mode 100644 index 3573943..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/prehensile-tailed-skink.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/prehensile-tailed-skink2-thumb.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/prehensile-tailed-skink2-thumb.jpg deleted file mode 100644 index 9be6e41..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/prehensile-tailed-skink2-thumb.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/prehensile-tailed-skink2.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/prehensile-tailed-skink2.jpg deleted file mode 100644 index 0559845..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/prehensile-tailed-skink2.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/princess-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/princess-s.jpg deleted file mode 100644 index d4521a3..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/princess-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/princess.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/princess.jpg deleted file mode 100644 index 370e4fd..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/princess.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/puppup-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/puppup-s.jpg deleted file mode 100644 index 5b89061..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/puppup-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/puppup.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/puppup.jpg deleted file mode 100644 index efff187..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/puppup.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/purple-jellyfish-med.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/purple-jellyfish-med.jpg deleted file mode 100644 index 93af55f..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/purple-jellyfish-med.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/purple-jellyfish-thumb.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/purple-jellyfish-thumb.jpg deleted file mode 100644 index d751856..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/purple-jellyfish-thumb.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/rainbow-lorikeet-med.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/rainbow-lorikeet-med.jpg deleted file mode 100644 index 9c72270..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/rainbow-lorikeet-med.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/rainbow-lorikeet-thumb.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/rainbow-lorikeet-thumb.jpg deleted file mode 100644 index 9003e0c..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/rainbow-lorikeet-thumb.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/reptiles_icon.gif b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/reptiles_icon.gif deleted file mode 100644 index 0ee4c52..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/reptiles_icon.gif and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/right.gif b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/right.gif deleted file mode 100644 index 89e7ba1..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/right.gif and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/rita-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/rita-s.jpg deleted file mode 100644 index 16d1692..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/rita-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/rita.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/rita.jpg deleted file mode 100644 index f183f1c..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/rita.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/rockfish-med.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/rockfish-med.jpg deleted file mode 100644 index 005d708..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/rockfish-med.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/rockfish-thumb.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/rockfish-thumb.jpg deleted file mode 100644 index e82c87d..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/rockfish-thumb.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/sabrina-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/sabrina-s.jpg deleted file mode 100644 index 508edb1..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/sabrina-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/sabrina.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/sabrina.jpg deleted file mode 100644 index 870c2f3..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/sabrina.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/sea-anemone-med.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/sea-anemone-med.jpg deleted file mode 100644 index a18e30a..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/sea-anemone-med.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/sea-anemone-thumb.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/sea-anemone-thumb.jpg deleted file mode 100644 index febadd3..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/sea-anemone-thumb.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/sea-nettle-jellyfish-med.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/sea-nettle-jellyfish-med.jpg deleted file mode 100644 index c7329f4..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/sea-nettle-jellyfish-med.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/sea-nettle-jellyfish-thumb.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/sea-nettle-jellyfish-thumb.jpg deleted file mode 100644 index 3753577..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/sea-nettle-jellyfish-thumb.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/seller-thumb-g.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/seller-thumb-g.jpg deleted file mode 100644 index a9c45e8..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/seller-thumb-g.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/seller-thumb.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/seller-thumb.jpg deleted file mode 100644 index 2b7adf1..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/seller-thumb.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/simba-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/simba-s.jpg deleted file mode 100644 index 93e78ee..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/simba-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/simba.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/simba.jpg deleted file mode 100644 index cdbb5fb..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/simba.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/splash.gif b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/splash.gif deleted file mode 100644 index cdae47c..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/splash.gif and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/spotted-jellyfish-med.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/spotted-jellyfish-med.jpg deleted file mode 100644 index 6c1e407..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/spotted-jellyfish-med.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/spotted-jellyfish-thumb.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/spotted-jellyfish-thumb.jpg deleted file mode 100644 index 991392d..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/spotted-jellyfish-thumb.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/thaicat-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/thaicat-s.jpg deleted file mode 100644 index 49898fb..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/thaicat-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/thaicat.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/thaicat.jpg deleted file mode 100644 index eb43a52..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/thaicat.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/thaidog-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/thaidog-s.jpg deleted file mode 100644 index c918e36..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/thaidog-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/thaidog.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/thaidog.jpg deleted file mode 100644 index f5063e3..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/thaidog.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/uncheck_all.gif b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/uncheck_all.gif deleted file mode 100644 index 39fa7ba..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/uncheck_all.gif and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/us_flag.gif b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/us_flag.gif deleted file mode 100644 index 52bc595..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/us_flag.gif and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/zh_flag.gif b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/zh_flag.gif deleted file mode 100644 index 0393bc1..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/zh_flag.gif and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/index-ajax.jsp b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/index-ajax.jsp deleted file mode 100644 index 9ce0b8d..0000000 --- a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/index-ajax.jsp +++ /dev/null @@ -1,239 +0,0 @@ -<%-- Copyright 2006 Sun Microsystems, Inc. All rights reserved. You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at: http://developer.sun.com/berkeley_license.html -$Id: index.jsp,v 1.17 2007/03/15 23:19:46 basler Exp $ --%> -<%@page contentType="text/html"%> -<%@page pageEncoding="UTF-8"%> -<%@page import="java.util.*, com.sun.javaee.blueprints.petstore.model.CatalogFacade, com.sun.javaee.blueprints.petstore.model.Tag"%> - -<% -try { - CatalogFacade cf = (CatalogFacade)config.getServletContext().getAttribute("CatalogFacade"); - List<Tag> tags=cf.getTagsInChunk(0, 12); - // since top 20 come from database or desending refCount order, need to reorder by tag name - Collections.sort(tags, new Comparator() { - public int compare(Object one, Object two) { - int cc=((Tag)two).getTag().compareTo(((Tag)one).getTag()); - return (cc < 0 ? 1 : cc > 0 ? -1 : 0); - } - }); -%> - -<html> - <head> - <meta http-equiv="Content-Type" content="text/html;charset=utf-8" > - <title>Java Pet Store Reference Application</title> - <script type="text/javascript" src="./common.js"></script> - <link type="text/css" rel="stylesheet" href="./tag.css"/> - <script type="text/javascript"> - //var djConfig = {isDebug: true }; - </script> - </head> - <body> - - <jsp:include page="banner.jsp" /> - <script> - dojo.require("dojo.widget.FisheyeList"); - dojo.require("dojo.io.*"); - dojo.require("dojo.io.ScriptSrcIO"); - //transport: "ScriptSrcTransport", - //url: "http://localhost:8080/petstore/downloadAd.json", - - function browse(category) { - window.location.href="${pageContext.request.contextPath}/faces/catalog.jsp?catid=" + category; - - } - - - function debugProperties(namex) { - var listx=""; - var ob=namex; - for(xx in ob) { - listx += xx + " = " + ob[xx] + "<br/>" - } - //document.write(listx); - alert(listx); - } - - function checkAdPage() { - var bindArgs = { - //url: "https://blueprints.dev.java.net/petstore/downloadAd.json", - //url: "http://localhost:8080/petstore/downloadAd.json", - url: "http://search.yahooapis.com/ImageSearchService/V1/imageSearch?appid=YahooDem...", - transport: "ScriptSrcTransport", - jsonParamName: "callback", - mimetype: "text/json", - load: function(type, data, event, kwArgs) { - /* type will be "load", data will be response data, event will null, and kwArgs are the keyword arguments used in the dojo.io.bind call. */ - alert("load = " + data.ResultSet.totalResultsAvailable); - //debugProperties(data); - //document.getElementById("downloadAds").innerHTML=data.downloadxx; - - - }, - error: function(type, data, event, kwArgs) { - /* type will be "error", data will be response data, event will null, and kwArgs are the keyword arguments used in the dojo.io.bind call. */ - alert("error"); - }, - timeout: function() { - /* Called if there is a timeout */ - alert("timeout"); - }, - timeoutSeconds: 10}; - // dispatch the request - dojo.io.bind(bindArgs); - } - - function callback() { - alert("callback"); - } - - function returnFunctionx(type, data, evt) { - // statically setup popup for simple case - // check return of the dojo call to make sure it is valid - if (evt.readyState == 4) { - if (evt.status == 200) { - alert("data = " + data.downloadxx); - //document.getElementById("downloadAds").innerHTML=data; - document.getElementById("downloadAds").innerHTML=data.downloadxx; - } - } - } - - function testit() { - testx={download:"test", textx:"it"}; - alert("test = " + testx.download); - } - - - </script> - <span onclick="checkAdPage();">test it</span> - - - <table bgcolor="white"> - <tr> - <td valign="top"> - <div class="outerbar" style="width: 200px"> - - <div dojoType="FisheyeList" - itemWidth="170" itemHeight="50" - itemMaxWidth="340" itemMaxHeight="100" - orientation="vertical" - effectUnits="2" - itemPadding="10" - attachEdge="top" - labelEdge="bottom" - enableCrappySvgSupport="false"> - - <div dojoType="FisheyeListItem" onClick="browse('Dogs');" - iconsrc="${pageContext.request.contextPath}/images/dogs_icon.gif"> - </div> - - <div dojoType="FisheyeListItem" onClick="browse('Cats');" - iconsrc="${pageContext.request.contextPath}/images/cats_icon.gif"> - </div> - - <div dojoType="FisheyeListItem" onClick="browse('Birds');" - iconsrc="${pageContext.request.contextPath}/images/birds_icon.gif"> - </div> - - <div dojoType="FisheyeListItem" onClick="browse('Fish');" - iconsrc="${pageContext.request.contextPath}/images/fish_icon.gif"> - </div> - - <div dojoType="FisheyeListItem" onClick="browse('Reptiles');" - iconsrc="${pageContext.request.contextPath}/images/reptiles_icon.gif"> - </div> - </div> - - </div> - </td> - <td valign="top" style="width: 400px"> - <div id="bodyCenter"> - <table valign="top" id="bodyTable" border="0"> - <tr> - <td> - <map name="petmap"> - <area onmouseover="javascript:this.style.cursor='pointer';" onclick="browse('Birds')" - alt="Birds" - coords="72,2,280,250"> - <area onmouseover="javascript:this.style.cursor='pointer';" onclick="browse('Fish')" - alt="Fish" - coords="2,180,72,250"> - <area onmouseover="javascript:this.style.cursor='pointer';" onclick="browse('Dogs')" - alt="Dogs" - coords="60,250,130,320"> - <area onmouseover="javascript:this.style.cursor='pointer';" onclick="browse('Reptiles')" - alt="Reptiles" - coords="140,270,210,340"> - <area onmouseover="javascript:this.style.cursor='pointer';" onclick="browse('Cats')" - alt="Cats" - coords="225,240,295,310"> - <area onmouseover="javascript:this.style.cursor='pointer';" onclick="browse('Birds')" - alt="Birds" - coords="280,180,350,250"> - </map> - - <img src="${pageContext.request.contextPath}/images/splash.gif" - alt="Pet Selection Map" - usemap="#petmap" - width="350" - height="355" - border="0"> - </td> - </tr> - </table> - - </div> - </td> - <td style="vertical-align:top;"> - <div style="border-style: double; width:100%;"> - <table border="0"> - <tr> - <th colspan="2" style="text-align:center">Most Popular Tags</th> - </tr> - <tr> -<% - String style=null; - int refx=0, ii=0; - for(Tag tag : tags) { - refx=tag.getRefCount() / 5; - if(refx >= 3) { - style="xxlarge"; - } else if(refx == 2) { - style="xlarge"; - } else if(refx == 1) { - style="large"; - } else { - style="medium"; - } - - if((ii % 2) == 0) out.println("</tr>\n<tr>"); - out.println("<td class='tagCell' style='text-align: center'><a href='./tag.jsp?tag=" + - tag.getTag() + "'><span class='" + style +"'>" + tag.getTag() + "</span></a></td>"); - ii++; - } -%> - </tr> - </table> - </div> - </td> - <td valign="top" style="vertical-align:top; width:250px;"> - <div id="downloadAds"> - <jsp:include page="download.jsp" /> - </div> - </td> - </tr> - </table> - - <div style="position: absolute; visibility: hidden;z-index:5" id="menu-popup"> - <table id="completeTable" class="popupTable" ></table> - </div> - - <br/><br/> - <jsp:include page="footer.jsp" /> - </body> -</html> -<% - } catch(Exception e) { - e.printStackTrace(); - } -%> diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/index.html b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/index.html deleted file mode 100644 index 8c5ca1b..0000000 --- a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/index.html +++ /dev/null @@ -1,117 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> -<html> -<head> - <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> - <title>Java Pet Store Reference Application, 2.0 Early Access</title> -</head> -<body> -<hr> -<h1>Java Pet Store Reference Application, 2.0 Early Access</h1> -<h2><a href="./faces/index.jsp">Enter the Store</a></h2> -The Java Pet Store Reference Application is a sample application -brought to -you by the <a href="http://blueprints.dev.java.net/">Java BluePrints</a> -program at <a href="http://sun.com">Sun Microsystems</a>. -This application is designed to illustrate how the Java EE 5 Platform -can be used to develop an AJAX-enabled Web 2.0 application. The -application comes with full source-code available under a -BSD-style license, so you can experiment with it and use it in your own -applications. <br> -<br> -<a href="#try">Try the Petstore Demo</a><br> -<a href="#learn">Learn more about features in Java Petstore</a><br> -<a href="#contributors">Show appreciation for Pet Store image -contributors</a><br> -<a href="#about">About BluePrints</a> -<h2><a name="try"></a>Try the Pet Store Demo</h2> -Now that you have the application deployed, you can use it and try out -the features. You can browse the catalog of pets for sale, sell your -own pets on the store, search for pets by location using Google maps, -view the RSS news bar for BluePrints news, and more.<a - href="./faces/index.jsp">Enter the Store</a> -<h2><a name="features"></a>Learn More About Features in Java Petstore</h2> -<p>Here are some of the features of this application. For a detailed -description of the features in the Java Pet -Store Reference application, please refer to the article at <a - href="http://java.sun.com/developer/technicalArticles/J2EE/petstore/%22%3Ehttp://j...</a><a - href="http://java.sun.com/developer/technicalArticles/J2EE/petstore/%22%3E</a><b> -</b></p> -<ol> - <li>Using AJAX for single-page interactive Web applications: The -application is designed to be a single-page application where the user -never leaves the page. Different sections of the page are dynamically -loaded based on the user actions. These sections are loaded -asynchronously to avoid any browser refreshes, and to give a richer -interactive user-experience. </li> - <li>Mash-ups with Google maps: The petstore uses a mashup with -Google's Map service, alongwith Yahoo's Geo-coder service to allow -users to see the available pets in a neighborhood. </li> - <li>Community-created content: The application allows a user to add a -pet for sale or adoption on the Website. The seller uploads </li> - <ol> - <li>Using Captchas to discourage spam in the community created -content: Whenever a website allows its users to add content, it needs -to build mechanisms to discourage placement of spurious content on its -Website through automated mechanisms. We demonstrate how captchas can -be used for this purpose. </li> - <li>Community rated content: Each item in the petstore website can -be rated by the users </li> - <li>Payments through PayPal: The application provides a meeting -ground for -buyers and sellers of pets. The application uses the PayPal service to -allow sellers to accept payments.</li> - </ol> - <li>Integration of an RSS feed: The website integrates an RSS feed of -news items coming out the Java BluePrints website. The </li> - <li>Integration of a search engine: The application integrates -Apache Lucene search engine to handle all website searches. </li> -</ol> -This application also demonstrate the use of various features of -the Java EE 5 platform such as: <br> -<ol> - <li>JavaServer Faces: Many of the AJAX features are implemented as -reusable JavaServer Faces components. </li> - <li>Java Persistence API: The application uses Java Persistence APIs -to create an object/relational mapping layer. </li> - <li>Dependency Injection: The application uses dependency injection -instead of deployment descriptors.</li> -</ol> -See the <a - href="https://blueprints.dev.java.net/petstore/architecture.html%22%3EPet -Store Architecure document</a> for more detail. -<h2><a name="contributors"></a>Show Appreciation for Pet Store Image -Contributors</h2> -<p>For many images in the Java Petstore, some organizations and people -were kind enough to give us permission to photograph their animals or -even give us photos to use in the Java Petstore. See the <a - href="https://blueprints.dev.java.net/petstore/imagecontributors.html%22%3E -image contributors </a> page for a more detail on these friends of the -animals. -</p> -<h2><a name="about"></a>About Java BluePrints</h2> -<p>The Java BluePrints program defines the application programming -model for the Java EE™ platform. It provides best practice guidelines -and -architectural recommendations for real-world application scenarios to -enable developers to build portable, scalable, and robust applications -using the Java EE technologies.<br> -<br> -Some other popular projects from Java BluePrints are <a - href="http://blueprints.dev.java.net/bpcatalog/%22%3EJava BluePrints -Solutions Catalog</a>, <a target="_blank" - href="https://blueprints.dev.java.net/adventurebuilder/%22%3EJava -Adventure Builder Reference</a> application, <a target="_blank" - href="http://java.sun.com/blueprints/guidelines/designing_webservices/%22%3EDesign... -Web Services with the J2EE(TM) 1.4 Platform : JAX-RPC, SOAP, and XML -Technologies</a> book, and the <a target="_blank" - href="http://java.sun.com/blueprints/guidelines/designing_enterprise_applications_...<span - class="body"><span class="title">Designing -Enterprise Applications with the J2EE Platform, Second Edition</span></span></a> -book. You can access these projects and other content from Java -BluePrints by visiting the <a target="_blank" - href="http://java.sun.com/reference/blueprints/index.html%22%3EJava -BluePrints website</a>. </p> -<hr noshade="noshade">Copyright © 2007 Sun Microsystems, -Inc. All Rights Reserved. -</body> -</html> diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/index.jsp b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/index.jsp deleted file mode 100644 index ab59139..0000000 --- a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/index.jsp +++ /dev/null @@ -1,164 +0,0 @@ -<%-- Copyright 2006 Sun Microsystems, Inc. All rights reserved. You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at: http://developer.sun.com/berkeley_license.html -$Id: index.jsp,v 1.20 2007/03/16 20:18:59 basler Exp $ --%> -<%@page contentType="text/html"%> -<%@page pageEncoding="UTF-8"%> -<%@page import="java.util.*, com.sun.javaee.blueprints.petstore.model.CatalogFacade, com.sun.javaee.blueprints.petstore.model.Tag"%> - -<% -try { - CatalogFacade cf = (CatalogFacade)config.getServletContext().getAttribute("CatalogFacade"); - List<Tag> tags=cf.getTagsInChunk(0, 12); - // since top 20 come from database or desending refCount order, need to reorder by tag name - Collections.sort(tags, new Comparator() { - public int compare(Object one, Object two) { - int cc=((Tag)two).getTag().compareTo(((Tag)one).getTag()); - return (cc < 0 ? 1 : cc > 0 ? -1 : 0); - } - }); -%> - -<html> - <head> - <meta http-equiv="Content-Type" content="text/html;charset=utf-8" > - <title>Java Pet Store Reference Application</title> - <link type="text/css" rel="stylesheet" href="./tag.css"/> - </head> - <body> - - <jsp:include page="banner.jsp" /> - <script> - dojo.require("dojo.widget.FisheyeList"); - function browse(category) { - window.location.href="${pageContext.request.contextPath}/faces/catalog.jsp?catid=" + category; - } - </script> - <table bgcolor="white"> - <tr> - <td valign="top"> - <div class="outerbar" style="width: 200px"> - - <div dojoType="FisheyeList" - itemWidth="170" itemHeight="50" - itemMaxWidth="340" itemMaxHeight="100" - orientation="vertical" - effectUnits="2" - itemPadding="10" - attachEdge="top" - labelEdge="bottom" - enableCrappySvgSupport="false"> - - <div dojoType="FisheyeListItem" onClick="browse('Dogs');" - iconsrc="${pageContext.request.contextPath}/images/dogs_icon.gif"> - </div> - - <div dojoType="FisheyeListItem" onClick="browse('Cats');" - iconsrc="${pageContext.request.contextPath}/images/cats_icon.gif"> - </div> - - <div dojoType="FisheyeListItem" onClick="browse('Birds');" - iconsrc="${pageContext.request.contextPath}/images/birds_icon.gif"> - </div> - - <div dojoType="FisheyeListItem" onClick="browse('Fish');" - iconsrc="${pageContext.request.contextPath}/images/fish_icon.gif"> - </div> - - <div dojoType="FisheyeListItem" onClick="browse('Reptiles');" - iconsrc="${pageContext.request.contextPath}/images/reptiles_icon.gif"> - </div> - </div> - - </div> - </td> - <td valign="top" style="width: 400px"> - <div id="bodyCenter"> - <table valign="top" id="bodyTable" border="0"> - <tr> - <td> - <map name="petmap"> - <area onmouseover="javascript:this.style.cursor='pointer';" onclick="browse('Birds')" - alt="Birds" - coords="72,2,280,250"> - <area onmouseover="javascript:this.style.cursor='pointer';" onclick="browse('Fish')" - alt="Fish" - coords="2,180,72,250"> - <area onmouseover="javascript:this.style.cursor='pointer';" onclick="browse('Dogs')" - alt="Dogs" - coords="60,250,130,320"> - <area onmouseover="javascript:this.style.cursor='pointer';" onclick="browse('Reptiles')" - alt="Reptiles" - coords="140,270,210,340"> - <area onmouseover="javascript:this.style.cursor='pointer';" onclick="browse('Cats')" - alt="Cats" - coords="225,240,295,310"> - <area onmouseover="javascript:this.style.cursor='pointer';" onclick="browse('Birds')" - alt="Birds" - coords="280,180,350,250"> - </map> - - <img src="${pageContext.request.contextPath}/images/splash.gif" - alt="Pet Selection Map" - usemap="#petmap" - width="350" - height="355" - border="0"> - </td> - </tr> - </table> - - </div> - </td> - <td style="vertical-align:top;"> - <div style="border-style: double; width:100%;"> - <table border="0"> - <tr> - <th colspan="2" style="text-align:center">Most Popular Tags</th> - </tr> - <tr> -<% - String style=null; - int refx=0, ii=0; - for(Tag tag : tags) { - refx=tag.getRefCount() / 5; - if(refx >= 3) { - style="xxlarge"; - } else if(refx == 2) { - style="xlarge"; - } else if(refx == 1) { - style="large"; - } else { - style="medium"; - } - - if((ii % 2) == 0) out.println("</tr>\n<tr>"); - out.println("<td class='tagCell' style='text-align: center'><a href='./tag.jsp?tag=" + - tag.getTag() + "'><span class='" + style +"'>" + tag.getTag() + "</span></a></td>"); - ii++; - } -%> - </tr> - </table> - </div> - </td> - <td style="vertical-align:top; width:300px; text-align:right;"> - <div id="downloadAds"> - <jsp:include page="download.jsp" /> - </div> - </td> - </tr> - </table> - - <div style="position: absolute; visibility: hidden;z-index:5" id="menu-popup"> - <table id="completeTable" class="popupTable" ></table> - </div> - - <br/><br/> - <jsp:include page="footer.jsp" /> - - </body> -</html> -<% - } catch(Exception e) { - e.printStackTrace(); - } -%> diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/index_a.jsp b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/index_a.jsp deleted file mode 100644 index 54f30ce..0000000 --- a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/index_a.jsp +++ /dev/null @@ -1,194 +0,0 @@ -<%-- Copyright 2006 Sun Microsystems, Inc. All rights reserved. You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at: http://developer.sun.com/berkeley_license.html -$Id: index.jsp,v 1.18 2007/03/16 15:29:15 basler Exp $ --%> -<%@page contentType="text/html"%> -<%@page pageEncoding="UTF-8"%> -<%@page import="java.util.*, com.sun.javaee.blueprints.petstore.model.CatalogFacade, com.sun.javaee.blueprints.petstore.model.Tag"%> - -<% -try { - CatalogFacade cf = (CatalogFacade)config.getServletContext().getAttribute("CatalogFacade"); - List<Tag> tags=cf.getTagsInChunk(0, 12); - // since top 20 come from database or desending refCount order, need to reorder by tag name - Collections.sort(tags, new Comparator() { - public int compare(Object one, Object two) { - int cc=((Tag)two).getTag().compareTo(((Tag)one).getTag()); - return (cc < 0 ? 1 : cc > 0 ? -1 : 0); - } - }); -%> - -<html> - <head> - <meta http-equiv="Content-Type" content="text/html;charset=utf-8" > - <title>Java Pet Store Reference Application</title> - <link type="text/css" rel="stylesheet" href="./tag.css"/> - <script type="text/javascript" src="https://blueprints.dev.java.net/petstore/downloadAd.js"></script> - </head> - <body onload="alterDownloadAd()"> - - <jsp:include page="banner.jsp" /> - <script> - dojo.require("dojo.widget.FisheyeList"); - function browse(category) { - window.location.href="${pageContext.request.contextPath}/faces/catalog.jsp?catid=" + category; - } - - function alterDownloadAd() { - if(typeof checkAdPage != "undefined") { - var textx=checkAdPage(); - if(typeof textx != "undefined") { - document.getElementById("downloadAds").innerHTML=textx; - } - } - } - - - </script> - <table bgcolor="white"> - <tr> - <td valign="top"> - <div class="outerbar" style="width: 200px"> - - <div dojoType="FisheyeList" - itemWidth="170" itemHeight="50" - itemMaxWidth="340" itemMaxHeight="100" - orientation="vertical" - effectUnits="2" - itemPadding="10" - attachEdge="top" - labelEdge="bottom" - enableCrappySvgSupport="false"> - - <div dojoType="FisheyeListItem" onClick="browse('Dogs');" - iconsrc="${pageContext.request.contextPath}/images/dogs_icon.gif"> - </div> - - <div dojoType="FisheyeListItem" onClick="browse('Cats');" - iconsrc="${pageContext.request.contextPath}/images/cats_icon.gif"> - </div> - - <div dojoType="FisheyeListItem" onClick="browse('Birds');" - iconsrc="${pageContext.request.contextPath}/images/birds_icon.gif"> - </div> - - <div dojoType="FisheyeListItem" onClick="browse('Fish');" - iconsrc="${pageContext.request.contextPath}/images/fish_icon.gif"> - </div> - - <div dojoType="FisheyeListItem" onClick="browse('Reptiles');" - iconsrc="${pageContext.request.contextPath}/images/reptiles_icon.gif"> - </div> - </div> - - </div> - </td> - <td valign="top" style="width: 400px"> - <div id="bodyCenter"> - <table valign="top" id="bodyTable" border="0"> - <tr> - <td> - <map name="petmap"> - <area onmouseover="javascript:this.style.cursor='pointer';" onclick="browse('Birds')" - alt="Birds" - coords="72,2,280,250"> - <area onmouseover="javascript:this.style.cursor='pointer';" onclick="browse('Fish')" - alt="Fish" - coords="2,180,72,250"> - <area onmouseover="javascript:this.style.cursor='pointer';" onclick="browse('Dogs')" - alt="Dogs" - coords="60,250,130,320"> - <area onmouseover="javascript:this.style.cursor='pointer';" onclick="browse('Reptiles')" - alt="Reptiles" - coords="140,270,210,340"> - <area onmouseover="javascript:this.style.cursor='pointer';" onclick="browse('Cats')" - alt="Cats" - coords="225,240,295,310"> - <area onmouseover="javascript:this.style.cursor='pointer';" onclick="browse('Birds')" - alt="Birds" - coords="280,180,350,250"> - </map> - - <img src="${pageContext.request.contextPath}/images/splash.gif" - alt="Pet Selection Map" - usemap="#petmap" - width="350" - height="355" - border="0"> - </td> - </tr> - </table> - - </div> - </td> - <td style="vertical-align:top;"> - <div style="border-style: double; width:100%;"> - <table border="0"> - <tr> - <th colspan="2" style="text-align:center">Most Popular Tags</th> - </tr> - <tr> -<% - String style=null; - int refx=0, ii=0; - for(Tag tag : tags) { - refx=tag.getRefCount() / 5; - if(refx >= 3) { - style="xxlarge"; - } else if(refx == 2) { - style="xlarge"; - } else if(refx == 1) { - style="large"; - } else { - style="medium"; - } - - if((ii % 2) == 0) out.println("</tr>\n<tr>"); - out.println("<td class='tagCell' style='text-align: center'><a href='./tag.jsp?tag=" + - tag.getTag() + "'><span class='" + style +"'>" + tag.getTag() + "</span></a></td>"); - ii++; - } -%> - </tr> - </table> - </div> - </td> - <td style="vertical-align:top; width:250px; text-align:right;"> - <div id="downloadAds"> - <div id="downloadAds" style="text-align:center; border-style:none; width:100%;"> - <table style="width:100%"> - <tr> - <td style="text-align:center;"> - <a href="http://java.sun.com/javaee/downloads/index.jsp" target="downloads"><img style="border:none" src="./images/ad-sdk.jpg" alt="Download Java EE 5 SDK"/></a> - </td> - </tr> - <tr> - <td style="text-align:center;"> - <a href="http://www.netbeans.org/downloads/index.html" target="downloads"><img style="border:none" src="./images/ad-netbeans.jpg" alt="Download Netbeans IDE"/></a> - </td> - </tr> - <tr> - <td style="text-align:center;"> - <a href="http://java.com/en/download/index.jsp" target="downloads"><img style="border:none" src="./images/ad-jre.jpg" alt="Download Java SE"/></a> - </td> - </tr> - </table> - </div> - </div> - </td> - </tr> - </table> - - <div style="position: absolute; visibility: hidden;z-index:5" id="menu-popup"> - <table id="completeTable" class="popupTable" ></table> - </div> - - <br/><br/> - <jsp:include page="footer.jsp" /> - - </body> -</html> -<% - } catch(Exception e) { - e.printStackTrace(); - } -%> diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/jsonTest.jsp b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/jsonTest.jsp deleted file mode 100644 index d2fd4c5..0000000 --- a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/jsonTest.jsp +++ /dev/null @@ -1,53 +0,0 @@ -<%@page contentType="text/html"%> -<%@page pageEncoding="UTF-8"%> -<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> -<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> - -<html> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> - <title>JSON Test Page</title> - <script type="text/javascript" src="${pageContext.request.contextPath}/faces/static/META-INF/dojo/bpcatalog/dojo.js"></script> - - <script type="text/javascript"> - function getJSON() { - // get data and send to controller servlet - var bindArgs = { - url: "${pageContext.request.contextPath}/catalog?command=items&pid=feline01&start=0&length=2&format=json", - mimetype: "text/json", - error: function(){ alert("error")}, - load: callbackx - }; - - dojo.io.bind(bindArgs); - } - - function callbackx(type, data, evt) { - // check successful response - if (evt.readyState == 4) { - if (evt.status == 200) { - var prodsx=data.products; - rep="Products:<br>"; - for(ii=0; ii < prodsx.length; ii++) { - rep += prodsx[ii].name + "<br/>"; - } - rep+="<br>"; - document.getElementById("testResult").innerHTML=rep; - } - } - } - - </script> - - </head> - <body> - - <h1>JSON Test Page</h1> - <span onclick="getJSON();"> GET DATA </span><br/><br/> - - <div id="testResult"> - This should be populated with result. If not, look at the error console for errors. - </div> - - </body> -</html> diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/lookup.jsp b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/lookup.jsp deleted file mode 100644 index b634b42..0000000 --- a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/lookup.jsp +++ /dev/null @@ -1,36 +0,0 @@ -<%-- Copyright 2006 Sun Microsystems, Inc. All rights reserved. You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at: http://developer.sun.com/berkeley_license.html -$Id: lookup.jsp,v 1.7 2007/01/19 21:47:31 basler Exp $ --%> - -<%@page contentType="text/xml"%> -<%@page pageEncoding="UTF-8"%> -<%@page import="com.sun.javaee.blueprints.petstore.model.CatalogFacade, com.sun.javaee.blueprints.petstore.model.Item"%> - -<% - String itemId=request.getParameter("itemId"); - String popupView=request.getParameter("popupView"); - - try { - ServletContext context=config.getServletContext(); - CatalogFacade cf=(CatalogFacade)context.getAttribute("CatalogFacade"); - Item item=cf.getItem(itemId); - - if(itemId != null) { - out.println("<response>"); - out.println("<name>" + item.getName() + "</name>"); - String tmp=null; - if(popupView != null && popupView.equals("2")) { - tmp=item.getAddress().addressToString(); - } else { - tmp=item.getDescription(); - } - out.println("<description><![CDATA[" + tmp + "]]></description>"); - out.println("<price>" + java.text.NumberFormat.getCurrencyInstance(java.util.Locale.US).format(item.getPrice()) + "</price>"); - out.println("<image>" + request.getContextPath() + "/ImageServlet/" + item.getImageThumbURL() + "</image>"); - out.println("</response>"); - out.flush(); - } - } catch(Exception ee) { - ee.printStackTrace(); - } - -%> diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/main.htmf b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/main.htmf deleted file mode 100644 index b207a5a..0000000 --- a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/main.htmf +++ /dev/null @@ -1,36 +0,0 @@ -<!-- Copyright 2006 Sun Microsystems, Inc. All rights reserved. You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at: http://developer.sun.com/berkeley_license.html -$Id: main.htmf,v 1.3 2006/05/03 22:00:33 inder Exp $ --> - - <table valign="top" id="bodyTable" border="0"> - <tr> - <td> - <map name="petmap"> - <area onmouseover="javascript:this.style.cursor='pointer';" onclick="loadCategory('BIRDS')" - alt="Birds" - coords="72,2,280,250"> - <area onmouseover="javascript:this.style.cursor='pointer';" onclick="loadCategory('FISH')" - alt="Fish" - coords="2,180,72,250"> - <area onmouseover="javascript:this.style.cursor='pointer';" onclick="loadCategory('DOGS')" - alt="Dogs" - coords="60,250,130,320"> - <area onmouseover="javascript:this.style.cursor='pointer';" onclick="loadCategory('REPTILES')" - alt="Reptiles" - coords="140,270,210,340"> - <area onmouseover="javascript:this.style.cursor='pointer';" onclick="loadCategory('CATS')" - alt="Cats" - coords="225,240,295,310"> - <area onmouseover="javascript:this.style.cursor='pointer';" onclick="loadCategory('BIRDS')" - alt="Birds" - coords="280,180,350,250"> - </map> - - <img src="images/splash.gif" - alt="Pet Selection Map" - usemap="#petmap" - width="350" - height="355" - border="0"> - </td> - </tr> - </table> \ No newline at end of file diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/main.js b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/main.js deleted file mode 100644 index b8de8fc..0000000 --- a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/main.js +++ /dev/null @@ -1,21 +0,0 @@ -/* Copyright 2006 Sun Microsystems, Inc. All rights reserved. You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at: http://developer.sun.com/berkeley_license.html -$Id: main.js,v 1.9 2006/05/03 22:00:33 inder Exp $ */ - -var isIE; -var bodyRowText; - -dojo.require("dojo.widget.FisheyeList"); -init(); - -function browse(category) { - window.location.href="catalog.jsp?catid=" + category; -} - -function loadPetstore() { - init(); - showMain(); -} - -function init() { - if (navigator.userAgent.indexOf("IE") != -1) isIE = true; -} diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/map.jsp b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/map.jsp deleted file mode 100644 index c2673c9..0000000 --- a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/map.jsp +++ /dev/null @@ -1,143 +0,0 @@ -<%-- Copyright 2006 Sun Microsystems, Inc. All rights reserved. You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at: http://developer.sun.com/berkeley_license.html -$Id: map.jsp,v 1.20 2006/11/02 00:34:49 basler Exp $ --%> - -<%@page contentType="text/html"%> -<%@page pageEncoding="UTF-8"%> -<%@page import="com.sun.javaee.blueprints.petstore.model.CatalogFacade, com.sun.javaee.blueprints.petstore.model.Item, com.sun.javaee.blueprints.petstore.mapviewer.MapBean, com.sun.javaee.blueprints.components.ui.mapviewer.MapMarker"%> -<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@taglib uri="http://java.sun.com/jsf/html" prefix="h" %> -<%@taglib uri="http://java.sun.com/jsf/core" prefix="f" %> -<%@taglib prefix="ui" uri="http://java.sun.com/blueprints/ui" %> - -<html> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> - <title>Map Display</title> - </head> - <body> - <jsp:include page="banner.jsp" /> - <br> - <center> - <table border="1" cellspacing="5px" cellpadding="5px" - style="border-style:double; border-color:darkgreen; padding:5px"> - <tr> - <td valign="top" align="center" width="200px"> - <table border="0"> - <c:if test="${!empty sessionScope.MapBean.locations}"> - <tr> - <th> - <u>${sessionScope.MapBean.locationCount} Items Displayed</u> - </th> - </tr> - <tr> - <td> - <ul> -<% - try { - // need to use scriptlet to preform the reconciliation of items to map coords - // this way I don't have to create a new wrapper object - MapBean mapBean=(MapBean)session.getAttribute("MapBean"); - MapMarker[] mapMarkers=(MapMarker[])mapBean.getLocations(); - java.util.List<Item> items=mapBean.getItems(); - Item itemxx=null; - String popupOptions=null; - for(int ii=0; ii < mapMarkers.length; ii++) { - - //System.out.println("loop - " + ii + " - " + mapBean.getCenterAddress()); - if(mapBean.getCenterAddress() != null && !mapBean.getCenterAddress().equals("")) { - // center point is set to the first mapMarker, items are off by one - if(ii > 0) { - // reconcile correct mapMarkers with items list - itemxx=items.get(ii - 1); - popupOptions="onmouseover="bpui.popup.show('pop1', event, '" + itemxx.getItemID() + "')" onmouseout="bpui.popup.hide('pop1')""; - } else { - // first item of mapMarker is centerpoint, so no corresponding item, also no popup on mouseover - itemxx=null; - popupOptions=""; - } - } else { - // no center point items should be 1-to-1 with mappedMarkers - itemxx=items.get(ii); - popupOptions="onmouseover="bpui.popup.show('pop1', event, '" + itemxx.getItemID() + "')" onmouseout="bpui.popup.hide('pop1')""; - } -%> - <li> - <a href="javascript:mapViewerx.openInfoWindowHtml(new GPoint(<%= mapMarkers[ii].getLongitude() %>,<%= mapMarkers[ii].getLatitude() %>), '<%= mapMarkers[ii].getMarkup() %>');" <%= popupOptions %>> - <%= mapBean.changeSpaces((itemxx == null) ? mapMarkers[ii].getMarkup() : "<b>" + itemxx.getName() + "</b>") %> - </a> -<% - if(itemxx != null) { - // remove these links for center point entry -%> - <a href="${pageContext.request.contextPath}/faces/catalog.jsp?pid=<%= itemxx.getProductID() %>&itemId=<%= itemxx.getItemID() %>" alt="Go to Detailed Catalog Page"> - <i>(detail)</i> - </a> - - <br/> - <a href="javascript:mapViewerx.openInfoWindowHtml(new GPoint(<%= mapMarkers[ii].getLongitude() %>, <%= mapMarkers[ii].getLatitude() %>), '<%= mapMarkers[ii].getMarkup() %>');" <%= popupOptions %>> - <font size="-1"><%= mapBean.changeSpaces((itemxx == null) ? mapMarkers[ii].getMarkup() : itemxx.getAddress().addressToString()) %></font> - </a> -<% - } -%> - </li> - <% - } - } catch(Exception ee) { - ee.printStackTrace(); - - } - %> - </ul> - <td> - </tr> - </c:if> - </table> - </td> - <td valign="top"> - <f:view> - <ui:popupTag id="pop1" xmlHttpRequestURL="../lookup.jsp?itemId=" - elementNamePairs="name=value1,description=value2,price=value3,image=imageId"> - <!-- Used as spaces to center the table, this could be done programmatically, - but browser diff, so I left it in the hands of the component user. The image is located - in the component jar so for retrieval, push it through the faces servlet --> - <img id="spaceImage" height="10px" width="12px" src="${pageContext.request.contextPath}/faces/static/META-INF/popup/images/spacer.gif" align="left"> - <table border="0" width="270px" bgcolor="#ffffff" cellpadding="5" cellspacing="5"> - <tr> - <td align="left" valign="top"><b>Name:</b> - <span id="value1">Loading Data...</span></td> - </tr> - <tr> - <td align="left" valign="top"><b>Description:</b> - <span id="value2">Loading Data...</span></td> - </tr> - <tr> - <td align="left" valign="top"><b>Price:</b> - <span id="value3">Loading Data...</span></td> - </tr> - <tr> - <td colspan="2" align="center"><img name="image" id="imageId" src="" - alt="[Loading Image...]" border="2"/><br/><br/></td> - </tr> - </table> - </ui:popupTag> - - - <ui:mapViewer id="mapViewerx" center="#{MapBean.mapPoint}" info="#{MapBean.mapMarker}" - markers="#{MapBean.locations}" zoomLevel="#{MapBean.zoomLevel}" style="height: 500px; width: 700px"/> - - </f:view> - </td> - </tr> - </table> - <script type="text/javascript"> - bpui.mapviewer.createMapControl = function() { - return new GLargeMapControl(); - } - - </script> - <br/><br/> - </center> - <jsp:include page="footer.jsp" /> - </body> -</html> diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/mapAll.jsp b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/mapAll.jsp deleted file mode 100644 index a3ae6dc..0000000 --- a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/mapAll.jsp +++ /dev/null @@ -1,65 +0,0 @@ -<%-- Copyright 2006 Sun Microsystems, Inc. All rights reserved. You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at: http://developer.sun.com/berkeley_license.html -$Id: mapAll.jsp,v 1.14 2006/12/06 22:44:37 basler Exp $ --%> - -<%@page contentType="text/html"%> -<%@page pageEncoding="UTF-8"%> -<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@taglib uri="http://java.sun.com/jsf/html" prefix="h" %> -<%@taglib uri="http://java.sun.com/jsf/core" prefix="f" %> -<%@taglib prefix="ui" uri="http://java.sun.com/blueprints/ui" %> - -<html> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> - <title>Map Viewer Page</title> - </head> - <body> - <jsp:include page="banner.jsp" /> - <center> - <f:view> - - <h:form id="form1"> - <table border="1" cellpadding="5" cellspacing="5" style="border-style:double; width:600px; border-color:darkgreen; padding:5px"> - <tr> - <td colspan=3> - <i>Select the category whose items will be displayed in a Google map based on the Seller's address. - Optionally, enter a "Center Point Address" and "Area" to limit the search to a specific - area around the center point.</i> - </td> - </tr> - <tr> - <th align="right">Select Category to Map:</th> - <td align="center" colspan=2> - <h:selectOneRadio value="#{MapBean.category}" required="true"> - <f:selectItems value="#{MapBean.categories}"/> - </h:selectOneRadio> - </td> - </tr> - <tr> - <th align="right">Center Point Address:</th> - <td> - <h:inputText id="centerAddress" value="#{MapBean.centerAddress}" size="70"/> - <br/><small><i>For example: 4140 Network Circle, Santa Clara, CA, 95054</i></small> - </td> - </tr> - <tr> - <th align="right">Area (in Miles):</th> - <td> - <h:inputText id="radius" value="#{MapBean.radius}" size="5"/> - </td> - </tr> - <tr> - <td colspan="2" align="center"> - <h:commandButton action="#{MapBean.findAllByCategory}" id="submitCat" type="submit" value="Map Category"/> - </td> - </tr> - - </table> - <h:messages/> - </h:form> - </f:view> - - </center> - <jsp:include page="footer.jsp" /> - </body> -</html> diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/news.js b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/news.js deleted file mode 100644 index 5bcac34..0000000 --- a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/news.js +++ /dev/null @@ -1,190 +0,0 @@ - -dojo.require("dojo.io.*"); -dojo.require("dojo.event.*"); - -var bpuinews; -if (typeof bpuinews == "undefined") { - bpuinews = new Object(); -} - -bpuinews.RSS = function() { - var currentItem = 0; - var limitCharNum = 75; - var itemNum=0; - var rssData = null; - var prev; - var next; - var prevHit=false; - - this.getRssInJson = function (method, uri) { - prev = document.getElementById("previous"); - next = document.getElementById("next"); - dojo.event.connect(prev, "onclick", function(evt) {showPrevious();}); - dojo.event.connect(next, "onclick", function (evt) {showNext();}); - prev.disabled=true; - - var encodedURI = encodeURI(method + "?style=json&itemCount=0&url="+uri); - var bindArgs = { - url: encodedURI, - mimetype: "text/json", - load: function (type, data, http) { - handleJsonRss(data); - }, - error: function (t, e) { - dojo.debug("ERROR : " + e.message); - } - } - dojo.io.bind(bindArgs); - return false; - } - - function handleJsonRss(json) { - rssData = json; - itemNum = json.channel.item.length; - showNext(); - } - - function createUl(skip) { - var i; - var cp="<ul>\n"; - for (i = currentItem; i<currentItem + skip; i++) { - cp += "<li><b>"+decodeURL(rssData.channel.item[i].title)+"</b>\n"; - cp += "<p>" + decodeURL(rssData.channel.item[i].description) + "</p>\n</li>\n"; - } - cp += "</ul>\n"; - return cp; - } - - // Following funcs(showNext, showPrevious) should be connected to the button - // by dojo.event.connect. - function showNext() { - var skip = 5; - if (prevHit) { - currentItem = currentItem + skip; - prevHit = false; - } - var nextCurrentItem = currentItem + skip; - if (nextCurrentItem >= itemNum) { - skip = itemNum - currentItem; - // deactivate "next" button - next.disabled=true; - nextCurrentItem = currentItem; - } - // activate "previous" button - if (currentItem != 0) { - prev.disabled=false; - } - var cp = createUl(skip); - var elm = document.getElementById("news"); - elm.innerHTML = cp; - currentItem = nextCurrentItem; - } - - function showPrevious() { - prevHit = true; - var skip = 5; - currentItem = currentItem - skip; - if (currentItem <= 0) { - currentItem = 0; - // deactivate "previous" button - prev.disabled=true; - } - next.disabled=false; - var cp = createUl(skip); - var elm = document.getElementById("news"); - elm.innerHTML = cp; - } - - - /* Compatible function to java.net.URLDecoder.decode(). - * (decodeURI() is not compatible) - */ - function decodeURL(str){ - var targetStr=""; - var s, tmpStr, unicode, f; - // take a look at every char in the source str - var i, j; - for (i = 0; i < str.length; i++) { - s = str.charAt(i); - // handle WS, which is the most common char - if (s == "+") { - targetStr += " "; - } else { - if (s != "%") { - // Non-encoded char - targetStr += s; - } else{ - // encoding begin - unicode = 0; // uncode representation - f = 1; // flag to specify the escape sequence - while (true) { - tmpStr = ""; - // get the two HEX chars and put that in the temp string. If no char, that is not a HEX. - for (j = 0; j < 2; j++ ) { - tmptmpStr = str.charAt(++i); - if (((tmptmpStr >= "0") && (tmptmpStr <= "9")) || - ((tmptmpStr >= "a") && (tmptmpStr <= "f")) || - ((tmptmpStr >= "A") && (tmptmpStr <= "F"))) { - tmpStr += tmptmpStr; - } else { - --i; - break; - } - } - /* parse the HEX - * <= 0x7f : Single byte - * >=0xc0 && <=0xdf : Two bytes - * >=0xe0 && <=0xef : Three bytes - * >=0xf0 && <=0xf7 : Four bytes - * >=0x80 && <=0xbf : may not occur - just shift it - * <=1 : sequence terminated - */ - var byte = parseInt(tmpStr, 16); - if (byte <= 0x7f) {unicode = byte; f = 1;} - if ((byte >= 0xc0) && (byte <= 0xdf)) {unicode = byte & 0x1f; f = 2;} - if ((byte >= 0xe0) && (byte <= 0xef)) {unicode = byte & 0x0f; f = 3;} - if ((byte >= 0xf0) && (byte <= 0xf7)) {unicode = byte & 0x07; f = 4;} - if ((byte >= 0x80) && (byte <= 0xbf)) {unicode = (unicode << 6) + (byte & 0x3f); --f;} - if (f <= 1) { - break; - } - if (str.charAt(i + 1) == "%") { - i++ ; - } else { - // Error. should not occur - break; - } - } - targetStr += String.fromCharCode(unicode); - } - } - } - return targetStr; - } - - /* Cut the string at the WS so that it's shorter than the limitCharNum. - */ - function cutStringatWs(str, limitCharNum) { - var tmpStr = str; - var cnum = 0; - while (true) { - cnum = tmpStr.lastIndexOf(" "); - // no occurance of WS - if (cnum < 0) { - // if str is still longer than limit - if (tmpStr.length >= limitCharNum) { - tmpStr = tmpStr.substring(0, limitCharNum); - } - break; - } else { - tmpStr = tmpStr.substring(0, cnum); - if (cnum <= limitCharNum) { - break; - } - } - } - return tmpStr; - } - -} - diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/news.jsp b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/news.jsp deleted file mode 100644 index b57de0b..0000000 --- a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/news.jsp +++ /dev/null @@ -1,51 +0,0 @@ -<%-- Copyright 2006 Sun Microsystems, Inc. -All rights reserved. You may not modify, use, reproduce, or distribute -this software except in compliance with the terms of the License at: -http://developer.sun.com/berkeley_license.html -$Id: news.jsp,v 1.2 2006/12/14 01:04:50 yutayoshida Exp $ --%> - -<%@page contentType="text/html"%> -<%@page pageEncoding="UTF-8"%> -<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@taglib uri="http://java.sun.com/jsf/html" prefix="h" %> -<%@taglib prefix="ui" uri="http://java.sun.com/blueprints/ui" %> - -<html> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> - <title>BluePrints News Page</title> - <script type="text/javascript" src="${pageContext.request.contextPath}/faces/static/META-INF/dojo/bpcatalog/dojo.js"></script> - <script type="text/javascript" src="${pageContext.request.contextPath}/news.js"></script> - - <style> - p { - width : 70%; - background-color : #FFEFD5; - font-size : 80% - } - </style> - - </head> - <script type="text/javascript"> - var news = new bpuinews.RSS(); - dojo.addOnLoad(function(){news.getRssInJson('${pageContext.request.contextPath}/faces/dynamic/bpui_rssfeedhandler/getRssfeed', 'https://blueprints.dev.java.net/servlets/ProjectRSS?type=news%27);%7D); - </script> - <body> - <jsp:include page="banner.jsp" /> - <h2><a href="http://blueprints.dev.java.net">BluePrints News</a></h2> - <center> - <table border="0" width="95%"> - <tr> - <td> - <button id="previous" type="button"><< Previous</button> - </td> - <td> - <button id="next" type="button">Next >></button> - </td> - </tr> - </table> - </center> - <div id="news"></div> - <jsp:include page="footer.jsp" /> - </body> -</html> diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/petstoreListTest.jsp b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/petstoreListTest.jsp deleted file mode 100644 index 923739b..0000000 --- a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/petstoreListTest.jsp +++ /dev/null @@ -1,21 +0,0 @@ -<%@page contentType="text/html"%> -<%@page pageEncoding="UTF-8"%> -<html> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> - <title>jsonp test page</title> - <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/bp_petstorelist.css"></link> - <script type="text/javascript" src="${pageContext.request.contextPath}/bp_petstorelist.js"></script> - <script type="text/javascript"> - var petstoreList; - function init() { - petstoreList=new bpui.petstoreList.createPetstoreList("petstoreListDiv"); - } - </script> - </head> - <body onload="init()"> - <h1>jsonp test page</h1> - - <div id="petstoreListDiv"></div> - </body> -</html> diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/rss.js b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/rss.js deleted file mode 100644 index 66700d3..0000000 --- a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/rss.js +++ /dev/null @@ -1,110 +0,0 @@ -/* Copyright 2006 Sun Microsystems, Inc. All rights reserved. You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at: http://developer.sun.com/berkeley_license.html -$Id: rss.js,v 1.3 2006/05/31 19:13:03 basler Exp $ */ - -dojo.require("dojo.io.*"); - -if (bpui = 'undefined') { - bpui = new Object(); -} - -bpui.RSS = function() { - var jsonData = null; - var rssItemNum = 0; - var currentItem = 0; - var rssTimeout = null; - var itemIntervalMsec = 2000; - var rssFadeoutCounter = 110; - var rssFadeinCounter = 110; - var itemIntervalId = 0; - - this.getRssInJson = function (uri, number) { - rssItemNum = number; - var encodedURI = encodeURI(bpui.contextRoot + "/faces/dynamic/bpui_rssfeedhandler/getRssfeed?style=json&itemNumber="+number+"&url="+uri); - //alert("encoded url=" + encodedURI); - var bindArgs = { - url: encodedURI, - mimetype: "text/json", - load: function (type, data, http) { - handleJsonRss(data); - for (var key in data.channel.item) { - dojo.debug("ITEM Title ", key, ":", data.channel.item[key].title); - dojo.debug("ITEM LInk ", key, ":", data.channel.item[key].link); - } - }, - error: function (t, e) { - dj_debug("ERROR : " + e.message); - } - } - dojo.io.bind(bindArgs); - return false; - } - - function handleJsonRss(json) { - jsonData = json; - // setting top title and link - generateHref(json.channel.title, json.channel.link, "rss-channel"); - // setting items - generateHref(json.channel.item[0].title, json.channel.item[0].link, "rss-item"); - var aNodes = document.getElementById("rss-item").getElementsByTagName("a"); - dojo.event.connect(aNodes[0], "onmouseover", "pauseCycle"); - dojo.event.connect(aNodes[0], "onmouseout", "resumeCycle"); - cycleRss(); - } - - function generateHref (title, link, nodeId) { - var node = document.getElementById(nodeId); - var aNode = document.createElement("a"); - aNode.setAttribute("href", link); - aNode.appendChild(document.createTextNode(title)); - if (node.hasChildNodes()) { - node.removeChild(node.firstChild); - } - node.appendChild(aNode); - } - - function cycleRss () { - itemIntervalId = setTimeout(replaceItem, itemIntervalMsec); - } - - - function replaceItem() { - if (itemIntervalId) { - clearTimeout(itemIntervalId); - } - // fadeout the current item and pop the next one in. - var cItem = document.getElementById("rss-item"); - dojo.fx.html.fadeOut(cItem.getElementsByTagName('a')[0], 500); - var waitId = setTimeout(function(waitId) { - clearTimeout(waitId); - //cItem.removeChild(cItem.firstChild); - if (currentItem < (rssItemNum -1)) { - currentItem += 1; - } else { - currentItem = 0; - } - generateHref(jsonData.channel.item[currentItem].title, jsonData.channel.item[currentItem].link, "rss-item"); - // attach event for onmouseover(pause) and onmouseout(resume) - var aNodes = cItem.getElementsByTagName("a"); - dojo.event.connect(aNodes[0], "onmouseover", "pauseCycle"); - dojo.event.connect(aNodes[0], "onmouseout", "resumeCycle"); - cycleRss();}, 500); - } - - function pauseCycle(evt) { - if (itemIntervalId) { - clearTimeout(itemIntervalId); - } - } - - function resumeCycle (evt) { - cycleRss(); - } - - bpui.getContextRoot = function() { - var urlArray=window.location.toString().split("/", 4); - return "/" + urlArray[3]; - } - - bpui.contextRoot = bpui.getContextRoot(); -} - diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/rss.jsp b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/rss.jsp deleted file mode 100644 index e57e4dc..0000000 --- a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/rss.jsp +++ /dev/null @@ -1,33 +0,0 @@ -<%-- Copyright 2006 Sun Microsystems, Inc. All rights reserved. You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at: http://developer.sun.com/berkeley_license.html -$Id: rss.jsp,v 1.2 2006/05/03 22:00:34 inder Exp $ --%> - -<%@page contentType="text/html"%> -<%@page pageEncoding="UTF-8"%> - -<%@taglib prefix="f" uri="http://java.sun.com/jsf/core%22%%3E -<%@taglib prefix="h" uri="http://java.sun.com/jsf/html%22%%3E -<%@taglib prefix="ui" uri="http://java.sun.com/blueprints/ui" %> - -<html> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> - <title>RSS</title> - </head> - <body> - - <h1>RSS test</h1> - <f:view> - ui:rssreader - <ui:rsscategory title="JavaEE 5"> - <ui:rssfeed title="BluePrints" url="https://blueprints.dev.java.net/servlets/ProjectRSS?type=news%22%3E</ui:rssfeed> - <ui:rssfeed title="GlassFish" url="http://blogs.sun.com/roller/rss/theaquarium%22%3E</ui:rssfeed> - </ui:rsscategory> - <ui:rsscategory title="Yahoo!"> - <ui:rssfeed title="World" url="http://rss.news.yahoo.com/rss/world%22%3E</ui:rssfeed> - <ui:rssfeed title="US" url="http://rss.news.yahoo.com/rss/us%22%3E</ui:rssfeed> - </ui:rsscategory> - </ui:rssreader> - - </f:view> - </body> -</html> diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/rssbar.jsp b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/rssbar.jsp deleted file mode 100644 index 6f9c2f9..0000000 --- a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/rssbar.jsp +++ /dev/null @@ -1,20 +0,0 @@ -<%-- Copyright 2006 Sun Microsystems, Inc. All rights reserved. You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at: http://developer.sun.com/berkeley_license.html -$Id: rssbar.jsp,v 1.7 2006/05/06 01:44:59 yutayoshida Exp $ --%> - -<%@page contentType="text/html"%> -<%@page pageEncoding="UTF-8"%> - -<%@taglib prefix="f" uri="http://java.sun.com/jsf/core%22%%3E -<%@taglib prefix="h" uri="http://java.sun.com/jsf/html%22%%3E -<%@taglib prefix="ui" uri="http://java.sun.com/blueprints/ui" %> - - - - <f:view> - <ui:rssBar url="https://blueprints.dev.java.net/servlets/ProjectRSS?type=news" - itemCount="4" - title="News from BluePrints" - speed="6000" - backgroundImage="no" - color="#00ffff" hoverColor="#ff00ff"></ui:rssBar> - </f:view> diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/rteToolBar.html b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/rteToolBar.html deleted file mode 100644 index 9cc8c0a..0000000 --- a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/rteToolBar.html +++ /dev/null @@ -1,60 +0,0 @@ -<div class="EditorToolbarDomNode EditorToolbarSmallBg"> - <table cellpadding="1" cellspacing="0" border="0"> - <tbody> - <tr valign="top" align="left"> - <td> - <!-- bold --> - <span class="iconContainer dojoEditorToolbarItem" dojoETItemName="bold"> - <span title="Toggle Bold (Ctrl-B)" class="dojoE2TBIcon dojoE2TBIcon_Bold"> </span> - </span> - </td> - <td> - <!-- italic --> - <span class="iconContainer dojoEditorToolbarItem" dojoETItemName="italic"> - <span title="Toggle Italic (Ctrl-I)" class="dojoE2TBIcon dojoE2TBIcon_Italic"> </span> - </span> - </td> - <td> - <!-- underline --> - <span class="iconContainer dojoEditorToolbarItem" dojoETItemName="underline"> - <span title="Toggle Underline (Ctrl-U)" class="dojoE2TBIcon dojoE2TBIcon_Underline"> </span> - </span> - </td> - <td> - <!-- strikethrough --> - <span class="iconContainer dojoEditorToolbarItem" dojoETItemName="strikethrough"> - <span title="Toggle Strike-Through" -class="dojoE2TBIcon dojoE2TBIcon_StrikeThrough"> </span> - </span> - </td> - <td> - <!-- inserthorizontalrule --> - <span class="iconContainer dojoEditorToolbarItem" dojoETItemName="inserthorizontalrule"> - <span title="Insert Horizontal Rule" class="dojoE2TBIcon dojoE2TBIcon_HorizontalLine "> </span> - </span> - </td> - <td isSpacer="true"> - <!-- spacer --> - <span class="iconContainer"> - <span class="dojoE2TBIcon dojoE2TBIcon_Sep" style="width: 5px; min-width: 5px;"></span> - </span> - </td> - <td> - <!-- forecolor --> - <span class="iconContainer dojoEditorToolbarItem" dojoETItemName="forecolor"> - <span title="Change Text Color" class="dojoE2TBIcon dojoE2TBIcon_TextColor" -unselectable="on"> </span> - </span> - </td> - <td> - <!-- hilitecolor --> - <span class="iconContainer dojoEditorToolbarItem" dojoETItemName="hilitecolor"> - <span title="Change Background Color" class="dojoE2TBIcon dojoE2TBIcon_BackgroundColor" -unselectable="on"> </span> - </span> - </td> - <td width="*"> </td> - </tr> - </tbody> - </table> -</div> diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/scroller.css b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/scroller.css deleted file mode 100644 index 151df6d..0000000 --- a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/scroller.css +++ /dev/null @@ -1 +0,0 @@ -.slider { border-width:1px; border-style:solid; border-color:black; background:#404040; }
.tile { position: absolute; top:0px; left:0px; cursor:pointer; border-width:1px; border-style:solid; border-color:black; visibility:hidden; z-index:1; background:white; opacity: .99; }
.tileImage { width: 94; height: 70; }
.nav { cursor:pointer; position: absolute; vertical-align:bottom; z-index:11; opacity: .85; }
.infopane { z-index:0; width:475px; position: absolute; border-width:1px; border-style:solid; border-color:black; background:black; opacity: .65; }
.infopaneDescription { color:white; font-size:12px; }
.infopaneShortDescription { color:white; font-size:16px; }
.infopanePrice { color:white; text-align: center; height:20px; }
.infopanePayPal{ vertical-valign: bottom; text-align: right; height:20px; }
.infopaneRating{ vertical-valign: top; text-align: center; width:125px; height:15px; color:white; opacity: .95; }
.infopaneTitle { width:255px; height:15px; color:white; font-size:18px; } \ No newline at end of file diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/scroller.js b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/scroller.js deleted file mode 100644 index 1f72578..0000000 --- a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/scroller.js +++ /dev/null @@ -1,643 +0,0 @@ -/* Copyright 2006 Sun Microsystems, Inc. All rights reserved. You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at: http://developer.sun.com/berkeley_license.html -$Id: scroller.js,v 1.32 2007/01/17 18:00:09 basler Exp $ */ - -/** -* ImageScroller - A multipurpose item brower -* @ Author: Greg Murray -* -*/ - -function getApplicationContextRoot() { - var urlArray=window.location.toString().split("/", 4); - return "/" + urlArray[3]; -} - -var applicationContextRoot=getApplicationContextRoot(); - - -function ImageScroller() { - var _this = this; - var initialized = false; - // default sizes - - var VIEWPORT_WIDTH = 500; - // all sizes are realitive the the viewport width - var IMAGEPANE_WIDTH = VIEWPORT_WIDTH; - var IMAGEPANE_HEIGHT = Math.round(VIEWPORT_WIDTH / 1.49); - var INFOPANE_DEFAULT_HEIGHT = Math.round(VIEWPORT_WIDTH / 6.67); - var INFOPANE_EXPAND_HEIGHT = Math.round(VIEWPORT_WIDTH / 2.86); - var THUMB_WIDTH = Math.round(VIEWPORT_WIDTH / 5);; - var THUMB_HEIGHT = Math.round(VIEWPORT_WIDTH / 6.67); - - var CHUNK_SIZE = 7; - var PREFETCH_THRESHHOLD = 5; - - var IMAGE_PANE_ID = "imagePane"; - var IMAGE_PANE_BUFFER_ID = "imageBufferPane"; - - var PADDING = 3; - - var MINIMIZE_IMG_URI = applicationContextRoot + "/images/minimize.gif"; - var MAXIMIZE_IMG_URI = applicationContextRoot + "/images/maximize.gif"; - var INDICATOR_IMG_URI = applicationContextRoot + "/images/indicator-black.gif"; - var MAXIMIZE_IMG_TOOLTIP = "Show Details"; - var MINIMIZE_IMG_TOOLTIP = "Show Less Details"; - - // this is an array of the tiles which are divs for each thumb - var tiles = []; - - var injectionPoint; - - // for scrolling - - var SCROLL_INCREMENT = 5; - var INFOPANE_INCREMENT = 3; - var tileY; - var tileX; - // this is the index of the image tile on the far left - var index = 0; - // keeps track how for the scroll has gone - var offset = 0; - - var timeout = 30; // in ms - var isScrollingRight = false; - var isScrollingLeft = false; - - // large image pane - var imagePane; - var imageLoadingPane; - var loadingPane; - // images - var minimizeImage; - - var indicatorImage; - var leftButton; - var rightButton; - - // infopane - var infoPane; - var infoTableMinimize; - var indicatorCell; - var minimizeLink; - var infoPaneLoop = 0; - var maximizing = false; - var minimizing = false; - var maximized = false; - - // prefetch thresh-hold - var prefetchThreshold = 2; - - // a growing list of items; - var items = []; - // cached chunks that are already in the items array - var loadedChunks = []; - - // used for debugging when debug is true - var debug = false; - var statusDiv; - var status2Div; - - var showingBuffer = false; - var imageBuffer; - var imageReloadTries = 0; - var IMG_RELOAD_RETRY_MAX = 30; - // used for url book marking - - - var pid; - var currentChunk; - // this map contains all the items - var map; - // this is the main container div - var containerDiv; - - this.getItems = function() { - return map; - } - - this.getScrollerItems = function() { - return items; - } - - - this.getGroupId = function() { - return pid; - } - - this.reset = function() { - resetTitles() - tiles = []; - index = 0; - offset = 0; - currentChunk = 0; - items = []; - loadedChunks = []; - } - - function resetTitles() { - for (var l = 0; l < tiles.length; l++) { - tiles[l].parentNode.removeChild(tiles[l]); - } - } - - // event bound to the mouseOut event of both scroll buttons - function scrollDone() { - isScrollingLeft = false; - isScrollingRight = false; - } - - // looping method for time out - function scroll() { - if (isScrollingRight) scrollRight(); - else if (isScrollingLeft) scrollLeft(); - } - - - // do the value list pre-emptive fetching - function prefetch() { - //printDebug("** scoller index = " + index); - if (isScrollingRight && (index + PREFETCH_THRESHHOLD) % CHUNK_SIZE == 0) { - - if ((Math.round(index / CHUNK_SIZE)) >= currentChunk) { - currentChunk = Math.round(index / CHUNK_SIZE) + 1; - // fire an event - dojo.event.topic.publish("/catalog", {type:"getChunk", id: pid, index: index, currentChunk: currentChunk}); - } - } - } - - this.setGroupId = function(id) { - pid = id; - } - - this.containsChunk = function(chunkId) { - printDebug("containsChunk = " + loadedChunks); - ret=false; - for(ii=0; ii < loadedChunks.length; ii++) { - if(chunkId == loadedChunks[ii]) { - ret=true; - break; - } - } - return ret; - } - - this.addChunk = function(chunkId) { - loadedChunks.push(chunkId); - } - - this.addItems = function(inItems) { - for (var loop=0; loop < inItems.length ; loop++) { - items.push(inItems[loop]); - map.put(inItems[loop].id, inItems[loop]); - createTile(inItems[loop]); - if (loop == 0 && !loadImage) { - showImage(inItems[loop].id); - } - - } - drawTiles(); - rightButton.style.visibility="visible"; - _this.hideProgressIndicator(); - } - - this.showProgressIndicator = function() { - if (indicatorImage) { - indicatorImage.style.visibility = "visible"; - } - } - - this.hideProgressIndicator = function() { - indicatorImage.style.visibility = "hidden"; - } - - function postImageLoad(loadIntoBuffer) { - if (debug) { - status2Div.innerHTML = "Try " + imageReloadTries + " " + url + " image.complete=" + imageBuffer.complete; - } - // keep calling this funtion until imageReloadTries < IMG_RELOAD_RETRY_MAX - if (!imageBuffer.complete) { - if (imageReloadTries < IMG_RELOAD_RETRY_MAX) { - setTimeout(function(){this.loadIntoBuffer = loadIntoBuffer;postImageLoad(loadIntoBuffer);},500); - } else { - this.hideProgressIndicator(); - } - imageReloadTries = imageReloadTries + 1; - return; - } - var id; - - _this.hideProgressIndicator(); - if (loadIntoBuffer) { - imageLoadingPane.src = imageBuffer.src; - } else { - imagePane.src = imageBuffer.src; - - } - // do a cross fade as long as the images aren't the same - if (imageLoadingPane.src != imagePane.src) { - crossFade(0,loadIntoBuffer ); - } - } - - - this.showImage = function(itemId) { - - _this.showProgressIndicator(); - //setTimeout(this.showProgressIndicator,0); - var i = map.get(itemId); - - if (!i) { - return; - } - dojo.event.topic.publish("/catalog", {type:"showingItem", id: itemId, rating: i.rating}); - // create the image pane and append the description nodes - // asumption is that if the imagePane is not set neigher are the info children - if (typeof imagePane == 'undefined') { - imagePane = document.createElement("img"); - imagePane.style.width = IMAGEPANE_WIDTH + "px"; - imagePane.style.height = IMAGEPANE_HEIGHT + "px"; - imagePane.id = IMAGE_PANE_ID; - - var targetElement = document.getElementById("bodySpace"); - imageLoadingPane = document.createElement("img"); - imageLoadingPane.style.position = "absolute"; - imageLoadingPane.style.visibility = "hidden"; - imageLoadingPane.style.width = IMAGEPANE_WIDTH + "px"; - imageLoadingPane.style.height = IMAGEPANE_HEIGHT + "px"; - imageLoadingPane.id = IMAGE_PANE_BUFFER_ID; - targetElement.appendChild(imagePane); - targetElement.appendChild(imageLoadingPane); - imageLoadingPane.style.left = tileX + "px"; - - loadImage(i.image, false); - } else { - imageLoadingPane.style.visibility = "visible"; - if (showingBuffer) { - showingBuffer = false; - } else { - showingBuffer = true; - } - loadImage(i.image, showingBuffer); - } - } - - function loadImage(url, loadIntoBuffer) { - imageReloadTries = 0; - imageBuffer = new Image(); - if (loadIntoBuffer) { - imageBuffer.src = url; - imageLoadingPane.onLoad = setTimeout(function(){this.url=url;this.loadIntoBuffer = loadIntoBuffer;postImageLoad(loadIntoBuffer,url);},0); - } else { - imageBuffer.src = url; - imageBuffer.onLoad = setTimeout(function(){this.url = url;this.loadIntoBuffer = loadIntoBuffer;postImageLoad(loadIntoBuffer,url);},0); - } - } - - function setOpacity(opacity, id) { - var target = document.getElementById(id); - if (typeof target.style.filter != 'undefined') { - target.style.filter = "alpha(opacity:" + opacity + ")"; - } else { - target.style.opacity = opacity/100; - } - } - - function crossFade(count,loadIntoBuffer) { - var percentage = Number(count); - if (loadIntoBuffer) { - setOpacity(100 - percentage, IMAGE_PANE_ID); - setOpacity(percentage, IMAGE_PANE_BUFFER_ID); - } else { - setOpacity(100 - percentage, IMAGE_PANE_BUFFER_ID); - setOpacity(percentage, IMAGE_PANE_ID); - - } - if (percentage < 100) { - percentage = percentage + 10; - setTimeout(function(){this.loadIntoBuffer = loadIntoBuffer;this.percentage = percentage;crossFade(percentage,loadIntoBuffer);}, 25); - } - } - - - // calling this function will result in the maximizing event being fired - // if the pane is maximized it will asume the event want to minimize - this.doMaximize = function() { - if (!maximizing && !minimizing && !maximized) { - infoPaneLoop = INFOPANE_DEFAULT_HEIGHT; - maximizing = true; - minimizing = false; - } else if (!maximizing && !minimizing) { - minimizing = true; - maximizing = false; - } - setTimeout(changeInfoPane, 0); - } - - // will handle either minimizing or maximing but not both - // this method is called recursively until the maximinging - // or minimizing is done. - function changeInfoPane() { - if (maximizing) { - maxmizeInfoPane(); - } else if (minimizing) { - minimizeInfoPane(); - } - } - - function maxmizeInfoPane() { - if (infoPaneLoop < INFOPANE_EXPAND_HEIGHT) { - infoPaneLoop = infoPaneLoop + INFOPANE_INCREMENT; - var clipMe = 'rect(' + '0px,' + VIEWPORT_WIDTH + 'px,'+ infoPaneLoop +'px,' + 0 + 'px)'; - infoPane.style.clip = clipMe; - infoPane.style.height = infoPaneLoop; - infoPane.style.top = (tileY + (PADDING *2) + INFOPANE_DEFAULT_HEIGHT + IMAGEPANE_HEIGHT) - infoPaneLoop; - setTimeout(changeInfoPane, 5); - } else { - minimizeImage.src= MINIMIZE_IMG_URI; - minimizeLink.title = MINIMIZE_IMG_TOOLTIP; - maximized = true; - maximizing = false; - minimizing = false; - } - } - - function minimizeInfoPane() { - if (infoPaneLoop > INFOPANE_DEFAULT_HEIGHT) { - infoPaneLoop = infoPaneLoop - INFOPANE_INCREMENT; - var clipMe = 'rect(' + '0px,' + VIEWPORT_WIDTH + 'px,'+ infoPaneLoop +'px,' + 0 + 'px)'; - infoPane.style.clip = clipMe; - infoPane.style.height = infoPaneLoop; - infoPane.style.top = (tileY + (PADDING *2) + INFOPANE_DEFAULT_HEIGHT + IMAGEPANE_HEIGHT) - infoPaneLoop; - if (debug) { - status2Div.innerHTML = "minimize infoPaneLoop =" + infoPaneLoop + " infopane.top=" + infoPane.style.top; - } - setTimeout(changeInfoPane, 5); - } else { - minimizeImage.src= MAXIMIZE_IMG_URI; - minimizeLink.title = MAXIMIZE_IMG_TOOLTIP; - maximizing = false; - minimizing = false; - maximized = false; - } - } - - function scrollRight() { - isScrollingRight = true; - if ( (index + 4) >= tiles.length) { - // hide the rightButton - rightButton.style.visibility="hidden"; - return; - } else { - leftButton.style.visibility="visible"; - } - offset = offset - SCROLL_INCREMENT; - drawTiles(); - setTimeout(scroll, timeout); - } - - function getNext() { - isScrollingRight = true; - setTimeout(scroll, timeout); - } - - - function getPrevious () { - isScrollingLeft = true; - setTimeout(scroll, timeout); - } - - function scrollLeft() { - if (offset >= 0) { - leftButton.style.visibility="hidden"; - return; - } else { - leftButton.style.visibility="visible"; - } - offset = offset + SCROLL_INCREMENT; - drawTiles(); - setTimeout(scroll, timeout); - } - - function drawTiles() { - // draw the first one if its off the screen - // check if the far right image is out view - var overHang; - var temp = offset; - index = Math.floor((offset)/THUMB_WIDTH); - overHang = offset % THUMB_WIDTH; - if (overHang < 0) { - overHang = overHang * -1; - } - if (index < 0) { - index = index * -1; - } - // check for next set of images - prefetch(); - var startIndex = index; - if (overHang > 0 && index >0) { - startIndex = index -1; - } - var stopIndex = index + Math.round(VIEWPORT_WIDTH / THUMB_WIDTH); - if (stopIndex > tiles.length) { - stopIndex = tiles.length; - } - var displayX = 0; - for (var tl=startIndex; tl < stopIndex; tl++) { - if (debug) { - statusDiv.innerHTML = "overhang=" + overHang + " startIndex=" + startIndex + " stopIndex=" + stopIndex + " offset=" + offset + " displayX=" + displayX; - } - if (overHang > 0 && tl == startIndex) { - rightButton.style.visibility="visible"; - // clip: rect(top right bottom left) - borders of the clipped area - // clip the left - var clipMe = 'rect(' + '0px,' + THUMB_WIDTH + 'px,'+ THUMB_HEIGHT +'px,' + overHang + 'px)'; - tiles[tl].style.clip = clipMe; - tiles[tl].style.left = (tileX - overHang) + "px"; - displayX = displayX + (THUMB_WIDTH - overHang); - } else if (tl == stopIndex -1) { - var underHang = VIEWPORT_WIDTH - displayX ; - if (underHang > 0 && underHang) { - var clipMe = 'rect(' + '0px,' + (underHang) + "px," + THUMB_HEIGHT +'px,' + 0 + 'px)'; - tiles[tl].style.clip = clipMe; - tiles[tl].style.left = tileX + (offset + (tl * THUMB_WIDTH)) + 'px'; - tiles[tl].style.visibility = "visible"; - // resize the previous one to its real length - } else if (underHang < 0 && tl > 0) { - var clipMe = 'rect(' + '0px,' + (THUMB_WIDTH + underHang) + "px," + THUMB_HEIGHT +'px,' + 0 + 'px)'; - tiles[tl-1].style.clip = clipMe; - tiles[tl-1].style.visibility = "visible"; - tiles[tl-1].style.left = tileX + (offset + ((tl -1) * THUMB_WIDTH)) + 'px'; - } else { - tiles[tl].style.left = '0px'; - tiles[tl].style.visibility = "hidden"; - } - } else { - displayX = displayX + THUMB_WIDTH; - tiles[tl].style.left = tileX + (offset + (tl * THUMB_WIDTH)) + 'px'; - tiles[tl].style.visibility = "visible"; - } - } - if (stopIndex < tiles.length) { - tiles[stopIndex].style.visibility = "hidden"; - tiles[stopIndex].style.left = "0px"; - } - } - - - this.load = function () { - map = new Map(); - dojo.event.connect(window, "onresize", layout); - var loadImage; - - var targetRow = document.getElementById("targetRow"); - injectionPoint = document.getElementById("injection_point"); - - // for status output - statusDiv = document.getElementById("status"); - status2Div = document.getElementById("status_2"); - - initLayout(); - initialized = true; - } - - function initLayout() { - containerDiv = document.getElementById("CatalogBrowser"); - rightButton = document.getElementById("right_button"); - leftButton = document.getElementById("left_button"); - layout(); - leftButton.style.visibility="hidden"; - if (typeof rightButton.attachEvent != 'undefined') { - rightButton.attachEvent('onmouseover',function(e){scrollDone();getNext();}); - rightButton.attachEvent('onmouseout',function(e){scrollDone();}); - leftButton.attachEvent('onmouseover',function(e){scrollDone();getPrevious();}); - leftButton.attachEvent('onmouseout',function(e){scrollDone();}); - } else if (typeof rightButton.addEventListener != 'undefined') { - rightButton.addEventListener('mouseover',function(e){scrollDone();getNext();}, false); - rightButton.addEventListener('mouseout',function(e){scrollDone();}, false); - leftButton.addEventListener('mouseover',function(e){scrollDone();getPrevious();}, false); - leftButton.addEventListener('mouseout',function(e){scrollDone();}, false); - } - createInfoPane(); - } - - function layout() { - var ua = navigator.userAgent.toLowerCase(); - - // this will need to be made generic depending on the thumb height - tileY = findY(containerDiv); - tileX = findX(containerDiv) + 4; - var rightX = tileX + VIEWPORT_WIDTH - 20; - rightButton.style.left = rightX + "px"; - var buttonY = tileY + IMAGEPANE_HEIGHT + INFOPANE_DEFAULT_HEIGHT + 12; - rightButton.style.top = buttonY + "px"; - leftButton.style.top = buttonY + "px"; - - if (ua.indexOf('ie') != -1) { - isIE = true; - } else if (ua.indexOf('safari') != -1) { - tileX = tileX + 8; - timeout = 20; - } - drawTiles(); - if (infoPane) { - infoPane.style.left = tileX + "px"; - if (maximized) { - - infoPane.style.top = (tileY + IMAGEPANE_HEIGHT + (PADDING*2) - infoPane.style.height) + "px"; - } else { - infoPane.style.top = (tileY + IMAGEPANE_HEIGHT + (PADDING*2)) + "px"; - } - if (maximized) { - infoPaneLoop = infoPane.style.height; - } else { - infoPaneLoop = INFOPANE_DEFAULT_HEIGHT; - } - } - if (typeof imageLoadingPane != 'undefined') { - imageLoadingPane.style.left = tileX; - imageLoadingPane.style.top = tileY; - } - } - - function createInfoPane() { - infoPane = document.getElementById("infopane"); - infoPane.style.width = VIEWPORT_WIDTH + "px"; - // give room for 4 pixels above and below - infoPane.style.height = (INFOPANE_DEFAULT_HEIGHT) + "px"; - // give 3px padding for a border - infoPane.style.top = (tileY + IMAGEPANE_HEIGHT + (PADDING*2)) + "px"; - infoPane.style.left = tileX + "px"; - infoTableMinimize = document.getElementById("infopaneDetailsIcon"); - indicatorCell = document.getElementById("infopaneIndicator"); - indicatorCell.style.width = (10) + "px"; - indicatorImage = document.createElement("img"); - indicatorImage.className = "infopaneIndicator"; - indicatorImage.src = INDICATOR_IMG_URI; - indicatorImage.style.visibility = "hidden"; - indicatorCell.appendChild(indicatorImage); - minimizeLink = document.createElement("a"); - minimizeLink.className = "infopaneLink"; - minimizeLink.title = MAXIMIZE_IMG_TOOLTIP; - minimizeImage = document.createElement("img"); - minimizeImage.src= MAXIMIZE_IMG_URI; - minimizeLink.appendChild(minimizeImage); - infoTableMinimize.appendChild(minimizeLink); - - if (typeof minimizeLink.attachEvent != 'undefined') { - minimizeLink.attachEvent("onclick",function(e){_this.doMaximize();}); - } else { - minimizeLink.addEventListener("click",function(e){_this.doMaximize();}, true); - } - var clipMe = 'rect(' + '0px,' + VIEWPORT_WIDTH + 'px,'+ INFOPANE_DEFAULT_HEIGHT +'px,' + 0 + 'px)'; - infoPane.style.clip = clipMe; - } - - function createTile(i) { - var div = document.createElement("div"); - div.className = "tile"; - div.id = i.id; - var link = document.createElement("a"); - var img = document.createElement("img"); - img.title = i.name; - img.src = i.thumbnail; - img.className = "tileImage"; - link.appendChild(img); - link.setAttribute("id", i.id); - if (typeof div.attachEvent != 'undefined') { - div.attachEvent('onclick',function(e){this.id = div.id; _this.showImage(this.id, false);}); - } else { - link.addEventListener('click',function(e){this.id = div.id; _this.showImage(this.id, false);}, true); - } - div.appendChild(link); - injectionPoint.appendChild(div); - div.style.top = tileY + INFOPANE_DEFAULT_HEIGHT + IMAGEPANE_HEIGHT + (PADDING * 3) + "px"; - tiles.push(div); - } - - - function findY(element) { - var t = 0; - if (element.offsetParent) { - while (element.offsetParent) { - t += element.offsetTop - element = element.offsetParent; - } - } else if (element.y) { - t += element.y; - } - return t; - } - - function findX(element) { - var l = 0; - if (element.offsetParent) { - while (element.offsetParent) { - l += element.offsetLeft - element = element.offsetParent; - } - } else if (element.x) - l += element.x; - return l; - } -} diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/search.jsp b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/search.jsp deleted file mode 100644 index e12d666..0000000 --- a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/search.jsp +++ /dev/null @@ -1,290 +0,0 @@ -<%-- Copyright 2006 Sun Microsystems, Inc. All rights reserved. You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at: http://developer.sun.com/berkeley_license.html -$Id: search.jsp,v 1.28 2006/12/04 21:34:10 basler Exp $ --%> - -<%@page contentType="text/html"%> -<%@page pageEncoding="UTF-8"%> -<%@page import="java.util.*, com.sun.javaee.blueprints.petstore.search.*"%> -<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@taglib uri="http://java.sun.com/jsf/html" prefix="h" %> -<%@taglib uri="http://java.sun.com/jsf/core" prefix="f" %> -<%@taglib prefix="ui5" uri="http://java.sun.com/blueprints/ui" %> - - -<html> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> - <title>Search Page</title> - <style> - .itemTable { - padding: 0.3cm; - width: 800px; - border-style: double; - border-color: darkgreen; - } - .itemCell { - border-style: solid; - border-color: darkgreen; - border-width: thin; - padding: 5px - } - .tagDiv { - border-style: groove; - border-color: darkgreen; - background-color: white; - border-width: thick; - padding: 5px; - visibility: hidden; - position:absolute; - left:0px; - top:0px; - z-index: 3; - } - </style> - <script type="text/javascript" src="common.js"></script> - </head> - <body> - <jsp:include page="banner.jsp" /> - <center> - - <script type="text/javascript"> - function checkAll() { - var elems=dojo.byId("resultsForm").elements; - for(ii=0; ii < elems.length; ii++) { - if(elems[ii].name.indexOf("mapSelectedItems") >= 0) { - elems[ii].checked=true; - } - } - return false; - } - - function uncheckAll() { - var elems=dojo.byId("resultsForm").elements; - for(ii=0; ii < elems.length; ii++) { - if(elems[ii].name.indexOf("mapSelectedItems") >= 0) { - elems[ii].checked=false; - } - } - return false; - } - - function addTags(eventx, namex, itemIdx) { - var xx=0; - var yy=0; - if (!eventx) var eventx=window.event; - if (eventx.pageX || eventx.pageY){ - xx=eventx.pageX; - yy=eventx.pageY; - } else if (eventx.clientX || eventx.clientY) { - xx=eventx.clientX + document.body.scrollLeft; - yy=eventx.clientY + document.body.scrollTop; - } - divId="addTags"; - document.getElementById("addTagsItemId").value=itemIdx; - document.getElementById("addTagsTags").value=""; - document.getElementById("addTagsTitle").innerHTML="<b>Add Tags to '" + namex + "'</b>"; - document.getElementById(divId).style.left=(xx - 170) + "px"; - document.getElementById(divId).style.top=(yy - 140) + "px"; - document.getElementById(divId).style.visibility='visible'; - document.getElementById("addTagsTags").focus(); - } - - function saveAddTags() { - // get data and send to controller servlet - itemIdx=document.getElementById("addTagsItemId").value; - tagsx=document.getElementById("addTagsTags").value; - var bindArgs = { - url: "../TagServlet?itemId=" + escape(itemIdx) + "&tags=" + escape(tagsx), - mimetype: "text/xml", - error: ajaxBindError, - load: function(type, data, evt){ - // check successful response - if (evt.readyState == 4) { - if (evt.status == 200) { - // get results and replace dom elements - var resultx=data.getElementsByTagName("response")[0]; - itemIdx=resultx.getElementsByTagName("itemId")[0].childNodes[0].nodeValue; - - // change DOM data - document.getElementById("ITEMID_TAGS_" + itemIdx).innerHTML=resultx.getElementsByTagName("tags")[0].childNodes[0].nodeValue; - - } else if (evt.status == 204){ - alert("204 return"); - } - } - } - }; - - dojo.io.bind(bindArgs); - // make sure it was updated - - // show messages if error - - // hide popup - document.getElementById(divId).style.visibility='hidden'; - } - - function cancelAddTags() { - // hide popup - document.getElementById(divId).style.visibility='hidden'; - } - - </script> - - <f:view> - - <ui5:popupTag id="pop1" xmlHttpRequestURL="../lookup.jsp?popupView=2&itemId=" - elementNamePairs="name=value1,description=value2,price=value3,image=imageId"> - <!-- Used as spaces to center the table, this could be done programmatically, - but browser diff, so I left it in the hands of the component user. The image is located - in the component jar so for retrieval, push it through the faces servlet --> - <img id="spaceImage" height="10px" width="3px" src="${pageContext.request.contextPath}/faces/static/META-INF/popup/images/spacer.gif" align="left"> - <table border="0" width="270px" bgcolor="#ffffff" cellpadding="5" cellspacing="5"> - <tr> - <td align="left" valign="top"><b>Name:</b> - <span id="value1">Loading Data...</span></td> - </tr> - <tr> - <td align="left" valign="top"><b>Seller Address:</b> - <span id="value2">Loading Data...</span></td> - </tr> - <tr> - <td align="left" valign="top"><b>Price:</b> - <span id="value3">Loading Data...</span></td> - </tr> - <tr> - <td colspan="2" align="center"><img name="image" id="imageId" src="" - alt="[Loading Image...]" border="2"/><br/><br/></td> - </tr> - </table> - </ui5:popupTag> - - <h1>Search Page</h1> - <h:form id="searchForm"> - <table class="itemTable" style="width: 700px"> - <tr> - <th class="itemCell">Search String</th> - <td class="itemCell"> - <h:inputText size="50" id="searchString" value="#{SearchBean.searchString}"/> - Also Search Tags:<h:selectBooleanCheckbox id="searchTags" value="#{SearchBean.searchTags}"/> - </td> - </tr> - <tr> - <td class="itemCell" align="center" colspan="2"> - <h:commandButton action="#{SearchBean.searchAction}" id="searchSubmit" type="submit" value="Submit"/> - <h:commandButton id="searchReset" type="reset" value="Reset"/> - </td> - </tr> - </table> - <h:messages/> - </h:form> - <br/> - - - - <h:form id="resultsForm" rendered="#{SearchBean.showResults}"> - <table class="itemTable"> - <tr> - <th class="itemCell"> - Map - <br/> - <img src="../images/check_all.gif" onclick="return checkAll()"/><img src="../images/uncheck_all.gif" onclick="return uncheckAll()"/> - </th> - <th class="itemCell">Name</th> - <th class="itemCell">Description</th> - <th class="itemCell">Tags</th> - <th class="itemCell">Price</th> - </tr> -<% -SearchBean searchBean=(SearchBean)session.getAttribute("SearchBean"); -if(searchBean != null) { - List<IndexDocument> hits=searchBean.getHits(); - if(hits != null) { - for(IndexDocument indexDoc : hits) { -%> - <tr> - <td class="itemCell"> - <input type="checkbox" name="mapSelectedItems" value="<%= indexDoc.getUID() %>"/> - </td> - <td class="itemCell"> - <a href="${pageContext.request.contextPath}/faces/catalog.jsp?pid=<%= indexDoc.getProduct() %>&itemId=<%= indexDoc.getUID() %>" - onmouseover="bpui.popup.show('pop1', event, '<%= indexDoc.getUID() %>')" onmouseout="bpui.popup.hide('pop1')"> - <%= indexDoc.getTitle() %> - </a> - </td> - <td class="itemCell"> - <%= indexDoc.getSummary() %> - </td> - <td class="itemCell"> - <span id="ITEMID_TAGS_<%= indexDoc.getUID() %>"><%= (indexDoc.getTag().equals("") ? " " : indexDoc.getTag()) %></span> - <br/><input type="button" value="Add Tags" onclick="addTags(event, '<%= indexDoc.getTitle() %>', '<%= indexDoc.getUID() %>')"/> - </td> - <td class="itemCell"> - <%= indexDoc.getPriceDisplay() %> - </td> - </tr> -<% - } - } -} -%> - <tr> - <td colspan="5"> - <br/> - <center> - <table class="itemTable"> - <tr> - <th align="right">Center Point Address:</th> - <td> - <h:inputText id="centerAddress" value="#{MapBean.centerAddress}" size="50"/> - <br/><small><i>For example: 4140 Network Circle, Santa Clara, CA, 95054</i></small> - </td> - </tr> - <tr> - <th align="right">Area (in Miles):</th> - <td> - <h:inputText id="radius" value="#{MapBean.radius}" size="5"/> - </td> - </tr> - <tr> - <td align="center" colspan="2"> - <h:commandButton action="#{MapBean.findAllByIDs}" id="mapSubmit" type="submit" - value="Map Checked Item(s)" rendered="#{SearchBean.showResults}"/> - </td> - </tr> - </table> - </center> - <br/> - </td> - </tr> - </table> - - <h:messages/> - </h:form> - <br/><br/><br/> - <div class="tagDiv" id="addTags"> - <form> - <table> - <tr> - <td align="center"> - <span id="addTagsTitle"><b>Tag Title</b></span><br/><i>(seperated by spaces)</i> - </td> - </tr> - <tr> - <td align="center"> - <input id="addTagsTags" type="text" size="50"/> - </td> - </tr> - <tr> - <td align="center"> - <input type="button" value="Save" onclick="saveAddTags()"/> <input type="button" value="Cancel" onclick="cancelAddTags()"/> - </td> - </tr> - </table> - <input type="hidden" id="addTagsItemId"/> - </form> - </div> - </f:view> - </center> - <jsp:include page="footer.jsp" /> - </body> -</html> diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/styles.css b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/styles.css deleted file mode 100644 index 24ffbf9..0000000 --- a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/styles.css +++ /dev/null @@ -1,130 +0,0 @@ - -.dojoHtmlFisheyeListBar { - cursor:pointer; - margin: 0; - width: 300px; - text-align: right; -} - -.outerbar { - background-color: white; - text-align: left; - width: 300px; -} - -.editText { - height:25; - font-size:18px; - font-weight: bold; - font-family: Arial; -} - -.plainText { - height:25; - font-size:20px; - font-weight: bold; - font-family: Arial -} - -.plainTextSelect { - height:25; - font-size:20px; - font-weight: bold; - font-family: Arial; - background: red -} - -.smallText { - height:15; - font-size:13px; - font-weight: bold; - font-family: Arial -} - -.banner { - height:35; - font-size:35; - font-weight: bold; - font-family: Arial -} - - -.menuItem { - background: white; - color: black; - text-decoration: none; - font-size: 1.4em; -} - -.menuLink { - cursor:pointer; - color: black; - text-decoration: none; - font-size: 1.3em; -} - -.menuLinkHover { - cursor:pointer; - color: black; - font-size: 1.3em; - text-decoration: underline; -} - -.autocomplete { - position:absolute; -} - -.autocompleteTable { - padding:0; - visibility: hidden; - border-spacing: 0; - border-width:1px; - border-style:solid; - border-color:black; -} - -.popupRowHover { - color: #FFFAFA; - cursor:pointer; - padding-left:3; - padding-right:3; - border-spacing: 0; - border-width:0px; - background: #7A8AFF; -} - -.popupRow { - padding-left:3; - padding-right:3; - border-spacing: 0; - border-width:0px; - background: #FFFAFA; -} - -.popupRowEven { - padding-left:3; - padding-right:3; - border-spacing: 0; - border-width:0px; - background: #FFFADA; -} - -.popupItem { - background: #FFFAFA; - color: #000000; - text-decoration: none; - font-size: 1.2em; -} - -.shadow { - top:0px; - left:0px; - position: absolute; - visibility: hidden; - width:0; - height:0; - z-index:0; - background:gray; - opacity: .5; -} - diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/systemerror.jsp b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/systemerror.jsp deleted file mode 100644 index c7a5309..0000000 --- a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/systemerror.jsp +++ /dev/null @@ -1,28 +0,0 @@ -<%-- Copyright 2006 Sun Microsystems, Inc. All rights reserved. You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at: http://developer.sun.com/berkeley_license.html -$Id: systemerror.jsp,v 1.3 2007/01/09 19:02:12 basler Exp $ --%> -<%@ page isErrorPage="true" %> -<%@ page import="com.sun.javaee.blueprints.petstore.util.PetstoreUtil, java.util.logging.Level" %> -<% -PetstoreUtil.getLogger().log(Level.INFO, "Encountered a Runtime Exception and being transferred the the systemerror page", exception); -%> -<html> - <head> - <meta http-equiv="Content-Type" content="text/html;charset=utf-8" > - <title>Java Pet Store Reference Application: System Error Page</title> - </head> - <body> - - <jsp:include page="banner.jsp" /> - - <h2>System Error !</h2> - <p>We had problems processing your request. An exception has been caught, - so perhaps your application was not set up or deployed properly.</p> - - The Exception that was thrown is:<b> <%= exception.toString() %></b>. The server log will contain the stack trace of the exception. - - <p><a href="${pageContext.request.contextPath}/faces/index.jsp">Go back to sample application home</a></p> - <br/><br/> - <jsp:include page="footer.jsp" /> - - </body> -</html> diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/tag.css b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/tag.css deleted file mode 100644 index bfbab6e..0000000 --- a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/tag.css +++ /dev/null @@ -1,47 +0,0 @@ - .itemTable { - padding: 0.3cm; - border-style: double; - width: 800px; - border-color: darkgreen; - } - .itemCell { - border-style: solid; - border-color: darkgreen; - border-width: thin; - padding: 5px - } - .tagCell { - padding: 0.3cm; - } - .xxlarge - { - font-size: xx-large; - color: red; - cursor: pointer; - text-decoration: underline; - } - .xlarge - { - font-size: x-large; - color: blue; - cursor: pointer; - text-decoration: underline; - } - .large - { - font-size: large; - color: green; - cursor: pointer; - text-decoration: underline; - } - .medium - { - font-size: medium; - cursor: pointer; - color: black; - text-decoration: underline; - } - .items - { - visibility: hidden; - } diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/tag.jsp b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/tag.jsp deleted file mode 100644 index f9c74f3..0000000 --- a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/tag.jsp +++ /dev/null @@ -1,158 +0,0 @@ -<%-- Copyright 2006 Sun Microsystems, Inc. All rights reserved. You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at: http://developer.sun.com/berkeley_license.html -$Id: tag.jsp,v 1.11 2007/01/17 18:00:09 basler Exp $ --%> - -<%@page contentType="text/html"%> -<%@page pageEncoding="UTF-8"%> -<%@page import="java.util.*, com.sun.javaee.blueprints.petstore.model.CatalogFacade, com.sun.javaee.blueprints.petstore.model.Tag"%> -<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@taglib uri="http://java.sun.com/jsf/html" prefix="h" %> -<%@taglib uri="http://java.sun.com/jsf/core" prefix="f" %> -<%@taglib prefix="ui5" uri="http://java.sun.com/blueprints/ui" %> - - -<html> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> - <title>Tag Page</title> - <script type="text/javascript" src="./common.js"></script> - <link type="text/css" rel="stylesheet" href="./tag.css"/> -<% -try { - CatalogFacade cf = (CatalogFacade)config.getServletContext().getAttribute("CatalogFacade"); - List<Tag> tags=cf.getTagsInChunk(0, 90); - // since top 20 come from database or desending refCount order, need to reorder by tag name - Collections.sort(tags, new Comparator() { - public int compare(Object one, Object two) { - return ((Tag)one).getTag().compareTo(((Tag)two).getTag()); - } - }); -%> - <script language="javascript"> - function retrieveItems(tag) { - var bindArgs = { - // url when using the jsp to serve the ajax request - url: "../tagItemLookup.jsp?tag=" + escape(tag), - mimetype: "text/xml", - load: returnFunctionx, - error: ajaxBindError}; - - // dispatch the request - dojo.io.bind(bindArgs); - } - - - function returnFunctionx(type, data, evt) { - // statically setup popup for simple case - var componentId="displayItems"; - // check return of the dojo call to make sure it is valid - if (evt.readyState == 4) { - if (evt.status == 200) { - // get results and replace dom elements - var itemsx=data.getElementsByTagName("item"); - display="<table class='itemTable'><tr><td class='itemCell' align='center' colspan='4'><h2>Tag: " + - data.getElementsByTagName("tag")[0].childNodes[0].nodeValue + - "</h2></td></tr><tr><th class='itemCell'>Name</th><th class='itemCell'>Description</th><th class='itemCell'>Tags</th><th class='itemCell'>Price</th></tr>" - for(ii=0; ii < itemsx.length; ii++) { - display += "<tr>"; - display +="<td class='itemCell'><a href='./catalog.jsp?pid="+ itemsx[ii].getElementsByTagName("productID")[0].childNodes[0].nodeValue +"&itemId=" + - itemsx[ii].getElementsByTagName("itemID")[0].childNodes[0].nodeValue + "' onmouseover='bpui.popup.show("pop1", event, "" + - itemsx[ii].getElementsByTagName("itemID")[0].childNodes[0].nodeValue + "")' onmouseout='bpui.popup.hide("pop1")'>" + - itemsx[ii].getElementsByTagName("name")[0].childNodes[0].nodeValue +"</a></td>"; - display +="<td class='itemCell'>" + itemsx[ii].getElementsByTagName("description")[0].childNodes[0].nodeValue +"</td>"; - display +="<td class='itemCell'>" + itemsx[ii].getElementsByTagName("tags")[0].childNodes[0].nodeValue +"</td>"; - display +="<td class='itemCell' style='text-align: right'>" + itemsx[ii].getElementsByTagName("price")[0].childNodes[0].nodeValue +"</td>"; - display +="</tr>"; - } - display += "</table>"; - document.getElementById(componentId).innerHTML=display; - document.getElementById(componentId).style.visibility='visible'; - } else if (evt.status == 204){ - alert("204 return"); - } - } - } - - - function checkQueryString() { - <!-- add script to check for tag in query string, if exists then retrieve data --> - var iPos=window.location.href.indexOf("?tag="); - if(iPos > -1) { - // have tag so retrieve items - retrieveItems(window.location.href.substr(iPos + 5)); - } - } - - </script> - </head> - <body onload="checkQueryString();"> - <jsp:include page="banner.jsp" /> - <f:view> - - <ui5:popupTag id="pop1" xmlHttpRequestURL="../lookup.jsp?popupView=2&itemId=" - elementNamePairs="name=value1,description=value2,price=value3,image=imageId"> - <!-- Used as spaces to center the table, this could be done programmatically, - but browser diff, so I left it in the hands of the component user. The image is located - in the component jar so for retrieval, push it through the faces servlet --> - <img id="spaceImage" height="10px" width="10px" src="${pageContext.request.contextPath}/faces/static/META-INF/popup/images/spacer.gif" align="left"> - <table border="0" width="270px" bgcolor="#ffffff" cellpadding="5" cellspacing="5"> - <tr> - <td align="left" valign="top"><b>Name:</b> - <span id="value1">Loading Data...</span></td> - </tr> - <tr> - <td align="left" valign="top"><b>Seller Address:</b> - <span id="value2">Loading Data...</span></td> - </tr> - <tr> - <td align="left" valign="top"><b>Price:</b> - <span id="value3">Loading Data...</span></td> - </tr> - <tr> - <td colspan="2" align="center"><img name="image" id="imageId" src="" - alt="[Loading Image...]" border="2"/><br/><br/></td> - </tr> - </table> - </ui5:popupTag> - <center> - <h1>Tag Page</h1> - <table border="0"> - <tr> -<% - String style=null; - int refx=0, ii=0; - for(Tag tag : tags) { - refx=tag.getRefCount() / 5; - if(refx >= 3) { - style="xxlarge"; - } else if(refx == 2) { - style="xlarge"; - } else if(refx == 1) { - style="large"; - } else { - style="medium"; - } - - if((ii % 6) == 0) out.println("</tr>\n<tr>"); - //out.println("<td class='tagCell'><span onclick="retrieveItems('" + tag.getTag() + "')" class='" + style +"'>" + tag.getTag() + "</span> (" + tag.getRefCount() + ")</td>"); - out.println("<td class='tagCell'><span onclick="retrieveItems('" + tag.getTag() + "')" class='" + style +"'>" + tag.getTag() + "</span></td>"); - ii++; - } -%> - </tr> - </table> - <div id="displayItems" class="items"> - - </div> - </center> - </f:view> - <br/><br/><br/><br/> - <jsp:include page="footer.jsp" /> - - </body> -</html> - -<% - } catch(Exception e) { - e.printStackTrace(); - } -%> diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/tagItemLookup.jsp b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/tagItemLookup.jsp deleted file mode 100644 index 05ef352..0000000 --- a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/tagItemLookup.jsp +++ /dev/null @@ -1,45 +0,0 @@ -<%-- Copyright 2006 Sun Microsystems, Inc. All rights reserved. You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at: http://developer.sun.com/berkeley_license.html -$Id: tagItemLookup.jsp,v 1.4 2007/01/19 21:47:31 basler Exp $ --%> - -<%@page contentType="text/xml"%> -<%@page pageEncoding="UTF-8"%> -<%@page import="java.util.*, java.text.NumberFormat, com.sun.javaee.blueprints.petstore.model.CatalogFacade, com.sun.javaee.blueprints.petstore.model.Item, com.sun.javaee.blueprints.petstore.model.Tag"%> - -<% - String sxTag=request.getParameter("tag"); - - try { - response.setHeader("Pragma", "No-Cache"); - response.setHeader("Cache-Control", "no-cache,no-store,max-age=0"); - response.setDateHeader("Expires", 1); - - ServletContext context=config.getServletContext(); - CatalogFacade cf=(CatalogFacade)context.getAttribute("CatalogFacade"); - Tag tag=cf.getTagWithPersistentItems(sxTag); - out.println("<response>"); - - if(tag != null) { - out.println("<tag>" + tag.getTag() + "</tag>"); - out.println("<items>"); - Collection<Item> items=tag.getItems(); - for(Item item : items) { - if(item.getDisabled() == 0) { - out.println("<item>"); - out.println("<itemID>" + item.getItemID() + "</itemID>"); - out.println("<productID>" + item.getProductID() + "</productID>"); - out.println("<name><![CDATA[" + item.getName() + "]]></name>"); - out.println("<description><![CDATA[" + item.getDescription() + "]]></description>"); - out.println("<tags><![CDATA[" + item.tagsAsString() + "]]></tags>"); - out.println("<price><![CDATA[" + NumberFormat.getCurrencyInstance(java.util.Locale.US).format(item.getPrice()) + "]]></price>"); - out.println("</item>"); - } - } - out.println("</items>"); - } - out.println("</response>"); - out.flush(); - } catch(Exception ee) { - ee.printStackTrace(); - } - -%> diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/testis.jsp b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/testis.jsp deleted file mode 100644 index e5dd68a..0000000 --- a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/testis.jsp +++ /dev/null @@ -1,36 +0,0 @@ -<%@page contentType="text/html"%> -<%@page pageEncoding="UTF-8"%> -<%-- -The taglib directive below imports the JSTL library. If you uncomment it, -you must also add the JSTL library to the project. The Add Library... action -on Libraries node in Projects view can be used to add the JSTL 1.1 library. ---%> -<%-- -<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> ---%> - -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" - "http://www.w3.org/TR/html4/loose.dtd"> - -<html> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> - <title>JSP Page</title> - </head> - <body> - - <h1>JSP Page</h1> - - <%-- - This example uses JSTL, uncomment the taglib directive above. - To test, display the page like this: index.jsp?sayHello=true&name=Murphy - --%> - <%-- - <c:if test="${param.sayHello}"> - <!-- Let's welcome the user ${param.name} --> - Hello ${param.name}! - </c:if> - --%> - - </body> -</html> diff --git a/etc/samples/sample-bundle/src/main/scripts/assembly.xml b/etc/samples/sample-bundle/src/main/scripts/assembly.xml deleted file mode 100644 index 942e5f9..0000000 --- a/etc/samples/sample-bundle/src/main/scripts/assembly.xml +++ /dev/null @@ -1,41 +0,0 @@ -<?xml version="1.0"?> - -<!-- $Id$ --> - -<assembly> - <!-- The id gets appended to the end of the zipfile name unless - it's an empty string, so make it an empty string. --> - <id></id> - <formats> - <format>zip</format> - </formats> - <includeBaseDirectory>false</includeBaseDirectory> - <baseDirectory>target/bundle</baseDirectory> - <fileSets> - <fileSet> - <directory>target/bundle</directory> - <outputDirectory>/</outputDirectory> - <includes> - <include>**/*</include> - </includes> - <excludes> - <exclude>**/*.sh</exclude> - <exclude>**/*.so</exclude> - <exclude>**/*.sl</exclude> - <exclude>**/*.dylib</exclude> - </excludes> - </fileSet> - <fileSet> - <directory>target/bundle</directory> - <outputDirectory>/</outputDirectory> - <includes> - <include>**/*.sh</include> - <include>**/*.so</include> - <include>**/*.sl</include> - <include>**/*.dylib</include> - </includes> - <fileMode>0755</fileMode> - </fileSet> - </fileSets> -</assembly> - diff --git a/etc/samples/sample-bundle/src/main/scripts/build.xml b/etc/samples/sample-bundle/src/main/scripts/build.xml deleted file mode 100644 index fed3f16..0000000 --- a/etc/samples/sample-bundle/src/main/scripts/build.xml +++ /dev/null @@ -1,63 +0,0 @@ -<?xml version="1.0"?> - -<!-- $Id$ --> - -<project name="sample-bundle" basedir="." default="build"> - - <target name="build"> - - <!-- download JBossAS 6.0 dist from sourceforge and unzip it --> - <property name="tmp.dir" location="${java.io.tmpdir}/${user.name}"/> - <echo>tmp.dir="${tmp.dir}"</echo> - <mkdir dir="${tmp.dir}"/> - - <get src="http://downloads.sourceforge.net/project/jboss/JBoss/JBoss-6.0.0.M3/jboss-as..." - dest="${tmp.dir}/jbossas.zip" - usetimestamp="true"/> - <property name="jboss.home" location="target/jbossas-petstore"/> - <echo>jboss.home="${jboss.home}"</echo> - <mkdir dir="${jboss.home}"/> - <unzip src="${tmp.dir}/jbossas.zip" dest="${jboss.home}"> - <mapper> - <globmapper from="jboss-6.0.0.20100429-M3/*" to="*"/> - </mapper> - </unzip> - - <!-- delete all server configs, except 'default' --> - <delete includeemptydirs="true"> - <fileset dir="${jboss.home}/server"> - <exclude name="default/**"/> - </fileset> - </delete> - - <!-- delete docs dir and README files... --> - <delete dir="${jboss.home}/docs"/> - <delete> - <fileset dir="${jboss.home}" includes="*.*" /> - </delete> - - <property name="jboss.config.dir" location="${jboss.home}/server/default"/> - - <echo>Copying Derby JDBC driver jar to $${jboss.home}/server/default/lib/...</echo> - <copy file="${settings.localRepository}/org/apache/derby/derbyclient/${derbyclient.version}/derbyclient-${derbyclient.version}.jar" - toDir="${jboss.config.dir}/lib" failonerror="false" verbose="true" /> - - <!-- copy petstore files into the jbossas install --> - <copy todir="${jboss.home}"> - <fileset dir="src/main/petstore"/> - </copy> - - <mkdir dir="target/bundle"/> - - <!-- zip up our modified jbossas install - this zipfile will be used as a bundle file --> - <zip destfile="target/bundle/jbossas-petstore.zip" basedir="${jboss.home}"/> - - <!-- copy the recipe and other bundle files into the bundle --> - <copy todir="target/bundle"> - <fileset dir="src/main/bundle"/> - </copy> - - </target> - -</project> -
commit b661d3a756edffbde2cc92079a7c2b2a078251a7 Author: Jay Shaughnessy jshaughn@redhat.com Date: Mon Jun 28 16:37:11 2010 -0400
[BZ 604471] Make the Bundle Handler resources Services under the platform as opposed to Server resources. In this way the user does not have to explicitly import them and provisioning will be supported out of the box. They do still show up as children under the platform resource.
diff --git a/modules/plugins/ant-bundle/src/main/java/org/rhq/plugins/ant/AntBundlePluginDiscoveryComponent.java b/modules/plugins/ant-bundle/src/main/java/org/rhq/plugins/ant/AntBundlePluginDiscoveryComponent.java index 50a2f86..33da95d 100644 --- a/modules/plugins/ant-bundle/src/main/java/org/rhq/plugins/ant/AntBundlePluginDiscoveryComponent.java +++ b/modules/plugins/ant-bundle/src/main/java/org/rhq/plugins/ant/AntBundlePluginDiscoveryComponent.java @@ -37,9 +37,9 @@ public class AntBundlePluginDiscoveryComponent implements ResourceDiscoveryCompo HashSet<DiscoveredResourceDetails> set = new HashSet<DiscoveredResourceDetails>();
String key = "ant-bundle"; - String name = "Ant Bundle Handler"; + String name = "Bundle Handler - Ant"; String version = this.getClass().getPackage().getImplementationVersion(); - String description = "Processes bundles whose recipes are Ant scripts"; + String description = "For provisioning bundles with Ant script recipes";
DiscoveredResourceDetails resource = new DiscoveredResourceDetails(context.getResourceType(), key, name, version, description, null, null); diff --git a/modules/plugins/ant-bundle/src/main/resources/META-INF/rhq-plugin.xml b/modules/plugins/ant-bundle/src/main/resources/META-INF/rhq-plugin.xml index ce2b150..529507d 100644 --- a/modules/plugins/ant-bundle/src/main/resources/META-INF/rhq-plugin.xml +++ b/modules/plugins/ant-bundle/src/main/resources/META-INF/rhq-plugin.xml @@ -7,14 +7,23 @@ xmlns="urn:xmlns:rhq-plugin" xmlns:c="urn:xmlns:rhq-configuration">
- - <server name="Ant Bundle Handler Server" + <service name="Ant Bundle Handler" discovery="AntBundlePluginDiscoveryComponent" class="AntBundlePluginComponent" singleton="true" description="This plugin is used to process Ant bundles">
+ <runs-inside> + <parent-resource-type name="Windows" plugin="Platforms"/> + <parent-resource-type name="Linux" plugin="Platforms"/> + <parent-resource-type name="Solaris" plugin="Platforms"/> + <parent-resource-type name="HP-UX" plugin="Platforms"/> + <parent-resource-type name="AIX" plugin="Platforms"/> + <parent-resource-type name="FreeBSD" plugin="Platforms"/> + <parent-resource-type name="Mac OS X" plugin="Platforms"/> + </runs-inside> + <bundle type="Ant Bundle" />
- </server> + </service> </plugin> diff --git a/modules/plugins/filetemplate-bundle/src/main/java/org/rhq/plugins/filetemplate/FileTemplateBundlePluginDiscoveryComponent.java b/modules/plugins/filetemplate-bundle/src/main/java/org/rhq/plugins/filetemplate/FileTemplateBundlePluginDiscoveryComponent.java index faae71d..8562eeb 100644 --- a/modules/plugins/filetemplate-bundle/src/main/java/org/rhq/plugins/filetemplate/FileTemplateBundlePluginDiscoveryComponent.java +++ b/modules/plugins/filetemplate-bundle/src/main/java/org/rhq/plugins/filetemplate/FileTemplateBundlePluginDiscoveryComponent.java @@ -37,9 +37,9 @@ public class FileTemplateBundlePluginDiscoveryComponent implements ResourceDisco HashSet<DiscoveredResourceDetails> set = new HashSet<DiscoveredResourceDetails>();
String key = "file-template-bundle"; - String name = "File Template Bundle Handler"; + String name = "Bundle Handler - File Template"; String version = this.getClass().getPackage().getImplementationVersion(); - String description = "Processes file template bundles"; + String description = "For provisioning bundles with File Template recipes";
DiscoveredResourceDetails resource = new DiscoveredResourceDetails(context.getResourceType(), key, name, version, description, null, null); diff --git a/modules/plugins/filetemplate-bundle/src/main/resources/META-INF/rhq-plugin.xml b/modules/plugins/filetemplate-bundle/src/main/resources/META-INF/rhq-plugin.xml index a07d411..98132f5 100644 --- a/modules/plugins/filetemplate-bundle/src/main/resources/META-INF/rhq-plugin.xml +++ b/modules/plugins/filetemplate-bundle/src/main/resources/META-INF/rhq-plugin.xml @@ -8,13 +8,23 @@ xmlns:c="urn:xmlns:rhq-configuration">
- <server name="File Template Bundle Handler Server" + <service name="File Template Bundle Handler" discovery="FileTemplateBundlePluginDiscoveryComponent" class="FileTemplateBundlePluginServerComponent" singleton="true" description="This plugin is used to process File Template bundles">
+ <runs-inside> + <parent-resource-type name="Windows" plugin="Platforms"/> + <parent-resource-type name="Linux" plugin="Platforms"/> + <parent-resource-type name="Solaris" plugin="Platforms"/> + <parent-resource-type name="HP-UX" plugin="Platforms"/> + <parent-resource-type name="AIX" plugin="Platforms"/> + <parent-resource-type name="FreeBSD" plugin="Platforms"/> + <parent-resource-type name="Mac OS X" plugin="Platforms"/> + </runs-inside> + <bundle type="File Template Bundle" />
- </server> + </service> </plugin>
commit 13c15e74eee55b4910c517419d1e5028a03bf3aa Merge: a76a1d4... 358f16a... Author: Jay Shaughnessy jshaughn@redhat.com Date: Mon Jun 28 16:54:54 2010 -0400
Merge branch 'release-3.0.0' into release-3.0.0-jay
commit a76a1d4d666ce8b69fb111f44ee24f69866d1960 Author: Jay Shaughnessy jshaughn@redhat.com Date: Mon Jun 28 16:41:00 2010 -0400
Work In Progress - sample provisioning scripts
diff --git a/etc/samples/provisioning/sample-cli/resources/sample-bundle-v1.zip b/etc/samples/provisioning/sample-cli/resources/sample-bundle-v1.zip new file mode 100644 index 0000000..c044d9a Binary files /dev/null and b/etc/samples/provisioning/sample-cli/resources/sample-bundle-v1.zip differ diff --git a/etc/samples/provisioning/sample-cli/scripts/cli-1-createBundle.js b/etc/samples/provisioning/sample-cli/scripts/cli-1-createBundle.js new file mode 100644 index 0000000..5c8d36a --- /dev/null +++ b/etc/samples/provisioning/sample-cli/scripts/cli-1-createBundle.js @@ -0,0 +1,55 @@ +/* + * RHQ Management Platform + * Copyright (C) 2005-2010 Red Hat, Inc. + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License, version 2, as + * published by the Free Software Foundation, and/or the GNU Lesser + * General Public License, version 2.1, also as published by the Free + * Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License and the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License + * and the GNU Lesser General Public License along with this program; + * if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +/** + * This sample script shows how to create a Bundle by uploading an existing Bundle Distribution file. + * The Bundle uses the Ant Bundle Type provided with RHQ. + * Prerequisites: + * - The "Ant Bundle Handler Server" resource must be in inventory on the target platforms + */ + +var bundleName = 'test-bundle-upgrade-ant'; +var bundleDistroV1Path = '../resources/sample-bundle-v1.zip'; + +// delete the test bundle if it exists +var bc = new BundleCriteria(); +bc.addFilterName( bundleName ); +var bundles = BundleManager.findBundlesByCriteria( bc ); +if ( null != bundles && bundles.size() > 0 ) { + print( "\nDeleting sample bundle [" + bundleName + "] to re-run sample scripts...") + BundleManager.deleteBundle( bundles.get(0).getId() ); +} + +// create bundleVersion 1.0 for the sample bundle +var distributionFile = new java.io.File(bundleDistroV1Path); +distributionFile = new java.io.File(distributionFile.getAbsolutePath()); +Assert.assertTrue(distributionFile.exists(), "Missing ant bundle distribution file: " + distributionFile); +var bundleVersion1 = BundleManager.createBundleVersionViaFile( distributionFile ); + +print( "\nCreated Bundle [" + bundleVersion1 + "]!") + + + + + + diff --git a/etc/samples/provisioning/sample-cli/scripts/cli-2-deployBundle.js b/etc/samples/provisioning/sample-cli/scripts/cli-2-deployBundle.js new file mode 100644 index 0000000..e4e61ec --- /dev/null +++ b/etc/samples/provisioning/sample-cli/scripts/cli-2-deployBundle.js @@ -0,0 +1,66 @@ +/* + * RHQ Management Platform + * Copyright (C) 2005-2010 Red Hat, Inc. + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License, version 2, as + * published by the Free Software Foundation, and/or the GNU Lesser + * General Public License, version 2.1, also as published by the Free + * Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License and the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License + * and the GNU Lesser General Public License along with this program; + * if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +/** + * Thus test script works with a real env including at least one platform resource and a running agent on + * said platform. It will deploy an original distro file then upgrade it, utilitizing the + * Ant bundle system. + */ + +var TestsEnabled = true; + +var bundleName = 'test-bundle-upgrade-ant'; +var bundleZipFile1 = 'src/test/resources/test-upgrade-bundle-ant1.zip'; +var bundleZipFile2 = 'src/test/resources/test-upgrade-bundle-ant2.zip'; + +// note, super-user, will not test any security constraints +var subject = rhq.login('rhqadmin', 'rhqadmin'); + +executeAllTests(); + +rhq.logout(); + +function testGroupDeployment() { + if ( !TestsEnabled ) { + return; + } + + var groupId = getGroupId(); + var bundleType = getBundleType(); + Assert.assertNotNull(bundleType, "need ant bundle plugin installed for this test"); + + // delete the test bundle if it exists + var bc = new BundleCriteria(); + bc.addFilterName( bundleName ); + var bundles = BundleManager.findBundlesByCriteria( bc ); + if ( null != bundles && bundles.size() > 0 ) { + print( "\nDeleting existing test ant bundle in order to test a fresh deploy...") + BundleManager.deleteBundle( bundles.get(0).getId() ); + } + + // create bundleVersion 1.0 + var distributionFile1 = new java.io.File(bundleZipFile1); + distributionFile1 = new java.io.File(distributionFile1.getAbsolutePath()); + Assert.assertTrue(distributionFile1.exists(), "missing ant bundle file 1: " + distributionFile1); + var testBundleVersion1 = BundleManager.createBundleVersionViaFile( distributionFile1 ); + diff --git a/etc/samples/provisioning/sample-cli/scripts/cli-3-upgradeBundle.js b/etc/samples/provisioning/sample-cli/scripts/cli-3-upgradeBundle.js new file mode 100644 index 0000000..e4e61ec --- /dev/null +++ b/etc/samples/provisioning/sample-cli/scripts/cli-3-upgradeBundle.js @@ -0,0 +1,66 @@ +/* + * RHQ Management Platform + * Copyright (C) 2005-2010 Red Hat, Inc. + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License, version 2, as + * published by the Free Software Foundation, and/or the GNU Lesser + * General Public License, version 2.1, also as published by the Free + * Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License and the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License + * and the GNU Lesser General Public License along with this program; + * if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +/** + * Thus test script works with a real env including at least one platform resource and a running agent on + * said platform. It will deploy an original distro file then upgrade it, utilitizing the + * Ant bundle system. + */ + +var TestsEnabled = true; + +var bundleName = 'test-bundle-upgrade-ant'; +var bundleZipFile1 = 'src/test/resources/test-upgrade-bundle-ant1.zip'; +var bundleZipFile2 = 'src/test/resources/test-upgrade-bundle-ant2.zip'; + +// note, super-user, will not test any security constraints +var subject = rhq.login('rhqadmin', 'rhqadmin'); + +executeAllTests(); + +rhq.logout(); + +function testGroupDeployment() { + if ( !TestsEnabled ) { + return; + } + + var groupId = getGroupId(); + var bundleType = getBundleType(); + Assert.assertNotNull(bundleType, "need ant bundle plugin installed for this test"); + + // delete the test bundle if it exists + var bc = new BundleCriteria(); + bc.addFilterName( bundleName ); + var bundles = BundleManager.findBundlesByCriteria( bc ); + if ( null != bundles && bundles.size() > 0 ) { + print( "\nDeleting existing test ant bundle in order to test a fresh deploy...") + BundleManager.deleteBundle( bundles.get(0).getId() ); + } + + // create bundleVersion 1.0 + var distributionFile1 = new java.io.File(bundleZipFile1); + distributionFile1 = new java.io.File(distributionFile1.getAbsolutePath()); + Assert.assertTrue(distributionFile1.exists(), "missing ant bundle file 1: " + distributionFile1); + var testBundleVersion1 = BundleManager.createBundleVersionViaFile( distributionFile1 ); + diff --git a/etc/samples/provisioning/sample-cli/scripts/cli-4-revertBundle.js b/etc/samples/provisioning/sample-cli/scripts/cli-4-revertBundle.js new file mode 100644 index 0000000..e4e61ec --- /dev/null +++ b/etc/samples/provisioning/sample-cli/scripts/cli-4-revertBundle.js @@ -0,0 +1,66 @@ +/* + * RHQ Management Platform + * Copyright (C) 2005-2010 Red Hat, Inc. + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License, version 2, as + * published by the Free Software Foundation, and/or the GNU Lesser + * General Public License, version 2.1, also as published by the Free + * Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License and the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License + * and the GNU Lesser General Public License along with this program; + * if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +/** + * Thus test script works with a real env including at least one platform resource and a running agent on + * said platform. It will deploy an original distro file then upgrade it, utilitizing the + * Ant bundle system. + */ + +var TestsEnabled = true; + +var bundleName = 'test-bundle-upgrade-ant'; +var bundleZipFile1 = 'src/test/resources/test-upgrade-bundle-ant1.zip'; +var bundleZipFile2 = 'src/test/resources/test-upgrade-bundle-ant2.zip'; + +// note, super-user, will not test any security constraints +var subject = rhq.login('rhqadmin', 'rhqadmin'); + +executeAllTests(); + +rhq.logout(); + +function testGroupDeployment() { + if ( !TestsEnabled ) { + return; + } + + var groupId = getGroupId(); + var bundleType = getBundleType(); + Assert.assertNotNull(bundleType, "need ant bundle plugin installed for this test"); + + // delete the test bundle if it exists + var bc = new BundleCriteria(); + bc.addFilterName( bundleName ); + var bundles = BundleManager.findBundlesByCriteria( bc ); + if ( null != bundles && bundles.size() > 0 ) { + print( "\nDeleting existing test ant bundle in order to test a fresh deploy...") + BundleManager.deleteBundle( bundles.get(0).getId() ); + } + + // create bundleVersion 1.0 + var distributionFile1 = new java.io.File(bundleZipFile1); + distributionFile1 = new java.io.File(distributionFile1.getAbsolutePath()); + Assert.assertTrue(distributionFile1.exists(), "missing ant bundle file 1: " + distributionFile1); + var testBundleVersion1 = BundleManager.createBundleVersionViaFile( distributionFile1 ); +
commit 5c1112f7c170af81986456808ba1fee557c58036 Author: Jay Shaughnessy jshaughn@redhat.com Date: Mon Jun 28 16:37:11 2010 -0400
[BZ 604471] Make the Bundle Handler resources Services under the platform as opposed to Server resources. In this way the user does not have to explicitly import them and provisioning will be supported out of the box. They do still show up as children under the platform resource.
diff --git a/modules/plugins/ant-bundle/src/main/java/org/rhq/plugins/ant/AntBundlePluginDiscoveryComponent.java b/modules/plugins/ant-bundle/src/main/java/org/rhq/plugins/ant/AntBundlePluginDiscoveryComponent.java index 50a2f86..33da95d 100644 --- a/modules/plugins/ant-bundle/src/main/java/org/rhq/plugins/ant/AntBundlePluginDiscoveryComponent.java +++ b/modules/plugins/ant-bundle/src/main/java/org/rhq/plugins/ant/AntBundlePluginDiscoveryComponent.java @@ -37,9 +37,9 @@ public class AntBundlePluginDiscoveryComponent implements ResourceDiscoveryCompo HashSet<DiscoveredResourceDetails> set = new HashSet<DiscoveredResourceDetails>();
String key = "ant-bundle"; - String name = "Ant Bundle Handler"; + String name = "Bundle Handler - Ant"; String version = this.getClass().getPackage().getImplementationVersion(); - String description = "Processes bundles whose recipes are Ant scripts"; + String description = "For provisioning bundles with Ant script recipes";
DiscoveredResourceDetails resource = new DiscoveredResourceDetails(context.getResourceType(), key, name, version, description, null, null); diff --git a/modules/plugins/ant-bundle/src/main/resources/META-INF/rhq-plugin.xml b/modules/plugins/ant-bundle/src/main/resources/META-INF/rhq-plugin.xml index ce2b150..529507d 100644 --- a/modules/plugins/ant-bundle/src/main/resources/META-INF/rhq-plugin.xml +++ b/modules/plugins/ant-bundle/src/main/resources/META-INF/rhq-plugin.xml @@ -7,14 +7,23 @@ xmlns="urn:xmlns:rhq-plugin" xmlns:c="urn:xmlns:rhq-configuration">
- - <server name="Ant Bundle Handler Server" + <service name="Ant Bundle Handler" discovery="AntBundlePluginDiscoveryComponent" class="AntBundlePluginComponent" singleton="true" description="This plugin is used to process Ant bundles">
+ <runs-inside> + <parent-resource-type name="Windows" plugin="Platforms"/> + <parent-resource-type name="Linux" plugin="Platforms"/> + <parent-resource-type name="Solaris" plugin="Platforms"/> + <parent-resource-type name="HP-UX" plugin="Platforms"/> + <parent-resource-type name="AIX" plugin="Platforms"/> + <parent-resource-type name="FreeBSD" plugin="Platforms"/> + <parent-resource-type name="Mac OS X" plugin="Platforms"/> + </runs-inside> + <bundle type="Ant Bundle" />
- </server> + </service> </plugin> diff --git a/modules/plugins/filetemplate-bundle/src/main/java/org/rhq/plugins/filetemplate/FileTemplateBundlePluginDiscoveryComponent.java b/modules/plugins/filetemplate-bundle/src/main/java/org/rhq/plugins/filetemplate/FileTemplateBundlePluginDiscoveryComponent.java index faae71d..8562eeb 100644 --- a/modules/plugins/filetemplate-bundle/src/main/java/org/rhq/plugins/filetemplate/FileTemplateBundlePluginDiscoveryComponent.java +++ b/modules/plugins/filetemplate-bundle/src/main/java/org/rhq/plugins/filetemplate/FileTemplateBundlePluginDiscoveryComponent.java @@ -37,9 +37,9 @@ public class FileTemplateBundlePluginDiscoveryComponent implements ResourceDisco HashSet<DiscoveredResourceDetails> set = new HashSet<DiscoveredResourceDetails>();
String key = "file-template-bundle"; - String name = "File Template Bundle Handler"; + String name = "Bundle Handler - File Template"; String version = this.getClass().getPackage().getImplementationVersion(); - String description = "Processes file template bundles"; + String description = "For provisioning bundles with File Template recipes";
DiscoveredResourceDetails resource = new DiscoveredResourceDetails(context.getResourceType(), key, name, version, description, null, null); diff --git a/modules/plugins/filetemplate-bundle/src/main/resources/META-INF/rhq-plugin.xml b/modules/plugins/filetemplate-bundle/src/main/resources/META-INF/rhq-plugin.xml index a07d411..98132f5 100644 --- a/modules/plugins/filetemplate-bundle/src/main/resources/META-INF/rhq-plugin.xml +++ b/modules/plugins/filetemplate-bundle/src/main/resources/META-INF/rhq-plugin.xml @@ -8,13 +8,23 @@ xmlns:c="urn:xmlns:rhq-configuration">
- <server name="File Template Bundle Handler Server" + <service name="File Template Bundle Handler" discovery="FileTemplateBundlePluginDiscoveryComponent" class="FileTemplateBundlePluginServerComponent" singleton="true" description="This plugin is used to process File Template bundles">
+ <runs-inside> + <parent-resource-type name="Windows" plugin="Platforms"/> + <parent-resource-type name="Linux" plugin="Platforms"/> + <parent-resource-type name="Solaris" plugin="Platforms"/> + <parent-resource-type name="HP-UX" plugin="Platforms"/> + <parent-resource-type name="AIX" plugin="Platforms"/> + <parent-resource-type name="FreeBSD" plugin="Platforms"/> + <parent-resource-type name="Mac OS X" plugin="Platforms"/> + </runs-inside> + <bundle type="File Template Bundle" />
- </server> + </service> </plugin>
commit 11ecc3d372952e868fde0c003dae356aebb7adda Author: Jay Shaughnessy jshaughn@redhat.com Date: Mon Jun 28 16:30:27 2010 -0400
Move etc/samples/sample-bundle to etc/samples/provisioning/sample-bundle
diff --git a/etc/samples/provisioning/sample-bundle/pom.xml b/etc/samples/provisioning/sample-bundle/pom.xml new file mode 100644 index 0000000..6bd4a88 --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/pom.xml @@ -0,0 +1,92 @@ +<?xml version="1.0"?> + +<!-- $Id$ --> + +<project xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd%22%3E + + <modelVersion>4.0.0</modelVersion> + + <groupId>org.rhq.sample</groupId> + <artifactId>rhq-sample-bundle</artifactId> + <version>2.0</version> + <packaging>pom</packaging> + + <name>RHQ Sample Bundle</name> + <description>a sample bundle consisting of JBossAS 6.0 running the Java Petstore application</description> + + <scm> + <connection>scm:git:ssh://git.fedorahosted.org/git/rhq.git/etc/modules/sample-bundle/</connection> + <developerConnection>scm:git:ssh://git.fedorahosted.org/git/rhq.git/etc/modules/sample-bundle/</developerConnection> + </scm> + + <properties> + <!-- dependency versions --> + <derbyclient.version>10.5.3.0_1</derbyclient.version> + </properties> + + <dependencies> + + <!-- Derby JDBC driver --> + <dependency> + <groupId>org.apache.derby</groupId> + <artifactId>derbyclient</artifactId> + <version>${derbyclient.version}</version> + </dependency> + + </dependencies> + + <build> + + <plugins> + + <plugin> + <artifactId>maven-antrun-plugin</artifactId> + <executions> + <execution> + <id>prepare-bundle</id> + <phase>process-resources</phase> + <configuration> + <tasks> + <echo>settings.localRepository=${settings.localRepository}</echo> + <echo>project.build.outputDirectory=${project.build.outputDirectory}</echo> + <ant antfile="src/main/scripts/build.xml"> + <property name="settings.localRepository" value="${settings.localRepository}"/> + <property name="project.version" value="${project.version}"/> + <property name="project.build.outputDirectory" value="${project.build.outputDirectory}"/> + <property name="derbyclient.version" value="${derbyclient.version}"/> + </ant> + </tasks> + </configuration> + <goals> + <goal>run</goal> + </goals> + </execution> + </executions> + </plugin> + + <plugin> + <artifactId>maven-assembly-plugin</artifactId> + <configuration> + <descriptors> + <descriptor>src/main/scripts/assembly.xml</descriptor> + </descriptors> + <finalName>${project.build.finalName}</finalName> + </configuration> + <executions> + <execution> + <id>assemble-bundle</id> + <phase>package</phase> + <goals> + <goal>attached</goal> + </goals> + </execution> + </executions> + </plugin> + + </plugins> + </build> + +</project> + diff --git a/etc/samples/provisioning/sample-bundle/src/main/bundle/deploy.xml b/etc/samples/provisioning/sample-bundle/src/main/bundle/deploy.xml new file mode 100644 index 0000000..8bfec17 --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/bundle/deploy.xml @@ -0,0 +1,57 @@ +<?xml version="1.0"?> + +<project name="petstore" default="main" + xmlns:rhq="antlib:org.rhq.bundle"> + + <rhq:bundle name="Java Petstore" version="2.0" + description="a sample bundle consisting of JBossAS 6.0 running the Java Petstore application"> + + <rhq:input-property + name="jboss.bind.address" + description="the IP address the JBoss AS server should bind to" + required="true"/> + + <rhq:input-property + name="http.port" + description="the HTTP port the JBoss AS server should listen on" + required="true" + type="integer"/> + + <rhq:input-property + name="https.port" + description="the HTTPS port the JBoss AS server should listen on" + required="true" + type="integer"/> + + <rhq:deployment-unit name="appserver" + preinstallTarget="appserver-preinstall" postinstallTarget="appserver-postinstall"> + <rhq:system-service name="jbossas-petstore" scriptFile="jbossas-init-script" + configFile="jbossas-init-config" overwriteScript="true" + startLevels="3,4,5" startPriority="80" stopPriority="20"/> + + <rhq:archive name="jbossas-petstore.zip"/> + + <!-- the files that should be ignored during upgrades --> + rhq:ignore + rhq:fileset + <include name="server/default/data/**"/> + <include name="server/default/logs/**"/> + <include name="server/default/tmp/**"/> + <include name="server/default/work/**"/> + </rhq:fileset> + </rhq:ignore> + </rhq:deployment-unit> + + </rhq:bundle> + + <target name="main"/> + + <target name="appserver-preinstall"> + <echo>Installing Java Petstore App Server to ${rhq.deploy.dir}...</echo> + </target> + + <target name="appserver-postinstall"> + <echo>Done installing Java Petstore App Server to ${rhq.deploy.dir}.</echo> + </target> + +</project> diff --git a/etc/samples/provisioning/sample-bundle/src/main/bundle/jbossas-init-config b/etc/samples/provisioning/sample-bundle/src/main/bundle/jbossas-init-config new file mode 100644 index 0000000..a2fc4c1 --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/bundle/jbossas-init-config @@ -0,0 +1,69 @@ +# Configuration file for jbossas init script that configures the +# settings needed to start a particular JBoss AS instance. + +# +# the JBoss AS installation directory (e.g. /opt/jboss-6.0.0.M1) +# (*REQUIRED*) +# +JBOSS_HOME="@@rhq.deploy.dir@@" + +# +# the args that will be passed to run.sh +# (i.e. org.jboss.Main). +# +JBOSS_OPTS="-b @@jboss.bind.address@@" + +# What UNIX user the JBoss AS java process will run as. +# (The shutdown client is always run as the invoker of the +# init script). JBoss AS will be run as root by default, but, for +# the sake of security, it is recommended that you chown the JBoss +# AS installation files to a non-root user and use that use here. +# Note, you do need to run as root if your server will listen on one +# or more privileged (< 1024) ports. If you really do want to run as +# root, comment out the JBOSS_USER variable completely (i.e. do not +# set it to root). This will run the server process without "su". +#JBOSS_USER=jboss + +# +# Specify the maximum file descriptor limit, use "max" or "maximum" to use +# the default, as queried by the system. +# +# Defaults to "maximum" +# +#MAX_FD="maximum" + +# +# Specify the profiler configuration file to load. +# +# Default is to not load profiler configuration file. +# +#PROFILER= + +# +# Specify the location of the Java Rntime Environment (JRE) or +# Java Development Kit (JDK) installation directory. If not set, +# "/usr/java/default" will be used. +# +#JAVA_HOME="/usr/java/default" + +# +# Specify options to pass to the Java VM (if unset, a default +# set of options will be used). +# +# Note, if you want to pass the default options but some of +# your own additional options in, then set the +# ADDITIONAL_JAVA_OPTS variable (see below), rather than JAVA_OPTS. +# +#JAVA_OPTS="-Xms128M -Xmx512M -XX:MaxPermSize=256M -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Djava.net.preferIPv4Stack=true" + +# +# Specify additional options to pass to the Java VM. These are passed +# in addition to the default set of options, +# i.e. java $JAVA_OPTS $ADDITIONAL_JAVA_OPTS ... org.jboss.Main ... +# +# Sample JPDA settings (uncomment either a) or b)) +# a) remote socket debugging +#ADDITIONAL_JAVA_OPTS="-Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n" +# b) shared memory debugging +#ADDITIONAL_JAVA_OPTS="-Xrunjdwp:transport=dt_shmem,server=y,suspend=n,address=jboss" + diff --git a/etc/samples/provisioning/sample-bundle/src/main/bundle/jbossas-init-script b/etc/samples/provisioning/sample-bundle/src/main/bundle/jbossas-init-script new file mode 100644 index 0000000..58eb98e --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/bundle/jbossas-init-script @@ -0,0 +1,328 @@ +#!/bin/bash +# +# jbossas - This shell script takes care of starting and stopping +# a JBoss Application Server (AS) instance on a Red Hat +# Linux system. It can be run as a system service (init +# script) and/or run manually. +# +# chkconfig: 345 84 16 +# description: JBoss AS server +# processname: java +# pidfile: /var/run/jbossas.pid + +# Source init-script function library. +FUNCTIONS=/etc/rc.d/init.d/functions +if [ ! -f "$FUNCTIONS" ]; then + echo "Functions library ($FUNCTIONS) not found." >&2 + exit 1 +fi +. $FUNCTIONS + +# Find the name of this service (e.g. "jbossas"). +NAME=`basename $0` +if [ ${NAME:0:1} = "S" -o ${NAME:0:1} = "K" ]; then + NAME=${NAME:3} +fi + +# Set names of pid, lock, and log files - all based on the service name. +PIDFILE="/var/run/$NAME.pid" +LOCKFILE="/var/lock/subsys/$NAME" +LOGFILE="/var/log/$NAME.log" + +# Set defaults for optional configuration variables. +JAVA_HOME="/usr/java/default" +JAVA_OPTS="-Xms128M -Xmx512M -XX:MaxPermSize=256M" +JAVA_OPTS="$JAVA_OPTS -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000" +# (Prefer IPv4 stack as as temporary workaround to avoid 'all' config startup +# issues from IPv4 multicast addresses. See JBAS-7936.) +JAVA_OPTS="$JAVA_OPTS -Djava.net.preferIPv4Stack=true" + +# Source the service's config file, potentially overriding the defaults set +# above. +CONFIG="/etc/sysconfig/${NAME}" +if [ ! -f "$CONFIG" ]; then + echo "Required configuration file $CONFIG not found." >&2 + exit 1 +fi +. "$CONFIG" + +# Bail out if required variables were not set in the config file. +if [ -z "$JBOSS_HOME" ]; then + echo "Required variable JBOSS_HOME was not set in $CONFIG." >&2 + exit 1 +fi + + +start() +{ + # See if the service is already running, and, if so, exit with an error. + PID=`pidfileofproc "$NAME"` + if [ -n "$PID" ]; then + # pid file exists - see if process is actually running. + kill -0 $PID 2>/dev/null + if [ $? -eq 0 ]; then + echo "$NAME service is already running (pid=$PID)." >&2 + exit 1 + else + echo "Removing bogus pid file $PIDFILE..." + rm -f "$PIDFILE" + if [ -f "$LOCKFILE" ]; then + echo "Removing bogus lock file $LOCKFILE..." + rm -f "$LOCKFILE" + fi + fi + fi + + # Check that JAVA_HOME is valid. + JAVA="$JAVA_HOME/bin/java" + if [ ! -f "$JAVA" ]; then + echo "Java not found at $JAVA - please set JAVA_HOME in $CONFIG." >&2 + exit 1 + fi + if [ ! -x "$JAVA" ]; then + echo "$JAVA is not executable." >&2 + exit 5 + fi + + # Setup the classpath + JBOSS_BOOT_CLASSPATH="$JBOSS_HOME/bin/run.jar" + if [ ! -f "$JBOSS_BOOT_CLASSPATH" ]; then + echo "Missing required file: $JBOSS_BOOT_CLASSPATH" >&2 + exit 1 + fi + + # By default, Tomcat uses the JDT Compiler for compiling JSPs. However, + # include tools.jar in the classpath if we can find it under JAVA_HOME + # or if the user specified it via the JAVAC_JAR variable. + JAVAC_JAR_FILE="${JAVAC_JAR:-$JAVA_HOME/lib/tools.jar}" + if [ ! -f "$JAVAC_JAR_FILE" ]; then + [ -n "$JAVAC_JAR" ] && echo "Missing javac jar file $JAVAC_JAR as defined by the JAVAC_JAR variable. Unexpected results may occur." + unset JAVAC_JAR_FILE + fi + + # If -server not set in JAVA_OPTS, set it, if supported. + SERVER_SET=`echo $JAVA_OPTS | grep "-server"` + if [ -z "$SERVER_SET" ]; then + # Check for Sun JVM w/ HotSpot support. + HAS_HOTSPOT=`"$JAVA" -version 2>&1 | grep -i HotSpot` + + # Check for OpenJDK JVM w/ server support. + HAS_OPENJDK=`"$JAVA" -version 2>&1 | grep -i OpenJDK` + + # Enable -server if we have Hotspot or OpenJDK, unless we can't + if [ -n "$HAS_HOTSPOT" ] || [ -n "$HAS_OPENJDK" ]; then + JAVA_OPTS="-server $JAVA_OPTS" + fi + fi + + # Setup JBoss-specific properties. + JAVA_OPTS="-Dprogram.name=$NAME $JAVA_OPTS" + + # Setup JBoss Native library path. + unset JBOSS_NATIVE_DIR + for DIR in "$JBOSS_HOME/../native/lib" "$JBOSS_HOME/../native" "$JBOSS_HOME/../native/lib64" "$JBOSS_HOME/native/lib64" "$JBOSS_HOME/native/bin" "$JBOSS_HOME/bin/native"; do + if [ -d "$DIR" ]; then + JBOSS_NATIVE_DIR=`cd "$DIR/.." && pwd` + break + fi + done + if [ -d "$JBOSS_NATIVE_DIR" ]; then + IS_64_BIT_JVM=`"$JAVA" $JAVA_OPTS -version 2>&1 | grep -i 64-bit` + if [ -n "$IS_64_BIT_JVM" ]; then + JBOSS_NATIVE_DIR="$JBOSS_NATIVE_DIR/lib64" + else + JBOSS_NATIVE_DIR="$JBOSS_NATIVE_DIR/lib" + fi + LD_LIBRARY_PATH="$JBOSS_NATIVE_DIR${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" + export LD_LIBRARY_PATH + JAVA_OPTS="$JAVA_OPTS -Djava.library.path=$LD_LIBRARY_PATH" + fi + + # Setup the Java endorsed dirs. + JBOSS_ENDORSED_DIRS="$JBOSS_HOME/lib/endorsed" + JAVA_OPTS="$JAVA_OPTS -Djava.endorsed.dirs="$JBOSS_ENDORSED_DIRS"" + + # Setup the Java classpath. + JBOSS_CLASSPATH="${JBOSS_CLASSPATH:+$JBOSS_CLASSPATH:$JBOSS_BOOT_CLASSPATH}" + JBOSS_CLASSPATH="${JBOSS_CLASSPATH:-$JBOSS_BOOT_CLASSPATH}" + JBOSS_CLASSPATH="$JBOSS_CLASSPATH${JAVAC_JAR_FILE:+:$JAVAC_JAR_FILE}" + JAVA_OPTS="$JAVA_OPTS -classpath "$JBOSS_CLASSPATH"" + + # Display a summary of our environment if we're associated with a terminal. + if tty -s; then + echo "========================================================================="; echo + echo " JBoss AS Bootstrap Environment" ; echo + echo " JBOSS_HOME: $JBOSS_HOME" ; echo + echo " JAVA: $JAVA" ; echo + echo " JAVA_OPTS: $JAVA_OPTS" ; echo + echo " JBOSS_OPTS: $JBOSS_OPTS" ; echo + echo "========================================================================="; echo + fi + + # JBoss AS expects its current working dir to be $JBOSS_HOME/bin + cd "$JBOSS_HOME/bin" + + # JBoss AS expects JBOSS_HOME to be set in its environment. + export JBOSS_HOME + + # We only need to bother with nohup if we're associated with a terminal. + if tty -s; then + NOHUP=nohup + else + unset NOHUP + fi + + # If they set NICELEVEL in the config file, honor it. + [ -n "${NICELEVEL:-}" ] && NICE="nice -n $NICELEVEL" + + # If JBOSS_USER was specified in the config and current user is root, we + # want to setuid the JBoss AS process to JBOSS_USER. + if [ -n "$JBOSS_USER" ] && [ "$EUID" -eq 0 ]; then + # For SELinux we need to use 'runuser', not 'su'. + if [ -x /sbin/runuser ]; then + SU=runuser + else + SU=su + fi + else + unset SU + fi + + if [ -n "$SU" ]; then + WRAPPER="$NOHUP $NICE $SU -s /bin/bash - $JBOSS_USER -c" + else + WRAPPER="$NOHUP $NICE bash -c" + fi + + # Make sure log file exists and has correct ownership and permissions. + if [ "$EUID" -eq 0 ]; then + touch -a "$LOGFILE" || exit 4 + [ -n "$JBOSS_USER" ] && chown $JBOSS_USER "$LOGFILE" + [ -n "$JBOSS_GROUP" ] && chgrp $JBOSS_GROUP "$LOGFILE" + chmod u=rw "$LOGFILE" + [ -n "$JBOSS_GROUP" ] && chmod g+r "$LOGFILE" + [ -x /sbin/restorecon ] && /sbin/restorecon "$LOGFILE" + fi + + # Make sure pid file has correct ownership and permissions. + if [ "$EUID" -eq 0 ] && [ -f "$PIDFILE" ]; then + [ -n "$JBOSS_USER" ] && chown $JBOSS_USER "$PIDFILE" + [ -n "$JBOSS_GROUP" ] && chgrp $JBOSS_GROUP "$PIDFILE" + chmod u=rw "$PIDFILE" + [ -n "$JBOSS_GROUP" ] && chmod g+r + [ -x /sbin/restorecon ] && /sbin/restorecon "$PIDFILE" + fi + + echo -n "Starting $NAME service: " + + # Make sure to escape the $$'s within the subshell to prevent our own shell + # from evaluating them and writing our own pid to the pid file. + $WRAPPER "echo $$ >"$PIDFILE" || ( echo "Failed to write pid ($$) to $PIDFILE." >&2; exit 4 ); exec "$JAVA" $JAVA_OPTS org.jboss.Main $JBOSS_OPTS" >>"$LOGFILE" 2>&1 & + if [ $? -ne 0 ]; then + failure "$NAME startup" + echo + EXIT_STATUS=$? + fi + + # Wait a few seconds and then check that the process is running. Note, this + # will *not* verify that JBoss AS started properly without any configuration + # or deployment errors. + sleep 3 + + if pidfileofproc "$NAME"; then + success "$NAME startup" + echo + touch "$LOCKFILE" + EXIT_STATUS=0 + else + failure "$NAME startup" + echo + EXIT_STATUS=1 + fi +} + +stop() +{ + # See if service is running, and, if not, exit without any error. + PID=`pidfileofproc "$NAME"` + unset NOT_RUNNING + if [ -z "$PID" ]; then + NOT_RUNNING=1 + else + # pid file exists - see if process is actually running. + kill -0 $PID 2>/dev/null + if [ $? -ne 0 ]; then + NOT_RUNNING=1 + if [ -f "$PIDFILE" ]; then + echo "Removing bogus pid file $PIDFILE..." + rm -f "$PIDFILE" + fi + if [ -f "$LOCKFILE" ]; then + echo "Removing bogus lock file $LOCKFILE..." + rm -f "$LOCKFILE" + fi + fi + fi + if [ -n "$NOT_RUNNING" ]; then + echo "$NAME service is not running." + exit 0 + fi + + echo -n "Stopping $NAME service: " + killproc -d 30 "$NAME" + EXIT_STATUS=$? + if [ $EXIT_STATUS -eq 0 ]; then + rm -f "$LOCKFILE" + fi + echo +} + +# NOTE: We don't name this function 'status', since that would override the +# 'status function defined in /etc/init.d/functions. +_status() +{ + status "$NAME" + EXIT_CODE=$? +} + +restart() +{ + stop || exit $? + start +} + +condrestart() +{ + [ -f "$PIDFILE" ] && restart +} + +usage() +{ + echo "Usage: $NAME {start|stop|status|restart|condrestart}" >&2 + EXIT_CODE=2 +} + +# The +case "$1" in + start) + start + ;; + stop) + stop + ;; + status) + _status + ;; + restart) + restart + ;; + condrestart) + condrestart + ;; + *) + usage + ;; +esac + +exit $EXIT_STATUS + diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/petstore-db.changelog.xml b/etc/samples/provisioning/sample-bundle/src/main/petstore/petstore-db.changelog.xml new file mode 100644 index 0000000..42ced88 --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/petstore/petstore-db.changelog.xml @@ -0,0 +1,187 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog/1.9" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog/1.9 http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-1.9.xsd"> + <changeSet author="ips (generated)" id="1272025063915-1"> + <createTable schemaName="APP" tableName="ADDRESS"> + <column name="ADDRESSID" type="VARCHAR(10)"> + <constraints nullable="false" primaryKey="true" primaryKeyName="SQL100422173635960"/> + </column> + <column name="STREET1" type="VARCHAR(55)"> + <constraints nullable="false"/> + </column> + <column name="STREET2" type="VARCHAR(55)"/> + <column name="CITY" type="VARCHAR(55)"> + <constraints nullable="false"/> + </column> + <column name="STATE" type="VARCHAR(25)"> + <constraints nullable="false"/> + </column> + <column name="ZIP" type="VARCHAR(5)"> + <constraints nullable="false"/> + </column> + <column name="LATITUDE" type="DECIMAL(14,10)"> + <constraints nullable="false"/> + </column> + <column name="LONGITUDE" type="DECIMAL(14,10)"> + <constraints nullable="false"/> + </column> + </createTable> + </changeSet> + <changeSet author="ips (generated)" id="1272025063915-2"> + <createTable schemaName="APP" tableName="CATEGORY"> + <column name="CATEGORYID" type="VARCHAR(10)"> + <constraints nullable="false" primaryKey="true" primaryKeyName="SQL100422173635550"/> + </column> + <column name="NAME" type="VARCHAR(25)"> + <constraints nullable="false"/> + </column> + <column name="DESCRIPTION" type="VARCHAR(255)"> + <constraints nullable="false"/> + </column> + <column name="IMAGEURL" type="VARCHAR(55)"/> + </createTable> + </changeSet> + <changeSet author="ips (generated)" id="1272025063915-3"> + <createTable schemaName="APP" tableName="ID_GEN"> + <column name="GEN_KEY" type="VARCHAR(20)"> + <constraints nullable="false" primaryKey="true" primaryKeyName="SQL100422173636590"/> + </column> + <column name="GEN_VALUE" type="INT"> + <constraints nullable="false"/> + </column> + </createTable> + </changeSet> + <changeSet author="ips (generated)" id="1272025063915-4"> + <createTable schemaName="APP" tableName="ITEM"> + <column name="ITEMID" type="VARCHAR(10)"> + <constraints nullable="false" primaryKey="true" primaryKeyName="SQL100422173636230"/> + </column> + <column name="PRODUCTID" type="VARCHAR(10)"> + <constraints nullable="false"/> + </column> + <column name="NAME" type="VARCHAR(30)"> + <constraints nullable="false"/> + </column> + <column name="DESCRIPTION" type="VARCHAR(500)"> + <constraints nullable="false"/> + </column> + <column name="IMAGEURL" type="VARCHAR(55)"/> + <column name="IMAGETHUMBURL" type="VARCHAR(55)"/> + <column name="PRICE" type="DECIMAL(14,2)"> + <constraints nullable="false"/> + </column> + <column name="ADDRESS_ADDRESSID" type="VARCHAR(10)"> + <constraints nullable="false"/> + </column> + <column name="CONTACTINFO_CONTACTINFOID" type="VARCHAR(10)"> + <constraints nullable="false"/> + </column> + <column name="TOTALSCORE" type="INT"> + <constraints nullable="false"/> + </column> + <column name="NUMBEROFVOTES" type="INT"> + <constraints nullable="false"/> + </column> + <column name="DISABLED" type="INT"> + <constraints nullable="false"/> + </column> + </createTable> + </changeSet> + <changeSet author="ips (generated)" id="1272025063915-5"> + <createTable schemaName="APP" tableName="PRODUCT"> + <column name="PRODUCTID" type="VARCHAR(10)"> + <constraints nullable="false" primaryKey="true" primaryKeyName="SQL100422173635740"/> + </column> + <column name="CATEGORYID" type="VARCHAR(10)"> + <constraints nullable="false"/> + </column> + <column name="NAME" type="VARCHAR(25)"> + <constraints nullable="false"/> + </column> + <column name="DESCRIPTION" type="VARCHAR(255)"> + <constraints nullable="false"/> + </column> + <column name="IMAGEURL" type="VARCHAR(55)"/> + </createTable> + </changeSet> + <changeSet author="ips (generated)" id="1272025063915-6"> + <createTable schemaName="APP" tableName="SELLERCONTACTINFO"> + <column name="CONTACTINFOID" type="VARCHAR(10)"> + <constraints nullable="false" primaryKey="true" primaryKeyName="SQL100422173636080"/> + </column> + <column name="LASTNAME" type="VARCHAR(24)"> + <constraints nullable="false"/> + </column> + <column name="FIRSTNAME" type="VARCHAR(24)"> + <constraints nullable="false"/> + </column> + <column name="EMAIL" type="VARCHAR(24)"> + <constraints nullable="false"/> + </column> + </createTable> + </changeSet> + <changeSet author="ips (generated)" id="1272025063915-7"> + <createTable schemaName="APP" tableName="TAG"> + <column name="TAGID" type="INT"> + <constraints nullable="false" primaryKey="true" primaryKeyName="SQL100422173636830"/> + </column> + <column name="TAG" type="VARCHAR(30)"> + <constraints nullable="false"/> + </column> + <column name="REFCOUNT" type="INT"> + <constraints nullable="false"/> + </column> + </createTable> + </changeSet> + <changeSet author="ips (generated)" id="1272025063915-8"> + <createTable schemaName="APP" tableName="TAG_ITEM"> + <column name="TAGID" type="INT"> + <constraints nullable="false"/> + </column> + <column name="ITEMID" type="VARCHAR(10)"> + <constraints nullable="false"/> + </column> + </createTable> + </changeSet> + <changeSet author="ips (generated)" id="1272025063915-9"> + <createTable schemaName="APP" tableName="ZIPLOCATION"> + <column name="ZIPCODE" type="INT"> + <constraints nullable="false" primaryKey="true" primaryKeyName="SQL100422173636710"/> + </column> + <column name="CITY" type="VARCHAR(30)"> + <constraints nullable="false"/> + </column> + <column name="STATE" type="VARCHAR(2)"> + <constraints nullable="false"/> + </column> + </createTable> + </changeSet> + <changeSet author="ips (generated)" id="1272025063915-10"> + <createIndex indexName="SQL100422173636831" schemaName="APP" tableName="TAG" unique="true"> + <column name="TAG"/> + </createIndex> + </changeSet> + <changeSet author="ips (generated)" id="1272025063915-11"> + <createIndex indexName="SQL100422173637010" schemaName="APP" tableName="TAG_ITEM" unique="true"> + <column name="TAGID"/> + <column name="ITEMID"/> + </createIndex> + </changeSet> + <changeSet author="ips (generated)" id="1272025063915-12"> + <addForeignKeyConstraint baseColumnNames="ADDRESS_ADDRESSID" baseTableName="ITEM" baseTableSchemaName="APP" constraintName="SQL100422173636231" deferrable="false" initiallyDeferred="false" referencedColumnNames="ADDRESSID" referencedTableName="ADDRESS" referencedTableSchemaName="APP"/> + </changeSet> + <changeSet author="ips (generated)" id="1272025063915-13"> + <addForeignKeyConstraint baseColumnNames="CONTACTINFO_CONTACTINFOID" baseTableName="ITEM" baseTableSchemaName="APP" constraintName="SQL100422173636233" deferrable="false" initiallyDeferred="false" referencedColumnNames="CONTACTINFOID" referencedTableName="SELLERCONTACTINFO" referencedTableSchemaName="APP"/> + </changeSet> + <changeSet author="ips (generated)" id="1272025063915-14"> + <addForeignKeyConstraint baseColumnNames="PRODUCTID" baseTableName="ITEM" baseTableSchemaName="APP" constraintName="SQL100422173636232" deferrable="false" initiallyDeferred="false" referencedColumnNames="PRODUCTID" referencedTableName="PRODUCT" referencedTableSchemaName="APP"/> + </changeSet> + <changeSet author="ips (generated)" id="1272025063915-15"> + <addForeignKeyConstraint baseColumnNames="CATEGORYID" baseTableName="PRODUCT" baseTableSchemaName="APP" constraintName="SQL100422173635741" deferrable="false" initiallyDeferred="false" referencedColumnNames="CATEGORYID" referencedTableName="CATEGORY" referencedTableSchemaName="APP"/> + </changeSet> + <changeSet author="ips (generated)" id="1272025063915-16"> + <addForeignKeyConstraint baseColumnNames="ITEMID" baseTableName="TAG_ITEM" baseTableSchemaName="APP" constraintName="SQL100422173637011" deferrable="false" initiallyDeferred="false" referencedColumnNames="ITEMID" referencedTableName="ITEM" referencedTableSchemaName="APP"/> + </changeSet> + <changeSet author="ips (generated)" id="1272025063915-17"> + <addForeignKeyConstraint baseColumnNames="TAGID" baseTableName="TAG_ITEM" baseTableSchemaName="APP" constraintName="SQL100422173637012" deferrable="false" initiallyDeferred="false" referencedColumnNames="TAGID" referencedTableName="TAG" referencedTableSchemaName="APP"/> + </changeSet> +</databaseChangeLog> diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore-ds.xml b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore-ds.xml new file mode 100644 index 0000000..ae5ea7c --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore-ds.xml @@ -0,0 +1,42 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!-- The Derby embedded database JCA connection factory config --> +<!-- See http://www.jboss.org/community/wiki/Multiple1PC for information about local-tx-datasource --> +<!-- $Id: derby-ds.xml 97536 2009-12-08 14:05:07Z jesper.pedersen $ --> + +<datasources> + + <local-tx-datasource> + + <!-- The jndi name of the DataSource, it is prefixed with java:/ --> + <!-- Datasources are not available outside the virtual machine --> + <jndi-name>jdbc/PetstoreDB</jndi-name> + + <!-- for in-process persistent db, saved when jboss stops. The + org.jboss.jdbc.DerbyDatabase mbean is necessary for properly db shutdown --> + <connection-url>jdbc:derby://localhost:1527/petstore;create=true</connection-url> + + <!-- The driver class --> + <driver-class>org.apache.derby.jdbc.ClientDriver</driver-class> + + <!-- The login and password --> + <user-name>APP</user-name> + <password>APP</password> + + <!-- The minimum connections in a pool/sub-pool. Pools are lazily constructed on first use --> + <min-pool-size>5</min-pool-size> + + <!-- The maximum connections in a pool/sub-pool --> + <max-pool-size>20</max-pool-size> + + <!-- The time before an unused connection is destroyed --> + <idle-timeout-minutes>5</idle-timeout-minutes> + + <!-- Whether to check all statements are closed when the connection is returned to the pool, + this is a debugging feature that should be turned off in production --> + <track-statements/> + + </local-tx-datasource> + +</datasources> + diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/META-INF/application.xml b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/META-INF/application.xml new file mode 100644 index 0000000..eadc0f4 --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/META-INF/application.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<application xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/application_1_4.xsd" version="1.4"> + + <display-name>Java Pet Store</display-name> + + <module> + <web> + <web-uri>petstore.war</web-uri> + <context-root>/petstore</context-root> + </web> + </module> + + <module> + <ejb>petstore-ejb.jar</ejb> + </module> + +</application> + diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore-ejb.jar/META-INF/persistence.xml b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore-ejb.jar/META-INF/persistence.xml new file mode 100644 index 0000000..76e0703 --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore-ejb.jar/META-INF/persistence.xml @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd%22%3E + + <persistence-unit name="PetstorePu"> + <description>Petstore Persistence Unit</description> + <provider>org.hibernate.ejb.HibernatePersistence</provider> + <jta-data-source>java:jdbc/PetstoreDB</jta-data-source> + <non-jta-data-source>java:jdbc/PetstoreDB</non-jta-data-source> + <properties> + <property name="hibernate.dialect" value="org.hibernate.dialect.DerbyDialect"/> + <property name="hibernate.connection.username" value="APP"/> + <property name="hibernate.connection.password" value="APP"/> + <property name="hibernate.format_sql" value="true"/> + </properties> + </persistence-unit> + +</persistence> + diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore-ejb.jar/com/sun/javaee/blueprints/petstore/model/Address.class b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore-ejb.jar/com/sun/javaee/blueprints/petstore/model/Address.class new file mode 100644 index 0000000..c9dc392 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore-ejb.jar/com/sun/javaee/blueprints/petstore/model/Address.class differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore-ejb.jar/com/sun/javaee/blueprints/petstore/model/Category.class b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore-ejb.jar/com/sun/javaee/blueprints/petstore/model/Category.class new file mode 100644 index 0000000..be2275b Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore-ejb.jar/com/sun/javaee/blueprints/petstore/model/Category.class differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore-ejb.jar/com/sun/javaee/blueprints/petstore/model/Item.class b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore-ejb.jar/com/sun/javaee/blueprints/petstore/model/Item.class new file mode 100644 index 0000000..8842106 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore-ejb.jar/com/sun/javaee/blueprints/petstore/model/Item.class differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore-ejb.jar/com/sun/javaee/blueprints/petstore/model/Product.class b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore-ejb.jar/com/sun/javaee/blueprints/petstore/model/Product.class new file mode 100644 index 0000000..dda3feb Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore-ejb.jar/com/sun/javaee/blueprints/petstore/model/Product.class differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore-ejb.jar/com/sun/javaee/blueprints/petstore/model/SellerContactInfo.class b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore-ejb.jar/com/sun/javaee/blueprints/petstore/model/SellerContactInfo.class new file mode 100644 index 0000000..b5dbe74 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore-ejb.jar/com/sun/javaee/blueprints/petstore/model/SellerContactInfo.class differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore-ejb.jar/com/sun/javaee/blueprints/petstore/model/Tag.class b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore-ejb.jar/com/sun/javaee/blueprints/petstore/model/Tag.class new file mode 100644 index 0000000..1b5785b Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore-ejb.jar/com/sun/javaee/blueprints/petstore/model/Tag.class differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore-ejb.jar/com/sun/javaee/blueprints/petstore/model/ZipLocation.class b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore-ejb.jar/com/sun/javaee/blueprints/petstore/model/ZipLocation.class new file mode 100644 index 0000000..591af10 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore-ejb.jar/com/sun/javaee/blueprints/petstore/model/ZipLocation.class differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/META-INF/MANIFEST.MF b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/META-INF/MANIFEST.MF new file mode 100644 index 0000000..7a679c4 --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/META-INF/MANIFEST.MF @@ -0,0 +1,4 @@ +Manifest-Version: 1.0 +Ant-Version: Apache Ant 1.7.1 +Created-By: 16.0-b13 (Sun Microsystems Inc.) + diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/captcha/BlueFilter.class b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/captcha/BlueFilter.class new file mode 100644 index 0000000..abac5a6 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/captcha/BlueFilter.class differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/captcha/CaptchaSingleton.class b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/captcha/CaptchaSingleton.class new file mode 100644 index 0000000..7d7af77 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/captcha/CaptchaSingleton.class differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/captcha/RandomString.class b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/captcha/RandomString.class new file mode 100644 index 0000000..b8bfa4d Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/captcha/RandomString.class differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/captcha/SimpleCaptcha.class b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/captcha/SimpleCaptcha.class new file mode 100644 index 0000000..8c469f4 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/captcha/SimpleCaptcha.class differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/AddressBean.class b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/AddressBean.class new file mode 100644 index 0000000..e2b4ca5 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/AddressBean.class differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/AutocompleteBean.class b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/AutocompleteBean.class new file mode 100644 index 0000000..223289e Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/AutocompleteBean.class differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/CaptchaValidateFilter.class b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/CaptchaValidateFilter.class new file mode 100644 index 0000000..61f3863 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/CaptchaValidateFilter.class differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/ControllerAction.class b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/ControllerAction.class new file mode 100644 index 0000000..7c149e3 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/ControllerAction.class differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/ControllerServlet.class b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/ControllerServlet.class new file mode 100644 index 0000000..c5fb59a Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/ControllerServlet.class differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/EntryFilter.class b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/EntryFilter.class new file mode 100644 index 0000000..65d4cdb Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/EntryFilter.class differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/FileUploadBean.class b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/FileUploadBean.class new file mode 100644 index 0000000..1ee72ad Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/FileUploadBean.class differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/actions/CaptchaAction.class b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/actions/CaptchaAction.class new file mode 100644 index 0000000..f56c35e Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/actions/CaptchaAction.class differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/actions/CatalogXmlAction.class b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/actions/CatalogXmlAction.class new file mode 100644 index 0000000..56fc53d Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/actions/CatalogXmlAction.class differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/actions/DefaultControllerAction.class b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/actions/DefaultControllerAction.class new file mode 100644 index 0000000..ee55705 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/actions/DefaultControllerAction.class differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/actions/ImageAction.class b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/actions/ImageAction.class new file mode 100644 index 0000000..30e70ab Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/actions/ImageAction.class differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/actions/TagXmlAction.class b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/actions/TagXmlAction.class new file mode 100644 index 0000000..dd5b7c1 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/actions/TagXmlAction.class differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/mapviewer/MapBean.class b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/mapviewer/MapBean.class new file mode 100644 index 0000000..03400b2 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/mapviewer/MapBean.class differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/model/CatalogFacade.class b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/model/CatalogFacade.class new file mode 100644 index 0000000..23a204c Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/model/CatalogFacade.class differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/model/FileUploadResponse.class b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/model/FileUploadResponse.class new file mode 100644 index 0000000..18f8102 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/model/FileUploadResponse.class differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/model/PayPalBean.class b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/model/PayPalBean.class new file mode 100644 index 0000000..b6e2b0d Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/model/PayPalBean.class differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/model/RatingBean.class b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/model/RatingBean.class new file mode 100644 index 0000000..be21196 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/model/RatingBean.class differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/proxy/GeoCoder.class b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/proxy/GeoCoder.class new file mode 100644 index 0000000..185dc01 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/proxy/GeoCoder.class differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/proxy/GeoPoint.class b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/proxy/GeoPoint.class new file mode 100644 index 0000000..18b3463 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/proxy/GeoPoint.class differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/search/HTMLParser$CallbackHandler.class b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/search/HTMLParser$CallbackHandler.class new file mode 100644 index 0000000..0c448bf Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/search/HTMLParser$CallbackHandler.class differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/search/HTMLParser.class b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/search/HTMLParser.class new file mode 100644 index 0000000..4a19fad Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/search/HTMLParser.class differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/search/IndexDocument.class b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/search/IndexDocument.class new file mode 100644 index 0000000..a8b6521 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/search/IndexDocument.class differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/search/Indexer.class b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/search/Indexer.class new file mode 100644 index 0000000..2b42389 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/search/Indexer.class differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/search/SQLParser.class b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/search/SQLParser.class new file mode 100644 index 0000000..8ab0084 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/search/SQLParser.class differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/search/SearchBean.class b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/search/SearchBean.class new file mode 100644 index 0000000..a4cc2bf Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/search/SearchBean.class differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/search/SearchIndex.class b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/search/SearchIndex.class new file mode 100644 index 0000000..50007c4 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/search/SearchIndex.class differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/search/UpdateIndex.class b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/search/UpdateIndex.class new file mode 100644 index 0000000..1ef9761 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/search/UpdateIndex.class differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/util/ImageScaler.class b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/util/ImageScaler.class new file mode 100644 index 0000000..5570fac Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/util/ImageScaler.class differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/util/LogStrings.properties b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/util/LogStrings.properties new file mode 100644 index 0000000..112905d --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/util/LogStrings.properties @@ -0,0 +1,10 @@ +index.exception=An exception was encountered while indexing the data. Please checked to make sure there indexes are not locked by another user. +index.sql.statement=Select statement used for retrieving database data "{0}" +search.string=Searching indexes for string "{0}" +search.results=Search String returned "{0}" hits +search.exception=An exception was encountered while performing the search. Please check to make sure the indexes exist. +fileupload.persist.exception=Error persisting seller data +fileupload.rollback.exception=Persisting seller data, rollback failed +geocoder.lookup.exception=The GeoCode address lookup from Yahoo has returned and Exception +image_does_not_exist=The image doesn't exist in the default image directory or in the upload directory "{0}" +resource_bundle_does_not_exist=The MessageStrings.properties file does not exist!. diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/util/MessageStrings.properties b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/util/MessageStrings.properties new file mode 100644 index 0000000..7ca2d9d --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/util/MessageStrings.properties @@ -0,0 +1,10 @@ +invalid_contact_firstname=First Name is required. +invalid_contact_lastname=Last Name is required. +invalid_address_street1=Street is required. +invalid_address_city=City is required. +invalid_address_state=State is required. +invalid_address_zip=Zip Code is required. +invalid_item_name=Pet Name is required. +invalid_item_description=The Description should exist and the field can't have a '<script>' and/or a '<link>' tag in it. +invalid_item_price=Price should should exist and be a number greater or equal to 0. +invalid_item_imageurl=The image upload file must exist and be of type '.jpg', '.gif' or '.png'. diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/util/PetstoreConstants.class b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/util/PetstoreConstants.class new file mode 100644 index 0000000..5aa4b42 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/util/PetstoreConstants.class differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/util/PetstoreUtil.class b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/util/PetstoreUtil.class new file mode 100644 index 0000000..a521d71 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/util/PetstoreUtil.class differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/faces-config.xml b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/faces-config.xml new file mode 100644 index 0000000..22f03df --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/faces-config.xml @@ -0,0 +1,94 @@ +<?xml version='1.0' encoding='UTF-8'?> + +<!-- Copyright 2006 Sun Microsystems, Inc. All rights reserved. You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at: + http://developer.sun.com/berkeley_license.html + $Id: faces-config.xml,v 1.13 2006/05/03 22:03:20 inder Exp $ --> + +<faces-config xmlns="http://java.sun.com/xml/ns/javaee" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd" + version="1.2"> + <!-- ========== Application Wide Features ================================ --> + + <!-- ========== Managed Beans ============================================ --> + <managed-bean> + <managed-bean-name>SearchBean</managed-bean-name> + <managed-bean-class>com.sun.javaee.blueprints.petstore.search.SearchBean</managed-bean-class> + <managed-bean-scope>session</managed-bean-scope> + </managed-bean> + + <managed-bean> + <managed-bean-name>RatingBean</managed-bean-name> + <managed-bean-class>com.sun.javaee.blueprints.petstore.model.RatingBean</managed-bean-class> + <managed-bean-scope>request</managed-bean-scope> + <managed-property> + <property-name>itemId</property-name> + <value>#{param.itemIdBinding}</value> + </managed-property> + </managed-bean> + + <managed-bean> + <managed-bean-name>PayPalBean</managed-bean-name> + <managed-bean-class>com.sun.javaee.blueprints.petstore.model.PayPalBean</managed-bean-class> + <managed-bean-scope>session</managed-bean-scope> + </managed-bean> + + <managed-bean> + <managed-bean-name>FileUploadBean</managed-bean-name> + <managed-bean-class>com.sun.javaee.blueprints.petstore.controller.FileUploadBean</managed-bean-class> + <managed-bean-scope>session</managed-bean-scope> + </managed-bean> + + <managed-bean> + <managed-bean-name>MapBean</managed-bean-name> + <managed-bean-class>com.sun.javaee.blueprints.petstore.mapviewer.MapBean</managed-bean-class> + <managed-bean-scope>session</managed-bean-scope> + </managed-bean> + + <managed-bean> + <managed-bean-name>AutocompleteBean</managed-bean-name> + <managed-bean-class>com.sun.javaee.blueprints.petstore.controller.AutocompleteBean</managed-bean-class> + <managed-bean-scope>session</managed-bean-scope> + </managed-bean> + + <managed-bean> + <managed-bean-name>AddressBean</managed-bean-name> + <managed-bean-class>com.sun.javaee.blueprints.petstore.controller.AddressBean</managed-bean-class> + <managed-bean-scope>session</managed-bean-scope> + </managed-bean> + + <!-- ========== Navigation Rules ========================================= --> + <navigation-rule> + <from-view-id>/mapLocation.jsp</from-view-id> + <navigation-case> + <from-outcome>map</from-outcome> + <to-view-id>/map.jsp</to-view-id> + </navigation-case> + </navigation-rule> + <navigation-rule> + <from-view-id>/mapAll.jsp</from-view-id> + <navigation-case> + <from-outcome>map</from-outcome> + <to-view-id>/map.jsp</to-view-id> + </navigation-case> + </navigation-rule> + <navigation-rule> + <from-view-id>/map.jsp</from-view-id> + <navigation-case> + <to-view-id>/mapLocation.jsp</to-view-id> + </navigation-case> + </navigation-rule> + <navigation-rule> + <from-view-id>/search.jsp</from-view-id> + <navigation-case> + <from-outcome>displayResults</from-outcome> + <to-view-id>/search.jsp</to-view-id> + </navigation-case> + <navigation-case> + <from-outcome>map</from-outcome> + <to-view-id>/map.jsp</to-view-id> + </navigation-case> + </navigation-rule> + +</faces-config> + diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/jboss-web.xml b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/jboss-web.xml new file mode 100644 index 0000000..0862993 --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/jboss-web.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<jboss-web> + <resource-ref> + <res-ref-name>jdbc/PetstoreDB</res-ref-name> + <res-type>javax.sql.DataSource</res-type> + <jndi-name>java:jdbc/PetstoreDB</jndi-name> + </resource-ref> +</jboss-web> + diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/bp-ui-5.jar b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/bp-ui-5.jar new file mode 100644 index 0000000..f6bd6d2 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/bp-ui-5.jar differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/commons-fileupload-1.1.1.jar b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/commons-fileupload-1.1.1.jar new file mode 100644 index 0000000..fc5763d Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/commons-fileupload-1.1.1.jar differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/commons-io-1.2.jar b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/commons-io-1.2.jar new file mode 100644 index 0000000..b2867cd Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/commons-io-1.2.jar differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/commons-logging-1.1.jar b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/commons-logging-1.1.jar new file mode 100644 index 0000000..2ff9bbd Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/commons-logging-1.1.jar differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/jdom.jar b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/jdom.jar new file mode 100644 index 0000000..288e64c Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/jdom.jar differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/lucene-core-2.0.0.jar b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/lucene-core-2.0.0.jar new file mode 100644 index 0000000..db6456f Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/lucene-core-2.0.0.jar differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/rome-0.8.jar b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/rome-0.8.jar new file mode 100644 index 0000000..27d2ad3 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/rome-0.8.jar differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/rome-fetcher-0.7.jar b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/rome-fetcher-0.7.jar new file mode 100644 index 0000000..c2a26da Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/rome-fetcher-0.7.jar differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/shale-remoting.jar b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/shale-remoting.jar new file mode 100644 index 0000000..128045d Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/shale-remoting.jar differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/sun-web.xml b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/sun-web.xml new file mode 100644 index 0000000..a9c411b --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/sun-web.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE sun-web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Application Server 9.0 Servlet 2.5//EN" "http://www.sun.com/software/appserver/dtds/sun-web-app_2_5-0.dtd"> +<sun-web-app error-url=""> + <context-root>/petstore</context-root> + <class-loader delegate="true"/> + <jsp-config> + <property name="classdebuginfo" value="true"> + <description>Enable debug info compilation in the generated servlet class</description> + </property> + <property name="mappedfile" value="true"> + <description>Maintain a one-to-one correspondence between static content and the generated servlet class' java code</description> + </property> + </jsp-config> +</sun-web-app> diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/web.xml b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/web.xml new file mode 100644 index 0000000..6c65069 --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/web.xml @@ -0,0 +1,126 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- Copyright 2006 Sun Microsystems, Inc. All rights reserved. You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at: + http://developer.sun.com/berkeley_license.html + $Id: web.xml,v 1.27 2007/04/18 19:25:09 smitha Exp $ --> +<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"> + + <display-name>Petstore</display-name> + <filter> + <filter-name>CaptchaValidateFilter</filter-name> + <filter-class>com.sun.javaee.blueprints.petstore.controller.CaptchaValidateFilter</filter-class> + </filter> + <filter> + <filter-name>EntryFilter</filter-name> + <filter-class>com.sun.javaee.blueprints.petstore.controller.EntryFilter</filter-class> + </filter> + <filter-mapping> + <filter-name>EntryFilter</filter-name> + <url-pattern>/*</url-pattern> + </filter-mapping> + <filter-mapping> + <filter-name>CaptchaValidateFilter</filter-name> + <url-pattern>/faces/dynamic/bpui_fileupload_handler/handleFileUpload</url-pattern> + </filter-mapping> + <listener> + <listener-class>com.sun.javaee.blueprints.petstore.model.CatalogFacade</listener-class> + </listener> + + <servlet> + <display-name>ControllerServlet</display-name> + <servlet-name>ControllerServlet</servlet-name> + <servlet-class>com.sun.javaee.blueprints.petstore.controller.ControllerServlet</servlet-class> + </servlet> + + <servlet-mapping> + <servlet-name>ControllerServlet</servlet-name> + <url-pattern>/catalog</url-pattern> + </servlet-mapping> + + <servlet-mapping> + <servlet-name>ControllerServlet</servlet-name> + <url-pattern>/controller</url-pattern> + </servlet-mapping> + + <context-param> + <description> + Google Maps authorization key for "http://localhost:8080/" + To use a another URL a new map key will have to be generated from http://www.google.com/apis/maps/ + </description> + <param-name>com.sun.j2ee.blueprints.ui.mapviewer.KEY</param-name> + <param-value>ABQIAAAAyQYKk4__l80DyIsqLPvvuxTwM0brOpm-All5BF6PoaKBxRWWERSt2NPUufvDhWGdrb-pCzTZQ2vi2A</param-value> + </context-param> + + <context-param> + <param-name>javax.faces.STATE_SAVING_METHOD</param-name> + <param-value>server</param-value> + </context-param> + + <context-param> + <param-name>com.sun.faces.validateXml</param-name> + <param-value>false</param-value> + </context-param> + + <context-param> + <param-name>com.sun.faces.verifyObjects</param-name> + <param-value>false</param-value> + </context-param> + + <context-param> + <param-name>javax.faces.CONFIG_FILES</param-name> + <param-value>/WEB-INF/faces-config.xml</param-value> + </context-param> + + <!-- proxy for mapviewer --> + <context-param> + <param-name>proxyHost</param-name> + <param-value></param-value> + </context-param> + <context-param> + <param-name>proxyPort</param-name> + <param-value></param-value> + </context-param> + <!-- filter init-param not working so use servlet context --> + <context-param> + <param-name>entryPages</param-name> + <param-value>.jpg|.gif|index.html|index.jsp|fileupload.jsp|search.jsp|catalog.jsp|mapAll.jsp|tag.jsp|news.jsp</param-value> + </context-param> + + + <!-- Faces Servlet --> + <servlet> + <servlet-name>Faces Servlet</servlet-name> + <servlet-class>javax.faces.webapp.FacesServlet</servlet-class> + <load-on-startup>1</load-on-startup> + </servlet> + + <!-- Faces Servlet Mapping --> + <servlet-mapping> + <servlet-name>Faces Servlet</servlet-name> + <url-pattern>/faces/*</url-pattern> + </servlet-mapping> + + <!-- need datasource for indexing Lucene search engine --> + <servlet-mapping> + <servlet-name>ControllerServlet</servlet-name> + <url-pattern>/faces/CaptchaServlet</url-pattern> + </servlet-mapping> + <servlet-mapping> + <servlet-name>ControllerServlet</servlet-name> + <url-pattern>/ImageServlet/*</url-pattern> + </servlet-mapping> + <servlet-mapping> + <servlet-name>ControllerServlet</servlet-name> + <url-pattern>/TagServlet/*</url-pattern> + </servlet-mapping> + <error-page> + <exception-type>java.lang.RuntimeException</exception-type> + <location>/systemerror.jsp</location> + </error-page> + <resource-ref> + <res-ref-name>jdbc/PetstoreDB</res-ref-name> + <res-type>javax.sql.DataSource</res-type> + <res-auth>Container</res-auth> + <res-sharing-scope>Shareable</res-sharing-scope> + </resource-ref> +</web-app> + diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/accordion.css b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/accordion.css new file mode 100644 index 0000000..14c6ed0 --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/accordion.css @@ -0,0 +1 @@ +.accordion { width:150px; height:400px; border-width:1px; border-style:solid; border-color:black; background:#404040; }
.accordionBody { width:160px; height:400px; border-width:1px; border-style:solid; border-color:black; background:#404040; }
.accordionTitle { vertical-align: top; padding-top: 10px; text-align: center; width:150px; height:90px; color:white; font-size:22px; font-weight: bold; background:black; opacity: .99; }
.accordionRow { color:white; cursor: pointer; font-size:18px; font-weight: bold; vertical-align: middle; padding-top: 5px; text-align: center; width:150px; height:40px; background:#104E8B; opacity: .99; }
.accordionProduct { text-align: center; width:150px; color:white; font-size:12px; font-weight: bold; background:#104E8B; opacity: .99; }
.accordionLink { cursor: pointer; text-decoration: none; color:white; }
.accordionLinkSelected { text-align: center; width:150px; color:red; font-size:12px; font-weight: bold; background:black; opacity: .99; }
.accordionLinkHover { text-decoration: underline; color:white; } \ No newline at end of file diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/accordion.js b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/accordion.js new file mode 100644 index 0000000..1c1ee6b --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/accordion.js @@ -0,0 +1,249 @@ +/* Copyright 2006 Sun Microsystems, Inc. All rights reserved. You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at: http://developer.sun.com/berkeley_license.html +$Id: accordion.js,v 1.22 2006/05/03 22:00:32 inder Exp $ */ + +function AccordionMenu () { + + dojo.event.topic.subscribe("/accordion", this, this.handleEvent); + + var displayPortWidth = 100; + var HEIGHT = 400; + + var EXPANDED_HEIGHT = 125; + var ITEM_HEIGHT = 55; + var INCREMENT = 10; + + var timeout = 5; // in ms + + var accordion = document.getElementById("accordionBody"); + var divs = []; + var oExpandedIndex = -1; + var nExpandedIndex = -1; + var oHeight = ITEM_HEIGHT; + var nHeight = ITEM_HEIGHT; + var tHeight = 165; + var expanding = false; + var categories; + + // while control the inline debug statements + var debug = false; + var status = document.getElementById("status"); + + function Row(id, div, defaultHeight) { + this.id = id; + this.div = div; + //this.height = height; + this.h = defaultHeight; + this.div.style.height = defaultHeight + "px" + } + + Row.prototype.setHeight = function(nH) { + this.h = nH; + this.div.style.height = nH + "px"; + // re-adjust for ie in that it does not follow the boxmodel + if (this.div.offsetHeight > nH) { + this.div.style.height = (nH - (this.div.offsetHeight - nH)) + 'px'; + } + } + + Row.prototype.getTotalHeight = function() { + return this.div.offsetHeight; + } + + Row.prototype.getHeight = function() { + return this.h; + } + + this.handleEvent = function(args) { + if (args.type) { + if (args.type == 'expand') { + var targetRow = args.targetRow; + initiateExpansion(targetRow); + } + } + } + + this.load = function(lcategories) { + categories = lcategories; + // create all the rows + for (var l=0; l < categories.length; l++) { + var row = createRow(l,"accordionRow", ITEM_HEIGHT); + createLinks(row.div, categories[l].name, l, "accordionLink"); + divs.push(row); + } + } + + function showStatus() { + if (debug) { + var stat = "oExpandedIndex=" + oExpandedIndex + " " ; + for (var i=0; i < divs.length; i++) { + stat = stat + i + "=" + divs[i].getTotalHeight() + " "; + } + status.innerHTML = stat + " total height=" + accordion.offsetHeight; + var totalH = 0; + var tH = 0; + for (var i=0; i < divs.length; i++) { + totalH = totalH + divs[i].getHeight(); + tH = tH + divs[i].getTotalHeight(); + } + } + } + + this.showCategory = function(catid) { + for (var l=0; l < categories.length; l++) { + if (catid == categories[l].name) { + // now tell the scroller to load the first product + initiateExpansion(l); + if (categories[l].products[0]) { + dojo.event.topic.publish("/catalog", {type:"showProducts", productId:categories[l].products[0].id}); + } + break; + } + } + } + + this.showFirstCategory = function() { + initiateExpansion(0); + if (categories[0].products[0]) { + dojo.event.topic.publish("/catalog", {type:"showProducts", productId:categories[0].products[0].id}); + } + } + + this.loadCategoryItem = function(pid, itemId) { + // find the right product and expand the accordion + for (var l=0; l < categories.length; l++) { + // now tell the scroller to load the first product + for (var il=0; il < categories[l].products.length; il++) { + if (categories[l].products[il].id == pid ) { + initiateExpansion(l); + break; + } + } + } + dojo.event.topic.publish("/catalog", {type:"showItemDetails", productId: pid , itemId: itemId}); + } + + function initiateExpansion(id) { + // jump out if we are in progress + if (!expanding && oExpandedIndex != Number(id)) { + expanding = true; + nExpandedIndex = Number(id); + if (oExpandedIndex != -1) { + var targetDiv = divs[oExpandedIndex].div; + if (targetDiv && targetDiv.childNodes) { + for (var l = targetDiv.childNodes.length -1; l >= 0 ; l--) { + targetDiv.removeChild(targetDiv.childNodes[l]); + } + } + createLinks(divs[oExpandedIndex].div, categories[oExpandedIndex].name, oExpandedIndex, "accordionLink"); + } + expandRow(id); + } + } + + function expandRow() { + if (expanding) { + showStatus(); + // + if (nHeight < EXPANDED_HEIGHT) { + nHeight = nHeight + INCREMENT; + divs[nExpandedIndex].setHeight(nHeight); + if (oExpandedIndex != -1) { + if (tHeight >= ITEM_HEIGHT) { + oHeight = oHeight - INCREMENT; + // take all out of the old expanded + } else { + oHeight = oHeight - INCREMENT; + } + divs[oExpandedIndex].setHeight(oHeight); + } + // default exapnd here + } else if (oExpandedIndex != -1 && oHeight > ITEM_HEIGHT) { + oHeight = oHeight - INCREMENT; + divs[oExpandedIndex].setHeight(oHeight); + } else { + // set the contents of the new menu + var targetDiv = divs[nExpandedIndex].div; + if (targetDiv && targetDiv.childNodes) { + for (var l = targetDiv.childNodes.length -1; l >= 0 ; l--) { + targetDiv.removeChild(targetDiv.childNodes[l]); + } + } + divs[nExpandedIndex].div.appendChild(document.createTextNode(categories[nExpandedIndex].name)); + divs[nExpandedIndex].div.appendChild(document.createElement("p")); + for (var l= 0; l < categories[nExpandedIndex].products.length; l++) { + var span = document.createElement("span"); + span.className = "accordionProduct"; + var link = document.createElement("a"); + var target = categories[nExpandedIndex].products[l].id; + link.id = target; + link.className = "accordionLink"; + // some browsers aren't setting the styles for hovers so forcing them + link.setAttribute("onmouseover", "this.className='accordionLinkHover';"); + link.setAttribute("onmouseout", "this.className='accordionLink';"); + dojo.event.connect(link, "onclick", function(evt) { + this._target = target + var src; + if (evt.target) { + src = evt.target; + } else if (evt.srcElement) { + src = evt.srcElement; + } + //src.parentNode.className = "accordionLinkSelected"; + // set this so the next time around it can be removed; + dojo.event.topic.publish("/catalog", {type:"showProducts", productId:src.id}); + }); + link.appendChild(document.createTextNode(categories[nExpandedIndex].products[l].name)); + span.appendChild(link); + divs[nExpandedIndex].div.appendChild(span); + if (l < categories[nExpandedIndex].products.length - 1) { + divs[nExpandedIndex].div.appendChild(document.createElement("p")); + } + link = null; + } + expanding = false; + oExpandedIndex = nExpandedIndex; + nExpandedIndex = -1; + oHeight = nHeight; + nHeight = ITEM_HEIGHT; + return; + } + + setTimeout(expandRow, timeout); + } + } + + function createLinks(tDiv, text, id, linkStyle) { + var link = document.createElement("a"); + link.className = linkStyle; + link.appendChild(document.createTextNode(text)); + link.setAttribute("id", id); + if (link.attachEvent) { + link.attachEvent('onmouseover',function(e){initiateExpansion(e.srcElement.getAttribute("id"));}); + } else if (link.addEventListener) { + link.addEventListener('mouseover',function(e){initiateExpansion(e.currentTarget.getAttribute("id"));}, true); + } + tDiv.appendChild(link); + } + + function createRow(id, rowStyle, height) { + var nDiv = document.createElement("div"); + nDiv.className = rowStyle; + var row; + var cell; + if (accordion.insertRow) { + row = accordion.insertRow(accordion.rows.length); + + } else { + row = document.createElement("tr"); + accordion.appendChild(row); + } + if (row.inserCell) { + cell = row.insertCell(0); + } else { + cell = document.createElement("td"); + row.appendChild(cell); + } + cell.appendChild(nDiv); + return new Row(id, nDiv, height); + } +} diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/banner.jsp b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/banner.jsp new file mode 100644 index 0000000..c43dd98 --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/banner.jsp @@ -0,0 +1,80 @@ +<%-- Copyright 2006 Sun Microsystems, Inc. All rights reserved. You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at: http://developer.sun.com/berkeley_license.html +$Id: banner.jsp,v 1.28 2006/12/19 20:23:53 yutayoshida Exp $ --%> + +<%@page contentType="text/html"%> +<%@page pageEncoding="UTF-8"%> + +<%@taglib prefix="f" uri="http://java.sun.com/jsf/core%22%%3E +<%@taglib prefix="h" uri="http://java.sun.com/jsf/html%22%%3E +<%@taglib prefix="ui" uri="http://java.sun.com/blueprints/ui" %> + +<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/styles.css"></link> +<script type="text/javascript" src="${pageContext.request.contextPath}/faces/static/META-INF/dojo/bpcatalog/dojo.js"></script> +<script type="text/javascript" src="${pageContext.request.contextPath}/faces/static/META-INF/rss/rssbar.js"></script> +<link type="text/css" rel="stylesheet" href="${pageContext.request.contextPath}/faces/static/META-INF/rss/rssbar.css" /> +<style type="text/css"> + +#rss-bar { + margin: 0 auto 0px; +} + +#rss-bar table td#rss-channel { + background-repeat: no-repeat; + background-position: top left; + font-size: 14px; + font-weight: bold; + vertical-align: top; + text-align: center; + width: 254px; +} + +#rss-bar table td#rss-item { + background-repeat: no-repeat; + font-size: 14px; + width: 534px; + text-align: left; +} + +#rss-bar table a { + color: white; + text-decoration: none; +} +#rss-bar table a:hover { color: #ffff00;} + +</style> +<script type="text/javascript"> + var rss = new bpui.RSS(); + dojo.addOnLoad(function(){rss.getRssInJson('${pageContext.request.contextPath}/faces/dynamic/bpui_rssfeedhandler/getRssfeed', 'https://blueprints.dev.java.net/servlets/ProjectRSS?type=news', '4', '4000', 'News from BluePrints', 'news.jsp');}); +</script> + +<table border="0" bordercolor="gray" cellpadding="0" cellspacing="0" bgcolor="white" width="100%"> + <tr id="injectionPoint"> + <td width="100"><a class="menuLink" href="${pageContext.request.contextPath}/faces/index.jsp""><img src="${pageContext.request.contextPath}/images/banner_logo.gif" border="0" width="70" height="70"></a></td> + <td align="left"> + <div class="banner">Java Pet Store</div> + </td> + <td id="bannerRight" align="right"> + <a class="menuLink" onmouseover="this.className='menuLinkHover';" onmouseout="this.className='menuLink';" href="${pageContext.request.contextPath}/faces/fileupload.jsp">Seller</a> <span class="menuItem">|</span> + <a class="menuLink" onmouseover="this.className='menuLinkHover';" onmouseout="this.className='menuLink';" href="${pageContext.request.contextPath}/faces/search.jsp">Search</a> <span class="menuItem">|</span> + <a class="menuLink" onmouseover="this.className='menuLinkHover';" onmouseout="this.className='menuLink';" href="${pageContext.request.contextPath}/faces/catalog.jsp">Catalog</a> <span class="menuItem">|</span> + <a class="menuLink" onmouseover="this.className='menuLinkHover';" onmouseout="this.className='menuLink';" href="${pageContext.request.contextPath}/faces/mapAll.jsp">Map</a> <span class="menuItem">|</span> + <a class="menuLink" onmouseover="this.className='menuLinkHover';" onmouseout="this.className='menuLink';" href="${pageContext.request.contextPath}/faces/tag.jsp">Tags</a> <span class="menuItem">|</span> + <a class="menuLink" onmouseover="this.className='menuLinkHover';" onmouseout="this.className='menuLink';" href="${pageContext.request.contextPath}/faces/index.jsp">Home</a> + </td> + </tr> + </tr> + <tr bgcolor="gray"> + <td id="menubar" align="left" colspan="3" height="25" > + <div id="rss-bar"> + <table border="0" cellpadding="0" cellspacing="0"> + <tr> + <td id="rss-channel" nowrap="true"></td> + <td id="rss-item" nowrap="true"></td> + </tr> + </table> + </div> + </td> + </tr> + </table> + + diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/bp_petstorelist.css b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/bp_petstorelist.css new file mode 100644 index 0000000..5c906b5 --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/bp_petstorelist.css @@ -0,0 +1,48 @@ +.bpui_petstorelist_dataDiv { + border-style: groove; + overflow: auto; + width: 600px; + height: 500px; + padding: 10px; +} + +.bpui_petstorelist_pageDiv { +} + + +.bpui_petstorelist_table { +} + +.bpui_petstorelist_cell { + padding: 5px; + vertical-align: top; +} + +.bpui_petstorelist_row { + border-bottom: dotted; +} + +.bpui_petstorelist_hr { + width: 90%; +} + +.bpui_petstorelist_image { +} + +.bpui_petstorelist_link{ +} + +.bpui_petstorelist_name{ +} + +.bpui_petstorelist_description{ +} + +.bpui_petstorelist_price { +} + +.bpui_petstorelist_previous { +} + +.bpui_petstorelist_next { +} diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/bp_petstorelist.js b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/bp_petstorelist.js new file mode 100644 index 0000000..4df46fb --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/bp_petstorelist.js @@ -0,0 +1,269 @@ +var bpui; +if(typeof bpui == "undefined") { + bpui=new Object(); +} +bpui.petstoreList=new Object(); + +bpui.petstoreList.divName=""; +bpui.petstoreList.currentCount=0; +bpui.petstoreList.numberPerPage=5; +bpui.petstoreList.category="feline01"; +bpui.petstoreList.cachedData=new Object(); +bpui.petstoreList.debug=false; +bpui.petstoreList.timer; + +bpui.petstoreList.initialSetup=function() { + // get outerdiv + var targetDiv=document.getElementById(bpui.petstoreList.divName); + + // containier div + tablex="<table><tr><td align="center">"; + tablex += "<b>Java BluePrint's Pet Store Category:</b> <select size="1" id="bpui.petstoreList.categoryList" onchange="bpui.petstoreList.selectCategory()">"; + tablex += "<option value="loading">Loading Data...</option>"; + tablex += "</select>"; + tablex += "</td></tr><tr><td><div id="bpui.petstoreList.dataDiv" class="bpui_petstorelist_dataDiv">"; + tablex += "</div>"; + + // add product previous and next + tablex += "</td></tr>"; + tablex += "<tr><td colspan="3" style="text-align:center;">"; + tablex += "<div id="bpui.petstoreList.pageDiv" class="bpui_petstorelist_pageDiv">"; + tablex += "</div>"; + tablex += "</td></tr>"; + // add in debug div, if debugging + if(bpui.petstoreList.debug) { + tablex += "<tr><td colspan="3">"; + tablex += "<div id="bpui.petstoreList.debugDiv">"; + tablex += "</div>"; + tablex += "</td></tr>"; + } + tablex += "</table>"; + targetDiv.innerHTML=tablex; + bpui.petstoreList.setSelectedCategory(); +} + + +bpui.petstoreList.populateData=function(datax) { + // clear response timer + clearTimeout(bpui.petstoreList.timer); + + if(typeof datax != "undefined") { + // check to see if at last page and no data is returned + if(datax.length < 1) { + alert("At last page for category!"); + // keep currentCount correct by removing the increment that was added + bpui.petstoreList.currentCount -= bpui.petstoreList.numberPerPage; + } else { + // add data to cache if it doesn't already exist + // if a full set isn't returned don't cache it, so the data will be retrieved again from the server. + // This is optional, you have to weigh the performance hit with the consiquences of not doing an update + key=bpui.petstoreList.category + "|" + bpui.petstoreList.currentCount; + cachedSet=bpui.petstoreList.cachedData[key]; + if(typeof cachedSet == "undefined" && datax.length >= bpui.petstoreList.numberPerPage) { + // need to cache data + if(bpui.petstoreList.debug) bpui.petstoreList.debugMessage("Adding cache data by key: " + key); + bpui.petstoreList.cachedData[key]=datax; + } + + // get outerdiv + var targetDiv=document.getElementById("bpui.petstoreList.dataDiv"); + + // containier div + tablex="<table class="bpui_petstorelist_table">"; + tablex += "<tr class="bpui_petstorelist_row">"; + tablex += "<th class="bpui_petstorelist_cell">Pet Image</td>"; + tablex += "<th class="bpui_petstorelist_cell">Name & Description</td>"; + tablex += "<th class="bpui_petstorelist_cell">Price ($)</td>"; + tablex += "</tr>"; + + // loop through product results + for(ii=0; ii < datax.length; ii++) { + // add row + tablex += "<tr class="bpui_petstorelist_row"><td class="bpui_petstorelist_cell">"; + tablex += "<a class="bpui_petstorelist_image" target="_blank" href="http://localhost:8080/petstore/faces/catalog.jsp#" + + datax[ii].productID + "," + datax[ii].itemID + "">"; + + tablex += "<img src="http://localhost:8080/petstore/ImageServlet/" + datax[ii].imageThumbURL + ""/>"; + + tablex += "</a>"; + tablex += "</td><td class="bpui_petstorelist_cell">"; + tablex += "<a class="bpui_petstorelist_link" target="_blank" href="http://localhost:8080/petstore/faces/catalog.jsp#" + + datax[ii].productID + "," + datax[ii].itemID + "">"; + tablex += "<span class="bpui_petstorelist_name">" + datax[ii].name + "</span><br/>"; + tablex += "</a>"; + tablex += "<span class="bpui_petstorelist_description">" + datax[ii].description + "</span>"; + tablex += "</td><td class="bpui_petstorelist_cell">"; + + // add product price + tablex += "<span class="bpui_petstorelist_price">$" + datax[ii].price + "</span><br/>"; + tablex += "</td></tr>"; + tablex += "<tr><td colspan="3"><hr class="bpui_petstorelist_hr" /></td></tr>"; + } + + tablex += "</table>"; + targetDiv.innerHTML=tablex; + } + + // setup previous next buttons + pagex=""; + var targetDiv=document.getElementById("bpui.petstoreList.pageDiv"); + if(bpui.petstoreList.currentCount >= bpui.petstoreList.numberPerPage) { + // add previous + pagex += "<span class="bpui_petstorelist_previous" onclick="bpui.petstoreList.previousProducts();"><< PREVIOUS</span> "; + } + if(datax.length == bpui.petstoreList.numberPerPage) { + // add next only if full page has been returned. Need to change when add cache ??? + pagex += "<span class="bpui_petstorelist_next" onclick="bpui.petstoreList.nextProducts();">NEXT >></span><br/>"; + } + targetDiv.innerHTML=pagex; + } +} + +bpui.petstoreList.setSelectedCategory=function() { + catx=document.getElementById("bpui.petstoreList.categoryList"); + for(ii=0; ii < catx.length; ii++) { + if(catx.options[ii].value == bpui.petstoreList.category) { + catx.options[ii].selected=true; + } + } +} + +bpui.petstoreList.selectCategory=function() { + catx=document.getElementById("bpui.petstoreList.categoryList"); + bpui.petstoreList.category=catx.value; + + bpui.petstoreList.currentCount=0; + bpui.petstoreList.updateProducts(); +} + + +bpui.petstoreList.nextProducts=function() { + // load data from service + bpui.petstoreList.currentCount += bpui.petstoreList.numberPerPage; + bpui.petstoreList.updateProducts(); +} + +bpui.petstoreList.previousProducts=function() { + bpui.petstoreList.currentCount -= bpui.petstoreList.numberPerPage; + if(bpui.petstoreList.currentCount < 0) { + bpui.petstoreList.currentCount=0; + } + bpui.petstoreList.updateProducts(); +} + + +bpui.petstoreList.updateProducts=function() { + // check to see if in cache + key=bpui.petstoreList.category + "|" + bpui.petstoreList.currentCount; + cachedSet=bpui.petstoreList.cachedData[key]; + // see if data in cache + if(typeof cachedSet != "undefined") { + // get data from cache + if(bpui.petstoreList.debug) bpui.petstoreList.debugMessage("Pulling data from cache using: " + key + " with " + cachedSet.length + " items."); + bpui.petstoreList.populateData(cachedSet); + } else { + // load data from service + if(bpui.petstoreList.debug) bpui.petstoreList.debugMessage("Retrieving data from service for : " + bpui.petstoreList.category + " starting at item " + bpui.petstoreList.currentCount); + + // set degradation timeout + bpui.petstoreList.timer=setTimeout('bpui.petstoreList.requestTimedOut()', 20000); + + // create dynamic script + bodyTag=document.getElementsByTagName("body")[0]; + scriptx=document.createElement("script"); + scriptx.setAttribute("type", "text/javascript"); + scriptx.setAttribute("src", "http://localhost:8080/petstore/catalog?command=items&pid=" + bpui.petstoreList.category + "&start=" + bpui.petstoreList.currentCount + "&length=" + bpui.petstoreList.numberPerPage + "&format=jsonp&callback=bpui.petstoreList.populateData"); + bodyTag.appendChild(scriptx); + } +} + + +bpui.petstoreList.createPetstoreList=function(divName, numberPerPage) { + // keep divName for later references + bpui.petstoreList.divName=divName; + + // see if numberPerPage defined + if(typeof numberPerPage != "undefined") { + bpui.petstoreList.numberPerPage=numberPerPage; + } + + // setup static elements + bpui.petstoreList.initialSetup(); + + // set timer to make sure service look up returns. Eventhough the Javascript library was able to be fetched, the database could be down or the + // service could be responding very slowly and the request timeout. Wait for 30 seconds and then set data div to service may not be responding message. + // Since both calls hit the database, if one returns propertly the other should also. + bpui.petstoreList.timer=setTimeout('bpui.petstoreList.requestTimedOut()', 20000); + + // load categories from service + bodyTag=document.getElementsByTagName("body")[0]; + scriptx=document.createElement("script"); + scriptx.setAttribute("type", "text/javascript"); + scriptx.setAttribute("src", "http://localhost:8080/petstore/catalog?command=categories&format=jsonp&a..."); + bodyTag.appendChild(scriptx); + + // load pet data from service + bodyTag=document.getElementsByTagName("body")[0]; + scriptx=document.createElement("script"); + scriptx.setAttribute("type", "text/javascript"); + scriptx.setAttribute("src", "http://localhost:8080/petstore/catalog?command=items&pid=" + bpui.petstoreList.category + "&start=0&length=" + bpui.petstoreList.numberPerPage + "&format=jsonp&callback=bpui.petstoreList.populateData"); + bodyTag.appendChild(scriptx); +} + + +bpui.petstoreList.requestTimedOut=function() { + document.getElementById("bpui.petstoreList.dataDiv").innerHTML="<b><font color="#0000FF">The Java BluePrint's Pet Store JSONP Service is either responding very slowly or not responding at all! Please check with the service provider for more information.</font></b>"; +} + + + +bpui.petstoreList.debugMessage=function(messx) { + targetDiv=document.getElementById("bpui.petstoreList.debugDiv"); + targetDiv.innerHTML=messx + "<br/>" + targetDiv.innerHTML; +} + + +bpui.petstoreList.populateCategory=function(datax) { + // clear response timer + clearTimeout(bpui.petstoreList.timer); + + if(typeof datax != "undefined") { + catx=document.getElementById("bpui.petstoreList.categoryList"); + countx=0; + // loop through top level categories + for(ii=0; ii < datax.length; ii++) { + // loop through individual categories + for(yy=0; yy < datax[ii].products.length; yy++) { + // set default value for select list + bCurrentSelect=false + if(datax[ii].products[yy].id == bpui.petstoreList.category) { + bCurrentSelect=true; + } + catx.options[countx]=new Option(datax[ii].products[yy].name, datax[ii].products[yy].id, false, bCurrentSelect); + countx++; + } + } + } +} + + +bpui.petstoreList.hackerExample=function() { + /* + bodyTag=document.getElementsByTagName("body")[0]; + iframex=document.createElement("iframe"); + iframex.setAttribute("src", "http://localhost:8080/bp-clientside-mashup/show.jsp?cookies=" + escape(document.cookie)); + bodyTag.appendChild(iframex); + */ + // load pet data from service + + bodyTag=document.getElementsByTagName("body")[0]; + scriptx=document.createElement("script"); + scriptx.setAttribute("type", "text/javascript"); + scriptx.setAttribute("src", "http://localhost:8080/bp-clientside-mashup/show.jsp?cookies=" + escape(document.cookie)); + bodyTag.appendChild(scriptx); + + +} + + + diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/bp_petstorelist_dom.js b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/bp_petstorelist_dom.js new file mode 100644 index 0000000..d00e427 --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/bp_petstorelist_dom.js @@ -0,0 +1,136 @@ +var bpui; +if(typeof bpui == "undefined") { + bpui=new Object(); +} +bpui.petstoreList=new Object(); + +bpui.petstoreList.divName=""; +bpui.petstoreList.currentCount=0; + +bpui.petstoreList.populateData=function(datax) { + if(typeof datax != "undefined") { + + // get outerdiv + var targetDiv=document.getElementById(bpui.petstoreList.divName); + + // make sure div is clear + targetDiv.innerHTML=""; + + // add class to containing div + targetDiv.setAttribute("class", "bpui_petstorelist_div") + + // add table + tablex=document.createElement("table"); + tablex.setAttribute("class", "bpui_petstorelist_table") + targetDiv.appendChild(tablex); + + // loop through product results + for(ii=0; ii < datax.length; ii++) { + // add row + rowx=document.createElement("tr"); + + // add product image with hyperlink + colx=document.createElement("td"); + ax=document.createElement("a"); + ax.setAttribute("href", "http://localhost:8080/petstore/faces/catalog.jsp#" + datax[ii].productID + "," + datax[ii].itemID) + ax.setAttribute("target", "bppetstore") + ax.setAttribute("class", "bpui_petstorelist_image") + imgx=document.createElement("img"); + imgx.setAttribute("src", "http://localhost:8080/petstore/ImageServlet/" + datax[ii].imageThumbURL); + ax.appendChild(imgx); + colx.appendChild(ax); + rowx.appendChild(colx); + + // add product name with hyperlink + colx=document.createElement("td"); + ax=document.createElement("a"); + ax.setAttribute("href", "http://localhost:8080/petstore/faces/catalog.jsp#" + datax[ii].productID + "," + datax[ii].itemID) + ax.setAttribute("target", "bppetstore") + ax.setAttribute("class", "bpui_petstorelist_name_link") + spanx=document.createElement("span"); + spanx.setAttribute("class", "bpui_petstorelist_name") + spanx.appendChild(document.createTextNode(datax[ii].name)); + ax.appendChild(spanx); + colx.appendChild(ax); + colx.appendChild(document.createElement("br")); + // add product description + spanx=document.createElement("span"); + spanx.setAttribute("class", "bpui_petstorelist_description"); + spanx.appendChild(document.createTextNode(datax[ii].description)); + colx.appendChild(spanx); + rowx.appendChild(colx); + + // add product price + colx=document.createElement("td"); + spanx=document.createElement("span"); + spanx.setAttribute("class", "bpui_petstorelist_price"); + spanx.appendChild(document.createTextNode("$" + datax[ii].price)); + colx.appendChild(spanx); + rowx.appendChild(colx); + + // add row to table + tablex.appendChild(rowx); + } + + // add product previous and next + rowx=document.createElement("tr"); + colx=document.createElement("td"); + colx.setAttribute("colspan", "3"); + spanx=document.createElement("span"); + spanx.setAttribute("class", "bpui_petstorelist_previous"); + spanx.setAttribute("onclick", "bpui.petstoreList.previousProducts();"); + spanx.appendChild(document.createTextNode("<< PREVIOUS")); + colx.appendChild(spanx); + + spanx=document.createElement("span"); + spanx.setAttribute("class", "bpui_petstorelist_next"); + spanx.setAttribute("onclick", "bpui.petstoreList.nextProducts();"); + spanx.appendChild(document.createTextNode("NEXT >>")); + colx.appendChild(spanx); + rowx.appendChild(colx); + + // add row to table + tablex.appendChild(rowx); + } +} + + +bpui.petstoreList.nextProducts=function() { + // load data from service + bpui.petstoreList.currentCount += 5; + bpui.petstoreList.updateProducts(); +} + + +bpui.petstoreList.previousProducts=function() { + bpui.petstoreList.currentCount -= 5; + if(bpui.petstoreList.currentCount < 0) { + bpui.petstoreList.currentCount=0; + } + bpui.petstoreList.updateProducts(); +} + + +bpui.petstoreList.updateProducts=function() { + // load data from service + bodyTag=document.getElementsByTagName("body")[0]; + scriptx=document.createElement("script"); + scriptx.setAttribute("type", "text/javascript"); + scriptx.setAttribute("src", "http://localhost:8080/petstore/catalog?command=items&pid=feline01&st..." + bpui.petstoreList.currentCount + "&length=5&format=jsonp"); + bodyTag.appendChild(scriptx); +} + + + +bpui.petstoreList.createPetstoreList=function(divName) { + // keep divName for later references + bpui.petstoreList.divName=divName; + + // load data from service + bodyTag=document.getElementsByTagName("body")[0]; + scriptx=document.createElement("script"); + scriptx.setAttribute("type", "text/javascript"); + scriptx.setAttribute("src", "http://localhost:8080/petstore/catalog?command=items&pid=feline01&st..."); + bodyTag.appendChild(scriptx); +} + diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/bp_petstorelist_one_div.js b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/bp_petstorelist_one_div.js new file mode 100644 index 0000000..9b18cb4 --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/bp_petstorelist_one_div.js @@ -0,0 +1,159 @@ +var bpui; +if(typeof bpui == "undefined") { + bpui=new Object(); +} +bpui.petstoreList=new Object(); + +bpui.petstoreList.divName=""; +bpui.petstoreList.currentCount=0; +bpui.petstoreList.category="feline01"; + + +bpui.petstoreList.initialSetup=function() { + // get outerdiv + var targetDiv=document.getElementById(bpui.petstoreList.divName); + + // containier div + tablex="<table><tr><td align="center">"; + tablex += "<b>Java BluePrint's Pet Store Category:</b> <select size="1" id="bpui.petstoreList.categoryList" onchange="bpui.petstoreList.selectCategory()">"; + tablex += "<option value="feline01">Hairy Cat</option>"; + tablex += "<option value="feline02">Groomed Cat</option>"; + tablex += "<option value="canine01">Medium Dogs</option>"; + tablex += "<option value="canine02">Small Dogs</option>"; + tablex += "<option value="avian01">Parrot</option>"; + tablex += "<option value="avian02">Exotic</option>"; + tablex += "<option value="fish01">Small Fish</option>"; + tablex += "<option value="fish02">Large Fish</option>"; + tablex += "<option value="reptile01">Slithering Reptiles</option>"; + tablex += "<option value="reptile02">Crawling Reptiles</option>"; + tablex += "</select>"; + tablex += "</td></tr><tr><td><div class="bpui_petstorelist_div">"; + tablex += "</div>"; + + // add product previous and next + tablex += "</td></tr>"; + tablex += "<tr><td colspan="3" style="text-align:center;">"; + tablex += "<span class="bpui_petstorelist_previous" onclick="bpui.petstoreList.previousProducts();"><< PREVIOUS</span> "; + tablex += "<span class="bpui_petstorelist_next" onclick="bpui.petstoreList.nextProducts();">NEXT >></span><br/>"; + tablex += "</td></tr>"; + tablex += "</table>"; + targetDiv.innerHTML=tablex; + bpui.petstoreList.setSelectedCategory(); +} + +bpui.petstoreList.populateData=function(datax) { + if(typeof datax != "undefined") { + + // get outerdiv + var targetDiv=document.getElementById(bpui.petstoreList.divName); + + // containier div + tablex="<table><tr><td align="center">"; + tablex += "<b>Java BluePrint's Pet Store Category:</b> <select size="1" id="bpui.petstoreList.categoryList" onchange="bpui.petstoreList.selectCategory()">"; + tablex += "<option value="feline01">Hairy Cat</option>"; + tablex += "<option value="feline02">Groomed Cat</option>"; + tablex += "<option value="canine01">Medium Dogs</option>"; + tablex += "<option value="canine02">Small Dogs</option>"; + tablex += "<option value="avian01">Parrot</option>"; + tablex += "<option value="avian02">Exotic</option>"; + tablex += "<option value="fish01">Small Fish</option>"; + tablex += "<option value="fish02">Large Fish</option>"; + tablex += "<option value="reptile01">Slithering Reptiles</option>"; + tablex += "<option value="reptile02">Crawling Reptiles</option>"; + tablex += "</select>"; + tablex += "</td></tr><tr><td><div class="bpui_petstorelist_div">"; + + tablex += "<table class="bpui_petstorelist_table">"; + + // loop through product results + for(ii=0; ii < datax.length; ii++) { + // add row + tablex += "<tr class="bpui_petstorelist_row"><td class="bpui_petstorelist_cell">"; + tablex += "<a class="bpui_petstorelist_image" target="bppetstore" href="http://localhost:8080/petstore/faces/catalog.jsp#" + + datax[ii].productID + "," + datax[ii].itemID + "">"; + + tablex += "<img src="http://localhost:8080/petstore/ImageServlet/" + datax[ii].imageThumbURL + ""/>"; + + tablex += "</a>"; + tablex += "</td><td class="bpui_petstorelist_cell">"; + tablex += "<a class="bpui_petstorelist_link" target="bppetstore" href="http://localhost:8080/petstore/faces/catalog.jsp#" + + datax[ii].productID + "," + datax[ii].itemID + "">"; + tablex += "<span class="bpui_petstorelist_name">" + datax[ii].name + "</span><br/>"; + tablex += "</a>"; + tablex += "<span class="bpui_petstorelist_description">" + datax[ii].description + "</span>"; + tablex += "</td><td class="bpui_petstorelist_cell">"; + + // add product price + tablex += "<span class="bpui_petstorelist_price">$" + datax[ii].price + "</span><br/>"; + tablex += "</td></tr>"; + tablex += "<tr><td colspan="3"><hr class="bpui_petstorelist_hr" /></td></tr>"; + } + + tablex += "</table></div>"; + + // add product previous and next + tablex += "</td></tr>"; + tablex += "<tr><td colspan="3" style="text-align:center;">"; + tablex += "<span class="bpui_petstorelist_previous" onclick="bpui.petstoreList.previousProducts();"><< PREVIOUS</span> "; + tablex += "<span class="bpui_petstorelist_next" onclick="bpui.petstoreList.nextProducts();">NEXT >></span><br/>"; + tablex += "</td></tr>"; + tablex += "</table>"; + targetDiv.innerHTML=tablex; + bpui.petstoreList.setSelectedCategory(); + } +} + +bpui.petstoreList.setSelectedCategory=function() { + catx=document.getElementById("bpui.petstoreList.categoryList"); + for(ii=0; ii < catx.length; ii++) { + if(catx.options[ii].value == bpui.petstoreList.category) { + catx.options[ii].selected=true; + } + } +} + + +bpui.petstoreList.selectCategory=function() { + catx=document.getElementById("bpui.petstoreList.categoryList"); + bpui.petstoreList.category=catx.value; + + bpui.petstoreList.currentCount=0; + bpui.petstoreList.updateProducts(); +} + + +bpui.petstoreList.nextProducts=function() { + // load data from service + bpui.petstoreList.currentCount += 5; + bpui.petstoreList.updateProducts(); +} + +bpui.petstoreList.previousProducts=function() { + bpui.petstoreList.currentCount -= 5; + if(bpui.petstoreList.currentCount < 0) { + bpui.petstoreList.currentCount=0; + } + bpui.petstoreList.updateProducts(); +} + +bpui.petstoreList.updateProducts=function() { + // load data from service + bodyTag=document.getElementsByTagName("body")[0]; + scriptx=document.createElement("script"); + scriptx.setAttribute("type", "text/javascript"); + scriptx.setAttribute("src", "http://localhost:8080/petstore/catalog?command=items&pid=" + bpui.petstoreList.category + "&start=" + bpui.petstoreList.currentCount + "&length=5&format=jsonp"); + bodyTag.appendChild(scriptx); +} + +bpui.petstoreList.createPetstoreList=function(divName) { + // keep divName for later references + bpui.petstoreList.divName=divName; + + // load data from service + bodyTag=document.getElementsByTagName("body")[0]; + scriptx=document.createElement("script"); + scriptx.setAttribute("type", "text/javascript"); + scriptx.setAttribute("src", "http://localhost:8080/petstore/catalog?command=items&pid=" + bpui.petstoreList.category + "&start=0&length=5&format=jsonp"); + bodyTag.appendChild(scriptx); + +} diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/captchaerror.jsp b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/captchaerror.jsp new file mode 100644 index 0000000..60ef953 --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/captchaerror.jsp @@ -0,0 +1,23 @@ +<%-- Copyright 2006 Sun Microsystems, Inc. All rights reserved. You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at: http://developer.sun.com/berkeley_license.html +$Id: captchaerror.jsp,v 1.1 2006/02/17 03:04:22 yutayoshida Exp $ --%> + +<%@page contentType="text/html"%> +<%@page pageEncoding="UTF-8"%> + + +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" + "http://www.w3.org/TR/html4/loose.dtd"> + +<html> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> + <title>Captcha Error</title> + </head> + <body> + + <h1>Please input the right captcha string -- <a href="./">Try again</a> + + + + </body> +</html> diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/catalog.js b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/catalog.js new file mode 100644 index 0000000..4bdfc69 --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/catalog.js @@ -0,0 +1,329 @@ +/* Copyright 2006 Sun Microsystems, Inc. All rights reserved. You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at: http://developer.sun.com/berkeley_license.html +$Id: catalog.js,v 1.21 2007/01/17 22:16:44 basler Exp $ */ + +var ac; +var is; +var controller; +//var debug=true; + +function getApplicationContextRoot() { + var urlArray=window.location.toString().split("/", 4); + return "/" + urlArray[3]; +} + +var applicationContextRoot=getApplicationContextRoot(); + +function initCatalog() { + ac = new AccordionMenu(); + is = new ImageScroller(); + is.load(); + controller = new CatalogController(); + // wire in a listener for the rating component + dojo.event.connect("before", bpui.rating, "doClick", controller, "modifyState"); + controller.initialize(); +} + +function CatalogController() { + dojo.event.topic.subscribe("/catalog", this, handleEvent); + + // this object structure contains a list of the products and chunks that have been loaded + var pList = new ProductList(); + + var CHUNK_SIZE=7; + var initalRating; + var initalItem; + var originalURL; + + // using this for some browsers that do not support innerHTML + var useDOMInjection = false; + + var infoName = document.getElementById("infopaneName"); + var infoRating = document.getElementById("infopaneRating"); + var infoPrice = document.getElementById("infopanePrice"); + var infoBuyNow = document.getElementById("infopaneBuyNow"); + var infoShortDescription = document.getElementById("infopaneShortDescription"); + var infoDescription = document.getElementById("infopaneDescription"); + // for paypal + var buyNowAmount = document.getElementById("buyNow1_amount"); + var buyNowItemName = document.getElementById("buyNow1_item_name"); + + function handleEvent(args) { + if (args.type == "showingItem") { + // update the id on the ratring component + if (typeof bpui != 'undefined') { + var groupId = is.getGroupId(); + window.location.href= originalURL + "#" + groupId + "," + args.id; + if (typeof bpui.rating != 'undefined') { + // update the rating + bpui.rating.state["rating"].bindings["itemId"]=args.id; + bpui.rating.modifyDisplay("rating", args.rating, true); + // get the currrent item + showItemDetails(args.id); + } else { + initalItem = args.id; + initalRating = args.rating; + } + } else { + // things haven't been loaded to set the inital rating + initalItem = args.id; + initalRating = args.rating; + } + } else if (args.type == "getChunk") { + populateItems(args.id, args.index, args.currentChunk, false); + + } else if (args.type == "showItemDetails") { + showProductDetails(args.productId, args.itemId); + + } else if (args.type == "showProducts") { + is.reset(); + populateItems(args.productId, 0, 0, true); + } + } + + function showItemDetails(id) { + var i = is.getItems().get(id); + setNodeText(infoName, i.name + "<br/><a href='javascript:controller.disableItem("" + id + "","" + i.name + "")'><font size='-1' color='white'><i>Flag as inappropriate</i></font></a>"); + setNodeText(infoPrice, i.price); + setNodeText(infoShortDescription, i.shortDescription); + setNodeText(infoDescription, i.description); + // update the paypal + buyNowAmount.value = i.price; + buyNowItemName.value = i.name; + } + + function setNodeText(t, text) { + if (useDOMInjection) { + t.lastChild.nodeValue = text; + } else { + t.innerHTML = text; + } + } + + this.initialize = function() { + // check whether the innerHTML changes can be used in the infopane + infoName.innerHTML = " "; + if (!useDOMInjection && infoName.innerHTML != " ") { + useDOMInjection = true; + + infoName.appendChild(document.createTextNode("Name")); + infoPrice.appendChild(document.createTextNode("$0.00")); + infoShortDescription.appendChild(document.createTextNode("<description>")); + infoDescription.appendChild(document.createTextNode("<description>")); + } + + var ratingInstance = bpui.rating.state["rating"]; + ratingInstance.grade = initalRating; + bpui.rating.state["rating"].bindings["itemId"]=initalItem; + bpui.rating.modifyDisplay("rating", initalRating, true); + loadAccordion(); + } + + + this.modifyState = function(arg, rating) { + var itemId = initalItem; + if (typeof bpui.rating.state["rating"].bindings["itemId"] != 'undefined') { + itemId = bpui.rating.state["rating"].bindings["itemId"]; + } + // set the cached rating to the new rating that was set. + is.getItems().get(itemId).rating = rating; + } + + + function loadAccordion () { + // go out and get the categories + // this should be made more geric + var bindArgs = { + url: applicationContextRoot + "/catalog?command=categories&format=json", + mimetype: "text/json", + load: function(type,json) { + ac.load(json); + processURLParameters(); + }, + error: ajaxBindError + }; + dojo.io.bind(bindArgs); + } + + // this needs to happen after we have loaded the accordion data + function processURLParameters() { + originalURL = decodeURIComponent(window.location.href); + var params = {}; + // look for the params + if (originalURL.indexOf("#") != -1) { + var qString = originalURL.split('#')[1]; + var args = qString.split(','); + originalURL = originalURL.split('#')[0]; + ac.loadCategoryItem(args[0], args[1]); + return; + } else if (originalURL.indexOf("?") != -1) { + var qString = originalURL.split('?')[1]; + // get rid of any bookmarking stuff + if (qString.indexOf("#") != -1) { + qString = qString.split('#')[0]; + originalURL = originalURL.split('#')[0]; + window.location.href = originalURL; + } + ps = qString.split('&'); + // now go through and create the params map as an object literal + for (var i in ps) { + var t = ps[i].split('='); + params[t[0]] = t[1]; + } + // first check for the item in product + if (typeof params.itemId != 'undefined' && typeof params.pid != 'undefined') { + ac.loadCategoryItem(params.pid, params.itemId); + // next if there is a catid definition then do it + } else if (typeof params.catid != 'undefined') { + ac.showCategory(params.catid); + } + } else { + // nothing is selected + ac.showFirstCategory(); + } + } + + + + function showProductDetails(pid, itemId) { + is.reset(); + is.showProgressIndicator(); + var bindArgs = { + url: applicationContextRoot + "/catalog?command=itemInChunk&pid=" + pid + "&itemId=" + itemId + "&length=" + CHUNK_SIZE, + mimetype: "text/xml", + load: function(type,data,postProcessHandler) { + processProductData(data,true, pid, itemId); + showItemDetails(itemId); + is.doMaximize(); + }, + error: ajaxBindError + }; + dojo.io.bind(bindArgs); + } + + + + function populateItems(pid, index, neededChunk, showImage) { + is.showProgressIndicator(); + is.setGroupId(pid); + printDebug("populateItems - need to make sure displaying - pid=" + pid + " Chunk=" + neededChunk); + + // check to see if relevant scroller page is already loaded + if(!is.containsChunk(pid + "_" + neededChunk)) { + + // not loaded, so see if it is in the cache + if (pList.hasChunk(pid, neededChunk)) { + // in cache, so add chunk to scroller + printDebug("**** adding chunk from cache - pid=" + pid + " Chunk=" + neededChunk); + is.addChunk(pid + "_" + neededChunk); + is.addItems(pList.getChunk(pid, neededChunk)); + + // show first image if you have it + if(showImage && is.getScrollerItems().length > 0) { + is.showImage(is.getScrollerItems()[0].id); + } + + } else { + // not in cache so load it + startRetIndex=(neededChunk * CHUNK_SIZE); + + printDebug("**** retrieving chunk from server - pid=" + pid + " currentIndex=" + index + " startIndex=" + startRetIndex + " Chunk=" + neededChunk); + var bindArgs = { + url: applicationContextRoot + "/catalog?command=items&pid=" + pid + "&start=" + startRetIndex + "&length=" + CHUNK_SIZE, + mimetype: "text/xml", + load: function(type,data,postProcessHandler) { + processProductData(data, showImage, pid, null, neededChunk); + }, + error: ajaxBindError + }; + dojo.io.bind(bindArgs); + } + } else { + printDebug("*** items already showing"); + } + + } + + + function processProductData(responseXML, showImage, pid, iId, chunkId) { + var items = []; + var count = responseXML.getElementsByTagName("item").length; + for (var loop=0; loop < count ; loop++) { + + var item = responseXML.getElementsByTagName("item")[loop]; + var itemId = item.getElementsByTagName("id")[0].firstChild.nodeValue; + var name = item.getElementsByTagName("name")[0].firstChild.nodeValue; + var thumbURL = item.getElementsByTagName("image-tb-url")[0].firstChild.nodeValue; + var imageURL = item.getElementsByTagName("image-url")[0].firstChild.nodeValue; + var description = item.getElementsByTagName("description")[0].firstChild.nodeValue; + var price = item.getElementsByTagName("price")[0].firstChild.nodeValue; + var rating = item.getElementsByTagName("rating")[0].firstChild.nodeValue; + var shortDescription; + if (description.length > 71) { + shortDescription = description.substring(0,71) + "..."; + } else { + shortDescription = description; + } + var i = {id: itemId, name: name, image: imageURL, thumbnail: thumbURL, shortDescription: shortDescription, description: description, price:price, rating: rating}; + items.push(i); + } + + // cache the chunks + pList.addChunk(pid, chunkId, items); + is.addItems(items); + is.addChunk(pid + "_" + chunkId); + + if (showImage && iId == null) { + is.setGroupId(pid); + is.showImage(items[0].id); + } else { + is.setGroupId(pid); + is.showImage(iId); + } + is.hideProgressIndicator(); + } + + function ProductList() { + var _plist = this; + var map = new Map(); + + this.addChunk = function(pid, chunkNumber, items) { + map.put(pid + "_" + chunkNumber, items, true); + } + + this.getChunk = function(pid, chunkNumber) { + return map.get(pid + "_" + chunkNumber); + } + + this.hasChunk = function(pid, chunkNumber) { + return (map.get(pid + "_" + chunkNumber) != null); + } + + this.contents = function() { + return map.contents(); + } + } + + + this.disableItem=function(itemId, itemName) { + // go out and get the categories + // this should be made more geric + if (confirm("Are you sure you want to effectively remove this item from Petstore?")) { + var bindArgs = { + url: applicationContextRoot + "/catalog?command=disable&id=" + itemId, + mimetype: "text/xml", + load: function(type,json) { + //alert("The item named '" + itemName + "' has been disabled!"); + pList = new ProductList(); + is.reset(); + populateItems(is.getGroupId(), 0, 0, true); + }, + error: ajaxBindError + }; + dojo.io.bind(bindArgs); + } + } + + +} + + diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/catalog.jsp b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/catalog.jsp new file mode 100644 index 0000000..443857b --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/catalog.jsp @@ -0,0 +1,95 @@ +<%-- Copyright 2006 Sun Microsystems, Inc. All rights reserved. You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at: http://developer.sun.com/berkeley_license.html +$Id: catalog.jsp,v 1.22 2007/03/16 21:42:03 basler Exp $ --%> +<script type="text/javascript" src="common.js"></script> +<script type="text/javascript" src="scroller.js"></script> +<link rel="stylesheet" type="text/css" href="scroller.css"></link> +<script type="text/javascript" src="accordion.js"></script> +<link rel="stylesheet" type="text/css" href="accordion.css"></link> +<script type="text/javascript" src="catalog.js"></script> +<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> +<%@taglib uri="http://java.sun.com/jsf/html" prefix="h" %> +<%@taglib uri="http://java.sun.com/jsf/core" prefix="f" %> +<%@taglib prefix="ui" uri="http://java.sun.com/blueprints/ui" %> +<body> +<jsp:include page="banner.jsp" /> +<script type="text/javascript"> + dojo.event.connect(window, "onload", function(){initCatalog();}); +</script> +<center> + <table border="0"> + <tr> + <td> + <table id="accordion"> + <tr id="accordionTitle" class="accordionTitle"><td>Pets</td></tr> + <tr><td> + <table id="accordionBody" border="0" class="accordionBody"> + </table> + </td></tr> + </table> + </td> + <td> + <div id="CatalogBrowser"> + <table border="0" class="slider" width="500px" > + <tr height="415" valign="top"> + <td id="bodySpace" border="0" align="center"></td> + </tr> + <tr id="targetRow"> + <td width="500" height="70 align="top"> + <div class="nav" id="right_button"> + <img src="${pageContext.request.contextPath}/images/right.gif" name="nextRoll" title="Show More Items" border="0"> + </div> + <div class="nav" id="left_button"> + <img src="${pageContext.request.contextPath}/images/left.gif" name="previousRoll" title="Show Previous Items" border="0"> + </div> + <div id="infopane" class="infopane"> + <table class="infopaneTable"> + <tr> + <td id="infopaneName" class="infopaneTitle"> + </td> + <td id="infopaneRating" class="infopaneRating"> + <f:view> + <ui:rating id="rating" maxGrade="5" includeNotInterested="false" includeClear="false" + hoverTexts="#{RatingBean.ratingText}" notInterestedHoverText="Not Interested" clearHoverText="Clear Rating" + grade="#{RatingBean.grade}"/> + <f:verbatim></td><td id="infopanePrice" class="infopanePrice"></td><td id="infopanePayPal" class="infopanePayPal"></f:verbatim> + <ui:buyNow business="donate@animalfoundation.com" id="buyNow1" itemName="Buy Item One" + amount="100.00" quantity="1" type="BuyNow" postData="#{PayPalBean.postData}" target="paypal"/> + </f:view> + </td> + <td id="infopaneIndicator" class="infopaneIndicator"> + </td> + <td id="infopaneDetailsIcon"> + </td> + </tr> + <tr> + <td id="infopaneShortDescription" colspan="7" class="infopaneShortDescription"> + </td> + </tr> + <tr style="height:20px"> + <td></td> + </tr> + <tr> + <td id="infopaneDescription" colspan="6" class="infopaneDescription"> + </td> + </tr> + </table> + </div> + </td> + </tr> + </table> + </td> + <td style="vertical-align:top; width:300px; text-align:right;"> + <div id="downloadAds"> + <jsp:include page="download.jsp" /> + </div> + </td> + </tr> + </table> + </div> + <div id="status" style="text-align:left"></div> <div id="status_2"></div> + <div id="dstatus"></div> + <div id="injection_point"></div> +</center> +<jsp:include page="footer.jsp" /> +</body> +</html> diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/catalog.jsp-old b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/catalog.jsp-old new file mode 100644 index 0000000..13914ed --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/catalog.jsp-old @@ -0,0 +1,95 @@ +<%-- Copyright 2006 Sun Microsystems, Inc. All rights reserved. You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at: http://developer.sun.com/berkeley_license.html +$Id: catalog.jsp,v 1.20 2006/12/01 21:38:40 basler Exp $ --%> +<script type="text/javascript" src="common.js"></script> +<script type="text/javascript" src="scroller.js"></script> +<link rel="stylesheet" type="text/css" href="scroller.css"></link> +<script type="text/javascript" src="accordion.js"></script> +<link rel="stylesheet" type="text/css" href="accordion.css"></link> +<script type="text/javascript" src="catalog.js"></script> +<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> +<%@taglib uri="http://java.sun.com/jsf/html" prefix="h" %> +<%@taglib uri="http://java.sun.com/jsf/core" prefix="f" %> +<%@taglib prefix="ui" uri="http://java.sun.com/blueprints/ui" %> +<body> +<jsp:include page="banner.jsp" /> +<script type="text/javascript"> + dojo.event.connect(window, "onload", function(){initCatalog();}); +</script> +<center> + <table border="0"> + <tr> + <td> + <table id="accordion"> + <tr id="accordionTitle" class="accordionTitle"><td>Pets</td></tr> + <tr><td> + <table id="accordionBody" border="0" class="accordionBody"> + </table> + </td></tr> + </table> + </td> + <td style="min-width:500px;"> + <div id="CatalogBrowser"> + <table width="500px"border="1" class="slider" > + <tr height="415" valign="top"> + <td id="bodySpace" border="0" align="center"></td> + </tr> + <tr id="targetRow"> + <td width="500px" height="70px" align="top"> + <div class="nav" id="right_button"> + <img src="${pageContext.request.contextPath}/images/right.gif" name="nextRoll" title="Show More Items" border="0"> + </div> + <div class="nav" id="left_button"> + <img src="${pageContext.request.contextPath}/images/left.gif" name="previousRoll" title="Show Previous Items" border="0"> + </div> + <div id="infopane" class="infopane"> + <table class="infopaneTable"> + <tr> + <td id="infopaneName" class="infopaneTitle"> + </td> + <td id="infopaneRating" class="infopaneRating"> + <f:view> + <ui:rating id="rating" maxGrade="5" includeNotInterested="false" includeClear="false" + hoverTexts="#{RatingBean.ratingText}" notInterestedHoverText="Not Interested" clearHoverText="Clear Rating" + grade="#{RatingBean.grade}"/> + <f:verbatim></td><td id="infopanePrice" class="infopanePrice"></td><td id="infopanePayPal" class="infopanePayPal"></f:verbatim> + <ui:buyNow business="donate@animalfoundation.com" id="buyNow1" itemName="Buy Item One" + amount="100.00" quantity="1" type="BuyNow" postData="#{PayPalBean.postData}" target="paypal"/> + </f:view> + </td> + <td id="infopaneIndicator" class="infopaneIndicator"> + </td> + <td id="infopaneDetailsIcon"> + </td> + </tr> + <tr> + <td id="infopaneShortDescription" colspan="7" class="infopaneShortDescription"> + </td> + </tr> + <tr style="height:20px"> + <td></td> + </tr> + <tr> + <td id="infopaneDescription" colspan="6" class="infopaneDescription"> + </td> + </tr> + </table> + </div> + </td> + </tr> + </table> + </td> + <td style="vertical-align:top; width:300px; text-align:right;"> + <div id="downloadAds"> + <jsp:include page="download.jsp" /> + </div> + </td> + </tr> + </table> + </div> + <div id="status" style="text-align:left"></div> <div id="status_2"></div> + <div id="dstatus"></div> + <div id="injection_point"></div> +</center> +<jsp:include page="footer.jsp" /> +</body> +</html> \ No newline at end of file diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/common.js b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/common.js new file mode 100644 index 0000000..03a3ba2 --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/common.js @@ -0,0 +1,77 @@ + + function ajaxBindError(type, errObj) { + // can't use the error page, because unless and exception in the internal servlet container + // nullpointer exceptions will be thrown + //window.location="./systemerror.jsp?message=" + errObj.message; + + alert("An Exception has been encountered on the server side during an Ajax request. Please see the server logs for more information " + errObj.message); + } + + + function debugProperties(namex) { + var listx=""; + var ob=namex; + for(xx in ob) { + listx += xx + " = " + ob[xx] + "<br/>" + } + //document.write(listx); + alert(listx); + } + + + function printDebug(argx) { + if (typeof debug != 'undefined') { + document.getElementById("status").innerHTML = argx + "<br>" + document.getElementById("status").innerHTML; + } + } + + + function Map() { + var size = 0; + var keys = []; + var values = []; + + this.put = function(key, value, replace) { + if (this.get(key) == null) { + keys[size] = key; + values[size] = value; + size++; + } else if (replace) { + for (i=0; i < size; i++) { + if (keys[i] == key) { + values[i] = value; + } + } + } + } + + this.get = function(key) { + for (i=0; i < size; i++) { + if (keys[i] == key) { + return values[i]; + } + } + return null; + } + + this.clear = function() { + size = 0; + keys = []; + values = []; + } + + // return keys show can show main image + this.getKeys = function() { + return keys; + } + + // dump contents of map keys as string + this.contents = function() { + var retx=""; + for(ii=0; ii < size; ii++) { + retx += keys[ii] + ", "; + } + return retx; + } + + } \ No newline at end of file diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/download.jsp b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/download.jsp new file mode 100644 index 0000000..20ef584 --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/download.jsp @@ -0,0 +1,22 @@ +<div id="downloadAds" style="text-align:center; border-style:none; width:100%;"> + <table style="width:100%;"> + <tr> + <td style="text-align:center;"> + <a href="http://java.sun.com/javaee/downloads/index.jsp" target="downloads"><img style="border:none" src="./images/ad-sdk.jpg" alt="Download Java EE 5 SDK"/></a> + <br/> + </td> + </tr> + <tr> + <td style="text-align:center;"> + <a href="http://www.netbeans.org/downloads/index.html" target="downloads"><img style="border:none" src="./images/ad-netbeans.jpg" alt="Download Netbeans IDE"/></a> + <br/> + </td> + </tr> + <tr> + <td style="text-align:center;"> + <a href="http://java.com/en/download/index.jsp" target="downloads"><img style="border:none" src="./images/ad-jre.jpg" alt="Download Java SE"/></a> + <br/> + </td> + </tr> + </table> +</div> diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/downloadAd.js b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/downloadAd.js new file mode 100644 index 0000000..65855c2 --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/downloadAd.js @@ -0,0 +1,54 @@ +dojo.require("dojo.io"); +function checkAdPage() { + var bindArgs = { + // check to see if an updated page is available + URL: "http://localhost:8080/petstore/downloadAd.txt", + mimetype: "text/plain", + load: returnFunctionx, + error: ajaxBindError}; + + // dispatch the request + dojo.io.bind(bindArgs); +} + +function returnFunctionx(type, data, evt) { + // statically setup popup for simple case + // check return of the dojo call to make sure it is valid + if (evt.readyState == 4) { + if (evt.status == 200) { + alert("data = " + data); + document.getElementById("downloadAds").innerHTML=data; + } + } +} + + +var req; + +function checkAdPageMark() { + // calculate arrow and border image location + req=initRequest(); + + url="http://blueprints.dev.java.net/petstore/downloadAd.txt", + req.onreadystatechange = returnFunctionxMark; + req.open("GET", url, true); + req.send(null); +} + + +function returnFunctionxMark() { + if (req.readyState == 4) { + if (req.status == 200) { + alert("data = " + req.responseText); + document.getElementById("downloadAds").innerHTML=req.responseText; + } + } +} + +initRequest=function() { + if (window.XMLHttpRequest) { + return new XMLHttpRequest(); + } else if (window.ActiveXObject) { + return new ActiveXObject("Microsoft.XMLHTTP"); + } +} diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/downloadAd.json b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/downloadAd.json new file mode 100644 index 0000000..3bbf564 --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/downloadAd.json @@ -0,0 +1,7 @@ +jsonpTest({"keyId":"TestData"}); + +function testexample() { + alert("testexample!!"); +} + +testexample(); \ No newline at end of file diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/downloadAd.txt b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/downloadAd.txt new file mode 100644 index 0000000..e9a0944 --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/downloadAd.txt @@ -0,0 +1 @@ +<div id='downloadAds' style='text-align:center; border-style:double; width:100%;'> <table style='width:100%'> <tr> <th style='text-align:center; border-bottom:thin solid black;'>DOWNLOADS Blueprints</th> </tr> <tr> <td style='text-align:center;'> <a href='http://java.sun.com/javaee/downloads/index.jsp' target='downloads'><img style='border:none' src='./images/ad-sdk.jpg' alt='Download Java EE 5 SDK'/></a> </td> </tr> <tr> <td style='text-align:center;'> <a href='http://www.netbeans.org/downloads/index.html' target='downloads'><img style='border:none' src='./images/ad-netbeans.jpg' alt='Download Netbeans IDE'/></a> </td> </tr> <tr> <td style='text-align:center;'> <a href='http://java.com/en/download/index.jsp' target='downloads'><img style='border:none' src='./images/ad-jre.jpg' alt='Download Java SE'/></a> </td> </tr> </table></div> \ No newline at end of file diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/engine.js b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/engine.js new file mode 100644 index 0000000..0e5b14e --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/engine.js @@ -0,0 +1,241 @@ +/* Copyright 2006 Sun Microsystems, Inc. All rights reserved. You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at: http://developer.sun.com/berkeley_license.html +$Id: engine.js,v 1.10 2006/05/03 22:00:32 inder Exp $ */ + +function Engine () { + + /** + * + * Load template text aloing with an associated script + * + * Argument p properties are as follows: + * + * url : Not required but used if you want to get the template from + * something other than the injection serlvet. For example if + * you want to load content directly from a a JSP or HTML file. + * + * p.template : Not required if you specficy a url property Otherewise this + * is the name of the template file. + * + * p.initFunction: Not required. This function or function pointer will be called + * after the template text and script are loaded. The result of + * the evaluated script will be accessible in the context of + * this function. + * + * p.injectionPoint: Not required. This is the id of an element into. If this is + * not specfied a div will be created under the roon node of + * the document and the template will be injected into it. + * Content is injected by setting the innerHTML property + * of an element to the template text. + */ + this.inject = function (p) { + var targetUrl; + if (!p.url) targetUrl = "controller?command=content&target=/" + p.template; + else targetUrl = p.url; + var templateArgs = { + url: targetUrl, + mimetype: "text/html", + load: function(type, data) { + //if no parent is given append to the document root + var nData = includeEmbeddedResources(data, p.initFunction ); + if (!p.injectionPoint) { + var injectionPoint = document.createElement("div"); + injectionPoint.innerHTML = nData; + document.firstChild.appendChild(injectionPoint); + } else { + p.injectionPoint.innerHTML = nData; + } + if (p.script) { + // now load the associated JavaScript + loadScript(p.script,p.initFunction); + } + } + }; + dojo.io.bind(templateArgs); + } + + function loadScript(targetURL,callback) { + var templateArgs = { + url: targetURL, + mimetype: "text/plain", + load: callback + }; + dojo.io.bind(templateArgs); + } + + /** + * If were returning an text document remove any script in the + * the document and add it to the global scope using a time out. + */ + function includeEmbeddedResources(target, initFunction) { + var bodyText = ""; + var embeddedScripts = []; + var embeddedStyles = []; + var scriptReferences = []; + var styleReferences = []; + var styles = []; + // recursively go through and weed out the scripts + // TODO: Use some better REGEX processing + // TODO: Also support single quotes + while (target.indexOf("<script") != -1) { + var realStart = target.indexOf("<script"); + var scriptSourceStart = target.indexOf("src=", (realStart)); + var scriptElementEnd = target.indexOf(">", realStart); + var end = target.indexOf("</script>", (realStart)) + "</script>".length; + if (realStart != -1 && scriptSourceStart != -1) { + var scriptSourceName; + var scriptSourceLinkStart= scriptSourceStart + 5; + var scriptSourceLinkEnd= target.indexOf(""", (scriptSourceLinkStart + 1)); + if (scriptSourceStart < scriptElementEnd) { + scriptSourceName = target.substring(scriptSourceLinkStart, scriptSourceLinkEnd); + // prevent multiple inclusions of dojo.js. + // there is no way you would get to this point without dojo being included + if (scriptSourceName.indexOf("dojo.js") == -1) { + scriptReferences.push(scriptSourceName); + } + } + } + // now remove the script body + var scriptBodyStart = scriptElementEnd + 1; + var sBody = target.substring(scriptBodyStart, end - "</script>".length); + if (sBody.length > 0) { + embeddedScripts.push(sBody); + } + //remove script + target = target.substring(0, realStart) + target.substring(end, target.length); + } + + while (target.indexOf("<style") != -1) { + var realStart = target.indexOf("<style"); + var styleElementEnd = target.indexOf(">", realStart); + var end = target.indexOf("</style>", (realStart)) ; + var styleBodyStart = styleElementEnd + 1; + var sBody = target.substring(styleBodyStart, end); + if (sBody.length > 0) { + embeddedStyles.push(sBody); + } + //remove style + target = target.substring(0, realStart) + target.substring(end + "</style>".length, target.length); + } + // get the links + while (target.indexOf("<link") != -1) { + var realStart = target.indexOf("<link"); + var styleSourceStart = target.indexOf("href=", (realStart)); + var styleElementEnd = target.indexOf(">", realStart) +1; + if (realStart != -1 && styleSourceStart != -1) { + var styletSourceName; + var styleSourceLinkStart= styleSourceStart + 6; + var styleSourceLinkEnd= target.indexOf(""", (styleSourceLinkStart + 1)); + if (styleSourceStart < styleElementEnd) { + styleSourceName = target.substring(styleSourceLinkStart, styleSourceLinkEnd); + styleReferences.push(styleSourceName); + } + //remove style + target = target.substring(0, realStart) + target.substring(styleElementEnd, target.length); + } + } + + var head = document.getElementsByTagName("head")[0]; + + // inject the links + for(var loop = 0; loop < styleReferences.length; loop++) { + var link = document.createElement("link"); + link.href = styleReferences[loop]; + link.type = "text/css"; + link.rel = "stylesheet"; + head.appendChild(link); + } + + var stylesElement; + if (embeddedStyles.length > 0) { + stylesElement = document.createElement("style"); + stylesElement.type="text/css"; + var stylesText; + for(var loop = 0; loop < embeddedStyles.length; loop++) { + stylesText = stylesText + embeddedStyles[loop]; + } + if (document.styleSheets[0].cssText) { + document.styleSheets[0].cssText = document.styleSheets[0].cssText + stylesText; + } else { + stylesElement.appendChild(document.createTextNode(stylesText)); + head.appendChild(stylesElement); + } + } + + scriptLoader(scriptReferences, 0, function() { + this.embeddedScripts = embeddedScripts; + // evaluate the embedded javascripts in the order they were added + // consider using an onload handler + for(var loop = 0; loop < embeddedScripts.length; loop++) { + //alert("evaluating " + embeddedScripts[loop]); + var script = embeddedScripts[loop]; + // append to the script a method to call the scriptLoaderCallback + eval(script); + if (loop == (embeddedScripts.length -1)) { + initFunction(); + } + } + }); + + return target; + } + + + /** + * Load the scripts in order and load them one after on another + */ + function scriptLoader(scripts, index, callbackFunction) { + var head = document.getElementsByTagName("head").item(0); + var scriptElement = document.createElement("script"); + scriptElement.id = "c_script_" + index; + scriptElement.type = "text/javascript"; + + var loadHandler = function () { + if (index < scripts.length && index != scripts.length -1) { + scriptLoader(scripts, ++index, callbackFunction); + } else { + callbackFunction(); + } + } + if (typeof scriptElement.onreadystatechange != 'undefined') { + scriptElement.onreadystatechange = function () { + if (this.readyState == 'loaded') { + loadHandler(); + } + }; + } + scriptElement.onload = loadHandler; + + // Safari not seeing the onload event and does not support the onreadystate + if (navigator.userAgent.toLowerCase().indexOf("safari") != -1) { + scriptElement.src = scripts[index]; + setTimeout(loadHandler, 0); + } + head.appendChild(scriptElement); + setTimeout("document.getElementById('c_script_" + index + "').src ='" + scripts[index] + "'", 0); + + scriptElement = null; + head = null; + } + + /** + * If were returning an XML document remove any script in the + * the document and add it to the global scope using a time out. + */ + function includeEmbeddedScripts(xmlDocument) { + var items = new Array(); + var xmlDocument = document.getElementsByTagName("script"); + + for(var loop = 0; loop < targets.length; loop++) { + var children = targets[loop].childNodes; + var iScript = ""; + for(var innerLoop = 0; innerLoop < children.length; innerLoop++) { + iScript += children[innerLoop].data; + } + items.add(iScript); + children[loop].parentNode.removeChild(children[loop]); + } + for(var loop = 0; loop < items.length; loop++) { + setTimeout(items[loop],0); + } + } +} diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/fileupload.jsp b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/fileupload.jsp new file mode 100644 index 0000000..bb8fb85 --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/fileupload.jsp @@ -0,0 +1,266 @@ +<%-- Copyright 2006 Sun Microsystems, Inc. All rights reserved. You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at: http://developer.sun.com/berkeley_license.html +$Id: fileupload.jsp,v 1.57 2007/03/08 21:58:48 inder Exp $ --%> + +<%@page contentType="text/html"%> +<%@page pageEncoding="UTF-8"%> +<%@page import="com.sun.javaee.blueprints.petstore.util.PetstoreConstants"%> +<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> +<%@taglib uri="http://java.sun.com/jsf/html" prefix="h" %> +<%@taglib uri="http://java.sun.com/jsf/core" prefix="f" %> +<%@taglib prefix="ui" uri="http://java.sun.com/blueprints/ui" %> + +<html> + <head> + <title>Petstore Seller page</title> + <script type="text/javascript"> + var submittingForm=false; + + function testRetFunction(type, data, evt){ + if (evt.readyState == 4) { + if(evt.status == 200) { + // check for error + submittingForm=false; + var resultx=data.getElementsByTagName("response")[0]; + var message=resultx.getElementsByTagName("message")[0].childNodes[0].nodeValue; + if(message == "Captchas Filter Error") { + // captcha error + alert("Authorization failed : please enter the correct captcha string"); + } else if(message == "Validation Error") { + alert("Validation failed on the Server :\n" + resultx.getElementsByTagName("detail")[0].childNodes[0].nodeValue); + } else if(message == "Upload Size Error") { + alert("The size of the uploaded image must not be more than 100 KB"); + } else { + // fileupload complete + var thumbpath=resultx.getElementsByTagName("thumbnail")[0].childNodes[0].nodeValue; + var productId=resultx.getElementsByTagName("productId")[0].childNodes[0].nodeValue; + var itemid=resultx.getElementsByTagName("itemId")[0].childNodes[0].nodeValue; + // forward to status page + location.href="fileuploadstatus.jsp?message=" + message + "&id=" + itemid + "&productId=" + productId + "&thumb=" + thumbpath; + } + } else { + // server error, send to error page + // can't forward to errorpage because null pointer gets thrown on lookup of status code ("javax.servlet.error.status_code") + //ajaxBindError(type, data.message); + alert("Persistence failed : Please check if the server logs for more information!") + } + } + } + + + function storeCookie() { + currentcap = "j_captcha_response="+document.getElementById("TestFileuploadForm:captcharesponse").value; + document.cookie = currentcap; + } + + function extractCity(citystatezip) { + var index = citystatezip.indexOf(','); + var nextcity = citystatezip.substring(0, index+4); + return nextcity; + } + + function chooseCity(city) { + var index = city.indexOf(','); + var state = city.substring(index+2, index+4); + var zip = city.substring(index+5); + city = city.substring(0, index); + + document.getElementById('TestFileuploadForm:cityField').value = city; + document.getElementById('TestFileuploadForm:stateField').value = state; + document.getElementById('TestFileuploadForm:zipField').value = zip; + } + + function fileuploadOnsubmit() { + if(!submittingForm) { + var valMess=""; + + // save rich text editor text to element + var descx=dojo.widget.byId('rtEditor').getEditorContent() + var lowDescx=descx.toLowerCase(); + + // START: check validation + if(dojo.byId("TestFileuploadForm:name").value == "") { + valMess += "Error: Pet Name is required.\n"; + } + + // make sure there isn't a script/link tag in the description + if(lowDescx == "" || lowDescx.indexOf("<script") > -1 || lowDescx.indexOf("<link") > -1) { + valMess += "Error: The Description must exist and the field can't have a '<script>' and/or a '<link>' tag in it\n"; + } + + // make sure price is a number + var pricex=dojo.byId("TestFileuploadForm:price").value; + if(pricex == "" || isNaN(parseInt(pricex))) { + // price should be a number + valMess += "Error: Price should should exist and be a number in American Dollars in the format '*.00'.\n"; + } + + // make sure the upload file ends in an suffix + var filex=dojo.byId("fileToUploadId").value; + var lengthx=filex.length; + var suffix=filex.substr(lengthx-4).toLowerCase(); + if(lengthx < 1 || (suffix != ".jpg" && suffix != ".gif" && suffix != ".png")) { + // not a proper upload so error + valMess += "Error: The image upload file must exist and be of type .jpg, .gif or .png\n"; + } + + + // make sure make and address is entered + if(dojo.byId("TestFileuploadForm:firstName").value == "") { + // price should be a number + valMess += "Error: First Name is required.\n"; + } + if(dojo.byId("TestFileuploadForm:lastName").value == "") { + valMess += "Error: Last Name is required.\n"; + } + if(dojo.byId("TestFileuploadForm:street1").value == "") { + valMess += "Error: Street is required.\n"; + } + if(dojo.byId("TestFileuploadForm:cityField").value == "") { + valMess += "Error: City is required.\n"; + } + if(dojo.byId("TestFileuploadForm:stateField").value == "") { + valMess += "Error: State is required.\n"; + } + if(dojo.byId("TestFileuploadForm:zipField").value == "") { + valMess += "Error: Zip Code is required.\n"; + } + + if(valMess != "") { + // error, show message + alert(valMess + "\nPlease addresses the error(s) and re-submit your entry!"); + } else { + // no validation errors, so submit form + submittingForm=true; + // set description + dojo.byId('description').value=descx; + + storeCookie() + document.forms['TestFileuploadForm'].onsubmit(); + } + } + } + + function showFU() { + document.getElementById("fucomponent").style.visibility = "visible"; + } + + function switchPanes(fromDivId, toDivId) { + // show pane + var divx=document.getElementById(fromDivId); + divx.style.visibility='hidden'; + divx=document.getElementById(toDivId); + divx.style.visibility='visible'; + } +</script> +<style> +span.button { + background-color: #6699CC; + color: white; + cursor:pointer; + border: thin outset black; + padding: 1px 5px; +} +div.pane { + width: 90%; + background-color: #EEEEEE; + border: thin double blue; + padding: .5cm; + font: 12px arial; +} + +.nameCol { + width: 45%; +} +.dataCol { + width: 55%; +} + +</style> + </head> + <body onload="showFU()"> + <jsp:include page="banner.jsp"/> + <script>dojo.require("dojo.widget.Editor2");</script> + <br/> + <div id="fucomponent" style="visibility:hidden;"> + <f:view> + + <ui:fileUploadTag id="TestFileuploadForm" serverLocationDir="#{FileUploadBean.uploadImageDirectory}" + postProcessingMethod="#{FileUploadBean.postProcessingMethod}" + retMimeType="text/xml" retFunction="testRetFunction" + progressBarDivId="progress" progressBarSize="40"> + <div id="pane2" class="pane" style="visibility: hidden;"> + <h:panelGrid border="0" columns="2" style="width: 100%" columnClasses="nameCol, dataCol"> + <f:facet name="header"> + <h:outputText value="Information about yourself"/> + </f:facet> + <h:outputText value="*First Name"/> + <h:inputText size="20" id="firstName"></h:inputText> + <h:outputText value="*Last Name"/> + <h:inputText size="20" id="lastName"></h:inputText> + <h:outputText value="Seller Email"/> + <h:inputText size="20" id="email"></h:inputText> + <h:outputText value="*Street"/> + <h:inputText size="20" id="street1"></h:inputText> + <h:outputText value="*City"/> + <ui:autoComplete size="20" maxlength="10" id="cityField" + completionMethod="#{AutocompleteBean.completeCity}" + value="#{AddressBean.city}" required="true" + ondisplay="function(item) { return extractCity(item); }" + onchoose="function(item) { return chooseCity(item); }" /> + <h:outputText value="*State"/> + <ui:autoComplete size="2" maxlength="10" id="stateField" + completionMethod="#{AutocompleteBean.completeState}" + value="#{AddressBean.state}" required="true" /> + <h:outputText value="*Zip Code"/> + <h:inputText size="5" id="zipField" value="#{AddressBean.zip}" required="true" /> + + <h:outputText value="Enter the text as it is shown below (case insensitive)"/> + <h:outputText /> + <h:graphicImage id="captchaImg" url="CaptchaServlet"/> + <h:inputText id="captcharesponse"></h:inputText> + <br/><span class="button" onclick="switchPanes('pane2', 'pane1');"><< Previous</span> + <span class="button" onclick="fileuploadOnsubmit()">Submit</span> + <br/><div id="progress"></div><br/> + + </h:panelGrid> + </div> + <div class="pane"style="position:absolute; top:125px;" id="pane1"> + <h:panelGrid border="0" columns="2" style="width: 100%" columnClasses="nameCol, dataCol"> + <f:facet name="header"> + <h:outputText value="Information about your pet"/> + </f:facet> + + <h:outputText value="Category"/> + <h:selectOneMenu id="product"> + <f:selectItems value="#{FileUploadBean.products}"/> + </h:selectOneMenu> + + <h:outputText value="*Pet's Name"/> + <h:inputText size="20" id="name"></h:inputText> + + <h:outputText value="*Description (3 lines max display in catalog)"/> + + <div style="border-style:inset; border-width:thin; background-color:white"> + <textarea wrap="soft" dojoType="Editor2" widgetId="rtEditor" id="description" name="TestFileuploadForm:description" + toolbarTemplatePath="${pageContext.request.contextPath}/rteToolBar.html"></textarea> + </div> + + <h:outputText value="*Price (is US dollars)"/> + <h:inputText size="20" id="price"></h:inputText> + + <h:outputText value="*Image File"/> + <input type="file" size="20" name="fileToUpload" id="fileToUploadId"/> + + <h:outputText value="Custom Tag Keywords (separated by spaces)"/> + <h:inputText size="20" id="tags"></h:inputText> + </h:panelGrid> + <br/><span class="button" onclick="switchPanes('pane1', 'pane2');">Next >></span> + </div> + Required fields are designated by a * + </ui:fileUploadTag> + </f:view> + </div> + + <jsp:include page="footer.jsp" /> + </body> +</html> diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/fileuploadstatus.jsp b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/fileuploadstatus.jsp new file mode 100644 index 0000000..50e3730 --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/fileuploadstatus.jsp @@ -0,0 +1,134 @@ +<%-- Copyright 2006 Sun Microsystems, Inc. All rights reserved. You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at: http://developer.sun.com/berkeley_license.html +$Id: fileuploadstatus.jsp,v 1.8 2006/05/05 21:05:47 yutayoshida Exp $ --%> + +<%@page contentType="text/html"%> +<%@page pageEncoding="UTF-8"%> + +<html> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> + <title>Seller Photo Submit Status</title> + <style type="text/css"> + #status { background-color : #E0FFFF; + border : none; + width : 50%; + } + </style> + <script type="text/javascript"> + window.onload = function() { + var thumbfile = "${param.thumb}"; + if (thumbfile == "") { + thumbfile = "${sessionScope['fileuploadResponse'].thumbnail}"; + } + thumbpath = "http://$%7BpageContext.request.serverName%7D:$%7BpageContext.request.serverP..."; + thumbpath += thumbfile; + var divNode = document.getElementById("thumb"); + var imgNode = document.createElement("img"); + imgNode.setAttribute("src", thumbpath); + divNode.appendChild(imgNode); + + // initialize buttons + initButtonImage(); + } + + var imageLayerId = new Array(); + var imageLayerG = new Array(); + var imageLayerC = new Array(); + var imageText = new Array(); + function initButtonImage(){ + imageLayerId[1] ="seller" + imageLayerG[1] = "../images/seller-thumb-g.jpg"; + imageLayerC[1] = "../images/seller-thumb.jpg"; + imageLayerId[2] ="catalog" + imageLayerG[2] = "../images/catalog-thumb-g.jpg"; + imageLayerC[2] = "../images/catalog-thumb.jpg"; + imageLayerId[3] ="home" + imageLayerG[3] = "../images/index-thumb-g.jpg"; + imageLayerC[3] = "../images/index-thumb.jpg"; + + imageText[1] = "Submit another pet"; + imageText[2] = "Go to your pet page"; + imageText[3] = "Go back to PetStore home"; + } + + function highlightButton(n) { + switchButton(true, n); + } + function darkenButton(n) { + switchButton(false, n); + } + + function switchButton(highlight, n){ + var id = imageLayerId[n]; + var btn = document.getElementById(id); + if (highlight) { + btn.src = imageLayerC[n]; + popupText(imageText[n]); + } else { + btn.src = imageLayerG[n]; + popupText(null); + } + } + var Mx; + var My; + function popupText(txt) { + var pNode = document.getElementById("popupText"); + var rx; + var ry; + if (document.all) { + rx = event.clientX + document.body.scrollLeft +10; + ry = event.clientY + document.body.scrollTop -20; + } else { + rx = Mx + 10; + ry = My -20; + } + if (txt) { + pNode.style.display = "block"; + pNode.style.left = rx + "px"; + pNode.style.top = ry + "px"; + pNode.innerHTML = txt; + } else { + pNode.style.display = "none"; + pNode.innerHTML = ""; + } + } + function getMouseXY(mEvent) { + Mx = mEvent.pageX; + My = mEvent.pageY; + } + window.onmousemove = getMouseXY; + </script> + </head> + <body> + <jsp:include page="banner.jsp"/> + <center> + <div id="status"> + <h4>${param.message}</h4> + Here's the uploaded photo of your pet<br/><br/> + <div id="thumb"></div> + <br/><br/> + Would you like to :-<br/><br/> + + <div id="popupText" style="position:absolute;z-index:2;border:1px solid;padding:5px; + border-color:blue;font-size:10pt;background-color:#00ffff;color:blue;display:none"></div> + <table border="0" cellpadding="4" cellspacing="4"> + <tr> + <td><a href="fileupload.jsp" onmouseover="highlightButton(1)" onmouseout="darkenButton(1)"> + <img name="seller" id="seller" src="../images/seller-thumb-g.jpg" alt="seller" width="105" height="60" border="0"> + </a> + </td> + <td><a href="catalog.jsp?pid=${param.productId}&itemId=${param.id}" onmouseover="highlightButton(2)" onmouseout="darkenButton(2)"> + <img name="catalog" id="catalog" src="../images/catalog-thumb-g.jpg" alt="catalog" width="105" height="60" border="0"> + </a> + </td> + <td><a href="http://${pageContext.request.serverName}:${pageContext.request.serverPort}${pageContext.servletContext.contextPath}/index.jsp" onmouseover="highlightButton(3)" onmouseout="darkenButton(3)"> + <img name="home" id="home" src="../images/index-thumb-g.jpg" alt="index" width="105" height="60" border="0"> + </a> + </td> + </tr> + </table> + </div> + </center> + <jsp:include page="footer.jsp" /> + </body> +</html> diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/footer.jsp b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/footer.jsp new file mode 100644 index 0000000..8fda523 --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/footer.jsp @@ -0,0 +1,15 @@ +<%-- Copyright 2006 Sun Microsystems, Inc. All rights reserved. You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at: http://developer.sun.com/berkeley_license.html +$Id: footer.jsp,v 1.10 2007/01/31 19:40:34 basler Exp $ --%> + +<hr/> +<center> + If you have any questions or suggestions, please use the <a + href="https://blueprints.dev.java.net/feedback.html" target="petstore">feedback page</a>. + <br/> + To access the latest versions of any of the BluePrints projects, please use the <a + href="https://blueprints.dev.java.net/downloads.html" target="petstore">download page</a>. + <br/> + <a href="http://blueprints.dev.java.net/" target="petstore">Java BluePrints</a> | + <a href="http://sun.com/" target="petstore">Sun Microsystems</a> © 2007 Sun Microsystems Inc. All rights reserved. Use is subject to license terms. +</center> + diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9081-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9081-s.jpg new file mode 100644 index 0000000..734f0ba Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9081-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9081.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9081.jpg new file mode 100644 index 0000000..1d6b615 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9081.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9083-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9083-s.jpg new file mode 100644 index 0000000..d50fc6f Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9083-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9083.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9083.jpg new file mode 100644 index 0000000..77fb082 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9083.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9084-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9084-s.jpg new file mode 100644 index 0000000..93a3832 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9084-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9084.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9084.jpg new file mode 100644 index 0000000..b7c7c3b Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9084.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9086-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9086-s.jpg new file mode 100644 index 0000000..0c9ce17 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9086-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9086.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9086.jpg new file mode 100644 index 0000000..caaf6a7 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9086.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9088-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9088-s.jpg new file mode 100644 index 0000000..6c7d06e Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9088-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9088.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9088.jpg new file mode 100644 index 0000000..f7daf7a Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9088.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9099-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9099-s.jpg new file mode 100644 index 0000000..2794a4b Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9099-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9099.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9099.jpg new file mode 100644 index 0000000..57175e3 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9099.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9100-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9100-s.jpg new file mode 100644 index 0000000..d1b3610 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9100-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9100.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9100.jpg new file mode 100644 index 0000000..dd57db1 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9100.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9101-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9101-s.jpg new file mode 100644 index 0000000..2f14c53 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9101-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9101.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9101.jpg new file mode 100644 index 0000000..334a0f8 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9101.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9102-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9102-s.jpg new file mode 100644 index 0000000..6bec9fa Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9102-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9102.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9102.jpg new file mode 100644 index 0000000..6219a97 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9102.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9103-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9103-s.jpg new file mode 100644 index 0000000..61b9b59 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9103-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9103.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9103.jpg new file mode 100644 index 0000000..d4a91e0 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9103.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9104-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9104-s.jpg new file mode 100644 index 0000000..9c7c4ab Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9104-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9104.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9104.jpg new file mode 100644 index 0000000..93eb9da Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9104.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9107-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9107-s.jpg new file mode 100644 index 0000000..cacb8f6 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9107-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9107.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9107.jpg new file mode 100644 index 0000000..f1da9d8 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9107.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9109-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9109-s.jpg new file mode 100644 index 0000000..a999838 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9109-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9109.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9109.jpg new file mode 100644 index 0000000..e3eeb3e Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9109.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9113-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9113-s.jpg new file mode 100644 index 0000000..bf3aa59 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9113-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9113.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9113.jpg new file mode 100644 index 0000000..990e44b Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9113.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9115-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9115-s.jpg new file mode 100644 index 0000000..873beb5 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9115-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9115.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9115.jpg new file mode 100644 index 0000000..e9f2fbb Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9115.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9117-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9117-s.jpg new file mode 100644 index 0000000..4119ae3 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9117-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9117.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9117.jpg new file mode 100644 index 0000000..efa8fa8 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9117.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9118-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9118-s.jpg new file mode 100644 index 0000000..6ac0c46 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9118-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9118.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9118.jpg new file mode 100644 index 0000000..1ab033b Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9118.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9122-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9122-s.jpg new file mode 100644 index 0000000..4b75817 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9122-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9122.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9122.jpg new file mode 100644 index 0000000..0bbad05 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9122.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9123-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9123-s.jpg new file mode 100644 index 0000000..f63f01a Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9123-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9123.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9123.jpg new file mode 100644 index 0000000..10f22cc Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9123.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9125-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9125-s.jpg new file mode 100644 index 0000000..e18660f Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9125-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9125.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9125.jpg new file mode 100644 index 0000000..e651619 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9125.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9127-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9127-s.jpg new file mode 100644 index 0000000..3f93502 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9127-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9127.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9127.jpg new file mode 100644 index 0000000..d33f856 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9127.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9129-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9129-s.jpg new file mode 100644 index 0000000..43cd251 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9129-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9129.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9129.jpg new file mode 100644 index 0000000..aa0820c Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9129.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9134-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9134-s.jpg new file mode 100644 index 0000000..8b73de1 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9134-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9134.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9134.jpg new file mode 100644 index 0000000..248ca28 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9134.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9138-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9138-s.jpg new file mode 100644 index 0000000..0c3fb87 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9138-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9138.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9138.jpg new file mode 100644 index 0000000..ff93f90 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9138.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9142-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9142-s.jpg new file mode 100644 index 0000000..4571a4b Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9142-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9142.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9142.jpg new file mode 100644 index 0000000..647323b Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9142.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9149-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9149-s.jpg new file mode 100644 index 0000000..e870f66 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9149-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9149.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9149.jpg new file mode 100644 index 0000000..23dd110 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9149.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9154-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9154-s.jpg new file mode 100644 index 0000000..3355eaa Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9154-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9154.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9154.jpg new file mode 100644 index 0000000..531ec1e Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9154.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9155-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9155-s.jpg new file mode 100644 index 0000000..9cd85f5 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9155-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9155.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9155.jpg new file mode 100644 index 0000000..72377b5 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9155.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9156-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9156-s.jpg new file mode 100644 index 0000000..2788d06 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9156-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9156.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9156.jpg new file mode 100644 index 0000000..2b836df Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9156.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9157-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9157-s.jpg new file mode 100644 index 0000000..9ef87c3 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9157-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9157.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9157.jpg new file mode 100644 index 0000000..753d1e9 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9157.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9158-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9158-s.jpg new file mode 100644 index 0000000..29953c4 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9158-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9158.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9158.jpg new file mode 100644 index 0000000..a4a0247 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9158.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9159-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9159-s.jpg new file mode 100644 index 0000000..7caf368 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9159-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9159.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9159.jpg new file mode 100644 index 0000000..9f18ed6 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9159.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9162-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9162-s.jpg new file mode 100644 index 0000000..65bc52f Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9162-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9162.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9162.jpg new file mode 100644 index 0000000..b0f299d Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9162.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9165-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9165-s.jpg new file mode 100644 index 0000000..d1e9cc3 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9165-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9165.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9165.jpg new file mode 100644 index 0000000..862c6f8 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9165.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/ad-jre.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/ad-jre.jpg new file mode 100644 index 0000000..5c7b519 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/ad-jre.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/ad-netbeans.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/ad-netbeans.jpg new file mode 100644 index 0000000..079b2fa Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/ad-netbeans.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/ad-sdk.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/ad-sdk.jpg new file mode 100644 index 0000000..2a1a88a Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/ad-sdk.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/african-spurred-tortoise-thumb.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/african-spurred-tortoise-thumb.jpg new file mode 100644 index 0000000..4d1ed42 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/african-spurred-tortoise-thumb.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/african-spurred-tortoise.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/african-spurred-tortoise.jpg new file mode 100644 index 0000000..87ea286 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/african-spurred-tortoise.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/african-spurred-tortoise2-thumb.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/african-spurred-tortoise2-thumb.jpg new file mode 100644 index 0000000..7b76088 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/african-spurred-tortoise2-thumb.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/african-spurred-tortoise2.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/african-spurred-tortoise2.jpg new file mode 100644 index 0000000..8005ff3 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/african-spurred-tortoise2.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/anthony-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/anthony-s.jpg new file mode 100644 index 0000000..4b21f49 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/anthony-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/anthony.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/anthony.jpg new file mode 100644 index 0000000..88a889c Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/anthony.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bailey-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bailey-s.jpg new file mode 100644 index 0000000..8adf561 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bailey-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bailey.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bailey.jpg new file mode 100644 index 0000000..c262965 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bailey.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/banner_logo.gif b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/banner_logo.gif new file mode 100644 index 0000000..85de81a Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/banner_logo.gif differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bird1.gif b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bird1.gif new file mode 100644 index 0000000..06f1abe Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bird1.gif differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bird2.gif b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bird2.gif new file mode 100644 index 0000000..9601f1c Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bird2.gif differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bird3.gif b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bird3.gif new file mode 100644 index 0000000..f48a7ec Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bird3.gif differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bird4.gif b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bird4.gif new file mode 100644 index 0000000..eaaa3e5 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bird4.gif differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bird5.gif b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bird5.gif new file mode 100644 index 0000000..9f440f1 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bird5.gif differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bird6.gif b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bird6.gif new file mode 100644 index 0000000..affd8e0 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bird6.gif differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/birds_icon.gif b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/birds_icon.gif new file mode 100644 index 0000000..8b14629 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/birds_icon.gif differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/biscuit-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/biscuit-s.jpg new file mode 100644 index 0000000..8c54af1 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/biscuit-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/biscuit.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/biscuit.jpg new file mode 100644 index 0000000..ccdea14 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/biscuit.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bob-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bob-s.jpg new file mode 100644 index 0000000..b3f1d09 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bob-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bob.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bob.jpg new file mode 100644 index 0000000..d3dcfd7 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bob.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/box-turtle-thumb.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/box-turtle-thumb.jpg new file mode 100644 index 0000000..a4b48da Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/box-turtle-thumb.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/box-turtle.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/box-turtle.jpg new file mode 100644 index 0000000..5a172c5 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/box-turtle.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/box-turtle2-thumb.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/box-turtle2-thumb.jpg new file mode 100644 index 0000000..40303af Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/box-turtle2-thumb.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/box-turtle2.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/box-turtle2.jpg new file mode 100644 index 0000000..83d74d2 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/box-turtle2.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/box-turtle3-thumb.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/box-turtle3-thumb.jpg new file mode 100644 index 0000000..004dfe3 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/box-turtle3-thumb.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/box-turtle3.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/box-turtle3.jpg new file mode 100644 index 0000000..3e77142 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/box-turtle3.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/california-desert-tortoise-thumb.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/california-desert-tortoise-thumb.jpg new file mode 100644 index 0000000..4c260e8 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/california-desert-tortoise-thumb.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/california-desert-tortoise.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/california-desert-tortoise.jpg new file mode 100644 index 0000000..b146396 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/california-desert-tortoise.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/carp-car-med.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/carp-car-med.jpg new file mode 100644 index 0000000..742336f Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/carp-car-med.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/carp-car-thumb.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/carp-car-thumb.jpg new file mode 100644 index 0000000..e5bbc24 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/carp-car-thumb.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat1.gif b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat1.gif new file mode 100644 index 0000000..1fd4d1c Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat1.gif differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat10.gif b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat10.gif new file mode 100644 index 0000000..8bc7f6c Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat10.gif differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat11.gif b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat11.gif new file mode 100644 index 0000000..a51bc96 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat11.gif differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat12.gif b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat12.gif new file mode 100644 index 0000000..e594c67 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat12.gif differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat2.gif b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat2.gif new file mode 100644 index 0000000..6ac8718 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat2.gif differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat3.gif b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat3.gif new file mode 100644 index 0000000..4716f5d Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat3.gif differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat4.gif b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat4.gif new file mode 100644 index 0000000..0793e3f Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat4.gif differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat5.gif b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat5.gif new file mode 100644 index 0000000..2d289ba Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat5.gif differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat6.gif b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat6.gif new file mode 100644 index 0000000..2ea6132 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat6.gif differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat7.gif b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat7.gif new file mode 100644 index 0000000..159ba6a Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat7.gif differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat8.gif b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat8.gif new file mode 100644 index 0000000..a9ed7c9 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat8.gif differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat9.gif b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat9.gif new file mode 100644 index 0000000..02faffb Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat9.gif differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/catalog-thumb-g.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/catalog-thumb-g.jpg new file mode 100644 index 0000000..1a13b11 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/catalog-thumb-g.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/catalog-thumb.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/catalog-thumb.jpg new file mode 100644 index 0000000..d6148de Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/catalog-thumb.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cats_icon.gif b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cats_icon.gif new file mode 100644 index 0000000..db70d7d Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cats_icon.gif differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cbutton.gif b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cbutton.gif new file mode 100644 index 0000000..83b8761 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cbutton.gif differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/chantelle-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/chantelle-s.jpg new file mode 100644 index 0000000..84e4e89 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/chantelle-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/chantelle.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/chantelle.jpg new file mode 100644 index 0000000..5830e57 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/chantelle.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/charlie-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/charlie-s.jpg new file mode 100644 index 0000000..bb91e94 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/charlie-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/charlie.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/charlie.jpg new file mode 100644 index 0000000..9e8d17d Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/charlie.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/check_all.gif b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/check_all.gif new file mode 100644 index 0000000..3c517f3 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/check_all.gif differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cuttlefish-med.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cuttlefish-med.jpg new file mode 100644 index 0000000..575a854 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cuttlefish-med.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cuttlefish-thumb.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cuttlefish-thumb.jpg new file mode 100644 index 0000000..9c2dc57 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cuttlefish-thumb.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dog1.gif b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dog1.gif new file mode 100644 index 0000000..92e71b5 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dog1.gif differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dog2.gif b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dog2.gif new file mode 100644 index 0000000..e581980 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dog2.gif differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dog3.gif b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dog3.gif new file mode 100644 index 0000000..9baa503 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dog3.gif differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dog4.gif b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dog4.gif new file mode 100644 index 0000000..9124427 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dog4.gif differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dog5.gif b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dog5.gif new file mode 100644 index 0000000..3f1690e Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dog5.gif differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dog6.gif b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dog6.gif new file mode 100644 index 0000000..2bf1380 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dog6.gif differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dogs_icon.gif b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dogs_icon.gif new file mode 100644 index 0000000..b13e5b9 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dogs_icon.gif differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dragon-iron-med.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dragon-iron-med.jpg new file mode 100644 index 0000000..ff83a16 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dragon-iron-med.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dragon-iron-thumb.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dragon-iron-thumb.jpg new file mode 100644 index 0000000..814dab1 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dragon-iron-thumb.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/eagle-stone-med.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/eagle-stone-med.jpg new file mode 100644 index 0000000..2623f3c Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/eagle-stone-med.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/eagle-stone-thumb.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/eagle-stone-thumb.jpg new file mode 100644 index 0000000..ccf10a2 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/eagle-stone-thumb.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/eclectus-female-med.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/eclectus-female-med.jpg new file mode 100644 index 0000000..7a7a59e Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/eclectus-female-med.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/eclectus-female-thumb.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/eclectus-female-thumb.jpg new file mode 100644 index 0000000..1f65136 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/eclectus-female-thumb.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/elkie-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/elkie-s.jpg new file mode 100644 index 0000000..4709e19 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/elkie-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/elkie.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/elkie.jpg new file mode 100644 index 0000000..76a7ff1 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/elkie.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/faith-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/faith-s.jpg new file mode 100644 index 0000000..13194bd Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/faith-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/faith.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/faith.jpg new file mode 100644 index 0000000..cd8ad6e Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/faith.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/fish2.gif b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/fish2.gif new file mode 100644 index 0000000..4d9916c Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/fish2.gif differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/fish3.gif b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/fish3.gif new file mode 100644 index 0000000..258489d Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/fish3.gif differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/fish4.gif b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/fish4.gif new file mode 100644 index 0000000..d3e39e1 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/fish4.gif differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/fish_icon.gif b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/fish_icon.gif new file mode 100644 index 0000000..730c813 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/fish_icon.gif differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/florida-king-snake-thumb.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/florida-king-snake-thumb.jpg new file mode 100644 index 0000000..cbe5030 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/florida-king-snake-thumb.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/florida-king-snake.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/florida-king-snake.jpg new file mode 100644 index 0000000..11954df Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/florida-king-snake.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/frog1.gif b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/frog1.gif new file mode 100644 index 0000000..4bf637f Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/frog1.gif differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/gaetano-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/gaetano-s.jpg new file mode 100644 index 0000000..097b144 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/gaetano-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/gaetano.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/gaetano.jpg new file mode 100644 index 0000000..ec5d64b Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/gaetano.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/galah-parrot-med.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/galah-parrot-med.jpg new file mode 100644 index 0000000..31bb43c Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/galah-parrot-med.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/galah-parrot-thumb.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/galah-parrot-thumb.jpg new file mode 100644 index 0000000..70cdc2a Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/galah-parrot-thumb.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/glassfish-colored-med.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/glassfish-colored-med.jpg new file mode 100644 index 0000000..a6646c7 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/glassfish-colored-med.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/glassfish-colored-thumb.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/glassfish-colored-thumb.jpg new file mode 100644 index 0000000..262659a Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/glassfish-colored-thumb.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/guinea-pig-thumb.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/guinea-pig-thumb.jpg new file mode 100644 index 0000000..ea0c069 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/guinea-pig-thumb.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/guinea-pig.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/guinea-pig.jpg new file mode 100644 index 0000000..828bba2 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/guinea-pig.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/harmony-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/harmony-s.jpg new file mode 100644 index 0000000..5b28bd0 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/harmony-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/harmony.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/harmony.jpg new file mode 100644 index 0000000..3c4d322 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/harmony.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/harrison-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/harrison-s.jpg new file mode 100644 index 0000000..c7c1486 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/harrison-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/harrison.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/harrison.jpg new file mode 100644 index 0000000..6003c8c Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/harrison.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/hawaiian-lizard-med.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/hawaiian-lizard-med.jpg new file mode 100644 index 0000000..a538759 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/hawaiian-lizard-med.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/hawaiian-lizard-thumb.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/hawaiian-lizard-thumb.jpg new file mode 100644 index 0000000..2369c90 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/hawaiian-lizard-thumb.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/honey-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/honey-s.jpg new file mode 100644 index 0000000..13c3f9b Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/honey-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/honey.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/honey.jpg new file mode 100644 index 0000000..61d877b Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/honey.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/hunter-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/hunter-s.jpg new file mode 100644 index 0000000..4303498 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/hunter-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/hunter.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/hunter.jpg new file mode 100644 index 0000000..37ebbe9 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/hunter.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/index-thumb-g.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/index-thumb-g.jpg new file mode 100644 index 0000000..a42ddb4 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/index-thumb-g.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/index-thumb.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/index-thumb.jpg new file mode 100644 index 0000000..571475a Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/index-thumb.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/indicator-black.gif b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/indicator-black.gif new file mode 100644 index 0000000..6da716a Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/indicator-black.gif differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/ja_flag.gif b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/ja_flag.gif new file mode 100644 index 0000000..31d0ada Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/ja_flag.gif differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/jack-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/jack-s.jpg new file mode 100644 index 0000000..d4144da Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/jack-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/jack.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/jack.jpg new file mode 100644 index 0000000..fe37700 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/jack.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/katzen-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/katzen-s.jpg new file mode 100644 index 0000000..d83d3f9 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/katzen-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/katzen.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/katzen.jpg new file mode 100644 index 0000000..ba460be Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/katzen.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/koi-med.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/koi-med.jpg new file mode 100644 index 0000000..7afa021 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/koi-med.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/koi-thumb.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/koi-thumb.jpg new file mode 100644 index 0000000..f7fa2b2 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/koi-thumb.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/kookaburra-med.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/kookaburra-med.jpg new file mode 100644 index 0000000..8c06c3d Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/kookaburra-med.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/kookaburra-thumb.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/kookaburra-thumb.jpg new file mode 100644 index 0000000..84e82f5 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/kookaburra-thumb.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/lady-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/lady-s.jpg new file mode 100644 index 0000000..72a724f Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/lady-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/lady.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/lady.jpg new file mode 100644 index 0000000..ae9054e Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/lady.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/left.gif b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/left.gif new file mode 100644 index 0000000..46b3630 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/left.gif differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/left_2.gif b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/left_2.gif new file mode 100644 index 0000000..f50cbed Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/left_2.gif differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/leopard-gecko-thumb.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/leopard-gecko-thumb.jpg new file mode 100644 index 0000000..620c826 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/leopard-gecko-thumb.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/leopard-gecko-thumb2.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/leopard-gecko-thumb2.jpg new file mode 100644 index 0000000..2a52e80 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/leopard-gecko-thumb2.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/leopard-gecko.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/leopard-gecko.jpg new file mode 100644 index 0000000..7b77428 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/leopard-gecko.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/leopard-gecko2.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/leopard-gecko2.jpg new file mode 100644 index 0000000..b3748ae Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/leopard-gecko2.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/lizard1.gif b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/lizard1.gif new file mode 100644 index 0000000..665c4d6 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/lizard1.gif differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/lizard2.gif b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/lizard2.gif new file mode 100644 index 0000000..2e59d89 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/lizard2.gif differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/lizard3.gif b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/lizard3.gif new file mode 100644 index 0000000..6dca58f Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/lizard3.gif differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/lovebird-med.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/lovebird-med.jpg new file mode 100644 index 0000000..cef3163 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/lovebird-med.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/lovebird-thumb.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/lovebird-thumb.jpg new file mode 100644 index 0000000..7e97d51 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/lovebird-thumb.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/macaw-thumb.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/macaw-thumb.jpg new file mode 100644 index 0000000..a95ff80 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/macaw-thumb.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/macaw.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/macaw.jpg new file mode 100644 index 0000000..b7ae026 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/macaw.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/maggie-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/maggie-s.jpg new file mode 100644 index 0000000..7acf48e Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/maggie-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/maggie.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/maggie.jpg new file mode 100644 index 0000000..140a325 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/maggie.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/marianna-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/marianna-s.jpg new file mode 100644 index 0000000..4b96d8d Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/marianna-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/marianna.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/marianna.jpg new file mode 100644 index 0000000..5e3b381 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/marianna.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/mario-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/mario-s.jpg new file mode 100644 index 0000000..f2f1848 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/mario-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/mario.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/mario.jpg new file mode 100644 index 0000000..a68cd9e Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/mario.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/maximize.gif b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/maximize.gif new file mode 100644 index 0000000..da05f30 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/maximize.gif differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/mexican-redkneed-tarantula-thumb.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/mexican-redkneed-tarantula-thumb.jpg new file mode 100644 index 0000000..35387ca Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/mexican-redkneed-tarantula-thumb.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/mexican-redkneed-tarantula.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/mexican-redkneed-tarantula.jpg new file mode 100644 index 0000000..7365af9 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/mexican-redkneed-tarantula.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/mimi-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/mimi-s.jpg new file mode 100644 index 0000000..0e6a1a5 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/mimi-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/mimi.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/mimi.jpg new file mode 100644 index 0000000..950c84e Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/mimi.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/minimize.gif b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/minimize.gif new file mode 100644 index 0000000..8408264 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/minimize.gif differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/monique-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/monique-s.jpg new file mode 100644 index 0000000..dea6b6d Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/monique-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/monique.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/monique.jpg new file mode 100644 index 0000000..0f0ac10 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/monique.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/moon-jelly-med.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/moon-jelly-med.jpg new file mode 100644 index 0000000..3c7618a Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/moon-jelly-med.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/moon-jelly-thumb.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/moon-jelly-thumb.jpg new file mode 100644 index 0000000..e765076 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/moon-jelly-thumb.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/octopus-red-med.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/octopus-red-med.jpg new file mode 100644 index 0000000..7c7d897 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/octopus-red-med.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/octopus-red-thumb.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/octopus-red-thumb.jpg new file mode 100644 index 0000000..4cdb8bb Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/octopus-red-thumb.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/octopus-white-med.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/octopus-white-med.jpg new file mode 100644 index 0000000..f38af83 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/octopus-white-med.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/octopus-white-thumb.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/octopus-white-thumb.jpg new file mode 100644 index 0000000..bec9ee6 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/octopus-white-thumb.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/olie-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/olie-s.jpg new file mode 100644 index 0000000..9bb9a17 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/olie-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/olie.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/olie.jpg new file mode 100644 index 0000000..c91be8e Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/olie.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/paris-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/paris-s.jpg new file mode 100644 index 0000000..f4ce9ec Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/paris-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/paris.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/paris.jpg new file mode 100644 index 0000000..b599c76 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/paris.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/parrot-popcorn-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/parrot-popcorn-s.jpg new file mode 100644 index 0000000..cae1408 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/parrot-popcorn-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/parrot-popcorn.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/parrot-popcorn.jpg new file mode 100644 index 0000000..57e02ff Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/parrot-popcorn.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/peacock-blue-med.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/peacock-blue-med.jpg new file mode 100644 index 0000000..758ed35 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/peacock-blue-med.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/peacock-blue-thumb.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/peacock-blue-thumb.jpg new file mode 100644 index 0000000..3aec8c4 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/peacock-blue-thumb.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/peacock-med.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/peacock-med.jpg new file mode 100644 index 0000000..13164b8 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/peacock-med.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/peacock-thumb.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/peacock-thumb.jpg new file mode 100644 index 0000000..fbd5412 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/peacock-thumb.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/peacock-white-thumb.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/peacock-white-thumb.jpg new file mode 100644 index 0000000..148006d Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/peacock-white-thumb.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/peakcock-white-med.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/peakcock-white-med.jpg new file mode 100644 index 0000000..f25a814 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/peakcock-white-med.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/prehensile-tailed-skink-thumb.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/prehensile-tailed-skink-thumb.jpg new file mode 100644 index 0000000..2d9c2b1 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/prehensile-tailed-skink-thumb.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/prehensile-tailed-skink.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/prehensile-tailed-skink.jpg new file mode 100644 index 0000000..3573943 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/prehensile-tailed-skink.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/prehensile-tailed-skink2-thumb.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/prehensile-tailed-skink2-thumb.jpg new file mode 100644 index 0000000..9be6e41 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/prehensile-tailed-skink2-thumb.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/prehensile-tailed-skink2.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/prehensile-tailed-skink2.jpg new file mode 100644 index 0000000..0559845 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/prehensile-tailed-skink2.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/princess-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/princess-s.jpg new file mode 100644 index 0000000..d4521a3 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/princess-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/princess.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/princess.jpg new file mode 100644 index 0000000..370e4fd Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/princess.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/puppup-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/puppup-s.jpg new file mode 100644 index 0000000..5b89061 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/puppup-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/puppup.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/puppup.jpg new file mode 100644 index 0000000..efff187 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/puppup.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/purple-jellyfish-med.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/purple-jellyfish-med.jpg new file mode 100644 index 0000000..93af55f Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/purple-jellyfish-med.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/purple-jellyfish-thumb.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/purple-jellyfish-thumb.jpg new file mode 100644 index 0000000..d751856 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/purple-jellyfish-thumb.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/rainbow-lorikeet-med.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/rainbow-lorikeet-med.jpg new file mode 100644 index 0000000..9c72270 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/rainbow-lorikeet-med.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/rainbow-lorikeet-thumb.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/rainbow-lorikeet-thumb.jpg new file mode 100644 index 0000000..9003e0c Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/rainbow-lorikeet-thumb.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/reptiles_icon.gif b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/reptiles_icon.gif new file mode 100644 index 0000000..0ee4c52 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/reptiles_icon.gif differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/right.gif b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/right.gif new file mode 100644 index 0000000..89e7ba1 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/right.gif differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/rita-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/rita-s.jpg new file mode 100644 index 0000000..16d1692 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/rita-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/rita.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/rita.jpg new file mode 100644 index 0000000..f183f1c Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/rita.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/rockfish-med.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/rockfish-med.jpg new file mode 100644 index 0000000..005d708 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/rockfish-med.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/rockfish-thumb.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/rockfish-thumb.jpg new file mode 100644 index 0000000..e82c87d Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/rockfish-thumb.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/sabrina-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/sabrina-s.jpg new file mode 100644 index 0000000..508edb1 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/sabrina-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/sabrina.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/sabrina.jpg new file mode 100644 index 0000000..870c2f3 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/sabrina.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/sea-anemone-med.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/sea-anemone-med.jpg new file mode 100644 index 0000000..a18e30a Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/sea-anemone-med.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/sea-anemone-thumb.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/sea-anemone-thumb.jpg new file mode 100644 index 0000000..febadd3 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/sea-anemone-thumb.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/sea-nettle-jellyfish-med.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/sea-nettle-jellyfish-med.jpg new file mode 100644 index 0000000..c7329f4 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/sea-nettle-jellyfish-med.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/sea-nettle-jellyfish-thumb.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/sea-nettle-jellyfish-thumb.jpg new file mode 100644 index 0000000..3753577 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/sea-nettle-jellyfish-thumb.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/seller-thumb-g.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/seller-thumb-g.jpg new file mode 100644 index 0000000..a9c45e8 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/seller-thumb-g.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/seller-thumb.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/seller-thumb.jpg new file mode 100644 index 0000000..2b7adf1 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/seller-thumb.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/simba-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/simba-s.jpg new file mode 100644 index 0000000..93e78ee Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/simba-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/simba.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/simba.jpg new file mode 100644 index 0000000..cdbb5fb Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/simba.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/splash.gif b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/splash.gif new file mode 100644 index 0000000..cdae47c Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/splash.gif differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/spotted-jellyfish-med.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/spotted-jellyfish-med.jpg new file mode 100644 index 0000000..6c1e407 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/spotted-jellyfish-med.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/spotted-jellyfish-thumb.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/spotted-jellyfish-thumb.jpg new file mode 100644 index 0000000..991392d Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/spotted-jellyfish-thumb.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/thaicat-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/thaicat-s.jpg new file mode 100644 index 0000000..49898fb Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/thaicat-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/thaicat.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/thaicat.jpg new file mode 100644 index 0000000..eb43a52 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/thaicat.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/thaidog-s.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/thaidog-s.jpg new file mode 100644 index 0000000..c918e36 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/thaidog-s.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/thaidog.jpg b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/thaidog.jpg new file mode 100644 index 0000000..f5063e3 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/thaidog.jpg differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/uncheck_all.gif b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/uncheck_all.gif new file mode 100644 index 0000000..39fa7ba Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/uncheck_all.gif differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/us_flag.gif b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/us_flag.gif new file mode 100644 index 0000000..52bc595 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/us_flag.gif differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/zh_flag.gif b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/zh_flag.gif new file mode 100644 index 0000000..0393bc1 Binary files /dev/null and b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/zh_flag.gif differ diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/index-ajax.jsp b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/index-ajax.jsp new file mode 100644 index 0000000..9ce0b8d --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/index-ajax.jsp @@ -0,0 +1,239 @@ +<%-- Copyright 2006 Sun Microsystems, Inc. All rights reserved. You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at: http://developer.sun.com/berkeley_license.html +$Id: index.jsp,v 1.17 2007/03/15 23:19:46 basler Exp $ --%> +<%@page contentType="text/html"%> +<%@page pageEncoding="UTF-8"%> +<%@page import="java.util.*, com.sun.javaee.blueprints.petstore.model.CatalogFacade, com.sun.javaee.blueprints.petstore.model.Tag"%> + +<% +try { + CatalogFacade cf = (CatalogFacade)config.getServletContext().getAttribute("CatalogFacade"); + List<Tag> tags=cf.getTagsInChunk(0, 12); + // since top 20 come from database or desending refCount order, need to reorder by tag name + Collections.sort(tags, new Comparator() { + public int compare(Object one, Object two) { + int cc=((Tag)two).getTag().compareTo(((Tag)one).getTag()); + return (cc < 0 ? 1 : cc > 0 ? -1 : 0); + } + }); +%> + +<html> + <head> + <meta http-equiv="Content-Type" content="text/html;charset=utf-8" > + <title>Java Pet Store Reference Application</title> + <script type="text/javascript" src="./common.js"></script> + <link type="text/css" rel="stylesheet" href="./tag.css"/> + <script type="text/javascript"> + //var djConfig = {isDebug: true }; + </script> + </head> + <body> + + <jsp:include page="banner.jsp" /> + <script> + dojo.require("dojo.widget.FisheyeList"); + dojo.require("dojo.io.*"); + dojo.require("dojo.io.ScriptSrcIO"); + //transport: "ScriptSrcTransport", + //url: "http://localhost:8080/petstore/downloadAd.json", + + function browse(category) { + window.location.href="${pageContext.request.contextPath}/faces/catalog.jsp?catid=" + category; + + } + + + function debugProperties(namex) { + var listx=""; + var ob=namex; + for(xx in ob) { + listx += xx + " = " + ob[xx] + "<br/>" + } + //document.write(listx); + alert(listx); + } + + function checkAdPage() { + var bindArgs = { + //url: "https://blueprints.dev.java.net/petstore/downloadAd.json", + //url: "http://localhost:8080/petstore/downloadAd.json", + url: "http://search.yahooapis.com/ImageSearchService/V1/imageSearch?appid=YahooDem...", + transport: "ScriptSrcTransport", + jsonParamName: "callback", + mimetype: "text/json", + load: function(type, data, event, kwArgs) { + /* type will be "load", data will be response data, event will null, and kwArgs are the keyword arguments used in the dojo.io.bind call. */ + alert("load = " + data.ResultSet.totalResultsAvailable); + //debugProperties(data); + //document.getElementById("downloadAds").innerHTML=data.downloadxx; + + + }, + error: function(type, data, event, kwArgs) { + /* type will be "error", data will be response data, event will null, and kwArgs are the keyword arguments used in the dojo.io.bind call. */ + alert("error"); + }, + timeout: function() { + /* Called if there is a timeout */ + alert("timeout"); + }, + timeoutSeconds: 10}; + // dispatch the request + dojo.io.bind(bindArgs); + } + + function callback() { + alert("callback"); + } + + function returnFunctionx(type, data, evt) { + // statically setup popup for simple case + // check return of the dojo call to make sure it is valid + if (evt.readyState == 4) { + if (evt.status == 200) { + alert("data = " + data.downloadxx); + //document.getElementById("downloadAds").innerHTML=data; + document.getElementById("downloadAds").innerHTML=data.downloadxx; + } + } + } + + function testit() { + testx={download:"test", textx:"it"}; + alert("test = " + testx.download); + } + + + </script> + <span onclick="checkAdPage();">test it</span> + + + <table bgcolor="white"> + <tr> + <td valign="top"> + <div class="outerbar" style="width: 200px"> + + <div dojoType="FisheyeList" + itemWidth="170" itemHeight="50" + itemMaxWidth="340" itemMaxHeight="100" + orientation="vertical" + effectUnits="2" + itemPadding="10" + attachEdge="top" + labelEdge="bottom" + enableCrappySvgSupport="false"> + + <div dojoType="FisheyeListItem" onClick="browse('Dogs');" + iconsrc="${pageContext.request.contextPath}/images/dogs_icon.gif"> + </div> + + <div dojoType="FisheyeListItem" onClick="browse('Cats');" + iconsrc="${pageContext.request.contextPath}/images/cats_icon.gif"> + </div> + + <div dojoType="FisheyeListItem" onClick="browse('Birds');" + iconsrc="${pageContext.request.contextPath}/images/birds_icon.gif"> + </div> + + <div dojoType="FisheyeListItem" onClick="browse('Fish');" + iconsrc="${pageContext.request.contextPath}/images/fish_icon.gif"> + </div> + + <div dojoType="FisheyeListItem" onClick="browse('Reptiles');" + iconsrc="${pageContext.request.contextPath}/images/reptiles_icon.gif"> + </div> + </div> + + </div> + </td> + <td valign="top" style="width: 400px"> + <div id="bodyCenter"> + <table valign="top" id="bodyTable" border="0"> + <tr> + <td> + <map name="petmap"> + <area onmouseover="javascript:this.style.cursor='pointer';" onclick="browse('Birds')" + alt="Birds" + coords="72,2,280,250"> + <area onmouseover="javascript:this.style.cursor='pointer';" onclick="browse('Fish')" + alt="Fish" + coords="2,180,72,250"> + <area onmouseover="javascript:this.style.cursor='pointer';" onclick="browse('Dogs')" + alt="Dogs" + coords="60,250,130,320"> + <area onmouseover="javascript:this.style.cursor='pointer';" onclick="browse('Reptiles')" + alt="Reptiles" + coords="140,270,210,340"> + <area onmouseover="javascript:this.style.cursor='pointer';" onclick="browse('Cats')" + alt="Cats" + coords="225,240,295,310"> + <area onmouseover="javascript:this.style.cursor='pointer';" onclick="browse('Birds')" + alt="Birds" + coords="280,180,350,250"> + </map> + + <img src="${pageContext.request.contextPath}/images/splash.gif" + alt="Pet Selection Map" + usemap="#petmap" + width="350" + height="355" + border="0"> + </td> + </tr> + </table> + + </div> + </td> + <td style="vertical-align:top;"> + <div style="border-style: double; width:100%;"> + <table border="0"> + <tr> + <th colspan="2" style="text-align:center">Most Popular Tags</th> + </tr> + <tr> +<% + String style=null; + int refx=0, ii=0; + for(Tag tag : tags) { + refx=tag.getRefCount() / 5; + if(refx >= 3) { + style="xxlarge"; + } else if(refx == 2) { + style="xlarge"; + } else if(refx == 1) { + style="large"; + } else { + style="medium"; + } + + if((ii % 2) == 0) out.println("</tr>\n<tr>"); + out.println("<td class='tagCell' style='text-align: center'><a href='./tag.jsp?tag=" + + tag.getTag() + "'><span class='" + style +"'>" + tag.getTag() + "</span></a></td>"); + ii++; + } +%> + </tr> + </table> + </div> + </td> + <td valign="top" style="vertical-align:top; width:250px;"> + <div id="downloadAds"> + <jsp:include page="download.jsp" /> + </div> + </td> + </tr> + </table> + + <div style="position: absolute; visibility: hidden;z-index:5" id="menu-popup"> + <table id="completeTable" class="popupTable" ></table> + </div> + + <br/><br/> + <jsp:include page="footer.jsp" /> + </body> +</html> +<% + } catch(Exception e) { + e.printStackTrace(); + } +%> diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/index.html b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/index.html new file mode 100644 index 0000000..8c5ca1b --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/index.html @@ -0,0 +1,117 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html> +<head> + <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> + <title>Java Pet Store Reference Application, 2.0 Early Access</title> +</head> +<body> +<hr> +<h1>Java Pet Store Reference Application, 2.0 Early Access</h1> +<h2><a href="./faces/index.jsp">Enter the Store</a></h2> +The Java Pet Store Reference Application is a sample application +brought to +you by the <a href="http://blueprints.dev.java.net/">Java BluePrints</a> +program at <a href="http://sun.com">Sun Microsystems</a>. +This application is designed to illustrate how the Java EE 5 Platform +can be used to develop an AJAX-enabled Web 2.0 application. The +application comes with full source-code available under a +BSD-style license, so you can experiment with it and use it in your own +applications. <br> +<br> +<a href="#try">Try the Petstore Demo</a><br> +<a href="#learn">Learn more about features in Java Petstore</a><br> +<a href="#contributors">Show appreciation for Pet Store image +contributors</a><br> +<a href="#about">About BluePrints</a> +<h2><a name="try"></a>Try the Pet Store Demo</h2> +Now that you have the application deployed, you can use it and try out +the features. You can browse the catalog of pets for sale, sell your +own pets on the store, search for pets by location using Google maps, +view the RSS news bar for BluePrints news, and more.<a + href="./faces/index.jsp">Enter the Store</a> +<h2><a name="features"></a>Learn More About Features in Java Petstore</h2> +<p>Here are some of the features of this application. For a detailed +description of the features in the Java Pet +Store Reference application, please refer to the article at <a + href="http://java.sun.com/developer/technicalArticles/J2EE/petstore/%22%3Ehttp://j...</a><a + href="http://java.sun.com/developer/technicalArticles/J2EE/petstore/%22%3E</a><b> +</b></p> +<ol> + <li>Using AJAX for single-page interactive Web applications: The +application is designed to be a single-page application where the user +never leaves the page. Different sections of the page are dynamically +loaded based on the user actions. These sections are loaded +asynchronously to avoid any browser refreshes, and to give a richer +interactive user-experience. </li> + <li>Mash-ups with Google maps: The petstore uses a mashup with +Google's Map service, alongwith Yahoo's Geo-coder service to allow +users to see the available pets in a neighborhood. </li> + <li>Community-created content: The application allows a user to add a +pet for sale or adoption on the Website. The seller uploads </li> + <ol> + <li>Using Captchas to discourage spam in the community created +content: Whenever a website allows its users to add content, it needs +to build mechanisms to discourage placement of spurious content on its +Website through automated mechanisms. We demonstrate how captchas can +be used for this purpose. </li> + <li>Community rated content: Each item in the petstore website can +be rated by the users </li> + <li>Payments through PayPal: The application provides a meeting +ground for +buyers and sellers of pets. The application uses the PayPal service to +allow sellers to accept payments.</li> + </ol> + <li>Integration of an RSS feed: The website integrates an RSS feed of +news items coming out the Java BluePrints website. The </li> + <li>Integration of a search engine: The application integrates +Apache Lucene search engine to handle all website searches. </li> +</ol> +This application also demonstrate the use of various features of +the Java EE 5 platform such as: <br> +<ol> + <li>JavaServer Faces: Many of the AJAX features are implemented as +reusable JavaServer Faces components. </li> + <li>Java Persistence API: The application uses Java Persistence APIs +to create an object/relational mapping layer. </li> + <li>Dependency Injection: The application uses dependency injection +instead of deployment descriptors.</li> +</ol> +See the <a + href="https://blueprints.dev.java.net/petstore/architecture.html%22%3EPet +Store Architecure document</a> for more detail. +<h2><a name="contributors"></a>Show Appreciation for Pet Store Image +Contributors</h2> +<p>For many images in the Java Petstore, some organizations and people +were kind enough to give us permission to photograph their animals or +even give us photos to use in the Java Petstore. See the <a + href="https://blueprints.dev.java.net/petstore/imagecontributors.html%22%3E +image contributors </a> page for a more detail on these friends of the +animals. +</p> +<h2><a name="about"></a>About Java BluePrints</h2> +<p>The Java BluePrints program defines the application programming +model for the Java EE™ platform. It provides best practice guidelines +and +architectural recommendations for real-world application scenarios to +enable developers to build portable, scalable, and robust applications +using the Java EE technologies.<br> +<br> +Some other popular projects from Java BluePrints are <a + href="http://blueprints.dev.java.net/bpcatalog/%22%3EJava BluePrints +Solutions Catalog</a>, <a target="_blank" + href="https://blueprints.dev.java.net/adventurebuilder/%22%3EJava +Adventure Builder Reference</a> application, <a target="_blank" + href="http://java.sun.com/blueprints/guidelines/designing_webservices/%22%3EDesign... +Web Services with the J2EE(TM) 1.4 Platform : JAX-RPC, SOAP, and XML +Technologies</a> book, and the <a target="_blank" + href="http://java.sun.com/blueprints/guidelines/designing_enterprise_applications_...<span + class="body"><span class="title">Designing +Enterprise Applications with the J2EE Platform, Second Edition</span></span></a> +book. You can access these projects and other content from Java +BluePrints by visiting the <a target="_blank" + href="http://java.sun.com/reference/blueprints/index.html%22%3EJava +BluePrints website</a>. </p> +<hr noshade="noshade">Copyright © 2007 Sun Microsystems, +Inc. All Rights Reserved. +</body> +</html> diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/index.jsp b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/index.jsp new file mode 100644 index 0000000..ab59139 --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/index.jsp @@ -0,0 +1,164 @@ +<%-- Copyright 2006 Sun Microsystems, Inc. All rights reserved. You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at: http://developer.sun.com/berkeley_license.html +$Id: index.jsp,v 1.20 2007/03/16 20:18:59 basler Exp $ --%> +<%@page contentType="text/html"%> +<%@page pageEncoding="UTF-8"%> +<%@page import="java.util.*, com.sun.javaee.blueprints.petstore.model.CatalogFacade, com.sun.javaee.blueprints.petstore.model.Tag"%> + +<% +try { + CatalogFacade cf = (CatalogFacade)config.getServletContext().getAttribute("CatalogFacade"); + List<Tag> tags=cf.getTagsInChunk(0, 12); + // since top 20 come from database or desending refCount order, need to reorder by tag name + Collections.sort(tags, new Comparator() { + public int compare(Object one, Object two) { + int cc=((Tag)two).getTag().compareTo(((Tag)one).getTag()); + return (cc < 0 ? 1 : cc > 0 ? -1 : 0); + } + }); +%> + +<html> + <head> + <meta http-equiv="Content-Type" content="text/html;charset=utf-8" > + <title>Java Pet Store Reference Application</title> + <link type="text/css" rel="stylesheet" href="./tag.css"/> + </head> + <body> + + <jsp:include page="banner.jsp" /> + <script> + dojo.require("dojo.widget.FisheyeList"); + function browse(category) { + window.location.href="${pageContext.request.contextPath}/faces/catalog.jsp?catid=" + category; + } + </script> + <table bgcolor="white"> + <tr> + <td valign="top"> + <div class="outerbar" style="width: 200px"> + + <div dojoType="FisheyeList" + itemWidth="170" itemHeight="50" + itemMaxWidth="340" itemMaxHeight="100" + orientation="vertical" + effectUnits="2" + itemPadding="10" + attachEdge="top" + labelEdge="bottom" + enableCrappySvgSupport="false"> + + <div dojoType="FisheyeListItem" onClick="browse('Dogs');" + iconsrc="${pageContext.request.contextPath}/images/dogs_icon.gif"> + </div> + + <div dojoType="FisheyeListItem" onClick="browse('Cats');" + iconsrc="${pageContext.request.contextPath}/images/cats_icon.gif"> + </div> + + <div dojoType="FisheyeListItem" onClick="browse('Birds');" + iconsrc="${pageContext.request.contextPath}/images/birds_icon.gif"> + </div> + + <div dojoType="FisheyeListItem" onClick="browse('Fish');" + iconsrc="${pageContext.request.contextPath}/images/fish_icon.gif"> + </div> + + <div dojoType="FisheyeListItem" onClick="browse('Reptiles');" + iconsrc="${pageContext.request.contextPath}/images/reptiles_icon.gif"> + </div> + </div> + + </div> + </td> + <td valign="top" style="width: 400px"> + <div id="bodyCenter"> + <table valign="top" id="bodyTable" border="0"> + <tr> + <td> + <map name="petmap"> + <area onmouseover="javascript:this.style.cursor='pointer';" onclick="browse('Birds')" + alt="Birds" + coords="72,2,280,250"> + <area onmouseover="javascript:this.style.cursor='pointer';" onclick="browse('Fish')" + alt="Fish" + coords="2,180,72,250"> + <area onmouseover="javascript:this.style.cursor='pointer';" onclick="browse('Dogs')" + alt="Dogs" + coords="60,250,130,320"> + <area onmouseover="javascript:this.style.cursor='pointer';" onclick="browse('Reptiles')" + alt="Reptiles" + coords="140,270,210,340"> + <area onmouseover="javascript:this.style.cursor='pointer';" onclick="browse('Cats')" + alt="Cats" + coords="225,240,295,310"> + <area onmouseover="javascript:this.style.cursor='pointer';" onclick="browse('Birds')" + alt="Birds" + coords="280,180,350,250"> + </map> + + <img src="${pageContext.request.contextPath}/images/splash.gif" + alt="Pet Selection Map" + usemap="#petmap" + width="350" + height="355" + border="0"> + </td> + </tr> + </table> + + </div> + </td> + <td style="vertical-align:top;"> + <div style="border-style: double; width:100%;"> + <table border="0"> + <tr> + <th colspan="2" style="text-align:center">Most Popular Tags</th> + </tr> + <tr> +<% + String style=null; + int refx=0, ii=0; + for(Tag tag : tags) { + refx=tag.getRefCount() / 5; + if(refx >= 3) { + style="xxlarge"; + } else if(refx == 2) { + style="xlarge"; + } else if(refx == 1) { + style="large"; + } else { + style="medium"; + } + + if((ii % 2) == 0) out.println("</tr>\n<tr>"); + out.println("<td class='tagCell' style='text-align: center'><a href='./tag.jsp?tag=" + + tag.getTag() + "'><span class='" + style +"'>" + tag.getTag() + "</span></a></td>"); + ii++; + } +%> + </tr> + </table> + </div> + </td> + <td style="vertical-align:top; width:300px; text-align:right;"> + <div id="downloadAds"> + <jsp:include page="download.jsp" /> + </div> + </td> + </tr> + </table> + + <div style="position: absolute; visibility: hidden;z-index:5" id="menu-popup"> + <table id="completeTable" class="popupTable" ></table> + </div> + + <br/><br/> + <jsp:include page="footer.jsp" /> + + </body> +</html> +<% + } catch(Exception e) { + e.printStackTrace(); + } +%> diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/index_a.jsp b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/index_a.jsp new file mode 100644 index 0000000..54f30ce --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/index_a.jsp @@ -0,0 +1,194 @@ +<%-- Copyright 2006 Sun Microsystems, Inc. All rights reserved. You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at: http://developer.sun.com/berkeley_license.html +$Id: index.jsp,v 1.18 2007/03/16 15:29:15 basler Exp $ --%> +<%@page contentType="text/html"%> +<%@page pageEncoding="UTF-8"%> +<%@page import="java.util.*, com.sun.javaee.blueprints.petstore.model.CatalogFacade, com.sun.javaee.blueprints.petstore.model.Tag"%> + +<% +try { + CatalogFacade cf = (CatalogFacade)config.getServletContext().getAttribute("CatalogFacade"); + List<Tag> tags=cf.getTagsInChunk(0, 12); + // since top 20 come from database or desending refCount order, need to reorder by tag name + Collections.sort(tags, new Comparator() { + public int compare(Object one, Object two) { + int cc=((Tag)two).getTag().compareTo(((Tag)one).getTag()); + return (cc < 0 ? 1 : cc > 0 ? -1 : 0); + } + }); +%> + +<html> + <head> + <meta http-equiv="Content-Type" content="text/html;charset=utf-8" > + <title>Java Pet Store Reference Application</title> + <link type="text/css" rel="stylesheet" href="./tag.css"/> + <script type="text/javascript" src="https://blueprints.dev.java.net/petstore/downloadAd.js"></script> + </head> + <body onload="alterDownloadAd()"> + + <jsp:include page="banner.jsp" /> + <script> + dojo.require("dojo.widget.FisheyeList"); + function browse(category) { + window.location.href="${pageContext.request.contextPath}/faces/catalog.jsp?catid=" + category; + } + + function alterDownloadAd() { + if(typeof checkAdPage != "undefined") { + var textx=checkAdPage(); + if(typeof textx != "undefined") { + document.getElementById("downloadAds").innerHTML=textx; + } + } + } + + + </script> + <table bgcolor="white"> + <tr> + <td valign="top"> + <div class="outerbar" style="width: 200px"> + + <div dojoType="FisheyeList" + itemWidth="170" itemHeight="50" + itemMaxWidth="340" itemMaxHeight="100" + orientation="vertical" + effectUnits="2" + itemPadding="10" + attachEdge="top" + labelEdge="bottom" + enableCrappySvgSupport="false"> + + <div dojoType="FisheyeListItem" onClick="browse('Dogs');" + iconsrc="${pageContext.request.contextPath}/images/dogs_icon.gif"> + </div> + + <div dojoType="FisheyeListItem" onClick="browse('Cats');" + iconsrc="${pageContext.request.contextPath}/images/cats_icon.gif"> + </div> + + <div dojoType="FisheyeListItem" onClick="browse('Birds');" + iconsrc="${pageContext.request.contextPath}/images/birds_icon.gif"> + </div> + + <div dojoType="FisheyeListItem" onClick="browse('Fish');" + iconsrc="${pageContext.request.contextPath}/images/fish_icon.gif"> + </div> + + <div dojoType="FisheyeListItem" onClick="browse('Reptiles');" + iconsrc="${pageContext.request.contextPath}/images/reptiles_icon.gif"> + </div> + </div> + + </div> + </td> + <td valign="top" style="width: 400px"> + <div id="bodyCenter"> + <table valign="top" id="bodyTable" border="0"> + <tr> + <td> + <map name="petmap"> + <area onmouseover="javascript:this.style.cursor='pointer';" onclick="browse('Birds')" + alt="Birds" + coords="72,2,280,250"> + <area onmouseover="javascript:this.style.cursor='pointer';" onclick="browse('Fish')" + alt="Fish" + coords="2,180,72,250"> + <area onmouseover="javascript:this.style.cursor='pointer';" onclick="browse('Dogs')" + alt="Dogs" + coords="60,250,130,320"> + <area onmouseover="javascript:this.style.cursor='pointer';" onclick="browse('Reptiles')" + alt="Reptiles" + coords="140,270,210,340"> + <area onmouseover="javascript:this.style.cursor='pointer';" onclick="browse('Cats')" + alt="Cats" + coords="225,240,295,310"> + <area onmouseover="javascript:this.style.cursor='pointer';" onclick="browse('Birds')" + alt="Birds" + coords="280,180,350,250"> + </map> + + <img src="${pageContext.request.contextPath}/images/splash.gif" + alt="Pet Selection Map" + usemap="#petmap" + width="350" + height="355" + border="0"> + </td> + </tr> + </table> + + </div> + </td> + <td style="vertical-align:top;"> + <div style="border-style: double; width:100%;"> + <table border="0"> + <tr> + <th colspan="2" style="text-align:center">Most Popular Tags</th> + </tr> + <tr> +<% + String style=null; + int refx=0, ii=0; + for(Tag tag : tags) { + refx=tag.getRefCount() / 5; + if(refx >= 3) { + style="xxlarge"; + } else if(refx == 2) { + style="xlarge"; + } else if(refx == 1) { + style="large"; + } else { + style="medium"; + } + + if((ii % 2) == 0) out.println("</tr>\n<tr>"); + out.println("<td class='tagCell' style='text-align: center'><a href='./tag.jsp?tag=" + + tag.getTag() + "'><span class='" + style +"'>" + tag.getTag() + "</span></a></td>"); + ii++; + } +%> + </tr> + </table> + </div> + </td> + <td style="vertical-align:top; width:250px; text-align:right;"> + <div id="downloadAds"> + <div id="downloadAds" style="text-align:center; border-style:none; width:100%;"> + <table style="width:100%"> + <tr> + <td style="text-align:center;"> + <a href="http://java.sun.com/javaee/downloads/index.jsp" target="downloads"><img style="border:none" src="./images/ad-sdk.jpg" alt="Download Java EE 5 SDK"/></a> + </td> + </tr> + <tr> + <td style="text-align:center;"> + <a href="http://www.netbeans.org/downloads/index.html" target="downloads"><img style="border:none" src="./images/ad-netbeans.jpg" alt="Download Netbeans IDE"/></a> + </td> + </tr> + <tr> + <td style="text-align:center;"> + <a href="http://java.com/en/download/index.jsp" target="downloads"><img style="border:none" src="./images/ad-jre.jpg" alt="Download Java SE"/></a> + </td> + </tr> + </table> + </div> + </div> + </td> + </tr> + </table> + + <div style="position: absolute; visibility: hidden;z-index:5" id="menu-popup"> + <table id="completeTable" class="popupTable" ></table> + </div> + + <br/><br/> + <jsp:include page="footer.jsp" /> + + </body> +</html> +<% + } catch(Exception e) { + e.printStackTrace(); + } +%> diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/jsonTest.jsp b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/jsonTest.jsp new file mode 100644 index 0000000..d2fd4c5 --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/jsonTest.jsp @@ -0,0 +1,53 @@ +<%@page contentType="text/html"%> +<%@page pageEncoding="UTF-8"%> +<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> +<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> + +<html> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> + <title>JSON Test Page</title> + <script type="text/javascript" src="${pageContext.request.contextPath}/faces/static/META-INF/dojo/bpcatalog/dojo.js"></script> + + <script type="text/javascript"> + function getJSON() { + // get data and send to controller servlet + var bindArgs = { + url: "${pageContext.request.contextPath}/catalog?command=items&pid=feline01&start=0&length=2&format=json", + mimetype: "text/json", + error: function(){ alert("error")}, + load: callbackx + }; + + dojo.io.bind(bindArgs); + } + + function callbackx(type, data, evt) { + // check successful response + if (evt.readyState == 4) { + if (evt.status == 200) { + var prodsx=data.products; + rep="Products:<br>"; + for(ii=0; ii < prodsx.length; ii++) { + rep += prodsx[ii].name + "<br/>"; + } + rep+="<br>"; + document.getElementById("testResult").innerHTML=rep; + } + } + } + + </script> + + </head> + <body> + + <h1>JSON Test Page</h1> + <span onclick="getJSON();"> GET DATA </span><br/><br/> + + <div id="testResult"> + This should be populated with result. If not, look at the error console for errors. + </div> + + </body> +</html> diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/lookup.jsp b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/lookup.jsp new file mode 100644 index 0000000..b634b42 --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/lookup.jsp @@ -0,0 +1,36 @@ +<%-- Copyright 2006 Sun Microsystems, Inc. All rights reserved. You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at: http://developer.sun.com/berkeley_license.html +$Id: lookup.jsp,v 1.7 2007/01/19 21:47:31 basler Exp $ --%> + +<%@page contentType="text/xml"%> +<%@page pageEncoding="UTF-8"%> +<%@page import="com.sun.javaee.blueprints.petstore.model.CatalogFacade, com.sun.javaee.blueprints.petstore.model.Item"%> + +<% + String itemId=request.getParameter("itemId"); + String popupView=request.getParameter("popupView"); + + try { + ServletContext context=config.getServletContext(); + CatalogFacade cf=(CatalogFacade)context.getAttribute("CatalogFacade"); + Item item=cf.getItem(itemId); + + if(itemId != null) { + out.println("<response>"); + out.println("<name>" + item.getName() + "</name>"); + String tmp=null; + if(popupView != null && popupView.equals("2")) { + tmp=item.getAddress().addressToString(); + } else { + tmp=item.getDescription(); + } + out.println("<description><![CDATA[" + tmp + "]]></description>"); + out.println("<price>" + java.text.NumberFormat.getCurrencyInstance(java.util.Locale.US).format(item.getPrice()) + "</price>"); + out.println("<image>" + request.getContextPath() + "/ImageServlet/" + item.getImageThumbURL() + "</image>"); + out.println("</response>"); + out.flush(); + } + } catch(Exception ee) { + ee.printStackTrace(); + } + +%> diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/main.htmf b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/main.htmf new file mode 100644 index 0000000..b207a5a --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/main.htmf @@ -0,0 +1,36 @@ +<!-- Copyright 2006 Sun Microsystems, Inc. All rights reserved. You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at: http://developer.sun.com/berkeley_license.html +$Id: main.htmf,v 1.3 2006/05/03 22:00:33 inder Exp $ --> + + <table valign="top" id="bodyTable" border="0"> + <tr> + <td> + <map name="petmap"> + <area onmouseover="javascript:this.style.cursor='pointer';" onclick="loadCategory('BIRDS')" + alt="Birds" + coords="72,2,280,250"> + <area onmouseover="javascript:this.style.cursor='pointer';" onclick="loadCategory('FISH')" + alt="Fish" + coords="2,180,72,250"> + <area onmouseover="javascript:this.style.cursor='pointer';" onclick="loadCategory('DOGS')" + alt="Dogs" + coords="60,250,130,320"> + <area onmouseover="javascript:this.style.cursor='pointer';" onclick="loadCategory('REPTILES')" + alt="Reptiles" + coords="140,270,210,340"> + <area onmouseover="javascript:this.style.cursor='pointer';" onclick="loadCategory('CATS')" + alt="Cats" + coords="225,240,295,310"> + <area onmouseover="javascript:this.style.cursor='pointer';" onclick="loadCategory('BIRDS')" + alt="Birds" + coords="280,180,350,250"> + </map> + + <img src="images/splash.gif" + alt="Pet Selection Map" + usemap="#petmap" + width="350" + height="355" + border="0"> + </td> + </tr> + </table> \ No newline at end of file diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/main.js b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/main.js new file mode 100644 index 0000000..b8de8fc --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/main.js @@ -0,0 +1,21 @@ +/* Copyright 2006 Sun Microsystems, Inc. All rights reserved. You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at: http://developer.sun.com/berkeley_license.html +$Id: main.js,v 1.9 2006/05/03 22:00:33 inder Exp $ */ + +var isIE; +var bodyRowText; + +dojo.require("dojo.widget.FisheyeList"); +init(); + +function browse(category) { + window.location.href="catalog.jsp?catid=" + category; +} + +function loadPetstore() { + init(); + showMain(); +} + +function init() { + if (navigator.userAgent.indexOf("IE") != -1) isIE = true; +} diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/map.jsp b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/map.jsp new file mode 100644 index 0000000..c2673c9 --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/map.jsp @@ -0,0 +1,143 @@ +<%-- Copyright 2006 Sun Microsystems, Inc. All rights reserved. You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at: http://developer.sun.com/berkeley_license.html +$Id: map.jsp,v 1.20 2006/11/02 00:34:49 basler Exp $ --%> + +<%@page contentType="text/html"%> +<%@page pageEncoding="UTF-8"%> +<%@page import="com.sun.javaee.blueprints.petstore.model.CatalogFacade, com.sun.javaee.blueprints.petstore.model.Item, com.sun.javaee.blueprints.petstore.mapviewer.MapBean, com.sun.javaee.blueprints.components.ui.mapviewer.MapMarker"%> +<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> +<%@taglib uri="http://java.sun.com/jsf/html" prefix="h" %> +<%@taglib uri="http://java.sun.com/jsf/core" prefix="f" %> +<%@taglib prefix="ui" uri="http://java.sun.com/blueprints/ui" %> + +<html> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> + <title>Map Display</title> + </head> + <body> + <jsp:include page="banner.jsp" /> + <br> + <center> + <table border="1" cellspacing="5px" cellpadding="5px" + style="border-style:double; border-color:darkgreen; padding:5px"> + <tr> + <td valign="top" align="center" width="200px"> + <table border="0"> + <c:if test="${!empty sessionScope.MapBean.locations}"> + <tr> + <th> + <u>${sessionScope.MapBean.locationCount} Items Displayed</u> + </th> + </tr> + <tr> + <td> + <ul> +<% + try { + // need to use scriptlet to preform the reconciliation of items to map coords + // this way I don't have to create a new wrapper object + MapBean mapBean=(MapBean)session.getAttribute("MapBean"); + MapMarker[] mapMarkers=(MapMarker[])mapBean.getLocations(); + java.util.List<Item> items=mapBean.getItems(); + Item itemxx=null; + String popupOptions=null; + for(int ii=0; ii < mapMarkers.length; ii++) { + + //System.out.println("loop - " + ii + " - " + mapBean.getCenterAddress()); + if(mapBean.getCenterAddress() != null && !mapBean.getCenterAddress().equals("")) { + // center point is set to the first mapMarker, items are off by one + if(ii > 0) { + // reconcile correct mapMarkers with items list + itemxx=items.get(ii - 1); + popupOptions="onmouseover="bpui.popup.show('pop1', event, '" + itemxx.getItemID() + "')" onmouseout="bpui.popup.hide('pop1')""; + } else { + // first item of mapMarker is centerpoint, so no corresponding item, also no popup on mouseover + itemxx=null; + popupOptions=""; + } + } else { + // no center point items should be 1-to-1 with mappedMarkers + itemxx=items.get(ii); + popupOptions="onmouseover="bpui.popup.show('pop1', event, '" + itemxx.getItemID() + "')" onmouseout="bpui.popup.hide('pop1')""; + } +%> + <li> + <a href="javascript:mapViewerx.openInfoWindowHtml(new GPoint(<%= mapMarkers[ii].getLongitude() %>,<%= mapMarkers[ii].getLatitude() %>), '<%= mapMarkers[ii].getMarkup() %>');" <%= popupOptions %>> + <%= mapBean.changeSpaces((itemxx == null) ? mapMarkers[ii].getMarkup() : "<b>" + itemxx.getName() + "</b>") %> + </a> +<% + if(itemxx != null) { + // remove these links for center point entry +%> + <a href="${pageContext.request.contextPath}/faces/catalog.jsp?pid=<%= itemxx.getProductID() %>&itemId=<%= itemxx.getItemID() %>" alt="Go to Detailed Catalog Page"> + <i>(detail)</i> + </a> + + <br/> + <a href="javascript:mapViewerx.openInfoWindowHtml(new GPoint(<%= mapMarkers[ii].getLongitude() %>, <%= mapMarkers[ii].getLatitude() %>), '<%= mapMarkers[ii].getMarkup() %>');" <%= popupOptions %>> + <font size="-1"><%= mapBean.changeSpaces((itemxx == null) ? mapMarkers[ii].getMarkup() : itemxx.getAddress().addressToString()) %></font> + </a> +<% + } +%> + </li> + <% + } + } catch(Exception ee) { + ee.printStackTrace(); + + } + %> + </ul> + <td> + </tr> + </c:if> + </table> + </td> + <td valign="top"> + <f:view> + <ui:popupTag id="pop1" xmlHttpRequestURL="../lookup.jsp?itemId=" + elementNamePairs="name=value1,description=value2,price=value3,image=imageId"> + <!-- Used as spaces to center the table, this could be done programmatically, + but browser diff, so I left it in the hands of the component user. The image is located + in the component jar so for retrieval, push it through the faces servlet --> + <img id="spaceImage" height="10px" width="12px" src="${pageContext.request.contextPath}/faces/static/META-INF/popup/images/spacer.gif" align="left"> + <table border="0" width="270px" bgcolor="#ffffff" cellpadding="5" cellspacing="5"> + <tr> + <td align="left" valign="top"><b>Name:</b> + <span id="value1">Loading Data...</span></td> + </tr> + <tr> + <td align="left" valign="top"><b>Description:</b> + <span id="value2">Loading Data...</span></td> + </tr> + <tr> + <td align="left" valign="top"><b>Price:</b> + <span id="value3">Loading Data...</span></td> + </tr> + <tr> + <td colspan="2" align="center"><img name="image" id="imageId" src="" + alt="[Loading Image...]" border="2"/><br/><br/></td> + </tr> + </table> + </ui:popupTag> + + + <ui:mapViewer id="mapViewerx" center="#{MapBean.mapPoint}" info="#{MapBean.mapMarker}" + markers="#{MapBean.locations}" zoomLevel="#{MapBean.zoomLevel}" style="height: 500px; width: 700px"/> + + </f:view> + </td> + </tr> + </table> + <script type="text/javascript"> + bpui.mapviewer.createMapControl = function() { + return new GLargeMapControl(); + } + + </script> + <br/><br/> + </center> + <jsp:include page="footer.jsp" /> + </body> +</html> diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/mapAll.jsp b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/mapAll.jsp new file mode 100644 index 0000000..a3ae6dc --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/mapAll.jsp @@ -0,0 +1,65 @@ +<%-- Copyright 2006 Sun Microsystems, Inc. All rights reserved. You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at: http://developer.sun.com/berkeley_license.html +$Id: mapAll.jsp,v 1.14 2006/12/06 22:44:37 basler Exp $ --%> + +<%@page contentType="text/html"%> +<%@page pageEncoding="UTF-8"%> +<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> +<%@taglib uri="http://java.sun.com/jsf/html" prefix="h" %> +<%@taglib uri="http://java.sun.com/jsf/core" prefix="f" %> +<%@taglib prefix="ui" uri="http://java.sun.com/blueprints/ui" %> + +<html> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> + <title>Map Viewer Page</title> + </head> + <body> + <jsp:include page="banner.jsp" /> + <center> + <f:view> + + <h:form id="form1"> + <table border="1" cellpadding="5" cellspacing="5" style="border-style:double; width:600px; border-color:darkgreen; padding:5px"> + <tr> + <td colspan=3> + <i>Select the category whose items will be displayed in a Google map based on the Seller's address. + Optionally, enter a "Center Point Address" and "Area" to limit the search to a specific + area around the center point.</i> + </td> + </tr> + <tr> + <th align="right">Select Category to Map:</th> + <td align="center" colspan=2> + <h:selectOneRadio value="#{MapBean.category}" required="true"> + <f:selectItems value="#{MapBean.categories}"/> + </h:selectOneRadio> + </td> + </tr> + <tr> + <th align="right">Center Point Address:</th> + <td> + <h:inputText id="centerAddress" value="#{MapBean.centerAddress}" size="70"/> + <br/><small><i>For example: 4140 Network Circle, Santa Clara, CA, 95054</i></small> + </td> + </tr> + <tr> + <th align="right">Area (in Miles):</th> + <td> + <h:inputText id="radius" value="#{MapBean.radius}" size="5"/> + </td> + </tr> + <tr> + <td colspan="2" align="center"> + <h:commandButton action="#{MapBean.findAllByCategory}" id="submitCat" type="submit" value="Map Category"/> + </td> + </tr> + + </table> + <h:messages/> + </h:form> + </f:view> + + </center> + <jsp:include page="footer.jsp" /> + </body> +</html> diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/news.js b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/news.js new file mode 100644 index 0000000..5bcac34 --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/news.js @@ -0,0 +1,190 @@ + +dojo.require("dojo.io.*"); +dojo.require("dojo.event.*"); + +var bpuinews; +if (typeof bpuinews == "undefined") { + bpuinews = new Object(); +} + +bpuinews.RSS = function() { + var currentItem = 0; + var limitCharNum = 75; + var itemNum=0; + var rssData = null; + var prev; + var next; + var prevHit=false; + + this.getRssInJson = function (method, uri) { + prev = document.getElementById("previous"); + next = document.getElementById("next"); + dojo.event.connect(prev, "onclick", function(evt) {showPrevious();}); + dojo.event.connect(next, "onclick", function (evt) {showNext();}); + prev.disabled=true; + + var encodedURI = encodeURI(method + "?style=json&itemCount=0&url="+uri); + var bindArgs = { + url: encodedURI, + mimetype: "text/json", + load: function (type, data, http) { + handleJsonRss(data); + }, + error: function (t, e) { + dojo.debug("ERROR : " + e.message); + } + } + dojo.io.bind(bindArgs); + return false; + } + + function handleJsonRss(json) { + rssData = json; + itemNum = json.channel.item.length; + showNext(); + } + + function createUl(skip) { + var i; + var cp="<ul>\n"; + for (i = currentItem; i<currentItem + skip; i++) { + cp += "<li><b>"+decodeURL(rssData.channel.item[i].title)+"</b>\n"; + cp += "<p>" + decodeURL(rssData.channel.item[i].description) + "</p>\n</li>\n"; + } + cp += "</ul>\n"; + return cp; + } + + // Following funcs(showNext, showPrevious) should be connected to the button + // by dojo.event.connect. + function showNext() { + var skip = 5; + if (prevHit) { + currentItem = currentItem + skip; + prevHit = false; + } + var nextCurrentItem = currentItem + skip; + if (nextCurrentItem >= itemNum) { + skip = itemNum - currentItem; + // deactivate "next" button + next.disabled=true; + nextCurrentItem = currentItem; + } + // activate "previous" button + if (currentItem != 0) { + prev.disabled=false; + } + var cp = createUl(skip); + var elm = document.getElementById("news"); + elm.innerHTML = cp; + currentItem = nextCurrentItem; + } + + function showPrevious() { + prevHit = true; + var skip = 5; + currentItem = currentItem - skip; + if (currentItem <= 0) { + currentItem = 0; + // deactivate "previous" button + prev.disabled=true; + } + next.disabled=false; + var cp = createUl(skip); + var elm = document.getElementById("news"); + elm.innerHTML = cp; + } + + + /* Compatible function to java.net.URLDecoder.decode(). + * (decodeURI() is not compatible) + */ + function decodeURL(str){ + var targetStr=""; + var s, tmpStr, unicode, f; + // take a look at every char in the source str + var i, j; + for (i = 0; i < str.length; i++) { + s = str.charAt(i); + // handle WS, which is the most common char + if (s == "+") { + targetStr += " "; + } else { + if (s != "%") { + // Non-encoded char + targetStr += s; + } else{ + // encoding begin + unicode = 0; // uncode representation + f = 1; // flag to specify the escape sequence + while (true) { + tmpStr = ""; + // get the two HEX chars and put that in the temp string. If no char, that is not a HEX. + for (j = 0; j < 2; j++ ) { + tmptmpStr = str.charAt(++i); + if (((tmptmpStr >= "0") && (tmptmpStr <= "9")) || + ((tmptmpStr >= "a") && (tmptmpStr <= "f")) || + ((tmptmpStr >= "A") && (tmptmpStr <= "F"))) { + tmpStr += tmptmpStr; + } else { + --i; + break; + } + } + /* parse the HEX + * <= 0x7f : Single byte + * >=0xc0 && <=0xdf : Two bytes + * >=0xe0 && <=0xef : Three bytes + * >=0xf0 && <=0xf7 : Four bytes + * >=0x80 && <=0xbf : may not occur - just shift it + * <=1 : sequence terminated + */ + var byte = parseInt(tmpStr, 16); + if (byte <= 0x7f) {unicode = byte; f = 1;} + if ((byte >= 0xc0) && (byte <= 0xdf)) {unicode = byte & 0x1f; f = 2;} + if ((byte >= 0xe0) && (byte <= 0xef)) {unicode = byte & 0x0f; f = 3;} + if ((byte >= 0xf0) && (byte <= 0xf7)) {unicode = byte & 0x07; f = 4;} + if ((byte >= 0x80) && (byte <= 0xbf)) {unicode = (unicode << 6) + (byte & 0x3f); --f;} + if (f <= 1) { + break; + } + if (str.charAt(i + 1) == "%") { + i++ ; + } else { + // Error. should not occur + break; + } + } + targetStr += String.fromCharCode(unicode); + } + } + } + return targetStr; + } + + /* Cut the string at the WS so that it's shorter than the limitCharNum. + */ + function cutStringatWs(str, limitCharNum) { + var tmpStr = str; + var cnum = 0; + while (true) { + cnum = tmpStr.lastIndexOf(" "); + // no occurance of WS + if (cnum < 0) { + // if str is still longer than limit + if (tmpStr.length >= limitCharNum) { + tmpStr = tmpStr.substring(0, limitCharNum); + } + break; + } else { + tmpStr = tmpStr.substring(0, cnum); + if (cnum <= limitCharNum) { + break; + } + } + } + return tmpStr; + } + +} + diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/news.jsp b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/news.jsp new file mode 100644 index 0000000..b57de0b --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/news.jsp @@ -0,0 +1,51 @@ +<%-- Copyright 2006 Sun Microsystems, Inc. +All rights reserved. You may not modify, use, reproduce, or distribute +this software except in compliance with the terms of the License at: +http://developer.sun.com/berkeley_license.html +$Id: news.jsp,v 1.2 2006/12/14 01:04:50 yutayoshida Exp $ --%> + +<%@page contentType="text/html"%> +<%@page pageEncoding="UTF-8"%> +<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> +<%@taglib uri="http://java.sun.com/jsf/html" prefix="h" %> +<%@taglib prefix="ui" uri="http://java.sun.com/blueprints/ui" %> + +<html> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> + <title>BluePrints News Page</title> + <script type="text/javascript" src="${pageContext.request.contextPath}/faces/static/META-INF/dojo/bpcatalog/dojo.js"></script> + <script type="text/javascript" src="${pageContext.request.contextPath}/news.js"></script> + + <style> + p { + width : 70%; + background-color : #FFEFD5; + font-size : 80% + } + </style> + + </head> + <script type="text/javascript"> + var news = new bpuinews.RSS(); + dojo.addOnLoad(function(){news.getRssInJson('${pageContext.request.contextPath}/faces/dynamic/bpui_rssfeedhandler/getRssfeed', 'https://blueprints.dev.java.net/servlets/ProjectRSS?type=news%27);%7D); + </script> + <body> + <jsp:include page="banner.jsp" /> + <h2><a href="http://blueprints.dev.java.net">BluePrints News</a></h2> + <center> + <table border="0" width="95%"> + <tr> + <td> + <button id="previous" type="button"><< Previous</button> + </td> + <td> + <button id="next" type="button">Next >></button> + </td> + </tr> + </table> + </center> + <div id="news"></div> + <jsp:include page="footer.jsp" /> + </body> +</html> diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/petstoreListTest.jsp b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/petstoreListTest.jsp new file mode 100644 index 0000000..923739b --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/petstoreListTest.jsp @@ -0,0 +1,21 @@ +<%@page contentType="text/html"%> +<%@page pageEncoding="UTF-8"%> +<html> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> + <title>jsonp test page</title> + <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/bp_petstorelist.css"></link> + <script type="text/javascript" src="${pageContext.request.contextPath}/bp_petstorelist.js"></script> + <script type="text/javascript"> + var petstoreList; + function init() { + petstoreList=new bpui.petstoreList.createPetstoreList("petstoreListDiv"); + } + </script> + </head> + <body onload="init()"> + <h1>jsonp test page</h1> + + <div id="petstoreListDiv"></div> + </body> +</html> diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/rss.js b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/rss.js new file mode 100644 index 0000000..66700d3 --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/rss.js @@ -0,0 +1,110 @@ +/* Copyright 2006 Sun Microsystems, Inc. All rights reserved. You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at: http://developer.sun.com/berkeley_license.html +$Id: rss.js,v 1.3 2006/05/31 19:13:03 basler Exp $ */ + +dojo.require("dojo.io.*"); + +if (bpui = 'undefined') { + bpui = new Object(); +} + +bpui.RSS = function() { + var jsonData = null; + var rssItemNum = 0; + var currentItem = 0; + var rssTimeout = null; + var itemIntervalMsec = 2000; + var rssFadeoutCounter = 110; + var rssFadeinCounter = 110; + var itemIntervalId = 0; + + this.getRssInJson = function (uri, number) { + rssItemNum = number; + var encodedURI = encodeURI(bpui.contextRoot + "/faces/dynamic/bpui_rssfeedhandler/getRssfeed?style=json&itemNumber="+number+"&url="+uri); + //alert("encoded url=" + encodedURI); + var bindArgs = { + url: encodedURI, + mimetype: "text/json", + load: function (type, data, http) { + handleJsonRss(data); + for (var key in data.channel.item) { + dojo.debug("ITEM Title ", key, ":", data.channel.item[key].title); + dojo.debug("ITEM LInk ", key, ":", data.channel.item[key].link); + } + }, + error: function (t, e) { + dj_debug("ERROR : " + e.message); + } + } + dojo.io.bind(bindArgs); + return false; + } + + function handleJsonRss(json) { + jsonData = json; + // setting top title and link + generateHref(json.channel.title, json.channel.link, "rss-channel"); + // setting items + generateHref(json.channel.item[0].title, json.channel.item[0].link, "rss-item"); + var aNodes = document.getElementById("rss-item").getElementsByTagName("a"); + dojo.event.connect(aNodes[0], "onmouseover", "pauseCycle"); + dojo.event.connect(aNodes[0], "onmouseout", "resumeCycle"); + cycleRss(); + } + + function generateHref (title, link, nodeId) { + var node = document.getElementById(nodeId); + var aNode = document.createElement("a"); + aNode.setAttribute("href", link); + aNode.appendChild(document.createTextNode(title)); + if (node.hasChildNodes()) { + node.removeChild(node.firstChild); + } + node.appendChild(aNode); + } + + function cycleRss () { + itemIntervalId = setTimeout(replaceItem, itemIntervalMsec); + } + + + function replaceItem() { + if (itemIntervalId) { + clearTimeout(itemIntervalId); + } + // fadeout the current item and pop the next one in. + var cItem = document.getElementById("rss-item"); + dojo.fx.html.fadeOut(cItem.getElementsByTagName('a')[0], 500); + var waitId = setTimeout(function(waitId) { + clearTimeout(waitId); + //cItem.removeChild(cItem.firstChild); + if (currentItem < (rssItemNum -1)) { + currentItem += 1; + } else { + currentItem = 0; + } + generateHref(jsonData.channel.item[currentItem].title, jsonData.channel.item[currentItem].link, "rss-item"); + // attach event for onmouseover(pause) and onmouseout(resume) + var aNodes = cItem.getElementsByTagName("a"); + dojo.event.connect(aNodes[0], "onmouseover", "pauseCycle"); + dojo.event.connect(aNodes[0], "onmouseout", "resumeCycle"); + cycleRss();}, 500); + } + + function pauseCycle(evt) { + if (itemIntervalId) { + clearTimeout(itemIntervalId); + } + } + + function resumeCycle (evt) { + cycleRss(); + } + + bpui.getContextRoot = function() { + var urlArray=window.location.toString().split("/", 4); + return "/" + urlArray[3]; + } + + bpui.contextRoot = bpui.getContextRoot(); +} + diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/rss.jsp b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/rss.jsp new file mode 100644 index 0000000..e57e4dc --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/rss.jsp @@ -0,0 +1,33 @@ +<%-- Copyright 2006 Sun Microsystems, Inc. All rights reserved. You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at: http://developer.sun.com/berkeley_license.html +$Id: rss.jsp,v 1.2 2006/05/03 22:00:34 inder Exp $ --%> + +<%@page contentType="text/html"%> +<%@page pageEncoding="UTF-8"%> + +<%@taglib prefix="f" uri="http://java.sun.com/jsf/core%22%%3E +<%@taglib prefix="h" uri="http://java.sun.com/jsf/html%22%%3E +<%@taglib prefix="ui" uri="http://java.sun.com/blueprints/ui" %> + +<html> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> + <title>RSS</title> + </head> + <body> + + <h1>RSS test</h1> + <f:view> + ui:rssreader + <ui:rsscategory title="JavaEE 5"> + <ui:rssfeed title="BluePrints" url="https://blueprints.dev.java.net/servlets/ProjectRSS?type=news%22%3E</ui:rssfeed> + <ui:rssfeed title="GlassFish" url="http://blogs.sun.com/roller/rss/theaquarium%22%3E</ui:rssfeed> + </ui:rsscategory> + <ui:rsscategory title="Yahoo!"> + <ui:rssfeed title="World" url="http://rss.news.yahoo.com/rss/world%22%3E</ui:rssfeed> + <ui:rssfeed title="US" url="http://rss.news.yahoo.com/rss/us%22%3E</ui:rssfeed> + </ui:rsscategory> + </ui:rssreader> + + </f:view> + </body> +</html> diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/rssbar.jsp b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/rssbar.jsp new file mode 100644 index 0000000..6f9c2f9 --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/rssbar.jsp @@ -0,0 +1,20 @@ +<%-- Copyright 2006 Sun Microsystems, Inc. All rights reserved. You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at: http://developer.sun.com/berkeley_license.html +$Id: rssbar.jsp,v 1.7 2006/05/06 01:44:59 yutayoshida Exp $ --%> + +<%@page contentType="text/html"%> +<%@page pageEncoding="UTF-8"%> + +<%@taglib prefix="f" uri="http://java.sun.com/jsf/core%22%%3E +<%@taglib prefix="h" uri="http://java.sun.com/jsf/html%22%%3E +<%@taglib prefix="ui" uri="http://java.sun.com/blueprints/ui" %> + + + + <f:view> + <ui:rssBar url="https://blueprints.dev.java.net/servlets/ProjectRSS?type=news" + itemCount="4" + title="News from BluePrints" + speed="6000" + backgroundImage="no" + color="#00ffff" hoverColor="#ff00ff"></ui:rssBar> + </f:view> diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/rteToolBar.html b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/rteToolBar.html new file mode 100644 index 0000000..9cc8c0a --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/rteToolBar.html @@ -0,0 +1,60 @@ +<div class="EditorToolbarDomNode EditorToolbarSmallBg"> + <table cellpadding="1" cellspacing="0" border="0"> + <tbody> + <tr valign="top" align="left"> + <td> + <!-- bold --> + <span class="iconContainer dojoEditorToolbarItem" dojoETItemName="bold"> + <span title="Toggle Bold (Ctrl-B)" class="dojoE2TBIcon dojoE2TBIcon_Bold"> </span> + </span> + </td> + <td> + <!-- italic --> + <span class="iconContainer dojoEditorToolbarItem" dojoETItemName="italic"> + <span title="Toggle Italic (Ctrl-I)" class="dojoE2TBIcon dojoE2TBIcon_Italic"> </span> + </span> + </td> + <td> + <!-- underline --> + <span class="iconContainer dojoEditorToolbarItem" dojoETItemName="underline"> + <span title="Toggle Underline (Ctrl-U)" class="dojoE2TBIcon dojoE2TBIcon_Underline"> </span> + </span> + </td> + <td> + <!-- strikethrough --> + <span class="iconContainer dojoEditorToolbarItem" dojoETItemName="strikethrough"> + <span title="Toggle Strike-Through" +class="dojoE2TBIcon dojoE2TBIcon_StrikeThrough"> </span> + </span> + </td> + <td> + <!-- inserthorizontalrule --> + <span class="iconContainer dojoEditorToolbarItem" dojoETItemName="inserthorizontalrule"> + <span title="Insert Horizontal Rule" class="dojoE2TBIcon dojoE2TBIcon_HorizontalLine "> </span> + </span> + </td> + <td isSpacer="true"> + <!-- spacer --> + <span class="iconContainer"> + <span class="dojoE2TBIcon dojoE2TBIcon_Sep" style="width: 5px; min-width: 5px;"></span> + </span> + </td> + <td> + <!-- forecolor --> + <span class="iconContainer dojoEditorToolbarItem" dojoETItemName="forecolor"> + <span title="Change Text Color" class="dojoE2TBIcon dojoE2TBIcon_TextColor" +unselectable="on"> </span> + </span> + </td> + <td> + <!-- hilitecolor --> + <span class="iconContainer dojoEditorToolbarItem" dojoETItemName="hilitecolor"> + <span title="Change Background Color" class="dojoE2TBIcon dojoE2TBIcon_BackgroundColor" +unselectable="on"> </span> + </span> + </td> + <td width="*"> </td> + </tr> + </tbody> + </table> +</div> diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/scroller.css b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/scroller.css new file mode 100644 index 0000000..151df6d --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/scroller.css @@ -0,0 +1 @@ +.slider { border-width:1px; border-style:solid; border-color:black; background:#404040; }
.tile { position: absolute; top:0px; left:0px; cursor:pointer; border-width:1px; border-style:solid; border-color:black; visibility:hidden; z-index:1; background:white; opacity: .99; }
.tileImage { width: 94; height: 70; }
.nav { cursor:pointer; position: absolute; vertical-align:bottom; z-index:11; opacity: .85; }
.infopane { z-index:0; width:475px; position: absolute; border-width:1px; border-style:solid; border-color:black; background:black; opacity: .65; }
.infopaneDescription { color:white; font-size:12px; }
.infopaneShortDescription { color:white; font-size:16px; }
.infopanePrice { color:white; text-align: center; height:20px; }
.infopanePayPal{ vertical-valign: bottom; text-align: right; height:20px; }
.infopaneRating{ vertical-valign: top; text-align: center; width:125px; height:15px; color:white; opacity: .95; }
.infopaneTitle { width:255px; height:15px; color:white; font-size:18px; } \ No newline at end of file diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/scroller.js b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/scroller.js new file mode 100644 index 0000000..1f72578 --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/scroller.js @@ -0,0 +1,643 @@ +/* Copyright 2006 Sun Microsystems, Inc. All rights reserved. You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at: http://developer.sun.com/berkeley_license.html +$Id: scroller.js,v 1.32 2007/01/17 18:00:09 basler Exp $ */ + +/** +* ImageScroller - A multipurpose item brower +* @ Author: Greg Murray +* +*/ + +function getApplicationContextRoot() { + var urlArray=window.location.toString().split("/", 4); + return "/" + urlArray[3]; +} + +var applicationContextRoot=getApplicationContextRoot(); + + +function ImageScroller() { + var _this = this; + var initialized = false; + // default sizes + + var VIEWPORT_WIDTH = 500; + // all sizes are realitive the the viewport width + var IMAGEPANE_WIDTH = VIEWPORT_WIDTH; + var IMAGEPANE_HEIGHT = Math.round(VIEWPORT_WIDTH / 1.49); + var INFOPANE_DEFAULT_HEIGHT = Math.round(VIEWPORT_WIDTH / 6.67); + var INFOPANE_EXPAND_HEIGHT = Math.round(VIEWPORT_WIDTH / 2.86); + var THUMB_WIDTH = Math.round(VIEWPORT_WIDTH / 5);; + var THUMB_HEIGHT = Math.round(VIEWPORT_WIDTH / 6.67); + + var CHUNK_SIZE = 7; + var PREFETCH_THRESHHOLD = 5; + + var IMAGE_PANE_ID = "imagePane"; + var IMAGE_PANE_BUFFER_ID = "imageBufferPane"; + + var PADDING = 3; + + var MINIMIZE_IMG_URI = applicationContextRoot + "/images/minimize.gif"; + var MAXIMIZE_IMG_URI = applicationContextRoot + "/images/maximize.gif"; + var INDICATOR_IMG_URI = applicationContextRoot + "/images/indicator-black.gif"; + var MAXIMIZE_IMG_TOOLTIP = "Show Details"; + var MINIMIZE_IMG_TOOLTIP = "Show Less Details"; + + // this is an array of the tiles which are divs for each thumb + var tiles = []; + + var injectionPoint; + + // for scrolling + + var SCROLL_INCREMENT = 5; + var INFOPANE_INCREMENT = 3; + var tileY; + var tileX; + // this is the index of the image tile on the far left + var index = 0; + // keeps track how for the scroll has gone + var offset = 0; + + var timeout = 30; // in ms + var isScrollingRight = false; + var isScrollingLeft = false; + + // large image pane + var imagePane; + var imageLoadingPane; + var loadingPane; + // images + var minimizeImage; + + var indicatorImage; + var leftButton; + var rightButton; + + // infopane + var infoPane; + var infoTableMinimize; + var indicatorCell; + var minimizeLink; + var infoPaneLoop = 0; + var maximizing = false; + var minimizing = false; + var maximized = false; + + // prefetch thresh-hold + var prefetchThreshold = 2; + + // a growing list of items; + var items = []; + // cached chunks that are already in the items array + var loadedChunks = []; + + // used for debugging when debug is true + var debug = false; + var statusDiv; + var status2Div; + + var showingBuffer = false; + var imageBuffer; + var imageReloadTries = 0; + var IMG_RELOAD_RETRY_MAX = 30; + // used for url book marking + + + var pid; + var currentChunk; + // this map contains all the items + var map; + // this is the main container div + var containerDiv; + + this.getItems = function() { + return map; + } + + this.getScrollerItems = function() { + return items; + } + + + this.getGroupId = function() { + return pid; + } + + this.reset = function() { + resetTitles() + tiles = []; + index = 0; + offset = 0; + currentChunk = 0; + items = []; + loadedChunks = []; + } + + function resetTitles() { + for (var l = 0; l < tiles.length; l++) { + tiles[l].parentNode.removeChild(tiles[l]); + } + } + + // event bound to the mouseOut event of both scroll buttons + function scrollDone() { + isScrollingLeft = false; + isScrollingRight = false; + } + + // looping method for time out + function scroll() { + if (isScrollingRight) scrollRight(); + else if (isScrollingLeft) scrollLeft(); + } + + + // do the value list pre-emptive fetching + function prefetch() { + //printDebug("** scoller index = " + index); + if (isScrollingRight && (index + PREFETCH_THRESHHOLD) % CHUNK_SIZE == 0) { + + if ((Math.round(index / CHUNK_SIZE)) >= currentChunk) { + currentChunk = Math.round(index / CHUNK_SIZE) + 1; + // fire an event + dojo.event.topic.publish("/catalog", {type:"getChunk", id: pid, index: index, currentChunk: currentChunk}); + } + } + } + + this.setGroupId = function(id) { + pid = id; + } + + this.containsChunk = function(chunkId) { + printDebug("containsChunk = " + loadedChunks); + ret=false; + for(ii=0; ii < loadedChunks.length; ii++) { + if(chunkId == loadedChunks[ii]) { + ret=true; + break; + } + } + return ret; + } + + this.addChunk = function(chunkId) { + loadedChunks.push(chunkId); + } + + this.addItems = function(inItems) { + for (var loop=0; loop < inItems.length ; loop++) { + items.push(inItems[loop]); + map.put(inItems[loop].id, inItems[loop]); + createTile(inItems[loop]); + if (loop == 0 && !loadImage) { + showImage(inItems[loop].id); + } + + } + drawTiles(); + rightButton.style.visibility="visible"; + _this.hideProgressIndicator(); + } + + this.showProgressIndicator = function() { + if (indicatorImage) { + indicatorImage.style.visibility = "visible"; + } + } + + this.hideProgressIndicator = function() { + indicatorImage.style.visibility = "hidden"; + } + + function postImageLoad(loadIntoBuffer) { + if (debug) { + status2Div.innerHTML = "Try " + imageReloadTries + " " + url + " image.complete=" + imageBuffer.complete; + } + // keep calling this funtion until imageReloadTries < IMG_RELOAD_RETRY_MAX + if (!imageBuffer.complete) { + if (imageReloadTries < IMG_RELOAD_RETRY_MAX) { + setTimeout(function(){this.loadIntoBuffer = loadIntoBuffer;postImageLoad(loadIntoBuffer);},500); + } else { + this.hideProgressIndicator(); + } + imageReloadTries = imageReloadTries + 1; + return; + } + var id; + + _this.hideProgressIndicator(); + if (loadIntoBuffer) { + imageLoadingPane.src = imageBuffer.src; + } else { + imagePane.src = imageBuffer.src; + + } + // do a cross fade as long as the images aren't the same + if (imageLoadingPane.src != imagePane.src) { + crossFade(0,loadIntoBuffer ); + } + } + + + this.showImage = function(itemId) { + + _this.showProgressIndicator(); + //setTimeout(this.showProgressIndicator,0); + var i = map.get(itemId); + + if (!i) { + return; + } + dojo.event.topic.publish("/catalog", {type:"showingItem", id: itemId, rating: i.rating}); + // create the image pane and append the description nodes + // asumption is that if the imagePane is not set neigher are the info children + if (typeof imagePane == 'undefined') { + imagePane = document.createElement("img"); + imagePane.style.width = IMAGEPANE_WIDTH + "px"; + imagePane.style.height = IMAGEPANE_HEIGHT + "px"; + imagePane.id = IMAGE_PANE_ID; + + var targetElement = document.getElementById("bodySpace"); + imageLoadingPane = document.createElement("img"); + imageLoadingPane.style.position = "absolute"; + imageLoadingPane.style.visibility = "hidden"; + imageLoadingPane.style.width = IMAGEPANE_WIDTH + "px"; + imageLoadingPane.style.height = IMAGEPANE_HEIGHT + "px"; + imageLoadingPane.id = IMAGE_PANE_BUFFER_ID; + targetElement.appendChild(imagePane); + targetElement.appendChild(imageLoadingPane); + imageLoadingPane.style.left = tileX + "px"; + + loadImage(i.image, false); + } else { + imageLoadingPane.style.visibility = "visible"; + if (showingBuffer) { + showingBuffer = false; + } else { + showingBuffer = true; + } + loadImage(i.image, showingBuffer); + } + } + + function loadImage(url, loadIntoBuffer) { + imageReloadTries = 0; + imageBuffer = new Image(); + if (loadIntoBuffer) { + imageBuffer.src = url; + imageLoadingPane.onLoad = setTimeout(function(){this.url=url;this.loadIntoBuffer = loadIntoBuffer;postImageLoad(loadIntoBuffer,url);},0); + } else { + imageBuffer.src = url; + imageBuffer.onLoad = setTimeout(function(){this.url = url;this.loadIntoBuffer = loadIntoBuffer;postImageLoad(loadIntoBuffer,url);},0); + } + } + + function setOpacity(opacity, id) { + var target = document.getElementById(id); + if (typeof target.style.filter != 'undefined') { + target.style.filter = "alpha(opacity:" + opacity + ")"; + } else { + target.style.opacity = opacity/100; + } + } + + function crossFade(count,loadIntoBuffer) { + var percentage = Number(count); + if (loadIntoBuffer) { + setOpacity(100 - percentage, IMAGE_PANE_ID); + setOpacity(percentage, IMAGE_PANE_BUFFER_ID); + } else { + setOpacity(100 - percentage, IMAGE_PANE_BUFFER_ID); + setOpacity(percentage, IMAGE_PANE_ID); + + } + if (percentage < 100) { + percentage = percentage + 10; + setTimeout(function(){this.loadIntoBuffer = loadIntoBuffer;this.percentage = percentage;crossFade(percentage,loadIntoBuffer);}, 25); + } + } + + + // calling this function will result in the maximizing event being fired + // if the pane is maximized it will asume the event want to minimize + this.doMaximize = function() { + if (!maximizing && !minimizing && !maximized) { + infoPaneLoop = INFOPANE_DEFAULT_HEIGHT; + maximizing = true; + minimizing = false; + } else if (!maximizing && !minimizing) { + minimizing = true; + maximizing = false; + } + setTimeout(changeInfoPane, 0); + } + + // will handle either minimizing or maximing but not both + // this method is called recursively until the maximinging + // or minimizing is done. + function changeInfoPane() { + if (maximizing) { + maxmizeInfoPane(); + } else if (minimizing) { + minimizeInfoPane(); + } + } + + function maxmizeInfoPane() { + if (infoPaneLoop < INFOPANE_EXPAND_HEIGHT) { + infoPaneLoop = infoPaneLoop + INFOPANE_INCREMENT; + var clipMe = 'rect(' + '0px,' + VIEWPORT_WIDTH + 'px,'+ infoPaneLoop +'px,' + 0 + 'px)'; + infoPane.style.clip = clipMe; + infoPane.style.height = infoPaneLoop; + infoPane.style.top = (tileY + (PADDING *2) + INFOPANE_DEFAULT_HEIGHT + IMAGEPANE_HEIGHT) - infoPaneLoop; + setTimeout(changeInfoPane, 5); + } else { + minimizeImage.src= MINIMIZE_IMG_URI; + minimizeLink.title = MINIMIZE_IMG_TOOLTIP; + maximized = true; + maximizing = false; + minimizing = false; + } + } + + function minimizeInfoPane() { + if (infoPaneLoop > INFOPANE_DEFAULT_HEIGHT) { + infoPaneLoop = infoPaneLoop - INFOPANE_INCREMENT; + var clipMe = 'rect(' + '0px,' + VIEWPORT_WIDTH + 'px,'+ infoPaneLoop +'px,' + 0 + 'px)'; + infoPane.style.clip = clipMe; + infoPane.style.height = infoPaneLoop; + infoPane.style.top = (tileY + (PADDING *2) + INFOPANE_DEFAULT_HEIGHT + IMAGEPANE_HEIGHT) - infoPaneLoop; + if (debug) { + status2Div.innerHTML = "minimize infoPaneLoop =" + infoPaneLoop + " infopane.top=" + infoPane.style.top; + } + setTimeout(changeInfoPane, 5); + } else { + minimizeImage.src= MAXIMIZE_IMG_URI; + minimizeLink.title = MAXIMIZE_IMG_TOOLTIP; + maximizing = false; + minimizing = false; + maximized = false; + } + } + + function scrollRight() { + isScrollingRight = true; + if ( (index + 4) >= tiles.length) { + // hide the rightButton + rightButton.style.visibility="hidden"; + return; + } else { + leftButton.style.visibility="visible"; + } + offset = offset - SCROLL_INCREMENT; + drawTiles(); + setTimeout(scroll, timeout); + } + + function getNext() { + isScrollingRight = true; + setTimeout(scroll, timeout); + } + + + function getPrevious () { + isScrollingLeft = true; + setTimeout(scroll, timeout); + } + + function scrollLeft() { + if (offset >= 0) { + leftButton.style.visibility="hidden"; + return; + } else { + leftButton.style.visibility="visible"; + } + offset = offset + SCROLL_INCREMENT; + drawTiles(); + setTimeout(scroll, timeout); + } + + function drawTiles() { + // draw the first one if its off the screen + // check if the far right image is out view + var overHang; + var temp = offset; + index = Math.floor((offset)/THUMB_WIDTH); + overHang = offset % THUMB_WIDTH; + if (overHang < 0) { + overHang = overHang * -1; + } + if (index < 0) { + index = index * -1; + } + // check for next set of images + prefetch(); + var startIndex = index; + if (overHang > 0 && index >0) { + startIndex = index -1; + } + var stopIndex = index + Math.round(VIEWPORT_WIDTH / THUMB_WIDTH); + if (stopIndex > tiles.length) { + stopIndex = tiles.length; + } + var displayX = 0; + for (var tl=startIndex; tl < stopIndex; tl++) { + if (debug) { + statusDiv.innerHTML = "overhang=" + overHang + " startIndex=" + startIndex + " stopIndex=" + stopIndex + " offset=" + offset + " displayX=" + displayX; + } + if (overHang > 0 && tl == startIndex) { + rightButton.style.visibility="visible"; + // clip: rect(top right bottom left) - borders of the clipped area + // clip the left + var clipMe = 'rect(' + '0px,' + THUMB_WIDTH + 'px,'+ THUMB_HEIGHT +'px,' + overHang + 'px)'; + tiles[tl].style.clip = clipMe; + tiles[tl].style.left = (tileX - overHang) + "px"; + displayX = displayX + (THUMB_WIDTH - overHang); + } else if (tl == stopIndex -1) { + var underHang = VIEWPORT_WIDTH - displayX ; + if (underHang > 0 && underHang) { + var clipMe = 'rect(' + '0px,' + (underHang) + "px," + THUMB_HEIGHT +'px,' + 0 + 'px)'; + tiles[tl].style.clip = clipMe; + tiles[tl].style.left = tileX + (offset + (tl * THUMB_WIDTH)) + 'px'; + tiles[tl].style.visibility = "visible"; + // resize the previous one to its real length + } else if (underHang < 0 && tl > 0) { + var clipMe = 'rect(' + '0px,' + (THUMB_WIDTH + underHang) + "px," + THUMB_HEIGHT +'px,' + 0 + 'px)'; + tiles[tl-1].style.clip = clipMe; + tiles[tl-1].style.visibility = "visible"; + tiles[tl-1].style.left = tileX + (offset + ((tl -1) * THUMB_WIDTH)) + 'px'; + } else { + tiles[tl].style.left = '0px'; + tiles[tl].style.visibility = "hidden"; + } + } else { + displayX = displayX + THUMB_WIDTH; + tiles[tl].style.left = tileX + (offset + (tl * THUMB_WIDTH)) + 'px'; + tiles[tl].style.visibility = "visible"; + } + } + if (stopIndex < tiles.length) { + tiles[stopIndex].style.visibility = "hidden"; + tiles[stopIndex].style.left = "0px"; + } + } + + + this.load = function () { + map = new Map(); + dojo.event.connect(window, "onresize", layout); + var loadImage; + + var targetRow = document.getElementById("targetRow"); + injectionPoint = document.getElementById("injection_point"); + + // for status output + statusDiv = document.getElementById("status"); + status2Div = document.getElementById("status_2"); + + initLayout(); + initialized = true; + } + + function initLayout() { + containerDiv = document.getElementById("CatalogBrowser"); + rightButton = document.getElementById("right_button"); + leftButton = document.getElementById("left_button"); + layout(); + leftButton.style.visibility="hidden"; + if (typeof rightButton.attachEvent != 'undefined') { + rightButton.attachEvent('onmouseover',function(e){scrollDone();getNext();}); + rightButton.attachEvent('onmouseout',function(e){scrollDone();}); + leftButton.attachEvent('onmouseover',function(e){scrollDone();getPrevious();}); + leftButton.attachEvent('onmouseout',function(e){scrollDone();}); + } else if (typeof rightButton.addEventListener != 'undefined') { + rightButton.addEventListener('mouseover',function(e){scrollDone();getNext();}, false); + rightButton.addEventListener('mouseout',function(e){scrollDone();}, false); + leftButton.addEventListener('mouseover',function(e){scrollDone();getPrevious();}, false); + leftButton.addEventListener('mouseout',function(e){scrollDone();}, false); + } + createInfoPane(); + } + + function layout() { + var ua = navigator.userAgent.toLowerCase(); + + // this will need to be made generic depending on the thumb height + tileY = findY(containerDiv); + tileX = findX(containerDiv) + 4; + var rightX = tileX + VIEWPORT_WIDTH - 20; + rightButton.style.left = rightX + "px"; + var buttonY = tileY + IMAGEPANE_HEIGHT + INFOPANE_DEFAULT_HEIGHT + 12; + rightButton.style.top = buttonY + "px"; + leftButton.style.top = buttonY + "px"; + + if (ua.indexOf('ie') != -1) { + isIE = true; + } else if (ua.indexOf('safari') != -1) { + tileX = tileX + 8; + timeout = 20; + } + drawTiles(); + if (infoPane) { + infoPane.style.left = tileX + "px"; + if (maximized) { + + infoPane.style.top = (tileY + IMAGEPANE_HEIGHT + (PADDING*2) - infoPane.style.height) + "px"; + } else { + infoPane.style.top = (tileY + IMAGEPANE_HEIGHT + (PADDING*2)) + "px"; + } + if (maximized) { + infoPaneLoop = infoPane.style.height; + } else { + infoPaneLoop = INFOPANE_DEFAULT_HEIGHT; + } + } + if (typeof imageLoadingPane != 'undefined') { + imageLoadingPane.style.left = tileX; + imageLoadingPane.style.top = tileY; + } + } + + function createInfoPane() { + infoPane = document.getElementById("infopane"); + infoPane.style.width = VIEWPORT_WIDTH + "px"; + // give room for 4 pixels above and below + infoPane.style.height = (INFOPANE_DEFAULT_HEIGHT) + "px"; + // give 3px padding for a border + infoPane.style.top = (tileY + IMAGEPANE_HEIGHT + (PADDING*2)) + "px"; + infoPane.style.left = tileX + "px"; + infoTableMinimize = document.getElementById("infopaneDetailsIcon"); + indicatorCell = document.getElementById("infopaneIndicator"); + indicatorCell.style.width = (10) + "px"; + indicatorImage = document.createElement("img"); + indicatorImage.className = "infopaneIndicator"; + indicatorImage.src = INDICATOR_IMG_URI; + indicatorImage.style.visibility = "hidden"; + indicatorCell.appendChild(indicatorImage); + minimizeLink = document.createElement("a"); + minimizeLink.className = "infopaneLink"; + minimizeLink.title = MAXIMIZE_IMG_TOOLTIP; + minimizeImage = document.createElement("img"); + minimizeImage.src= MAXIMIZE_IMG_URI; + minimizeLink.appendChild(minimizeImage); + infoTableMinimize.appendChild(minimizeLink); + + if (typeof minimizeLink.attachEvent != 'undefined') { + minimizeLink.attachEvent("onclick",function(e){_this.doMaximize();}); + } else { + minimizeLink.addEventListener("click",function(e){_this.doMaximize();}, true); + } + var clipMe = 'rect(' + '0px,' + VIEWPORT_WIDTH + 'px,'+ INFOPANE_DEFAULT_HEIGHT +'px,' + 0 + 'px)'; + infoPane.style.clip = clipMe; + } + + function createTile(i) { + var div = document.createElement("div"); + div.className = "tile"; + div.id = i.id; + var link = document.createElement("a"); + var img = document.createElement("img"); + img.title = i.name; + img.src = i.thumbnail; + img.className = "tileImage"; + link.appendChild(img); + link.setAttribute("id", i.id); + if (typeof div.attachEvent != 'undefined') { + div.attachEvent('onclick',function(e){this.id = div.id; _this.showImage(this.id, false);}); + } else { + link.addEventListener('click',function(e){this.id = div.id; _this.showImage(this.id, false);}, true); + } + div.appendChild(link); + injectionPoint.appendChild(div); + div.style.top = tileY + INFOPANE_DEFAULT_HEIGHT + IMAGEPANE_HEIGHT + (PADDING * 3) + "px"; + tiles.push(div); + } + + + function findY(element) { + var t = 0; + if (element.offsetParent) { + while (element.offsetParent) { + t += element.offsetTop + element = element.offsetParent; + } + } else if (element.y) { + t += element.y; + } + return t; + } + + function findX(element) { + var l = 0; + if (element.offsetParent) { + while (element.offsetParent) { + l += element.offsetLeft + element = element.offsetParent; + } + } else if (element.x) + l += element.x; + return l; + } +} diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/search.jsp b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/search.jsp new file mode 100644 index 0000000..e12d666 --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/search.jsp @@ -0,0 +1,290 @@ +<%-- Copyright 2006 Sun Microsystems, Inc. All rights reserved. You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at: http://developer.sun.com/berkeley_license.html +$Id: search.jsp,v 1.28 2006/12/04 21:34:10 basler Exp $ --%> + +<%@page contentType="text/html"%> +<%@page pageEncoding="UTF-8"%> +<%@page import="java.util.*, com.sun.javaee.blueprints.petstore.search.*"%> +<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> +<%@taglib uri="http://java.sun.com/jsf/html" prefix="h" %> +<%@taglib uri="http://java.sun.com/jsf/core" prefix="f" %> +<%@taglib prefix="ui5" uri="http://java.sun.com/blueprints/ui" %> + + +<html> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> + <title>Search Page</title> + <style> + .itemTable { + padding: 0.3cm; + width: 800px; + border-style: double; + border-color: darkgreen; + } + .itemCell { + border-style: solid; + border-color: darkgreen; + border-width: thin; + padding: 5px + } + .tagDiv { + border-style: groove; + border-color: darkgreen; + background-color: white; + border-width: thick; + padding: 5px; + visibility: hidden; + position:absolute; + left:0px; + top:0px; + z-index: 3; + } + </style> + <script type="text/javascript" src="common.js"></script> + </head> + <body> + <jsp:include page="banner.jsp" /> + <center> + + <script type="text/javascript"> + function checkAll() { + var elems=dojo.byId("resultsForm").elements; + for(ii=0; ii < elems.length; ii++) { + if(elems[ii].name.indexOf("mapSelectedItems") >= 0) { + elems[ii].checked=true; + } + } + return false; + } + + function uncheckAll() { + var elems=dojo.byId("resultsForm").elements; + for(ii=0; ii < elems.length; ii++) { + if(elems[ii].name.indexOf("mapSelectedItems") >= 0) { + elems[ii].checked=false; + } + } + return false; + } + + function addTags(eventx, namex, itemIdx) { + var xx=0; + var yy=0; + if (!eventx) var eventx=window.event; + if (eventx.pageX || eventx.pageY){ + xx=eventx.pageX; + yy=eventx.pageY; + } else if (eventx.clientX || eventx.clientY) { + xx=eventx.clientX + document.body.scrollLeft; + yy=eventx.clientY + document.body.scrollTop; + } + divId="addTags"; + document.getElementById("addTagsItemId").value=itemIdx; + document.getElementById("addTagsTags").value=""; + document.getElementById("addTagsTitle").innerHTML="<b>Add Tags to '" + namex + "'</b>"; + document.getElementById(divId).style.left=(xx - 170) + "px"; + document.getElementById(divId).style.top=(yy - 140) + "px"; + document.getElementById(divId).style.visibility='visible'; + document.getElementById("addTagsTags").focus(); + } + + function saveAddTags() { + // get data and send to controller servlet + itemIdx=document.getElementById("addTagsItemId").value; + tagsx=document.getElementById("addTagsTags").value; + var bindArgs = { + url: "../TagServlet?itemId=" + escape(itemIdx) + "&tags=" + escape(tagsx), + mimetype: "text/xml", + error: ajaxBindError, + load: function(type, data, evt){ + // check successful response + if (evt.readyState == 4) { + if (evt.status == 200) { + // get results and replace dom elements + var resultx=data.getElementsByTagName("response")[0]; + itemIdx=resultx.getElementsByTagName("itemId")[0].childNodes[0].nodeValue; + + // change DOM data + document.getElementById("ITEMID_TAGS_" + itemIdx).innerHTML=resultx.getElementsByTagName("tags")[0].childNodes[0].nodeValue; + + } else if (evt.status == 204){ + alert("204 return"); + } + } + } + }; + + dojo.io.bind(bindArgs); + // make sure it was updated + + // show messages if error + + // hide popup + document.getElementById(divId).style.visibility='hidden'; + } + + function cancelAddTags() { + // hide popup + document.getElementById(divId).style.visibility='hidden'; + } + + </script> + + <f:view> + + <ui5:popupTag id="pop1" xmlHttpRequestURL="../lookup.jsp?popupView=2&itemId=" + elementNamePairs="name=value1,description=value2,price=value3,image=imageId"> + <!-- Used as spaces to center the table, this could be done programmatically, + but browser diff, so I left it in the hands of the component user. The image is located + in the component jar so for retrieval, push it through the faces servlet --> + <img id="spaceImage" height="10px" width="3px" src="${pageContext.request.contextPath}/faces/static/META-INF/popup/images/spacer.gif" align="left"> + <table border="0" width="270px" bgcolor="#ffffff" cellpadding="5" cellspacing="5"> + <tr> + <td align="left" valign="top"><b>Name:</b> + <span id="value1">Loading Data...</span></td> + </tr> + <tr> + <td align="left" valign="top"><b>Seller Address:</b> + <span id="value2">Loading Data...</span></td> + </tr> + <tr> + <td align="left" valign="top"><b>Price:</b> + <span id="value3">Loading Data...</span></td> + </tr> + <tr> + <td colspan="2" align="center"><img name="image" id="imageId" src="" + alt="[Loading Image...]" border="2"/><br/><br/></td> + </tr> + </table> + </ui5:popupTag> + + <h1>Search Page</h1> + <h:form id="searchForm"> + <table class="itemTable" style="width: 700px"> + <tr> + <th class="itemCell">Search String</th> + <td class="itemCell"> + <h:inputText size="50" id="searchString" value="#{SearchBean.searchString}"/> + Also Search Tags:<h:selectBooleanCheckbox id="searchTags" value="#{SearchBean.searchTags}"/> + </td> + </tr> + <tr> + <td class="itemCell" align="center" colspan="2"> + <h:commandButton action="#{SearchBean.searchAction}" id="searchSubmit" type="submit" value="Submit"/> + <h:commandButton id="searchReset" type="reset" value="Reset"/> + </td> + </tr> + </table> + <h:messages/> + </h:form> + <br/> + + + + <h:form id="resultsForm" rendered="#{SearchBean.showResults}"> + <table class="itemTable"> + <tr> + <th class="itemCell"> + Map + <br/> + <img src="../images/check_all.gif" onclick="return checkAll()"/><img src="../images/uncheck_all.gif" onclick="return uncheckAll()"/> + </th> + <th class="itemCell">Name</th> + <th class="itemCell">Description</th> + <th class="itemCell">Tags</th> + <th class="itemCell">Price</th> + </tr> +<% +SearchBean searchBean=(SearchBean)session.getAttribute("SearchBean"); +if(searchBean != null) { + List<IndexDocument> hits=searchBean.getHits(); + if(hits != null) { + for(IndexDocument indexDoc : hits) { +%> + <tr> + <td class="itemCell"> + <input type="checkbox" name="mapSelectedItems" value="<%= indexDoc.getUID() %>"/> + </td> + <td class="itemCell"> + <a href="${pageContext.request.contextPath}/faces/catalog.jsp?pid=<%= indexDoc.getProduct() %>&itemId=<%= indexDoc.getUID() %>" + onmouseover="bpui.popup.show('pop1', event, '<%= indexDoc.getUID() %>')" onmouseout="bpui.popup.hide('pop1')"> + <%= indexDoc.getTitle() %> + </a> + </td> + <td class="itemCell"> + <%= indexDoc.getSummary() %> + </td> + <td class="itemCell"> + <span id="ITEMID_TAGS_<%= indexDoc.getUID() %>"><%= (indexDoc.getTag().equals("") ? " " : indexDoc.getTag()) %></span> + <br/><input type="button" value="Add Tags" onclick="addTags(event, '<%= indexDoc.getTitle() %>', '<%= indexDoc.getUID() %>')"/> + </td> + <td class="itemCell"> + <%= indexDoc.getPriceDisplay() %> + </td> + </tr> +<% + } + } +} +%> + <tr> + <td colspan="5"> + <br/> + <center> + <table class="itemTable"> + <tr> + <th align="right">Center Point Address:</th> + <td> + <h:inputText id="centerAddress" value="#{MapBean.centerAddress}" size="50"/> + <br/><small><i>For example: 4140 Network Circle, Santa Clara, CA, 95054</i></small> + </td> + </tr> + <tr> + <th align="right">Area (in Miles):</th> + <td> + <h:inputText id="radius" value="#{MapBean.radius}" size="5"/> + </td> + </tr> + <tr> + <td align="center" colspan="2"> + <h:commandButton action="#{MapBean.findAllByIDs}" id="mapSubmit" type="submit" + value="Map Checked Item(s)" rendered="#{SearchBean.showResults}"/> + </td> + </tr> + </table> + </center> + <br/> + </td> + </tr> + </table> + + <h:messages/> + </h:form> + <br/><br/><br/> + <div class="tagDiv" id="addTags"> + <form> + <table> + <tr> + <td align="center"> + <span id="addTagsTitle"><b>Tag Title</b></span><br/><i>(seperated by spaces)</i> + </td> + </tr> + <tr> + <td align="center"> + <input id="addTagsTags" type="text" size="50"/> + </td> + </tr> + <tr> + <td align="center"> + <input type="button" value="Save" onclick="saveAddTags()"/> <input type="button" value="Cancel" onclick="cancelAddTags()"/> + </td> + </tr> + </table> + <input type="hidden" id="addTagsItemId"/> + </form> + </div> + </f:view> + </center> + <jsp:include page="footer.jsp" /> + </body> +</html> diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/styles.css b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/styles.css new file mode 100644 index 0000000..24ffbf9 --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/styles.css @@ -0,0 +1,130 @@ + +.dojoHtmlFisheyeListBar { + cursor:pointer; + margin: 0; + width: 300px; + text-align: right; +} + +.outerbar { + background-color: white; + text-align: left; + width: 300px; +} + +.editText { + height:25; + font-size:18px; + font-weight: bold; + font-family: Arial; +} + +.plainText { + height:25; + font-size:20px; + font-weight: bold; + font-family: Arial +} + +.plainTextSelect { + height:25; + font-size:20px; + font-weight: bold; + font-family: Arial; + background: red +} + +.smallText { + height:15; + font-size:13px; + font-weight: bold; + font-family: Arial +} + +.banner { + height:35; + font-size:35; + font-weight: bold; + font-family: Arial +} + + +.menuItem { + background: white; + color: black; + text-decoration: none; + font-size: 1.4em; +} + +.menuLink { + cursor:pointer; + color: black; + text-decoration: none; + font-size: 1.3em; +} + +.menuLinkHover { + cursor:pointer; + color: black; + font-size: 1.3em; + text-decoration: underline; +} + +.autocomplete { + position:absolute; +} + +.autocompleteTable { + padding:0; + visibility: hidden; + border-spacing: 0; + border-width:1px; + border-style:solid; + border-color:black; +} + +.popupRowHover { + color: #FFFAFA; + cursor:pointer; + padding-left:3; + padding-right:3; + border-spacing: 0; + border-width:0px; + background: #7A8AFF; +} + +.popupRow { + padding-left:3; + padding-right:3; + border-spacing: 0; + border-width:0px; + background: #FFFAFA; +} + +.popupRowEven { + padding-left:3; + padding-right:3; + border-spacing: 0; + border-width:0px; + background: #FFFADA; +} + +.popupItem { + background: #FFFAFA; + color: #000000; + text-decoration: none; + font-size: 1.2em; +} + +.shadow { + top:0px; + left:0px; + position: absolute; + visibility: hidden; + width:0; + height:0; + z-index:0; + background:gray; + opacity: .5; +} + diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/systemerror.jsp b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/systemerror.jsp new file mode 100644 index 0000000..c7a5309 --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/systemerror.jsp @@ -0,0 +1,28 @@ +<%-- Copyright 2006 Sun Microsystems, Inc. All rights reserved. You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at: http://developer.sun.com/berkeley_license.html +$Id: systemerror.jsp,v 1.3 2007/01/09 19:02:12 basler Exp $ --%> +<%@ page isErrorPage="true" %> +<%@ page import="com.sun.javaee.blueprints.petstore.util.PetstoreUtil, java.util.logging.Level" %> +<% +PetstoreUtil.getLogger().log(Level.INFO, "Encountered a Runtime Exception and being transferred the the systemerror page", exception); +%> +<html> + <head> + <meta http-equiv="Content-Type" content="text/html;charset=utf-8" > + <title>Java Pet Store Reference Application: System Error Page</title> + </head> + <body> + + <jsp:include page="banner.jsp" /> + + <h2>System Error !</h2> + <p>We had problems processing your request. An exception has been caught, + so perhaps your application was not set up or deployed properly.</p> + + The Exception that was thrown is:<b> <%= exception.toString() %></b>. The server log will contain the stack trace of the exception. + + <p><a href="${pageContext.request.contextPath}/faces/index.jsp">Go back to sample application home</a></p> + <br/><br/> + <jsp:include page="footer.jsp" /> + + </body> +</html> diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/tag.css b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/tag.css new file mode 100644 index 0000000..bfbab6e --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/tag.css @@ -0,0 +1,47 @@ + .itemTable { + padding: 0.3cm; + border-style: double; + width: 800px; + border-color: darkgreen; + } + .itemCell { + border-style: solid; + border-color: darkgreen; + border-width: thin; + padding: 5px + } + .tagCell { + padding: 0.3cm; + } + .xxlarge + { + font-size: xx-large; + color: red; + cursor: pointer; + text-decoration: underline; + } + .xlarge + { + font-size: x-large; + color: blue; + cursor: pointer; + text-decoration: underline; + } + .large + { + font-size: large; + color: green; + cursor: pointer; + text-decoration: underline; + } + .medium + { + font-size: medium; + cursor: pointer; + color: black; + text-decoration: underline; + } + .items + { + visibility: hidden; + } diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/tag.jsp b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/tag.jsp new file mode 100644 index 0000000..f9c74f3 --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/tag.jsp @@ -0,0 +1,158 @@ +<%-- Copyright 2006 Sun Microsystems, Inc. All rights reserved. You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at: http://developer.sun.com/berkeley_license.html +$Id: tag.jsp,v 1.11 2007/01/17 18:00:09 basler Exp $ --%> + +<%@page contentType="text/html"%> +<%@page pageEncoding="UTF-8"%> +<%@page import="java.util.*, com.sun.javaee.blueprints.petstore.model.CatalogFacade, com.sun.javaee.blueprints.petstore.model.Tag"%> +<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> +<%@taglib uri="http://java.sun.com/jsf/html" prefix="h" %> +<%@taglib uri="http://java.sun.com/jsf/core" prefix="f" %> +<%@taglib prefix="ui5" uri="http://java.sun.com/blueprints/ui" %> + + +<html> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> + <title>Tag Page</title> + <script type="text/javascript" src="./common.js"></script> + <link type="text/css" rel="stylesheet" href="./tag.css"/> +<% +try { + CatalogFacade cf = (CatalogFacade)config.getServletContext().getAttribute("CatalogFacade"); + List<Tag> tags=cf.getTagsInChunk(0, 90); + // since top 20 come from database or desending refCount order, need to reorder by tag name + Collections.sort(tags, new Comparator() { + public int compare(Object one, Object two) { + return ((Tag)one).getTag().compareTo(((Tag)two).getTag()); + } + }); +%> + <script language="javascript"> + function retrieveItems(tag) { + var bindArgs = { + // url when using the jsp to serve the ajax request + url: "../tagItemLookup.jsp?tag=" + escape(tag), + mimetype: "text/xml", + load: returnFunctionx, + error: ajaxBindError}; + + // dispatch the request + dojo.io.bind(bindArgs); + } + + + function returnFunctionx(type, data, evt) { + // statically setup popup for simple case + var componentId="displayItems"; + // check return of the dojo call to make sure it is valid + if (evt.readyState == 4) { + if (evt.status == 200) { + // get results and replace dom elements + var itemsx=data.getElementsByTagName("item"); + display="<table class='itemTable'><tr><td class='itemCell' align='center' colspan='4'><h2>Tag: " + + data.getElementsByTagName("tag")[0].childNodes[0].nodeValue + + "</h2></td></tr><tr><th class='itemCell'>Name</th><th class='itemCell'>Description</th><th class='itemCell'>Tags</th><th class='itemCell'>Price</th></tr>" + for(ii=0; ii < itemsx.length; ii++) { + display += "<tr>"; + display +="<td class='itemCell'><a href='./catalog.jsp?pid="+ itemsx[ii].getElementsByTagName("productID")[0].childNodes[0].nodeValue +"&itemId=" + + itemsx[ii].getElementsByTagName("itemID")[0].childNodes[0].nodeValue + "' onmouseover='bpui.popup.show("pop1", event, "" + + itemsx[ii].getElementsByTagName("itemID")[0].childNodes[0].nodeValue + "")' onmouseout='bpui.popup.hide("pop1")'>" + + itemsx[ii].getElementsByTagName("name")[0].childNodes[0].nodeValue +"</a></td>"; + display +="<td class='itemCell'>" + itemsx[ii].getElementsByTagName("description")[0].childNodes[0].nodeValue +"</td>"; + display +="<td class='itemCell'>" + itemsx[ii].getElementsByTagName("tags")[0].childNodes[0].nodeValue +"</td>"; + display +="<td class='itemCell' style='text-align: right'>" + itemsx[ii].getElementsByTagName("price")[0].childNodes[0].nodeValue +"</td>"; + display +="</tr>"; + } + display += "</table>"; + document.getElementById(componentId).innerHTML=display; + document.getElementById(componentId).style.visibility='visible'; + } else if (evt.status == 204){ + alert("204 return"); + } + } + } + + + function checkQueryString() { + <!-- add script to check for tag in query string, if exists then retrieve data --> + var iPos=window.location.href.indexOf("?tag="); + if(iPos > -1) { + // have tag so retrieve items + retrieveItems(window.location.href.substr(iPos + 5)); + } + } + + </script> + </head> + <body onload="checkQueryString();"> + <jsp:include page="banner.jsp" /> + <f:view> + + <ui5:popupTag id="pop1" xmlHttpRequestURL="../lookup.jsp?popupView=2&itemId=" + elementNamePairs="name=value1,description=value2,price=value3,image=imageId"> + <!-- Used as spaces to center the table, this could be done programmatically, + but browser diff, so I left it in the hands of the component user. The image is located + in the component jar so for retrieval, push it through the faces servlet --> + <img id="spaceImage" height="10px" width="10px" src="${pageContext.request.contextPath}/faces/static/META-INF/popup/images/spacer.gif" align="left"> + <table border="0" width="270px" bgcolor="#ffffff" cellpadding="5" cellspacing="5"> + <tr> + <td align="left" valign="top"><b>Name:</b> + <span id="value1">Loading Data...</span></td> + </tr> + <tr> + <td align="left" valign="top"><b>Seller Address:</b> + <span id="value2">Loading Data...</span></td> + </tr> + <tr> + <td align="left" valign="top"><b>Price:</b> + <span id="value3">Loading Data...</span></td> + </tr> + <tr> + <td colspan="2" align="center"><img name="image" id="imageId" src="" + alt="[Loading Image...]" border="2"/><br/><br/></td> + </tr> + </table> + </ui5:popupTag> + <center> + <h1>Tag Page</h1> + <table border="0"> + <tr> +<% + String style=null; + int refx=0, ii=0; + for(Tag tag : tags) { + refx=tag.getRefCount() / 5; + if(refx >= 3) { + style="xxlarge"; + } else if(refx == 2) { + style="xlarge"; + } else if(refx == 1) { + style="large"; + } else { + style="medium"; + } + + if((ii % 6) == 0) out.println("</tr>\n<tr>"); + //out.println("<td class='tagCell'><span onclick="retrieveItems('" + tag.getTag() + "')" class='" + style +"'>" + tag.getTag() + "</span> (" + tag.getRefCount() + ")</td>"); + out.println("<td class='tagCell'><span onclick="retrieveItems('" + tag.getTag() + "')" class='" + style +"'>" + tag.getTag() + "</span></td>"); + ii++; + } +%> + </tr> + </table> + <div id="displayItems" class="items"> + + </div> + </center> + </f:view> + <br/><br/><br/><br/> + <jsp:include page="footer.jsp" /> + + </body> +</html> + +<% + } catch(Exception e) { + e.printStackTrace(); + } +%> diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/tagItemLookup.jsp b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/tagItemLookup.jsp new file mode 100644 index 0000000..05ef352 --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/tagItemLookup.jsp @@ -0,0 +1,45 @@ +<%-- Copyright 2006 Sun Microsystems, Inc. All rights reserved. You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at: http://developer.sun.com/berkeley_license.html +$Id: tagItemLookup.jsp,v 1.4 2007/01/19 21:47:31 basler Exp $ --%> + +<%@page contentType="text/xml"%> +<%@page pageEncoding="UTF-8"%> +<%@page import="java.util.*, java.text.NumberFormat, com.sun.javaee.blueprints.petstore.model.CatalogFacade, com.sun.javaee.blueprints.petstore.model.Item, com.sun.javaee.blueprints.petstore.model.Tag"%> + +<% + String sxTag=request.getParameter("tag"); + + try { + response.setHeader("Pragma", "No-Cache"); + response.setHeader("Cache-Control", "no-cache,no-store,max-age=0"); + response.setDateHeader("Expires", 1); + + ServletContext context=config.getServletContext(); + CatalogFacade cf=(CatalogFacade)context.getAttribute("CatalogFacade"); + Tag tag=cf.getTagWithPersistentItems(sxTag); + out.println("<response>"); + + if(tag != null) { + out.println("<tag>" + tag.getTag() + "</tag>"); + out.println("<items>"); + Collection<Item> items=tag.getItems(); + for(Item item : items) { + if(item.getDisabled() == 0) { + out.println("<item>"); + out.println("<itemID>" + item.getItemID() + "</itemID>"); + out.println("<productID>" + item.getProductID() + "</productID>"); + out.println("<name><![CDATA[" + item.getName() + "]]></name>"); + out.println("<description><![CDATA[" + item.getDescription() + "]]></description>"); + out.println("<tags><![CDATA[" + item.tagsAsString() + "]]></tags>"); + out.println("<price><![CDATA[" + NumberFormat.getCurrencyInstance(java.util.Locale.US).format(item.getPrice()) + "]]></price>"); + out.println("</item>"); + } + } + out.println("</items>"); + } + out.println("</response>"); + out.flush(); + } catch(Exception ee) { + ee.printStackTrace(); + } + +%> diff --git a/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/testis.jsp b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/testis.jsp new file mode 100644 index 0000000..e5dd68a --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/testis.jsp @@ -0,0 +1,36 @@ +<%@page contentType="text/html"%> +<%@page pageEncoding="UTF-8"%> +<%-- +The taglib directive below imports the JSTL library. If you uncomment it, +you must also add the JSTL library to the project. The Add Library... action +on Libraries node in Projects view can be used to add the JSTL 1.1 library. +--%> +<%-- +<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> +--%> + +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" + "http://www.w3.org/TR/html4/loose.dtd"> + +<html> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> + <title>JSP Page</title> + </head> + <body> + + <h1>JSP Page</h1> + + <%-- + This example uses JSTL, uncomment the taglib directive above. + To test, display the page like this: index.jsp?sayHello=true&name=Murphy + --%> + <%-- + <c:if test="${param.sayHello}"> + <!-- Let's welcome the user ${param.name} --> + Hello ${param.name}! + </c:if> + --%> + + </body> +</html> diff --git a/etc/samples/provisioning/sample-bundle/src/main/scripts/assembly.xml b/etc/samples/provisioning/sample-bundle/src/main/scripts/assembly.xml new file mode 100644 index 0000000..942e5f9 --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/scripts/assembly.xml @@ -0,0 +1,41 @@ +<?xml version="1.0"?> + +<!-- $Id$ --> + +<assembly> + <!-- The id gets appended to the end of the zipfile name unless + it's an empty string, so make it an empty string. --> + <id></id> + <formats> + <format>zip</format> + </formats> + <includeBaseDirectory>false</includeBaseDirectory> + <baseDirectory>target/bundle</baseDirectory> + <fileSets> + <fileSet> + <directory>target/bundle</directory> + <outputDirectory>/</outputDirectory> + <includes> + <include>**/*</include> + </includes> + <excludes> + <exclude>**/*.sh</exclude> + <exclude>**/*.so</exclude> + <exclude>**/*.sl</exclude> + <exclude>**/*.dylib</exclude> + </excludes> + </fileSet> + <fileSet> + <directory>target/bundle</directory> + <outputDirectory>/</outputDirectory> + <includes> + <include>**/*.sh</include> + <include>**/*.so</include> + <include>**/*.sl</include> + <include>**/*.dylib</include> + </includes> + <fileMode>0755</fileMode> + </fileSet> + </fileSets> +</assembly> + diff --git a/etc/samples/provisioning/sample-bundle/src/main/scripts/build.xml b/etc/samples/provisioning/sample-bundle/src/main/scripts/build.xml new file mode 100644 index 0000000..fed3f16 --- /dev/null +++ b/etc/samples/provisioning/sample-bundle/src/main/scripts/build.xml @@ -0,0 +1,63 @@ +<?xml version="1.0"?> + +<!-- $Id$ --> + +<project name="sample-bundle" basedir="." default="build"> + + <target name="build"> + + <!-- download JBossAS 6.0 dist from sourceforge and unzip it --> + <property name="tmp.dir" location="${java.io.tmpdir}/${user.name}"/> + <echo>tmp.dir="${tmp.dir}"</echo> + <mkdir dir="${tmp.dir}"/> + + <get src="http://downloads.sourceforge.net/project/jboss/JBoss/JBoss-6.0.0.M3/jboss-as..." + dest="${tmp.dir}/jbossas.zip" + usetimestamp="true"/> + <property name="jboss.home" location="target/jbossas-petstore"/> + <echo>jboss.home="${jboss.home}"</echo> + <mkdir dir="${jboss.home}"/> + <unzip src="${tmp.dir}/jbossas.zip" dest="${jboss.home}"> + <mapper> + <globmapper from="jboss-6.0.0.20100429-M3/*" to="*"/> + </mapper> + </unzip> + + <!-- delete all server configs, except 'default' --> + <delete includeemptydirs="true"> + <fileset dir="${jboss.home}/server"> + <exclude name="default/**"/> + </fileset> + </delete> + + <!-- delete docs dir and README files... --> + <delete dir="${jboss.home}/docs"/> + <delete> + <fileset dir="${jboss.home}" includes="*.*" /> + </delete> + + <property name="jboss.config.dir" location="${jboss.home}/server/default"/> + + <echo>Copying Derby JDBC driver jar to $${jboss.home}/server/default/lib/...</echo> + <copy file="${settings.localRepository}/org/apache/derby/derbyclient/${derbyclient.version}/derbyclient-${derbyclient.version}.jar" + toDir="${jboss.config.dir}/lib" failonerror="false" verbose="true" /> + + <!-- copy petstore files into the jbossas install --> + <copy todir="${jboss.home}"> + <fileset dir="src/main/petstore"/> + </copy> + + <mkdir dir="target/bundle"/> + + <!-- zip up our modified jbossas install - this zipfile will be used as a bundle file --> + <zip destfile="target/bundle/jbossas-petstore.zip" basedir="${jboss.home}"/> + + <!-- copy the recipe and other bundle files into the bundle --> + <copy todir="target/bundle"> + <fileset dir="src/main/bundle"/> + </copy> + + </target> + +</project> + diff --git a/etc/samples/sample-bundle/pom.xml b/etc/samples/sample-bundle/pom.xml deleted file mode 100644 index 6bd4a88..0000000 --- a/etc/samples/sample-bundle/pom.xml +++ /dev/null @@ -1,92 +0,0 @@ -<?xml version="1.0"?> - -<!-- $Id$ --> - -<project xmlns="http://maven.apache.org/POM/4.0.0" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd%22%3E - - <modelVersion>4.0.0</modelVersion> - - <groupId>org.rhq.sample</groupId> - <artifactId>rhq-sample-bundle</artifactId> - <version>2.0</version> - <packaging>pom</packaging> - - <name>RHQ Sample Bundle</name> - <description>a sample bundle consisting of JBossAS 6.0 running the Java Petstore application</description> - - <scm> - <connection>scm:git:ssh://git.fedorahosted.org/git/rhq.git/etc/modules/sample-bundle/</connection> - <developerConnection>scm:git:ssh://git.fedorahosted.org/git/rhq.git/etc/modules/sample-bundle/</developerConnection> - </scm> - - <properties> - <!-- dependency versions --> - <derbyclient.version>10.5.3.0_1</derbyclient.version> - </properties> - - <dependencies> - - <!-- Derby JDBC driver --> - <dependency> - <groupId>org.apache.derby</groupId> - <artifactId>derbyclient</artifactId> - <version>${derbyclient.version}</version> - </dependency> - - </dependencies> - - <build> - - <plugins> - - <plugin> - <artifactId>maven-antrun-plugin</artifactId> - <executions> - <execution> - <id>prepare-bundle</id> - <phase>process-resources</phase> - <configuration> - <tasks> - <echo>settings.localRepository=${settings.localRepository}</echo> - <echo>project.build.outputDirectory=${project.build.outputDirectory}</echo> - <ant antfile="src/main/scripts/build.xml"> - <property name="settings.localRepository" value="${settings.localRepository}"/> - <property name="project.version" value="${project.version}"/> - <property name="project.build.outputDirectory" value="${project.build.outputDirectory}"/> - <property name="derbyclient.version" value="${derbyclient.version}"/> - </ant> - </tasks> - </configuration> - <goals> - <goal>run</goal> - </goals> - </execution> - </executions> - </plugin> - - <plugin> - <artifactId>maven-assembly-plugin</artifactId> - <configuration> - <descriptors> - <descriptor>src/main/scripts/assembly.xml</descriptor> - </descriptors> - <finalName>${project.build.finalName}</finalName> - </configuration> - <executions> - <execution> - <id>assemble-bundle</id> - <phase>package</phase> - <goals> - <goal>attached</goal> - </goals> - </execution> - </executions> - </plugin> - - </plugins> - </build> - -</project> - diff --git a/etc/samples/sample-bundle/src/main/bundle/deploy.xml b/etc/samples/sample-bundle/src/main/bundle/deploy.xml deleted file mode 100644 index 8bfec17..0000000 --- a/etc/samples/sample-bundle/src/main/bundle/deploy.xml +++ /dev/null @@ -1,57 +0,0 @@ -<?xml version="1.0"?> - -<project name="petstore" default="main" - xmlns:rhq="antlib:org.rhq.bundle"> - - <rhq:bundle name="Java Petstore" version="2.0" - description="a sample bundle consisting of JBossAS 6.0 running the Java Petstore application"> - - <rhq:input-property - name="jboss.bind.address" - description="the IP address the JBoss AS server should bind to" - required="true"/> - - <rhq:input-property - name="http.port" - description="the HTTP port the JBoss AS server should listen on" - required="true" - type="integer"/> - - <rhq:input-property - name="https.port" - description="the HTTPS port the JBoss AS server should listen on" - required="true" - type="integer"/> - - <rhq:deployment-unit name="appserver" - preinstallTarget="appserver-preinstall" postinstallTarget="appserver-postinstall"> - <rhq:system-service name="jbossas-petstore" scriptFile="jbossas-init-script" - configFile="jbossas-init-config" overwriteScript="true" - startLevels="3,4,5" startPriority="80" stopPriority="20"/> - - <rhq:archive name="jbossas-petstore.zip"/> - - <!-- the files that should be ignored during upgrades --> - rhq:ignore - rhq:fileset - <include name="server/default/data/**"/> - <include name="server/default/logs/**"/> - <include name="server/default/tmp/**"/> - <include name="server/default/work/**"/> - </rhq:fileset> - </rhq:ignore> - </rhq:deployment-unit> - - </rhq:bundle> - - <target name="main"/> - - <target name="appserver-preinstall"> - <echo>Installing Java Petstore App Server to ${rhq.deploy.dir}...</echo> - </target> - - <target name="appserver-postinstall"> - <echo>Done installing Java Petstore App Server to ${rhq.deploy.dir}.</echo> - </target> - -</project> diff --git a/etc/samples/sample-bundle/src/main/bundle/jbossas-init-config b/etc/samples/sample-bundle/src/main/bundle/jbossas-init-config deleted file mode 100644 index a2fc4c1..0000000 --- a/etc/samples/sample-bundle/src/main/bundle/jbossas-init-config +++ /dev/null @@ -1,69 +0,0 @@ -# Configuration file for jbossas init script that configures the -# settings needed to start a particular JBoss AS instance. - -# -# the JBoss AS installation directory (e.g. /opt/jboss-6.0.0.M1) -# (*REQUIRED*) -# -JBOSS_HOME="@@rhq.deploy.dir@@" - -# -# the args that will be passed to run.sh -# (i.e. org.jboss.Main). -# -JBOSS_OPTS="-b @@jboss.bind.address@@" - -# What UNIX user the JBoss AS java process will run as. -# (The shutdown client is always run as the invoker of the -# init script). JBoss AS will be run as root by default, but, for -# the sake of security, it is recommended that you chown the JBoss -# AS installation files to a non-root user and use that use here. -# Note, you do need to run as root if your server will listen on one -# or more privileged (< 1024) ports. If you really do want to run as -# root, comment out the JBOSS_USER variable completely (i.e. do not -# set it to root). This will run the server process without "su". -#JBOSS_USER=jboss - -# -# Specify the maximum file descriptor limit, use "max" or "maximum" to use -# the default, as queried by the system. -# -# Defaults to "maximum" -# -#MAX_FD="maximum" - -# -# Specify the profiler configuration file to load. -# -# Default is to not load profiler configuration file. -# -#PROFILER= - -# -# Specify the location of the Java Rntime Environment (JRE) or -# Java Development Kit (JDK) installation directory. If not set, -# "/usr/java/default" will be used. -# -#JAVA_HOME="/usr/java/default" - -# -# Specify options to pass to the Java VM (if unset, a default -# set of options will be used). -# -# Note, if you want to pass the default options but some of -# your own additional options in, then set the -# ADDITIONAL_JAVA_OPTS variable (see below), rather than JAVA_OPTS. -# -#JAVA_OPTS="-Xms128M -Xmx512M -XX:MaxPermSize=256M -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Djava.net.preferIPv4Stack=true" - -# -# Specify additional options to pass to the Java VM. These are passed -# in addition to the default set of options, -# i.e. java $JAVA_OPTS $ADDITIONAL_JAVA_OPTS ... org.jboss.Main ... -# -# Sample JPDA settings (uncomment either a) or b)) -# a) remote socket debugging -#ADDITIONAL_JAVA_OPTS="-Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n" -# b) shared memory debugging -#ADDITIONAL_JAVA_OPTS="-Xrunjdwp:transport=dt_shmem,server=y,suspend=n,address=jboss" - diff --git a/etc/samples/sample-bundle/src/main/bundle/jbossas-init-script b/etc/samples/sample-bundle/src/main/bundle/jbossas-init-script deleted file mode 100755 index 58eb98e..0000000 --- a/etc/samples/sample-bundle/src/main/bundle/jbossas-init-script +++ /dev/null @@ -1,328 +0,0 @@ -#!/bin/bash -# -# jbossas - This shell script takes care of starting and stopping -# a JBoss Application Server (AS) instance on a Red Hat -# Linux system. It can be run as a system service (init -# script) and/or run manually. -# -# chkconfig: 345 84 16 -# description: JBoss AS server -# processname: java -# pidfile: /var/run/jbossas.pid - -# Source init-script function library. -FUNCTIONS=/etc/rc.d/init.d/functions -if [ ! -f "$FUNCTIONS" ]; then - echo "Functions library ($FUNCTIONS) not found." >&2 - exit 1 -fi -. $FUNCTIONS - -# Find the name of this service (e.g. "jbossas"). -NAME=`basename $0` -if [ ${NAME:0:1} = "S" -o ${NAME:0:1} = "K" ]; then - NAME=${NAME:3} -fi - -# Set names of pid, lock, and log files - all based on the service name. -PIDFILE="/var/run/$NAME.pid" -LOCKFILE="/var/lock/subsys/$NAME" -LOGFILE="/var/log/$NAME.log" - -# Set defaults for optional configuration variables. -JAVA_HOME="/usr/java/default" -JAVA_OPTS="-Xms128M -Xmx512M -XX:MaxPermSize=256M" -JAVA_OPTS="$JAVA_OPTS -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000" -# (Prefer IPv4 stack as as temporary workaround to avoid 'all' config startup -# issues from IPv4 multicast addresses. See JBAS-7936.) -JAVA_OPTS="$JAVA_OPTS -Djava.net.preferIPv4Stack=true" - -# Source the service's config file, potentially overriding the defaults set -# above. -CONFIG="/etc/sysconfig/${NAME}" -if [ ! -f "$CONFIG" ]; then - echo "Required configuration file $CONFIG not found." >&2 - exit 1 -fi -. "$CONFIG" - -# Bail out if required variables were not set in the config file. -if [ -z "$JBOSS_HOME" ]; then - echo "Required variable JBOSS_HOME was not set in $CONFIG." >&2 - exit 1 -fi - - -start() -{ - # See if the service is already running, and, if so, exit with an error. - PID=`pidfileofproc "$NAME"` - if [ -n "$PID" ]; then - # pid file exists - see if process is actually running. - kill -0 $PID 2>/dev/null - if [ $? -eq 0 ]; then - echo "$NAME service is already running (pid=$PID)." >&2 - exit 1 - else - echo "Removing bogus pid file $PIDFILE..." - rm -f "$PIDFILE" - if [ -f "$LOCKFILE" ]; then - echo "Removing bogus lock file $LOCKFILE..." - rm -f "$LOCKFILE" - fi - fi - fi - - # Check that JAVA_HOME is valid. - JAVA="$JAVA_HOME/bin/java" - if [ ! -f "$JAVA" ]; then - echo "Java not found at $JAVA - please set JAVA_HOME in $CONFIG." >&2 - exit 1 - fi - if [ ! -x "$JAVA" ]; then - echo "$JAVA is not executable." >&2 - exit 5 - fi - - # Setup the classpath - JBOSS_BOOT_CLASSPATH="$JBOSS_HOME/bin/run.jar" - if [ ! -f "$JBOSS_BOOT_CLASSPATH" ]; then - echo "Missing required file: $JBOSS_BOOT_CLASSPATH" >&2 - exit 1 - fi - - # By default, Tomcat uses the JDT Compiler for compiling JSPs. However, - # include tools.jar in the classpath if we can find it under JAVA_HOME - # or if the user specified it via the JAVAC_JAR variable. - JAVAC_JAR_FILE="${JAVAC_JAR:-$JAVA_HOME/lib/tools.jar}" - if [ ! -f "$JAVAC_JAR_FILE" ]; then - [ -n "$JAVAC_JAR" ] && echo "Missing javac jar file $JAVAC_JAR as defined by the JAVAC_JAR variable. Unexpected results may occur." - unset JAVAC_JAR_FILE - fi - - # If -server not set in JAVA_OPTS, set it, if supported. - SERVER_SET=`echo $JAVA_OPTS | grep "-server"` - if [ -z "$SERVER_SET" ]; then - # Check for Sun JVM w/ HotSpot support. - HAS_HOTSPOT=`"$JAVA" -version 2>&1 | grep -i HotSpot` - - # Check for OpenJDK JVM w/ server support. - HAS_OPENJDK=`"$JAVA" -version 2>&1 | grep -i OpenJDK` - - # Enable -server if we have Hotspot or OpenJDK, unless we can't - if [ -n "$HAS_HOTSPOT" ] || [ -n "$HAS_OPENJDK" ]; then - JAVA_OPTS="-server $JAVA_OPTS" - fi - fi - - # Setup JBoss-specific properties. - JAVA_OPTS="-Dprogram.name=$NAME $JAVA_OPTS" - - # Setup JBoss Native library path. - unset JBOSS_NATIVE_DIR - for DIR in "$JBOSS_HOME/../native/lib" "$JBOSS_HOME/../native" "$JBOSS_HOME/../native/lib64" "$JBOSS_HOME/native/lib64" "$JBOSS_HOME/native/bin" "$JBOSS_HOME/bin/native"; do - if [ -d "$DIR" ]; then - JBOSS_NATIVE_DIR=`cd "$DIR/.." && pwd` - break - fi - done - if [ -d "$JBOSS_NATIVE_DIR" ]; then - IS_64_BIT_JVM=`"$JAVA" $JAVA_OPTS -version 2>&1 | grep -i 64-bit` - if [ -n "$IS_64_BIT_JVM" ]; then - JBOSS_NATIVE_DIR="$JBOSS_NATIVE_DIR/lib64" - else - JBOSS_NATIVE_DIR="$JBOSS_NATIVE_DIR/lib" - fi - LD_LIBRARY_PATH="$JBOSS_NATIVE_DIR${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" - export LD_LIBRARY_PATH - JAVA_OPTS="$JAVA_OPTS -Djava.library.path=$LD_LIBRARY_PATH" - fi - - # Setup the Java endorsed dirs. - JBOSS_ENDORSED_DIRS="$JBOSS_HOME/lib/endorsed" - JAVA_OPTS="$JAVA_OPTS -Djava.endorsed.dirs="$JBOSS_ENDORSED_DIRS"" - - # Setup the Java classpath. - JBOSS_CLASSPATH="${JBOSS_CLASSPATH:+$JBOSS_CLASSPATH:$JBOSS_BOOT_CLASSPATH}" - JBOSS_CLASSPATH="${JBOSS_CLASSPATH:-$JBOSS_BOOT_CLASSPATH}" - JBOSS_CLASSPATH="$JBOSS_CLASSPATH${JAVAC_JAR_FILE:+:$JAVAC_JAR_FILE}" - JAVA_OPTS="$JAVA_OPTS -classpath "$JBOSS_CLASSPATH"" - - # Display a summary of our environment if we're associated with a terminal. - if tty -s; then - echo "========================================================================="; echo - echo " JBoss AS Bootstrap Environment" ; echo - echo " JBOSS_HOME: $JBOSS_HOME" ; echo - echo " JAVA: $JAVA" ; echo - echo " JAVA_OPTS: $JAVA_OPTS" ; echo - echo " JBOSS_OPTS: $JBOSS_OPTS" ; echo - echo "========================================================================="; echo - fi - - # JBoss AS expects its current working dir to be $JBOSS_HOME/bin - cd "$JBOSS_HOME/bin" - - # JBoss AS expects JBOSS_HOME to be set in its environment. - export JBOSS_HOME - - # We only need to bother with nohup if we're associated with a terminal. - if tty -s; then - NOHUP=nohup - else - unset NOHUP - fi - - # If they set NICELEVEL in the config file, honor it. - [ -n "${NICELEVEL:-}" ] && NICE="nice -n $NICELEVEL" - - # If JBOSS_USER was specified in the config and current user is root, we - # want to setuid the JBoss AS process to JBOSS_USER. - if [ -n "$JBOSS_USER" ] && [ "$EUID" -eq 0 ]; then - # For SELinux we need to use 'runuser', not 'su'. - if [ -x /sbin/runuser ]; then - SU=runuser - else - SU=su - fi - else - unset SU - fi - - if [ -n "$SU" ]; then - WRAPPER="$NOHUP $NICE $SU -s /bin/bash - $JBOSS_USER -c" - else - WRAPPER="$NOHUP $NICE bash -c" - fi - - # Make sure log file exists and has correct ownership and permissions. - if [ "$EUID" -eq 0 ]; then - touch -a "$LOGFILE" || exit 4 - [ -n "$JBOSS_USER" ] && chown $JBOSS_USER "$LOGFILE" - [ -n "$JBOSS_GROUP" ] && chgrp $JBOSS_GROUP "$LOGFILE" - chmod u=rw "$LOGFILE" - [ -n "$JBOSS_GROUP" ] && chmod g+r "$LOGFILE" - [ -x /sbin/restorecon ] && /sbin/restorecon "$LOGFILE" - fi - - # Make sure pid file has correct ownership and permissions. - if [ "$EUID" -eq 0 ] && [ -f "$PIDFILE" ]; then - [ -n "$JBOSS_USER" ] && chown $JBOSS_USER "$PIDFILE" - [ -n "$JBOSS_GROUP" ] && chgrp $JBOSS_GROUP "$PIDFILE" - chmod u=rw "$PIDFILE" - [ -n "$JBOSS_GROUP" ] && chmod g+r - [ -x /sbin/restorecon ] && /sbin/restorecon "$PIDFILE" - fi - - echo -n "Starting $NAME service: " - - # Make sure to escape the $$'s within the subshell to prevent our own shell - # from evaluating them and writing our own pid to the pid file. - $WRAPPER "echo $$ >"$PIDFILE" || ( echo "Failed to write pid ($$) to $PIDFILE." >&2; exit 4 ); exec "$JAVA" $JAVA_OPTS org.jboss.Main $JBOSS_OPTS" >>"$LOGFILE" 2>&1 & - if [ $? -ne 0 ]; then - failure "$NAME startup" - echo - EXIT_STATUS=$? - fi - - # Wait a few seconds and then check that the process is running. Note, this - # will *not* verify that JBoss AS started properly without any configuration - # or deployment errors. - sleep 3 - - if pidfileofproc "$NAME"; then - success "$NAME startup" - echo - touch "$LOCKFILE" - EXIT_STATUS=0 - else - failure "$NAME startup" - echo - EXIT_STATUS=1 - fi -} - -stop() -{ - # See if service is running, and, if not, exit without any error. - PID=`pidfileofproc "$NAME"` - unset NOT_RUNNING - if [ -z "$PID" ]; then - NOT_RUNNING=1 - else - # pid file exists - see if process is actually running. - kill -0 $PID 2>/dev/null - if [ $? -ne 0 ]; then - NOT_RUNNING=1 - if [ -f "$PIDFILE" ]; then - echo "Removing bogus pid file $PIDFILE..." - rm -f "$PIDFILE" - fi - if [ -f "$LOCKFILE" ]; then - echo "Removing bogus lock file $LOCKFILE..." - rm -f "$LOCKFILE" - fi - fi - fi - if [ -n "$NOT_RUNNING" ]; then - echo "$NAME service is not running." - exit 0 - fi - - echo -n "Stopping $NAME service: " - killproc -d 30 "$NAME" - EXIT_STATUS=$? - if [ $EXIT_STATUS -eq 0 ]; then - rm -f "$LOCKFILE" - fi - echo -} - -# NOTE: We don't name this function 'status', since that would override the -# 'status function defined in /etc/init.d/functions. -_status() -{ - status "$NAME" - EXIT_CODE=$? -} - -restart() -{ - stop || exit $? - start -} - -condrestart() -{ - [ -f "$PIDFILE" ] && restart -} - -usage() -{ - echo "Usage: $NAME {start|stop|status|restart|condrestart}" >&2 - EXIT_CODE=2 -} - -# The -case "$1" in - start) - start - ;; - stop) - stop - ;; - status) - _status - ;; - restart) - restart - ;; - condrestart) - condrestart - ;; - *) - usage - ;; -esac - -exit $EXIT_STATUS - diff --git a/etc/samples/sample-bundle/src/main/petstore/petstore-db.changelog.xml b/etc/samples/sample-bundle/src/main/petstore/petstore-db.changelog.xml deleted file mode 100644 index 42ced88..0000000 --- a/etc/samples/sample-bundle/src/main/petstore/petstore-db.changelog.xml +++ /dev/null @@ -1,187 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog/1.9" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog/1.9 http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-1.9.xsd"> - <changeSet author="ips (generated)" id="1272025063915-1"> - <createTable schemaName="APP" tableName="ADDRESS"> - <column name="ADDRESSID" type="VARCHAR(10)"> - <constraints nullable="false" primaryKey="true" primaryKeyName="SQL100422173635960"/> - </column> - <column name="STREET1" type="VARCHAR(55)"> - <constraints nullable="false"/> - </column> - <column name="STREET2" type="VARCHAR(55)"/> - <column name="CITY" type="VARCHAR(55)"> - <constraints nullable="false"/> - </column> - <column name="STATE" type="VARCHAR(25)"> - <constraints nullable="false"/> - </column> - <column name="ZIP" type="VARCHAR(5)"> - <constraints nullable="false"/> - </column> - <column name="LATITUDE" type="DECIMAL(14,10)"> - <constraints nullable="false"/> - </column> - <column name="LONGITUDE" type="DECIMAL(14,10)"> - <constraints nullable="false"/> - </column> - </createTable> - </changeSet> - <changeSet author="ips (generated)" id="1272025063915-2"> - <createTable schemaName="APP" tableName="CATEGORY"> - <column name="CATEGORYID" type="VARCHAR(10)"> - <constraints nullable="false" primaryKey="true" primaryKeyName="SQL100422173635550"/> - </column> - <column name="NAME" type="VARCHAR(25)"> - <constraints nullable="false"/> - </column> - <column name="DESCRIPTION" type="VARCHAR(255)"> - <constraints nullable="false"/> - </column> - <column name="IMAGEURL" type="VARCHAR(55)"/> - </createTable> - </changeSet> - <changeSet author="ips (generated)" id="1272025063915-3"> - <createTable schemaName="APP" tableName="ID_GEN"> - <column name="GEN_KEY" type="VARCHAR(20)"> - <constraints nullable="false" primaryKey="true" primaryKeyName="SQL100422173636590"/> - </column> - <column name="GEN_VALUE" type="INT"> - <constraints nullable="false"/> - </column> - </createTable> - </changeSet> - <changeSet author="ips (generated)" id="1272025063915-4"> - <createTable schemaName="APP" tableName="ITEM"> - <column name="ITEMID" type="VARCHAR(10)"> - <constraints nullable="false" primaryKey="true" primaryKeyName="SQL100422173636230"/> - </column> - <column name="PRODUCTID" type="VARCHAR(10)"> - <constraints nullable="false"/> - </column> - <column name="NAME" type="VARCHAR(30)"> - <constraints nullable="false"/> - </column> - <column name="DESCRIPTION" type="VARCHAR(500)"> - <constraints nullable="false"/> - </column> - <column name="IMAGEURL" type="VARCHAR(55)"/> - <column name="IMAGETHUMBURL" type="VARCHAR(55)"/> - <column name="PRICE" type="DECIMAL(14,2)"> - <constraints nullable="false"/> - </column> - <column name="ADDRESS_ADDRESSID" type="VARCHAR(10)"> - <constraints nullable="false"/> - </column> - <column name="CONTACTINFO_CONTACTINFOID" type="VARCHAR(10)"> - <constraints nullable="false"/> - </column> - <column name="TOTALSCORE" type="INT"> - <constraints nullable="false"/> - </column> - <column name="NUMBEROFVOTES" type="INT"> - <constraints nullable="false"/> - </column> - <column name="DISABLED" type="INT"> - <constraints nullable="false"/> - </column> - </createTable> - </changeSet> - <changeSet author="ips (generated)" id="1272025063915-5"> - <createTable schemaName="APP" tableName="PRODUCT"> - <column name="PRODUCTID" type="VARCHAR(10)"> - <constraints nullable="false" primaryKey="true" primaryKeyName="SQL100422173635740"/> - </column> - <column name="CATEGORYID" type="VARCHAR(10)"> - <constraints nullable="false"/> - </column> - <column name="NAME" type="VARCHAR(25)"> - <constraints nullable="false"/> - </column> - <column name="DESCRIPTION" type="VARCHAR(255)"> - <constraints nullable="false"/> - </column> - <column name="IMAGEURL" type="VARCHAR(55)"/> - </createTable> - </changeSet> - <changeSet author="ips (generated)" id="1272025063915-6"> - <createTable schemaName="APP" tableName="SELLERCONTACTINFO"> - <column name="CONTACTINFOID" type="VARCHAR(10)"> - <constraints nullable="false" primaryKey="true" primaryKeyName="SQL100422173636080"/> - </column> - <column name="LASTNAME" type="VARCHAR(24)"> - <constraints nullable="false"/> - </column> - <column name="FIRSTNAME" type="VARCHAR(24)"> - <constraints nullable="false"/> - </column> - <column name="EMAIL" type="VARCHAR(24)"> - <constraints nullable="false"/> - </column> - </createTable> - </changeSet> - <changeSet author="ips (generated)" id="1272025063915-7"> - <createTable schemaName="APP" tableName="TAG"> - <column name="TAGID" type="INT"> - <constraints nullable="false" primaryKey="true" primaryKeyName="SQL100422173636830"/> - </column> - <column name="TAG" type="VARCHAR(30)"> - <constraints nullable="false"/> - </column> - <column name="REFCOUNT" type="INT"> - <constraints nullable="false"/> - </column> - </createTable> - </changeSet> - <changeSet author="ips (generated)" id="1272025063915-8"> - <createTable schemaName="APP" tableName="TAG_ITEM"> - <column name="TAGID" type="INT"> - <constraints nullable="false"/> - </column> - <column name="ITEMID" type="VARCHAR(10)"> - <constraints nullable="false"/> - </column> - </createTable> - </changeSet> - <changeSet author="ips (generated)" id="1272025063915-9"> - <createTable schemaName="APP" tableName="ZIPLOCATION"> - <column name="ZIPCODE" type="INT"> - <constraints nullable="false" primaryKey="true" primaryKeyName="SQL100422173636710"/> - </column> - <column name="CITY" type="VARCHAR(30)"> - <constraints nullable="false"/> - </column> - <column name="STATE" type="VARCHAR(2)"> - <constraints nullable="false"/> - </column> - </createTable> - </changeSet> - <changeSet author="ips (generated)" id="1272025063915-10"> - <createIndex indexName="SQL100422173636831" schemaName="APP" tableName="TAG" unique="true"> - <column name="TAG"/> - </createIndex> - </changeSet> - <changeSet author="ips (generated)" id="1272025063915-11"> - <createIndex indexName="SQL100422173637010" schemaName="APP" tableName="TAG_ITEM" unique="true"> - <column name="TAGID"/> - <column name="ITEMID"/> - </createIndex> - </changeSet> - <changeSet author="ips (generated)" id="1272025063915-12"> - <addForeignKeyConstraint baseColumnNames="ADDRESS_ADDRESSID" baseTableName="ITEM" baseTableSchemaName="APP" constraintName="SQL100422173636231" deferrable="false" initiallyDeferred="false" referencedColumnNames="ADDRESSID" referencedTableName="ADDRESS" referencedTableSchemaName="APP"/> - </changeSet> - <changeSet author="ips (generated)" id="1272025063915-13"> - <addForeignKeyConstraint baseColumnNames="CONTACTINFO_CONTACTINFOID" baseTableName="ITEM" baseTableSchemaName="APP" constraintName="SQL100422173636233" deferrable="false" initiallyDeferred="false" referencedColumnNames="CONTACTINFOID" referencedTableName="SELLERCONTACTINFO" referencedTableSchemaName="APP"/> - </changeSet> - <changeSet author="ips (generated)" id="1272025063915-14"> - <addForeignKeyConstraint baseColumnNames="PRODUCTID" baseTableName="ITEM" baseTableSchemaName="APP" constraintName="SQL100422173636232" deferrable="false" initiallyDeferred="false" referencedColumnNames="PRODUCTID" referencedTableName="PRODUCT" referencedTableSchemaName="APP"/> - </changeSet> - <changeSet author="ips (generated)" id="1272025063915-15"> - <addForeignKeyConstraint baseColumnNames="CATEGORYID" baseTableName="PRODUCT" baseTableSchemaName="APP" constraintName="SQL100422173635741" deferrable="false" initiallyDeferred="false" referencedColumnNames="CATEGORYID" referencedTableName="CATEGORY" referencedTableSchemaName="APP"/> - </changeSet> - <changeSet author="ips (generated)" id="1272025063915-16"> - <addForeignKeyConstraint baseColumnNames="ITEMID" baseTableName="TAG_ITEM" baseTableSchemaName="APP" constraintName="SQL100422173637011" deferrable="false" initiallyDeferred="false" referencedColumnNames="ITEMID" referencedTableName="ITEM" referencedTableSchemaName="APP"/> - </changeSet> - <changeSet author="ips (generated)" id="1272025063915-17"> - <addForeignKeyConstraint baseColumnNames="TAGID" baseTableName="TAG_ITEM" baseTableSchemaName="APP" constraintName="SQL100422173637012" deferrable="false" initiallyDeferred="false" referencedColumnNames="TAGID" referencedTableName="TAG" referencedTableSchemaName="APP"/> - </changeSet> -</databaseChangeLog> diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore-ds.xml b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore-ds.xml deleted file mode 100644 index ae5ea7c..0000000 --- a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore-ds.xml +++ /dev/null @@ -1,42 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<!-- The Derby embedded database JCA connection factory config --> -<!-- See http://www.jboss.org/community/wiki/Multiple1PC for information about local-tx-datasource --> -<!-- $Id: derby-ds.xml 97536 2009-12-08 14:05:07Z jesper.pedersen $ --> - -<datasources> - - <local-tx-datasource> - - <!-- The jndi name of the DataSource, it is prefixed with java:/ --> - <!-- Datasources are not available outside the virtual machine --> - <jndi-name>jdbc/PetstoreDB</jndi-name> - - <!-- for in-process persistent db, saved when jboss stops. The - org.jboss.jdbc.DerbyDatabase mbean is necessary for properly db shutdown --> - <connection-url>jdbc:derby://localhost:1527/petstore;create=true</connection-url> - - <!-- The driver class --> - <driver-class>org.apache.derby.jdbc.ClientDriver</driver-class> - - <!-- The login and password --> - <user-name>APP</user-name> - <password>APP</password> - - <!-- The minimum connections in a pool/sub-pool. Pools are lazily constructed on first use --> - <min-pool-size>5</min-pool-size> - - <!-- The maximum connections in a pool/sub-pool --> - <max-pool-size>20</max-pool-size> - - <!-- The time before an unused connection is destroyed --> - <idle-timeout-minutes>5</idle-timeout-minutes> - - <!-- Whether to check all statements are closed when the connection is returned to the pool, - this is a debugging feature that should be turned off in production --> - <track-statements/> - - </local-tx-datasource> - -</datasources> - diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/META-INF/application.xml b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/META-INF/application.xml deleted file mode 100644 index eadc0f4..0000000 --- a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/META-INF/application.xml +++ /dev/null @@ -1,19 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<application xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/application_1_4.xsd" version="1.4"> - - <display-name>Java Pet Store</display-name> - - <module> - <web> - <web-uri>petstore.war</web-uri> - <context-root>/petstore</context-root> - </web> - </module> - - <module> - <ejb>petstore-ejb.jar</ejb> - </module> - -</application> - diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore-ejb.jar/META-INF/persistence.xml b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore-ejb.jar/META-INF/persistence.xml deleted file mode 100644 index 76e0703..0000000 --- a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore-ejb.jar/META-INF/persistence.xml +++ /dev/null @@ -1,21 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd%22%3E - - <persistence-unit name="PetstorePu"> - <description>Petstore Persistence Unit</description> - <provider>org.hibernate.ejb.HibernatePersistence</provider> - <jta-data-source>java:jdbc/PetstoreDB</jta-data-source> - <non-jta-data-source>java:jdbc/PetstoreDB</non-jta-data-source> - <properties> - <property name="hibernate.dialect" value="org.hibernate.dialect.DerbyDialect"/> - <property name="hibernate.connection.username" value="APP"/> - <property name="hibernate.connection.password" value="APP"/> - <property name="hibernate.format_sql" value="true"/> - </properties> - </persistence-unit> - -</persistence> - diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore-ejb.jar/com/sun/javaee/blueprints/petstore/model/Address.class b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore-ejb.jar/com/sun/javaee/blueprints/petstore/model/Address.class deleted file mode 100644 index c9dc392..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore-ejb.jar/com/sun/javaee/blueprints/petstore/model/Address.class and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore-ejb.jar/com/sun/javaee/blueprints/petstore/model/Category.class b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore-ejb.jar/com/sun/javaee/blueprints/petstore/model/Category.class deleted file mode 100644 index be2275b..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore-ejb.jar/com/sun/javaee/blueprints/petstore/model/Category.class and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore-ejb.jar/com/sun/javaee/blueprints/petstore/model/Item.class b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore-ejb.jar/com/sun/javaee/blueprints/petstore/model/Item.class deleted file mode 100644 index 8842106..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore-ejb.jar/com/sun/javaee/blueprints/petstore/model/Item.class and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore-ejb.jar/com/sun/javaee/blueprints/petstore/model/Product.class b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore-ejb.jar/com/sun/javaee/blueprints/petstore/model/Product.class deleted file mode 100644 index dda3feb..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore-ejb.jar/com/sun/javaee/blueprints/petstore/model/Product.class and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore-ejb.jar/com/sun/javaee/blueprints/petstore/model/SellerContactInfo.class b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore-ejb.jar/com/sun/javaee/blueprints/petstore/model/SellerContactInfo.class deleted file mode 100644 index b5dbe74..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore-ejb.jar/com/sun/javaee/blueprints/petstore/model/SellerContactInfo.class and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore-ejb.jar/com/sun/javaee/blueprints/petstore/model/Tag.class b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore-ejb.jar/com/sun/javaee/blueprints/petstore/model/Tag.class deleted file mode 100644 index 1b5785b..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore-ejb.jar/com/sun/javaee/blueprints/petstore/model/Tag.class and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore-ejb.jar/com/sun/javaee/blueprints/petstore/model/ZipLocation.class b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore-ejb.jar/com/sun/javaee/blueprints/petstore/model/ZipLocation.class deleted file mode 100644 index 591af10..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore-ejb.jar/com/sun/javaee/blueprints/petstore/model/ZipLocation.class and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/META-INF/MANIFEST.MF b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/META-INF/MANIFEST.MF deleted file mode 100644 index 7a679c4..0000000 --- a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/META-INF/MANIFEST.MF +++ /dev/null @@ -1,4 +0,0 @@ -Manifest-Version: 1.0 -Ant-Version: Apache Ant 1.7.1 -Created-By: 16.0-b13 (Sun Microsystems Inc.) - diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/captcha/BlueFilter.class b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/captcha/BlueFilter.class deleted file mode 100644 index abac5a6..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/captcha/BlueFilter.class and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/captcha/CaptchaSingleton.class b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/captcha/CaptchaSingleton.class deleted file mode 100644 index 7d7af77..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/captcha/CaptchaSingleton.class and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/captcha/RandomString.class b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/captcha/RandomString.class deleted file mode 100644 index b8bfa4d..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/captcha/RandomString.class and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/captcha/SimpleCaptcha.class b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/captcha/SimpleCaptcha.class deleted file mode 100644 index 8c469f4..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/captcha/SimpleCaptcha.class and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/AddressBean.class b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/AddressBean.class deleted file mode 100644 index e2b4ca5..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/AddressBean.class and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/AutocompleteBean.class b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/AutocompleteBean.class deleted file mode 100644 index 223289e..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/AutocompleteBean.class and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/CaptchaValidateFilter.class b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/CaptchaValidateFilter.class deleted file mode 100644 index 61f3863..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/CaptchaValidateFilter.class and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/ControllerAction.class b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/ControllerAction.class deleted file mode 100644 index 7c149e3..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/ControllerAction.class and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/ControllerServlet.class b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/ControllerServlet.class deleted file mode 100644 index c5fb59a..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/ControllerServlet.class and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/EntryFilter.class b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/EntryFilter.class deleted file mode 100644 index 65d4cdb..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/EntryFilter.class and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/FileUploadBean.class b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/FileUploadBean.class deleted file mode 100644 index 1ee72ad..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/FileUploadBean.class and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/actions/CaptchaAction.class b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/actions/CaptchaAction.class deleted file mode 100644 index f56c35e..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/actions/CaptchaAction.class and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/actions/CatalogXmlAction.class b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/actions/CatalogXmlAction.class deleted file mode 100644 index 56fc53d..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/actions/CatalogXmlAction.class and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/actions/DefaultControllerAction.class b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/actions/DefaultControllerAction.class deleted file mode 100644 index ee55705..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/actions/DefaultControllerAction.class and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/actions/ImageAction.class b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/actions/ImageAction.class deleted file mode 100644 index 30e70ab..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/actions/ImageAction.class and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/actions/TagXmlAction.class b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/actions/TagXmlAction.class deleted file mode 100644 index dd5b7c1..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/controller/actions/TagXmlAction.class and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/mapviewer/MapBean.class b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/mapviewer/MapBean.class deleted file mode 100644 index 03400b2..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/mapviewer/MapBean.class and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/model/CatalogFacade.class b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/model/CatalogFacade.class deleted file mode 100644 index 23a204c..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/model/CatalogFacade.class and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/model/FileUploadResponse.class b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/model/FileUploadResponse.class deleted file mode 100644 index 18f8102..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/model/FileUploadResponse.class and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/model/PayPalBean.class b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/model/PayPalBean.class deleted file mode 100644 index b6e2b0d..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/model/PayPalBean.class and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/model/RatingBean.class b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/model/RatingBean.class deleted file mode 100644 index be21196..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/model/RatingBean.class and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/proxy/GeoCoder.class b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/proxy/GeoCoder.class deleted file mode 100644 index 185dc01..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/proxy/GeoCoder.class and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/proxy/GeoPoint.class b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/proxy/GeoPoint.class deleted file mode 100644 index 18b3463..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/proxy/GeoPoint.class and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/search/HTMLParser$CallbackHandler.class b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/search/HTMLParser$CallbackHandler.class deleted file mode 100644 index 0c448bf..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/search/HTMLParser$CallbackHandler.class and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/search/HTMLParser.class b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/search/HTMLParser.class deleted file mode 100644 index 4a19fad..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/search/HTMLParser.class and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/search/IndexDocument.class b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/search/IndexDocument.class deleted file mode 100644 index a8b6521..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/search/IndexDocument.class and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/search/Indexer.class b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/search/Indexer.class deleted file mode 100644 index 2b42389..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/search/Indexer.class and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/search/SQLParser.class b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/search/SQLParser.class deleted file mode 100644 index 8ab0084..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/search/SQLParser.class and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/search/SearchBean.class b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/search/SearchBean.class deleted file mode 100644 index a4cc2bf..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/search/SearchBean.class and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/search/SearchIndex.class b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/search/SearchIndex.class deleted file mode 100644 index 50007c4..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/search/SearchIndex.class and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/search/UpdateIndex.class b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/search/UpdateIndex.class deleted file mode 100644 index 1ef9761..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/search/UpdateIndex.class and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/util/ImageScaler.class b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/util/ImageScaler.class deleted file mode 100644 index 5570fac..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/util/ImageScaler.class and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/util/LogStrings.properties b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/util/LogStrings.properties deleted file mode 100644 index 112905d..0000000 --- a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/util/LogStrings.properties +++ /dev/null @@ -1,10 +0,0 @@ -index.exception=An exception was encountered while indexing the data. Please checked to make sure there indexes are not locked by another user. -index.sql.statement=Select statement used for retrieving database data "{0}" -search.string=Searching indexes for string "{0}" -search.results=Search String returned "{0}" hits -search.exception=An exception was encountered while performing the search. Please check to make sure the indexes exist. -fileupload.persist.exception=Error persisting seller data -fileupload.rollback.exception=Persisting seller data, rollback failed -geocoder.lookup.exception=The GeoCode address lookup from Yahoo has returned and Exception -image_does_not_exist=The image doesn't exist in the default image directory or in the upload directory "{0}" -resource_bundle_does_not_exist=The MessageStrings.properties file does not exist!. diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/util/MessageStrings.properties b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/util/MessageStrings.properties deleted file mode 100644 index 7ca2d9d..0000000 --- a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/util/MessageStrings.properties +++ /dev/null @@ -1,10 +0,0 @@ -invalid_contact_firstname=First Name is required. -invalid_contact_lastname=Last Name is required. -invalid_address_street1=Street is required. -invalid_address_city=City is required. -invalid_address_state=State is required. -invalid_address_zip=Zip Code is required. -invalid_item_name=Pet Name is required. -invalid_item_description=The Description should exist and the field can't have a '<script>' and/or a '<link>' tag in it. -invalid_item_price=Price should should exist and be a number greater or equal to 0. -invalid_item_imageurl=The image upload file must exist and be of type '.jpg', '.gif' or '.png'. diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/util/PetstoreConstants.class b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/util/PetstoreConstants.class deleted file mode 100644 index 5aa4b42..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/util/PetstoreConstants.class and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/util/PetstoreUtil.class b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/util/PetstoreUtil.class deleted file mode 100644 index a521d71..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/classes/com/sun/javaee/blueprints/petstore/util/PetstoreUtil.class and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/faces-config.xml b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/faces-config.xml deleted file mode 100644 index 22f03df..0000000 --- a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/faces-config.xml +++ /dev/null @@ -1,94 +0,0 @@ -<?xml version='1.0' encoding='UTF-8'?> - -<!-- Copyright 2006 Sun Microsystems, Inc. All rights reserved. You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at: - http://developer.sun.com/berkeley_license.html - $Id: faces-config.xml,v 1.13 2006/05/03 22:03:20 inder Exp $ --> - -<faces-config xmlns="http://java.sun.com/xml/ns/javaee" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd" - version="1.2"> - <!-- ========== Application Wide Features ================================ --> - - <!-- ========== Managed Beans ============================================ --> - <managed-bean> - <managed-bean-name>SearchBean</managed-bean-name> - <managed-bean-class>com.sun.javaee.blueprints.petstore.search.SearchBean</managed-bean-class> - <managed-bean-scope>session</managed-bean-scope> - </managed-bean> - - <managed-bean> - <managed-bean-name>RatingBean</managed-bean-name> - <managed-bean-class>com.sun.javaee.blueprints.petstore.model.RatingBean</managed-bean-class> - <managed-bean-scope>request</managed-bean-scope> - <managed-property> - <property-name>itemId</property-name> - <value>#{param.itemIdBinding}</value> - </managed-property> - </managed-bean> - - <managed-bean> - <managed-bean-name>PayPalBean</managed-bean-name> - <managed-bean-class>com.sun.javaee.blueprints.petstore.model.PayPalBean</managed-bean-class> - <managed-bean-scope>session</managed-bean-scope> - </managed-bean> - - <managed-bean> - <managed-bean-name>FileUploadBean</managed-bean-name> - <managed-bean-class>com.sun.javaee.blueprints.petstore.controller.FileUploadBean</managed-bean-class> - <managed-bean-scope>session</managed-bean-scope> - </managed-bean> - - <managed-bean> - <managed-bean-name>MapBean</managed-bean-name> - <managed-bean-class>com.sun.javaee.blueprints.petstore.mapviewer.MapBean</managed-bean-class> - <managed-bean-scope>session</managed-bean-scope> - </managed-bean> - - <managed-bean> - <managed-bean-name>AutocompleteBean</managed-bean-name> - <managed-bean-class>com.sun.javaee.blueprints.petstore.controller.AutocompleteBean</managed-bean-class> - <managed-bean-scope>session</managed-bean-scope> - </managed-bean> - - <managed-bean> - <managed-bean-name>AddressBean</managed-bean-name> - <managed-bean-class>com.sun.javaee.blueprints.petstore.controller.AddressBean</managed-bean-class> - <managed-bean-scope>session</managed-bean-scope> - </managed-bean> - - <!-- ========== Navigation Rules ========================================= --> - <navigation-rule> - <from-view-id>/mapLocation.jsp</from-view-id> - <navigation-case> - <from-outcome>map</from-outcome> - <to-view-id>/map.jsp</to-view-id> - </navigation-case> - </navigation-rule> - <navigation-rule> - <from-view-id>/mapAll.jsp</from-view-id> - <navigation-case> - <from-outcome>map</from-outcome> - <to-view-id>/map.jsp</to-view-id> - </navigation-case> - </navigation-rule> - <navigation-rule> - <from-view-id>/map.jsp</from-view-id> - <navigation-case> - <to-view-id>/mapLocation.jsp</to-view-id> - </navigation-case> - </navigation-rule> - <navigation-rule> - <from-view-id>/search.jsp</from-view-id> - <navigation-case> - <from-outcome>displayResults</from-outcome> - <to-view-id>/search.jsp</to-view-id> - </navigation-case> - <navigation-case> - <from-outcome>map</from-outcome> - <to-view-id>/map.jsp</to-view-id> - </navigation-case> - </navigation-rule> - -</faces-config> - diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/jboss-web.xml b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/jboss-web.xml deleted file mode 100644 index 0862993..0000000 --- a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/jboss-web.xml +++ /dev/null @@ -1,10 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<jboss-web> - <resource-ref> - <res-ref-name>jdbc/PetstoreDB</res-ref-name> - <res-type>javax.sql.DataSource</res-type> - <jndi-name>java:jdbc/PetstoreDB</jndi-name> - </resource-ref> -</jboss-web> - diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/bp-ui-5.jar b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/bp-ui-5.jar deleted file mode 100644 index f6bd6d2..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/bp-ui-5.jar and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/commons-fileupload-1.1.1.jar b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/commons-fileupload-1.1.1.jar deleted file mode 100644 index fc5763d..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/commons-fileupload-1.1.1.jar and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/commons-io-1.2.jar b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/commons-io-1.2.jar deleted file mode 100644 index b2867cd..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/commons-io-1.2.jar and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/commons-logging-1.1.jar b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/commons-logging-1.1.jar deleted file mode 100644 index 2ff9bbd..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/commons-logging-1.1.jar and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/jdom.jar b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/jdom.jar deleted file mode 100644 index 288e64c..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/jdom.jar and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/lucene-core-2.0.0.jar b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/lucene-core-2.0.0.jar deleted file mode 100644 index db6456f..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/lucene-core-2.0.0.jar and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/rome-0.8.jar b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/rome-0.8.jar deleted file mode 100644 index 27d2ad3..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/rome-0.8.jar and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/rome-fetcher-0.7.jar b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/rome-fetcher-0.7.jar deleted file mode 100644 index c2a26da..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/rome-fetcher-0.7.jar and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/shale-remoting.jar b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/shale-remoting.jar deleted file mode 100644 index 128045d..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/lib/shale-remoting.jar and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/sun-web.xml b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/sun-web.xml deleted file mode 100644 index a9c411b..0000000 --- a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/sun-web.xml +++ /dev/null @@ -1,14 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE sun-web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Application Server 9.0 Servlet 2.5//EN" "http://www.sun.com/software/appserver/dtds/sun-web-app_2_5-0.dtd"> -<sun-web-app error-url=""> - <context-root>/petstore</context-root> - <class-loader delegate="true"/> - <jsp-config> - <property name="classdebuginfo" value="true"> - <description>Enable debug info compilation in the generated servlet class</description> - </property> - <property name="mappedfile" value="true"> - <description>Maintain a one-to-one correspondence between static content and the generated servlet class' java code</description> - </property> - </jsp-config> -</sun-web-app> diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/web.xml b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/web.xml deleted file mode 100644 index 6c65069..0000000 --- a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/WEB-INF/web.xml +++ /dev/null @@ -1,126 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- Copyright 2006 Sun Microsystems, Inc. All rights reserved. You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at: - http://developer.sun.com/berkeley_license.html - $Id: web.xml,v 1.27 2007/04/18 19:25:09 smitha Exp $ --> -<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"> - - <display-name>Petstore</display-name> - <filter> - <filter-name>CaptchaValidateFilter</filter-name> - <filter-class>com.sun.javaee.blueprints.petstore.controller.CaptchaValidateFilter</filter-class> - </filter> - <filter> - <filter-name>EntryFilter</filter-name> - <filter-class>com.sun.javaee.blueprints.petstore.controller.EntryFilter</filter-class> - </filter> - <filter-mapping> - <filter-name>EntryFilter</filter-name> - <url-pattern>/*</url-pattern> - </filter-mapping> - <filter-mapping> - <filter-name>CaptchaValidateFilter</filter-name> - <url-pattern>/faces/dynamic/bpui_fileupload_handler/handleFileUpload</url-pattern> - </filter-mapping> - <listener> - <listener-class>com.sun.javaee.blueprints.petstore.model.CatalogFacade</listener-class> - </listener> - - <servlet> - <display-name>ControllerServlet</display-name> - <servlet-name>ControllerServlet</servlet-name> - <servlet-class>com.sun.javaee.blueprints.petstore.controller.ControllerServlet</servlet-class> - </servlet> - - <servlet-mapping> - <servlet-name>ControllerServlet</servlet-name> - <url-pattern>/catalog</url-pattern> - </servlet-mapping> - - <servlet-mapping> - <servlet-name>ControllerServlet</servlet-name> - <url-pattern>/controller</url-pattern> - </servlet-mapping> - - <context-param> - <description> - Google Maps authorization key for "http://localhost:8080/" - To use a another URL a new map key will have to be generated from http://www.google.com/apis/maps/ - </description> - <param-name>com.sun.j2ee.blueprints.ui.mapviewer.KEY</param-name> - <param-value>ABQIAAAAyQYKk4__l80DyIsqLPvvuxTwM0brOpm-All5BF6PoaKBxRWWERSt2NPUufvDhWGdrb-pCzTZQ2vi2A</param-value> - </context-param> - - <context-param> - <param-name>javax.faces.STATE_SAVING_METHOD</param-name> - <param-value>server</param-value> - </context-param> - - <context-param> - <param-name>com.sun.faces.validateXml</param-name> - <param-value>false</param-value> - </context-param> - - <context-param> - <param-name>com.sun.faces.verifyObjects</param-name> - <param-value>false</param-value> - </context-param> - - <context-param> - <param-name>javax.faces.CONFIG_FILES</param-name> - <param-value>/WEB-INF/faces-config.xml</param-value> - </context-param> - - <!-- proxy for mapviewer --> - <context-param> - <param-name>proxyHost</param-name> - <param-value></param-value> - </context-param> - <context-param> - <param-name>proxyPort</param-name> - <param-value></param-value> - </context-param> - <!-- filter init-param not working so use servlet context --> - <context-param> - <param-name>entryPages</param-name> - <param-value>.jpg|.gif|index.html|index.jsp|fileupload.jsp|search.jsp|catalog.jsp|mapAll.jsp|tag.jsp|news.jsp</param-value> - </context-param> - - - <!-- Faces Servlet --> - <servlet> - <servlet-name>Faces Servlet</servlet-name> - <servlet-class>javax.faces.webapp.FacesServlet</servlet-class> - <load-on-startup>1</load-on-startup> - </servlet> - - <!-- Faces Servlet Mapping --> - <servlet-mapping> - <servlet-name>Faces Servlet</servlet-name> - <url-pattern>/faces/*</url-pattern> - </servlet-mapping> - - <!-- need datasource for indexing Lucene search engine --> - <servlet-mapping> - <servlet-name>ControllerServlet</servlet-name> - <url-pattern>/faces/CaptchaServlet</url-pattern> - </servlet-mapping> - <servlet-mapping> - <servlet-name>ControllerServlet</servlet-name> - <url-pattern>/ImageServlet/*</url-pattern> - </servlet-mapping> - <servlet-mapping> - <servlet-name>ControllerServlet</servlet-name> - <url-pattern>/TagServlet/*</url-pattern> - </servlet-mapping> - <error-page> - <exception-type>java.lang.RuntimeException</exception-type> - <location>/systemerror.jsp</location> - </error-page> - <resource-ref> - <res-ref-name>jdbc/PetstoreDB</res-ref-name> - <res-type>javax.sql.DataSource</res-type> - <res-auth>Container</res-auth> - <res-sharing-scope>Shareable</res-sharing-scope> - </resource-ref> -</web-app> - diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/accordion.css b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/accordion.css deleted file mode 100644 index 14c6ed0..0000000 --- a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/accordion.css +++ /dev/null @@ -1 +0,0 @@ -.accordion { width:150px; height:400px; border-width:1px; border-style:solid; border-color:black; background:#404040; }
.accordionBody { width:160px; height:400px; border-width:1px; border-style:solid; border-color:black; background:#404040; }
.accordionTitle { vertical-align: top; padding-top: 10px; text-align: center; width:150px; height:90px; color:white; font-size:22px; font-weight: bold; background:black; opacity: .99; }
.accordionRow { color:white; cursor: pointer; font-size:18px; font-weight: bold; vertical-align: middle; padding-top: 5px; text-align: center; width:150px; height:40px; background:#104E8B; opacity: .99; }
.accordionProduct { text-align: center; width:150px; color:white; font-size:12px; font-weight: bold; background:#104E8B; opacity: .99; }
.accordionLink { cursor: pointer; text-decoration: none; color:white; }
.accordionLinkSelected { text-align: center; width:150px; color:red; font-size:12px; font-weight: bold; background:black; opacity: .99; }
.accordionLinkHover { text-decoration: underline; color:white; } \ No newline at end of file diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/accordion.js b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/accordion.js deleted file mode 100644 index 1c1ee6b..0000000 --- a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/accordion.js +++ /dev/null @@ -1,249 +0,0 @@ -/* Copyright 2006 Sun Microsystems, Inc. All rights reserved. You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at: http://developer.sun.com/berkeley_license.html -$Id: accordion.js,v 1.22 2006/05/03 22:00:32 inder Exp $ */ - -function AccordionMenu () { - - dojo.event.topic.subscribe("/accordion", this, this.handleEvent); - - var displayPortWidth = 100; - var HEIGHT = 400; - - var EXPANDED_HEIGHT = 125; - var ITEM_HEIGHT = 55; - var INCREMENT = 10; - - var timeout = 5; // in ms - - var accordion = document.getElementById("accordionBody"); - var divs = []; - var oExpandedIndex = -1; - var nExpandedIndex = -1; - var oHeight = ITEM_HEIGHT; - var nHeight = ITEM_HEIGHT; - var tHeight = 165; - var expanding = false; - var categories; - - // while control the inline debug statements - var debug = false; - var status = document.getElementById("status"); - - function Row(id, div, defaultHeight) { - this.id = id; - this.div = div; - //this.height = height; - this.h = defaultHeight; - this.div.style.height = defaultHeight + "px" - } - - Row.prototype.setHeight = function(nH) { - this.h = nH; - this.div.style.height = nH + "px"; - // re-adjust for ie in that it does not follow the boxmodel - if (this.div.offsetHeight > nH) { - this.div.style.height = (nH - (this.div.offsetHeight - nH)) + 'px'; - } - } - - Row.prototype.getTotalHeight = function() { - return this.div.offsetHeight; - } - - Row.prototype.getHeight = function() { - return this.h; - } - - this.handleEvent = function(args) { - if (args.type) { - if (args.type == 'expand') { - var targetRow = args.targetRow; - initiateExpansion(targetRow); - } - } - } - - this.load = function(lcategories) { - categories = lcategories; - // create all the rows - for (var l=0; l < categories.length; l++) { - var row = createRow(l,"accordionRow", ITEM_HEIGHT); - createLinks(row.div, categories[l].name, l, "accordionLink"); - divs.push(row); - } - } - - function showStatus() { - if (debug) { - var stat = "oExpandedIndex=" + oExpandedIndex + " " ; - for (var i=0; i < divs.length; i++) { - stat = stat + i + "=" + divs[i].getTotalHeight() + " "; - } - status.innerHTML = stat + " total height=" + accordion.offsetHeight; - var totalH = 0; - var tH = 0; - for (var i=0; i < divs.length; i++) { - totalH = totalH + divs[i].getHeight(); - tH = tH + divs[i].getTotalHeight(); - } - } - } - - this.showCategory = function(catid) { - for (var l=0; l < categories.length; l++) { - if (catid == categories[l].name) { - // now tell the scroller to load the first product - initiateExpansion(l); - if (categories[l].products[0]) { - dojo.event.topic.publish("/catalog", {type:"showProducts", productId:categories[l].products[0].id}); - } - break; - } - } - } - - this.showFirstCategory = function() { - initiateExpansion(0); - if (categories[0].products[0]) { - dojo.event.topic.publish("/catalog", {type:"showProducts", productId:categories[0].products[0].id}); - } - } - - this.loadCategoryItem = function(pid, itemId) { - // find the right product and expand the accordion - for (var l=0; l < categories.length; l++) { - // now tell the scroller to load the first product - for (var il=0; il < categories[l].products.length; il++) { - if (categories[l].products[il].id == pid ) { - initiateExpansion(l); - break; - } - } - } - dojo.event.topic.publish("/catalog", {type:"showItemDetails", productId: pid , itemId: itemId}); - } - - function initiateExpansion(id) { - // jump out if we are in progress - if (!expanding && oExpandedIndex != Number(id)) { - expanding = true; - nExpandedIndex = Number(id); - if (oExpandedIndex != -1) { - var targetDiv = divs[oExpandedIndex].div; - if (targetDiv && targetDiv.childNodes) { - for (var l = targetDiv.childNodes.length -1; l >= 0 ; l--) { - targetDiv.removeChild(targetDiv.childNodes[l]); - } - } - createLinks(divs[oExpandedIndex].div, categories[oExpandedIndex].name, oExpandedIndex, "accordionLink"); - } - expandRow(id); - } - } - - function expandRow() { - if (expanding) { - showStatus(); - // - if (nHeight < EXPANDED_HEIGHT) { - nHeight = nHeight + INCREMENT; - divs[nExpandedIndex].setHeight(nHeight); - if (oExpandedIndex != -1) { - if (tHeight >= ITEM_HEIGHT) { - oHeight = oHeight - INCREMENT; - // take all out of the old expanded - } else { - oHeight = oHeight - INCREMENT; - } - divs[oExpandedIndex].setHeight(oHeight); - } - // default exapnd here - } else if (oExpandedIndex != -1 && oHeight > ITEM_HEIGHT) { - oHeight = oHeight - INCREMENT; - divs[oExpandedIndex].setHeight(oHeight); - } else { - // set the contents of the new menu - var targetDiv = divs[nExpandedIndex].div; - if (targetDiv && targetDiv.childNodes) { - for (var l = targetDiv.childNodes.length -1; l >= 0 ; l--) { - targetDiv.removeChild(targetDiv.childNodes[l]); - } - } - divs[nExpandedIndex].div.appendChild(document.createTextNode(categories[nExpandedIndex].name)); - divs[nExpandedIndex].div.appendChild(document.createElement("p")); - for (var l= 0; l < categories[nExpandedIndex].products.length; l++) { - var span = document.createElement("span"); - span.className = "accordionProduct"; - var link = document.createElement("a"); - var target = categories[nExpandedIndex].products[l].id; - link.id = target; - link.className = "accordionLink"; - // some browsers aren't setting the styles for hovers so forcing them - link.setAttribute("onmouseover", "this.className='accordionLinkHover';"); - link.setAttribute("onmouseout", "this.className='accordionLink';"); - dojo.event.connect(link, "onclick", function(evt) { - this._target = target - var src; - if (evt.target) { - src = evt.target; - } else if (evt.srcElement) { - src = evt.srcElement; - } - //src.parentNode.className = "accordionLinkSelected"; - // set this so the next time around it can be removed; - dojo.event.topic.publish("/catalog", {type:"showProducts", productId:src.id}); - }); - link.appendChild(document.createTextNode(categories[nExpandedIndex].products[l].name)); - span.appendChild(link); - divs[nExpandedIndex].div.appendChild(span); - if (l < categories[nExpandedIndex].products.length - 1) { - divs[nExpandedIndex].div.appendChild(document.createElement("p")); - } - link = null; - } - expanding = false; - oExpandedIndex = nExpandedIndex; - nExpandedIndex = -1; - oHeight = nHeight; - nHeight = ITEM_HEIGHT; - return; - } - - setTimeout(expandRow, timeout); - } - } - - function createLinks(tDiv, text, id, linkStyle) { - var link = document.createElement("a"); - link.className = linkStyle; - link.appendChild(document.createTextNode(text)); - link.setAttribute("id", id); - if (link.attachEvent) { - link.attachEvent('onmouseover',function(e){initiateExpansion(e.srcElement.getAttribute("id"));}); - } else if (link.addEventListener) { - link.addEventListener('mouseover',function(e){initiateExpansion(e.currentTarget.getAttribute("id"));}, true); - } - tDiv.appendChild(link); - } - - function createRow(id, rowStyle, height) { - var nDiv = document.createElement("div"); - nDiv.className = rowStyle; - var row; - var cell; - if (accordion.insertRow) { - row = accordion.insertRow(accordion.rows.length); - - } else { - row = document.createElement("tr"); - accordion.appendChild(row); - } - if (row.inserCell) { - cell = row.insertCell(0); - } else { - cell = document.createElement("td"); - row.appendChild(cell); - } - cell.appendChild(nDiv); - return new Row(id, nDiv, height); - } -} diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/banner.jsp b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/banner.jsp deleted file mode 100644 index c43dd98..0000000 --- a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/banner.jsp +++ /dev/null @@ -1,80 +0,0 @@ -<%-- Copyright 2006 Sun Microsystems, Inc. All rights reserved. You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at: http://developer.sun.com/berkeley_license.html -$Id: banner.jsp,v 1.28 2006/12/19 20:23:53 yutayoshida Exp $ --%> - -<%@page contentType="text/html"%> -<%@page pageEncoding="UTF-8"%> - -<%@taglib prefix="f" uri="http://java.sun.com/jsf/core%22%%3E -<%@taglib prefix="h" uri="http://java.sun.com/jsf/html%22%%3E -<%@taglib prefix="ui" uri="http://java.sun.com/blueprints/ui" %> - -<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/styles.css"></link> -<script type="text/javascript" src="${pageContext.request.contextPath}/faces/static/META-INF/dojo/bpcatalog/dojo.js"></script> -<script type="text/javascript" src="${pageContext.request.contextPath}/faces/static/META-INF/rss/rssbar.js"></script> -<link type="text/css" rel="stylesheet" href="${pageContext.request.contextPath}/faces/static/META-INF/rss/rssbar.css" /> -<style type="text/css"> - -#rss-bar { - margin: 0 auto 0px; -} - -#rss-bar table td#rss-channel { - background-repeat: no-repeat; - background-position: top left; - font-size: 14px; - font-weight: bold; - vertical-align: top; - text-align: center; - width: 254px; -} - -#rss-bar table td#rss-item { - background-repeat: no-repeat; - font-size: 14px; - width: 534px; - text-align: left; -} - -#rss-bar table a { - color: white; - text-decoration: none; -} -#rss-bar table a:hover { color: #ffff00;} - -</style> -<script type="text/javascript"> - var rss = new bpui.RSS(); - dojo.addOnLoad(function(){rss.getRssInJson('${pageContext.request.contextPath}/faces/dynamic/bpui_rssfeedhandler/getRssfeed', 'https://blueprints.dev.java.net/servlets/ProjectRSS?type=news', '4', '4000', 'News from BluePrints', 'news.jsp');}); -</script> - -<table border="0" bordercolor="gray" cellpadding="0" cellspacing="0" bgcolor="white" width="100%"> - <tr id="injectionPoint"> - <td width="100"><a class="menuLink" href="${pageContext.request.contextPath}/faces/index.jsp""><img src="${pageContext.request.contextPath}/images/banner_logo.gif" border="0" width="70" height="70"></a></td> - <td align="left"> - <div class="banner">Java Pet Store</div> - </td> - <td id="bannerRight" align="right"> - <a class="menuLink" onmouseover="this.className='menuLinkHover';" onmouseout="this.className='menuLink';" href="${pageContext.request.contextPath}/faces/fileupload.jsp">Seller</a> <span class="menuItem">|</span> - <a class="menuLink" onmouseover="this.className='menuLinkHover';" onmouseout="this.className='menuLink';" href="${pageContext.request.contextPath}/faces/search.jsp">Search</a> <span class="menuItem">|</span> - <a class="menuLink" onmouseover="this.className='menuLinkHover';" onmouseout="this.className='menuLink';" href="${pageContext.request.contextPath}/faces/catalog.jsp">Catalog</a> <span class="menuItem">|</span> - <a class="menuLink" onmouseover="this.className='menuLinkHover';" onmouseout="this.className='menuLink';" href="${pageContext.request.contextPath}/faces/mapAll.jsp">Map</a> <span class="menuItem">|</span> - <a class="menuLink" onmouseover="this.className='menuLinkHover';" onmouseout="this.className='menuLink';" href="${pageContext.request.contextPath}/faces/tag.jsp">Tags</a> <span class="menuItem">|</span> - <a class="menuLink" onmouseover="this.className='menuLinkHover';" onmouseout="this.className='menuLink';" href="${pageContext.request.contextPath}/faces/index.jsp">Home</a> - </td> - </tr> - </tr> - <tr bgcolor="gray"> - <td id="menubar" align="left" colspan="3" height="25" > - <div id="rss-bar"> - <table border="0" cellpadding="0" cellspacing="0"> - <tr> - <td id="rss-channel" nowrap="true"></td> - <td id="rss-item" nowrap="true"></td> - </tr> - </table> - </div> - </td> - </tr> - </table> - - diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/bp_petstorelist.css b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/bp_petstorelist.css deleted file mode 100644 index 5c906b5..0000000 --- a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/bp_petstorelist.css +++ /dev/null @@ -1,48 +0,0 @@ -.bpui_petstorelist_dataDiv { - border-style: groove; - overflow: auto; - width: 600px; - height: 500px; - padding: 10px; -} - -.bpui_petstorelist_pageDiv { -} - - -.bpui_petstorelist_table { -} - -.bpui_petstorelist_cell { - padding: 5px; - vertical-align: top; -} - -.bpui_petstorelist_row { - border-bottom: dotted; -} - -.bpui_petstorelist_hr { - width: 90%; -} - -.bpui_petstorelist_image { -} - -.bpui_petstorelist_link{ -} - -.bpui_petstorelist_name{ -} - -.bpui_petstorelist_description{ -} - -.bpui_petstorelist_price { -} - -.bpui_petstorelist_previous { -} - -.bpui_petstorelist_next { -} diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/bp_petstorelist.js b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/bp_petstorelist.js deleted file mode 100644 index 4df46fb..0000000 --- a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/bp_petstorelist.js +++ /dev/null @@ -1,269 +0,0 @@ -var bpui; -if(typeof bpui == "undefined") { - bpui=new Object(); -} -bpui.petstoreList=new Object(); - -bpui.petstoreList.divName=""; -bpui.petstoreList.currentCount=0; -bpui.petstoreList.numberPerPage=5; -bpui.petstoreList.category="feline01"; -bpui.petstoreList.cachedData=new Object(); -bpui.petstoreList.debug=false; -bpui.petstoreList.timer; - -bpui.petstoreList.initialSetup=function() { - // get outerdiv - var targetDiv=document.getElementById(bpui.petstoreList.divName); - - // containier div - tablex="<table><tr><td align="center">"; - tablex += "<b>Java BluePrint's Pet Store Category:</b> <select size="1" id="bpui.petstoreList.categoryList" onchange="bpui.petstoreList.selectCategory()">"; - tablex += "<option value="loading">Loading Data...</option>"; - tablex += "</select>"; - tablex += "</td></tr><tr><td><div id="bpui.petstoreList.dataDiv" class="bpui_petstorelist_dataDiv">"; - tablex += "</div>"; - - // add product previous and next - tablex += "</td></tr>"; - tablex += "<tr><td colspan="3" style="text-align:center;">"; - tablex += "<div id="bpui.petstoreList.pageDiv" class="bpui_petstorelist_pageDiv">"; - tablex += "</div>"; - tablex += "</td></tr>"; - // add in debug div, if debugging - if(bpui.petstoreList.debug) { - tablex += "<tr><td colspan="3">"; - tablex += "<div id="bpui.petstoreList.debugDiv">"; - tablex += "</div>"; - tablex += "</td></tr>"; - } - tablex += "</table>"; - targetDiv.innerHTML=tablex; - bpui.petstoreList.setSelectedCategory(); -} - - -bpui.petstoreList.populateData=function(datax) { - // clear response timer - clearTimeout(bpui.petstoreList.timer); - - if(typeof datax != "undefined") { - // check to see if at last page and no data is returned - if(datax.length < 1) { - alert("At last page for category!"); - // keep currentCount correct by removing the increment that was added - bpui.petstoreList.currentCount -= bpui.petstoreList.numberPerPage; - } else { - // add data to cache if it doesn't already exist - // if a full set isn't returned don't cache it, so the data will be retrieved again from the server. - // This is optional, you have to weigh the performance hit with the consiquences of not doing an update - key=bpui.petstoreList.category + "|" + bpui.petstoreList.currentCount; - cachedSet=bpui.petstoreList.cachedData[key]; - if(typeof cachedSet == "undefined" && datax.length >= bpui.petstoreList.numberPerPage) { - // need to cache data - if(bpui.petstoreList.debug) bpui.petstoreList.debugMessage("Adding cache data by key: " + key); - bpui.petstoreList.cachedData[key]=datax; - } - - // get outerdiv - var targetDiv=document.getElementById("bpui.petstoreList.dataDiv"); - - // containier div - tablex="<table class="bpui_petstorelist_table">"; - tablex += "<tr class="bpui_petstorelist_row">"; - tablex += "<th class="bpui_petstorelist_cell">Pet Image</td>"; - tablex += "<th class="bpui_petstorelist_cell">Name & Description</td>"; - tablex += "<th class="bpui_petstorelist_cell">Price ($)</td>"; - tablex += "</tr>"; - - // loop through product results - for(ii=0; ii < datax.length; ii++) { - // add row - tablex += "<tr class="bpui_petstorelist_row"><td class="bpui_petstorelist_cell">"; - tablex += "<a class="bpui_petstorelist_image" target="_blank" href="http://localhost:8080/petstore/faces/catalog.jsp#" + - datax[ii].productID + "," + datax[ii].itemID + "">"; - - tablex += "<img src="http://localhost:8080/petstore/ImageServlet/" + datax[ii].imageThumbURL + ""/>"; - - tablex += "</a>"; - tablex += "</td><td class="bpui_petstorelist_cell">"; - tablex += "<a class="bpui_petstorelist_link" target="_blank" href="http://localhost:8080/petstore/faces/catalog.jsp#" + - datax[ii].productID + "," + datax[ii].itemID + "">"; - tablex += "<span class="bpui_petstorelist_name">" + datax[ii].name + "</span><br/>"; - tablex += "</a>"; - tablex += "<span class="bpui_petstorelist_description">" + datax[ii].description + "</span>"; - tablex += "</td><td class="bpui_petstorelist_cell">"; - - // add product price - tablex += "<span class="bpui_petstorelist_price">$" + datax[ii].price + "</span><br/>"; - tablex += "</td></tr>"; - tablex += "<tr><td colspan="3"><hr class="bpui_petstorelist_hr" /></td></tr>"; - } - - tablex += "</table>"; - targetDiv.innerHTML=tablex; - } - - // setup previous next buttons - pagex=""; - var targetDiv=document.getElementById("bpui.petstoreList.pageDiv"); - if(bpui.petstoreList.currentCount >= bpui.petstoreList.numberPerPage) { - // add previous - pagex += "<span class="bpui_petstorelist_previous" onclick="bpui.petstoreList.previousProducts();"><< PREVIOUS</span> "; - } - if(datax.length == bpui.petstoreList.numberPerPage) { - // add next only if full page has been returned. Need to change when add cache ??? - pagex += "<span class="bpui_petstorelist_next" onclick="bpui.petstoreList.nextProducts();">NEXT >></span><br/>"; - } - targetDiv.innerHTML=pagex; - } -} - -bpui.petstoreList.setSelectedCategory=function() { - catx=document.getElementById("bpui.petstoreList.categoryList"); - for(ii=0; ii < catx.length; ii++) { - if(catx.options[ii].value == bpui.petstoreList.category) { - catx.options[ii].selected=true; - } - } -} - -bpui.petstoreList.selectCategory=function() { - catx=document.getElementById("bpui.petstoreList.categoryList"); - bpui.petstoreList.category=catx.value; - - bpui.petstoreList.currentCount=0; - bpui.petstoreList.updateProducts(); -} - - -bpui.petstoreList.nextProducts=function() { - // load data from service - bpui.petstoreList.currentCount += bpui.petstoreList.numberPerPage; - bpui.petstoreList.updateProducts(); -} - -bpui.petstoreList.previousProducts=function() { - bpui.petstoreList.currentCount -= bpui.petstoreList.numberPerPage; - if(bpui.petstoreList.currentCount < 0) { - bpui.petstoreList.currentCount=0; - } - bpui.petstoreList.updateProducts(); -} - - -bpui.petstoreList.updateProducts=function() { - // check to see if in cache - key=bpui.petstoreList.category + "|" + bpui.petstoreList.currentCount; - cachedSet=bpui.petstoreList.cachedData[key]; - // see if data in cache - if(typeof cachedSet != "undefined") { - // get data from cache - if(bpui.petstoreList.debug) bpui.petstoreList.debugMessage("Pulling data from cache using: " + key + " with " + cachedSet.length + " items."); - bpui.petstoreList.populateData(cachedSet); - } else { - // load data from service - if(bpui.petstoreList.debug) bpui.petstoreList.debugMessage("Retrieving data from service for : " + bpui.petstoreList.category + " starting at item " + bpui.petstoreList.currentCount); - - // set degradation timeout - bpui.petstoreList.timer=setTimeout('bpui.petstoreList.requestTimedOut()', 20000); - - // create dynamic script - bodyTag=document.getElementsByTagName("body")[0]; - scriptx=document.createElement("script"); - scriptx.setAttribute("type", "text/javascript"); - scriptx.setAttribute("src", "http://localhost:8080/petstore/catalog?command=items&pid=" + bpui.petstoreList.category + "&start=" + bpui.petstoreList.currentCount + "&length=" + bpui.petstoreList.numberPerPage + "&format=jsonp&callback=bpui.petstoreList.populateData"); - bodyTag.appendChild(scriptx); - } -} - - -bpui.petstoreList.createPetstoreList=function(divName, numberPerPage) { - // keep divName for later references - bpui.petstoreList.divName=divName; - - // see if numberPerPage defined - if(typeof numberPerPage != "undefined") { - bpui.petstoreList.numberPerPage=numberPerPage; - } - - // setup static elements - bpui.petstoreList.initialSetup(); - - // set timer to make sure service look up returns. Eventhough the Javascript library was able to be fetched, the database could be down or the - // service could be responding very slowly and the request timeout. Wait for 30 seconds and then set data div to service may not be responding message. - // Since both calls hit the database, if one returns propertly the other should also. - bpui.petstoreList.timer=setTimeout('bpui.petstoreList.requestTimedOut()', 20000); - - // load categories from service - bodyTag=document.getElementsByTagName("body")[0]; - scriptx=document.createElement("script"); - scriptx.setAttribute("type", "text/javascript"); - scriptx.setAttribute("src", "http://localhost:8080/petstore/catalog?command=categories&format=jsonp&a..."); - bodyTag.appendChild(scriptx); - - // load pet data from service - bodyTag=document.getElementsByTagName("body")[0]; - scriptx=document.createElement("script"); - scriptx.setAttribute("type", "text/javascript"); - scriptx.setAttribute("src", "http://localhost:8080/petstore/catalog?command=items&pid=" + bpui.petstoreList.category + "&start=0&length=" + bpui.petstoreList.numberPerPage + "&format=jsonp&callback=bpui.petstoreList.populateData"); - bodyTag.appendChild(scriptx); -} - - -bpui.petstoreList.requestTimedOut=function() { - document.getElementById("bpui.petstoreList.dataDiv").innerHTML="<b><font color="#0000FF">The Java BluePrint's Pet Store JSONP Service is either responding very slowly or not responding at all! Please check with the service provider for more information.</font></b>"; -} - - - -bpui.petstoreList.debugMessage=function(messx) { - targetDiv=document.getElementById("bpui.petstoreList.debugDiv"); - targetDiv.innerHTML=messx + "<br/>" + targetDiv.innerHTML; -} - - -bpui.petstoreList.populateCategory=function(datax) { - // clear response timer - clearTimeout(bpui.petstoreList.timer); - - if(typeof datax != "undefined") { - catx=document.getElementById("bpui.petstoreList.categoryList"); - countx=0; - // loop through top level categories - for(ii=0; ii < datax.length; ii++) { - // loop through individual categories - for(yy=0; yy < datax[ii].products.length; yy++) { - // set default value for select list - bCurrentSelect=false - if(datax[ii].products[yy].id == bpui.petstoreList.category) { - bCurrentSelect=true; - } - catx.options[countx]=new Option(datax[ii].products[yy].name, datax[ii].products[yy].id, false, bCurrentSelect); - countx++; - } - } - } -} - - -bpui.petstoreList.hackerExample=function() { - /* - bodyTag=document.getElementsByTagName("body")[0]; - iframex=document.createElement("iframe"); - iframex.setAttribute("src", "http://localhost:8080/bp-clientside-mashup/show.jsp?cookies=" + escape(document.cookie)); - bodyTag.appendChild(iframex); - */ - // load pet data from service - - bodyTag=document.getElementsByTagName("body")[0]; - scriptx=document.createElement("script"); - scriptx.setAttribute("type", "text/javascript"); - scriptx.setAttribute("src", "http://localhost:8080/bp-clientside-mashup/show.jsp?cookies=" + escape(document.cookie)); - bodyTag.appendChild(scriptx); - - -} - - - diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/bp_petstorelist_dom.js b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/bp_petstorelist_dom.js deleted file mode 100644 index d00e427..0000000 --- a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/bp_petstorelist_dom.js +++ /dev/null @@ -1,136 +0,0 @@ -var bpui; -if(typeof bpui == "undefined") { - bpui=new Object(); -} -bpui.petstoreList=new Object(); - -bpui.petstoreList.divName=""; -bpui.petstoreList.currentCount=0; - -bpui.petstoreList.populateData=function(datax) { - if(typeof datax != "undefined") { - - // get outerdiv - var targetDiv=document.getElementById(bpui.petstoreList.divName); - - // make sure div is clear - targetDiv.innerHTML=""; - - // add class to containing div - targetDiv.setAttribute("class", "bpui_petstorelist_div") - - // add table - tablex=document.createElement("table"); - tablex.setAttribute("class", "bpui_petstorelist_table") - targetDiv.appendChild(tablex); - - // loop through product results - for(ii=0; ii < datax.length; ii++) { - // add row - rowx=document.createElement("tr"); - - // add product image with hyperlink - colx=document.createElement("td"); - ax=document.createElement("a"); - ax.setAttribute("href", "http://localhost:8080/petstore/faces/catalog.jsp#" + datax[ii].productID + "," + datax[ii].itemID) - ax.setAttribute("target", "bppetstore") - ax.setAttribute("class", "bpui_petstorelist_image") - imgx=document.createElement("img"); - imgx.setAttribute("src", "http://localhost:8080/petstore/ImageServlet/" + datax[ii].imageThumbURL); - ax.appendChild(imgx); - colx.appendChild(ax); - rowx.appendChild(colx); - - // add product name with hyperlink - colx=document.createElement("td"); - ax=document.createElement("a"); - ax.setAttribute("href", "http://localhost:8080/petstore/faces/catalog.jsp#" + datax[ii].productID + "," + datax[ii].itemID) - ax.setAttribute("target", "bppetstore") - ax.setAttribute("class", "bpui_petstorelist_name_link") - spanx=document.createElement("span"); - spanx.setAttribute("class", "bpui_petstorelist_name") - spanx.appendChild(document.createTextNode(datax[ii].name)); - ax.appendChild(spanx); - colx.appendChild(ax); - colx.appendChild(document.createElement("br")); - // add product description - spanx=document.createElement("span"); - spanx.setAttribute("class", "bpui_petstorelist_description"); - spanx.appendChild(document.createTextNode(datax[ii].description)); - colx.appendChild(spanx); - rowx.appendChild(colx); - - // add product price - colx=document.createElement("td"); - spanx=document.createElement("span"); - spanx.setAttribute("class", "bpui_petstorelist_price"); - spanx.appendChild(document.createTextNode("$" + datax[ii].price)); - colx.appendChild(spanx); - rowx.appendChild(colx); - - // add row to table - tablex.appendChild(rowx); - } - - // add product previous and next - rowx=document.createElement("tr"); - colx=document.createElement("td"); - colx.setAttribute("colspan", "3"); - spanx=document.createElement("span"); - spanx.setAttribute("class", "bpui_petstorelist_previous"); - spanx.setAttribute("onclick", "bpui.petstoreList.previousProducts();"); - spanx.appendChild(document.createTextNode("<< PREVIOUS")); - colx.appendChild(spanx); - - spanx=document.createElement("span"); - spanx.setAttribute("class", "bpui_petstorelist_next"); - spanx.setAttribute("onclick", "bpui.petstoreList.nextProducts();"); - spanx.appendChild(document.createTextNode("NEXT >>")); - colx.appendChild(spanx); - rowx.appendChild(colx); - - // add row to table - tablex.appendChild(rowx); - } -} - - -bpui.petstoreList.nextProducts=function() { - // load data from service - bpui.petstoreList.currentCount += 5; - bpui.petstoreList.updateProducts(); -} - - -bpui.petstoreList.previousProducts=function() { - bpui.petstoreList.currentCount -= 5; - if(bpui.petstoreList.currentCount < 0) { - bpui.petstoreList.currentCount=0; - } - bpui.petstoreList.updateProducts(); -} - - -bpui.petstoreList.updateProducts=function() { - // load data from service - bodyTag=document.getElementsByTagName("body")[0]; - scriptx=document.createElement("script"); - scriptx.setAttribute("type", "text/javascript"); - scriptx.setAttribute("src", "http://localhost:8080/petstore/catalog?command=items&pid=feline01&st..." + bpui.petstoreList.currentCount + "&length=5&format=jsonp"); - bodyTag.appendChild(scriptx); -} - - - -bpui.petstoreList.createPetstoreList=function(divName) { - // keep divName for later references - bpui.petstoreList.divName=divName; - - // load data from service - bodyTag=document.getElementsByTagName("body")[0]; - scriptx=document.createElement("script"); - scriptx.setAttribute("type", "text/javascript"); - scriptx.setAttribute("src", "http://localhost:8080/petstore/catalog?command=items&pid=feline01&st..."); - bodyTag.appendChild(scriptx); -} - diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/bp_petstorelist_one_div.js b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/bp_petstorelist_one_div.js deleted file mode 100644 index 9b18cb4..0000000 --- a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/bp_petstorelist_one_div.js +++ /dev/null @@ -1,159 +0,0 @@ -var bpui; -if(typeof bpui == "undefined") { - bpui=new Object(); -} -bpui.petstoreList=new Object(); - -bpui.petstoreList.divName=""; -bpui.petstoreList.currentCount=0; -bpui.petstoreList.category="feline01"; - - -bpui.petstoreList.initialSetup=function() { - // get outerdiv - var targetDiv=document.getElementById(bpui.petstoreList.divName); - - // containier div - tablex="<table><tr><td align="center">"; - tablex += "<b>Java BluePrint's Pet Store Category:</b> <select size="1" id="bpui.petstoreList.categoryList" onchange="bpui.petstoreList.selectCategory()">"; - tablex += "<option value="feline01">Hairy Cat</option>"; - tablex += "<option value="feline02">Groomed Cat</option>"; - tablex += "<option value="canine01">Medium Dogs</option>"; - tablex += "<option value="canine02">Small Dogs</option>"; - tablex += "<option value="avian01">Parrot</option>"; - tablex += "<option value="avian02">Exotic</option>"; - tablex += "<option value="fish01">Small Fish</option>"; - tablex += "<option value="fish02">Large Fish</option>"; - tablex += "<option value="reptile01">Slithering Reptiles</option>"; - tablex += "<option value="reptile02">Crawling Reptiles</option>"; - tablex += "</select>"; - tablex += "</td></tr><tr><td><div class="bpui_petstorelist_div">"; - tablex += "</div>"; - - // add product previous and next - tablex += "</td></tr>"; - tablex += "<tr><td colspan="3" style="text-align:center;">"; - tablex += "<span class="bpui_petstorelist_previous" onclick="bpui.petstoreList.previousProducts();"><< PREVIOUS</span> "; - tablex += "<span class="bpui_petstorelist_next" onclick="bpui.petstoreList.nextProducts();">NEXT >></span><br/>"; - tablex += "</td></tr>"; - tablex += "</table>"; - targetDiv.innerHTML=tablex; - bpui.petstoreList.setSelectedCategory(); -} - -bpui.petstoreList.populateData=function(datax) { - if(typeof datax != "undefined") { - - // get outerdiv - var targetDiv=document.getElementById(bpui.petstoreList.divName); - - // containier div - tablex="<table><tr><td align="center">"; - tablex += "<b>Java BluePrint's Pet Store Category:</b> <select size="1" id="bpui.petstoreList.categoryList" onchange="bpui.petstoreList.selectCategory()">"; - tablex += "<option value="feline01">Hairy Cat</option>"; - tablex += "<option value="feline02">Groomed Cat</option>"; - tablex += "<option value="canine01">Medium Dogs</option>"; - tablex += "<option value="canine02">Small Dogs</option>"; - tablex += "<option value="avian01">Parrot</option>"; - tablex += "<option value="avian02">Exotic</option>"; - tablex += "<option value="fish01">Small Fish</option>"; - tablex += "<option value="fish02">Large Fish</option>"; - tablex += "<option value="reptile01">Slithering Reptiles</option>"; - tablex += "<option value="reptile02">Crawling Reptiles</option>"; - tablex += "</select>"; - tablex += "</td></tr><tr><td><div class="bpui_petstorelist_div">"; - - tablex += "<table class="bpui_petstorelist_table">"; - - // loop through product results - for(ii=0; ii < datax.length; ii++) { - // add row - tablex += "<tr class="bpui_petstorelist_row"><td class="bpui_petstorelist_cell">"; - tablex += "<a class="bpui_petstorelist_image" target="bppetstore" href="http://localhost:8080/petstore/faces/catalog.jsp#" + - datax[ii].productID + "," + datax[ii].itemID + "">"; - - tablex += "<img src="http://localhost:8080/petstore/ImageServlet/" + datax[ii].imageThumbURL + ""/>"; - - tablex += "</a>"; - tablex += "</td><td class="bpui_petstorelist_cell">"; - tablex += "<a class="bpui_petstorelist_link" target="bppetstore" href="http://localhost:8080/petstore/faces/catalog.jsp#" + - datax[ii].productID + "," + datax[ii].itemID + "">"; - tablex += "<span class="bpui_petstorelist_name">" + datax[ii].name + "</span><br/>"; - tablex += "</a>"; - tablex += "<span class="bpui_petstorelist_description">" + datax[ii].description + "</span>"; - tablex += "</td><td class="bpui_petstorelist_cell">"; - - // add product price - tablex += "<span class="bpui_petstorelist_price">$" + datax[ii].price + "</span><br/>"; - tablex += "</td></tr>"; - tablex += "<tr><td colspan="3"><hr class="bpui_petstorelist_hr" /></td></tr>"; - } - - tablex += "</table></div>"; - - // add product previous and next - tablex += "</td></tr>"; - tablex += "<tr><td colspan="3" style="text-align:center;">"; - tablex += "<span class="bpui_petstorelist_previous" onclick="bpui.petstoreList.previousProducts();"><< PREVIOUS</span> "; - tablex += "<span class="bpui_petstorelist_next" onclick="bpui.petstoreList.nextProducts();">NEXT >></span><br/>"; - tablex += "</td></tr>"; - tablex += "</table>"; - targetDiv.innerHTML=tablex; - bpui.petstoreList.setSelectedCategory(); - } -} - -bpui.petstoreList.setSelectedCategory=function() { - catx=document.getElementById("bpui.petstoreList.categoryList"); - for(ii=0; ii < catx.length; ii++) { - if(catx.options[ii].value == bpui.petstoreList.category) { - catx.options[ii].selected=true; - } - } -} - - -bpui.petstoreList.selectCategory=function() { - catx=document.getElementById("bpui.petstoreList.categoryList"); - bpui.petstoreList.category=catx.value; - - bpui.petstoreList.currentCount=0; - bpui.petstoreList.updateProducts(); -} - - -bpui.petstoreList.nextProducts=function() { - // load data from service - bpui.petstoreList.currentCount += 5; - bpui.petstoreList.updateProducts(); -} - -bpui.petstoreList.previousProducts=function() { - bpui.petstoreList.currentCount -= 5; - if(bpui.petstoreList.currentCount < 0) { - bpui.petstoreList.currentCount=0; - } - bpui.petstoreList.updateProducts(); -} - -bpui.petstoreList.updateProducts=function() { - // load data from service - bodyTag=document.getElementsByTagName("body")[0]; - scriptx=document.createElement("script"); - scriptx.setAttribute("type", "text/javascript"); - scriptx.setAttribute("src", "http://localhost:8080/petstore/catalog?command=items&pid=" + bpui.petstoreList.category + "&start=" + bpui.petstoreList.currentCount + "&length=5&format=jsonp"); - bodyTag.appendChild(scriptx); -} - -bpui.petstoreList.createPetstoreList=function(divName) { - // keep divName for later references - bpui.petstoreList.divName=divName; - - // load data from service - bodyTag=document.getElementsByTagName("body")[0]; - scriptx=document.createElement("script"); - scriptx.setAttribute("type", "text/javascript"); - scriptx.setAttribute("src", "http://localhost:8080/petstore/catalog?command=items&pid=" + bpui.petstoreList.category + "&start=0&length=5&format=jsonp"); - bodyTag.appendChild(scriptx); - -} diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/captchaerror.jsp b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/captchaerror.jsp deleted file mode 100644 index 60ef953..0000000 --- a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/captchaerror.jsp +++ /dev/null @@ -1,23 +0,0 @@ -<%-- Copyright 2006 Sun Microsystems, Inc. All rights reserved. You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at: http://developer.sun.com/berkeley_license.html -$Id: captchaerror.jsp,v 1.1 2006/02/17 03:04:22 yutayoshida Exp $ --%> - -<%@page contentType="text/html"%> -<%@page pageEncoding="UTF-8"%> - - -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" - "http://www.w3.org/TR/html4/loose.dtd"> - -<html> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> - <title>Captcha Error</title> - </head> - <body> - - <h1>Please input the right captcha string -- <a href="./">Try again</a> - - - - </body> -</html> diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/catalog.js b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/catalog.js deleted file mode 100644 index 4bdfc69..0000000 --- a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/catalog.js +++ /dev/null @@ -1,329 +0,0 @@ -/* Copyright 2006 Sun Microsystems, Inc. All rights reserved. You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at: http://developer.sun.com/berkeley_license.html -$Id: catalog.js,v 1.21 2007/01/17 22:16:44 basler Exp $ */ - -var ac; -var is; -var controller; -//var debug=true; - -function getApplicationContextRoot() { - var urlArray=window.location.toString().split("/", 4); - return "/" + urlArray[3]; -} - -var applicationContextRoot=getApplicationContextRoot(); - -function initCatalog() { - ac = new AccordionMenu(); - is = new ImageScroller(); - is.load(); - controller = new CatalogController(); - // wire in a listener for the rating component - dojo.event.connect("before", bpui.rating, "doClick", controller, "modifyState"); - controller.initialize(); -} - -function CatalogController() { - dojo.event.topic.subscribe("/catalog", this, handleEvent); - - // this object structure contains a list of the products and chunks that have been loaded - var pList = new ProductList(); - - var CHUNK_SIZE=7; - var initalRating; - var initalItem; - var originalURL; - - // using this for some browsers that do not support innerHTML - var useDOMInjection = false; - - var infoName = document.getElementById("infopaneName"); - var infoRating = document.getElementById("infopaneRating"); - var infoPrice = document.getElementById("infopanePrice"); - var infoBuyNow = document.getElementById("infopaneBuyNow"); - var infoShortDescription = document.getElementById("infopaneShortDescription"); - var infoDescription = document.getElementById("infopaneDescription"); - // for paypal - var buyNowAmount = document.getElementById("buyNow1_amount"); - var buyNowItemName = document.getElementById("buyNow1_item_name"); - - function handleEvent(args) { - if (args.type == "showingItem") { - // update the id on the ratring component - if (typeof bpui != 'undefined') { - var groupId = is.getGroupId(); - window.location.href= originalURL + "#" + groupId + "," + args.id; - if (typeof bpui.rating != 'undefined') { - // update the rating - bpui.rating.state["rating"].bindings["itemId"]=args.id; - bpui.rating.modifyDisplay("rating", args.rating, true); - // get the currrent item - showItemDetails(args.id); - } else { - initalItem = args.id; - initalRating = args.rating; - } - } else { - // things haven't been loaded to set the inital rating - initalItem = args.id; - initalRating = args.rating; - } - } else if (args.type == "getChunk") { - populateItems(args.id, args.index, args.currentChunk, false); - - } else if (args.type == "showItemDetails") { - showProductDetails(args.productId, args.itemId); - - } else if (args.type == "showProducts") { - is.reset(); - populateItems(args.productId, 0, 0, true); - } - } - - function showItemDetails(id) { - var i = is.getItems().get(id); - setNodeText(infoName, i.name + "<br/><a href='javascript:controller.disableItem("" + id + "","" + i.name + "")'><font size='-1' color='white'><i>Flag as inappropriate</i></font></a>"); - setNodeText(infoPrice, i.price); - setNodeText(infoShortDescription, i.shortDescription); - setNodeText(infoDescription, i.description); - // update the paypal - buyNowAmount.value = i.price; - buyNowItemName.value = i.name; - } - - function setNodeText(t, text) { - if (useDOMInjection) { - t.lastChild.nodeValue = text; - } else { - t.innerHTML = text; - } - } - - this.initialize = function() { - // check whether the innerHTML changes can be used in the infopane - infoName.innerHTML = " "; - if (!useDOMInjection && infoName.innerHTML != " ") { - useDOMInjection = true; - - infoName.appendChild(document.createTextNode("Name")); - infoPrice.appendChild(document.createTextNode("$0.00")); - infoShortDescription.appendChild(document.createTextNode("<description>")); - infoDescription.appendChild(document.createTextNode("<description>")); - } - - var ratingInstance = bpui.rating.state["rating"]; - ratingInstance.grade = initalRating; - bpui.rating.state["rating"].bindings["itemId"]=initalItem; - bpui.rating.modifyDisplay("rating", initalRating, true); - loadAccordion(); - } - - - this.modifyState = function(arg, rating) { - var itemId = initalItem; - if (typeof bpui.rating.state["rating"].bindings["itemId"] != 'undefined') { - itemId = bpui.rating.state["rating"].bindings["itemId"]; - } - // set the cached rating to the new rating that was set. - is.getItems().get(itemId).rating = rating; - } - - - function loadAccordion () { - // go out and get the categories - // this should be made more geric - var bindArgs = { - url: applicationContextRoot + "/catalog?command=categories&format=json", - mimetype: "text/json", - load: function(type,json) { - ac.load(json); - processURLParameters(); - }, - error: ajaxBindError - }; - dojo.io.bind(bindArgs); - } - - // this needs to happen after we have loaded the accordion data - function processURLParameters() { - originalURL = decodeURIComponent(window.location.href); - var params = {}; - // look for the params - if (originalURL.indexOf("#") != -1) { - var qString = originalURL.split('#')[1]; - var args = qString.split(','); - originalURL = originalURL.split('#')[0]; - ac.loadCategoryItem(args[0], args[1]); - return; - } else if (originalURL.indexOf("?") != -1) { - var qString = originalURL.split('?')[1]; - // get rid of any bookmarking stuff - if (qString.indexOf("#") != -1) { - qString = qString.split('#')[0]; - originalURL = originalURL.split('#')[0]; - window.location.href = originalURL; - } - ps = qString.split('&'); - // now go through and create the params map as an object literal - for (var i in ps) { - var t = ps[i].split('='); - params[t[0]] = t[1]; - } - // first check for the item in product - if (typeof params.itemId != 'undefined' && typeof params.pid != 'undefined') { - ac.loadCategoryItem(params.pid, params.itemId); - // next if there is a catid definition then do it - } else if (typeof params.catid != 'undefined') { - ac.showCategory(params.catid); - } - } else { - // nothing is selected - ac.showFirstCategory(); - } - } - - - - function showProductDetails(pid, itemId) { - is.reset(); - is.showProgressIndicator(); - var bindArgs = { - url: applicationContextRoot + "/catalog?command=itemInChunk&pid=" + pid + "&itemId=" + itemId + "&length=" + CHUNK_SIZE, - mimetype: "text/xml", - load: function(type,data,postProcessHandler) { - processProductData(data,true, pid, itemId); - showItemDetails(itemId); - is.doMaximize(); - }, - error: ajaxBindError - }; - dojo.io.bind(bindArgs); - } - - - - function populateItems(pid, index, neededChunk, showImage) { - is.showProgressIndicator(); - is.setGroupId(pid); - printDebug("populateItems - need to make sure displaying - pid=" + pid + " Chunk=" + neededChunk); - - // check to see if relevant scroller page is already loaded - if(!is.containsChunk(pid + "_" + neededChunk)) { - - // not loaded, so see if it is in the cache - if (pList.hasChunk(pid, neededChunk)) { - // in cache, so add chunk to scroller - printDebug("**** adding chunk from cache - pid=" + pid + " Chunk=" + neededChunk); - is.addChunk(pid + "_" + neededChunk); - is.addItems(pList.getChunk(pid, neededChunk)); - - // show first image if you have it - if(showImage && is.getScrollerItems().length > 0) { - is.showImage(is.getScrollerItems()[0].id); - } - - } else { - // not in cache so load it - startRetIndex=(neededChunk * CHUNK_SIZE); - - printDebug("**** retrieving chunk from server - pid=" + pid + " currentIndex=" + index + " startIndex=" + startRetIndex + " Chunk=" + neededChunk); - var bindArgs = { - url: applicationContextRoot + "/catalog?command=items&pid=" + pid + "&start=" + startRetIndex + "&length=" + CHUNK_SIZE, - mimetype: "text/xml", - load: function(type,data,postProcessHandler) { - processProductData(data, showImage, pid, null, neededChunk); - }, - error: ajaxBindError - }; - dojo.io.bind(bindArgs); - } - } else { - printDebug("*** items already showing"); - } - - } - - - function processProductData(responseXML, showImage, pid, iId, chunkId) { - var items = []; - var count = responseXML.getElementsByTagName("item").length; - for (var loop=0; loop < count ; loop++) { - - var item = responseXML.getElementsByTagName("item")[loop]; - var itemId = item.getElementsByTagName("id")[0].firstChild.nodeValue; - var name = item.getElementsByTagName("name")[0].firstChild.nodeValue; - var thumbURL = item.getElementsByTagName("image-tb-url")[0].firstChild.nodeValue; - var imageURL = item.getElementsByTagName("image-url")[0].firstChild.nodeValue; - var description = item.getElementsByTagName("description")[0].firstChild.nodeValue; - var price = item.getElementsByTagName("price")[0].firstChild.nodeValue; - var rating = item.getElementsByTagName("rating")[0].firstChild.nodeValue; - var shortDescription; - if (description.length > 71) { - shortDescription = description.substring(0,71) + "..."; - } else { - shortDescription = description; - } - var i = {id: itemId, name: name, image: imageURL, thumbnail: thumbURL, shortDescription: shortDescription, description: description, price:price, rating: rating}; - items.push(i); - } - - // cache the chunks - pList.addChunk(pid, chunkId, items); - is.addItems(items); - is.addChunk(pid + "_" + chunkId); - - if (showImage && iId == null) { - is.setGroupId(pid); - is.showImage(items[0].id); - } else { - is.setGroupId(pid); - is.showImage(iId); - } - is.hideProgressIndicator(); - } - - function ProductList() { - var _plist = this; - var map = new Map(); - - this.addChunk = function(pid, chunkNumber, items) { - map.put(pid + "_" + chunkNumber, items, true); - } - - this.getChunk = function(pid, chunkNumber) { - return map.get(pid + "_" + chunkNumber); - } - - this.hasChunk = function(pid, chunkNumber) { - return (map.get(pid + "_" + chunkNumber) != null); - } - - this.contents = function() { - return map.contents(); - } - } - - - this.disableItem=function(itemId, itemName) { - // go out and get the categories - // this should be made more geric - if (confirm("Are you sure you want to effectively remove this item from Petstore?")) { - var bindArgs = { - url: applicationContextRoot + "/catalog?command=disable&id=" + itemId, - mimetype: "text/xml", - load: function(type,json) { - //alert("The item named '" + itemName + "' has been disabled!"); - pList = new ProductList(); - is.reset(); - populateItems(is.getGroupId(), 0, 0, true); - }, - error: ajaxBindError - }; - dojo.io.bind(bindArgs); - } - } - - -} - - diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/catalog.jsp b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/catalog.jsp deleted file mode 100644 index 443857b..0000000 --- a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/catalog.jsp +++ /dev/null @@ -1,95 +0,0 @@ -<%-- Copyright 2006 Sun Microsystems, Inc. All rights reserved. You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at: http://developer.sun.com/berkeley_license.html -$Id: catalog.jsp,v 1.22 2007/03/16 21:42:03 basler Exp $ --%> -<script type="text/javascript" src="common.js"></script> -<script type="text/javascript" src="scroller.js"></script> -<link rel="stylesheet" type="text/css" href="scroller.css"></link> -<script type="text/javascript" src="accordion.js"></script> -<link rel="stylesheet" type="text/css" href="accordion.css"></link> -<script type="text/javascript" src="catalog.js"></script> -<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@taglib uri="http://java.sun.com/jsf/html" prefix="h" %> -<%@taglib uri="http://java.sun.com/jsf/core" prefix="f" %> -<%@taglib prefix="ui" uri="http://java.sun.com/blueprints/ui" %> -<body> -<jsp:include page="banner.jsp" /> -<script type="text/javascript"> - dojo.event.connect(window, "onload", function(){initCatalog();}); -</script> -<center> - <table border="0"> - <tr> - <td> - <table id="accordion"> - <tr id="accordionTitle" class="accordionTitle"><td>Pets</td></tr> - <tr><td> - <table id="accordionBody" border="0" class="accordionBody"> - </table> - </td></tr> - </table> - </td> - <td> - <div id="CatalogBrowser"> - <table border="0" class="slider" width="500px" > - <tr height="415" valign="top"> - <td id="bodySpace" border="0" align="center"></td> - </tr> - <tr id="targetRow"> - <td width="500" height="70 align="top"> - <div class="nav" id="right_button"> - <img src="${pageContext.request.contextPath}/images/right.gif" name="nextRoll" title="Show More Items" border="0"> - </div> - <div class="nav" id="left_button"> - <img src="${pageContext.request.contextPath}/images/left.gif" name="previousRoll" title="Show Previous Items" border="0"> - </div> - <div id="infopane" class="infopane"> - <table class="infopaneTable"> - <tr> - <td id="infopaneName" class="infopaneTitle"> - </td> - <td id="infopaneRating" class="infopaneRating"> - <f:view> - <ui:rating id="rating" maxGrade="5" includeNotInterested="false" includeClear="false" - hoverTexts="#{RatingBean.ratingText}" notInterestedHoverText="Not Interested" clearHoverText="Clear Rating" - grade="#{RatingBean.grade}"/> - <f:verbatim></td><td id="infopanePrice" class="infopanePrice"></td><td id="infopanePayPal" class="infopanePayPal"></f:verbatim> - <ui:buyNow business="donate@animalfoundation.com" id="buyNow1" itemName="Buy Item One" - amount="100.00" quantity="1" type="BuyNow" postData="#{PayPalBean.postData}" target="paypal"/> - </f:view> - </td> - <td id="infopaneIndicator" class="infopaneIndicator"> - </td> - <td id="infopaneDetailsIcon"> - </td> - </tr> - <tr> - <td id="infopaneShortDescription" colspan="7" class="infopaneShortDescription"> - </td> - </tr> - <tr style="height:20px"> - <td></td> - </tr> - <tr> - <td id="infopaneDescription" colspan="6" class="infopaneDescription"> - </td> - </tr> - </table> - </div> - </td> - </tr> - </table> - </td> - <td style="vertical-align:top; width:300px; text-align:right;"> - <div id="downloadAds"> - <jsp:include page="download.jsp" /> - </div> - </td> - </tr> - </table> - </div> - <div id="status" style="text-align:left"></div> <div id="status_2"></div> - <div id="dstatus"></div> - <div id="injection_point"></div> -</center> -<jsp:include page="footer.jsp" /> -</body> -</html> diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/catalog.jsp-old b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/catalog.jsp-old deleted file mode 100644 index 13914ed..0000000 --- a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/catalog.jsp-old +++ /dev/null @@ -1,95 +0,0 @@ -<%-- Copyright 2006 Sun Microsystems, Inc. All rights reserved. You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at: http://developer.sun.com/berkeley_license.html -$Id: catalog.jsp,v 1.20 2006/12/01 21:38:40 basler Exp $ --%> -<script type="text/javascript" src="common.js"></script> -<script type="text/javascript" src="scroller.js"></script> -<link rel="stylesheet" type="text/css" href="scroller.css"></link> -<script type="text/javascript" src="accordion.js"></script> -<link rel="stylesheet" type="text/css" href="accordion.css"></link> -<script type="text/javascript" src="catalog.js"></script> -<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@taglib uri="http://java.sun.com/jsf/html" prefix="h" %> -<%@taglib uri="http://java.sun.com/jsf/core" prefix="f" %> -<%@taglib prefix="ui" uri="http://java.sun.com/blueprints/ui" %> -<body> -<jsp:include page="banner.jsp" /> -<script type="text/javascript"> - dojo.event.connect(window, "onload", function(){initCatalog();}); -</script> -<center> - <table border="0"> - <tr> - <td> - <table id="accordion"> - <tr id="accordionTitle" class="accordionTitle"><td>Pets</td></tr> - <tr><td> - <table id="accordionBody" border="0" class="accordionBody"> - </table> - </td></tr> - </table> - </td> - <td style="min-width:500px;"> - <div id="CatalogBrowser"> - <table width="500px"border="1" class="slider" > - <tr height="415" valign="top"> - <td id="bodySpace" border="0" align="center"></td> - </tr> - <tr id="targetRow"> - <td width="500px" height="70px" align="top"> - <div class="nav" id="right_button"> - <img src="${pageContext.request.contextPath}/images/right.gif" name="nextRoll" title="Show More Items" border="0"> - </div> - <div class="nav" id="left_button"> - <img src="${pageContext.request.contextPath}/images/left.gif" name="previousRoll" title="Show Previous Items" border="0"> - </div> - <div id="infopane" class="infopane"> - <table class="infopaneTable"> - <tr> - <td id="infopaneName" class="infopaneTitle"> - </td> - <td id="infopaneRating" class="infopaneRating"> - <f:view> - <ui:rating id="rating" maxGrade="5" includeNotInterested="false" includeClear="false" - hoverTexts="#{RatingBean.ratingText}" notInterestedHoverText="Not Interested" clearHoverText="Clear Rating" - grade="#{RatingBean.grade}"/> - <f:verbatim></td><td id="infopanePrice" class="infopanePrice"></td><td id="infopanePayPal" class="infopanePayPal"></f:verbatim> - <ui:buyNow business="donate@animalfoundation.com" id="buyNow1" itemName="Buy Item One" - amount="100.00" quantity="1" type="BuyNow" postData="#{PayPalBean.postData}" target="paypal"/> - </f:view> - </td> - <td id="infopaneIndicator" class="infopaneIndicator"> - </td> - <td id="infopaneDetailsIcon"> - </td> - </tr> - <tr> - <td id="infopaneShortDescription" colspan="7" class="infopaneShortDescription"> - </td> - </tr> - <tr style="height:20px"> - <td></td> - </tr> - <tr> - <td id="infopaneDescription" colspan="6" class="infopaneDescription"> - </td> - </tr> - </table> - </div> - </td> - </tr> - </table> - </td> - <td style="vertical-align:top; width:300px; text-align:right;"> - <div id="downloadAds"> - <jsp:include page="download.jsp" /> - </div> - </td> - </tr> - </table> - </div> - <div id="status" style="text-align:left"></div> <div id="status_2"></div> - <div id="dstatus"></div> - <div id="injection_point"></div> -</center> -<jsp:include page="footer.jsp" /> -</body> -</html> \ No newline at end of file diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/common.js b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/common.js deleted file mode 100644 index 03a3ba2..0000000 --- a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/common.js +++ /dev/null @@ -1,77 +0,0 @@ - - function ajaxBindError(type, errObj) { - // can't use the error page, because unless and exception in the internal servlet container - // nullpointer exceptions will be thrown - //window.location="./systemerror.jsp?message=" + errObj.message; - - alert("An Exception has been encountered on the server side during an Ajax request. Please see the server logs for more information " + errObj.message); - } - - - function debugProperties(namex) { - var listx=""; - var ob=namex; - for(xx in ob) { - listx += xx + " = " + ob[xx] + "<br/>" - } - //document.write(listx); - alert(listx); - } - - - function printDebug(argx) { - if (typeof debug != 'undefined') { - document.getElementById("status").innerHTML = argx + "<br>" + document.getElementById("status").innerHTML; - } - } - - - function Map() { - var size = 0; - var keys = []; - var values = []; - - this.put = function(key, value, replace) { - if (this.get(key) == null) { - keys[size] = key; - values[size] = value; - size++; - } else if (replace) { - for (i=0; i < size; i++) { - if (keys[i] == key) { - values[i] = value; - } - } - } - } - - this.get = function(key) { - for (i=0; i < size; i++) { - if (keys[i] == key) { - return values[i]; - } - } - return null; - } - - this.clear = function() { - size = 0; - keys = []; - values = []; - } - - // return keys show can show main image - this.getKeys = function() { - return keys; - } - - // dump contents of map keys as string - this.contents = function() { - var retx=""; - for(ii=0; ii < size; ii++) { - retx += keys[ii] + ", "; - } - return retx; - } - - } \ No newline at end of file diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/download.jsp b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/download.jsp deleted file mode 100644 index 20ef584..0000000 --- a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/download.jsp +++ /dev/null @@ -1,22 +0,0 @@ -<div id="downloadAds" style="text-align:center; border-style:none; width:100%;"> - <table style="width:100%;"> - <tr> - <td style="text-align:center;"> - <a href="http://java.sun.com/javaee/downloads/index.jsp" target="downloads"><img style="border:none" src="./images/ad-sdk.jpg" alt="Download Java EE 5 SDK"/></a> - <br/> - </td> - </tr> - <tr> - <td style="text-align:center;"> - <a href="http://www.netbeans.org/downloads/index.html" target="downloads"><img style="border:none" src="./images/ad-netbeans.jpg" alt="Download Netbeans IDE"/></a> - <br/> - </td> - </tr> - <tr> - <td style="text-align:center;"> - <a href="http://java.com/en/download/index.jsp" target="downloads"><img style="border:none" src="./images/ad-jre.jpg" alt="Download Java SE"/></a> - <br/> - </td> - </tr> - </table> -</div> diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/downloadAd.js b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/downloadAd.js deleted file mode 100644 index 65855c2..0000000 --- a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/downloadAd.js +++ /dev/null @@ -1,54 +0,0 @@ -dojo.require("dojo.io"); -function checkAdPage() { - var bindArgs = { - // check to see if an updated page is available - URL: "http://localhost:8080/petstore/downloadAd.txt", - mimetype: "text/plain", - load: returnFunctionx, - error: ajaxBindError}; - - // dispatch the request - dojo.io.bind(bindArgs); -} - -function returnFunctionx(type, data, evt) { - // statically setup popup for simple case - // check return of the dojo call to make sure it is valid - if (evt.readyState == 4) { - if (evt.status == 200) { - alert("data = " + data); - document.getElementById("downloadAds").innerHTML=data; - } - } -} - - -var req; - -function checkAdPageMark() { - // calculate arrow and border image location - req=initRequest(); - - url="http://blueprints.dev.java.net/petstore/downloadAd.txt", - req.onreadystatechange = returnFunctionxMark; - req.open("GET", url, true); - req.send(null); -} - - -function returnFunctionxMark() { - if (req.readyState == 4) { - if (req.status == 200) { - alert("data = " + req.responseText); - document.getElementById("downloadAds").innerHTML=req.responseText; - } - } -} - -initRequest=function() { - if (window.XMLHttpRequest) { - return new XMLHttpRequest(); - } else if (window.ActiveXObject) { - return new ActiveXObject("Microsoft.XMLHTTP"); - } -} diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/downloadAd.json b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/downloadAd.json deleted file mode 100644 index 3bbf564..0000000 --- a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/downloadAd.json +++ /dev/null @@ -1,7 +0,0 @@ -jsonpTest({"keyId":"TestData"}); - -function testexample() { - alert("testexample!!"); -} - -testexample(); \ No newline at end of file diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/downloadAd.txt b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/downloadAd.txt deleted file mode 100644 index e9a0944..0000000 --- a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/downloadAd.txt +++ /dev/null @@ -1 +0,0 @@ -<div id='downloadAds' style='text-align:center; border-style:double; width:100%;'> <table style='width:100%'> <tr> <th style='text-align:center; border-bottom:thin solid black;'>DOWNLOADS Blueprints</th> </tr> <tr> <td style='text-align:center;'> <a href='http://java.sun.com/javaee/downloads/index.jsp' target='downloads'><img style='border:none' src='./images/ad-sdk.jpg' alt='Download Java EE 5 SDK'/></a> </td> </tr> <tr> <td style='text-align:center;'> <a href='http://www.netbeans.org/downloads/index.html' target='downloads'><img style='border:none' src='./images/ad-netbeans.jpg' alt='Download Netbeans IDE'/></a> </td> </tr> <tr> <td style='text-align:center;'> <a href='http://java.com/en/download/index.jsp' target='downloads'><img style='border:none' src='./images/ad-jre.jpg' alt='Download Java SE'/></a> </td> </tr> </table></div> \ No newline at end of file diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/engine.js b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/engine.js deleted file mode 100644 index 0e5b14e..0000000 --- a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/engine.js +++ /dev/null @@ -1,241 +0,0 @@ -/* Copyright 2006 Sun Microsystems, Inc. All rights reserved. You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at: http://developer.sun.com/berkeley_license.html -$Id: engine.js,v 1.10 2006/05/03 22:00:32 inder Exp $ */ - -function Engine () { - - /** - * - * Load template text aloing with an associated script - * - * Argument p properties are as follows: - * - * url : Not required but used if you want to get the template from - * something other than the injection serlvet. For example if - * you want to load content directly from a a JSP or HTML file. - * - * p.template : Not required if you specficy a url property Otherewise this - * is the name of the template file. - * - * p.initFunction: Not required. This function or function pointer will be called - * after the template text and script are loaded. The result of - * the evaluated script will be accessible in the context of - * this function. - * - * p.injectionPoint: Not required. This is the id of an element into. If this is - * not specfied a div will be created under the roon node of - * the document and the template will be injected into it. - * Content is injected by setting the innerHTML property - * of an element to the template text. - */ - this.inject = function (p) { - var targetUrl; - if (!p.url) targetUrl = "controller?command=content&target=/" + p.template; - else targetUrl = p.url; - var templateArgs = { - url: targetUrl, - mimetype: "text/html", - load: function(type, data) { - //if no parent is given append to the document root - var nData = includeEmbeddedResources(data, p.initFunction ); - if (!p.injectionPoint) { - var injectionPoint = document.createElement("div"); - injectionPoint.innerHTML = nData; - document.firstChild.appendChild(injectionPoint); - } else { - p.injectionPoint.innerHTML = nData; - } - if (p.script) { - // now load the associated JavaScript - loadScript(p.script,p.initFunction); - } - } - }; - dojo.io.bind(templateArgs); - } - - function loadScript(targetURL,callback) { - var templateArgs = { - url: targetURL, - mimetype: "text/plain", - load: callback - }; - dojo.io.bind(templateArgs); - } - - /** - * If were returning an text document remove any script in the - * the document and add it to the global scope using a time out. - */ - function includeEmbeddedResources(target, initFunction) { - var bodyText = ""; - var embeddedScripts = []; - var embeddedStyles = []; - var scriptReferences = []; - var styleReferences = []; - var styles = []; - // recursively go through and weed out the scripts - // TODO: Use some better REGEX processing - // TODO: Also support single quotes - while (target.indexOf("<script") != -1) { - var realStart = target.indexOf("<script"); - var scriptSourceStart = target.indexOf("src=", (realStart)); - var scriptElementEnd = target.indexOf(">", realStart); - var end = target.indexOf("</script>", (realStart)) + "</script>".length; - if (realStart != -1 && scriptSourceStart != -1) { - var scriptSourceName; - var scriptSourceLinkStart= scriptSourceStart + 5; - var scriptSourceLinkEnd= target.indexOf(""", (scriptSourceLinkStart + 1)); - if (scriptSourceStart < scriptElementEnd) { - scriptSourceName = target.substring(scriptSourceLinkStart, scriptSourceLinkEnd); - // prevent multiple inclusions of dojo.js. - // there is no way you would get to this point without dojo being included - if (scriptSourceName.indexOf("dojo.js") == -1) { - scriptReferences.push(scriptSourceName); - } - } - } - // now remove the script body - var scriptBodyStart = scriptElementEnd + 1; - var sBody = target.substring(scriptBodyStart, end - "</script>".length); - if (sBody.length > 0) { - embeddedScripts.push(sBody); - } - //remove script - target = target.substring(0, realStart) + target.substring(end, target.length); - } - - while (target.indexOf("<style") != -1) { - var realStart = target.indexOf("<style"); - var styleElementEnd = target.indexOf(">", realStart); - var end = target.indexOf("</style>", (realStart)) ; - var styleBodyStart = styleElementEnd + 1; - var sBody = target.substring(styleBodyStart, end); - if (sBody.length > 0) { - embeddedStyles.push(sBody); - } - //remove style - target = target.substring(0, realStart) + target.substring(end + "</style>".length, target.length); - } - // get the links - while (target.indexOf("<link") != -1) { - var realStart = target.indexOf("<link"); - var styleSourceStart = target.indexOf("href=", (realStart)); - var styleElementEnd = target.indexOf(">", realStart) +1; - if (realStart != -1 && styleSourceStart != -1) { - var styletSourceName; - var styleSourceLinkStart= styleSourceStart + 6; - var styleSourceLinkEnd= target.indexOf(""", (styleSourceLinkStart + 1)); - if (styleSourceStart < styleElementEnd) { - styleSourceName = target.substring(styleSourceLinkStart, styleSourceLinkEnd); - styleReferences.push(styleSourceName); - } - //remove style - target = target.substring(0, realStart) + target.substring(styleElementEnd, target.length); - } - } - - var head = document.getElementsByTagName("head")[0]; - - // inject the links - for(var loop = 0; loop < styleReferences.length; loop++) { - var link = document.createElement("link"); - link.href = styleReferences[loop]; - link.type = "text/css"; - link.rel = "stylesheet"; - head.appendChild(link); - } - - var stylesElement; - if (embeddedStyles.length > 0) { - stylesElement = document.createElement("style"); - stylesElement.type="text/css"; - var stylesText; - for(var loop = 0; loop < embeddedStyles.length; loop++) { - stylesText = stylesText + embeddedStyles[loop]; - } - if (document.styleSheets[0].cssText) { - document.styleSheets[0].cssText = document.styleSheets[0].cssText + stylesText; - } else { - stylesElement.appendChild(document.createTextNode(stylesText)); - head.appendChild(stylesElement); - } - } - - scriptLoader(scriptReferences, 0, function() { - this.embeddedScripts = embeddedScripts; - // evaluate the embedded javascripts in the order they were added - // consider using an onload handler - for(var loop = 0; loop < embeddedScripts.length; loop++) { - //alert("evaluating " + embeddedScripts[loop]); - var script = embeddedScripts[loop]; - // append to the script a method to call the scriptLoaderCallback - eval(script); - if (loop == (embeddedScripts.length -1)) { - initFunction(); - } - } - }); - - return target; - } - - - /** - * Load the scripts in order and load them one after on another - */ - function scriptLoader(scripts, index, callbackFunction) { - var head = document.getElementsByTagName("head").item(0); - var scriptElement = document.createElement("script"); - scriptElement.id = "c_script_" + index; - scriptElement.type = "text/javascript"; - - var loadHandler = function () { - if (index < scripts.length && index != scripts.length -1) { - scriptLoader(scripts, ++index, callbackFunction); - } else { - callbackFunction(); - } - } - if (typeof scriptElement.onreadystatechange != 'undefined') { - scriptElement.onreadystatechange = function () { - if (this.readyState == 'loaded') { - loadHandler(); - } - }; - } - scriptElement.onload = loadHandler; - - // Safari not seeing the onload event and does not support the onreadystate - if (navigator.userAgent.toLowerCase().indexOf("safari") != -1) { - scriptElement.src = scripts[index]; - setTimeout(loadHandler, 0); - } - head.appendChild(scriptElement); - setTimeout("document.getElementById('c_script_" + index + "').src ='" + scripts[index] + "'", 0); - - scriptElement = null; - head = null; - } - - /** - * If were returning an XML document remove any script in the - * the document and add it to the global scope using a time out. - */ - function includeEmbeddedScripts(xmlDocument) { - var items = new Array(); - var xmlDocument = document.getElementsByTagName("script"); - - for(var loop = 0; loop < targets.length; loop++) { - var children = targets[loop].childNodes; - var iScript = ""; - for(var innerLoop = 0; innerLoop < children.length; innerLoop++) { - iScript += children[innerLoop].data; - } - items.add(iScript); - children[loop].parentNode.removeChild(children[loop]); - } - for(var loop = 0; loop < items.length; loop++) { - setTimeout(items[loop],0); - } - } -} diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/fileupload.jsp b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/fileupload.jsp deleted file mode 100644 index bb8fb85..0000000 --- a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/fileupload.jsp +++ /dev/null @@ -1,266 +0,0 @@ -<%-- Copyright 2006 Sun Microsystems, Inc. All rights reserved. You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at: http://developer.sun.com/berkeley_license.html -$Id: fileupload.jsp,v 1.57 2007/03/08 21:58:48 inder Exp $ --%> - -<%@page contentType="text/html"%> -<%@page pageEncoding="UTF-8"%> -<%@page import="com.sun.javaee.blueprints.petstore.util.PetstoreConstants"%> -<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@taglib uri="http://java.sun.com/jsf/html" prefix="h" %> -<%@taglib uri="http://java.sun.com/jsf/core" prefix="f" %> -<%@taglib prefix="ui" uri="http://java.sun.com/blueprints/ui" %> - -<html> - <head> - <title>Petstore Seller page</title> - <script type="text/javascript"> - var submittingForm=false; - - function testRetFunction(type, data, evt){ - if (evt.readyState == 4) { - if(evt.status == 200) { - // check for error - submittingForm=false; - var resultx=data.getElementsByTagName("response")[0]; - var message=resultx.getElementsByTagName("message")[0].childNodes[0].nodeValue; - if(message == "Captchas Filter Error") { - // captcha error - alert("Authorization failed : please enter the correct captcha string"); - } else if(message == "Validation Error") { - alert("Validation failed on the Server :\n" + resultx.getElementsByTagName("detail")[0].childNodes[0].nodeValue); - } else if(message == "Upload Size Error") { - alert("The size of the uploaded image must not be more than 100 KB"); - } else { - // fileupload complete - var thumbpath=resultx.getElementsByTagName("thumbnail")[0].childNodes[0].nodeValue; - var productId=resultx.getElementsByTagName("productId")[0].childNodes[0].nodeValue; - var itemid=resultx.getElementsByTagName("itemId")[0].childNodes[0].nodeValue; - // forward to status page - location.href="fileuploadstatus.jsp?message=" + message + "&id=" + itemid + "&productId=" + productId + "&thumb=" + thumbpath; - } - } else { - // server error, send to error page - // can't forward to errorpage because null pointer gets thrown on lookup of status code ("javax.servlet.error.status_code") - //ajaxBindError(type, data.message); - alert("Persistence failed : Please check if the server logs for more information!") - } - } - } - - - function storeCookie() { - currentcap = "j_captcha_response="+document.getElementById("TestFileuploadForm:captcharesponse").value; - document.cookie = currentcap; - } - - function extractCity(citystatezip) { - var index = citystatezip.indexOf(','); - var nextcity = citystatezip.substring(0, index+4); - return nextcity; - } - - function chooseCity(city) { - var index = city.indexOf(','); - var state = city.substring(index+2, index+4); - var zip = city.substring(index+5); - city = city.substring(0, index); - - document.getElementById('TestFileuploadForm:cityField').value = city; - document.getElementById('TestFileuploadForm:stateField').value = state; - document.getElementById('TestFileuploadForm:zipField').value = zip; - } - - function fileuploadOnsubmit() { - if(!submittingForm) { - var valMess=""; - - // save rich text editor text to element - var descx=dojo.widget.byId('rtEditor').getEditorContent() - var lowDescx=descx.toLowerCase(); - - // START: check validation - if(dojo.byId("TestFileuploadForm:name").value == "") { - valMess += "Error: Pet Name is required.\n"; - } - - // make sure there isn't a script/link tag in the description - if(lowDescx == "" || lowDescx.indexOf("<script") > -1 || lowDescx.indexOf("<link") > -1) { - valMess += "Error: The Description must exist and the field can't have a '<script>' and/or a '<link>' tag in it\n"; - } - - // make sure price is a number - var pricex=dojo.byId("TestFileuploadForm:price").value; - if(pricex == "" || isNaN(parseInt(pricex))) { - // price should be a number - valMess += "Error: Price should should exist and be a number in American Dollars in the format '*.00'.\n"; - } - - // make sure the upload file ends in an suffix - var filex=dojo.byId("fileToUploadId").value; - var lengthx=filex.length; - var suffix=filex.substr(lengthx-4).toLowerCase(); - if(lengthx < 1 || (suffix != ".jpg" && suffix != ".gif" && suffix != ".png")) { - // not a proper upload so error - valMess += "Error: The image upload file must exist and be of type .jpg, .gif or .png\n"; - } - - - // make sure make and address is entered - if(dojo.byId("TestFileuploadForm:firstName").value == "") { - // price should be a number - valMess += "Error: First Name is required.\n"; - } - if(dojo.byId("TestFileuploadForm:lastName").value == "") { - valMess += "Error: Last Name is required.\n"; - } - if(dojo.byId("TestFileuploadForm:street1").value == "") { - valMess += "Error: Street is required.\n"; - } - if(dojo.byId("TestFileuploadForm:cityField").value == "") { - valMess += "Error: City is required.\n"; - } - if(dojo.byId("TestFileuploadForm:stateField").value == "") { - valMess += "Error: State is required.\n"; - } - if(dojo.byId("TestFileuploadForm:zipField").value == "") { - valMess += "Error: Zip Code is required.\n"; - } - - if(valMess != "") { - // error, show message - alert(valMess + "\nPlease addresses the error(s) and re-submit your entry!"); - } else { - // no validation errors, so submit form - submittingForm=true; - // set description - dojo.byId('description').value=descx; - - storeCookie() - document.forms['TestFileuploadForm'].onsubmit(); - } - } - } - - function showFU() { - document.getElementById("fucomponent").style.visibility = "visible"; - } - - function switchPanes(fromDivId, toDivId) { - // show pane - var divx=document.getElementById(fromDivId); - divx.style.visibility='hidden'; - divx=document.getElementById(toDivId); - divx.style.visibility='visible'; - } -</script> -<style> -span.button { - background-color: #6699CC; - color: white; - cursor:pointer; - border: thin outset black; - padding: 1px 5px; -} -div.pane { - width: 90%; - background-color: #EEEEEE; - border: thin double blue; - padding: .5cm; - font: 12px arial; -} - -.nameCol { - width: 45%; -} -.dataCol { - width: 55%; -} - -</style> - </head> - <body onload="showFU()"> - <jsp:include page="banner.jsp"/> - <script>dojo.require("dojo.widget.Editor2");</script> - <br/> - <div id="fucomponent" style="visibility:hidden;"> - <f:view> - - <ui:fileUploadTag id="TestFileuploadForm" serverLocationDir="#{FileUploadBean.uploadImageDirectory}" - postProcessingMethod="#{FileUploadBean.postProcessingMethod}" - retMimeType="text/xml" retFunction="testRetFunction" - progressBarDivId="progress" progressBarSize="40"> - <div id="pane2" class="pane" style="visibility: hidden;"> - <h:panelGrid border="0" columns="2" style="width: 100%" columnClasses="nameCol, dataCol"> - <f:facet name="header"> - <h:outputText value="Information about yourself"/> - </f:facet> - <h:outputText value="*First Name"/> - <h:inputText size="20" id="firstName"></h:inputText> - <h:outputText value="*Last Name"/> - <h:inputText size="20" id="lastName"></h:inputText> - <h:outputText value="Seller Email"/> - <h:inputText size="20" id="email"></h:inputText> - <h:outputText value="*Street"/> - <h:inputText size="20" id="street1"></h:inputText> - <h:outputText value="*City"/> - <ui:autoComplete size="20" maxlength="10" id="cityField" - completionMethod="#{AutocompleteBean.completeCity}" - value="#{AddressBean.city}" required="true" - ondisplay="function(item) { return extractCity(item); }" - onchoose="function(item) { return chooseCity(item); }" /> - <h:outputText value="*State"/> - <ui:autoComplete size="2" maxlength="10" id="stateField" - completionMethod="#{AutocompleteBean.completeState}" - value="#{AddressBean.state}" required="true" /> - <h:outputText value="*Zip Code"/> - <h:inputText size="5" id="zipField" value="#{AddressBean.zip}" required="true" /> - - <h:outputText value="Enter the text as it is shown below (case insensitive)"/> - <h:outputText /> - <h:graphicImage id="captchaImg" url="CaptchaServlet"/> - <h:inputText id="captcharesponse"></h:inputText> - <br/><span class="button" onclick="switchPanes('pane2', 'pane1');"><< Previous</span> - <span class="button" onclick="fileuploadOnsubmit()">Submit</span> - <br/><div id="progress"></div><br/> - - </h:panelGrid> - </div> - <div class="pane"style="position:absolute; top:125px;" id="pane1"> - <h:panelGrid border="0" columns="2" style="width: 100%" columnClasses="nameCol, dataCol"> - <f:facet name="header"> - <h:outputText value="Information about your pet"/> - </f:facet> - - <h:outputText value="Category"/> - <h:selectOneMenu id="product"> - <f:selectItems value="#{FileUploadBean.products}"/> - </h:selectOneMenu> - - <h:outputText value="*Pet's Name"/> - <h:inputText size="20" id="name"></h:inputText> - - <h:outputText value="*Description (3 lines max display in catalog)"/> - - <div style="border-style:inset; border-width:thin; background-color:white"> - <textarea wrap="soft" dojoType="Editor2" widgetId="rtEditor" id="description" name="TestFileuploadForm:description" - toolbarTemplatePath="${pageContext.request.contextPath}/rteToolBar.html"></textarea> - </div> - - <h:outputText value="*Price (is US dollars)"/> - <h:inputText size="20" id="price"></h:inputText> - - <h:outputText value="*Image File"/> - <input type="file" size="20" name="fileToUpload" id="fileToUploadId"/> - - <h:outputText value="Custom Tag Keywords (separated by spaces)"/> - <h:inputText size="20" id="tags"></h:inputText> - </h:panelGrid> - <br/><span class="button" onclick="switchPanes('pane1', 'pane2');">Next >></span> - </div> - Required fields are designated by a * - </ui:fileUploadTag> - </f:view> - </div> - - <jsp:include page="footer.jsp" /> - </body> -</html> diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/fileuploadstatus.jsp b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/fileuploadstatus.jsp deleted file mode 100644 index 50e3730..0000000 --- a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/fileuploadstatus.jsp +++ /dev/null @@ -1,134 +0,0 @@ -<%-- Copyright 2006 Sun Microsystems, Inc. All rights reserved. You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at: http://developer.sun.com/berkeley_license.html -$Id: fileuploadstatus.jsp,v 1.8 2006/05/05 21:05:47 yutayoshida Exp $ --%> - -<%@page contentType="text/html"%> -<%@page pageEncoding="UTF-8"%> - -<html> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> - <title>Seller Photo Submit Status</title> - <style type="text/css"> - #status { background-color : #E0FFFF; - border : none; - width : 50%; - } - </style> - <script type="text/javascript"> - window.onload = function() { - var thumbfile = "${param.thumb}"; - if (thumbfile == "") { - thumbfile = "${sessionScope['fileuploadResponse'].thumbnail}"; - } - thumbpath = "http://$%7BpageContext.request.serverName%7D:$%7BpageContext.request.serverP..."; - thumbpath += thumbfile; - var divNode = document.getElementById("thumb"); - var imgNode = document.createElement("img"); - imgNode.setAttribute("src", thumbpath); - divNode.appendChild(imgNode); - - // initialize buttons - initButtonImage(); - } - - var imageLayerId = new Array(); - var imageLayerG = new Array(); - var imageLayerC = new Array(); - var imageText = new Array(); - function initButtonImage(){ - imageLayerId[1] ="seller" - imageLayerG[1] = "../images/seller-thumb-g.jpg"; - imageLayerC[1] = "../images/seller-thumb.jpg"; - imageLayerId[2] ="catalog" - imageLayerG[2] = "../images/catalog-thumb-g.jpg"; - imageLayerC[2] = "../images/catalog-thumb.jpg"; - imageLayerId[3] ="home" - imageLayerG[3] = "../images/index-thumb-g.jpg"; - imageLayerC[3] = "../images/index-thumb.jpg"; - - imageText[1] = "Submit another pet"; - imageText[2] = "Go to your pet page"; - imageText[3] = "Go back to PetStore home"; - } - - function highlightButton(n) { - switchButton(true, n); - } - function darkenButton(n) { - switchButton(false, n); - } - - function switchButton(highlight, n){ - var id = imageLayerId[n]; - var btn = document.getElementById(id); - if (highlight) { - btn.src = imageLayerC[n]; - popupText(imageText[n]); - } else { - btn.src = imageLayerG[n]; - popupText(null); - } - } - var Mx; - var My; - function popupText(txt) { - var pNode = document.getElementById("popupText"); - var rx; - var ry; - if (document.all) { - rx = event.clientX + document.body.scrollLeft +10; - ry = event.clientY + document.body.scrollTop -20; - } else { - rx = Mx + 10; - ry = My -20; - } - if (txt) { - pNode.style.display = "block"; - pNode.style.left = rx + "px"; - pNode.style.top = ry + "px"; - pNode.innerHTML = txt; - } else { - pNode.style.display = "none"; - pNode.innerHTML = ""; - } - } - function getMouseXY(mEvent) { - Mx = mEvent.pageX; - My = mEvent.pageY; - } - window.onmousemove = getMouseXY; - </script> - </head> - <body> - <jsp:include page="banner.jsp"/> - <center> - <div id="status"> - <h4>${param.message}</h4> - Here's the uploaded photo of your pet<br/><br/> - <div id="thumb"></div> - <br/><br/> - Would you like to :-<br/><br/> - - <div id="popupText" style="position:absolute;z-index:2;border:1px solid;padding:5px; - border-color:blue;font-size:10pt;background-color:#00ffff;color:blue;display:none"></div> - <table border="0" cellpadding="4" cellspacing="4"> - <tr> - <td><a href="fileupload.jsp" onmouseover="highlightButton(1)" onmouseout="darkenButton(1)"> - <img name="seller" id="seller" src="../images/seller-thumb-g.jpg" alt="seller" width="105" height="60" border="0"> - </a> - </td> - <td><a href="catalog.jsp?pid=${param.productId}&itemId=${param.id}" onmouseover="highlightButton(2)" onmouseout="darkenButton(2)"> - <img name="catalog" id="catalog" src="../images/catalog-thumb-g.jpg" alt="catalog" width="105" height="60" border="0"> - </a> - </td> - <td><a href="http://${pageContext.request.serverName}:${pageContext.request.serverPort}${pageContext.servletContext.contextPath}/index.jsp" onmouseover="highlightButton(3)" onmouseout="darkenButton(3)"> - <img name="home" id="home" src="../images/index-thumb-g.jpg" alt="index" width="105" height="60" border="0"> - </a> - </td> - </tr> - </table> - </div> - </center> - <jsp:include page="footer.jsp" /> - </body> -</html> diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/footer.jsp b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/footer.jsp deleted file mode 100644 index 8fda523..0000000 --- a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/footer.jsp +++ /dev/null @@ -1,15 +0,0 @@ -<%-- Copyright 2006 Sun Microsystems, Inc. All rights reserved. You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at: http://developer.sun.com/berkeley_license.html -$Id: footer.jsp,v 1.10 2007/01/31 19:40:34 basler Exp $ --%> - -<hr/> -<center> - If you have any questions or suggestions, please use the <a - href="https://blueprints.dev.java.net/feedback.html" target="petstore">feedback page</a>. - <br/> - To access the latest versions of any of the BluePrints projects, please use the <a - href="https://blueprints.dev.java.net/downloads.html" target="petstore">download page</a>. - <br/> - <a href="http://blueprints.dev.java.net/" target="petstore">Java BluePrints</a> | - <a href="http://sun.com/" target="petstore">Sun Microsystems</a> © 2007 Sun Microsystems Inc. All rights reserved. Use is subject to license terms. -</center> - diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9081-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9081-s.jpg deleted file mode 100644 index 734f0ba..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9081-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9081.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9081.jpg deleted file mode 100644 index 1d6b615..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9081.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9083-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9083-s.jpg deleted file mode 100644 index d50fc6f..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9083-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9083.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9083.jpg deleted file mode 100644 index 77fb082..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9083.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9084-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9084-s.jpg deleted file mode 100644 index 93a3832..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9084-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9084.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9084.jpg deleted file mode 100644 index b7c7c3b..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9084.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9086-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9086-s.jpg deleted file mode 100644 index 0c9ce17..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9086-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9086.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9086.jpg deleted file mode 100644 index caaf6a7..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9086.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9088-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9088-s.jpg deleted file mode 100644 index 6c7d06e..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9088-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9088.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9088.jpg deleted file mode 100644 index f7daf7a..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9088.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9099-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9099-s.jpg deleted file mode 100644 index 2794a4b..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9099-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9099.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9099.jpg deleted file mode 100644 index 57175e3..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9099.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9100-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9100-s.jpg deleted file mode 100644 index d1b3610..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9100-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9100.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9100.jpg deleted file mode 100644 index dd57db1..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9100.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9101-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9101-s.jpg deleted file mode 100644 index 2f14c53..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9101-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9101.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9101.jpg deleted file mode 100644 index 334a0f8..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9101.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9102-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9102-s.jpg deleted file mode 100644 index 6bec9fa..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9102-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9102.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9102.jpg deleted file mode 100644 index 6219a97..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9102.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9103-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9103-s.jpg deleted file mode 100644 index 61b9b59..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9103-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9103.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9103.jpg deleted file mode 100644 index d4a91e0..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9103.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9104-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9104-s.jpg deleted file mode 100644 index 9c7c4ab..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9104-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9104.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9104.jpg deleted file mode 100644 index 93eb9da..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9104.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9107-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9107-s.jpg deleted file mode 100644 index cacb8f6..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9107-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9107.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9107.jpg deleted file mode 100644 index f1da9d8..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9107.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9109-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9109-s.jpg deleted file mode 100644 index a999838..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9109-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9109.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9109.jpg deleted file mode 100644 index e3eeb3e..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9109.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9113-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9113-s.jpg deleted file mode 100644 index bf3aa59..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9113-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9113.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9113.jpg deleted file mode 100644 index 990e44b..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9113.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9115-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9115-s.jpg deleted file mode 100644 index 873beb5..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9115-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9115.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9115.jpg deleted file mode 100644 index e9f2fbb..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9115.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9117-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9117-s.jpg deleted file mode 100644 index 4119ae3..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9117-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9117.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9117.jpg deleted file mode 100644 index efa8fa8..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9117.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9118-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9118-s.jpg deleted file mode 100644 index 6ac0c46..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9118-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9118.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9118.jpg deleted file mode 100644 index 1ab033b..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9118.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9122-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9122-s.jpg deleted file mode 100644 index 4b75817..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9122-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9122.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9122.jpg deleted file mode 100644 index 0bbad05..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9122.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9123-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9123-s.jpg deleted file mode 100644 index f63f01a..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9123-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9123.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9123.jpg deleted file mode 100644 index 10f22cc..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9123.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9125-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9125-s.jpg deleted file mode 100644 index e18660f..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9125-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9125.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9125.jpg deleted file mode 100644 index e651619..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9125.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9127-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9127-s.jpg deleted file mode 100644 index 3f93502..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9127-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9127.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9127.jpg deleted file mode 100644 index d33f856..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9127.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9129-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9129-s.jpg deleted file mode 100644 index 43cd251..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9129-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9129.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9129.jpg deleted file mode 100644 index aa0820c..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9129.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9134-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9134-s.jpg deleted file mode 100644 index 8b73de1..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9134-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9134.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9134.jpg deleted file mode 100644 index 248ca28..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9134.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9138-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9138-s.jpg deleted file mode 100644 index 0c3fb87..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9138-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9138.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9138.jpg deleted file mode 100644 index ff93f90..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9138.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9142-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9142-s.jpg deleted file mode 100644 index 4571a4b..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9142-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9142.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9142.jpg deleted file mode 100644 index 647323b..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9142.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9149-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9149-s.jpg deleted file mode 100644 index e870f66..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9149-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9149.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9149.jpg deleted file mode 100644 index 23dd110..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9149.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9154-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9154-s.jpg deleted file mode 100644 index 3355eaa..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9154-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9154.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9154.jpg deleted file mode 100644 index 531ec1e..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9154.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9155-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9155-s.jpg deleted file mode 100644 index 9cd85f5..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9155-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9155.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9155.jpg deleted file mode 100644 index 72377b5..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9155.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9156-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9156-s.jpg deleted file mode 100644 index 2788d06..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9156-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9156.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9156.jpg deleted file mode 100644 index 2b836df..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9156.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9157-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9157-s.jpg deleted file mode 100644 index 9ef87c3..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9157-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9157.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9157.jpg deleted file mode 100644 index 753d1e9..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9157.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9158-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9158-s.jpg deleted file mode 100644 index 29953c4..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9158-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9158.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9158.jpg deleted file mode 100644 index a4a0247..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9158.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9159-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9159-s.jpg deleted file mode 100644 index 7caf368..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9159-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9159.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9159.jpg deleted file mode 100644 index 9f18ed6..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9159.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9162-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9162-s.jpg deleted file mode 100644 index 65bc52f..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9162-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9162.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9162.jpg deleted file mode 100644 index b0f299d..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9162.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9165-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9165-s.jpg deleted file mode 100644 index d1e9cc3..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9165-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9165.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9165.jpg deleted file mode 100644 index 862c6f8..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/CIMG9165.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/ad-jre.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/ad-jre.jpg deleted file mode 100644 index 5c7b519..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/ad-jre.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/ad-netbeans.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/ad-netbeans.jpg deleted file mode 100644 index 079b2fa..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/ad-netbeans.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/ad-sdk.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/ad-sdk.jpg deleted file mode 100644 index 2a1a88a..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/ad-sdk.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/african-spurred-tortoise-thumb.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/african-spurred-tortoise-thumb.jpg deleted file mode 100644 index 4d1ed42..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/african-spurred-tortoise-thumb.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/african-spurred-tortoise.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/african-spurred-tortoise.jpg deleted file mode 100644 index 87ea286..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/african-spurred-tortoise.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/african-spurred-tortoise2-thumb.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/african-spurred-tortoise2-thumb.jpg deleted file mode 100644 index 7b76088..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/african-spurred-tortoise2-thumb.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/african-spurred-tortoise2.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/african-spurred-tortoise2.jpg deleted file mode 100644 index 8005ff3..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/african-spurred-tortoise2.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/anthony-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/anthony-s.jpg deleted file mode 100644 index 4b21f49..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/anthony-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/anthony.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/anthony.jpg deleted file mode 100644 index 88a889c..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/anthony.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bailey-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bailey-s.jpg deleted file mode 100644 index 8adf561..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bailey-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bailey.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bailey.jpg deleted file mode 100644 index c262965..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bailey.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/banner_logo.gif b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/banner_logo.gif deleted file mode 100644 index 85de81a..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/banner_logo.gif and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bird1.gif b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bird1.gif deleted file mode 100644 index 06f1abe..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bird1.gif and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bird2.gif b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bird2.gif deleted file mode 100644 index 9601f1c..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bird2.gif and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bird3.gif b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bird3.gif deleted file mode 100644 index f48a7ec..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bird3.gif and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bird4.gif b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bird4.gif deleted file mode 100644 index eaaa3e5..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bird4.gif and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bird5.gif b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bird5.gif deleted file mode 100644 index 9f440f1..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bird5.gif and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bird6.gif b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bird6.gif deleted file mode 100644 index affd8e0..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bird6.gif and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/birds_icon.gif b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/birds_icon.gif deleted file mode 100644 index 8b14629..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/birds_icon.gif and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/biscuit-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/biscuit-s.jpg deleted file mode 100644 index 8c54af1..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/biscuit-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/biscuit.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/biscuit.jpg deleted file mode 100644 index ccdea14..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/biscuit.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bob-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bob-s.jpg deleted file mode 100644 index b3f1d09..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bob-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bob.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bob.jpg deleted file mode 100644 index d3dcfd7..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/bob.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/box-turtle-thumb.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/box-turtle-thumb.jpg deleted file mode 100644 index a4b48da..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/box-turtle-thumb.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/box-turtle.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/box-turtle.jpg deleted file mode 100644 index 5a172c5..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/box-turtle.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/box-turtle2-thumb.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/box-turtle2-thumb.jpg deleted file mode 100644 index 40303af..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/box-turtle2-thumb.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/box-turtle2.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/box-turtle2.jpg deleted file mode 100644 index 83d74d2..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/box-turtle2.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/box-turtle3-thumb.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/box-turtle3-thumb.jpg deleted file mode 100644 index 004dfe3..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/box-turtle3-thumb.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/box-turtle3.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/box-turtle3.jpg deleted file mode 100644 index 3e77142..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/box-turtle3.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/california-desert-tortoise-thumb.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/california-desert-tortoise-thumb.jpg deleted file mode 100644 index 4c260e8..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/california-desert-tortoise-thumb.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/california-desert-tortoise.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/california-desert-tortoise.jpg deleted file mode 100644 index b146396..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/california-desert-tortoise.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/carp-car-med.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/carp-car-med.jpg deleted file mode 100644 index 742336f..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/carp-car-med.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/carp-car-thumb.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/carp-car-thumb.jpg deleted file mode 100644 index e5bbc24..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/carp-car-thumb.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat1.gif b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat1.gif deleted file mode 100644 index 1fd4d1c..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat1.gif and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat10.gif b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat10.gif deleted file mode 100644 index 8bc7f6c..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat10.gif and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat11.gif b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat11.gif deleted file mode 100644 index a51bc96..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat11.gif and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat12.gif b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat12.gif deleted file mode 100644 index e594c67..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat12.gif and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat2.gif b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat2.gif deleted file mode 100644 index 6ac8718..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat2.gif and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat3.gif b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat3.gif deleted file mode 100644 index 4716f5d..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat3.gif and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat4.gif b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat4.gif deleted file mode 100644 index 0793e3f..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat4.gif and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat5.gif b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat5.gif deleted file mode 100644 index 2d289ba..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat5.gif and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat6.gif b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat6.gif deleted file mode 100644 index 2ea6132..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat6.gif and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat7.gif b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat7.gif deleted file mode 100644 index 159ba6a..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat7.gif and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat8.gif b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat8.gif deleted file mode 100644 index a9ed7c9..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat8.gif and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat9.gif b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat9.gif deleted file mode 100644 index 02faffb..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cat9.gif and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/catalog-thumb-g.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/catalog-thumb-g.jpg deleted file mode 100644 index 1a13b11..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/catalog-thumb-g.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/catalog-thumb.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/catalog-thumb.jpg deleted file mode 100644 index d6148de..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/catalog-thumb.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cats_icon.gif b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cats_icon.gif deleted file mode 100644 index db70d7d..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cats_icon.gif and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cbutton.gif b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cbutton.gif deleted file mode 100644 index 83b8761..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cbutton.gif and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/chantelle-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/chantelle-s.jpg deleted file mode 100644 index 84e4e89..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/chantelle-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/chantelle.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/chantelle.jpg deleted file mode 100644 index 5830e57..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/chantelle.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/charlie-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/charlie-s.jpg deleted file mode 100644 index bb91e94..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/charlie-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/charlie.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/charlie.jpg deleted file mode 100644 index 9e8d17d..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/charlie.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/check_all.gif b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/check_all.gif deleted file mode 100644 index 3c517f3..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/check_all.gif and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cuttlefish-med.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cuttlefish-med.jpg deleted file mode 100644 index 575a854..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cuttlefish-med.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cuttlefish-thumb.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cuttlefish-thumb.jpg deleted file mode 100644 index 9c2dc57..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/cuttlefish-thumb.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dog1.gif b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dog1.gif deleted file mode 100644 index 92e71b5..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dog1.gif and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dog2.gif b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dog2.gif deleted file mode 100644 index e581980..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dog2.gif and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dog3.gif b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dog3.gif deleted file mode 100644 index 9baa503..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dog3.gif and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dog4.gif b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dog4.gif deleted file mode 100644 index 9124427..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dog4.gif and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dog5.gif b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dog5.gif deleted file mode 100644 index 3f1690e..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dog5.gif and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dog6.gif b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dog6.gif deleted file mode 100644 index 2bf1380..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dog6.gif and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dogs_icon.gif b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dogs_icon.gif deleted file mode 100644 index b13e5b9..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dogs_icon.gif and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dragon-iron-med.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dragon-iron-med.jpg deleted file mode 100644 index ff83a16..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dragon-iron-med.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dragon-iron-thumb.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dragon-iron-thumb.jpg deleted file mode 100644 index 814dab1..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/dragon-iron-thumb.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/eagle-stone-med.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/eagle-stone-med.jpg deleted file mode 100644 index 2623f3c..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/eagle-stone-med.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/eagle-stone-thumb.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/eagle-stone-thumb.jpg deleted file mode 100644 index ccf10a2..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/eagle-stone-thumb.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/eclectus-female-med.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/eclectus-female-med.jpg deleted file mode 100644 index 7a7a59e..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/eclectus-female-med.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/eclectus-female-thumb.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/eclectus-female-thumb.jpg deleted file mode 100644 index 1f65136..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/eclectus-female-thumb.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/elkie-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/elkie-s.jpg deleted file mode 100644 index 4709e19..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/elkie-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/elkie.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/elkie.jpg deleted file mode 100644 index 76a7ff1..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/elkie.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/faith-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/faith-s.jpg deleted file mode 100644 index 13194bd..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/faith-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/faith.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/faith.jpg deleted file mode 100644 index cd8ad6e..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/faith.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/fish2.gif b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/fish2.gif deleted file mode 100644 index 4d9916c..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/fish2.gif and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/fish3.gif b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/fish3.gif deleted file mode 100644 index 258489d..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/fish3.gif and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/fish4.gif b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/fish4.gif deleted file mode 100644 index d3e39e1..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/fish4.gif and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/fish_icon.gif b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/fish_icon.gif deleted file mode 100644 index 730c813..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/fish_icon.gif and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/florida-king-snake-thumb.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/florida-king-snake-thumb.jpg deleted file mode 100644 index cbe5030..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/florida-king-snake-thumb.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/florida-king-snake.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/florida-king-snake.jpg deleted file mode 100644 index 11954df..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/florida-king-snake.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/frog1.gif b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/frog1.gif deleted file mode 100644 index 4bf637f..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/frog1.gif and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/gaetano-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/gaetano-s.jpg deleted file mode 100644 index 097b144..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/gaetano-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/gaetano.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/gaetano.jpg deleted file mode 100644 index ec5d64b..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/gaetano.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/galah-parrot-med.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/galah-parrot-med.jpg deleted file mode 100644 index 31bb43c..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/galah-parrot-med.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/galah-parrot-thumb.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/galah-parrot-thumb.jpg deleted file mode 100644 index 70cdc2a..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/galah-parrot-thumb.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/glassfish-colored-med.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/glassfish-colored-med.jpg deleted file mode 100644 index a6646c7..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/glassfish-colored-med.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/glassfish-colored-thumb.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/glassfish-colored-thumb.jpg deleted file mode 100644 index 262659a..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/glassfish-colored-thumb.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/guinea-pig-thumb.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/guinea-pig-thumb.jpg deleted file mode 100644 index ea0c069..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/guinea-pig-thumb.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/guinea-pig.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/guinea-pig.jpg deleted file mode 100644 index 828bba2..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/guinea-pig.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/harmony-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/harmony-s.jpg deleted file mode 100644 index 5b28bd0..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/harmony-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/harmony.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/harmony.jpg deleted file mode 100644 index 3c4d322..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/harmony.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/harrison-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/harrison-s.jpg deleted file mode 100644 index c7c1486..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/harrison-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/harrison.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/harrison.jpg deleted file mode 100644 index 6003c8c..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/harrison.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/hawaiian-lizard-med.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/hawaiian-lizard-med.jpg deleted file mode 100644 index a538759..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/hawaiian-lizard-med.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/hawaiian-lizard-thumb.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/hawaiian-lizard-thumb.jpg deleted file mode 100644 index 2369c90..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/hawaiian-lizard-thumb.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/honey-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/honey-s.jpg deleted file mode 100644 index 13c3f9b..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/honey-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/honey.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/honey.jpg deleted file mode 100644 index 61d877b..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/honey.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/hunter-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/hunter-s.jpg deleted file mode 100644 index 4303498..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/hunter-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/hunter.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/hunter.jpg deleted file mode 100644 index 37ebbe9..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/hunter.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/index-thumb-g.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/index-thumb-g.jpg deleted file mode 100644 index a42ddb4..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/index-thumb-g.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/index-thumb.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/index-thumb.jpg deleted file mode 100644 index 571475a..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/index-thumb.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/indicator-black.gif b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/indicator-black.gif deleted file mode 100644 index 6da716a..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/indicator-black.gif and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/ja_flag.gif b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/ja_flag.gif deleted file mode 100644 index 31d0ada..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/ja_flag.gif and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/jack-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/jack-s.jpg deleted file mode 100644 index d4144da..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/jack-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/jack.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/jack.jpg deleted file mode 100644 index fe37700..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/jack.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/katzen-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/katzen-s.jpg deleted file mode 100644 index d83d3f9..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/katzen-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/katzen.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/katzen.jpg deleted file mode 100644 index ba460be..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/katzen.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/koi-med.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/koi-med.jpg deleted file mode 100644 index 7afa021..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/koi-med.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/koi-thumb.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/koi-thumb.jpg deleted file mode 100644 index f7fa2b2..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/koi-thumb.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/kookaburra-med.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/kookaburra-med.jpg deleted file mode 100644 index 8c06c3d..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/kookaburra-med.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/kookaburra-thumb.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/kookaburra-thumb.jpg deleted file mode 100644 index 84e82f5..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/kookaburra-thumb.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/lady-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/lady-s.jpg deleted file mode 100644 index 72a724f..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/lady-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/lady.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/lady.jpg deleted file mode 100644 index ae9054e..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/lady.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/left.gif b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/left.gif deleted file mode 100644 index 46b3630..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/left.gif and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/left_2.gif b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/left_2.gif deleted file mode 100644 index f50cbed..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/left_2.gif and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/leopard-gecko-thumb.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/leopard-gecko-thumb.jpg deleted file mode 100644 index 620c826..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/leopard-gecko-thumb.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/leopard-gecko-thumb2.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/leopard-gecko-thumb2.jpg deleted file mode 100644 index 2a52e80..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/leopard-gecko-thumb2.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/leopard-gecko.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/leopard-gecko.jpg deleted file mode 100644 index 7b77428..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/leopard-gecko.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/leopard-gecko2.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/leopard-gecko2.jpg deleted file mode 100644 index b3748ae..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/leopard-gecko2.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/lizard1.gif b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/lizard1.gif deleted file mode 100644 index 665c4d6..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/lizard1.gif and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/lizard2.gif b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/lizard2.gif deleted file mode 100644 index 2e59d89..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/lizard2.gif and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/lizard3.gif b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/lizard3.gif deleted file mode 100644 index 6dca58f..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/lizard3.gif and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/lovebird-med.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/lovebird-med.jpg deleted file mode 100644 index cef3163..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/lovebird-med.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/lovebird-thumb.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/lovebird-thumb.jpg deleted file mode 100644 index 7e97d51..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/lovebird-thumb.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/macaw-thumb.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/macaw-thumb.jpg deleted file mode 100644 index a95ff80..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/macaw-thumb.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/macaw.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/macaw.jpg deleted file mode 100644 index b7ae026..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/macaw.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/maggie-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/maggie-s.jpg deleted file mode 100644 index 7acf48e..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/maggie-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/maggie.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/maggie.jpg deleted file mode 100644 index 140a325..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/maggie.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/marianna-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/marianna-s.jpg deleted file mode 100644 index 4b96d8d..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/marianna-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/marianna.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/marianna.jpg deleted file mode 100644 index 5e3b381..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/marianna.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/mario-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/mario-s.jpg deleted file mode 100644 index f2f1848..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/mario-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/mario.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/mario.jpg deleted file mode 100644 index a68cd9e..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/mario.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/maximize.gif b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/maximize.gif deleted file mode 100644 index da05f30..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/maximize.gif and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/mexican-redkneed-tarantula-thumb.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/mexican-redkneed-tarantula-thumb.jpg deleted file mode 100644 index 35387ca..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/mexican-redkneed-tarantula-thumb.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/mexican-redkneed-tarantula.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/mexican-redkneed-tarantula.jpg deleted file mode 100644 index 7365af9..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/mexican-redkneed-tarantula.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/mimi-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/mimi-s.jpg deleted file mode 100644 index 0e6a1a5..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/mimi-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/mimi.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/mimi.jpg deleted file mode 100644 index 950c84e..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/mimi.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/minimize.gif b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/minimize.gif deleted file mode 100644 index 8408264..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/minimize.gif and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/monique-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/monique-s.jpg deleted file mode 100644 index dea6b6d..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/monique-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/monique.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/monique.jpg deleted file mode 100644 index 0f0ac10..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/monique.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/moon-jelly-med.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/moon-jelly-med.jpg deleted file mode 100644 index 3c7618a..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/moon-jelly-med.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/moon-jelly-thumb.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/moon-jelly-thumb.jpg deleted file mode 100644 index e765076..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/moon-jelly-thumb.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/octopus-red-med.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/octopus-red-med.jpg deleted file mode 100644 index 7c7d897..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/octopus-red-med.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/octopus-red-thumb.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/octopus-red-thumb.jpg deleted file mode 100644 index 4cdb8bb..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/octopus-red-thumb.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/octopus-white-med.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/octopus-white-med.jpg deleted file mode 100644 index f38af83..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/octopus-white-med.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/octopus-white-thumb.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/octopus-white-thumb.jpg deleted file mode 100644 index bec9ee6..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/octopus-white-thumb.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/olie-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/olie-s.jpg deleted file mode 100644 index 9bb9a17..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/olie-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/olie.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/olie.jpg deleted file mode 100644 index c91be8e..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/olie.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/paris-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/paris-s.jpg deleted file mode 100644 index f4ce9ec..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/paris-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/paris.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/paris.jpg deleted file mode 100644 index b599c76..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/paris.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/parrot-popcorn-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/parrot-popcorn-s.jpg deleted file mode 100644 index cae1408..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/parrot-popcorn-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/parrot-popcorn.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/parrot-popcorn.jpg deleted file mode 100644 index 57e02ff..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/parrot-popcorn.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/peacock-blue-med.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/peacock-blue-med.jpg deleted file mode 100644 index 758ed35..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/peacock-blue-med.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/peacock-blue-thumb.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/peacock-blue-thumb.jpg deleted file mode 100644 index 3aec8c4..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/peacock-blue-thumb.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/peacock-med.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/peacock-med.jpg deleted file mode 100644 index 13164b8..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/peacock-med.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/peacock-thumb.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/peacock-thumb.jpg deleted file mode 100644 index fbd5412..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/peacock-thumb.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/peacock-white-thumb.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/peacock-white-thumb.jpg deleted file mode 100644 index 148006d..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/peacock-white-thumb.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/peakcock-white-med.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/peakcock-white-med.jpg deleted file mode 100644 index f25a814..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/peakcock-white-med.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/prehensile-tailed-skink-thumb.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/prehensile-tailed-skink-thumb.jpg deleted file mode 100644 index 2d9c2b1..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/prehensile-tailed-skink-thumb.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/prehensile-tailed-skink.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/prehensile-tailed-skink.jpg deleted file mode 100644 index 3573943..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/prehensile-tailed-skink.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/prehensile-tailed-skink2-thumb.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/prehensile-tailed-skink2-thumb.jpg deleted file mode 100644 index 9be6e41..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/prehensile-tailed-skink2-thumb.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/prehensile-tailed-skink2.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/prehensile-tailed-skink2.jpg deleted file mode 100644 index 0559845..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/prehensile-tailed-skink2.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/princess-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/princess-s.jpg deleted file mode 100644 index d4521a3..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/princess-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/princess.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/princess.jpg deleted file mode 100644 index 370e4fd..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/princess.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/puppup-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/puppup-s.jpg deleted file mode 100644 index 5b89061..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/puppup-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/puppup.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/puppup.jpg deleted file mode 100644 index efff187..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/puppup.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/purple-jellyfish-med.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/purple-jellyfish-med.jpg deleted file mode 100644 index 93af55f..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/purple-jellyfish-med.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/purple-jellyfish-thumb.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/purple-jellyfish-thumb.jpg deleted file mode 100644 index d751856..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/purple-jellyfish-thumb.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/rainbow-lorikeet-med.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/rainbow-lorikeet-med.jpg deleted file mode 100644 index 9c72270..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/rainbow-lorikeet-med.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/rainbow-lorikeet-thumb.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/rainbow-lorikeet-thumb.jpg deleted file mode 100644 index 9003e0c..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/rainbow-lorikeet-thumb.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/reptiles_icon.gif b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/reptiles_icon.gif deleted file mode 100644 index 0ee4c52..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/reptiles_icon.gif and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/right.gif b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/right.gif deleted file mode 100644 index 89e7ba1..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/right.gif and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/rita-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/rita-s.jpg deleted file mode 100644 index 16d1692..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/rita-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/rita.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/rita.jpg deleted file mode 100644 index f183f1c..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/rita.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/rockfish-med.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/rockfish-med.jpg deleted file mode 100644 index 005d708..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/rockfish-med.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/rockfish-thumb.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/rockfish-thumb.jpg deleted file mode 100644 index e82c87d..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/rockfish-thumb.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/sabrina-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/sabrina-s.jpg deleted file mode 100644 index 508edb1..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/sabrina-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/sabrina.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/sabrina.jpg deleted file mode 100644 index 870c2f3..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/sabrina.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/sea-anemone-med.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/sea-anemone-med.jpg deleted file mode 100644 index a18e30a..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/sea-anemone-med.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/sea-anemone-thumb.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/sea-anemone-thumb.jpg deleted file mode 100644 index febadd3..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/sea-anemone-thumb.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/sea-nettle-jellyfish-med.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/sea-nettle-jellyfish-med.jpg deleted file mode 100644 index c7329f4..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/sea-nettle-jellyfish-med.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/sea-nettle-jellyfish-thumb.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/sea-nettle-jellyfish-thumb.jpg deleted file mode 100644 index 3753577..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/sea-nettle-jellyfish-thumb.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/seller-thumb-g.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/seller-thumb-g.jpg deleted file mode 100644 index a9c45e8..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/seller-thumb-g.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/seller-thumb.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/seller-thumb.jpg deleted file mode 100644 index 2b7adf1..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/seller-thumb.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/simba-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/simba-s.jpg deleted file mode 100644 index 93e78ee..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/simba-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/simba.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/simba.jpg deleted file mode 100644 index cdbb5fb..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/simba.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/splash.gif b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/splash.gif deleted file mode 100644 index cdae47c..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/splash.gif and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/spotted-jellyfish-med.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/spotted-jellyfish-med.jpg deleted file mode 100644 index 6c1e407..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/spotted-jellyfish-med.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/spotted-jellyfish-thumb.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/spotted-jellyfish-thumb.jpg deleted file mode 100644 index 991392d..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/spotted-jellyfish-thumb.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/thaicat-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/thaicat-s.jpg deleted file mode 100644 index 49898fb..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/thaicat-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/thaicat.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/thaicat.jpg deleted file mode 100644 index eb43a52..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/thaicat.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/thaidog-s.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/thaidog-s.jpg deleted file mode 100644 index c918e36..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/thaidog-s.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/thaidog.jpg b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/thaidog.jpg deleted file mode 100644 index f5063e3..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/thaidog.jpg and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/uncheck_all.gif b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/uncheck_all.gif deleted file mode 100644 index 39fa7ba..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/uncheck_all.gif and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/us_flag.gif b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/us_flag.gif deleted file mode 100644 index 52bc595..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/us_flag.gif and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/zh_flag.gif b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/zh_flag.gif deleted file mode 100644 index 0393bc1..0000000 Binary files a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/images/zh_flag.gif and /dev/null differ diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/index-ajax.jsp b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/index-ajax.jsp deleted file mode 100644 index 9ce0b8d..0000000 --- a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/index-ajax.jsp +++ /dev/null @@ -1,239 +0,0 @@ -<%-- Copyright 2006 Sun Microsystems, Inc. All rights reserved. You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at: http://developer.sun.com/berkeley_license.html -$Id: index.jsp,v 1.17 2007/03/15 23:19:46 basler Exp $ --%> -<%@page contentType="text/html"%> -<%@page pageEncoding="UTF-8"%> -<%@page import="java.util.*, com.sun.javaee.blueprints.petstore.model.CatalogFacade, com.sun.javaee.blueprints.petstore.model.Tag"%> - -<% -try { - CatalogFacade cf = (CatalogFacade)config.getServletContext().getAttribute("CatalogFacade"); - List<Tag> tags=cf.getTagsInChunk(0, 12); - // since top 20 come from database or desending refCount order, need to reorder by tag name - Collections.sort(tags, new Comparator() { - public int compare(Object one, Object two) { - int cc=((Tag)two).getTag().compareTo(((Tag)one).getTag()); - return (cc < 0 ? 1 : cc > 0 ? -1 : 0); - } - }); -%> - -<html> - <head> - <meta http-equiv="Content-Type" content="text/html;charset=utf-8" > - <title>Java Pet Store Reference Application</title> - <script type="text/javascript" src="./common.js"></script> - <link type="text/css" rel="stylesheet" href="./tag.css"/> - <script type="text/javascript"> - //var djConfig = {isDebug: true }; - </script> - </head> - <body> - - <jsp:include page="banner.jsp" /> - <script> - dojo.require("dojo.widget.FisheyeList"); - dojo.require("dojo.io.*"); - dojo.require("dojo.io.ScriptSrcIO"); - //transport: "ScriptSrcTransport", - //url: "http://localhost:8080/petstore/downloadAd.json", - - function browse(category) { - window.location.href="${pageContext.request.contextPath}/faces/catalog.jsp?catid=" + category; - - } - - - function debugProperties(namex) { - var listx=""; - var ob=namex; - for(xx in ob) { - listx += xx + " = " + ob[xx] + "<br/>" - } - //document.write(listx); - alert(listx); - } - - function checkAdPage() { - var bindArgs = { - //url: "https://blueprints.dev.java.net/petstore/downloadAd.json", - //url: "http://localhost:8080/petstore/downloadAd.json", - url: "http://search.yahooapis.com/ImageSearchService/V1/imageSearch?appid=YahooDem...", - transport: "ScriptSrcTransport", - jsonParamName: "callback", - mimetype: "text/json", - load: function(type, data, event, kwArgs) { - /* type will be "load", data will be response data, event will null, and kwArgs are the keyword arguments used in the dojo.io.bind call. */ - alert("load = " + data.ResultSet.totalResultsAvailable); - //debugProperties(data); - //document.getElementById("downloadAds").innerHTML=data.downloadxx; - - - }, - error: function(type, data, event, kwArgs) { - /* type will be "error", data will be response data, event will null, and kwArgs are the keyword arguments used in the dojo.io.bind call. */ - alert("error"); - }, - timeout: function() { - /* Called if there is a timeout */ - alert("timeout"); - }, - timeoutSeconds: 10}; - // dispatch the request - dojo.io.bind(bindArgs); - } - - function callback() { - alert("callback"); - } - - function returnFunctionx(type, data, evt) { - // statically setup popup for simple case - // check return of the dojo call to make sure it is valid - if (evt.readyState == 4) { - if (evt.status == 200) { - alert("data = " + data.downloadxx); - //document.getElementById("downloadAds").innerHTML=data; - document.getElementById("downloadAds").innerHTML=data.downloadxx; - } - } - } - - function testit() { - testx={download:"test", textx:"it"}; - alert("test = " + testx.download); - } - - - </script> - <span onclick="checkAdPage();">test it</span> - - - <table bgcolor="white"> - <tr> - <td valign="top"> - <div class="outerbar" style="width: 200px"> - - <div dojoType="FisheyeList" - itemWidth="170" itemHeight="50" - itemMaxWidth="340" itemMaxHeight="100" - orientation="vertical" - effectUnits="2" - itemPadding="10" - attachEdge="top" - labelEdge="bottom" - enableCrappySvgSupport="false"> - - <div dojoType="FisheyeListItem" onClick="browse('Dogs');" - iconsrc="${pageContext.request.contextPath}/images/dogs_icon.gif"> - </div> - - <div dojoType="FisheyeListItem" onClick="browse('Cats');" - iconsrc="${pageContext.request.contextPath}/images/cats_icon.gif"> - </div> - - <div dojoType="FisheyeListItem" onClick="browse('Birds');" - iconsrc="${pageContext.request.contextPath}/images/birds_icon.gif"> - </div> - - <div dojoType="FisheyeListItem" onClick="browse('Fish');" - iconsrc="${pageContext.request.contextPath}/images/fish_icon.gif"> - </div> - - <div dojoType="FisheyeListItem" onClick="browse('Reptiles');" - iconsrc="${pageContext.request.contextPath}/images/reptiles_icon.gif"> - </div> - </div> - - </div> - </td> - <td valign="top" style="width: 400px"> - <div id="bodyCenter"> - <table valign="top" id="bodyTable" border="0"> - <tr> - <td> - <map name="petmap"> - <area onmouseover="javascript:this.style.cursor='pointer';" onclick="browse('Birds')" - alt="Birds" - coords="72,2,280,250"> - <area onmouseover="javascript:this.style.cursor='pointer';" onclick="browse('Fish')" - alt="Fish" - coords="2,180,72,250"> - <area onmouseover="javascript:this.style.cursor='pointer';" onclick="browse('Dogs')" - alt="Dogs" - coords="60,250,130,320"> - <area onmouseover="javascript:this.style.cursor='pointer';" onclick="browse('Reptiles')" - alt="Reptiles" - coords="140,270,210,340"> - <area onmouseover="javascript:this.style.cursor='pointer';" onclick="browse('Cats')" - alt="Cats" - coords="225,240,295,310"> - <area onmouseover="javascript:this.style.cursor='pointer';" onclick="browse('Birds')" - alt="Birds" - coords="280,180,350,250"> - </map> - - <img src="${pageContext.request.contextPath}/images/splash.gif" - alt="Pet Selection Map" - usemap="#petmap" - width="350" - height="355" - border="0"> - </td> - </tr> - </table> - - </div> - </td> - <td style="vertical-align:top;"> - <div style="border-style: double; width:100%;"> - <table border="0"> - <tr> - <th colspan="2" style="text-align:center">Most Popular Tags</th> - </tr> - <tr> -<% - String style=null; - int refx=0, ii=0; - for(Tag tag : tags) { - refx=tag.getRefCount() / 5; - if(refx >= 3) { - style="xxlarge"; - } else if(refx == 2) { - style="xlarge"; - } else if(refx == 1) { - style="large"; - } else { - style="medium"; - } - - if((ii % 2) == 0) out.println("</tr>\n<tr>"); - out.println("<td class='tagCell' style='text-align: center'><a href='./tag.jsp?tag=" + - tag.getTag() + "'><span class='" + style +"'>" + tag.getTag() + "</span></a></td>"); - ii++; - } -%> - </tr> - </table> - </div> - </td> - <td valign="top" style="vertical-align:top; width:250px;"> - <div id="downloadAds"> - <jsp:include page="download.jsp" /> - </div> - </td> - </tr> - </table> - - <div style="position: absolute; visibility: hidden;z-index:5" id="menu-popup"> - <table id="completeTable" class="popupTable" ></table> - </div> - - <br/><br/> - <jsp:include page="footer.jsp" /> - </body> -</html> -<% - } catch(Exception e) { - e.printStackTrace(); - } -%> diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/index.html b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/index.html deleted file mode 100644 index 8c5ca1b..0000000 --- a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/index.html +++ /dev/null @@ -1,117 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> -<html> -<head> - <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> - <title>Java Pet Store Reference Application, 2.0 Early Access</title> -</head> -<body> -<hr> -<h1>Java Pet Store Reference Application, 2.0 Early Access</h1> -<h2><a href="./faces/index.jsp">Enter the Store</a></h2> -The Java Pet Store Reference Application is a sample application -brought to -you by the <a href="http://blueprints.dev.java.net/">Java BluePrints</a> -program at <a href="http://sun.com">Sun Microsystems</a>. -This application is designed to illustrate how the Java EE 5 Platform -can be used to develop an AJAX-enabled Web 2.0 application. The -application comes with full source-code available under a -BSD-style license, so you can experiment with it and use it in your own -applications. <br> -<br> -<a href="#try">Try the Petstore Demo</a><br> -<a href="#learn">Learn more about features in Java Petstore</a><br> -<a href="#contributors">Show appreciation for Pet Store image -contributors</a><br> -<a href="#about">About BluePrints</a> -<h2><a name="try"></a>Try the Pet Store Demo</h2> -Now that you have the application deployed, you can use it and try out -the features. You can browse the catalog of pets for sale, sell your -own pets on the store, search for pets by location using Google maps, -view the RSS news bar for BluePrints news, and more.<a - href="./faces/index.jsp">Enter the Store</a> -<h2><a name="features"></a>Learn More About Features in Java Petstore</h2> -<p>Here are some of the features of this application. For a detailed -description of the features in the Java Pet -Store Reference application, please refer to the article at <a - href="http://java.sun.com/developer/technicalArticles/J2EE/petstore/%22%3Ehttp://j...</a><a - href="http://java.sun.com/developer/technicalArticles/J2EE/petstore/%22%3E</a><b> -</b></p> -<ol> - <li>Using AJAX for single-page interactive Web applications: The -application is designed to be a single-page application where the user -never leaves the page. Different sections of the page are dynamically -loaded based on the user actions. These sections are loaded -asynchronously to avoid any browser refreshes, and to give a richer -interactive user-experience. </li> - <li>Mash-ups with Google maps: The petstore uses a mashup with -Google's Map service, alongwith Yahoo's Geo-coder service to allow -users to see the available pets in a neighborhood. </li> - <li>Community-created content: The application allows a user to add a -pet for sale or adoption on the Website. The seller uploads </li> - <ol> - <li>Using Captchas to discourage spam in the community created -content: Whenever a website allows its users to add content, it needs -to build mechanisms to discourage placement of spurious content on its -Website through automated mechanisms. We demonstrate how captchas can -be used for this purpose. </li> - <li>Community rated content: Each item in the petstore website can -be rated by the users </li> - <li>Payments through PayPal: The application provides a meeting -ground for -buyers and sellers of pets. The application uses the PayPal service to -allow sellers to accept payments.</li> - </ol> - <li>Integration of an RSS feed: The website integrates an RSS feed of -news items coming out the Java BluePrints website. The </li> - <li>Integration of a search engine: The application integrates -Apache Lucene search engine to handle all website searches. </li> -</ol> -This application also demonstrate the use of various features of -the Java EE 5 platform such as: <br> -<ol> - <li>JavaServer Faces: Many of the AJAX features are implemented as -reusable JavaServer Faces components. </li> - <li>Java Persistence API: The application uses Java Persistence APIs -to create an object/relational mapping layer. </li> - <li>Dependency Injection: The application uses dependency injection -instead of deployment descriptors.</li> -</ol> -See the <a - href="https://blueprints.dev.java.net/petstore/architecture.html%22%3EPet -Store Architecure document</a> for more detail. -<h2><a name="contributors"></a>Show Appreciation for Pet Store Image -Contributors</h2> -<p>For many images in the Java Petstore, some organizations and people -were kind enough to give us permission to photograph their animals or -even give us photos to use in the Java Petstore. See the <a - href="https://blueprints.dev.java.net/petstore/imagecontributors.html%22%3E -image contributors </a> page for a more detail on these friends of the -animals. -</p> -<h2><a name="about"></a>About Java BluePrints</h2> -<p>The Java BluePrints program defines the application programming -model for the Java EE™ platform. It provides best practice guidelines -and -architectural recommendations for real-world application scenarios to -enable developers to build portable, scalable, and robust applications -using the Java EE technologies.<br> -<br> -Some other popular projects from Java BluePrints are <a - href="http://blueprints.dev.java.net/bpcatalog/%22%3EJava BluePrints -Solutions Catalog</a>, <a target="_blank" - href="https://blueprints.dev.java.net/adventurebuilder/%22%3EJava -Adventure Builder Reference</a> application, <a target="_blank" - href="http://java.sun.com/blueprints/guidelines/designing_webservices/%22%3EDesign... -Web Services with the J2EE(TM) 1.4 Platform : JAX-RPC, SOAP, and XML -Technologies</a> book, and the <a target="_blank" - href="http://java.sun.com/blueprints/guidelines/designing_enterprise_applications_...<span - class="body"><span class="title">Designing -Enterprise Applications with the J2EE Platform, Second Edition</span></span></a> -book. You can access these projects and other content from Java -BluePrints by visiting the <a target="_blank" - href="http://java.sun.com/reference/blueprints/index.html%22%3EJava -BluePrints website</a>. </p> -<hr noshade="noshade">Copyright © 2007 Sun Microsystems, -Inc. All Rights Reserved. -</body> -</html> diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/index.jsp b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/index.jsp deleted file mode 100644 index ab59139..0000000 --- a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/index.jsp +++ /dev/null @@ -1,164 +0,0 @@ -<%-- Copyright 2006 Sun Microsystems, Inc. All rights reserved. You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at: http://developer.sun.com/berkeley_license.html -$Id: index.jsp,v 1.20 2007/03/16 20:18:59 basler Exp $ --%> -<%@page contentType="text/html"%> -<%@page pageEncoding="UTF-8"%> -<%@page import="java.util.*, com.sun.javaee.blueprints.petstore.model.CatalogFacade, com.sun.javaee.blueprints.petstore.model.Tag"%> - -<% -try { - CatalogFacade cf = (CatalogFacade)config.getServletContext().getAttribute("CatalogFacade"); - List<Tag> tags=cf.getTagsInChunk(0, 12); - // since top 20 come from database or desending refCount order, need to reorder by tag name - Collections.sort(tags, new Comparator() { - public int compare(Object one, Object two) { - int cc=((Tag)two).getTag().compareTo(((Tag)one).getTag()); - return (cc < 0 ? 1 : cc > 0 ? -1 : 0); - } - }); -%> - -<html> - <head> - <meta http-equiv="Content-Type" content="text/html;charset=utf-8" > - <title>Java Pet Store Reference Application</title> - <link type="text/css" rel="stylesheet" href="./tag.css"/> - </head> - <body> - - <jsp:include page="banner.jsp" /> - <script> - dojo.require("dojo.widget.FisheyeList"); - function browse(category) { - window.location.href="${pageContext.request.contextPath}/faces/catalog.jsp?catid=" + category; - } - </script> - <table bgcolor="white"> - <tr> - <td valign="top"> - <div class="outerbar" style="width: 200px"> - - <div dojoType="FisheyeList" - itemWidth="170" itemHeight="50" - itemMaxWidth="340" itemMaxHeight="100" - orientation="vertical" - effectUnits="2" - itemPadding="10" - attachEdge="top" - labelEdge="bottom" - enableCrappySvgSupport="false"> - - <div dojoType="FisheyeListItem" onClick="browse('Dogs');" - iconsrc="${pageContext.request.contextPath}/images/dogs_icon.gif"> - </div> - - <div dojoType="FisheyeListItem" onClick="browse('Cats');" - iconsrc="${pageContext.request.contextPath}/images/cats_icon.gif"> - </div> - - <div dojoType="FisheyeListItem" onClick="browse('Birds');" - iconsrc="${pageContext.request.contextPath}/images/birds_icon.gif"> - </div> - - <div dojoType="FisheyeListItem" onClick="browse('Fish');" - iconsrc="${pageContext.request.contextPath}/images/fish_icon.gif"> - </div> - - <div dojoType="FisheyeListItem" onClick="browse('Reptiles');" - iconsrc="${pageContext.request.contextPath}/images/reptiles_icon.gif"> - </div> - </div> - - </div> - </td> - <td valign="top" style="width: 400px"> - <div id="bodyCenter"> - <table valign="top" id="bodyTable" border="0"> - <tr> - <td> - <map name="petmap"> - <area onmouseover="javascript:this.style.cursor='pointer';" onclick="browse('Birds')" - alt="Birds" - coords="72,2,280,250"> - <area onmouseover="javascript:this.style.cursor='pointer';" onclick="browse('Fish')" - alt="Fish" - coords="2,180,72,250"> - <area onmouseover="javascript:this.style.cursor='pointer';" onclick="browse('Dogs')" - alt="Dogs" - coords="60,250,130,320"> - <area onmouseover="javascript:this.style.cursor='pointer';" onclick="browse('Reptiles')" - alt="Reptiles" - coords="140,270,210,340"> - <area onmouseover="javascript:this.style.cursor='pointer';" onclick="browse('Cats')" - alt="Cats" - coords="225,240,295,310"> - <area onmouseover="javascript:this.style.cursor='pointer';" onclick="browse('Birds')" - alt="Birds" - coords="280,180,350,250"> - </map> - - <img src="${pageContext.request.contextPath}/images/splash.gif" - alt="Pet Selection Map" - usemap="#petmap" - width="350" - height="355" - border="0"> - </td> - </tr> - </table> - - </div> - </td> - <td style="vertical-align:top;"> - <div style="border-style: double; width:100%;"> - <table border="0"> - <tr> - <th colspan="2" style="text-align:center">Most Popular Tags</th> - </tr> - <tr> -<% - String style=null; - int refx=0, ii=0; - for(Tag tag : tags) { - refx=tag.getRefCount() / 5; - if(refx >= 3) { - style="xxlarge"; - } else if(refx == 2) { - style="xlarge"; - } else if(refx == 1) { - style="large"; - } else { - style="medium"; - } - - if((ii % 2) == 0) out.println("</tr>\n<tr>"); - out.println("<td class='tagCell' style='text-align: center'><a href='./tag.jsp?tag=" + - tag.getTag() + "'><span class='" + style +"'>" + tag.getTag() + "</span></a></td>"); - ii++; - } -%> - </tr> - </table> - </div> - </td> - <td style="vertical-align:top; width:300px; text-align:right;"> - <div id="downloadAds"> - <jsp:include page="download.jsp" /> - </div> - </td> - </tr> - </table> - - <div style="position: absolute; visibility: hidden;z-index:5" id="menu-popup"> - <table id="completeTable" class="popupTable" ></table> - </div> - - <br/><br/> - <jsp:include page="footer.jsp" /> - - </body> -</html> -<% - } catch(Exception e) { - e.printStackTrace(); - } -%> diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/index_a.jsp b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/index_a.jsp deleted file mode 100644 index 54f30ce..0000000 --- a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/index_a.jsp +++ /dev/null @@ -1,194 +0,0 @@ -<%-- Copyright 2006 Sun Microsystems, Inc. All rights reserved. You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at: http://developer.sun.com/berkeley_license.html -$Id: index.jsp,v 1.18 2007/03/16 15:29:15 basler Exp $ --%> -<%@page contentType="text/html"%> -<%@page pageEncoding="UTF-8"%> -<%@page import="java.util.*, com.sun.javaee.blueprints.petstore.model.CatalogFacade, com.sun.javaee.blueprints.petstore.model.Tag"%> - -<% -try { - CatalogFacade cf = (CatalogFacade)config.getServletContext().getAttribute("CatalogFacade"); - List<Tag> tags=cf.getTagsInChunk(0, 12); - // since top 20 come from database or desending refCount order, need to reorder by tag name - Collections.sort(tags, new Comparator() { - public int compare(Object one, Object two) { - int cc=((Tag)two).getTag().compareTo(((Tag)one).getTag()); - return (cc < 0 ? 1 : cc > 0 ? -1 : 0); - } - }); -%> - -<html> - <head> - <meta http-equiv="Content-Type" content="text/html;charset=utf-8" > - <title>Java Pet Store Reference Application</title> - <link type="text/css" rel="stylesheet" href="./tag.css"/> - <script type="text/javascript" src="https://blueprints.dev.java.net/petstore/downloadAd.js"></script> - </head> - <body onload="alterDownloadAd()"> - - <jsp:include page="banner.jsp" /> - <script> - dojo.require("dojo.widget.FisheyeList"); - function browse(category) { - window.location.href="${pageContext.request.contextPath}/faces/catalog.jsp?catid=" + category; - } - - function alterDownloadAd() { - if(typeof checkAdPage != "undefined") { - var textx=checkAdPage(); - if(typeof textx != "undefined") { - document.getElementById("downloadAds").innerHTML=textx; - } - } - } - - - </script> - <table bgcolor="white"> - <tr> - <td valign="top"> - <div class="outerbar" style="width: 200px"> - - <div dojoType="FisheyeList" - itemWidth="170" itemHeight="50" - itemMaxWidth="340" itemMaxHeight="100" - orientation="vertical" - effectUnits="2" - itemPadding="10" - attachEdge="top" - labelEdge="bottom" - enableCrappySvgSupport="false"> - - <div dojoType="FisheyeListItem" onClick="browse('Dogs');" - iconsrc="${pageContext.request.contextPath}/images/dogs_icon.gif"> - </div> - - <div dojoType="FisheyeListItem" onClick="browse('Cats');" - iconsrc="${pageContext.request.contextPath}/images/cats_icon.gif"> - </div> - - <div dojoType="FisheyeListItem" onClick="browse('Birds');" - iconsrc="${pageContext.request.contextPath}/images/birds_icon.gif"> - </div> - - <div dojoType="FisheyeListItem" onClick="browse('Fish');" - iconsrc="${pageContext.request.contextPath}/images/fish_icon.gif"> - </div> - - <div dojoType="FisheyeListItem" onClick="browse('Reptiles');" - iconsrc="${pageContext.request.contextPath}/images/reptiles_icon.gif"> - </div> - </div> - - </div> - </td> - <td valign="top" style="width: 400px"> - <div id="bodyCenter"> - <table valign="top" id="bodyTable" border="0"> - <tr> - <td> - <map name="petmap"> - <area onmouseover="javascript:this.style.cursor='pointer';" onclick="browse('Birds')" - alt="Birds" - coords="72,2,280,250"> - <area onmouseover="javascript:this.style.cursor='pointer';" onclick="browse('Fish')" - alt="Fish" - coords="2,180,72,250"> - <area onmouseover="javascript:this.style.cursor='pointer';" onclick="browse('Dogs')" - alt="Dogs" - coords="60,250,130,320"> - <area onmouseover="javascript:this.style.cursor='pointer';" onclick="browse('Reptiles')" - alt="Reptiles" - coords="140,270,210,340"> - <area onmouseover="javascript:this.style.cursor='pointer';" onclick="browse('Cats')" - alt="Cats" - coords="225,240,295,310"> - <area onmouseover="javascript:this.style.cursor='pointer';" onclick="browse('Birds')" - alt="Birds" - coords="280,180,350,250"> - </map> - - <img src="${pageContext.request.contextPath}/images/splash.gif" - alt="Pet Selection Map" - usemap="#petmap" - width="350" - height="355" - border="0"> - </td> - </tr> - </table> - - </div> - </td> - <td style="vertical-align:top;"> - <div style="border-style: double; width:100%;"> - <table border="0"> - <tr> - <th colspan="2" style="text-align:center">Most Popular Tags</th> - </tr> - <tr> -<% - String style=null; - int refx=0, ii=0; - for(Tag tag : tags) { - refx=tag.getRefCount() / 5; - if(refx >= 3) { - style="xxlarge"; - } else if(refx == 2) { - style="xlarge"; - } else if(refx == 1) { - style="large"; - } else { - style="medium"; - } - - if((ii % 2) == 0) out.println("</tr>\n<tr>"); - out.println("<td class='tagCell' style='text-align: center'><a href='./tag.jsp?tag=" + - tag.getTag() + "'><span class='" + style +"'>" + tag.getTag() + "</span></a></td>"); - ii++; - } -%> - </tr> - </table> - </div> - </td> - <td style="vertical-align:top; width:250px; text-align:right;"> - <div id="downloadAds"> - <div id="downloadAds" style="text-align:center; border-style:none; width:100%;"> - <table style="width:100%"> - <tr> - <td style="text-align:center;"> - <a href="http://java.sun.com/javaee/downloads/index.jsp" target="downloads"><img style="border:none" src="./images/ad-sdk.jpg" alt="Download Java EE 5 SDK"/></a> - </td> - </tr> - <tr> - <td style="text-align:center;"> - <a href="http://www.netbeans.org/downloads/index.html" target="downloads"><img style="border:none" src="./images/ad-netbeans.jpg" alt="Download Netbeans IDE"/></a> - </td> - </tr> - <tr> - <td style="text-align:center;"> - <a href="http://java.com/en/download/index.jsp" target="downloads"><img style="border:none" src="./images/ad-jre.jpg" alt="Download Java SE"/></a> - </td> - </tr> - </table> - </div> - </div> - </td> - </tr> - </table> - - <div style="position: absolute; visibility: hidden;z-index:5" id="menu-popup"> - <table id="completeTable" class="popupTable" ></table> - </div> - - <br/><br/> - <jsp:include page="footer.jsp" /> - - </body> -</html> -<% - } catch(Exception e) { - e.printStackTrace(); - } -%> diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/jsonTest.jsp b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/jsonTest.jsp deleted file mode 100644 index d2fd4c5..0000000 --- a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/jsonTest.jsp +++ /dev/null @@ -1,53 +0,0 @@ -<%@page contentType="text/html"%> -<%@page pageEncoding="UTF-8"%> -<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> -<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> - -<html> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> - <title>JSON Test Page</title> - <script type="text/javascript" src="${pageContext.request.contextPath}/faces/static/META-INF/dojo/bpcatalog/dojo.js"></script> - - <script type="text/javascript"> - function getJSON() { - // get data and send to controller servlet - var bindArgs = { - url: "${pageContext.request.contextPath}/catalog?command=items&pid=feline01&start=0&length=2&format=json", - mimetype: "text/json", - error: function(){ alert("error")}, - load: callbackx - }; - - dojo.io.bind(bindArgs); - } - - function callbackx(type, data, evt) { - // check successful response - if (evt.readyState == 4) { - if (evt.status == 200) { - var prodsx=data.products; - rep="Products:<br>"; - for(ii=0; ii < prodsx.length; ii++) { - rep += prodsx[ii].name + "<br/>"; - } - rep+="<br>"; - document.getElementById("testResult").innerHTML=rep; - } - } - } - - </script> - - </head> - <body> - - <h1>JSON Test Page</h1> - <span onclick="getJSON();"> GET DATA </span><br/><br/> - - <div id="testResult"> - This should be populated with result. If not, look at the error console for errors. - </div> - - </body> -</html> diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/lookup.jsp b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/lookup.jsp deleted file mode 100644 index b634b42..0000000 --- a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/lookup.jsp +++ /dev/null @@ -1,36 +0,0 @@ -<%-- Copyright 2006 Sun Microsystems, Inc. All rights reserved. You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at: http://developer.sun.com/berkeley_license.html -$Id: lookup.jsp,v 1.7 2007/01/19 21:47:31 basler Exp $ --%> - -<%@page contentType="text/xml"%> -<%@page pageEncoding="UTF-8"%> -<%@page import="com.sun.javaee.blueprints.petstore.model.CatalogFacade, com.sun.javaee.blueprints.petstore.model.Item"%> - -<% - String itemId=request.getParameter("itemId"); - String popupView=request.getParameter("popupView"); - - try { - ServletContext context=config.getServletContext(); - CatalogFacade cf=(CatalogFacade)context.getAttribute("CatalogFacade"); - Item item=cf.getItem(itemId); - - if(itemId != null) { - out.println("<response>"); - out.println("<name>" + item.getName() + "</name>"); - String tmp=null; - if(popupView != null && popupView.equals("2")) { - tmp=item.getAddress().addressToString(); - } else { - tmp=item.getDescription(); - } - out.println("<description><![CDATA[" + tmp + "]]></description>"); - out.println("<price>" + java.text.NumberFormat.getCurrencyInstance(java.util.Locale.US).format(item.getPrice()) + "</price>"); - out.println("<image>" + request.getContextPath() + "/ImageServlet/" + item.getImageThumbURL() + "</image>"); - out.println("</response>"); - out.flush(); - } - } catch(Exception ee) { - ee.printStackTrace(); - } - -%> diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/main.htmf b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/main.htmf deleted file mode 100644 index b207a5a..0000000 --- a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/main.htmf +++ /dev/null @@ -1,36 +0,0 @@ -<!-- Copyright 2006 Sun Microsystems, Inc. All rights reserved. You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at: http://developer.sun.com/berkeley_license.html -$Id: main.htmf,v 1.3 2006/05/03 22:00:33 inder Exp $ --> - - <table valign="top" id="bodyTable" border="0"> - <tr> - <td> - <map name="petmap"> - <area onmouseover="javascript:this.style.cursor='pointer';" onclick="loadCategory('BIRDS')" - alt="Birds" - coords="72,2,280,250"> - <area onmouseover="javascript:this.style.cursor='pointer';" onclick="loadCategory('FISH')" - alt="Fish" - coords="2,180,72,250"> - <area onmouseover="javascript:this.style.cursor='pointer';" onclick="loadCategory('DOGS')" - alt="Dogs" - coords="60,250,130,320"> - <area onmouseover="javascript:this.style.cursor='pointer';" onclick="loadCategory('REPTILES')" - alt="Reptiles" - coords="140,270,210,340"> - <area onmouseover="javascript:this.style.cursor='pointer';" onclick="loadCategory('CATS')" - alt="Cats" - coords="225,240,295,310"> - <area onmouseover="javascript:this.style.cursor='pointer';" onclick="loadCategory('BIRDS')" - alt="Birds" - coords="280,180,350,250"> - </map> - - <img src="images/splash.gif" - alt="Pet Selection Map" - usemap="#petmap" - width="350" - height="355" - border="0"> - </td> - </tr> - </table> \ No newline at end of file diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/main.js b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/main.js deleted file mode 100644 index b8de8fc..0000000 --- a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/main.js +++ /dev/null @@ -1,21 +0,0 @@ -/* Copyright 2006 Sun Microsystems, Inc. All rights reserved. You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at: http://developer.sun.com/berkeley_license.html -$Id: main.js,v 1.9 2006/05/03 22:00:33 inder Exp $ */ - -var isIE; -var bodyRowText; - -dojo.require("dojo.widget.FisheyeList"); -init(); - -function browse(category) { - window.location.href="catalog.jsp?catid=" + category; -} - -function loadPetstore() { - init(); - showMain(); -} - -function init() { - if (navigator.userAgent.indexOf("IE") != -1) isIE = true; -} diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/map.jsp b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/map.jsp deleted file mode 100644 index c2673c9..0000000 --- a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/map.jsp +++ /dev/null @@ -1,143 +0,0 @@ -<%-- Copyright 2006 Sun Microsystems, Inc. All rights reserved. You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at: http://developer.sun.com/berkeley_license.html -$Id: map.jsp,v 1.20 2006/11/02 00:34:49 basler Exp $ --%> - -<%@page contentType="text/html"%> -<%@page pageEncoding="UTF-8"%> -<%@page import="com.sun.javaee.blueprints.petstore.model.CatalogFacade, com.sun.javaee.blueprints.petstore.model.Item, com.sun.javaee.blueprints.petstore.mapviewer.MapBean, com.sun.javaee.blueprints.components.ui.mapviewer.MapMarker"%> -<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@taglib uri="http://java.sun.com/jsf/html" prefix="h" %> -<%@taglib uri="http://java.sun.com/jsf/core" prefix="f" %> -<%@taglib prefix="ui" uri="http://java.sun.com/blueprints/ui" %> - -<html> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> - <title>Map Display</title> - </head> - <body> - <jsp:include page="banner.jsp" /> - <br> - <center> - <table border="1" cellspacing="5px" cellpadding="5px" - style="border-style:double; border-color:darkgreen; padding:5px"> - <tr> - <td valign="top" align="center" width="200px"> - <table border="0"> - <c:if test="${!empty sessionScope.MapBean.locations}"> - <tr> - <th> - <u>${sessionScope.MapBean.locationCount} Items Displayed</u> - </th> - </tr> - <tr> - <td> - <ul> -<% - try { - // need to use scriptlet to preform the reconciliation of items to map coords - // this way I don't have to create a new wrapper object - MapBean mapBean=(MapBean)session.getAttribute("MapBean"); - MapMarker[] mapMarkers=(MapMarker[])mapBean.getLocations(); - java.util.List<Item> items=mapBean.getItems(); - Item itemxx=null; - String popupOptions=null; - for(int ii=0; ii < mapMarkers.length; ii++) { - - //System.out.println("loop - " + ii + " - " + mapBean.getCenterAddress()); - if(mapBean.getCenterAddress() != null && !mapBean.getCenterAddress().equals("")) { - // center point is set to the first mapMarker, items are off by one - if(ii > 0) { - // reconcile correct mapMarkers with items list - itemxx=items.get(ii - 1); - popupOptions="onmouseover="bpui.popup.show('pop1', event, '" + itemxx.getItemID() + "')" onmouseout="bpui.popup.hide('pop1')""; - } else { - // first item of mapMarker is centerpoint, so no corresponding item, also no popup on mouseover - itemxx=null; - popupOptions=""; - } - } else { - // no center point items should be 1-to-1 with mappedMarkers - itemxx=items.get(ii); - popupOptions="onmouseover="bpui.popup.show('pop1', event, '" + itemxx.getItemID() + "')" onmouseout="bpui.popup.hide('pop1')""; - } -%> - <li> - <a href="javascript:mapViewerx.openInfoWindowHtml(new GPoint(<%= mapMarkers[ii].getLongitude() %>,<%= mapMarkers[ii].getLatitude() %>), '<%= mapMarkers[ii].getMarkup() %>');" <%= popupOptions %>> - <%= mapBean.changeSpaces((itemxx == null) ? mapMarkers[ii].getMarkup() : "<b>" + itemxx.getName() + "</b>") %> - </a> -<% - if(itemxx != null) { - // remove these links for center point entry -%> - <a href="${pageContext.request.contextPath}/faces/catalog.jsp?pid=<%= itemxx.getProductID() %>&itemId=<%= itemxx.getItemID() %>" alt="Go to Detailed Catalog Page"> - <i>(detail)</i> - </a> - - <br/> - <a href="javascript:mapViewerx.openInfoWindowHtml(new GPoint(<%= mapMarkers[ii].getLongitude() %>, <%= mapMarkers[ii].getLatitude() %>), '<%= mapMarkers[ii].getMarkup() %>');" <%= popupOptions %>> - <font size="-1"><%= mapBean.changeSpaces((itemxx == null) ? mapMarkers[ii].getMarkup() : itemxx.getAddress().addressToString()) %></font> - </a> -<% - } -%> - </li> - <% - } - } catch(Exception ee) { - ee.printStackTrace(); - - } - %> - </ul> - <td> - </tr> - </c:if> - </table> - </td> - <td valign="top"> - <f:view> - <ui:popupTag id="pop1" xmlHttpRequestURL="../lookup.jsp?itemId=" - elementNamePairs="name=value1,description=value2,price=value3,image=imageId"> - <!-- Used as spaces to center the table, this could be done programmatically, - but browser diff, so I left it in the hands of the component user. The image is located - in the component jar so for retrieval, push it through the faces servlet --> - <img id="spaceImage" height="10px" width="12px" src="${pageContext.request.contextPath}/faces/static/META-INF/popup/images/spacer.gif" align="left"> - <table border="0" width="270px" bgcolor="#ffffff" cellpadding="5" cellspacing="5"> - <tr> - <td align="left" valign="top"><b>Name:</b> - <span id="value1">Loading Data...</span></td> - </tr> - <tr> - <td align="left" valign="top"><b>Description:</b> - <span id="value2">Loading Data...</span></td> - </tr> - <tr> - <td align="left" valign="top"><b>Price:</b> - <span id="value3">Loading Data...</span></td> - </tr> - <tr> - <td colspan="2" align="center"><img name="image" id="imageId" src="" - alt="[Loading Image...]" border="2"/><br/><br/></td> - </tr> - </table> - </ui:popupTag> - - - <ui:mapViewer id="mapViewerx" center="#{MapBean.mapPoint}" info="#{MapBean.mapMarker}" - markers="#{MapBean.locations}" zoomLevel="#{MapBean.zoomLevel}" style="height: 500px; width: 700px"/> - - </f:view> - </td> - </tr> - </table> - <script type="text/javascript"> - bpui.mapviewer.createMapControl = function() { - return new GLargeMapControl(); - } - - </script> - <br/><br/> - </center> - <jsp:include page="footer.jsp" /> - </body> -</html> diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/mapAll.jsp b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/mapAll.jsp deleted file mode 100644 index a3ae6dc..0000000 --- a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/mapAll.jsp +++ /dev/null @@ -1,65 +0,0 @@ -<%-- Copyright 2006 Sun Microsystems, Inc. All rights reserved. You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at: http://developer.sun.com/berkeley_license.html -$Id: mapAll.jsp,v 1.14 2006/12/06 22:44:37 basler Exp $ --%> - -<%@page contentType="text/html"%> -<%@page pageEncoding="UTF-8"%> -<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@taglib uri="http://java.sun.com/jsf/html" prefix="h" %> -<%@taglib uri="http://java.sun.com/jsf/core" prefix="f" %> -<%@taglib prefix="ui" uri="http://java.sun.com/blueprints/ui" %> - -<html> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> - <title>Map Viewer Page</title> - </head> - <body> - <jsp:include page="banner.jsp" /> - <center> - <f:view> - - <h:form id="form1"> - <table border="1" cellpadding="5" cellspacing="5" style="border-style:double; width:600px; border-color:darkgreen; padding:5px"> - <tr> - <td colspan=3> - <i>Select the category whose items will be displayed in a Google map based on the Seller's address. - Optionally, enter a "Center Point Address" and "Area" to limit the search to a specific - area around the center point.</i> - </td> - </tr> - <tr> - <th align="right">Select Category to Map:</th> - <td align="center" colspan=2> - <h:selectOneRadio value="#{MapBean.category}" required="true"> - <f:selectItems value="#{MapBean.categories}"/> - </h:selectOneRadio> - </td> - </tr> - <tr> - <th align="right">Center Point Address:</th> - <td> - <h:inputText id="centerAddress" value="#{MapBean.centerAddress}" size="70"/> - <br/><small><i>For example: 4140 Network Circle, Santa Clara, CA, 95054</i></small> - </td> - </tr> - <tr> - <th align="right">Area (in Miles):</th> - <td> - <h:inputText id="radius" value="#{MapBean.radius}" size="5"/> - </td> - </tr> - <tr> - <td colspan="2" align="center"> - <h:commandButton action="#{MapBean.findAllByCategory}" id="submitCat" type="submit" value="Map Category"/> - </td> - </tr> - - </table> - <h:messages/> - </h:form> - </f:view> - - </center> - <jsp:include page="footer.jsp" /> - </body> -</html> diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/news.js b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/news.js deleted file mode 100644 index 5bcac34..0000000 --- a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/news.js +++ /dev/null @@ -1,190 +0,0 @@ - -dojo.require("dojo.io.*"); -dojo.require("dojo.event.*"); - -var bpuinews; -if (typeof bpuinews == "undefined") { - bpuinews = new Object(); -} - -bpuinews.RSS = function() { - var currentItem = 0; - var limitCharNum = 75; - var itemNum=0; - var rssData = null; - var prev; - var next; - var prevHit=false; - - this.getRssInJson = function (method, uri) { - prev = document.getElementById("previous"); - next = document.getElementById("next"); - dojo.event.connect(prev, "onclick", function(evt) {showPrevious();}); - dojo.event.connect(next, "onclick", function (evt) {showNext();}); - prev.disabled=true; - - var encodedURI = encodeURI(method + "?style=json&itemCount=0&url="+uri); - var bindArgs = { - url: encodedURI, - mimetype: "text/json", - load: function (type, data, http) { - handleJsonRss(data); - }, - error: function (t, e) { - dojo.debug("ERROR : " + e.message); - } - } - dojo.io.bind(bindArgs); - return false; - } - - function handleJsonRss(json) { - rssData = json; - itemNum = json.channel.item.length; - showNext(); - } - - function createUl(skip) { - var i; - var cp="<ul>\n"; - for (i = currentItem; i<currentItem + skip; i++) { - cp += "<li><b>"+decodeURL(rssData.channel.item[i].title)+"</b>\n"; - cp += "<p>" + decodeURL(rssData.channel.item[i].description) + "</p>\n</li>\n"; - } - cp += "</ul>\n"; - return cp; - } - - // Following funcs(showNext, showPrevious) should be connected to the button - // by dojo.event.connect. - function showNext() { - var skip = 5; - if (prevHit) { - currentItem = currentItem + skip; - prevHit = false; - } - var nextCurrentItem = currentItem + skip; - if (nextCurrentItem >= itemNum) { - skip = itemNum - currentItem; - // deactivate "next" button - next.disabled=true; - nextCurrentItem = currentItem; - } - // activate "previous" button - if (currentItem != 0) { - prev.disabled=false; - } - var cp = createUl(skip); - var elm = document.getElementById("news"); - elm.innerHTML = cp; - currentItem = nextCurrentItem; - } - - function showPrevious() { - prevHit = true; - var skip = 5; - currentItem = currentItem - skip; - if (currentItem <= 0) { - currentItem = 0; - // deactivate "previous" button - prev.disabled=true; - } - next.disabled=false; - var cp = createUl(skip); - var elm = document.getElementById("news"); - elm.innerHTML = cp; - } - - - /* Compatible function to java.net.URLDecoder.decode(). - * (decodeURI() is not compatible) - */ - function decodeURL(str){ - var targetStr=""; - var s, tmpStr, unicode, f; - // take a look at every char in the source str - var i, j; - for (i = 0; i < str.length; i++) { - s = str.charAt(i); - // handle WS, which is the most common char - if (s == "+") { - targetStr += " "; - } else { - if (s != "%") { - // Non-encoded char - targetStr += s; - } else{ - // encoding begin - unicode = 0; // uncode representation - f = 1; // flag to specify the escape sequence - while (true) { - tmpStr = ""; - // get the two HEX chars and put that in the temp string. If no char, that is not a HEX. - for (j = 0; j < 2; j++ ) { - tmptmpStr = str.charAt(++i); - if (((tmptmpStr >= "0") && (tmptmpStr <= "9")) || - ((tmptmpStr >= "a") && (tmptmpStr <= "f")) || - ((tmptmpStr >= "A") && (tmptmpStr <= "F"))) { - tmpStr += tmptmpStr; - } else { - --i; - break; - } - } - /* parse the HEX - * <= 0x7f : Single byte - * >=0xc0 && <=0xdf : Two bytes - * >=0xe0 && <=0xef : Three bytes - * >=0xf0 && <=0xf7 : Four bytes - * >=0x80 && <=0xbf : may not occur - just shift it - * <=1 : sequence terminated - */ - var byte = parseInt(tmpStr, 16); - if (byte <= 0x7f) {unicode = byte; f = 1;} - if ((byte >= 0xc0) && (byte <= 0xdf)) {unicode = byte & 0x1f; f = 2;} - if ((byte >= 0xe0) && (byte <= 0xef)) {unicode = byte & 0x0f; f = 3;} - if ((byte >= 0xf0) && (byte <= 0xf7)) {unicode = byte & 0x07; f = 4;} - if ((byte >= 0x80) && (byte <= 0xbf)) {unicode = (unicode << 6) + (byte & 0x3f); --f;} - if (f <= 1) { - break; - } - if (str.charAt(i + 1) == "%") { - i++ ; - } else { - // Error. should not occur - break; - } - } - targetStr += String.fromCharCode(unicode); - } - } - } - return targetStr; - } - - /* Cut the string at the WS so that it's shorter than the limitCharNum. - */ - function cutStringatWs(str, limitCharNum) { - var tmpStr = str; - var cnum = 0; - while (true) { - cnum = tmpStr.lastIndexOf(" "); - // no occurance of WS - if (cnum < 0) { - // if str is still longer than limit - if (tmpStr.length >= limitCharNum) { - tmpStr = tmpStr.substring(0, limitCharNum); - } - break; - } else { - tmpStr = tmpStr.substring(0, cnum); - if (cnum <= limitCharNum) { - break; - } - } - } - return tmpStr; - } - -} - diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/news.jsp b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/news.jsp deleted file mode 100644 index b57de0b..0000000 --- a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/news.jsp +++ /dev/null @@ -1,51 +0,0 @@ -<%-- Copyright 2006 Sun Microsystems, Inc. -All rights reserved. You may not modify, use, reproduce, or distribute -this software except in compliance with the terms of the License at: -http://developer.sun.com/berkeley_license.html -$Id: news.jsp,v 1.2 2006/12/14 01:04:50 yutayoshida Exp $ --%> - -<%@page contentType="text/html"%> -<%@page pageEncoding="UTF-8"%> -<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@taglib uri="http://java.sun.com/jsf/html" prefix="h" %> -<%@taglib prefix="ui" uri="http://java.sun.com/blueprints/ui" %> - -<html> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> - <title>BluePrints News Page</title> - <script type="text/javascript" src="${pageContext.request.contextPath}/faces/static/META-INF/dojo/bpcatalog/dojo.js"></script> - <script type="text/javascript" src="${pageContext.request.contextPath}/news.js"></script> - - <style> - p { - width : 70%; - background-color : #FFEFD5; - font-size : 80% - } - </style> - - </head> - <script type="text/javascript"> - var news = new bpuinews.RSS(); - dojo.addOnLoad(function(){news.getRssInJson('${pageContext.request.contextPath}/faces/dynamic/bpui_rssfeedhandler/getRssfeed', 'https://blueprints.dev.java.net/servlets/ProjectRSS?type=news%27);%7D); - </script> - <body> - <jsp:include page="banner.jsp" /> - <h2><a href="http://blueprints.dev.java.net">BluePrints News</a></h2> - <center> - <table border="0" width="95%"> - <tr> - <td> - <button id="previous" type="button"><< Previous</button> - </td> - <td> - <button id="next" type="button">Next >></button> - </td> - </tr> - </table> - </center> - <div id="news"></div> - <jsp:include page="footer.jsp" /> - </body> -</html> diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/petstoreListTest.jsp b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/petstoreListTest.jsp deleted file mode 100644 index 923739b..0000000 --- a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/petstoreListTest.jsp +++ /dev/null @@ -1,21 +0,0 @@ -<%@page contentType="text/html"%> -<%@page pageEncoding="UTF-8"%> -<html> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> - <title>jsonp test page</title> - <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/bp_petstorelist.css"></link> - <script type="text/javascript" src="${pageContext.request.contextPath}/bp_petstorelist.js"></script> - <script type="text/javascript"> - var petstoreList; - function init() { - petstoreList=new bpui.petstoreList.createPetstoreList("petstoreListDiv"); - } - </script> - </head> - <body onload="init()"> - <h1>jsonp test page</h1> - - <div id="petstoreListDiv"></div> - </body> -</html> diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/rss.js b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/rss.js deleted file mode 100644 index 66700d3..0000000 --- a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/rss.js +++ /dev/null @@ -1,110 +0,0 @@ -/* Copyright 2006 Sun Microsystems, Inc. All rights reserved. You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at: http://developer.sun.com/berkeley_license.html -$Id: rss.js,v 1.3 2006/05/31 19:13:03 basler Exp $ */ - -dojo.require("dojo.io.*"); - -if (bpui = 'undefined') { - bpui = new Object(); -} - -bpui.RSS = function() { - var jsonData = null; - var rssItemNum = 0; - var currentItem = 0; - var rssTimeout = null; - var itemIntervalMsec = 2000; - var rssFadeoutCounter = 110; - var rssFadeinCounter = 110; - var itemIntervalId = 0; - - this.getRssInJson = function (uri, number) { - rssItemNum = number; - var encodedURI = encodeURI(bpui.contextRoot + "/faces/dynamic/bpui_rssfeedhandler/getRssfeed?style=json&itemNumber="+number+"&url="+uri); - //alert("encoded url=" + encodedURI); - var bindArgs = { - url: encodedURI, - mimetype: "text/json", - load: function (type, data, http) { - handleJsonRss(data); - for (var key in data.channel.item) { - dojo.debug("ITEM Title ", key, ":", data.channel.item[key].title); - dojo.debug("ITEM LInk ", key, ":", data.channel.item[key].link); - } - }, - error: function (t, e) { - dj_debug("ERROR : " + e.message); - } - } - dojo.io.bind(bindArgs); - return false; - } - - function handleJsonRss(json) { - jsonData = json; - // setting top title and link - generateHref(json.channel.title, json.channel.link, "rss-channel"); - // setting items - generateHref(json.channel.item[0].title, json.channel.item[0].link, "rss-item"); - var aNodes = document.getElementById("rss-item").getElementsByTagName("a"); - dojo.event.connect(aNodes[0], "onmouseover", "pauseCycle"); - dojo.event.connect(aNodes[0], "onmouseout", "resumeCycle"); - cycleRss(); - } - - function generateHref (title, link, nodeId) { - var node = document.getElementById(nodeId); - var aNode = document.createElement("a"); - aNode.setAttribute("href", link); - aNode.appendChild(document.createTextNode(title)); - if (node.hasChildNodes()) { - node.removeChild(node.firstChild); - } - node.appendChild(aNode); - } - - function cycleRss () { - itemIntervalId = setTimeout(replaceItem, itemIntervalMsec); - } - - - function replaceItem() { - if (itemIntervalId) { - clearTimeout(itemIntervalId); - } - // fadeout the current item and pop the next one in. - var cItem = document.getElementById("rss-item"); - dojo.fx.html.fadeOut(cItem.getElementsByTagName('a')[0], 500); - var waitId = setTimeout(function(waitId) { - clearTimeout(waitId); - //cItem.removeChild(cItem.firstChild); - if (currentItem < (rssItemNum -1)) { - currentItem += 1; - } else { - currentItem = 0; - } - generateHref(jsonData.channel.item[currentItem].title, jsonData.channel.item[currentItem].link, "rss-item"); - // attach event for onmouseover(pause) and onmouseout(resume) - var aNodes = cItem.getElementsByTagName("a"); - dojo.event.connect(aNodes[0], "onmouseover", "pauseCycle"); - dojo.event.connect(aNodes[0], "onmouseout", "resumeCycle"); - cycleRss();}, 500); - } - - function pauseCycle(evt) { - if (itemIntervalId) { - clearTimeout(itemIntervalId); - } - } - - function resumeCycle (evt) { - cycleRss(); - } - - bpui.getContextRoot = function() { - var urlArray=window.location.toString().split("/", 4); - return "/" + urlArray[3]; - } - - bpui.contextRoot = bpui.getContextRoot(); -} - diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/rss.jsp b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/rss.jsp deleted file mode 100644 index e57e4dc..0000000 --- a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/rss.jsp +++ /dev/null @@ -1,33 +0,0 @@ -<%-- Copyright 2006 Sun Microsystems, Inc. All rights reserved. You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at: http://developer.sun.com/berkeley_license.html -$Id: rss.jsp,v 1.2 2006/05/03 22:00:34 inder Exp $ --%> - -<%@page contentType="text/html"%> -<%@page pageEncoding="UTF-8"%> - -<%@taglib prefix="f" uri="http://java.sun.com/jsf/core%22%%3E -<%@taglib prefix="h" uri="http://java.sun.com/jsf/html%22%%3E -<%@taglib prefix="ui" uri="http://java.sun.com/blueprints/ui" %> - -<html> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> - <title>RSS</title> - </head> - <body> - - <h1>RSS test</h1> - <f:view> - ui:rssreader - <ui:rsscategory title="JavaEE 5"> - <ui:rssfeed title="BluePrints" url="https://blueprints.dev.java.net/servlets/ProjectRSS?type=news%22%3E</ui:rssfeed> - <ui:rssfeed title="GlassFish" url="http://blogs.sun.com/roller/rss/theaquarium%22%3E</ui:rssfeed> - </ui:rsscategory> - <ui:rsscategory title="Yahoo!"> - <ui:rssfeed title="World" url="http://rss.news.yahoo.com/rss/world%22%3E</ui:rssfeed> - <ui:rssfeed title="US" url="http://rss.news.yahoo.com/rss/us%22%3E</ui:rssfeed> - </ui:rsscategory> - </ui:rssreader> - - </f:view> - </body> -</html> diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/rssbar.jsp b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/rssbar.jsp deleted file mode 100644 index 6f9c2f9..0000000 --- a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/rssbar.jsp +++ /dev/null @@ -1,20 +0,0 @@ -<%-- Copyright 2006 Sun Microsystems, Inc. All rights reserved. You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at: http://developer.sun.com/berkeley_license.html -$Id: rssbar.jsp,v 1.7 2006/05/06 01:44:59 yutayoshida Exp $ --%> - -<%@page contentType="text/html"%> -<%@page pageEncoding="UTF-8"%> - -<%@taglib prefix="f" uri="http://java.sun.com/jsf/core%22%%3E -<%@taglib prefix="h" uri="http://java.sun.com/jsf/html%22%%3E -<%@taglib prefix="ui" uri="http://java.sun.com/blueprints/ui" %> - - - - <f:view> - <ui:rssBar url="https://blueprints.dev.java.net/servlets/ProjectRSS?type=news" - itemCount="4" - title="News from BluePrints" - speed="6000" - backgroundImage="no" - color="#00ffff" hoverColor="#ff00ff"></ui:rssBar> - </f:view> diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/rteToolBar.html b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/rteToolBar.html deleted file mode 100644 index 9cc8c0a..0000000 --- a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/rteToolBar.html +++ /dev/null @@ -1,60 +0,0 @@ -<div class="EditorToolbarDomNode EditorToolbarSmallBg"> - <table cellpadding="1" cellspacing="0" border="0"> - <tbody> - <tr valign="top" align="left"> - <td> - <!-- bold --> - <span class="iconContainer dojoEditorToolbarItem" dojoETItemName="bold"> - <span title="Toggle Bold (Ctrl-B)" class="dojoE2TBIcon dojoE2TBIcon_Bold"> </span> - </span> - </td> - <td> - <!-- italic --> - <span class="iconContainer dojoEditorToolbarItem" dojoETItemName="italic"> - <span title="Toggle Italic (Ctrl-I)" class="dojoE2TBIcon dojoE2TBIcon_Italic"> </span> - </span> - </td> - <td> - <!-- underline --> - <span class="iconContainer dojoEditorToolbarItem" dojoETItemName="underline"> - <span title="Toggle Underline (Ctrl-U)" class="dojoE2TBIcon dojoE2TBIcon_Underline"> </span> - </span> - </td> - <td> - <!-- strikethrough --> - <span class="iconContainer dojoEditorToolbarItem" dojoETItemName="strikethrough"> - <span title="Toggle Strike-Through" -class="dojoE2TBIcon dojoE2TBIcon_StrikeThrough"> </span> - </span> - </td> - <td> - <!-- inserthorizontalrule --> - <span class="iconContainer dojoEditorToolbarItem" dojoETItemName="inserthorizontalrule"> - <span title="Insert Horizontal Rule" class="dojoE2TBIcon dojoE2TBIcon_HorizontalLine "> </span> - </span> - </td> - <td isSpacer="true"> - <!-- spacer --> - <span class="iconContainer"> - <span class="dojoE2TBIcon dojoE2TBIcon_Sep" style="width: 5px; min-width: 5px;"></span> - </span> - </td> - <td> - <!-- forecolor --> - <span class="iconContainer dojoEditorToolbarItem" dojoETItemName="forecolor"> - <span title="Change Text Color" class="dojoE2TBIcon dojoE2TBIcon_TextColor" -unselectable="on"> </span> - </span> - </td> - <td> - <!-- hilitecolor --> - <span class="iconContainer dojoEditorToolbarItem" dojoETItemName="hilitecolor"> - <span title="Change Background Color" class="dojoE2TBIcon dojoE2TBIcon_BackgroundColor" -unselectable="on"> </span> - </span> - </td> - <td width="*"> </td> - </tr> - </tbody> - </table> -</div> diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/scroller.css b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/scroller.css deleted file mode 100644 index 151df6d..0000000 --- a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/scroller.css +++ /dev/null @@ -1 +0,0 @@ -.slider { border-width:1px; border-style:solid; border-color:black; background:#404040; }
.tile { position: absolute; top:0px; left:0px; cursor:pointer; border-width:1px; border-style:solid; border-color:black; visibility:hidden; z-index:1; background:white; opacity: .99; }
.tileImage { width: 94; height: 70; }
.nav { cursor:pointer; position: absolute; vertical-align:bottom; z-index:11; opacity: .85; }
.infopane { z-index:0; width:475px; position: absolute; border-width:1px; border-style:solid; border-color:black; background:black; opacity: .65; }
.infopaneDescription { color:white; font-size:12px; }
.infopaneShortDescription { color:white; font-size:16px; }
.infopanePrice { color:white; text-align: center; height:20px; }
.infopanePayPal{ vertical-valign: bottom; text-align: right; height:20px; }
.infopaneRating{ vertical-valign: top; text-align: center; width:125px; height:15px; color:white; opacity: .95; }
.infopaneTitle { width:255px; height:15px; color:white; font-size:18px; } \ No newline at end of file diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/scroller.js b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/scroller.js deleted file mode 100644 index 1f72578..0000000 --- a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/scroller.js +++ /dev/null @@ -1,643 +0,0 @@ -/* Copyright 2006 Sun Microsystems, Inc. All rights reserved. You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at: http://developer.sun.com/berkeley_license.html -$Id: scroller.js,v 1.32 2007/01/17 18:00:09 basler Exp $ */ - -/** -* ImageScroller - A multipurpose item brower -* @ Author: Greg Murray -* -*/ - -function getApplicationContextRoot() { - var urlArray=window.location.toString().split("/", 4); - return "/" + urlArray[3]; -} - -var applicationContextRoot=getApplicationContextRoot(); - - -function ImageScroller() { - var _this = this; - var initialized = false; - // default sizes - - var VIEWPORT_WIDTH = 500; - // all sizes are realitive the the viewport width - var IMAGEPANE_WIDTH = VIEWPORT_WIDTH; - var IMAGEPANE_HEIGHT = Math.round(VIEWPORT_WIDTH / 1.49); - var INFOPANE_DEFAULT_HEIGHT = Math.round(VIEWPORT_WIDTH / 6.67); - var INFOPANE_EXPAND_HEIGHT = Math.round(VIEWPORT_WIDTH / 2.86); - var THUMB_WIDTH = Math.round(VIEWPORT_WIDTH / 5);; - var THUMB_HEIGHT = Math.round(VIEWPORT_WIDTH / 6.67); - - var CHUNK_SIZE = 7; - var PREFETCH_THRESHHOLD = 5; - - var IMAGE_PANE_ID = "imagePane"; - var IMAGE_PANE_BUFFER_ID = "imageBufferPane"; - - var PADDING = 3; - - var MINIMIZE_IMG_URI = applicationContextRoot + "/images/minimize.gif"; - var MAXIMIZE_IMG_URI = applicationContextRoot + "/images/maximize.gif"; - var INDICATOR_IMG_URI = applicationContextRoot + "/images/indicator-black.gif"; - var MAXIMIZE_IMG_TOOLTIP = "Show Details"; - var MINIMIZE_IMG_TOOLTIP = "Show Less Details"; - - // this is an array of the tiles which are divs for each thumb - var tiles = []; - - var injectionPoint; - - // for scrolling - - var SCROLL_INCREMENT = 5; - var INFOPANE_INCREMENT = 3; - var tileY; - var tileX; - // this is the index of the image tile on the far left - var index = 0; - // keeps track how for the scroll has gone - var offset = 0; - - var timeout = 30; // in ms - var isScrollingRight = false; - var isScrollingLeft = false; - - // large image pane - var imagePane; - var imageLoadingPane; - var loadingPane; - // images - var minimizeImage; - - var indicatorImage; - var leftButton; - var rightButton; - - // infopane - var infoPane; - var infoTableMinimize; - var indicatorCell; - var minimizeLink; - var infoPaneLoop = 0; - var maximizing = false; - var minimizing = false; - var maximized = false; - - // prefetch thresh-hold - var prefetchThreshold = 2; - - // a growing list of items; - var items = []; - // cached chunks that are already in the items array - var loadedChunks = []; - - // used for debugging when debug is true - var debug = false; - var statusDiv; - var status2Div; - - var showingBuffer = false; - var imageBuffer; - var imageReloadTries = 0; - var IMG_RELOAD_RETRY_MAX = 30; - // used for url book marking - - - var pid; - var currentChunk; - // this map contains all the items - var map; - // this is the main container div - var containerDiv; - - this.getItems = function() { - return map; - } - - this.getScrollerItems = function() { - return items; - } - - - this.getGroupId = function() { - return pid; - } - - this.reset = function() { - resetTitles() - tiles = []; - index = 0; - offset = 0; - currentChunk = 0; - items = []; - loadedChunks = []; - } - - function resetTitles() { - for (var l = 0; l < tiles.length; l++) { - tiles[l].parentNode.removeChild(tiles[l]); - } - } - - // event bound to the mouseOut event of both scroll buttons - function scrollDone() { - isScrollingLeft = false; - isScrollingRight = false; - } - - // looping method for time out - function scroll() { - if (isScrollingRight) scrollRight(); - else if (isScrollingLeft) scrollLeft(); - } - - - // do the value list pre-emptive fetching - function prefetch() { - //printDebug("** scoller index = " + index); - if (isScrollingRight && (index + PREFETCH_THRESHHOLD) % CHUNK_SIZE == 0) { - - if ((Math.round(index / CHUNK_SIZE)) >= currentChunk) { - currentChunk = Math.round(index / CHUNK_SIZE) + 1; - // fire an event - dojo.event.topic.publish("/catalog", {type:"getChunk", id: pid, index: index, currentChunk: currentChunk}); - } - } - } - - this.setGroupId = function(id) { - pid = id; - } - - this.containsChunk = function(chunkId) { - printDebug("containsChunk = " + loadedChunks); - ret=false; - for(ii=0; ii < loadedChunks.length; ii++) { - if(chunkId == loadedChunks[ii]) { - ret=true; - break; - } - } - return ret; - } - - this.addChunk = function(chunkId) { - loadedChunks.push(chunkId); - } - - this.addItems = function(inItems) { - for (var loop=0; loop < inItems.length ; loop++) { - items.push(inItems[loop]); - map.put(inItems[loop].id, inItems[loop]); - createTile(inItems[loop]); - if (loop == 0 && !loadImage) { - showImage(inItems[loop].id); - } - - } - drawTiles(); - rightButton.style.visibility="visible"; - _this.hideProgressIndicator(); - } - - this.showProgressIndicator = function() { - if (indicatorImage) { - indicatorImage.style.visibility = "visible"; - } - } - - this.hideProgressIndicator = function() { - indicatorImage.style.visibility = "hidden"; - } - - function postImageLoad(loadIntoBuffer) { - if (debug) { - status2Div.innerHTML = "Try " + imageReloadTries + " " + url + " image.complete=" + imageBuffer.complete; - } - // keep calling this funtion until imageReloadTries < IMG_RELOAD_RETRY_MAX - if (!imageBuffer.complete) { - if (imageReloadTries < IMG_RELOAD_RETRY_MAX) { - setTimeout(function(){this.loadIntoBuffer = loadIntoBuffer;postImageLoad(loadIntoBuffer);},500); - } else { - this.hideProgressIndicator(); - } - imageReloadTries = imageReloadTries + 1; - return; - } - var id; - - _this.hideProgressIndicator(); - if (loadIntoBuffer) { - imageLoadingPane.src = imageBuffer.src; - } else { - imagePane.src = imageBuffer.src; - - } - // do a cross fade as long as the images aren't the same - if (imageLoadingPane.src != imagePane.src) { - crossFade(0,loadIntoBuffer ); - } - } - - - this.showImage = function(itemId) { - - _this.showProgressIndicator(); - //setTimeout(this.showProgressIndicator,0); - var i = map.get(itemId); - - if (!i) { - return; - } - dojo.event.topic.publish("/catalog", {type:"showingItem", id: itemId, rating: i.rating}); - // create the image pane and append the description nodes - // asumption is that if the imagePane is not set neigher are the info children - if (typeof imagePane == 'undefined') { - imagePane = document.createElement("img"); - imagePane.style.width = IMAGEPANE_WIDTH + "px"; - imagePane.style.height = IMAGEPANE_HEIGHT + "px"; - imagePane.id = IMAGE_PANE_ID; - - var targetElement = document.getElementById("bodySpace"); - imageLoadingPane = document.createElement("img"); - imageLoadingPane.style.position = "absolute"; - imageLoadingPane.style.visibility = "hidden"; - imageLoadingPane.style.width = IMAGEPANE_WIDTH + "px"; - imageLoadingPane.style.height = IMAGEPANE_HEIGHT + "px"; - imageLoadingPane.id = IMAGE_PANE_BUFFER_ID; - targetElement.appendChild(imagePane); - targetElement.appendChild(imageLoadingPane); - imageLoadingPane.style.left = tileX + "px"; - - loadImage(i.image, false); - } else { - imageLoadingPane.style.visibility = "visible"; - if (showingBuffer) { - showingBuffer = false; - } else { - showingBuffer = true; - } - loadImage(i.image, showingBuffer); - } - } - - function loadImage(url, loadIntoBuffer) { - imageReloadTries = 0; - imageBuffer = new Image(); - if (loadIntoBuffer) { - imageBuffer.src = url; - imageLoadingPane.onLoad = setTimeout(function(){this.url=url;this.loadIntoBuffer = loadIntoBuffer;postImageLoad(loadIntoBuffer,url);},0); - } else { - imageBuffer.src = url; - imageBuffer.onLoad = setTimeout(function(){this.url = url;this.loadIntoBuffer = loadIntoBuffer;postImageLoad(loadIntoBuffer,url);},0); - } - } - - function setOpacity(opacity, id) { - var target = document.getElementById(id); - if (typeof target.style.filter != 'undefined') { - target.style.filter = "alpha(opacity:" + opacity + ")"; - } else { - target.style.opacity = opacity/100; - } - } - - function crossFade(count,loadIntoBuffer) { - var percentage = Number(count); - if (loadIntoBuffer) { - setOpacity(100 - percentage, IMAGE_PANE_ID); - setOpacity(percentage, IMAGE_PANE_BUFFER_ID); - } else { - setOpacity(100 - percentage, IMAGE_PANE_BUFFER_ID); - setOpacity(percentage, IMAGE_PANE_ID); - - } - if (percentage < 100) { - percentage = percentage + 10; - setTimeout(function(){this.loadIntoBuffer = loadIntoBuffer;this.percentage = percentage;crossFade(percentage,loadIntoBuffer);}, 25); - } - } - - - // calling this function will result in the maximizing event being fired - // if the pane is maximized it will asume the event want to minimize - this.doMaximize = function() { - if (!maximizing && !minimizing && !maximized) { - infoPaneLoop = INFOPANE_DEFAULT_HEIGHT; - maximizing = true; - minimizing = false; - } else if (!maximizing && !minimizing) { - minimizing = true; - maximizing = false; - } - setTimeout(changeInfoPane, 0); - } - - // will handle either minimizing or maximing but not both - // this method is called recursively until the maximinging - // or minimizing is done. - function changeInfoPane() { - if (maximizing) { - maxmizeInfoPane(); - } else if (minimizing) { - minimizeInfoPane(); - } - } - - function maxmizeInfoPane() { - if (infoPaneLoop < INFOPANE_EXPAND_HEIGHT) { - infoPaneLoop = infoPaneLoop + INFOPANE_INCREMENT; - var clipMe = 'rect(' + '0px,' + VIEWPORT_WIDTH + 'px,'+ infoPaneLoop +'px,' + 0 + 'px)'; - infoPane.style.clip = clipMe; - infoPane.style.height = infoPaneLoop; - infoPane.style.top = (tileY + (PADDING *2) + INFOPANE_DEFAULT_HEIGHT + IMAGEPANE_HEIGHT) - infoPaneLoop; - setTimeout(changeInfoPane, 5); - } else { - minimizeImage.src= MINIMIZE_IMG_URI; - minimizeLink.title = MINIMIZE_IMG_TOOLTIP; - maximized = true; - maximizing = false; - minimizing = false; - } - } - - function minimizeInfoPane() { - if (infoPaneLoop > INFOPANE_DEFAULT_HEIGHT) { - infoPaneLoop = infoPaneLoop - INFOPANE_INCREMENT; - var clipMe = 'rect(' + '0px,' + VIEWPORT_WIDTH + 'px,'+ infoPaneLoop +'px,' + 0 + 'px)'; - infoPane.style.clip = clipMe; - infoPane.style.height = infoPaneLoop; - infoPane.style.top = (tileY + (PADDING *2) + INFOPANE_DEFAULT_HEIGHT + IMAGEPANE_HEIGHT) - infoPaneLoop; - if (debug) { - status2Div.innerHTML = "minimize infoPaneLoop =" + infoPaneLoop + " infopane.top=" + infoPane.style.top; - } - setTimeout(changeInfoPane, 5); - } else { - minimizeImage.src= MAXIMIZE_IMG_URI; - minimizeLink.title = MAXIMIZE_IMG_TOOLTIP; - maximizing = false; - minimizing = false; - maximized = false; - } - } - - function scrollRight() { - isScrollingRight = true; - if ( (index + 4) >= tiles.length) { - // hide the rightButton - rightButton.style.visibility="hidden"; - return; - } else { - leftButton.style.visibility="visible"; - } - offset = offset - SCROLL_INCREMENT; - drawTiles(); - setTimeout(scroll, timeout); - } - - function getNext() { - isScrollingRight = true; - setTimeout(scroll, timeout); - } - - - function getPrevious () { - isScrollingLeft = true; - setTimeout(scroll, timeout); - } - - function scrollLeft() { - if (offset >= 0) { - leftButton.style.visibility="hidden"; - return; - } else { - leftButton.style.visibility="visible"; - } - offset = offset + SCROLL_INCREMENT; - drawTiles(); - setTimeout(scroll, timeout); - } - - function drawTiles() { - // draw the first one if its off the screen - // check if the far right image is out view - var overHang; - var temp = offset; - index = Math.floor((offset)/THUMB_WIDTH); - overHang = offset % THUMB_WIDTH; - if (overHang < 0) { - overHang = overHang * -1; - } - if (index < 0) { - index = index * -1; - } - // check for next set of images - prefetch(); - var startIndex = index; - if (overHang > 0 && index >0) { - startIndex = index -1; - } - var stopIndex = index + Math.round(VIEWPORT_WIDTH / THUMB_WIDTH); - if (stopIndex > tiles.length) { - stopIndex = tiles.length; - } - var displayX = 0; - for (var tl=startIndex; tl < stopIndex; tl++) { - if (debug) { - statusDiv.innerHTML = "overhang=" + overHang + " startIndex=" + startIndex + " stopIndex=" + stopIndex + " offset=" + offset + " displayX=" + displayX; - } - if (overHang > 0 && tl == startIndex) { - rightButton.style.visibility="visible"; - // clip: rect(top right bottom left) - borders of the clipped area - // clip the left - var clipMe = 'rect(' + '0px,' + THUMB_WIDTH + 'px,'+ THUMB_HEIGHT +'px,' + overHang + 'px)'; - tiles[tl].style.clip = clipMe; - tiles[tl].style.left = (tileX - overHang) + "px"; - displayX = displayX + (THUMB_WIDTH - overHang); - } else if (tl == stopIndex -1) { - var underHang = VIEWPORT_WIDTH - displayX ; - if (underHang > 0 && underHang) { - var clipMe = 'rect(' + '0px,' + (underHang) + "px," + THUMB_HEIGHT +'px,' + 0 + 'px)'; - tiles[tl].style.clip = clipMe; - tiles[tl].style.left = tileX + (offset + (tl * THUMB_WIDTH)) + 'px'; - tiles[tl].style.visibility = "visible"; - // resize the previous one to its real length - } else if (underHang < 0 && tl > 0) { - var clipMe = 'rect(' + '0px,' + (THUMB_WIDTH + underHang) + "px," + THUMB_HEIGHT +'px,' + 0 + 'px)'; - tiles[tl-1].style.clip = clipMe; - tiles[tl-1].style.visibility = "visible"; - tiles[tl-1].style.left = tileX + (offset + ((tl -1) * THUMB_WIDTH)) + 'px'; - } else { - tiles[tl].style.left = '0px'; - tiles[tl].style.visibility = "hidden"; - } - } else { - displayX = displayX + THUMB_WIDTH; - tiles[tl].style.left = tileX + (offset + (tl * THUMB_WIDTH)) + 'px'; - tiles[tl].style.visibility = "visible"; - } - } - if (stopIndex < tiles.length) { - tiles[stopIndex].style.visibility = "hidden"; - tiles[stopIndex].style.left = "0px"; - } - } - - - this.load = function () { - map = new Map(); - dojo.event.connect(window, "onresize", layout); - var loadImage; - - var targetRow = document.getElementById("targetRow"); - injectionPoint = document.getElementById("injection_point"); - - // for status output - statusDiv = document.getElementById("status"); - status2Div = document.getElementById("status_2"); - - initLayout(); - initialized = true; - } - - function initLayout() { - containerDiv = document.getElementById("CatalogBrowser"); - rightButton = document.getElementById("right_button"); - leftButton = document.getElementById("left_button"); - layout(); - leftButton.style.visibility="hidden"; - if (typeof rightButton.attachEvent != 'undefined') { - rightButton.attachEvent('onmouseover',function(e){scrollDone();getNext();}); - rightButton.attachEvent('onmouseout',function(e){scrollDone();}); - leftButton.attachEvent('onmouseover',function(e){scrollDone();getPrevious();}); - leftButton.attachEvent('onmouseout',function(e){scrollDone();}); - } else if (typeof rightButton.addEventListener != 'undefined') { - rightButton.addEventListener('mouseover',function(e){scrollDone();getNext();}, false); - rightButton.addEventListener('mouseout',function(e){scrollDone();}, false); - leftButton.addEventListener('mouseover',function(e){scrollDone();getPrevious();}, false); - leftButton.addEventListener('mouseout',function(e){scrollDone();}, false); - } - createInfoPane(); - } - - function layout() { - var ua = navigator.userAgent.toLowerCase(); - - // this will need to be made generic depending on the thumb height - tileY = findY(containerDiv); - tileX = findX(containerDiv) + 4; - var rightX = tileX + VIEWPORT_WIDTH - 20; - rightButton.style.left = rightX + "px"; - var buttonY = tileY + IMAGEPANE_HEIGHT + INFOPANE_DEFAULT_HEIGHT + 12; - rightButton.style.top = buttonY + "px"; - leftButton.style.top = buttonY + "px"; - - if (ua.indexOf('ie') != -1) { - isIE = true; - } else if (ua.indexOf('safari') != -1) { - tileX = tileX + 8; - timeout = 20; - } - drawTiles(); - if (infoPane) { - infoPane.style.left = tileX + "px"; - if (maximized) { - - infoPane.style.top = (tileY + IMAGEPANE_HEIGHT + (PADDING*2) - infoPane.style.height) + "px"; - } else { - infoPane.style.top = (tileY + IMAGEPANE_HEIGHT + (PADDING*2)) + "px"; - } - if (maximized) { - infoPaneLoop = infoPane.style.height; - } else { - infoPaneLoop = INFOPANE_DEFAULT_HEIGHT; - } - } - if (typeof imageLoadingPane != 'undefined') { - imageLoadingPane.style.left = tileX; - imageLoadingPane.style.top = tileY; - } - } - - function createInfoPane() { - infoPane = document.getElementById("infopane"); - infoPane.style.width = VIEWPORT_WIDTH + "px"; - // give room for 4 pixels above and below - infoPane.style.height = (INFOPANE_DEFAULT_HEIGHT) + "px"; - // give 3px padding for a border - infoPane.style.top = (tileY + IMAGEPANE_HEIGHT + (PADDING*2)) + "px"; - infoPane.style.left = tileX + "px"; - infoTableMinimize = document.getElementById("infopaneDetailsIcon"); - indicatorCell = document.getElementById("infopaneIndicator"); - indicatorCell.style.width = (10) + "px"; - indicatorImage = document.createElement("img"); - indicatorImage.className = "infopaneIndicator"; - indicatorImage.src = INDICATOR_IMG_URI; - indicatorImage.style.visibility = "hidden"; - indicatorCell.appendChild(indicatorImage); - minimizeLink = document.createElement("a"); - minimizeLink.className = "infopaneLink"; - minimizeLink.title = MAXIMIZE_IMG_TOOLTIP; - minimizeImage = document.createElement("img"); - minimizeImage.src= MAXIMIZE_IMG_URI; - minimizeLink.appendChild(minimizeImage); - infoTableMinimize.appendChild(minimizeLink); - - if (typeof minimizeLink.attachEvent != 'undefined') { - minimizeLink.attachEvent("onclick",function(e){_this.doMaximize();}); - } else { - minimizeLink.addEventListener("click",function(e){_this.doMaximize();}, true); - } - var clipMe = 'rect(' + '0px,' + VIEWPORT_WIDTH + 'px,'+ INFOPANE_DEFAULT_HEIGHT +'px,' + 0 + 'px)'; - infoPane.style.clip = clipMe; - } - - function createTile(i) { - var div = document.createElement("div"); - div.className = "tile"; - div.id = i.id; - var link = document.createElement("a"); - var img = document.createElement("img"); - img.title = i.name; - img.src = i.thumbnail; - img.className = "tileImage"; - link.appendChild(img); - link.setAttribute("id", i.id); - if (typeof div.attachEvent != 'undefined') { - div.attachEvent('onclick',function(e){this.id = div.id; _this.showImage(this.id, false);}); - } else { - link.addEventListener('click',function(e){this.id = div.id; _this.showImage(this.id, false);}, true); - } - div.appendChild(link); - injectionPoint.appendChild(div); - div.style.top = tileY + INFOPANE_DEFAULT_HEIGHT + IMAGEPANE_HEIGHT + (PADDING * 3) + "px"; - tiles.push(div); - } - - - function findY(element) { - var t = 0; - if (element.offsetParent) { - while (element.offsetParent) { - t += element.offsetTop - element = element.offsetParent; - } - } else if (element.y) { - t += element.y; - } - return t; - } - - function findX(element) { - var l = 0; - if (element.offsetParent) { - while (element.offsetParent) { - l += element.offsetLeft - element = element.offsetParent; - } - } else if (element.x) - l += element.x; - return l; - } -} diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/search.jsp b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/search.jsp deleted file mode 100644 index e12d666..0000000 --- a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/search.jsp +++ /dev/null @@ -1,290 +0,0 @@ -<%-- Copyright 2006 Sun Microsystems, Inc. All rights reserved. You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at: http://developer.sun.com/berkeley_license.html -$Id: search.jsp,v 1.28 2006/12/04 21:34:10 basler Exp $ --%> - -<%@page contentType="text/html"%> -<%@page pageEncoding="UTF-8"%> -<%@page import="java.util.*, com.sun.javaee.blueprints.petstore.search.*"%> -<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@taglib uri="http://java.sun.com/jsf/html" prefix="h" %> -<%@taglib uri="http://java.sun.com/jsf/core" prefix="f" %> -<%@taglib prefix="ui5" uri="http://java.sun.com/blueprints/ui" %> - - -<html> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> - <title>Search Page</title> - <style> - .itemTable { - padding: 0.3cm; - width: 800px; - border-style: double; - border-color: darkgreen; - } - .itemCell { - border-style: solid; - border-color: darkgreen; - border-width: thin; - padding: 5px - } - .tagDiv { - border-style: groove; - border-color: darkgreen; - background-color: white; - border-width: thick; - padding: 5px; - visibility: hidden; - position:absolute; - left:0px; - top:0px; - z-index: 3; - } - </style> - <script type="text/javascript" src="common.js"></script> - </head> - <body> - <jsp:include page="banner.jsp" /> - <center> - - <script type="text/javascript"> - function checkAll() { - var elems=dojo.byId("resultsForm").elements; - for(ii=0; ii < elems.length; ii++) { - if(elems[ii].name.indexOf("mapSelectedItems") >= 0) { - elems[ii].checked=true; - } - } - return false; - } - - function uncheckAll() { - var elems=dojo.byId("resultsForm").elements; - for(ii=0; ii < elems.length; ii++) { - if(elems[ii].name.indexOf("mapSelectedItems") >= 0) { - elems[ii].checked=false; - } - } - return false; - } - - function addTags(eventx, namex, itemIdx) { - var xx=0; - var yy=0; - if (!eventx) var eventx=window.event; - if (eventx.pageX || eventx.pageY){ - xx=eventx.pageX; - yy=eventx.pageY; - } else if (eventx.clientX || eventx.clientY) { - xx=eventx.clientX + document.body.scrollLeft; - yy=eventx.clientY + document.body.scrollTop; - } - divId="addTags"; - document.getElementById("addTagsItemId").value=itemIdx; - document.getElementById("addTagsTags").value=""; - document.getElementById("addTagsTitle").innerHTML="<b>Add Tags to '" + namex + "'</b>"; - document.getElementById(divId).style.left=(xx - 170) + "px"; - document.getElementById(divId).style.top=(yy - 140) + "px"; - document.getElementById(divId).style.visibility='visible'; - document.getElementById("addTagsTags").focus(); - } - - function saveAddTags() { - // get data and send to controller servlet - itemIdx=document.getElementById("addTagsItemId").value; - tagsx=document.getElementById("addTagsTags").value; - var bindArgs = { - url: "../TagServlet?itemId=" + escape(itemIdx) + "&tags=" + escape(tagsx), - mimetype: "text/xml", - error: ajaxBindError, - load: function(type, data, evt){ - // check successful response - if (evt.readyState == 4) { - if (evt.status == 200) { - // get results and replace dom elements - var resultx=data.getElementsByTagName("response")[0]; - itemIdx=resultx.getElementsByTagName("itemId")[0].childNodes[0].nodeValue; - - // change DOM data - document.getElementById("ITEMID_TAGS_" + itemIdx).innerHTML=resultx.getElementsByTagName("tags")[0].childNodes[0].nodeValue; - - } else if (evt.status == 204){ - alert("204 return"); - } - } - } - }; - - dojo.io.bind(bindArgs); - // make sure it was updated - - // show messages if error - - // hide popup - document.getElementById(divId).style.visibility='hidden'; - } - - function cancelAddTags() { - // hide popup - document.getElementById(divId).style.visibility='hidden'; - } - - </script> - - <f:view> - - <ui5:popupTag id="pop1" xmlHttpRequestURL="../lookup.jsp?popupView=2&itemId=" - elementNamePairs="name=value1,description=value2,price=value3,image=imageId"> - <!-- Used as spaces to center the table, this could be done programmatically, - but browser diff, so I left it in the hands of the component user. The image is located - in the component jar so for retrieval, push it through the faces servlet --> - <img id="spaceImage" height="10px" width="3px" src="${pageContext.request.contextPath}/faces/static/META-INF/popup/images/spacer.gif" align="left"> - <table border="0" width="270px" bgcolor="#ffffff" cellpadding="5" cellspacing="5"> - <tr> - <td align="left" valign="top"><b>Name:</b> - <span id="value1">Loading Data...</span></td> - </tr> - <tr> - <td align="left" valign="top"><b>Seller Address:</b> - <span id="value2">Loading Data...</span></td> - </tr> - <tr> - <td align="left" valign="top"><b>Price:</b> - <span id="value3">Loading Data...</span></td> - </tr> - <tr> - <td colspan="2" align="center"><img name="image" id="imageId" src="" - alt="[Loading Image...]" border="2"/><br/><br/></td> - </tr> - </table> - </ui5:popupTag> - - <h1>Search Page</h1> - <h:form id="searchForm"> - <table class="itemTable" style="width: 700px"> - <tr> - <th class="itemCell">Search String</th> - <td class="itemCell"> - <h:inputText size="50" id="searchString" value="#{SearchBean.searchString}"/> - Also Search Tags:<h:selectBooleanCheckbox id="searchTags" value="#{SearchBean.searchTags}"/> - </td> - </tr> - <tr> - <td class="itemCell" align="center" colspan="2"> - <h:commandButton action="#{SearchBean.searchAction}" id="searchSubmit" type="submit" value="Submit"/> - <h:commandButton id="searchReset" type="reset" value="Reset"/> - </td> - </tr> - </table> - <h:messages/> - </h:form> - <br/> - - - - <h:form id="resultsForm" rendered="#{SearchBean.showResults}"> - <table class="itemTable"> - <tr> - <th class="itemCell"> - Map - <br/> - <img src="../images/check_all.gif" onclick="return checkAll()"/><img src="../images/uncheck_all.gif" onclick="return uncheckAll()"/> - </th> - <th class="itemCell">Name</th> - <th class="itemCell">Description</th> - <th class="itemCell">Tags</th> - <th class="itemCell">Price</th> - </tr> -<% -SearchBean searchBean=(SearchBean)session.getAttribute("SearchBean"); -if(searchBean != null) { - List<IndexDocument> hits=searchBean.getHits(); - if(hits != null) { - for(IndexDocument indexDoc : hits) { -%> - <tr> - <td class="itemCell"> - <input type="checkbox" name="mapSelectedItems" value="<%= indexDoc.getUID() %>"/> - </td> - <td class="itemCell"> - <a href="${pageContext.request.contextPath}/faces/catalog.jsp?pid=<%= indexDoc.getProduct() %>&itemId=<%= indexDoc.getUID() %>" - onmouseover="bpui.popup.show('pop1', event, '<%= indexDoc.getUID() %>')" onmouseout="bpui.popup.hide('pop1')"> - <%= indexDoc.getTitle() %> - </a> - </td> - <td class="itemCell"> - <%= indexDoc.getSummary() %> - </td> - <td class="itemCell"> - <span id="ITEMID_TAGS_<%= indexDoc.getUID() %>"><%= (indexDoc.getTag().equals("") ? " " : indexDoc.getTag()) %></span> - <br/><input type="button" value="Add Tags" onclick="addTags(event, '<%= indexDoc.getTitle() %>', '<%= indexDoc.getUID() %>')"/> - </td> - <td class="itemCell"> - <%= indexDoc.getPriceDisplay() %> - </td> - </tr> -<% - } - } -} -%> - <tr> - <td colspan="5"> - <br/> - <center> - <table class="itemTable"> - <tr> - <th align="right">Center Point Address:</th> - <td> - <h:inputText id="centerAddress" value="#{MapBean.centerAddress}" size="50"/> - <br/><small><i>For example: 4140 Network Circle, Santa Clara, CA, 95054</i></small> - </td> - </tr> - <tr> - <th align="right">Area (in Miles):</th> - <td> - <h:inputText id="radius" value="#{MapBean.radius}" size="5"/> - </td> - </tr> - <tr> - <td align="center" colspan="2"> - <h:commandButton action="#{MapBean.findAllByIDs}" id="mapSubmit" type="submit" - value="Map Checked Item(s)" rendered="#{SearchBean.showResults}"/> - </td> - </tr> - </table> - </center> - <br/> - </td> - </tr> - </table> - - <h:messages/> - </h:form> - <br/><br/><br/> - <div class="tagDiv" id="addTags"> - <form> - <table> - <tr> - <td align="center"> - <span id="addTagsTitle"><b>Tag Title</b></span><br/><i>(seperated by spaces)</i> - </td> - </tr> - <tr> - <td align="center"> - <input id="addTagsTags" type="text" size="50"/> - </td> - </tr> - <tr> - <td align="center"> - <input type="button" value="Save" onclick="saveAddTags()"/> <input type="button" value="Cancel" onclick="cancelAddTags()"/> - </td> - </tr> - </table> - <input type="hidden" id="addTagsItemId"/> - </form> - </div> - </f:view> - </center> - <jsp:include page="footer.jsp" /> - </body> -</html> diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/styles.css b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/styles.css deleted file mode 100644 index 24ffbf9..0000000 --- a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/styles.css +++ /dev/null @@ -1,130 +0,0 @@ - -.dojoHtmlFisheyeListBar { - cursor:pointer; - margin: 0; - width: 300px; - text-align: right; -} - -.outerbar { - background-color: white; - text-align: left; - width: 300px; -} - -.editText { - height:25; - font-size:18px; - font-weight: bold; - font-family: Arial; -} - -.plainText { - height:25; - font-size:20px; - font-weight: bold; - font-family: Arial -} - -.plainTextSelect { - height:25; - font-size:20px; - font-weight: bold; - font-family: Arial; - background: red -} - -.smallText { - height:15; - font-size:13px; - font-weight: bold; - font-family: Arial -} - -.banner { - height:35; - font-size:35; - font-weight: bold; - font-family: Arial -} - - -.menuItem { - background: white; - color: black; - text-decoration: none; - font-size: 1.4em; -} - -.menuLink { - cursor:pointer; - color: black; - text-decoration: none; - font-size: 1.3em; -} - -.menuLinkHover { - cursor:pointer; - color: black; - font-size: 1.3em; - text-decoration: underline; -} - -.autocomplete { - position:absolute; -} - -.autocompleteTable { - padding:0; - visibility: hidden; - border-spacing: 0; - border-width:1px; - border-style:solid; - border-color:black; -} - -.popupRowHover { - color: #FFFAFA; - cursor:pointer; - padding-left:3; - padding-right:3; - border-spacing: 0; - border-width:0px; - background: #7A8AFF; -} - -.popupRow { - padding-left:3; - padding-right:3; - border-spacing: 0; - border-width:0px; - background: #FFFAFA; -} - -.popupRowEven { - padding-left:3; - padding-right:3; - border-spacing: 0; - border-width:0px; - background: #FFFADA; -} - -.popupItem { - background: #FFFAFA; - color: #000000; - text-decoration: none; - font-size: 1.2em; -} - -.shadow { - top:0px; - left:0px; - position: absolute; - visibility: hidden; - width:0; - height:0; - z-index:0; - background:gray; - opacity: .5; -} - diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/systemerror.jsp b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/systemerror.jsp deleted file mode 100644 index c7a5309..0000000 --- a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/systemerror.jsp +++ /dev/null @@ -1,28 +0,0 @@ -<%-- Copyright 2006 Sun Microsystems, Inc. All rights reserved. You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at: http://developer.sun.com/berkeley_license.html -$Id: systemerror.jsp,v 1.3 2007/01/09 19:02:12 basler Exp $ --%> -<%@ page isErrorPage="true" %> -<%@ page import="com.sun.javaee.blueprints.petstore.util.PetstoreUtil, java.util.logging.Level" %> -<% -PetstoreUtil.getLogger().log(Level.INFO, "Encountered a Runtime Exception and being transferred the the systemerror page", exception); -%> -<html> - <head> - <meta http-equiv="Content-Type" content="text/html;charset=utf-8" > - <title>Java Pet Store Reference Application: System Error Page</title> - </head> - <body> - - <jsp:include page="banner.jsp" /> - - <h2>System Error !</h2> - <p>We had problems processing your request. An exception has been caught, - so perhaps your application was not set up or deployed properly.</p> - - The Exception that was thrown is:<b> <%= exception.toString() %></b>. The server log will contain the stack trace of the exception. - - <p><a href="${pageContext.request.contextPath}/faces/index.jsp">Go back to sample application home</a></p> - <br/><br/> - <jsp:include page="footer.jsp" /> - - </body> -</html> diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/tag.css b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/tag.css deleted file mode 100644 index bfbab6e..0000000 --- a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/tag.css +++ /dev/null @@ -1,47 +0,0 @@ - .itemTable { - padding: 0.3cm; - border-style: double; - width: 800px; - border-color: darkgreen; - } - .itemCell { - border-style: solid; - border-color: darkgreen; - border-width: thin; - padding: 5px - } - .tagCell { - padding: 0.3cm; - } - .xxlarge - { - font-size: xx-large; - color: red; - cursor: pointer; - text-decoration: underline; - } - .xlarge - { - font-size: x-large; - color: blue; - cursor: pointer; - text-decoration: underline; - } - .large - { - font-size: large; - color: green; - cursor: pointer; - text-decoration: underline; - } - .medium - { - font-size: medium; - cursor: pointer; - color: black; - text-decoration: underline; - } - .items - { - visibility: hidden; - } diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/tag.jsp b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/tag.jsp deleted file mode 100644 index f9c74f3..0000000 --- a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/tag.jsp +++ /dev/null @@ -1,158 +0,0 @@ -<%-- Copyright 2006 Sun Microsystems, Inc. All rights reserved. You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at: http://developer.sun.com/berkeley_license.html -$Id: tag.jsp,v 1.11 2007/01/17 18:00:09 basler Exp $ --%> - -<%@page contentType="text/html"%> -<%@page pageEncoding="UTF-8"%> -<%@page import="java.util.*, com.sun.javaee.blueprints.petstore.model.CatalogFacade, com.sun.javaee.blueprints.petstore.model.Tag"%> -<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@taglib uri="http://java.sun.com/jsf/html" prefix="h" %> -<%@taglib uri="http://java.sun.com/jsf/core" prefix="f" %> -<%@taglib prefix="ui5" uri="http://java.sun.com/blueprints/ui" %> - - -<html> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> - <title>Tag Page</title> - <script type="text/javascript" src="./common.js"></script> - <link type="text/css" rel="stylesheet" href="./tag.css"/> -<% -try { - CatalogFacade cf = (CatalogFacade)config.getServletContext().getAttribute("CatalogFacade"); - List<Tag> tags=cf.getTagsInChunk(0, 90); - // since top 20 come from database or desending refCount order, need to reorder by tag name - Collections.sort(tags, new Comparator() { - public int compare(Object one, Object two) { - return ((Tag)one).getTag().compareTo(((Tag)two).getTag()); - } - }); -%> - <script language="javascript"> - function retrieveItems(tag) { - var bindArgs = { - // url when using the jsp to serve the ajax request - url: "../tagItemLookup.jsp?tag=" + escape(tag), - mimetype: "text/xml", - load: returnFunctionx, - error: ajaxBindError}; - - // dispatch the request - dojo.io.bind(bindArgs); - } - - - function returnFunctionx(type, data, evt) { - // statically setup popup for simple case - var componentId="displayItems"; - // check return of the dojo call to make sure it is valid - if (evt.readyState == 4) { - if (evt.status == 200) { - // get results and replace dom elements - var itemsx=data.getElementsByTagName("item"); - display="<table class='itemTable'><tr><td class='itemCell' align='center' colspan='4'><h2>Tag: " + - data.getElementsByTagName("tag")[0].childNodes[0].nodeValue + - "</h2></td></tr><tr><th class='itemCell'>Name</th><th class='itemCell'>Description</th><th class='itemCell'>Tags</th><th class='itemCell'>Price</th></tr>" - for(ii=0; ii < itemsx.length; ii++) { - display += "<tr>"; - display +="<td class='itemCell'><a href='./catalog.jsp?pid="+ itemsx[ii].getElementsByTagName("productID")[0].childNodes[0].nodeValue +"&itemId=" + - itemsx[ii].getElementsByTagName("itemID")[0].childNodes[0].nodeValue + "' onmouseover='bpui.popup.show("pop1", event, "" + - itemsx[ii].getElementsByTagName("itemID")[0].childNodes[0].nodeValue + "")' onmouseout='bpui.popup.hide("pop1")'>" + - itemsx[ii].getElementsByTagName("name")[0].childNodes[0].nodeValue +"</a></td>"; - display +="<td class='itemCell'>" + itemsx[ii].getElementsByTagName("description")[0].childNodes[0].nodeValue +"</td>"; - display +="<td class='itemCell'>" + itemsx[ii].getElementsByTagName("tags")[0].childNodes[0].nodeValue +"</td>"; - display +="<td class='itemCell' style='text-align: right'>" + itemsx[ii].getElementsByTagName("price")[0].childNodes[0].nodeValue +"</td>"; - display +="</tr>"; - } - display += "</table>"; - document.getElementById(componentId).innerHTML=display; - document.getElementById(componentId).style.visibility='visible'; - } else if (evt.status == 204){ - alert("204 return"); - } - } - } - - - function checkQueryString() { - <!-- add script to check for tag in query string, if exists then retrieve data --> - var iPos=window.location.href.indexOf("?tag="); - if(iPos > -1) { - // have tag so retrieve items - retrieveItems(window.location.href.substr(iPos + 5)); - } - } - - </script> - </head> - <body onload="checkQueryString();"> - <jsp:include page="banner.jsp" /> - <f:view> - - <ui5:popupTag id="pop1" xmlHttpRequestURL="../lookup.jsp?popupView=2&itemId=" - elementNamePairs="name=value1,description=value2,price=value3,image=imageId"> - <!-- Used as spaces to center the table, this could be done programmatically, - but browser diff, so I left it in the hands of the component user. The image is located - in the component jar so for retrieval, push it through the faces servlet --> - <img id="spaceImage" height="10px" width="10px" src="${pageContext.request.contextPath}/faces/static/META-INF/popup/images/spacer.gif" align="left"> - <table border="0" width="270px" bgcolor="#ffffff" cellpadding="5" cellspacing="5"> - <tr> - <td align="left" valign="top"><b>Name:</b> - <span id="value1">Loading Data...</span></td> - </tr> - <tr> - <td align="left" valign="top"><b>Seller Address:</b> - <span id="value2">Loading Data...</span></td> - </tr> - <tr> - <td align="left" valign="top"><b>Price:</b> - <span id="value3">Loading Data...</span></td> - </tr> - <tr> - <td colspan="2" align="center"><img name="image" id="imageId" src="" - alt="[Loading Image...]" border="2"/><br/><br/></td> - </tr> - </table> - </ui5:popupTag> - <center> - <h1>Tag Page</h1> - <table border="0"> - <tr> -<% - String style=null; - int refx=0, ii=0; - for(Tag tag : tags) { - refx=tag.getRefCount() / 5; - if(refx >= 3) { - style="xxlarge"; - } else if(refx == 2) { - style="xlarge"; - } else if(refx == 1) { - style="large"; - } else { - style="medium"; - } - - if((ii % 6) == 0) out.println("</tr>\n<tr>"); - //out.println("<td class='tagCell'><span onclick="retrieveItems('" + tag.getTag() + "')" class='" + style +"'>" + tag.getTag() + "</span> (" + tag.getRefCount() + ")</td>"); - out.println("<td class='tagCell'><span onclick="retrieveItems('" + tag.getTag() + "')" class='" + style +"'>" + tag.getTag() + "</span></td>"); - ii++; - } -%> - </tr> - </table> - <div id="displayItems" class="items"> - - </div> - </center> - </f:view> - <br/><br/><br/><br/> - <jsp:include page="footer.jsp" /> - - </body> -</html> - -<% - } catch(Exception e) { - e.printStackTrace(); - } -%> diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/tagItemLookup.jsp b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/tagItemLookup.jsp deleted file mode 100644 index 05ef352..0000000 --- a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/tagItemLookup.jsp +++ /dev/null @@ -1,45 +0,0 @@ -<%-- Copyright 2006 Sun Microsystems, Inc. All rights reserved. You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at: http://developer.sun.com/berkeley_license.html -$Id: tagItemLookup.jsp,v 1.4 2007/01/19 21:47:31 basler Exp $ --%> - -<%@page contentType="text/xml"%> -<%@page pageEncoding="UTF-8"%> -<%@page import="java.util.*, java.text.NumberFormat, com.sun.javaee.blueprints.petstore.model.CatalogFacade, com.sun.javaee.blueprints.petstore.model.Item, com.sun.javaee.blueprints.petstore.model.Tag"%> - -<% - String sxTag=request.getParameter("tag"); - - try { - response.setHeader("Pragma", "No-Cache"); - response.setHeader("Cache-Control", "no-cache,no-store,max-age=0"); - response.setDateHeader("Expires", 1); - - ServletContext context=config.getServletContext(); - CatalogFacade cf=(CatalogFacade)context.getAttribute("CatalogFacade"); - Tag tag=cf.getTagWithPersistentItems(sxTag); - out.println("<response>"); - - if(tag != null) { - out.println("<tag>" + tag.getTag() + "</tag>"); - out.println("<items>"); - Collection<Item> items=tag.getItems(); - for(Item item : items) { - if(item.getDisabled() == 0) { - out.println("<item>"); - out.println("<itemID>" + item.getItemID() + "</itemID>"); - out.println("<productID>" + item.getProductID() + "</productID>"); - out.println("<name><![CDATA[" + item.getName() + "]]></name>"); - out.println("<description><![CDATA[" + item.getDescription() + "]]></description>"); - out.println("<tags><![CDATA[" + item.tagsAsString() + "]]></tags>"); - out.println("<price><![CDATA[" + NumberFormat.getCurrencyInstance(java.util.Locale.US).format(item.getPrice()) + "]]></price>"); - out.println("</item>"); - } - } - out.println("</items>"); - } - out.println("</response>"); - out.flush(); - } catch(Exception ee) { - ee.printStackTrace(); - } - -%> diff --git a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/testis.jsp b/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/testis.jsp deleted file mode 100644 index e5dd68a..0000000 --- a/etc/samples/sample-bundle/src/main/petstore/server/default/deploy/petstore.ear/petstore.war/testis.jsp +++ /dev/null @@ -1,36 +0,0 @@ -<%@page contentType="text/html"%> -<%@page pageEncoding="UTF-8"%> -<%-- -The taglib directive below imports the JSTL library. If you uncomment it, -you must also add the JSTL library to the project. The Add Library... action -on Libraries node in Projects view can be used to add the JSTL 1.1 library. ---%> -<%-- -<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> ---%> - -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" - "http://www.w3.org/TR/html4/loose.dtd"> - -<html> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> - <title>JSP Page</title> - </head> - <body> - - <h1>JSP Page</h1> - - <%-- - This example uses JSTL, uncomment the taglib directive above. - To test, display the page like this: index.jsp?sayHello=true&name=Murphy - --%> - <%-- - <c:if test="${param.sayHello}"> - <!-- Let's welcome the user ${param.name} --> - Hello ${param.name}! - </c:if> - --%> - - </body> -</html> diff --git a/etc/samples/sample-bundle/src/main/scripts/assembly.xml b/etc/samples/sample-bundle/src/main/scripts/assembly.xml deleted file mode 100644 index 942e5f9..0000000 --- a/etc/samples/sample-bundle/src/main/scripts/assembly.xml +++ /dev/null @@ -1,41 +0,0 @@ -<?xml version="1.0"?> - -<!-- $Id$ --> - -<assembly> - <!-- The id gets appended to the end of the zipfile name unless - it's an empty string, so make it an empty string. --> - <id></id> - <formats> - <format>zip</format> - </formats> - <includeBaseDirectory>false</includeBaseDirectory> - <baseDirectory>target/bundle</baseDirectory> - <fileSets> - <fileSet> - <directory>target/bundle</directory> - <outputDirectory>/</outputDirectory> - <includes> - <include>**/*</include> - </includes> - <excludes> - <exclude>**/*.sh</exclude> - <exclude>**/*.so</exclude> - <exclude>**/*.sl</exclude> - <exclude>**/*.dylib</exclude> - </excludes> - </fileSet> - <fileSet> - <directory>target/bundle</directory> - <outputDirectory>/</outputDirectory> - <includes> - <include>**/*.sh</include> - <include>**/*.so</include> - <include>**/*.sl</include> - <include>**/*.dylib</include> - </includes> - <fileMode>0755</fileMode> - </fileSet> - </fileSets> -</assembly> - diff --git a/etc/samples/sample-bundle/src/main/scripts/build.xml b/etc/samples/sample-bundle/src/main/scripts/build.xml deleted file mode 100644 index fed3f16..0000000 --- a/etc/samples/sample-bundle/src/main/scripts/build.xml +++ /dev/null @@ -1,63 +0,0 @@ -<?xml version="1.0"?> - -<!-- $Id$ --> - -<project name="sample-bundle" basedir="." default="build"> - - <target name="build"> - - <!-- download JBossAS 6.0 dist from sourceforge and unzip it --> - <property name="tmp.dir" location="${java.io.tmpdir}/${user.name}"/> - <echo>tmp.dir="${tmp.dir}"</echo> - <mkdir dir="${tmp.dir}"/> - - <get src="http://downloads.sourceforge.net/project/jboss/JBoss/JBoss-6.0.0.M3/jboss-as..." - dest="${tmp.dir}/jbossas.zip" - usetimestamp="true"/> - <property name="jboss.home" location="target/jbossas-petstore"/> - <echo>jboss.home="${jboss.home}"</echo> - <mkdir dir="${jboss.home}"/> - <unzip src="${tmp.dir}/jbossas.zip" dest="${jboss.home}"> - <mapper> - <globmapper from="jboss-6.0.0.20100429-M3/*" to="*"/> - </mapper> - </unzip> - - <!-- delete all server configs, except 'default' --> - <delete includeemptydirs="true"> - <fileset dir="${jboss.home}/server"> - <exclude name="default/**"/> - </fileset> - </delete> - - <!-- delete docs dir and README files... --> - <delete dir="${jboss.home}/docs"/> - <delete> - <fileset dir="${jboss.home}" includes="*.*" /> - </delete> - - <property name="jboss.config.dir" location="${jboss.home}/server/default"/> - - <echo>Copying Derby JDBC driver jar to $${jboss.home}/server/default/lib/...</echo> - <copy file="${settings.localRepository}/org/apache/derby/derbyclient/${derbyclient.version}/derbyclient-${derbyclient.version}.jar" - toDir="${jboss.config.dir}/lib" failonerror="false" verbose="true" /> - - <!-- copy petstore files into the jbossas install --> - <copy todir="${jboss.home}"> - <fileset dir="src/main/petstore"/> - </copy> - - <mkdir dir="target/bundle"/> - - <!-- zip up our modified jbossas install - this zipfile will be used as a bundle file --> - <zip destfile="target/bundle/jbossas-petstore.zip" basedir="${jboss.home}"/> - - <!-- copy the recipe and other bundle files into the bundle --> - <copy todir="target/bundle"> - <fileset dir="src/main/bundle"/> - </copy> - - </target> - -</project> -
commit 358f16a670cdba71c5fa222ee2df72d7aa252a71 Author: John Mazzitelli mazz@redhat.com Date: Mon Jun 28 15:40:50 2010 -0400
BZ 608597 make sure we don't send hibernate proxy classes over the wire to the agent. deep copy plugin config
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/discovery/DiscoveryServerServiceImpl.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/discovery/DiscoveryServerServiceImpl.java index d692ad8..c10febc 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/discovery/DiscoveryServerServiceImpl.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/discovery/DiscoveryServerServiceImpl.java @@ -29,6 +29,7 @@ import org.rhq.core.clientapi.server.discovery.DiscoveryServerService; import org.rhq.core.clientapi.server.discovery.InvalidInventoryReportException; import org.rhq.core.clientapi.server.discovery.InventoryReport; import org.rhq.core.domain.auth.Subject; +import org.rhq.core.domain.configuration.Configuration; import org.rhq.core.domain.discovery.AvailabilityReport; import org.rhq.core.domain.discovery.MergeResourceResponse; import org.rhq.core.domain.discovery.ResourceSyncInfo; @@ -183,7 +184,11 @@ public class DiscoveryServerServiceImpl implements DiscoveryServerService { pojoResource.setResourceType(resource.getResourceType()); pojoResource.setMtime(resource.getMtime()); pojoResource.setInventoryStatus(resource.getInventoryStatus()); - pojoResource.setPluginConfiguration(resource.getPluginConfiguration()); + Configuration pcCopy = resource.getPluginConfiguration(); + if (pcCopy != null) { + pcCopy = pcCopy.deepCopy(); + } + pojoResource.setPluginConfiguration(pcCopy); pojoResource.setName(resource.getName()); pojoResource.setDescription(resource.getDescription()); pojoResource.setLocation(resource.getLocation());
commit a6b088898fe2d0d2f8ac5022f80ef8d1ff41dc09 Author: hudson auto wnstb@yahoo.com Date: Mon Jun 28 12:15:10 2010 -0400
[maven-release-plugin] prepare for next development iteration
diff --git a/modules/common/ant-bundle/pom.xml b/modules/common/ant-bundle/pom.xml index 6d440ef..eda9133 100644 --- a/modules/common/ant-bundle/pom.xml +++ b/modules/common/ant-bundle/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-common-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/common/filetemplate-bundle/pom.xml b/modules/common/filetemplate-bundle/pom.xml index dbd8dd6..bc7965b 100644 --- a/modules/common/filetemplate-bundle/pom.xml +++ b/modules/common/filetemplate-bundle/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-common-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/common/jboss-as/pom.xml b/modules/common/jboss-as/pom.xml index 1077987..2cf950b 100644 --- a/modules/common/jboss-as/pom.xml +++ b/modules/common/jboss-as/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-common-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/common/pom.xml b/modules/common/pom.xml index 751726e..ee81a94 100644 --- a/modules/common/pom.xml +++ b/modules/common/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/client-api/pom.xml b/modules/core/client-api/pom.xml index 78d1f23..d177f9e 100644 --- a/modules/core/client-api/pom.xml +++ b/modules/core/client-api/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/comm-api/pom.xml b/modules/core/comm-api/pom.xml index f6fadb5..a51f92b 100644 --- a/modules/core/comm-api/pom.xml +++ b/modules/core/comm-api/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/dbutils/pom.xml b/modules/core/dbutils/pom.xml index 84dd23f..92ae1d2 100644 --- a/modules/core/dbutils/pom.xml +++ b/modules/core/dbutils/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/domain/pom.xml b/modules/core/domain/pom.xml index 96cbc8e..e0ced84 100644 --- a/modules/core/domain/pom.xml +++ b/modules/core/domain/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/gui/pom.xml b/modules/core/gui/pom.xml index 0df3808..0911918 100644 --- a/modules/core/gui/pom.xml +++ b/modules/core/gui/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/native-system/pom.xml b/modules/core/native-system/pom.xml index 558b9a2..d47d4c8 100644 --- a/modules/core/native-system/pom.xml +++ b/modules/core/native-system/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/plugin-api/pom.xml b/modules/core/plugin-api/pom.xml index ba389df..e1ce7ef 100644 --- a/modules/core/plugin-api/pom.xml +++ b/modules/core/plugin-api/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/plugin-container/pom.xml b/modules/core/plugin-container/pom.xml index a570e19..2e58102 100644 --- a/modules/core/plugin-container/pom.xml +++ b/modules/core/plugin-container/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/plugin-validator/pom.xml b/modules/core/plugin-validator/pom.xml index c721f21..7739177 100644 --- a/modules/core/plugin-validator/pom.xml +++ b/modules/core/plugin-validator/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/plugindoc/pom.xml b/modules/core/plugindoc/pom.xml index 9e92634..eeb7e81 100644 --- a/modules/core/plugindoc/pom.xml +++ b/modules/core/plugindoc/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/pom.xml b/modules/core/pom.xml index 47cb583..7aad64c 100644 --- a/modules/core/pom.xml +++ b/modules/core/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/util/pom.xml b/modules/core/util/pom.xml index cee7efe..bc41dc5 100644 --- a/modules/core/util/pom.xml +++ b/modules/core/util/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/agent/pom.xml b/modules/enterprise/agent/pom.xml index f917e15..d9f1c1c 100644 --- a/modules/enterprise/agent/pom.xml +++ b/modules/enterprise/agent/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/agentupdate/pom.xml b/modules/enterprise/agentupdate/pom.xml index c569283..8942239 100644 --- a/modules/enterprise/agentupdate/pom.xml +++ b/modules/enterprise/agentupdate/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/comm/pom.xml b/modules/enterprise/comm/pom.xml index 88ef26e..8b9da9c 100644 --- a/modules/enterprise/comm/pom.xml +++ b/modules/enterprise/comm/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/base-perspective-jar/pom.xml b/modules/enterprise/gui/base-perspective-jar/pom.xml index 6a09d32..611eb9d 100644 --- a/modules/enterprise/gui/base-perspective-jar/pom.xml +++ b/modules/enterprise/gui/base-perspective-jar/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/base-perspective-war/pom.xml b/modules/enterprise/gui/base-perspective-war/pom.xml index 643d41e..798a8ca 100644 --- a/modules/enterprise/gui/base-perspective-war/pom.xml +++ b/modules/enterprise/gui/base-perspective-war/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/content_http-war/pom.xml b/modules/enterprise/gui/content_http-war/pom.xml index 3068b31..df05645 100644 --- a/modules/enterprise/gui/content_http-war/pom.xml +++ b/modules/enterprise/gui/content_http-war/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-gui-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/coregui/pom.xml b/modules/enterprise/gui/coregui/pom.xml index 6cd8f92..ca1b68d 100644 --- a/modules/enterprise/gui/coregui/pom.xml +++ b/modules/enterprise/gui/coregui/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/installer-war/pom.xml b/modules/enterprise/gui/installer-war/pom.xml index e908b75..1beadca 100644 --- a/modules/enterprise/gui/installer-war/pom.xml +++ b/modules/enterprise/gui/installer-war/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/pom.xml b/modules/enterprise/gui/pom.xml index f01ec85..0c529ba 100644 --- a/modules/enterprise/gui/pom.xml +++ b/modules/enterprise/gui/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/portal-war/pom.xml b/modules/enterprise/gui/portal-war/pom.xml index a3e6434..783942c 100644 --- a/modules/enterprise/gui/portal-war/pom.xml +++ b/modules/enterprise/gui/portal-war/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/webdav-war/pom.xml b/modules/enterprise/gui/webdav-war/pom.xml index bdef75c..aa880be 100644 --- a/modules/enterprise/gui/webdav-war/pom.xml +++ b/modules/enterprise/gui/webdav-war/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/pom.xml b/modules/enterprise/pom.xml index c3fc4fa..3b0dbb8 100644 --- a/modules/enterprise/pom.xml +++ b/modules/enterprise/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/remoting/cli/pom.xml b/modules/enterprise/remoting/cli/pom.xml index 5e0a013..33966bd 100644 --- a/modules/enterprise/remoting/cli/pom.xml +++ b/modules/enterprise/remoting/cli/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<artifactId>rhq-remoting-cli</artifactId> diff --git a/modules/enterprise/remoting/client-api/pom.xml b/modules/enterprise/remoting/client-api/pom.xml index 57e79e7..605267f 100644 --- a/modules/enterprise/remoting/client-api/pom.xml +++ b/modules/enterprise/remoting/client-api/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<artifactId>rhq-remoting-client-api</artifactId> diff --git a/modules/enterprise/remoting/pom.xml b/modules/enterprise/remoting/pom.xml index 1feb631..910b617 100644 --- a/modules/enterprise/remoting/pom.xml +++ b/modules/enterprise/remoting/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<artifactId>rhq-remoting-parent</artifactId> diff --git a/modules/enterprise/remoting/webservices/pom.xml b/modules/enterprise/remoting/webservices/pom.xml index a4d9ed6..2ea73ee 100644 --- a/modules/enterprise/remoting/webservices/pom.xml +++ b/modules/enterprise/remoting/webservices/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<artifactId>rhq-remoting-webservices</artifactId> diff --git a/modules/enterprise/server/container-lib/pom.xml b/modules/enterprise/server/container-lib/pom.xml index c2acfe1..2c98817 100644 --- a/modules/enterprise/server/container-lib/pom.xml +++ b/modules/enterprise/server/container-lib/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/container/pom.xml b/modules/enterprise/server/container/pom.xml index aee0070..3fd11e8 100644 --- a/modules/enterprise/server/container/pom.xml +++ b/modules/enterprise/server/container/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/ear/pom.xml b/modules/enterprise/server/ear/pom.xml index 6956e3c..bf15866 100644 --- a/modules/enterprise/server/ear/pom.xml +++ b/modules/enterprise/server/ear/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/jar/pom.xml b/modules/enterprise/server/jar/pom.xml index 4f2650b..9e7bb24 100644 --- a/modules/enterprise/server/jar/pom.xml +++ b/modules/enterprise/server/jar/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/alert-email/pom.xml b/modules/enterprise/server/plugins/alert-email/pom.xml index b05532d..dd5bc18 100644 --- a/modules/enterprise/server/plugins/alert-email/pom.xml +++ b/modules/enterprise/server/plugins/alert-email/pom.xml @@ -3,7 +3,7 @@ <parent> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent> <modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-irc/pom.xml b/modules/enterprise/server/plugins/alert-irc/pom.xml index 988e2e3..c0973f3 100644 --- a/modules/enterprise/server/plugins/alert-irc/pom.xml +++ b/modules/enterprise/server/plugins/alert-irc/pom.xml @@ -3,7 +3,7 @@ <parent> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent> <modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-microblog/pom.xml b/modules/enterprise/server/plugins/alert-microblog/pom.xml index b9f3d0c..a62fee8 100644 --- a/modules/enterprise/server/plugins/alert-microblog/pom.xml +++ b/modules/enterprise/server/plugins/alert-microblog/pom.xml @@ -3,7 +3,7 @@ <parent> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent> <modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-mobicents/pom.xml b/modules/enterprise/server/plugins/alert-mobicents/pom.xml index 8a0c7c9..3193539 100644 --- a/modules/enterprise/server/plugins/alert-mobicents/pom.xml +++ b/modules/enterprise/server/plugins/alert-mobicents/pom.xml @@ -3,7 +3,7 @@ <parent> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent> <modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-operations/pom.xml b/modules/enterprise/server/plugins/alert-operations/pom.xml index bf7fe01..e69bfbc 100644 --- a/modules/enterprise/server/plugins/alert-operations/pom.xml +++ b/modules/enterprise/server/plugins/alert-operations/pom.xml @@ -2,7 +2,7 @@ <parent> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent> <modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-roles/pom.xml b/modules/enterprise/server/plugins/alert-roles/pom.xml index 466b99a..ca33bb7 100644 --- a/modules/enterprise/server/plugins/alert-roles/pom.xml +++ b/modules/enterprise/server/plugins/alert-roles/pom.xml @@ -3,7 +3,7 @@ <parent> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent> <modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-snmp/pom.xml b/modules/enterprise/server/plugins/alert-snmp/pom.xml index b743122..af75153 100644 --- a/modules/enterprise/server/plugins/alert-snmp/pom.xml +++ b/modules/enterprise/server/plugins/alert-snmp/pom.xml @@ -3,7 +3,7 @@ <parent> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent> <modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-subject/pom.xml b/modules/enterprise/server/plugins/alert-subject/pom.xml index 97c50f4..09839b8 100644 --- a/modules/enterprise/server/plugins/alert-subject/pom.xml +++ b/modules/enterprise/server/plugins/alert-subject/pom.xml @@ -3,7 +3,7 @@ <parent> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent> <modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/ant-bundle/pom.xml b/modules/enterprise/server/plugins/ant-bundle/pom.xml index 8abb60d..73f405e 100644 --- a/modules/enterprise/server/plugins/ant-bundle/pom.xml +++ b/modules/enterprise/server/plugins/ant-bundle/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/cobbler/pom.xml b/modules/enterprise/server/plugins/cobbler/pom.xml index ce9b430..4c44f10 100644 --- a/modules/enterprise/server/plugins/cobbler/pom.xml +++ b/modules/enterprise/server/plugins/cobbler/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<modelVersion>4.0.0</modelVersion> diff --git a/modules/enterprise/server/plugins/disk/pom.xml b/modules/enterprise/server/plugins/disk/pom.xml index 86a21ef..0033d1b 100644 --- a/modules/enterprise/server/plugins/disk/pom.xml +++ b/modules/enterprise/server/plugins/disk/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml b/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml index b83824c..61965f2 100644 --- a/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml +++ b/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/jboss-software/pom.xml b/modules/enterprise/server/plugins/jboss-software/pom.xml index b8bba65..7451668 100644 --- a/modules/enterprise/server/plugins/jboss-software/pom.xml +++ b/modules/enterprise/server/plugins/jboss-software/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml b/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml index a53f3ad..0ac61d3 100644 --- a/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml +++ b/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml @@ -7,7 +7,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/perspectives/core/pom.xml b/modules/enterprise/server/plugins/perspectives/core/pom.xml index ab30954..5a78451 100644 --- a/modules/enterprise/server/plugins/perspectives/core/pom.xml +++ b/modules/enterprise/server/plugins/perspectives/core/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/pom.xml b/modules/enterprise/server/plugins/pom.xml index 8b6a170..2b16f4a 100644 --- a/modules/enterprise/server/plugins/pom.xml +++ b/modules/enterprise/server/plugins/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/rhnhosted/pom.xml b/modules/enterprise/server/plugins/rhnhosted/pom.xml index 9a96ab0..e4ab9b2 100644 --- a/modules/enterprise/server/plugins/rhnhosted/pom.xml +++ b/modules/enterprise/server/plugins/rhnhosted/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/url/pom.xml b/modules/enterprise/server/plugins/url/pom.xml index 3a96e6d..a6cba32 100644 --- a/modules/enterprise/server/plugins/url/pom.xml +++ b/modules/enterprise/server/plugins/url/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml b/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml index 8bcdcea..9c7cc74 100644 --- a/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml +++ b/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/yum/pom.xml b/modules/enterprise/server/plugins/yum/pom.xml index 2dce331..ebdd3da 100644 --- a/modules/enterprise/server/plugins/yum/pom.xml +++ b/modules/enterprise/server/plugins/yum/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/safe-invoker/pom.xml b/modules/enterprise/server/safe-invoker/pom.xml index 3fd87f6..06c8981 100644 --- a/modules/enterprise/server/safe-invoker/pom.xml +++ b/modules/enterprise/server/safe-invoker/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/sars/agent-sar/pom.xml b/modules/enterprise/server/sars/agent-sar/pom.xml index 7ecbbad..aa278b8 100644 --- a/modules/enterprise/server/sars/agent-sar/pom.xml +++ b/modules/enterprise/server/sars/agent-sar/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-sars-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/sars/pom.xml b/modules/enterprise/server/sars/pom.xml index cadb656..0cc2084 100644 --- a/modules/enterprise/server/sars/pom.xml +++ b/modules/enterprise/server/sars/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/xml-schemas/pom.xml b/modules/enterprise/server/xml-schemas/pom.xml index 8df64c1..14738d0 100644 --- a/modules/enterprise/server/xml-schemas/pom.xml +++ b/modules/enterprise/server/xml-schemas/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/helpers/pluginAnnotations/pom.xml b/modules/helpers/pluginAnnotations/pom.xml index 031c90d..d056f74 100644 --- a/modules/helpers/pluginAnnotations/pom.xml +++ b/modules/helpers/pluginAnnotations/pom.xml @@ -6,7 +6,7 @@ <parent> <groupId>org.rhq.helpers</groupId> <artifactId>rhq-helpers</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq.helpers</groupId> diff --git a/modules/helpers/pluginGen/pom.xml b/modules/helpers/pluginGen/pom.xml index ba37942..28dc9b1 100644 --- a/modules/helpers/pluginGen/pom.xml +++ b/modules/helpers/pluginGen/pom.xml @@ -6,7 +6,7 @@ <parent> <groupId>org.rhq.helpers</groupId> <artifactId>rhq-helpers</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq.helpers</groupId> diff --git a/modules/helpers/pom.xml b/modules/helpers/pom.xml index 762f318..a0721a9 100644 --- a/modules/helpers/pom.xml +++ b/modules/helpers/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq.helpers</groupId> diff --git a/modules/helpers/rtfilter/pom.xml b/modules/helpers/rtfilter/pom.xml index e17c9d8..5d327ee 100644 --- a/modules/helpers/rtfilter/pom.xml +++ b/modules/helpers/rtfilter/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq.helpers</groupId> <artifactId>rhq-helpers</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/aliases/pom.xml b/modules/plugins/aliases/pom.xml index 7006ed8..c37598e 100644 --- a/modules/plugins/aliases/pom.xml +++ b/modules/plugins/aliases/pom.xml @@ -7,7 +7,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/ant-bundle/pom.xml b/modules/plugins/ant-bundle/pom.xml index 851c129..cc160c9 100644 --- a/modules/plugins/ant-bundle/pom.xml +++ b/modules/plugins/ant-bundle/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/apache/pom.xml b/modules/plugins/apache/pom.xml index f2682e9..b4f9208 100644 --- a/modules/plugins/apache/pom.xml +++ b/modules/plugins/apache/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/augeas/pom.xml b/modules/plugins/augeas/pom.xml index a6f56dc..915106a 100644 --- a/modules/plugins/augeas/pom.xml +++ b/modules/plugins/augeas/pom.xml @@ -7,7 +7,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/cobbler/pom.xml b/modules/plugins/cobbler/pom.xml index 1e8011a..d920440 100644 --- a/modules/plugins/cobbler/pom.xml +++ b/modules/plugins/cobbler/pom.xml @@ -7,7 +7,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/cron/pom.xml b/modules/plugins/cron/pom.xml index 6ee0662..d5aaad5 100644 --- a/modules/plugins/cron/pom.xml +++ b/modules/plugins/cron/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/database/pom.xml b/modules/plugins/database/pom.xml index 7d98f84..30889f7 100644 --- a/modules/plugins/database/pom.xml +++ b/modules/plugins/database/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/filetemplate-bundle/pom.xml b/modules/plugins/filetemplate-bundle/pom.xml index 05ac956..b79645d 100644 --- a/modules/plugins/filetemplate-bundle/pom.xml +++ b/modules/plugins/filetemplate-bundle/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/grub/pom.xml b/modules/plugins/grub/pom.xml index 1c68b9b..f7cf265 100644 --- a/modules/plugins/grub/pom.xml +++ b/modules/plugins/grub/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/hibernate/pom.xml b/modules/plugins/hibernate/pom.xml index 35fd599..acb08ef 100644 --- a/modules/plugins/hibernate/pom.xml +++ b/modules/plugins/hibernate/pom.xml @@ -6,7 +6,7 @@ <groupId>org.rhq</groupId> <!-- Bypass the jopr-plugins-parent which can not have children. It must build after the plugins in order to execute integration tests on them. --> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.jboss.on</groupId> diff --git a/modules/plugins/hosts/pom.xml b/modules/plugins/hosts/pom.xml index eddd3ed..7dd0fde 100644 --- a/modules/plugins/hosts/pom.xml +++ b/modules/plugins/hosts/pom.xml @@ -7,7 +7,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/hudson/pom.xml b/modules/plugins/hudson/pom.xml index 5d79625..65fa7b8 100644 --- a/modules/plugins/hudson/pom.xml +++ b/modules/plugins/hudson/pom.xml @@ -6,7 +6,7 @@ <parent> <artifactId>rhq-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/iis/pom.xml b/modules/plugins/iis/pom.xml index 7e17c2b..853c020 100644 --- a/modules/plugins/iis/pom.xml +++ b/modules/plugins/iis/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/jboss-as-5/pom.xml b/modules/plugins/jboss-as-5/pom.xml index ceb58be..a0ade77 100644 --- a/modules/plugins/jboss-as-5/pom.xml +++ b/modules/plugins/jboss-as-5/pom.xml @@ -9,7 +9,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.jboss.on</groupId> diff --git a/modules/plugins/jboss-as/pom.xml b/modules/plugins/jboss-as/pom.xml index 54536d9..b9ed2b3 100644 --- a/modules/plugins/jboss-as/pom.xml +++ b/modules/plugins/jboss-as/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.jboss.on</groupId> diff --git a/modules/plugins/jboss-cache-v3/pom.xml b/modules/plugins/jboss-cache-v3/pom.xml index f276b7d..b3846fa 100644 --- a/modules/plugins/jboss-cache-v3/pom.xml +++ b/modules/plugins/jboss-cache-v3/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.jboss.on</groupId> diff --git a/modules/plugins/jboss-cache/pom.xml b/modules/plugins/jboss-cache/pom.xml index f1aa8f9..443e524 100644 --- a/modules/plugins/jboss-cache/pom.xml +++ b/modules/plugins/jboss-cache/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.jboss.on</groupId> diff --git a/modules/plugins/jmx/pom.xml b/modules/plugins/jmx/pom.xml index 6bc1bfa..ac9885a 100644 --- a/modules/plugins/jmx/pom.xml +++ b/modules/plugins/jmx/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/mysql/pom.xml b/modules/plugins/mysql/pom.xml index e488d56..d0c9053 100644 --- a/modules/plugins/mysql/pom.xml +++ b/modules/plugins/mysql/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/netservices/pom.xml b/modules/plugins/netservices/pom.xml index 37d84af..06ae2ae 100644 --- a/modules/plugins/netservices/pom.xml +++ b/modules/plugins/netservices/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/oracle/pom.xml b/modules/plugins/oracle/pom.xml index 75a1aff..1acdb0f 100644 --- a/modules/plugins/oracle/pom.xml +++ b/modules/plugins/oracle/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/perftest/pom.xml b/modules/plugins/perftest/pom.xml index 4e78da5..39c75da 100644 --- a/modules/plugins/perftest/pom.xml +++ b/modules/plugins/perftest/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/platform/pom.xml b/modules/plugins/platform/pom.xml index 87ba78d..97b83b0 100644 --- a/modules/plugins/platform/pom.xml +++ b/modules/plugins/platform/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/pom.xml b/modules/plugins/pom.xml index 4873dae..85d6105 100644 --- a/modules/plugins/pom.xml +++ b/modules/plugins/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/postfix/pom.xml b/modules/plugins/postfix/pom.xml index 1e95ca3..283ab6a 100644 --- a/modules/plugins/postfix/pom.xml +++ b/modules/plugins/postfix/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/postgres/pom.xml b/modules/plugins/postgres/pom.xml index daf3133..5a4466c 100644 --- a/modules/plugins/postgres/pom.xml +++ b/modules/plugins/postgres/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/rhq-agent/pom.xml b/modules/plugins/rhq-agent/pom.xml index b0c26a5..a190dcd 100644 --- a/modules/plugins/rhq-agent/pom.xml +++ b/modules/plugins/rhq-agent/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/rhq-server/pom.xml b/modules/plugins/rhq-server/pom.xml index 98333bb..8f4e675 100644 --- a/modules/plugins/rhq-server/pom.xml +++ b/modules/plugins/rhq-server/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.jboss.on</groupId> diff --git a/modules/plugins/samba/pom.xml b/modules/plugins/samba/pom.xml index d0d0d63..0d41574 100644 --- a/modules/plugins/samba/pom.xml +++ b/modules/plugins/samba/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/script/pom.xml b/modules/plugins/script/pom.xml index 7189f74..7719b14 100644 --- a/modules/plugins/script/pom.xml +++ b/modules/plugins/script/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/snmptrapd/pom.xml b/modules/plugins/snmptrapd/pom.xml index fdb421d..2d9d715 100644 --- a/modules/plugins/snmptrapd/pom.xml +++ b/modules/plugins/snmptrapd/pom.xml @@ -2,7 +2,7 @@ <parent> <artifactId>rhq-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<modelVersion>4.0.0</modelVersion> diff --git a/modules/plugins/sshd/pom.xml b/modules/plugins/sshd/pom.xml index 9c38247..3579496 100644 --- a/modules/plugins/sshd/pom.xml +++ b/modules/plugins/sshd/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/sudoers/pom.xml b/modules/plugins/sudoers/pom.xml index 7932012..41df1b8 100644 --- a/modules/plugins/sudoers/pom.xml +++ b/modules/plugins/sudoers/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/tomcat/pom.xml b/modules/plugins/tomcat/pom.xml index 03e2df8..205d5b0 100644 --- a/modules/plugins/tomcat/pom.xml +++ b/modules/plugins/tomcat/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.jboss.on</groupId> diff --git a/modules/plugins/twitter/pom.xml b/modules/plugins/twitter/pom.xml index cab4269..e299efa 100644 --- a/modules/plugins/twitter/pom.xml +++ b/modules/plugins/twitter/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/validate-all-plugins/pom.xml b/modules/plugins/validate-all-plugins/pom.xml index 4f886fd..b3d5e87 100644 --- a/modules/plugins/validate-all-plugins/pom.xml +++ b/modules/plugins/validate-all-plugins/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/pom.xml b/modules/pom.xml index 9a28ce8..bc96ae3 100644 --- a/modules/pom.xml +++ b/modules/pom.xml @@ -6,7 +6,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/test-utils/pom.xml b/modules/test-utils/pom.xml index 07130df..2235687 100644 --- a/modules/test-utils/pom.xml +++ b/modules/test-utils/pom.xml @@ -4,7 +4,7 @@ <parent> <artifactId>rhq-modules-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent> <artifactId>test-utils</artifactId> <name>RHQ Test Utils</name> diff --git a/pom.xml b/pom.xml index efc840d..95b0dc6 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@
<groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> <packaging>pom</packaging>
<name>RHQ</name>
commit 5f6ee45fc5195e90bac314de6cc918eb071e3e09 Author: hudson auto wnstb@yahoo.com Date: Mon Jun 28 12:13:23 2010 -0400
[maven-release-plugin] prepare release RHQ_3_0_0_GA_QA
diff --git a/modules/common/ant-bundle/pom.xml b/modules/common/ant-bundle/pom.xml index eda9133..6d440ef 100644 --- a/modules/common/ant-bundle/pom.xml +++ b/modules/common/ant-bundle/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-common-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/common/filetemplate-bundle/pom.xml b/modules/common/filetemplate-bundle/pom.xml index bc7965b..dbd8dd6 100644 --- a/modules/common/filetemplate-bundle/pom.xml +++ b/modules/common/filetemplate-bundle/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-common-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/common/jboss-as/pom.xml b/modules/common/jboss-as/pom.xml index 2cf950b..1077987 100644 --- a/modules/common/jboss-as/pom.xml +++ b/modules/common/jboss-as/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-common-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/common/pom.xml b/modules/common/pom.xml index ee81a94..751726e 100644 --- a/modules/common/pom.xml +++ b/modules/common/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/client-api/pom.xml b/modules/core/client-api/pom.xml index d177f9e..78d1f23 100644 --- a/modules/core/client-api/pom.xml +++ b/modules/core/client-api/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/comm-api/pom.xml b/modules/core/comm-api/pom.xml index a51f92b..f6fadb5 100644 --- a/modules/core/comm-api/pom.xml +++ b/modules/core/comm-api/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/dbutils/pom.xml b/modules/core/dbutils/pom.xml index 92ae1d2..84dd23f 100644 --- a/modules/core/dbutils/pom.xml +++ b/modules/core/dbutils/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/domain/pom.xml b/modules/core/domain/pom.xml index e0ced84..96cbc8e 100644 --- a/modules/core/domain/pom.xml +++ b/modules/core/domain/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/gui/pom.xml b/modules/core/gui/pom.xml index 0911918..0df3808 100644 --- a/modules/core/gui/pom.xml +++ b/modules/core/gui/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/native-system/pom.xml b/modules/core/native-system/pom.xml index d47d4c8..558b9a2 100644 --- a/modules/core/native-system/pom.xml +++ b/modules/core/native-system/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/plugin-api/pom.xml b/modules/core/plugin-api/pom.xml index e1ce7ef..ba389df 100644 --- a/modules/core/plugin-api/pom.xml +++ b/modules/core/plugin-api/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/plugin-container/pom.xml b/modules/core/plugin-container/pom.xml index 2e58102..a570e19 100644 --- a/modules/core/plugin-container/pom.xml +++ b/modules/core/plugin-container/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/plugin-validator/pom.xml b/modules/core/plugin-validator/pom.xml index 7739177..c721f21 100644 --- a/modules/core/plugin-validator/pom.xml +++ b/modules/core/plugin-validator/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/plugindoc/pom.xml b/modules/core/plugindoc/pom.xml index eeb7e81..9e92634 100644 --- a/modules/core/plugindoc/pom.xml +++ b/modules/core/plugindoc/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/pom.xml b/modules/core/pom.xml index 7aad64c..47cb583 100644 --- a/modules/core/pom.xml +++ b/modules/core/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/util/pom.xml b/modules/core/util/pom.xml index bc41dc5..cee7efe 100644 --- a/modules/core/util/pom.xml +++ b/modules/core/util/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/agent/pom.xml b/modules/enterprise/agent/pom.xml index d9f1c1c..f917e15 100644 --- a/modules/enterprise/agent/pom.xml +++ b/modules/enterprise/agent/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/agentupdate/pom.xml b/modules/enterprise/agentupdate/pom.xml index 8942239..c569283 100644 --- a/modules/enterprise/agentupdate/pom.xml +++ b/modules/enterprise/agentupdate/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/comm/pom.xml b/modules/enterprise/comm/pom.xml index 8b9da9c..88ef26e 100644 --- a/modules/enterprise/comm/pom.xml +++ b/modules/enterprise/comm/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/base-perspective-jar/pom.xml b/modules/enterprise/gui/base-perspective-jar/pom.xml index 611eb9d..6a09d32 100644 --- a/modules/enterprise/gui/base-perspective-jar/pom.xml +++ b/modules/enterprise/gui/base-perspective-jar/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/base-perspective-war/pom.xml b/modules/enterprise/gui/base-perspective-war/pom.xml index 798a8ca..643d41e 100644 --- a/modules/enterprise/gui/base-perspective-war/pom.xml +++ b/modules/enterprise/gui/base-perspective-war/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/content_http-war/pom.xml b/modules/enterprise/gui/content_http-war/pom.xml index df05645..3068b31 100644 --- a/modules/enterprise/gui/content_http-war/pom.xml +++ b/modules/enterprise/gui/content_http-war/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-gui-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/coregui/pom.xml b/modules/enterprise/gui/coregui/pom.xml index ca1b68d..6cd8f92 100644 --- a/modules/enterprise/gui/coregui/pom.xml +++ b/modules/enterprise/gui/coregui/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/installer-war/pom.xml b/modules/enterprise/gui/installer-war/pom.xml index 1beadca..e908b75 100644 --- a/modules/enterprise/gui/installer-war/pom.xml +++ b/modules/enterprise/gui/installer-war/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/pom.xml b/modules/enterprise/gui/pom.xml index 0c529ba..f01ec85 100644 --- a/modules/enterprise/gui/pom.xml +++ b/modules/enterprise/gui/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/portal-war/pom.xml b/modules/enterprise/gui/portal-war/pom.xml index 783942c..a3e6434 100644 --- a/modules/enterprise/gui/portal-war/pom.xml +++ b/modules/enterprise/gui/portal-war/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/webdav-war/pom.xml b/modules/enterprise/gui/webdav-war/pom.xml index aa880be..bdef75c 100644 --- a/modules/enterprise/gui/webdav-war/pom.xml +++ b/modules/enterprise/gui/webdav-war/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/pom.xml b/modules/enterprise/pom.xml index 3b0dbb8..c3fc4fa 100644 --- a/modules/enterprise/pom.xml +++ b/modules/enterprise/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/remoting/cli/pom.xml b/modules/enterprise/remoting/cli/pom.xml index 33966bd..5e0a013 100644 --- a/modules/enterprise/remoting/cli/pom.xml +++ b/modules/enterprise/remoting/cli/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<artifactId>rhq-remoting-cli</artifactId> diff --git a/modules/enterprise/remoting/client-api/pom.xml b/modules/enterprise/remoting/client-api/pom.xml index 605267f..57e79e7 100644 --- a/modules/enterprise/remoting/client-api/pom.xml +++ b/modules/enterprise/remoting/client-api/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<artifactId>rhq-remoting-client-api</artifactId> diff --git a/modules/enterprise/remoting/pom.xml b/modules/enterprise/remoting/pom.xml index 910b617..1feb631 100644 --- a/modules/enterprise/remoting/pom.xml +++ b/modules/enterprise/remoting/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<artifactId>rhq-remoting-parent</artifactId> diff --git a/modules/enterprise/remoting/webservices/pom.xml b/modules/enterprise/remoting/webservices/pom.xml index 2ea73ee..a4d9ed6 100644 --- a/modules/enterprise/remoting/webservices/pom.xml +++ b/modules/enterprise/remoting/webservices/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<artifactId>rhq-remoting-webservices</artifactId> diff --git a/modules/enterprise/server/container-lib/pom.xml b/modules/enterprise/server/container-lib/pom.xml index 2c98817..c2acfe1 100644 --- a/modules/enterprise/server/container-lib/pom.xml +++ b/modules/enterprise/server/container-lib/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/container/pom.xml b/modules/enterprise/server/container/pom.xml index 3fd11e8..aee0070 100644 --- a/modules/enterprise/server/container/pom.xml +++ b/modules/enterprise/server/container/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/ear/pom.xml b/modules/enterprise/server/ear/pom.xml index bf15866..6956e3c 100644 --- a/modules/enterprise/server/ear/pom.xml +++ b/modules/enterprise/server/ear/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/jar/pom.xml b/modules/enterprise/server/jar/pom.xml index 9e7bb24..4f2650b 100644 --- a/modules/enterprise/server/jar/pom.xml +++ b/modules/enterprise/server/jar/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/alert-email/pom.xml b/modules/enterprise/server/plugins/alert-email/pom.xml index dd5bc18..b05532d 100644 --- a/modules/enterprise/server/plugins/alert-email/pom.xml +++ b/modules/enterprise/server/plugins/alert-email/pom.xml @@ -3,7 +3,7 @@ <parent> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent> <modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-irc/pom.xml b/modules/enterprise/server/plugins/alert-irc/pom.xml index c0973f3..988e2e3 100644 --- a/modules/enterprise/server/plugins/alert-irc/pom.xml +++ b/modules/enterprise/server/plugins/alert-irc/pom.xml @@ -3,7 +3,7 @@ <parent> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent> <modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-microblog/pom.xml b/modules/enterprise/server/plugins/alert-microblog/pom.xml index a62fee8..b9f3d0c 100644 --- a/modules/enterprise/server/plugins/alert-microblog/pom.xml +++ b/modules/enterprise/server/plugins/alert-microblog/pom.xml @@ -3,7 +3,7 @@ <parent> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent> <modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-mobicents/pom.xml b/modules/enterprise/server/plugins/alert-mobicents/pom.xml index 3193539..8a0c7c9 100644 --- a/modules/enterprise/server/plugins/alert-mobicents/pom.xml +++ b/modules/enterprise/server/plugins/alert-mobicents/pom.xml @@ -3,7 +3,7 @@ <parent> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent> <modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-operations/pom.xml b/modules/enterprise/server/plugins/alert-operations/pom.xml index e69bfbc..bf7fe01 100644 --- a/modules/enterprise/server/plugins/alert-operations/pom.xml +++ b/modules/enterprise/server/plugins/alert-operations/pom.xml @@ -2,7 +2,7 @@ <parent> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent> <modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-roles/pom.xml b/modules/enterprise/server/plugins/alert-roles/pom.xml index ca33bb7..466b99a 100644 --- a/modules/enterprise/server/plugins/alert-roles/pom.xml +++ b/modules/enterprise/server/plugins/alert-roles/pom.xml @@ -3,7 +3,7 @@ <parent> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent> <modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-snmp/pom.xml b/modules/enterprise/server/plugins/alert-snmp/pom.xml index af75153..b743122 100644 --- a/modules/enterprise/server/plugins/alert-snmp/pom.xml +++ b/modules/enterprise/server/plugins/alert-snmp/pom.xml @@ -3,7 +3,7 @@ <parent> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent> <modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-subject/pom.xml b/modules/enterprise/server/plugins/alert-subject/pom.xml index 09839b8..97c50f4 100644 --- a/modules/enterprise/server/plugins/alert-subject/pom.xml +++ b/modules/enterprise/server/plugins/alert-subject/pom.xml @@ -3,7 +3,7 @@ <parent> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent> <modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/ant-bundle/pom.xml b/modules/enterprise/server/plugins/ant-bundle/pom.xml index 73f405e..8abb60d 100644 --- a/modules/enterprise/server/plugins/ant-bundle/pom.xml +++ b/modules/enterprise/server/plugins/ant-bundle/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/cobbler/pom.xml b/modules/enterprise/server/plugins/cobbler/pom.xml index 4c44f10..ce9b430 100644 --- a/modules/enterprise/server/plugins/cobbler/pom.xml +++ b/modules/enterprise/server/plugins/cobbler/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<modelVersion>4.0.0</modelVersion> diff --git a/modules/enterprise/server/plugins/disk/pom.xml b/modules/enterprise/server/plugins/disk/pom.xml index 0033d1b..86a21ef 100644 --- a/modules/enterprise/server/plugins/disk/pom.xml +++ b/modules/enterprise/server/plugins/disk/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml b/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml index 61965f2..b83824c 100644 --- a/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml +++ b/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/jboss-software/pom.xml b/modules/enterprise/server/plugins/jboss-software/pom.xml index 7451668..b8bba65 100644 --- a/modules/enterprise/server/plugins/jboss-software/pom.xml +++ b/modules/enterprise/server/plugins/jboss-software/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml b/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml index 0ac61d3..a53f3ad 100644 --- a/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml +++ b/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml @@ -7,7 +7,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/perspectives/core/pom.xml b/modules/enterprise/server/plugins/perspectives/core/pom.xml index 5a78451..ab30954 100644 --- a/modules/enterprise/server/plugins/perspectives/core/pom.xml +++ b/modules/enterprise/server/plugins/perspectives/core/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/pom.xml b/modules/enterprise/server/plugins/pom.xml index 2b16f4a..8b6a170 100644 --- a/modules/enterprise/server/plugins/pom.xml +++ b/modules/enterprise/server/plugins/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/rhnhosted/pom.xml b/modules/enterprise/server/plugins/rhnhosted/pom.xml index e4ab9b2..9a96ab0 100644 --- a/modules/enterprise/server/plugins/rhnhosted/pom.xml +++ b/modules/enterprise/server/plugins/rhnhosted/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/url/pom.xml b/modules/enterprise/server/plugins/url/pom.xml index a6cba32..3a96e6d 100644 --- a/modules/enterprise/server/plugins/url/pom.xml +++ b/modules/enterprise/server/plugins/url/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml b/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml index 9c7cc74..8bcdcea 100644 --- a/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml +++ b/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/yum/pom.xml b/modules/enterprise/server/plugins/yum/pom.xml index ebdd3da..2dce331 100644 --- a/modules/enterprise/server/plugins/yum/pom.xml +++ b/modules/enterprise/server/plugins/yum/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/safe-invoker/pom.xml b/modules/enterprise/server/safe-invoker/pom.xml index 06c8981..3fd87f6 100644 --- a/modules/enterprise/server/safe-invoker/pom.xml +++ b/modules/enterprise/server/safe-invoker/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/sars/agent-sar/pom.xml b/modules/enterprise/server/sars/agent-sar/pom.xml index aa278b8..7ecbbad 100644 --- a/modules/enterprise/server/sars/agent-sar/pom.xml +++ b/modules/enterprise/server/sars/agent-sar/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-sars-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/sars/pom.xml b/modules/enterprise/server/sars/pom.xml index 0cc2084..cadb656 100644 --- a/modules/enterprise/server/sars/pom.xml +++ b/modules/enterprise/server/sars/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/xml-schemas/pom.xml b/modules/enterprise/server/xml-schemas/pom.xml index 14738d0..8df64c1 100644 --- a/modules/enterprise/server/xml-schemas/pom.xml +++ b/modules/enterprise/server/xml-schemas/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/helpers/pluginAnnotations/pom.xml b/modules/helpers/pluginAnnotations/pom.xml index d056f74..031c90d 100644 --- a/modules/helpers/pluginAnnotations/pom.xml +++ b/modules/helpers/pluginAnnotations/pom.xml @@ -6,7 +6,7 @@ <parent> <groupId>org.rhq.helpers</groupId> <artifactId>rhq-helpers</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq.helpers</groupId> diff --git a/modules/helpers/pluginGen/pom.xml b/modules/helpers/pluginGen/pom.xml index 28dc9b1..ba37942 100644 --- a/modules/helpers/pluginGen/pom.xml +++ b/modules/helpers/pluginGen/pom.xml @@ -6,7 +6,7 @@ <parent> <groupId>org.rhq.helpers</groupId> <artifactId>rhq-helpers</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq.helpers</groupId> diff --git a/modules/helpers/pom.xml b/modules/helpers/pom.xml index a0721a9..762f318 100644 --- a/modules/helpers/pom.xml +++ b/modules/helpers/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq.helpers</groupId> diff --git a/modules/helpers/rtfilter/pom.xml b/modules/helpers/rtfilter/pom.xml index 5d327ee..e17c9d8 100644 --- a/modules/helpers/rtfilter/pom.xml +++ b/modules/helpers/rtfilter/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq.helpers</groupId> <artifactId>rhq-helpers</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/aliases/pom.xml b/modules/plugins/aliases/pom.xml index c37598e..7006ed8 100644 --- a/modules/plugins/aliases/pom.xml +++ b/modules/plugins/aliases/pom.xml @@ -7,7 +7,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/ant-bundle/pom.xml b/modules/plugins/ant-bundle/pom.xml index cc160c9..851c129 100644 --- a/modules/plugins/ant-bundle/pom.xml +++ b/modules/plugins/ant-bundle/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/apache/pom.xml b/modules/plugins/apache/pom.xml index b4f9208..f2682e9 100644 --- a/modules/plugins/apache/pom.xml +++ b/modules/plugins/apache/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/augeas/pom.xml b/modules/plugins/augeas/pom.xml index 915106a..a6f56dc 100644 --- a/modules/plugins/augeas/pom.xml +++ b/modules/plugins/augeas/pom.xml @@ -7,7 +7,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/cobbler/pom.xml b/modules/plugins/cobbler/pom.xml index d920440..1e8011a 100644 --- a/modules/plugins/cobbler/pom.xml +++ b/modules/plugins/cobbler/pom.xml @@ -7,7 +7,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/cron/pom.xml b/modules/plugins/cron/pom.xml index d5aaad5..6ee0662 100644 --- a/modules/plugins/cron/pom.xml +++ b/modules/plugins/cron/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/database/pom.xml b/modules/plugins/database/pom.xml index 30889f7..7d98f84 100644 --- a/modules/plugins/database/pom.xml +++ b/modules/plugins/database/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/filetemplate-bundle/pom.xml b/modules/plugins/filetemplate-bundle/pom.xml index b79645d..05ac956 100644 --- a/modules/plugins/filetemplate-bundle/pom.xml +++ b/modules/plugins/filetemplate-bundle/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/grub/pom.xml b/modules/plugins/grub/pom.xml index f7cf265..1c68b9b 100644 --- a/modules/plugins/grub/pom.xml +++ b/modules/plugins/grub/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/hibernate/pom.xml b/modules/plugins/hibernate/pom.xml index acb08ef..35fd599 100644 --- a/modules/plugins/hibernate/pom.xml +++ b/modules/plugins/hibernate/pom.xml @@ -6,7 +6,7 @@ <groupId>org.rhq</groupId> <!-- Bypass the jopr-plugins-parent which can not have children. It must build after the plugins in order to execute integration tests on them. --> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.jboss.on</groupId> diff --git a/modules/plugins/hosts/pom.xml b/modules/plugins/hosts/pom.xml index 7dd0fde..eddd3ed 100644 --- a/modules/plugins/hosts/pom.xml +++ b/modules/plugins/hosts/pom.xml @@ -7,7 +7,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/hudson/pom.xml b/modules/plugins/hudson/pom.xml index 65fa7b8..5d79625 100644 --- a/modules/plugins/hudson/pom.xml +++ b/modules/plugins/hudson/pom.xml @@ -6,7 +6,7 @@ <parent> <artifactId>rhq-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/iis/pom.xml b/modules/plugins/iis/pom.xml index 853c020..7e17c2b 100644 --- a/modules/plugins/iis/pom.xml +++ b/modules/plugins/iis/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/jboss-as-5/pom.xml b/modules/plugins/jboss-as-5/pom.xml index a0ade77..ceb58be 100644 --- a/modules/plugins/jboss-as-5/pom.xml +++ b/modules/plugins/jboss-as-5/pom.xml @@ -9,7 +9,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.jboss.on</groupId> diff --git a/modules/plugins/jboss-as/pom.xml b/modules/plugins/jboss-as/pom.xml index b9ed2b3..54536d9 100644 --- a/modules/plugins/jboss-as/pom.xml +++ b/modules/plugins/jboss-as/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.jboss.on</groupId> diff --git a/modules/plugins/jboss-cache-v3/pom.xml b/modules/plugins/jboss-cache-v3/pom.xml index b3846fa..f276b7d 100644 --- a/modules/plugins/jboss-cache-v3/pom.xml +++ b/modules/plugins/jboss-cache-v3/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.jboss.on</groupId> diff --git a/modules/plugins/jboss-cache/pom.xml b/modules/plugins/jboss-cache/pom.xml index 443e524..f1aa8f9 100644 --- a/modules/plugins/jboss-cache/pom.xml +++ b/modules/plugins/jboss-cache/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.jboss.on</groupId> diff --git a/modules/plugins/jmx/pom.xml b/modules/plugins/jmx/pom.xml index ac9885a..6bc1bfa 100644 --- a/modules/plugins/jmx/pom.xml +++ b/modules/plugins/jmx/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/mysql/pom.xml b/modules/plugins/mysql/pom.xml index d0c9053..e488d56 100644 --- a/modules/plugins/mysql/pom.xml +++ b/modules/plugins/mysql/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/netservices/pom.xml b/modules/plugins/netservices/pom.xml index 06ae2ae..37d84af 100644 --- a/modules/plugins/netservices/pom.xml +++ b/modules/plugins/netservices/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/oracle/pom.xml b/modules/plugins/oracle/pom.xml index 1acdb0f..75a1aff 100644 --- a/modules/plugins/oracle/pom.xml +++ b/modules/plugins/oracle/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/perftest/pom.xml b/modules/plugins/perftest/pom.xml index 39c75da..4e78da5 100644 --- a/modules/plugins/perftest/pom.xml +++ b/modules/plugins/perftest/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/platform/pom.xml b/modules/plugins/platform/pom.xml index 97b83b0..87ba78d 100644 --- a/modules/plugins/platform/pom.xml +++ b/modules/plugins/platform/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/pom.xml b/modules/plugins/pom.xml index 85d6105..4873dae 100644 --- a/modules/plugins/pom.xml +++ b/modules/plugins/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/postfix/pom.xml b/modules/plugins/postfix/pom.xml index 283ab6a..1e95ca3 100644 --- a/modules/plugins/postfix/pom.xml +++ b/modules/plugins/postfix/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/postgres/pom.xml b/modules/plugins/postgres/pom.xml index 5a4466c..daf3133 100644 --- a/modules/plugins/postgres/pom.xml +++ b/modules/plugins/postgres/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/rhq-agent/pom.xml b/modules/plugins/rhq-agent/pom.xml index a190dcd..b0c26a5 100644 --- a/modules/plugins/rhq-agent/pom.xml +++ b/modules/plugins/rhq-agent/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/rhq-server/pom.xml b/modules/plugins/rhq-server/pom.xml index 8f4e675..98333bb 100644 --- a/modules/plugins/rhq-server/pom.xml +++ b/modules/plugins/rhq-server/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.jboss.on</groupId> diff --git a/modules/plugins/samba/pom.xml b/modules/plugins/samba/pom.xml index 0d41574..d0d0d63 100644 --- a/modules/plugins/samba/pom.xml +++ b/modules/plugins/samba/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/script/pom.xml b/modules/plugins/script/pom.xml index 7719b14..7189f74 100644 --- a/modules/plugins/script/pom.xml +++ b/modules/plugins/script/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/snmptrapd/pom.xml b/modules/plugins/snmptrapd/pom.xml index 2d9d715..fdb421d 100644 --- a/modules/plugins/snmptrapd/pom.xml +++ b/modules/plugins/snmptrapd/pom.xml @@ -2,7 +2,7 @@ <parent> <artifactId>rhq-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<modelVersion>4.0.0</modelVersion> diff --git a/modules/plugins/sshd/pom.xml b/modules/plugins/sshd/pom.xml index 3579496..9c38247 100644 --- a/modules/plugins/sshd/pom.xml +++ b/modules/plugins/sshd/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/sudoers/pom.xml b/modules/plugins/sudoers/pom.xml index 41df1b8..7932012 100644 --- a/modules/plugins/sudoers/pom.xml +++ b/modules/plugins/sudoers/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/tomcat/pom.xml b/modules/plugins/tomcat/pom.xml index 205d5b0..03e2df8 100644 --- a/modules/plugins/tomcat/pom.xml +++ b/modules/plugins/tomcat/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.jboss.on</groupId> diff --git a/modules/plugins/twitter/pom.xml b/modules/plugins/twitter/pom.xml index e299efa..cab4269 100644 --- a/modules/plugins/twitter/pom.xml +++ b/modules/plugins/twitter/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/validate-all-plugins/pom.xml b/modules/plugins/validate-all-plugins/pom.xml index b3d5e87..4f886fd 100644 --- a/modules/plugins/validate-all-plugins/pom.xml +++ b/modules/plugins/validate-all-plugins/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/pom.xml b/modules/pom.xml index bc96ae3..9a28ce8 100644 --- a/modules/pom.xml +++ b/modules/pom.xml @@ -6,7 +6,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/test-utils/pom.xml b/modules/test-utils/pom.xml index 2235687..07130df 100644 --- a/modules/test-utils/pom.xml +++ b/modules/test-utils/pom.xml @@ -4,7 +4,7 @@ <parent> <artifactId>rhq-modules-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent> <artifactId>test-utils</artifactId> <name>RHQ Test Utils</name> diff --git a/pom.xml b/pom.xml index 95b0dc6..efc840d 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@
<groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> <packaging>pom</packaging>
<name>RHQ</name>
commit 7829f810ed242a7d61e89493ecc4c135106df90a Author: Jay Shaughnessy jshaughn@redhat.com Date: Mon Jun 28 11:09:34 2010 -0400
fix db used by tag-rhq-release job
diff --git a/release.sh b/release.sh index e9ed4ce..2722eda 100755 --- a/release.sh +++ b/release.sh @@ -261,15 +261,15 @@ cat <<EOF >"${MAVEN_SETTINGS_FILE}" <profile> <id>release</id> <properties> - <rhq.test.ds.connection-url>jdbc:postgresql://jon03.qa.atl2.redhat.com:5432/rhq_release</rhq.test.ds.connection-url> + <rhq.test.ds.server-name>hudson-qe.rhq.rdu.redhat.com</rhq.test.ds.server-name> + <rhq.test.ds.port>5432</rhq.test.ds.port> + <rhq.test.ds.db-name>rhq_release_tag</rhq.test.ds.db-name> + <rhq.test.ds.connection-url>jdbc:postgresql://hudson-qe.rhq.rdu.redhat.com:5432/rhq_release_tag</rhq.test.ds.connection-url> <rhq.test.ds.user-name>rhqadmin</rhq.test.ds.user-name> <rhq.test.ds.password>rhqadmin</rhq.test.ds.password> <rhq.test.ds.type-mapping>PostgreSQL</rhq.test.ds.type-mapping> <rhq.test.ds.driver-class>org.postgresql.Driver</rhq.test.ds.driver-class> <rhq.test.ds.xa-datasource-class>org.postgresql.xa.PGXADataSource</rhq.test.ds.xa-datasource-class> - <rhq.test.ds.server-name>jon03.qa.atl2.redhat.com</rhq.test.ds.server-name> - <rhq.test.ds.port>5432</rhq.test.ds.port> - <rhq.test.ds.db-name>rhq_release</rhq.test.ds.db-name> <rhq.test.ds.hibernate-dialect>org.hibernate.dialect.PostgreSQLDialect</rhq.test.ds.hibernate-dialect> <!-- quartz properties --> <rhq.test.quartz.driverDelegateClass>org.quartz.impl.jdbcjobstore.PostgreSQLDelegate</rhq.test.quartz.driverDelegateClass>
commit 0c86996f5f6e969e04960d6c61d19b30bbbd8a1e Author: Lukas Krejci lkrejci@redhat.com Date: Mon Jun 28 15:19:35 2010 +0200
BZ 608064 - Postgres discovery doesn't fail if not able to connect to the server, enhanced the host and version detection to be read out of the configuration file or using the executable respectively.
diff --git a/modules/plugins/postgres/src/main/java/org/rhq/plugins/postgres/PostgresDiscoveryComponent.java b/modules/plugins/postgres/src/main/java/org/rhq/plugins/postgres/PostgresDiscoveryComponent.java index 825a4a3..b02d764 100644 --- a/modules/plugins/postgres/src/main/java/org/rhq/plugins/postgres/PostgresDiscoveryComponent.java +++ b/modules/plugins/postgres/src/main/java/org/rhq/plugins/postgres/PostgresDiscoveryComponent.java @@ -25,7 +25,12 @@ import org.jetbrains.annotations.Nullable; import org.rhq.core.domain.configuration.Configuration; import org.rhq.core.domain.configuration.PropertySimple; import org.rhq.core.pluginapi.inventory.*; +import org.rhq.core.pluginapi.util.ProcessExecutionUtility; +import org.rhq.core.system.ProcessExecution; +import org.rhq.core.system.ProcessExecutionResults; import org.rhq.core.system.ProcessInfo; +import org.rhq.core.system.SystemInfo; +import org.rhq.core.system.SystemInfoFactory; import org.rhq.core.util.jdbc.JDBCUtil; import org.rhq.plugins.postgres.util.PostgresqlConfFile;
@@ -42,6 +47,8 @@ import java.util.Collections; import java.util.LinkedHashSet; import java.util.List; import java.util.Set; +import java.util.regex.Matcher; +import java.util.regex.Pattern;
/** * @author Greg Hinkle @@ -62,7 +69,7 @@ public class PostgresDiscoveryComponent implements ResourceDiscoveryComponent, M private static final String PGDATA_ENV_VAR = "PGDATA"; private static final String DEFAULT_RESOURCE_DESCRIPTION = "Postgres relational database server"; private static final String POSTGRES_DEFAULT_DATABASE_NAME = "postgres"; - + private static final Pattern VERSION_FROM_COMMANDLINE = Pattern.compile("\d+(?:\.\d+)*");
public Set<DiscoveredResourceDetails> discoverResources(ResourceDiscoveryContext context) { Set<DiscoveredResourceDetails> servers = new LinkedHashSet<DiscoveredResourceDetails>(); @@ -118,6 +125,14 @@ public class PostgresDiscoveryComponent implements ResourceDiscoveryComponent, M // Override the default (5432) from the descriptor. pluginConfig.put(new PropertySimple(PORT_CONFIGURATION_PROPERTY, port)); } + List<String> listenAddresses = confFile.getPropertyList("listen_addresses"); + if (listenAddresses.size() > 0) { + String listenAddress = listenAddresses.get(0).trim(); + if ("*".equals(listenAddress)) { + listenAddress = "127.0.0.1"; + } + pluginConfig.put(new PropertySimple(HOST_CONFIGURATION_PROPERTY, listenAddress)); + } }
DiscoveredResourceDetails resourceDetails = createResourceDetails(context, pluginConfig, procInfo); @@ -149,7 +164,7 @@ public class PostgresDiscoveryComponent implements ResourceDiscoveryComponent, M String key = buildUrl(pluginConfiguration); Connection conn = getConnection(pluginConfiguration); String name = getServerResourceName(pluginConfiguration, conn); - String version = getVersion(pluginConfiguration, conn); + String version = getVersion(pluginConfiguration, processInfo, discoveryContext.getSystemInformation(), conn); JDBCUtil.safeClose(conn); return new DiscoveredResourceDetails(discoveryContext.getResourceType(), key, name, version, DEFAULT_RESOURCE_DESCRIPTION, pluginConfiguration, processInfo); @@ -163,7 +178,7 @@ public class PostgresDiscoveryComponent implements ResourceDiscoveryComponent, M return url; }
- protected static String getVersion(Configuration config, Connection conn) { + protected static String getVersion(Configuration config, ProcessInfo processInfo, SystemInfo systemInfo, Connection conn) { String version = null; try { if (conn != null) { @@ -171,9 +186,27 @@ public class PostgresDiscoveryComponent implements ResourceDiscoveryComponent, M } } catch (SQLException e) { // TODO GH: How to put this back to the server while inventorying this resource in an unconfigured state - log.info("Exception detecting postgres instance", e); + log.info("Exception detecting postgres instance version.", e); }
+ //now try to extract the version information by asking the server executable itself + if (version == null && processInfo != null) { + try { + String postgresExe = processInfo.getExecutable().getName(); + ProcessExecution execution = new ProcessExecution(postgresExe); + execution.setArguments(new String[] { "--version" }); + execution.setCaptureOutput(true); + ProcessExecutionResults results = systemInfo.executeProcess(execution); + String versionInfo = results.getCapturedOutput(); + Matcher m = VERSION_FROM_COMMANDLINE.matcher(versionInfo); + if (m.find()) { + version = versionInfo.substring(m.start(), m.end()); + } + } catch (Exception e) { + log.info("Failed to obtain Postgres version information from the executable file.", e); + } + } + return version; }
@@ -271,6 +304,9 @@ public class PostgresDiscoveryComponent implements ResourceDiscoveryComponent, M private static List<String> getDatabaseNames(Configuration config, Connection conn) { Statement statement = null; ResultSet resultSet = null; + + if (conn == null) return Collections.emptyList(); + try { List<String> ret = new ArrayList<String>();
diff --git a/modules/plugins/postgres/src/main/java/org/rhq/plugins/postgres/util/PostgresqlConfFile.java b/modules/plugins/postgres/src/main/java/org/rhq/plugins/postgres/util/PostgresqlConfFile.java index bf67db8..d4b06dd 100644 --- a/modules/plugins/postgres/src/main/java/org/rhq/plugins/postgres/util/PostgresqlConfFile.java +++ b/modules/plugins/postgres/src/main/java/org/rhq/plugins/postgres/util/PostgresqlConfFile.java @@ -26,12 +26,16 @@ import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.FileReader; import java.io.IOException; +import java.util.Arrays; +import java.util.Collections; import java.util.HashMap; +import java.util.List; import java.util.Map; import java.util.regex.Matcher; import java.util.regex.Pattern; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.rhq.core.util.jdbc.JDBCUtil;
@@ -93,6 +97,24 @@ public class PostgresqlConfFile { return this.properties.get(paramName); }
+ @NotNull + public List<String> getPropertyList(String propertyName) { + String prop = getProperty(propertyName); + + if (prop == null) return Collections.emptyList(); + + return Arrays.asList(stripQuotes(prop).split(",")); + } + + @NotNull + public static String stripQuotes(@NotNull String value) { + if (value.startsWith("'") && value.endsWith("'")) { + return value.substring(1, value.length() - 1); + } + + return value; + } + @Nullable public String getPort() { return getProperty("port");
commit a4f49968b6950dad76564d8d7fda6d474bcc72e9 Merge: 9b91e02... 7621d76... Author: Filip Drabek fdrabek@dhcp-lab-136.englab.brq.redhat.com Date: Mon Jun 28 14:10:50 2010 +0200
Merge branch 'release-3.0.0' of ssh://git.fedorahosted.org/git/rhq/rhq into release-3.0.0
commit 9b91e02941d99a8e3b98541cb42f980c8198a442 Author: Filip Drabek fdrabek@dhcp-lab-136.englab.brq.redhat.com Date: Wed Jun 16 16:04:13 2010 +0200
BZ 601880 - JBossAS5 Plugin - ApplicationServerOperationsDelegate uses old plugin configuration after plugin configuration was updated.
diff --git a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ApplicationServerComponent.java b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ApplicationServerComponent.java index e4a0ec9..e21153e 100644 --- a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ApplicationServerComponent.java +++ b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ApplicationServerComponent.java @@ -190,7 +190,7 @@ public class ApplicationServerComponent implements ResourceComponent, ProfileSer
public void start(ResourceContext resourceContext) { this.resourceContext = resourceContext; - + this.operationDelegate = new ApplicationServerOperationsDelegate(this); // Connect to the JBAS instance's Profile Service and JMX MBeanServer. connectToProfileService(); initializeEmsConnection(); @@ -486,10 +486,7 @@ public class ApplicationServerComponent implements ResourceComponent, ProfileSer
public OperationResult invokeOperation(String name, Configuration parameters) throws InterruptedException, Exception { - if (this.operationDelegate == null) { - this.operationDelegate = new ApplicationServerOperationsDelegate(this, this.resourceContext - .getSystemInformation()); - } + ApplicationServerSupportedOperations operation = Enum.valueOf(ApplicationServerSupportedOperations.class, name .toUpperCase()); return this.operationDelegate.invoke(operation, parameters); diff --git a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ApplicationServerOperationsDelegate.java b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ApplicationServerOperationsDelegate.java index 643c9cc..5f7ae4f 100644 --- a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ApplicationServerOperationsDelegate.java +++ b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ApplicationServerOperationsDelegate.java @@ -37,7 +37,6 @@ import org.mc4j.ems.connection.bean.parameter.EmsParameter; import org.rhq.core.domain.configuration.Configuration; import org.rhq.core.domain.measurement.AvailabilityType; import org.rhq.core.pluginapi.inventory.InvalidPluginConfigurationException; -import org.rhq.core.pluginapi.inventory.ResourceContext; import org.rhq.core.pluginapi.operation.OperationResult; import org.rhq.core.pluginapi.util.ProcessExecutionUtility; import org.rhq.core.system.ProcessExecution; @@ -94,25 +93,13 @@ public class ApplicationServerOperationsDelegate { */ private ApplicationServerComponent serverComponent;
- private Configuration pluginConfig; - - private ResourceContext resourceContext; - private File configPath;
- /** - * Passed in from the resource context for making process calls. - */ - private SystemInfo systemInfo; - // Constructors --------------------------------------------
public ApplicationServerOperationsDelegate( - ApplicationServerComponent serverComponent, SystemInfo systemInfo) { + ApplicationServerComponent serverComponent) { this.serverComponent = serverComponent; - this.resourceContext = serverComponent.getResourceContext(); - this.pluginConfig = this.resourceContext.getPluginConfiguration(); - this.systemInfo = systemInfo; }
// Public -------------------------------------------- @@ -172,7 +159,7 @@ public class ApplicationServerOperationsDelegate { result.setErrorMessage("The server is already started."); return result; } - + Configuration pluginConfig = serverComponent.getResourceContext().getPluginConfiguration(); File startScriptFile = getStartScriptPath(); validateScriptFile( startScriptFile, @@ -233,7 +220,8 @@ public class ApplicationServerOperationsDelegate { if (log.isDebugEnabled()) { log.debug("About to execute the following process: [" + processExecution + "]"); } - ProcessExecutionResults results = this.systemInfo + SystemInfo systemInfo = serverComponent.getResourceContext().getSystemInformation(); + ProcessExecutionResults results = systemInfo .executeProcess(processExecution); logExecutionResults(results);
@@ -258,6 +246,7 @@ public class ApplicationServerOperationsDelegate { }
private String getConfigurationSet() { + Configuration pluginConfig = serverComponent.getResourceContext().getPluginConfiguration(); configPath = resolvePathRelativeToHomeDir(getRequiredPropertyValue( pluginConfig, ApplicationServerPluginConfigurationProperties.SERVER_HOME_DIR)); @@ -311,6 +300,7 @@ public class ApplicationServerOperationsDelegate { return result; }
+ Configuration pluginConfig = serverComponent.getResourceContext().getPluginConfiguration(); ApplicationServerShutdownMethod shutdownMethod = Enum .valueOf( ApplicationServerShutdownMethod.class, @@ -343,6 +333,7 @@ public class ApplicationServerOperationsDelegate { validateScriptFile( shutdownScriptFile, ApplicationServerPluginConfigurationProperties.SHUTDOWN_SCRIPT_CONFIG_PROP); + Configuration pluginConfig = serverComponent.getResourceContext().getPluginConfiguration(); String prefix = pluginConfig .getSimple( ApplicationServerPluginConfigurationProperties.SCRIPT_PREFIX_CONFIG_PROP) @@ -386,7 +377,8 @@ public class ApplicationServerOperationsDelegate { log.debug("About to execute the following process: [" + processExecution + "]"); } - ProcessExecutionResults results = this.systemInfo + SystemInfo systemInfo = serverComponent.getResourceContext().getSystemInformation(); + ProcessExecutionResults results = systemInfo .executeProcess(processExecution); logExecutionResults(results);
@@ -413,6 +405,7 @@ public class ApplicationServerOperationsDelegate { * @return success message if no errors are encountered */ private String shutdownViaJmx() { + Configuration pluginConfig = serverComponent.getResourceContext().getPluginConfiguration(); String mbeanName = pluginConfig .getSimple( ApplicationServerPluginConfigurationProperties.SHUTDOWN_MBEAN_CONFIG_PROP) @@ -604,13 +597,15 @@ public class ApplicationServerOperationsDelegate { */ @Nullable public File getJavaHomePath() { - String javaHomePath = this.pluginConfig.getSimpleValue(ApplicationServerPluginConfigurationProperties.JAVA_HOME, + Configuration pluginConfig = serverComponent.getResourceContext().getPluginConfiguration(); + String javaHomePath = pluginConfig.getSimpleValue(ApplicationServerPluginConfigurationProperties.JAVA_HOME, null); File javaHome = (javaHomePath != null) ? new File(javaHomePath) : null; return javaHome; }
void validateJavaHomePathProperty() { + Configuration pluginConfig = serverComponent.getResourceContext().getPluginConfiguration(); String javaHome = pluginConfig.getSimple( ApplicationServerPluginConfigurationProperties.JAVA_HOME) .getStringValue();
commit 7621d7695a05b2839b1c266a92566a56dc6cd76b Author: Heiko W. Rupp hwr@redhat.com Date: Mon Jun 28 10:55:05 2010 +0200
BZ 583833 - re-show the Events icon in the MICA section.
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/inventory/view.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/inventory/view.xhtml index 8709643..8e997ef 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/inventory/view.xhtml +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/inventory/view.xhtml @@ -33,31 +33,31 @@ </f:facet>
<h:panelGrid columns="2" styleClass="general-props-table" columnClasses="general-prop-cell"> - + <h:panelGroup layout="block"> <b>Name: </b> #{ResourceGroupUIBean.name} </h:panelGroup> - + <h:panelGroup layout="block"> <b>Date Created: </b> <h:outputText value="#{ResourceGroupUIBean.ctime}"> <f:converter converterId="UserDateTimeConverter" /> </h:outputText> </h:panelGroup> - + <h:panelGroup layout="block"> <h:outputText value="Description: " styleClass="BoldText"/> <h:outputText value="#{ResourceGroupUIBean.description}" rendered="#{!empty ResourceGroupUIBean.description}"/> <h:outputText value="none" style="font-style: italic" rendered="#{empty ResourceGroupUIBean.description}"/> </h:panelGroup> - + <h:panelGroup layout="block"> <b>Date Last Modified: </b> <h:outputText value="#{ResourceGroupUIBean.mtime}"> <f:converter converterId="UserDateTimeConverter" /> </h:outputText> </h:panelGroup> - + <h:panelGroup layout="block"> <b>Category: </b> #{ResourceGroupUIBean.groupCategoryName} </h:panelGroup> @@ -70,8 +70,8 @@ <h:panelGroup layout="block"> <b>Recursive: </b> #{ResourceGroupUIBean.recursive} </h:panelGroup> - - <h:panelGroup layout="block" rendered="#{!empty ResourceGroupUIBean.groupDefinition and + + <h:panelGroup layout="block" rendered="#{!empty ResourceGroupUIBean.groupDefinition and GlobalPermissionsUIBean.inventory}" > <b>Group Definition: </b> <h:outputLink value="/rhq/definition/group/view.xhtml"> @@ -79,7 +79,7 @@ <h:outputText value="#{ResourceGroupUIBean.groupDefinition.name}"/> </h:outputLink> </h:panelGroup> - + </h:panelGrid>
<h:form id="viewGeneralPropertiesForm"> @@ -117,13 +117,13 @@
<rich:dataGrid id="resourceTypeCounts" columns="#{ListResourceGroupMembersUIBean.numberOfColumns}" - value="#{ListResourceGroupMembersUIBean.resourceTypeCounts}" + value="#{ListResourceGroupMembersUIBean.resourceTypeCounts}" var="resourceTypeCountTuple">
<h:panelGroup layout="block" width="45%"> <h:outputText value="#{resourceTypeCountTuple.lefty}" /> (<h:outputText value="#{resourceTypeCountTuple.righty}" />) </h:panelGroup> - + </rich:dataGrid>
</rich:panel> @@ -145,8 +145,8 @@ <h:outputLabel for="showRecursiveMembers" value="Show Recursive Members: " /> <h:selectBooleanCheckbox id="showRecursiveMembers" value="#{ListResourceGroupMembersUIBean.showRecursiveMembers}" > <a4j:support event="onclick" - status="commonStatus" - reRender="resourceTypeCounts, resourceGroupMembersDataTable, resourceGroupMembersDataTableScroller" + status="commonStatus" + reRender="resourceTypeCounts, resourceGroupMembersDataTable, resourceGroupMembersDataTableScroller" actionListener="#{ListResourceGroupMembersUIBean.clearDataModel}" /> </h:selectBooleanCheckbox> </h:panelGrid> @@ -173,7 +173,7 @@ <f:facet name="header"> <onc:allSelect target="selectedResources" /> </f:facet> - + <onc:select name="selectedResources" value="#{resourceWithAvailability.original.resource.id}" rendered="#{resourceWithAvailability.original.explicit}"/> </rich:column> @@ -187,36 +187,41 @@ <f:param name="id" value="#{resourceWithAvailability.original.resource.id}"/>
<onc:icon name="Monitor" - url="/rhq/resource/monitor/graphs.xhtml" + url="/rhq/resource/monitor/graphs.xhtml" alt="Monitor" visible="#{monitorEnabled}"> </onc:icon>
<onc:icon name="Inventory" - url="/rhq/resource/inventory/view.xhtml" + url="/rhq/resource/inventory/view.xhtml" alt="Inventory"/>
<onc:icon name="Alert" - url="/rhq/resource/alert/listAlertDefinitions.xhtml" - alt="Alerts" + url="/rhq/resource/alert/listAlertDefinitions.xhtml" + alt="Alerts" visible="#{monitorEnabled}"/>
<onc:icon name="Configure" - url="/rhq/resource/configuration/view.xhtml" - alt="Configure" + url="/rhq/resource/configuration/view.xhtml" + alt="Configure" visible="#{resourceWithAvailability.original.resourceFacets.configuration}"/>
<onc:icon name="Operation" - url="/rhq/resource/operation/resourceOperationScheduleNew.xhtml" - alt="Operations" + url="/rhq/resource/operation/resourceOperationScheduleNew.xhtml" + alt="Operations" visible="#{resourceWithAvailability.original.resourceFacets.operation}"/>
- <onc:icon name="Content" - url="/rhq/resource/content/view.xhtml" + <onc:icon name="Events" + url="/rhq/resource/events/history.xhtml" + alt="Events" + visible="#{resourceWithAvailability.original.resourceFacets.event}"/> + + <onc:icon name="Content" + url="/rhq/resource/content/view.xhtml" alt="Content" visible="#{resourceWithAvailability.original.resourceFacets.content}"/> - - <!-- Is this necessary? It's being passed for all quick nav urls. --> + + <!-- Is this necessary? It's being passed for all quick nav urls. --> <f:param name="mode" value="list"/>
</onc:quickNav> @@ -267,19 +272,19 @@ <f:facet name="footer"> rich:columnGroup <rich:column colspan="8" width="100%"> - + <h:commandButton action="#{ListResourceGroupMembersUIBean.addNewResources}" value="ADD TO GROUP" - styleClass="on-pager-button buttonsmall" + styleClass="on-pager-button buttonsmall" rendered="#{GlobalPermissionsUIBean.inventory and !ResourceGroupUIBean.clusterGroup}" />
<onc:selectCommandButton action="#{DeleteResourcesFromGroupUIBean.removeSelectedResources}" value="REMOVE FROM GROUP" target="selectedResources" - styleClass="on-pager-button buttonsmall" + styleClass="on-pager-button buttonsmall" rendered="#{GlobalPermissionsUIBean.inventory and !ResourceGroupUIBean.clusterGroup}" /> - + <ui:param name="paginationDataTableName" value="resourceGroupMembersDataTable"/> <ui:param name="paginationDataModel" value="#{resourceGroupMembersDataModel}"/> <ui:param name="paginationPageControl" value="#{PageControl.ResourceGroupMemberList}"/> diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseGroups.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseGroups.xhtml index 491c13a..869b9dc 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseGroups.xhtml +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseGroups.xhtml @@ -27,7 +27,7 @@ <ui:param name="pageTitle" value="Browse Groups"/> <ui:param name="selectedTabName" value="Groups.#{param.subtab}"/> <ui:define name="content"> - + <a4j:keepAlive beanName="BrowseGroupsUIBean"/>
a4j:form @@ -37,7 +37,7 @@ </a4j:form> <h:form id="browseGroupsForm"> <input type="hidden" name="subtab" value="${param.subtab}"/> - + <p/> <h:panelGrid columns="3"> <h:outputText value="Search: " /> @@ -47,7 +47,7 @@ <ui:param name="defaultSearchText" value="#{param.search}" /> </ui:include>
- <a4j:commandButton id="searchButtonJSF" value="GO" + <a4j:commandButton id="searchButtonJSF" value="GO" reRender="browseGroupsDataTable, browseGroupsDataTableScroller" status="commonStatus" actionListener="#{BrowseGroupsUIBean.clearDataModel}" @@ -89,38 +89,38 @@ onc:quickNav ui:remove<!-- Pass 'groupId' param to all child icons. --></ui:remove> <f:param name="groupId" value="#{item.resourceGroup.id}"/> - + ui:remove <!-- Include the Alert, Event and Content tabs even though we currently don't support them for Groups, so that the icon renderer can still render spacers. --> </ui:remove> - + <onc:icon name="Monitor" url="/rhq/group/monitor/graphs.xhtml" alt="Monitor" visible="#{monitorEnabled and item.category.name eq 'COMPATIBLE'}"> <f:param name="category" value="#{item.category.name}"/> </onc:icon> - + <onc:icon name="Inventory" url="/rhq/group/inventory/view.xhtml" alt="Inventory"> <f:param name="category" value="#{item.category.name}"/> </onc:icon> - + <onc:icon name="Alert" url="/rhq/group/alert/listGroupAlertDefinitions.xhtml" alt="Alert" visible="#{monitorEnabled and item.category.name eq 'COMPATIBLE'}"/> - + <onc:icon name="Configure" url="/rhq/group/configuration/viewCurrent.xhtml" alt="Configure" visible="#{item.category.name eq 'COMPATIBLE' and item.resourceFacets.configuration}"> <f:param name="category" value="#{item.category.name}"/> </onc:icon> - + <onc:icon name="Operation" url="/rhq/group/operation/groupOperationScheduleNew.xhtml" alt="Operations" visible="#{item.category.name eq 'COMPATIBLE' and item.resourceFacets.operation}"> <f:param name="category" value="#{item.category.name}"/> </onc:icon> - + <onc:icon name="Events" url="/rhq/resource/events/history.xhtml" alt="Events" - visible="#{false and item.category.name eq 'COMPATIBLE' and + visible="#{item.category.name eq 'COMPATIBLE' and item.resourceFacets.event}"/>
<onc:icon name="Content" url="/rhq/resource/content/view.xhtml" alt="Content" @@ -152,7 +152,7 @@
<h:outputText value="#{item.resourceGroup.resourceType.name}" /> </rich:column> - + rich:column <f:facet name="header"> <onc:sortableColumnHeader sort="resourceType.plugin"> @@ -162,7 +162,7 @@
<h:outputText value="#{item.resourceGroup.resourceType.plugin}" /> </rich:column> - + rich:column <f:facet name="header"> <onc:sortableColumnHeader sort="description"> @@ -180,7 +180,7 @@ </onc:sortableColumnHeader> </f:facet>
- <h:outputText value="#{item.explicitFormatted}" + <h:outputText value="#{item.explicitFormatted}" escape="false" /> </rich:column>
@@ -191,7 +191,7 @@ </onc:sortableColumnHeader> </f:facet>
- <h:outputText value="#{item.implicitFormatted}" + <h:outputText value="#{item.implicitFormatted}" escape="false" /> </rich:column>
commit 2d3f784933a13f1049b78186adacf3a88ae60e58 Author: Joseph Marques joseph@redhat.com Date: Sun Jun 27 18:15:39 2010 -0400
BZ-608057: improve performance of measurement schedules updates
* refactor workflow to batch updates per agent, not per resource ** if X resources across Y agents, fix yields (X-Y) LESS roundtrips to DB ** if X resources across Y agents, fix yields (X-Y) LESS roundtrips between server and agent
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementScheduleManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementScheduleManagerBean.java index 5a5a829..546a020 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementScheduleManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementScheduleManagerBean.java @@ -242,6 +242,7 @@ public class MeasurementScheduleManagerBean implements MeasurementScheduleManage return findSchedulesByResourcesAndDefinitions(subject, resourceIds, new int[] { definitionId }); }
+ @SuppressWarnings("unchecked") public List<MeasurementSchedule> findSchedulesByResourceIdsAndDefinitionIds(int[] resourceIds, int[] definitionIds) { Query query = entityManager.createNamedQuery(MeasurementSchedule.FIND_BY_RESOURCE_IDS_AND_DEFINITION_IDS); query.setParameter("definitionIds", ArrayUtils.wrapInList(definitionIds)); @@ -250,7 +251,6 @@ public class MeasurementScheduleManagerBean implements MeasurementScheduleManage return results; }
- @SuppressWarnings("unchecked") private List<MeasurementSchedule> findSchedulesByResourcesAndDefinitions(Subject subject, int[] resourceIds, int[] definitionIds) { for (int resourceId : resourceIds) { @@ -303,55 +303,6 @@ public class MeasurementScheduleManagerBean implements MeasurementScheduleManage return; }
- // callers to this method need to perform authorization - private void disableSchedule(Subject subject, int resourceId, int[] measurementDefinitionIds) { - Resource resource = resourceManager.getResourceById(subject, resourceId); - - List<MeasurementSchedule> measurementSchedules = findSchedulesByResourceIdAndDefinitionIds(subject, resourceId, - measurementDefinitionIds); - ResourceMeasurementScheduleRequest resourceMeasurementScheduleRequest = new ResourceMeasurementScheduleRequest( - resourceId); - for (MeasurementSchedule measurementSchedule : measurementSchedules) { - measurementSchedule.setEnabled(false); - MeasurementScheduleRequest measurementScheduleRequest = new MeasurementScheduleRequest(measurementSchedule); - resourceMeasurementScheduleRequest.addMeasurementScheduleRequest(measurementScheduleRequest); - } - - Set<ResourceMeasurementScheduleRequest> resourceMeasurementScheduleRequests = new HashSet<ResourceMeasurementScheduleRequest>(); - resourceMeasurementScheduleRequests.add(resourceMeasurementScheduleRequest); - boolean synced = sendUpdatedSchedulesToAgent(resource.getAgent(), resourceMeasurementScheduleRequests); - if (!synced) { - resource.setAgentSynchronizationNeeded(); - } - entityManager.merge(resource); - - return; - } - - // callers to this method need to perform authorization - private void enableSchedule(Subject subject, int resourceId, int[] measurementDefinitionIds) { - Resource resource = resourceManager.getResourceById(subject, resourceId); - List<MeasurementSchedule> measurementSchedules = findSchedulesByResourceIdAndDefinitionIds(subject, resourceId, - measurementDefinitionIds); - ResourceMeasurementScheduleRequest resourceMeasurementScheduleRequest = new ResourceMeasurementScheduleRequest( - resourceId); - for (MeasurementSchedule measurementSchedule : measurementSchedules) { - measurementSchedule.setEnabled(true); - MeasurementScheduleRequest measurementScheduleRequest = new MeasurementScheduleRequest(measurementSchedule); - resourceMeasurementScheduleRequest.addMeasurementScheduleRequest(measurementScheduleRequest); - } - - Set<ResourceMeasurementScheduleRequest> resourceMeasurementScheduleRequests = new HashSet<ResourceMeasurementScheduleRequest>(); - resourceMeasurementScheduleRequests.add(resourceMeasurementScheduleRequest); - boolean synced = sendUpdatedSchedulesToAgent(resource.getAgent(), resourceMeasurementScheduleRequests); - if (!synced) { - resource.setAgentSynchronizationNeeded(); - } - entityManager.merge(resource); - - return; - } - @RequiredPermissions( { @RequiredPermission(Permission.MANAGE_INVENTORY), @RequiredPermission(Permission.MANAGE_SETTINGS) }) public void disableAllDefaultCollections(Subject subject) { @@ -546,6 +497,213 @@ public class MeasurementScheduleManagerBean implements MeasurementScheduleManage } }
+ public int updateSchedulesForContext(Subject subject, EntityContext context, int[] measurementDefinitionIds, + long collectionInterval) { + collectionInterval = verifyMinimumCollectionInterval(collectionInterval); + + String measurementScheduleSubQuery = getMeasurementScheduleSubQueryForContext(subject, context, + measurementDefinitionIds); + + String updateQuery = "" // + + "UPDATE MeasurementSchedule " // + + " SET interval = :interval, " // + + " enabled = true " // + + " WHERE id IN ( " + measurementScheduleSubQuery + " ) "; + + Query query = entityManager.createQuery(updateQuery); + query.setParameter("interval", collectionInterval); + int affectedRows = query.executeUpdate(); + + notifyAgentsOfScheduleUpdates(context, measurementScheduleSubQuery); + + return affectedRows; + } + + public int enableSchedulesForContext(Subject subject, EntityContext context, int[] measurementDefinitionIds) { + String measurementScheduleSubQuery = getMeasurementScheduleSubQueryForContext(subject, context, + measurementDefinitionIds); + + String updateQuery = "" // + + "UPDATE MeasurementSchedule " // + + " SET enabled = true " // + + " WHERE id IN ( " + measurementScheduleSubQuery + " ) "; + + Query query = entityManager.createQuery(updateQuery); + int affectedRows = query.executeUpdate(); + + notifyAgentsOfScheduleUpdates(context, measurementScheduleSubQuery); + + return affectedRows; + } + + public int disableSchedulesForContext(Subject subject, EntityContext context, int[] measurementDefinitionIds) { + String measurementScheduleSubQuery = getMeasurementScheduleSubQueryForContext(subject, context, + measurementDefinitionIds); + + String updateQuery = "" // + + "UPDATE MeasurementSchedule " // + + " SET enabled = false " // + + " WHERE id IN ( " + measurementScheduleSubQuery + " ) "; + + Query query = entityManager.createQuery(updateQuery); + int affectedRows = query.executeUpdate(); + + notifyAgentsOfScheduleUpdates(context, measurementScheduleSubQuery); + + return affectedRows; + } + + @SuppressWarnings("unchecked") + private void notifyAgentsOfScheduleUpdates(EntityContext context, String measurementScheduleSubQuery) { + + List<Integer> agentIds = new ArrayList<Integer>(); + try { + String agentsQueryString = "" // + + "SELECT DISTINCT ms.resource.agent.id " // + + " FROM MeasurementSchedule ms " // + + " WHERE ms.id IN ( " + measurementScheduleSubQuery + " ) "; + log.info("agentsQueryString: " + agentsQueryString); + Query agentsQuery = entityManager.createQuery(agentsQueryString); + agentIds = agentsQuery.getResultList(); + } catch (Throwable t) { + log.error("Could not notify agents of updates", t); + } + + // use composite query -- won't load managed entities, requires minimal wire transfer + String scheduleRequestQueryString = "" // + + "SELECT ms.resource.id, " // + + " ms.id, " // + + " ms.definition.name, " // + + " ms.interval, " // + + " ms.enabled, " // + + " ms.definition.dataType, " // + + " ms.definition.rawNumericType " // + + " FROM MeasurementSchedule ms " // + + " WHERE ms.id IN ( " + measurementScheduleSubQuery + " ) " // + + " AND ms.resource.agent.id = :agentId"; + log.info("scheduleRequestQueryString: " + scheduleRequestQueryString); + Query scheduleRequestQuery = entityManager.createQuery(scheduleRequestQueryString); + + Map<Integer, ResourceMeasurementScheduleRequest> agentRequests = new HashMap<Integer, ResourceMeasurementScheduleRequest>(); + for (int nextAgentId : agentIds) { + scheduleRequestQuery.setParameter("agentId", nextAgentId); + List<Object[]> scheduleRequests = scheduleRequestQuery.getResultList(); + for (Object[] nextScheduleDataSet : scheduleRequests) { + int resourceId = (Integer) nextScheduleDataSet[0]; + ResourceMeasurementScheduleRequest resourceRequest = agentRequests.get(resourceId); + if (resourceRequest == null) { + resourceRequest = new ResourceMeasurementScheduleRequest(resourceId); + agentRequests.put(resourceId, resourceRequest); + } + + MeasurementScheduleRequest requestData = new MeasurementScheduleRequest( // + (Integer) nextScheduleDataSet[1], // scheduleId + (String) nextScheduleDataSet[2], // definitionName, + (Long) nextScheduleDataSet[3], // interval, + (Boolean) nextScheduleDataSet[4], // enabled, + (DataType) nextScheduleDataSet[5], // dataType, + (NumericType) nextScheduleDataSet[6]); // awNumericType + resourceRequest.addMeasurementScheduleRequest(requestData); + } + + boolean markResources = false; + try { + Agent nextAgent = agentManager.getAgentByID(nextAgentId); + AgentClient agentClient = agentManager.getAgentClient(nextAgent); + + boolean couldPing = agentClient.ping(2000); // see if agent is up for sending + if (couldPing) { + Set<ResourceMeasurementScheduleRequest> requestsToSend = new HashSet<ResourceMeasurementScheduleRequest>( + agentRequests.values()); + agentClient.getMeasurementAgentService().scheduleCollection(requestsToSend); + } else { + log.error("Could not send measurement schedule updates to agent[id=" + nextAgentId + + "], marking resources for update; agent ping failed"); + markResources = true; + } + } catch (Throwable t) { + log.error("Could not send measurement schedule updates to agent[id=" + nextAgentId + + "], marking resources for update", t); + markResources = true; + } + + if (markResources) { + markResources(context, nextAgentId); + } + } + } + + private void markResources(EntityContext context, int agentId) { + ResourceCriteria criteria = new ResourceCriteria(); + if (context.category == EntityContext.Category.Resource) { + criteria.addFilterId(context.resourceId); + } else if (context.category == EntityContext.Category.ResourceGroup) { + criteria.addFilterImplicitGroupIds(context.groupId); + } else if (context.category == EntityContext.Category.AutoGroup) { + criteria.addFilterParentResourceId(context.parentResourceId); + criteria.addFilterResourceTypeId(context.resourceTypeId); + } + criteria.addFilterAgentId(agentId); + + try { + CriteriaQueryGenerator generator = new CriteriaQueryGenerator(criteria); + generator.alterProjection("resource.id"); + String resourceSubQuery = generator.getParameterReplacedQuery(false); + + String markResourceQueryString = "" // + + "UPDATE Resource res " // + + " SET res.mtime = :now " // + + " WHERE res.id IN ( " + resourceSubQuery + " ) "; + log.info("markResourceQueryString: " + markResourceQueryString); + + Query markResourceQuery = entityManager.createQuery(markResourceQueryString); + markResourceQuery.setParameter("now", System.currentTimeMillis()); + int affectedRows = markResourceQuery.executeUpdate(); + log.info("Marked " + affectedRows + " for future measurement scheudle update"); + } catch (Throwable t) { + log.error("Could not notify agents of updates", t); + } + } + + public String getMeasurementScheduleSubQueryForContext(Subject subject, EntityContext context, + int[] measurementDefinitionIds) { + if (context.category == EntityContext.Category.Resource) { + if (authorizationManager.hasResourcePermission(subject, Permission.MANAGE_MEASUREMENTS, context.resourceId) == false) { + throw new PermissionException("User [" + subject.getName() + + "] does not have permission to manage schedules for resource[id=" + context.resourceId + "]"); + } + } else if (context.category == EntityContext.Category.ResourceGroup) { + if (authorizationManager.hasGroupPermission(subject, Permission.MANAGE_MEASUREMENTS, context.groupId) == false) { + throw new PermissionException("User [" + subject.getName() + + "] does not have permission to manage schedules for resourceGroup[id=" + context.groupId + "]"); + } + } else if (context.category == EntityContext.Category.AutoGroup) { + if (authorizationManager.hasAutoGroupPermission(subject, Permission.MANAGE_MEASUREMENTS, + context.parentResourceId, context.resourceTypeId) == false) { + throw new PermissionException("User [" + subject.getName() + + "] does not have permission to manage schedules for autoGroup[parentResourceId=" + + context.parentResourceId + ", resourceTypeId=" + context.resourceTypeId + "]"); + } + } + + MeasurementScheduleCriteria criteria = new MeasurementScheduleCriteria(); + if (context.category == EntityContext.Category.Resource) { + criteria.addFilterResourceId(context.resourceId); + } else if (context.category == EntityContext.Category.ResourceGroup) { + criteria.addFilterResourceGroupId(context.groupId); + } else if (context.category == EntityContext.Category.AutoGroup) { + criteria.addFilterAutoGroupParentResourceId(context.parentResourceId); + criteria.addFilterAutoGroupResourceTypeId(context.resourceTypeId); + } + criteria.addFilterDefinitionIds(ArrayUtils.wrapInArray(measurementDefinitionIds)); + + CriteriaQueryGenerator generator = new CriteriaQueryGenerator(criteria); + generator.alterProjection("measurementschedule.id"); + String measurementScheduleSubQuery = generator.getParameterReplacedQuery(false); + + return measurementScheduleSubQuery; + } + private void setAgentSynchronizationNeededByDefinitionsForAgent(int agentId, List<Integer> measurementDefinitionIds) { String updateSQL = "" // + "UPDATE Resource res " // @@ -562,93 +720,23 @@ public class MeasurementScheduleManagerBean implements MeasurementScheduleManage log.info("" + updateCount + " resources mtime fields were updated as a result of this metric template update"); }
- public void updateSchedules(Subject subject, int resourceId, int[] measurementDefinitionIds, long collectionInterval) { - collectionInterval = verifyMinimumCollectionInterval(collectionInterval); - Resource resource = resourceManager.getResourceById(subject, resourceId); - if (!authorizationManager.hasResourcePermission(subject, Permission.MANAGE_MEASUREMENTS, resourceId)) { - throw new PermissionException("User[" + subject.getName() - + "] does not have permission to change metric collection schedules for resource[id=" + resourceId - + "]"); - } - - List<MeasurementSchedule> measurementSchedules = findSchedulesByResourceIdAndDefinitionIds(subject, resourceId, - measurementDefinitionIds); - ResourceMeasurementScheduleRequest resourceMeasurementScheduleRequest = new ResourceMeasurementScheduleRequest( - resourceId); - for (MeasurementSchedule measurementSchedule : measurementSchedules) { - measurementSchedule.setEnabled(true); - measurementSchedule.setInterval(collectionInterval); - MeasurementScheduleRequest measurementScheduleRequest = new MeasurementScheduleRequest(measurementSchedule); - resourceMeasurementScheduleRequest.addMeasurementScheduleRequest(measurementScheduleRequest); - } - - Set<ResourceMeasurementScheduleRequest> resourceMeasurementScheduleRequests = new HashSet<ResourceMeasurementScheduleRequest>(); - resourceMeasurementScheduleRequests.add(resourceMeasurementScheduleRequest); - boolean synced = sendUpdatedSchedulesToAgent(resource.getAgent(), resourceMeasurementScheduleRequests); - if (!synced) { - resource.setAgentSynchronizationNeeded(); - } - entityManager.merge(resource); - - return; - } - - /** - * Enables all collection schedules attached to the given auto group whose schedules are based off the given - * definitions. This does not enable the "templates" (aka definitions). If the passed group does not exist an - * Exception is thrown. - * - * @param subject Subject of the caller - * @param measurementDefinitionIds the definitions on which the schedules to update are based - * @param parentResourceId the Id of the parent resource - * @param childResourceType the ID of the {@link ResourceType} of the children that form the autogroup - * @param collectionInterval the new interval - * - * @see org.rhq.enterprise.server.measurement.MeasurementScheduleManagerLocal#updateSchedulesForAutoGroup(org.rhq.core.domain.auth.Subject, - * int[], int, int, long) - */ public void updateSchedulesForAutoGroup(Subject subject, int parentResourceId, int childResourceType, int[] measurementDefinitionIds, long collectionInterval) { // don't verify minimum collection interval here, it will be caught by updateMeasurementSchedules callee - List<Resource> resources = resourceGroupManager.findResourcesForAutoGroup(subject, parentResourceId, - childResourceType); - for (Resource resource : resources) { - updateSchedules(subject, resource.getId(), measurementDefinitionIds, collectionInterval); - } + updateSchedulesForContext(subject, EntityContext.forAutoGroup(parentResourceId, childResourceType), + measurementDefinitionIds, collectionInterval); }
- /** - * Disable the measurement schedules for the passed definitions of the rsource ot the passed auto group. - * - * @param subject - * @param measurementDefinitionIds - * @param parentResourceId - * @param childResourceType - */ public void disableSchedulesForAutoGroup(Subject subject, int parentResourceId, int childResourceType, int[] measurementDefinitionIds) { - List<Resource> resources = resourceGroupManager.findResourcesForAutoGroup(subject, parentResourceId, - childResourceType); - for (Resource resource : resources) { - disableSchedulesForResource(subject, resource.getId(), measurementDefinitionIds); - } + disableSchedulesForContext(subject, EntityContext.forAutoGroup(parentResourceId, childResourceType), + measurementDefinitionIds); }
- /** - * Enable the measurement schedules for the passed definitions of the rsource ot the passed auto group. - * - * @param subject - * @param measurementDefinitionIds - * @param parentResourceId - * @param childResourceType - */ public void enableSchedulesForAutoGroup(Subject subject, int parentResourceId, int childResourceType, int[] measurementDefinitionIds) { - List<Resource> resources = resourceGroupManager.findResourcesForAutoGroup(subject, parentResourceId, - childResourceType); - for (Resource resource : resources) { - enableSchedulesForResource(subject, resource.getId(), measurementDefinitionIds); - } + enableSchedulesForContext(subject, EntityContext.forAutoGroup(parentResourceId, childResourceType), + measurementDefinitionIds); }
/** @@ -687,7 +775,7 @@ public class MeasurementScheduleManagerBean implements MeasurementScheduleManage agentClient.getMeasurementAgentService().updateCollection(resourceMeasurementScheduleRequest); return true; // successfully sync'ed schedules down to the agent } catch (Throwable t) { - log.error("Error updating MeasurementSchedules for Agent[id=" + agent.getId() + "]: " + t); + log.error("Error updating MeasurementSchedules for Agent[id=" + agent.getId() + "]: ", t); } return false; // catch all and presume the live sync failed } @@ -998,31 +1086,11 @@ public class MeasurementScheduleManagerBean implements MeasurementScheduleManage }
public void disableSchedulesForResource(Subject subject, int resourceId, int[] measurementDefinitionIds) { - if (!authorizationManager.hasResourcePermission(subject, Permission.MANAGE_MEASUREMENTS, resourceId)) { - throw new PermissionException("User[" + subject.getName() - + "] does not have permission to disable metric collection schedules for resource[id=" + resourceId - + "]"); - } - - disableSchedule(subject, resourceId, measurementDefinitionIds); - - return; + disableSchedulesForContext(subject, EntityContext.forResource(resourceId), measurementDefinitionIds); }
- /** - * Disable the measurement schedules for the passed definitions for the resources of the passed compatible group. - */ public void disableSchedulesForCompatibleGroup(Subject subject, int groupId, int[] measurementDefinitionIds) { - if (!authorizationManager.hasGroupPermission(subject, Permission.MANAGE_MEASUREMENTS, groupId)) { - throw new PermissionException("User[" + subject.getName() - + "] does not have permission to disable metric collection schedules for resourceGroup[id=" + groupId - + "]"); - } - - List<Integer> explicitIds = resourceManager.findExplicitResourceIdsByResourceGroup(groupId); - for (Integer resourceId : explicitIds) { - disableSchedule(subject, resourceId, measurementDefinitionIds); - } + disableSchedulesForContext(subject, EntityContext.forGroup(groupId), measurementDefinitionIds); }
public void disableMeasurementTemplates(Subject subject, int[] measurementDefinitionIds) { @@ -1030,29 +1098,11 @@ public class MeasurementScheduleManagerBean implements MeasurementScheduleManage }
public void enableSchedulesForResource(Subject subject, int resourceId, int[] measurementDefinitionIds) { - if (!authorizationManager.hasResourcePermission(subject, Permission.MANAGE_MEASUREMENTS, resourceId)) { - throw new PermissionException("User[" + subject.getName() - + "] does not have permission to enable metric collection schedules for resource[id=" + resourceId - + "]"); - } - - enableSchedule(subject, resourceId, measurementDefinitionIds); + enableSchedulesForContext(subject, EntityContext.forResource(resourceId), measurementDefinitionIds); }
- /** - * Enable the measurement schedules for the passed definitions for the resources of the passed compatible group. - */ public void enableSchedulesForCompatibleGroup(Subject subject, int groupId, int[] measurementDefinitionIds) { - if (!authorizationManager.hasGroupPermission(subject, Permission.MANAGE_MEASUREMENTS, groupId)) { - throw new PermissionException("User[" + subject.getName() - + "] does not have permission to enable metric collection schedules for resourceGroup[id=" + groupId - + "]"); - } - - List<Integer> explicitIds = resourceManager.findExplicitResourceIdsByResourceGroup(groupId); - for (Integer resourceId : explicitIds) { - enableSchedule(subject, resourceId, measurementDefinitionIds); - } + enableSchedulesForContext(subject, EntityContext.forGroup(groupId), measurementDefinitionIds); }
public void enableMeasurementTemplates(Subject subject, int[] measurementDefinitionIds) { @@ -1078,7 +1128,8 @@ public class MeasurementScheduleManagerBean implements MeasurementScheduleManage
public void updateSchedulesForResource(Subject subject, int resourceId, int[] measurementDefinitionIds, long collectionInterval) { - updateSchedules(subject, resourceId, measurementDefinitionIds, collectionInterval); + updateSchedulesForContext(subject, EntityContext.forResource(resourceId), measurementDefinitionIds, + collectionInterval); }
/** @@ -1097,10 +1148,8 @@ public class MeasurementScheduleManagerBean implements MeasurementScheduleManage public void updateSchedulesForCompatibleGroup(Subject subject, int groupId, int[] measurementDefinitionIds, long collectionInterval) { // don't verify minimum collection interval here, it will be caught by updateMeasurementSchedules callee - List<Integer> explicitIds = resourceManager.findExplicitResourceIdsByResourceGroup(groupId); - for (Integer resourceId : explicitIds) { - updateSchedules(subject, resourceId, measurementDefinitionIds, collectionInterval); - } + updateSchedulesForContext(subject, EntityContext.forGroup(groupId), measurementDefinitionIds, + collectionInterval); }
public void updateMeasurementTemplates(Subject subject, int[] measurementDefinitionIds, long collectionInterval) { diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementScheduleManagerLocal.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementScheduleManagerLocal.java index 12c7358..1ef3012 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementScheduleManagerLocal.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementScheduleManagerLocal.java @@ -257,6 +257,13 @@ public interface MeasurementScheduleManagerLocal { PageList<MeasurementScheduleComposite> getMeasurementScheduleCompositesByContext(Subject subject, EntityContext context, PageControl pc);
+ int updateSchedulesForContext(Subject subject, EntityContext context, int[] measurementDefinitionIds, + long collectionInterval); + + int enableSchedulesForContext(Subject subject, EntityContext context, int[] measurementDefinitionIds); + + int disableSchedulesForContext(Subject subject, EntityContext context, int[] measurementDefinitionIds); + // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! // // The following are shared with the Remote Interface
commit 942920432369b0be766ae653325678d312cda0a9 Author: Joseph Marques joseph@redhat.com Date: Sun Jun 27 18:09:40 2010 -0400
BZ-608461: fix units for Hibernate statistics service "query execution max time" metric
diff --git a/modules/plugins/hibernate/src/main/resources/META-INF/rhq-plugin.xml b/modules/plugins/hibernate/src/main/resources/META-INF/rhq-plugin.xml index 555d5d1..ad8a9cf 100644 --- a/modules/plugins/hibernate/src/main/resources/META-INF/rhq-plugin.xml +++ b/modules/plugins/hibernate/src/main/resources/META-INF/rhq-plugin.xml @@ -51,7 +51,7 @@
<metric displayName="Query Execution Max Time" property="QueryExecutionMaxTime" description="The amount of time taken by the slowest recorded query since the statistics were reset" - category="performance" displayType="summary"/> + category="performance" displayType="summary" units="milliseconds" />
<metric displayName="Entity Update Count" property="EntityUpdateCount" description="The global number of entity updates since the statistics were reset"
commit b54e2cab7d36311929e596afd1bc0b8f6647db2c Author: Joseph Marques joseph@redhat.com Date: Sun Jun 27 18:08:39 2010 -0400
add the ability to filter ResourceCriteria by owning agent as well as gorup membership
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/ResourceCriteria.java b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/ResourceCriteria.java index 2a1d55d..ad52f4c 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/ResourceCriteria.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/ResourceCriteria.java @@ -22,6 +22,9 @@ */ package org.rhq.core.domain.criteria;
+import java.util.Arrays; +import java.util.List; + import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlRootElement; @@ -30,12 +33,8 @@ import org.rhq.core.domain.measurement.AvailabilityType; import org.rhq.core.domain.resource.InventoryStatus; import org.rhq.core.domain.resource.Resource; import org.rhq.core.domain.resource.ResourceCategory; -import org.rhq.core.domain.resource.ResourceType; import org.rhq.core.domain.util.PageOrdering;
-import java.util.Arrays; -import java.util.List; - /** * @author Joseph Marques */ @@ -59,10 +58,13 @@ public class ResourceCriteria extends TaggedCriteria { private String filterParentResourceName; // needs overrides private Integer filterParentResourceTypeId; // needs overrides private String filterAgentName; // needs overrides + private Integer filterAgentId; // needs overrides private AvailabilityType filterCurrentAvailability; // needs overrides private Long filterStartItime; private Long filterEndItime; private List<Integer> filterIds; // needs overrides + private List<Integer> filterExplicitGroupIds; // requires overrides + private List<Integer> filterImplicitGroupIds; // requires overrides
private boolean fetchResourceType; private boolean fetchChildResources; @@ -107,10 +109,21 @@ public class ResourceCriteria extends TaggedCriteria { filterOverrides.put("parentResourceName", "parentResource.name like ?"); filterOverrides.put("parentResourceTypeId", "parentResource.resourceType.id = ?"); filterOverrides.put("agentName", "agent.name like ?"); + filterOverrides.put("agentId", "agent.id = ?"); filterOverrides.put("currentAvailability", "currentAvailability.availabilityType = ?"); filterOverrides.put("startItime", "itime >= ?"); filterOverrides.put("endItime", "itime <= ?"); filterOverrides.put("ids", "id IN ( ? )"); + filterOverrides.put("explicitGroupIds", "" // + + "id IN ( SELECT ires.id " // + + " FROM Resource ires " // + + " JOIN ires.explicitGroups explicitGroup " // + + " WHERE explicitGroup.id IN ( ? ) )"); + filterOverrides.put("implicitGroupIds", "" // + + "id IN ( SELECT ires.id " // + + " FROM Resource ires " // + + " JOIN ires.implicitGroups implicitGroup " // + + " WHERE implicitGroup.id IN ( ? ) )");
sortOverrides.put("resourceTypeName", "resourceType.name"); sortOverrides.put("resourceCategory", "resourceType.category"); @@ -176,11 +189,15 @@ public class ResourceCriteria extends TaggedCriteria { public void addFilterParentResourceTypeId(int filterParentResourceTypeId) { this.filterParentResourceTypeId = filterParentResourceTypeId; } - + public void addFilterAgentName(String filterAgentName) { this.filterAgentName = filterAgentName; }
+ public void addFilterAgentId(Integer filterAgentId) { + this.filterAgentId = filterAgentId; + } + public void addFilterCurrentAvailability(AvailabilityType filterCurrentAvailability) { this.filterCurrentAvailability = filterCurrentAvailability; } @@ -197,6 +214,13 @@ public class ResourceCriteria extends TaggedCriteria { this.filterIds = Arrays.asList(filterIds); }
+ public void addFilterExplicitGroupIds(Integer... filterExplicitGroupIds) { + this.filterExplicitGroupIds = Arrays.asList(filterExplicitGroupIds); + } + + public void addFilterImplicitGroupIds(Integer... filterImplicitGroupIds) { + this.filterImplicitGroupIds = Arrays.asList(filterImplicitGroupIds); + }
public void fetchResourceType(boolean fetchResourceType) { this.fetchResourceType = fetchResourceType;
commit 0c05256ee75798d6f859dbf2a506f50fc42c63b2 Author: Joseph Marques joseph@redhat.com Date: Sun Jun 27 18:07:53 2010 -0400
add some debugging statements to InventoryManager, useful for testing "modified" resource sync logic
diff --git a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/InventoryManager.java b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/InventoryManager.java index 929a5b6..0c86f8f 100644 --- a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/InventoryManager.java +++ b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/InventoryManager.java @@ -2151,6 +2151,12 @@ public class InventoryManager extends AgentService implements ContainerService, log.info("Got unknown resource: " + syncInfo.getId()); } else { Resource resource = container.getResource(); + if (log.isDebugEnabled()) { + log.debug("Local Resource: id=" + resource.getId() + ", status=" + resource.getInventoryStatus() + + ", mtime=" + resource.getMtime()); + log.debug("Sync Resource: " + syncInfo.getId() + ", status=" + syncInfo.getInventoryStatus() + + ", mtime=" + syncInfo.getMtime()); + }
if (resource.getInventoryStatus() != InventoryStatus.COMMITTED && syncInfo.getInventoryStatus() == InventoryStatus.COMMITTED) {
commit 284a8fd0655a573cdc7425de35fddaf6bffc8cf7 Author: Joseph Marques joseph@redhat.com Date: Sun Jun 27 18:07:23 2010 -0400
add the ability to check if all members of some autogroup have a specified Permission
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/auth/Subject.java b/modules/core/domain/src/main/java/org/rhq/core/domain/auth/Subject.java index 31119fa..477a128 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/auth/Subject.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/auth/Subject.java @@ -111,6 +111,19 @@ import org.rhq.core.domain.util.Recordizable; + "FROM Resource res, IN (res.implicitGroups) g, IN (g.roles) r, IN (r.subjects) s, IN (r.permissions) p " + "WHERE s = :subject AND res.id = :resourceId AND p = :permission"),
+ @NamedQuery(name = Subject.QUERY_HAS_AUTO_GROUP_PERMISSION, query = "" // + + "SELECT COUNT(res.id) " // + + " FROM Resource res " // + + " WHERE res.parentResource.id = :parentResourceId " // + + " AND res.resourceType.id = :resourceTypeId " // + + " AND ( :subjectId = -1 OR res.id IN ( SELECT ires " // + + " FROM Resource ires " // + + " JOIN ires.implicitGroups g " // + + " JOIN g.roles r " // + + " JOIN r.permissions p " // + + " JOIN r.subjects s " // + + " WHERE s.id = :subjectId and p = :permission ) ) "), + @NamedQuery(name = Subject.QUERY_CAN_VIEW_RESOURCE, query = "SELECT COUNT(res) " + "FROM Resource res, IN (res.implicitGroups) g, IN (g.roles) r, IN (r.subjects) s " + "WHERE s = :subject AND res.id = :resourceId"), @@ -198,6 +211,7 @@ public class Subject implements Serializable, Recordizable { public static final String QUERY_HAS_GLOBAL_PERMISSION = "Subject.hasGlobalPermission"; public static final String QUERY_HAS_GROUP_PERMISSION = "Subject.hasGroupPermission"; public static final String QUERY_HAS_RESOURCE_PERMISSION = "Subject.hasResourcePermission"; + public static final String QUERY_HAS_AUTO_GROUP_PERMISSION = "Subject.hasAutoGroupPermission";
public static final String QUERY_CAN_VIEW_RESOURCE = "Subject.canViewResource"; public static final String QUERY_CAN_VIEW_RESOURCES = "Subject.canViewResources"; diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/authz/AuthorizationManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/authz/AuthorizationManagerBean.java index dccedaa..d675177 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/authz/AuthorizationManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/authz/AuthorizationManagerBean.java @@ -138,6 +138,31 @@ public class AuthorizationManagerBean implements AuthorizationManagerLocal { return (count != 0); }
+ public boolean hasAutoGroupPermission(Subject subject, Permission permission, int parentResourceId, + int resourceTypeId) { + if (isInventoryManager(subject)) { + return true; + } + + Query query = entityManager.createNamedQuery(Subject.QUERY_HAS_AUTO_GROUP_PERMISSION); + query.setParameter("permission", permission); + query.setParameter("parentResourceId", parentResourceId); + query.setParameter("resourceTypeId", resourceTypeId); + + query.setParameter("subject", -1); + long baseCount = (Long) query.getSingleResult(); + + query.setParameter("subject", subject); + long subjectCount = (Long) query.getSingleResult(); + + /* + * an auto-group is viewable if the count of resources with parent/type filters is identical + * to the count of those same resources additionally filtered by standard authorization + * + */ + return (baseCount == subjectCount); + } + public boolean canViewResource(Subject subject, int resourceId) { if (isInventoryManager(subject)) { return true; diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/authz/AuthorizationManagerLocal.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/authz/AuthorizationManagerLocal.java index cbf8cc4..5f04458 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/authz/AuthorizationManagerLocal.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/authz/AuthorizationManagerLocal.java @@ -120,6 +120,20 @@ public interface AuthorizationManagerLocal { boolean hasGroupPermission(Subject subject, Permission permission, int groupId);
/** + * Returns true if the current user possesses either: 1) the specified resource permission for the specified + * auto-group, or 2) the global MANAGE_INVENTORY permission which, by definition, gives full access to the + * inventory (all resources and all groups) + * + * @param subject the current subject or caller + * @param permission a resource permission (i.e. permission.getTarget() == Permission.Target.RESOURCE) + * @param parentResourceId the id of the parent resource of the auto-group to check permissions against + * @param parentResourceId the id of the resource type filter of the auto-group to check permissions against + * + * @return true if the current user possesses the specified resource permission for the specified auto-group + */ + boolean hasAutoGroupPermission(Subject subject, Permission permission, int parentResourceId, int resourceTypeId); + + /** * Returns true if the current user possesses the specified global permission. * * @param subject the current subject or caller
commit f2ba4a8dd48621dbb6ff0da1beeeadcadbaa359d Author: Joseph Marques joseph@redhat.com Date: Sun Jun 27 18:06:49 2010 -0400
add method to obtain the full, parameter-replaced SQL for criteria queries
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/CriteriaQueryGenerator.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/CriteriaQueryGenerator.java index 6902fad..cb10f56 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/CriteriaQueryGenerator.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/CriteriaQueryGenerator.java @@ -29,6 +29,8 @@ import java.util.List; import java.util.Map;
import javax.persistence.EntityManager; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; import javax.persistence.Query;
import org.apache.commons.logging.Log; @@ -198,8 +200,83 @@ public final class CriteriaQueryGenerator { } }
- // for testing purposes only, should use getQuery(EntityManager) or getCountQuery(EntityManager) instead + public String getParameterReplacedQuery(boolean countQuery) { + String query = getQueryString(countQuery); + + for (Map.Entry<String, Object> critField : getFilterFields(criteria).entrySet()) { + Object value = critField.getValue(); + + if (value instanceof Tag) { + Tag tag = (Tag) value; + query = query.replace(":tagNamespace", tag.getNamespace()); + query = query.replace(":tagSemantic", tag.getSemantic()); + query = query.replace(":tagName", tag.getName()); + + } else { + value = getParameterReplacedValue(value); + if (LOG.isDebugEnabled()) { + LOG.debug("Bind: (" + critField.getKey() + ", " + value + ")"); + } + query = query.replace(":" + critField.getKey(), String.valueOf(value)); + } + } + + if (null != this.authorizationPermsFragment) { + List<Permission> requiredPerms = this.criteria.getRequiredPermissions(); + String perms = requiredPerms.toString(); // [data1, data, data3] + query = query.replace(":requiredPerms", perms.subSequence(1, perms.length() - 1)); // remove first/last characters + query = query.replace(":requiredPermsSize", String.valueOf(requiredPerms.size())); + } + + return query; + } + + private String getParameterReplacedValue(Object value) { + String returnValue = null; + if (value instanceof String) { + returnValue = "'" + prepareStringBindValue((String) value) + "'"; + } else if (value instanceof Enum) { + // note: this strategy won't work for entities with multiple enums that are persisted differently + EnumType type = getPersistenceEnumType(value.getClass()); + if (type == EnumType.STRING) { + returnValue = "'" + String.valueOf(value) + "'"; + } else { + returnValue = String.valueOf(value); + } + } else if (value instanceof List<?>) { + List<?> valueList = (List<?>) value; + StringBuilder results = new StringBuilder(); + boolean first = true; + for (Object nextValue : valueList) { + if (first) { + first = false; + } else { + results.append(","); + } + results.append(getParameterReplacedValue(nextValue)); + } + returnValue = results.toString(); + } else { + returnValue = String.valueOf(value); + } + return returnValue; + } + + // calculates @Enumerated(EnumType.STRING) or @Enumerated(EnumType.ORDINAL) + private EnumType getPersistenceEnumType(Class<?> enumFieldType) { + for (Field nextField : getClass().getFields()) { + nextField.setAccessible(true); + if (nextField.getType().equals(enumFieldType)) { + Enumerated enumeratedAnnotation = nextField.getAnnotation(Enumerated.class); + if (enumeratedAnnotation != null) { + return enumeratedAnnotation.value(); + } + } + } + return EnumType.STRING; // catch-all + }
+ // for testing purposes only, should use getQuery(EntityManager) or getCountQuery(EntityManager) instead public String getQueryString(boolean countQuery) { StringBuilder results = new StringBuilder(); results.append("SELECT "); @@ -555,7 +632,6 @@ public final class CriteriaQueryGenerator { }
private void setBindValues(Query query, boolean countQuery) { - for (Map.Entry<String, Object> critField : getFilterFields(criteria).entrySet()) { Object value = critField.getValue();
commit 31c7e5b4df28c8290af3a9ffe6c669c223daf12d Author: Joseph Marques joseph@redhat.com Date: Sun Jun 27 18:05:08 2010 -0400
add new "schedules" agent prompt command, which was useful for testing BZ-608487
diff --git a/modules/core/client-api/src/main/java/org/rhq/core/clientapi/agent/measurement/MeasurementAgentService.java b/modules/core/client-api/src/main/java/org/rhq/core/clientapi/agent/measurement/MeasurementAgentService.java index 522ff87..66a5524 100644 --- a/modules/core/client-api/src/main/java/org/rhq/core/clientapi/agent/measurement/MeasurementAgentService.java +++ b/modules/core/client-api/src/main/java/org/rhq/core/clientapi/agent/measurement/MeasurementAgentService.java @@ -1,31 +1,33 @@ - /* - * RHQ Management Platform - * Copyright (C) 2005-2008 Red Hat, Inc. - * All rights reserved. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License, version 2, as - * published by the Free Software Foundation, and/or the GNU Lesser - * General Public License, version 2.1, also as published by the Free - * Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License and the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License - * and the GNU Lesser General Public License along with this program; - * if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ +/* + * RHQ Management Platform + * Copyright (C) 2005-2008 Red Hat, Inc. + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License, version 2, as + * published by the Free Software Foundation, and/or the GNU Lesser + * General Public License, version 2.1, also as published by the Free + * Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License and the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License + * and the GNU Lesser General Public License along with this program; + * if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ package org.rhq.core.clientapi.agent.measurement;
+import java.util.Map; import java.util.Set; + +import org.rhq.core.domain.measurement.DataType; import org.rhq.core.domain.measurement.MeasurementData; import org.rhq.core.domain.measurement.ResourceMeasurementScheduleRequest; -import org.rhq.core.domain.measurement.DataType;
/** * The interface to a JON Agent's measurement (i.e. metric collection) subsystem. @@ -74,5 +76,5 @@ public interface MeasurementAgentService { */ Set<MeasurementData> getRealTimeMeasurementValue(int resourceId, DataType dataType, String... measurementNames);
- Set<Integer> getMeasurementScheduleIdsForResource(int resourceId); + Map<String, Object> getMeasurementScheduleInfoForResource(int resourceId); } \ No newline at end of file diff --git a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/measurement/MeasurementManager.java b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/measurement/MeasurementManager.java index c0ff275..b58f607 100644 --- a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/measurement/MeasurementManager.java +++ b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/measurement/MeasurementManager.java @@ -405,7 +405,8 @@ public class MeasurementManager extends AgentService implements MeasurementAgent return Collections.emptySet(); } MeasurementFacet measurementFacet; - ResourceContainer resourceContainer = PluginContainer.getInstance().getInventoryManager().getResourceContainer(resourceId); + ResourceContainer resourceContainer = PluginContainer.getInstance().getInventoryManager().getResourceContainer( + resourceId); if (resourceContainer == null) { LOG.warn("Can not get resource container for resource with id " + resourceId); return null; @@ -520,16 +521,21 @@ public class MeasurementManager extends AgentService implements MeasurementAgent return perMinuteValue; }
- public synchronized Set<Integer> getMeasurementScheduleIdsForResource(int resourceId) { - Set<Integer> ids = new HashSet<Integer>(); + public Map<String, Object> getMeasurementScheduleInfoForResource(int resourceId) { + Map<String, Object> results = null;
- for (ScheduledMeasurementInfo info : scheduledRequests) { + for (ScheduledMeasurementInfo info : new PriorityQueue<ScheduledMeasurementInfo>(scheduledRequests)) { if (info.getResourceId() == resourceId) { - ids.add(info.getScheduleId()); + if (results == null) { + results = new HashMap<String, Object>(); + } + String scheduleId = String.valueOf(info.getScheduleId()); + String interval = String.valueOf(info.getInterval()) + "ms"; + results.put(scheduleId, interval); } }
- return ids; + return results; }
// -- MBean monitoring methods diff --git a/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/AgentMain.java b/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/AgentMain.java index b5d1223..b6ccd8b 100644 --- a/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/AgentMain.java +++ b/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/AgentMain.java @@ -120,6 +120,7 @@ import org.rhq.enterprise.agent.promptcmd.PiqlPromptCommand; import org.rhq.enterprise.agent.promptcmd.PluginContainerPromptCommand; import org.rhq.enterprise.agent.promptcmd.PluginsPromptCommand; import org.rhq.enterprise.agent.promptcmd.RegisterPromptCommand; +import org.rhq.enterprise.agent.promptcmd.SchedulesPromptCommand; import org.rhq.enterprise.agent.promptcmd.SenderPromptCommand; import org.rhq.enterprise.agent.promptcmd.SetConfigPromptCommand; import org.rhq.enterprise.agent.promptcmd.SetupPromptCommand; @@ -2959,7 +2960,8 @@ public class AgentMain { new AvailabilityPromptCommand(), new PiqlPromptCommand(), new IdentifyPromptCommand(), new LogPromptCommand(), new TimerPromptCommand(), new PingPromptCommand(), new DownloadPromptCommand(), new DumpSpoolPromptCommand(), new SenderPromptCommand(), new FailoverPromptCommand(), - new UpdatePromptCommand(), new DebugPromptCommand(), new SleepPromptCommand(), new GCPromptCommand() }; + new UpdatePromptCommand(), new DebugPromptCommand(), new SleepPromptCommand(), new GCPromptCommand(), + new SchedulesPromptCommand() };
// hold the conflicts StringBuilder conflicts = new StringBuilder(); diff --git a/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/i18n/AgentI18NResourceKeys.java b/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/i18n/AgentI18NResourceKeys.java index 7967b47..de3acca 100644 --- a/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/i18n/AgentI18NResourceKeys.java +++ b/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/i18n/AgentI18NResourceKeys.java @@ -769,6 +769,21 @@ public interface AgentI18NResourceKeys { @I18NMessage("Failed to perform sender command; stack trace follows:") String SENDER_FAILURE = "PromptCommand.sender.failure";
+ @I18NMessage("schedules") + String SCHEDULES = "PromptCommand.schedules"; + + @I18NMessage("Retrieves measurement schedule information for the specified resource") + String SCHEDULES_HELP = "PromptCommand.schedules.help"; + + @I18NMessage("schedules <resourceId>") + String SCHEDULES_SYNTAX = "PromptCommand.schedules.syntax"; + + @I18NMessage("This agent does not manage a resource with id {0}") + String SCHEDULES_UNKNOWN_RESOURCE = "PromptCommand.schedules.unknown-resource"; + + @I18NMessage("Failed to perform schedules command; stack trace follows:") + String SCHEDULES_FAILURE = "PromptCommand.schedules.failure"; + @I18NMessage("exit") String EXIT = "PromptCommand.exit";
diff --git a/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/promptcmd/SchedulesPromptCommand.java b/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/promptcmd/SchedulesPromptCommand.java new file mode 100644 index 0000000..b1c95c3 --- /dev/null +++ b/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/promptcmd/SchedulesPromptCommand.java @@ -0,0 +1,80 @@ +package org.rhq.enterprise.agent.promptcmd; + +import java.io.PrintWriter; +import java.util.Map; + +import mazz.i18n.Msg; + +import org.rhq.core.pc.PluginContainer; +import org.rhq.core.pc.measurement.MeasurementManager; +import org.rhq.enterprise.agent.AgentMain; +import org.rhq.enterprise.agent.StringUtil; +import org.rhq.enterprise.agent.i18n.AgentI18NFactory; +import org.rhq.enterprise.agent.i18n.AgentI18NResourceKeys; + +public class SchedulesPromptCommand implements AgentPromptCommand { + private static final Msg MSG = AgentI18NFactory.getMsg(); + + /** + * @see AgentPromptCommand#getPromptCommandString() + */ + public String getPromptCommandString() { + return MSG.getMsg(AgentI18NResourceKeys.SCHEDULES); + } + + /** + * @see AgentPromptCommand#execute(AgentMain, String[]) + */ + public boolean execute(AgentMain agent, String[] args) { + PrintWriter out = agent.getOut(); + + try { + if (args.length != 2) { + out.println(MSG.getMsg(AgentI18NResourceKeys.HELP_SYNTAX_LABEL, getSyntax())); + } else { + try { + int resourceId = Integer.parseInt(args[1]); + MeasurementManager measurementManager = PluginContainer.getInstance().getMeasurementManager(); + Map<String, Object> nameValuePairs = measurementManager + .getMeasurementScheduleInfoForResource(resourceId); + + if (nameValuePairs == null) { + // take string value so resourceId is rendered literally, instead of numerical formatting + out.println(MSG.getMsg(AgentI18NResourceKeys.SCHEDULES_UNKNOWN_RESOURCE, String + .valueOf(resourceId))); + } else { + out.println(StringUtil.justifyKeyValueStrings(nameValuePairs)); + } + } catch (NumberFormatException nfe) { + out.println(MSG.getMsg(AgentI18NResourceKeys.HELP_SYNTAX_LABEL, getSyntax())); + } + } + } catch (Exception e) { + out.println(MSG.getMsg(AgentI18NResourceKeys.SCHEDULES_FAILURE)); + e.printStackTrace(out); + } + + return true; + } + + /** + * @see AgentPromptCommand#getSyntax() + */ + public String getSyntax() { + return MSG.getMsg(AgentI18NResourceKeys.SCHEDULES_SYNTAX); + } + + /** + * @see AgentPromptCommand#getHelp() + */ + public String getHelp() { + return MSG.getMsg(AgentI18NResourceKeys.SCHEDULES_HELP); + } + + /** + * @see AgentPromptCommand#getDetailedHelp() + */ + public String getDetailedHelp() { + return getHelp(); + } +} diff --git a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/resource/metadata/test/UpdateSubsytemTestBase.java b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/resource/metadata/test/UpdateSubsytemTestBase.java index 3b0c439..b279a5a 100644 --- a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/resource/metadata/test/UpdateSubsytemTestBase.java +++ b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/resource/metadata/test/UpdateSubsytemTestBase.java @@ -21,6 +21,7 @@ package org.rhq.enterprise.server.resource.metadata.test; import java.io.FileNotFoundException; import java.net.URL; import java.util.List; +import java.util.Map; import java.util.Set; import java.util.UUID;
@@ -159,15 +160,13 @@ public class UpdateSubsytemTestBase extends AbstractEJB3Test { protected Resource getResource(ResourceCriteria resourceCriteria) { Subject overlord = LookupUtil.getSubjectManager().getOverlord();
- PageList<Resource> results = resourceManager - .findResourcesByCriteria(overlord, resourceCriteria); + PageList<Resource> results = resourceManager.findResourcesByCriteria(overlord, resourceCriteria); if (results.size() == 0) { return null; } else if (results.size() == 1) { return results.get(0); } else { - throw new IllegalStateException("Found more than one Resource with criteria " + resourceCriteria - + "."); + throw new IllegalStateException("Found more than one Resource with criteria " + resourceCriteria + "."); } }
@@ -193,8 +192,8 @@ public class UpdateSubsytemTestBase extends AbstractEJB3Test { } else { testPlugin.setVersion(descriptor.getVersion()); } - metadataManager.registerPlugin(LookupUtil.getSubjectManager().getOverlord(), testPlugin, descriptor, null, - true); + metadataManager + .registerPlugin(LookupUtil.getSubjectManager().getOverlord(), testPlugin, descriptor, null, true); }
protected void registerPlugin(String pathToDescriptor) throws Exception { @@ -288,7 +287,7 @@ public class UpdateSubsytemTestBase extends AbstractEJB3Test {
}
- public Set<Integer> getMeasurementScheduleIdsForResource(int resourceId) { + public Map<String, Object> getMeasurementScheduleInfoForResource(int resourceId) { return null; } } @@ -296,7 +295,7 @@ public class UpdateSubsytemTestBase extends AbstractEJB3Test { protected void cleanupTest() throws Exception { try { String pathToDescriptor = COMMON_PATH_PREFIX + "/noTypes.xml"; - registerPluginInternal(pathToDescriptor, null); + registerPluginInternal(pathToDescriptor, null);
/*cleanupResourceType("constraintPlatform"); cleanupResourceType("events"); diff --git a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/test/TestAgentClient.java b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/test/TestAgentClient.java index b2b96d2..a02e6cf 100644 --- a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/test/TestAgentClient.java +++ b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/test/TestAgentClient.java @@ -20,6 +20,7 @@ package org.rhq.enterprise.server.test;
import java.io.InputStream; import java.util.List; +import java.util.Map; import java.util.Set;
import org.rhq.core.clientapi.agent.PluginContainerException; @@ -41,14 +42,14 @@ import org.rhq.core.clientapi.agent.operation.CancelResults; import org.rhq.core.clientapi.agent.operation.OperationAgentService; import org.rhq.core.clientapi.agent.support.SupportAgentService; import org.rhq.core.clientapi.server.configuration.ConfigurationUpdateResponse; +import org.rhq.core.clientapi.server.content.ContentDiscoveryReport; import org.rhq.core.clientapi.server.content.DeletePackagesRequest; +import org.rhq.core.clientapi.server.content.DeployPackagesRequest; import org.rhq.core.clientapi.server.content.RetrievePackageBitsRequest; import org.rhq.core.clientapi.server.discovery.InventoryReport; import org.rhq.core.communications.command.annotation.Asynchronous; import org.rhq.core.domain.configuration.Configuration; -import org.rhq.core.clientapi.server.content.ContentDiscoveryReport; import org.rhq.core.domain.content.transfer.DeployPackageStep; -import org.rhq.core.clientapi.server.content.DeployPackagesRequest; import org.rhq.core.domain.content.transfer.ResourcePackageDetails; import org.rhq.core.domain.discovery.AvailabilityReport; import org.rhq.core.domain.discovery.MergeResourceResponse; @@ -137,7 +138,7 @@ public class TestAgentClient implements AgentClient, BundleAgentService, Content public void updateCollection(Set<ResourceMeasurementScheduleRequest> resourceSchedules) { }
- public Set<Integer> getMeasurementScheduleIdsForResource(int resourceId) { + public Map<String, Object> getMeasurementScheduleInfoForResource(int resourceId) { return null; }
commit 44e97f20fd026fc660d38d819497cb843a353384 Author: Joseph Marques joseph@redhat.com Date: Sun Jun 27 18:04:02 2010 -0400
BZ-608487: fix sync logic by always sending an InventoryReport to the server
diff --git a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/InventoryManager.java b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/InventoryManager.java index 0f77b05..929a5b6 100644 --- a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/InventoryManager.java +++ b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/InventoryManager.java @@ -862,9 +862,6 @@ public class InventoryManager extends AgentService implements ContainerService, if (!configuration.isInsideAgent()) { return true; } - if (report.getAddedRoots().isEmpty()) { - return true; // nothing to do - }
ResourceSyncInfo syncInfo; try {
commit fde3f073e809cbda96d5ae81ff393256c6dbcdae Author: Simeon Pinder spinder@redhat.com Date: Sat Jun 26 09:38:41 2010 -0400
moving sample blob out of server jar into test.
diff --git a/modules/enterprise/server/jar/src/main/resources/binary-blob-sample.jar b/modules/enterprise/server/jar/src/main/resources/binary-blob-sample.jar deleted file mode 100644 index 0a629ec..0000000 Binary files a/modules/enterprise/server/jar/src/main/resources/binary-blob-sample.jar and /dev/null differ diff --git a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/content/test/ContentUIManagerBeanTest.java b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/content/test/ContentUIManagerBeanTest.java index 8745b1c..3160074 100644 --- a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/content/test/ContentUIManagerBeanTest.java +++ b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/content/test/ContentUIManagerBeanTest.java @@ -276,7 +276,7 @@ public class ContentUIManagerBeanTest extends AbstractEJB3Test { // contents into memory every time.
//any jar should be fine. Use generated server jar - File originalBinary = new File("./src/main/resources/binary-blob-sample.jar"); + File originalBinary = new File("./src/test/resources/binary-blob-sample.jar"); //destination once pulled from db File retrieved = new File("./target/pulled.jar"); if (retrieved.exists()) { diff --git a/modules/enterprise/server/jar/src/test/resources/binary-blob-sample.jar b/modules/enterprise/server/jar/src/test/resources/binary-blob-sample.jar new file mode 100644 index 0000000..0a629ec Binary files /dev/null and b/modules/enterprise/server/jar/src/test/resources/binary-blob-sample.jar differ
commit f4095c7263e34a34adec649cf04ea181aba1509c Author: Simeon Pinder spinder@redhat.com Date: Fri Jun 25 19:26:36 2010 -0400
BZ 597246: added persist.
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerBean.java index f1883df..2c01712 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerBean.java @@ -1235,6 +1235,7 @@ public class ContentManagerBean implements ContentManagerLocal, ContentManagerRe
PackageVersion newPackageVersion = new PackageVersion(existingPackage, version, architecture); newPackageVersion.setDisplayName(existingPackage.getName()); + entityManager.persist(newPackageVersion);
Map<String, String> contentDetails = new HashMap<String, String>(); PackageBits bits = loadPackageBits(packageBitStream, newPackageVersion.getId(), packageName, version, null, @@ -1602,8 +1603,8 @@ public class ContentManagerBean implements ContentManagerLocal, ContentManagerRe //associate the two if located if (pv != null) {//np check. pv.setPackageBits(bits); + entityManager.flush(); } - entityManager.flush(); // push the new package bits row to the DB
bits = entityManager.find(PackageBits.class, bits.getId());
commit 8059d650aace4fcd408f476f86901b482a66b8bb Author: Simeon Pinder spinder@redhat.com Date: Fri Jun 25 18:32:44 2010 -0400
adding missing npe check, for test scenarios.
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerBean.java index 6ee805e..f1883df 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerBean.java @@ -1599,8 +1599,10 @@ public class ContentManagerBean implements ContentManagerLocal, ContentManagerRe //locate related packageVersion PackageVersion pv = entityManager.find(PackageVersion.class, packageVersionId);
- //associate the two - pv.setPackageBits(bits); + //associate the two if located + if (pv != null) {//np check. + pv.setPackageBits(bits); + } entityManager.flush(); // push the new package bits row to the DB
bits = entityManager.find(PackageBits.class, bits.getId());
commit 015ef23663c5fea4440e829885f601155215b1b9 Author: Simeon Pinder spinder@redhat.com Date: Fri Jun 25 18:07:52 2010 -0400
unit test fix for blob test.
diff --git a/modules/enterprise/server/jar/src/main/resources/binary-blob-sample.jar b/modules/enterprise/server/jar/src/main/resources/binary-blob-sample.jar new file mode 100644 index 0000000..0a629ec Binary files /dev/null and b/modules/enterprise/server/jar/src/main/resources/binary-blob-sample.jar differ diff --git a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/content/test/ContentUIManagerBeanTest.java b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/content/test/ContentUIManagerBeanTest.java index 5f73b89..8745b1c 100644 --- a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/content/test/ContentUIManagerBeanTest.java +++ b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/content/test/ContentUIManagerBeanTest.java @@ -276,7 +276,7 @@ public class ContentUIManagerBeanTest extends AbstractEJB3Test { // contents into memory every time.
//any jar should be fine. Use generated server jar - File originalBinary = new File("./target/rhq-enterprise-server.jar"); + File originalBinary = new File("./src/main/resources/binary-blob-sample.jar"); //destination once pulled from db File retrieved = new File("./target/pulled.jar"); if (retrieved.exists()) {
commit efd417bb1ba4278c8be08293afd403c643b51f56 Author: Joseph Marques joseph@redhat.com Date: Fri Jun 25 17:52:16 2010 -0400
add method to quickly take a snapshot of all measurement-related tables
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/admin/test/control.jsp b/modules/enterprise/gui/portal-war/src/main/webapp/admin/test/control.jsp index 49c32af..50af6a6 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/admin/test/control.jsp +++ b/modules/enterprise/gui/portal-war/src/main/webapp/admin/test/control.jsp @@ -1,5 +1,6 @@ <%@ page import="java.io.ByteArrayOutputStream" %> <%@ page import="java.io.PrintStream" %> +<%@ page import="java.util.Map" %>
<%@ page import="org.rhq.core.domain.auth.Subject" %> <%@ page import="org.rhq.core.server.PersistenceUtility" %> @@ -208,6 +209,18 @@ serverPlugins.purgeServerPlugin(subjectManager.getOverlord(), key); result = "OK - you can now try to re-register a plugin with the name [" + serverPluginName + "]"; } + + else if ("snapshotMeasurementTables".equals(mode)) + { + result = "<table>"; + Map<String, Long> tableCounts = measurementTestBean.snapshotMeasurementTables(); + for (Map.Entry<String, Long> nextCount : tableCounts.entrySet()) { + String tableAlias = nextCount.getKey(); + Long tableCount = nextCount.getValue(); + result += "<tr><td>" + tableAlias + "</td><td>" + tableCount + "</td></tr>"; + } + result += "</table>"; + } else if ("typeManagerRemote".equals(mode)) { int typeId = Integer.parseInt(request.getParameter("typeId")); @@ -328,6 +341,8 @@ Send New Platform Inventory Report <a href="<c:out value="${url}"/>">Force calculation of OOBs</a></li> <li><c:url var="url" value="/admin/test/control.jsp?mode=errorCorrectSchedules"/> <a href="<c:out value="${url}"/>">Error-Correct Measurement Schedules</a></li> + <li><c:url var="url" value="/admin/test/control.jsp?mode=snapshotMeasurementTables"/> + <a href="<c:out value="${url}"/>">Snapshot Measurement Tables</a></li> </ul>
<h2>Alerts</h2> diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/MeasurementTestBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/MeasurementTestBean.java index ce40d90..d093f5d 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/MeasurementTestBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/MeasurementTestBean.java @@ -18,18 +18,31 @@ */ package org.rhq.enterprise.server.test;
+import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; import java.util.Calendar; import java.util.Date; +import java.util.LinkedHashMap; +import java.util.Map; import java.util.Set;
+import javax.annotation.PostConstruct; import javax.ejb.EJB; import javax.ejb.Stateless; import javax.persistence.EntityManager; import javax.persistence.NoResultException; import javax.persistence.PersistenceContext; import javax.persistence.Query; +import javax.sql.DataSource; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory;
import org.rhq.core.clientapi.server.measurement.MeasurementServerService; +import org.rhq.core.db.DatabaseType; +import org.rhq.core.db.DatabaseTypeFactory; +import org.rhq.core.db.OracleDatabaseType; import org.rhq.core.domain.measurement.Availability; import org.rhq.core.domain.measurement.AvailabilityType; import org.rhq.core.domain.measurement.MeasurementDataNumeric; @@ -43,6 +56,7 @@ import org.rhq.core.domain.measurement.ResourceMeasurementScheduleRequest; import org.rhq.core.domain.resource.Resource; import org.rhq.core.domain.resource.ResourceCategory; import org.rhq.core.domain.resource.ResourceType; +import org.rhq.core.util.jdbc.JDBCUtil; import org.rhq.enterprise.server.RHQConstants; import org.rhq.enterprise.server.measurement.MeasurementScheduleManagerLocal; import org.rhq.enterprise.server.measurement.MeasurementServerServiceImpl; @@ -52,20 +66,41 @@ import org.rhq.enterprise.server.util.LookupUtil; * An EJB for testing the measurement subsystem - used by TestControl.jsp. */ @Stateless +@javax.annotation.Resource(name = "RHQ_DS", mappedName = RHQConstants.DATASOURCE_JNDI_NAME) public class MeasurementTestBean implements MeasurementTestLocal { + private final Log log = LogFactory.getLog(MeasurementTestBean.class); + private static final String FAKE_PLATFORM_NAME = "Fake Platform";
@PersistenceContext(unitName = RHQConstants.PERSISTENCE_UNIT_NAME) EntityManager entityManager;
+ @javax.annotation.Resource(name = "RHQ_DS") + private DataSource rhqDs; + private DatabaseType databaseType; + private MeasurementServerService measurementServerService = new MeasurementServerServiceImpl();
@EJB private MeasurementScheduleManagerLocal measurementScheduleManager;
+ @PostConstruct + public void init() { + Connection conn = null; + try { + conn = rhqDs.getConnection(); + databaseType = DatabaseTypeFactory.getDatabaseType(conn); + } catch (Exception e) { + throw new RuntimeException(e); + } finally { + JDBCUtil.safeClose(conn); + } + } + /** * Send a test measurement report, full of lots of fake metrics, to the server. */ + @SuppressWarnings("deprecation") public void sendTestMeasurementReport() { Resource res = setupFakePlatformIfNeeded(); Set<ResourceMeasurementScheduleRequest> scheds; @@ -152,4 +187,83 @@ public class MeasurementTestBean implements MeasurementTestLocal {
LookupUtil.getAlertConditionCacheManager().checkConditions(numericData); } + + public Map<String, Long> snapshotMeasurementTables() { + String snapshotQuery = "" // + + "select" // + + "(select count(*) from rhq_meas_data_num_r00) as r00," // + + "(select count(*) from rhq_meas_data_num_r01) as r01," // + + "(select count(*) from rhq_meas_data_num_r02) as r02," // + + "(select count(*) from rhq_meas_data_num_r03) as r03," // + + "(select count(*) from rhq_meas_data_num_r04) as r04," // + + "(select count(*) from rhq_meas_data_num_r05) as r05," // + + "(select count(*) from rhq_meas_data_num_r06) as r06," // + + "(select count(*) from rhq_meas_data_num_r07) as r07," // + + "(select count(*) from rhq_meas_data_num_r08) as r08," // + + "(select count(*) from rhq_meas_data_num_r09) as r09," // + + "(select count(*) from rhq_meas_data_num_r10) as r10," // + + "(select count(*) from rhq_meas_data_num_r11) as r11," // + + "(select count(*) from rhq_meas_data_num_r12) as r12," // + + "(select count(*) from rhq_meas_data_num_r13) as r13," // + + "(select count(*) from rhq_meas_data_num_r14) as r14," // + + "(select count(*) from rhq_measurement_data_num_1h) as oneHour," // + + "(select count(*) from rhq_measurement_data_num_6h) as sixHour," // + + "(select count(*) from rhq_measurement_data_num_1d) as oneDay," // + + "(select count(*) from rhq_measurement_data_trait) as trait," // + + "(select count(*) from rhq_measurement_bline) as bline," // + + "(select count(*) from rhq_measurement_oob) as oob," // + + "(select count(*) from rhq_measurement_oob_tmp) as oob_temp," // + + "(select count(*) from rhq_calltime_data_key) as callkey," // + + "(select count(*) from rhq_calltime_data_value) as calldata," // + + "(select count(ms.id) from rhq_measurement_sched ms" // + + " join rhq_measurement_def md on ms.definition = md.id" // + + " where ms.enabLed = true and md.data_type=0) as enabledMetricSchedules," // + + "(select count(ms.id) from rhq_measurement_sched ms" // + + " join rhq_measurement_def md on ms.definition = md.id" // + + " where ms.enabLed = true and md.data_type=1) as enabledTraitSchedules," // + + "(select count(ms.id) from rhq_measurement_sched ms" // + + " join rhq_measurement_def md on ms.definition = md.id" // + + " where ms.enabLed = true and md.data_type=3) as enabledCalltimeSchedules"; + + String querySuffix = ";"; + if (databaseType instanceof OracleDatabaseType) { + querySuffix = "from dual;"; + } + + Map<String, Long> results = new LinkedHashMap<String, Long>(); + + Connection conn = null; + PreparedStatement ps = null; + ResultSet rs = null; + try { + conn = rhqDs.getConnection(); + ps = conn.prepareStatement(snapshotQuery + querySuffix); + rs = ps.executeQuery(); + + String[] columnNames = { "r00", "r01", "r02", "r03", "r04", "r05", "r06", "r07", "r08", "r09", "r10", + "r11", "r12", "r13", "r14", "oneHour", "sixHour", "oneDay", "trait", "bline", "oob", "oob_temp", + "callkey", "calldata", "enabledMetricSchedules", "enabledTraitSchedules", "enabledCalltimeSchedules" }; + if (rs.next()) { + for (String nextColumn : columnNames) { + Long nextValue = rs.getLong(nextColumn); + results.put(nextColumn, nextValue); + } + } + } catch (Throwable t) { + log.error("Could not snapshot measurement tables", t); + } finally { + JDBCUtil.safeClose(conn, ps, rs); + } + + return results; + } + + public static void main(String[] args) { + Map<String, Long> results = new MeasurementTestBean().snapshotMeasurementTables(); + for (Map.Entry<String, Long> nextCount : results.entrySet()) { + String tableAlias = nextCount.getKey(); + Long tableCount = nextCount.getValue(); + + } + } } \ No newline at end of file diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/MeasurementTestLocal.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/MeasurementTestLocal.java index 1ed6b64..616bcbe 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/MeasurementTestLocal.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/MeasurementTestLocal.java @@ -18,10 +18,12 @@ */ package org.rhq.enterprise.server.test;
+import java.util.Map; + import javax.ejb.Local;
/** - * An EJB for testing the measurement subsystem - used by TestControl.jsp. + * An EJB for testing the measurement subsystem - used by control.jsp */ @Local public interface MeasurementTestLocal { @@ -30,4 +32,6 @@ public interface MeasurementTestLocal { void addProblemResource();
void setAgentCurrentlyScheduledMetrics(double value); + + Map<String, Long> snapshotMeasurementTables(); } \ No newline at end of file
commit ac9f562c813923aff0b07fbac50ad5d07d3aa34e Author: Ian Springer ian.springer@redhat.com Date: Fri Jun 25 17:44:31 2010 -0400
do not require user to pass in rhq.deploy.id prop; print a friendly error message if user does not pass in the rhq.deploy.dir prop
diff --git a/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/AntMain.java b/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/AntMain.java index 84e6649..8c00839 100644 --- a/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/AntMain.java +++ b/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/AntMain.java @@ -612,6 +612,10 @@ public class AntMain implements org.apache.tools.ant.launch.AntMain { }
// RHQ + String deployIdString = definedProps.getProperty(DeployPropertyNames.DEPLOY_ID); + if (deployIdString == null) { + definedProps.setProperty(DeployPropertyNames.DEPLOY_ID, "0"); + } DeploymentPhase[] lifecycle = getLifecycle(); for (DeploymentPhase phase : lifecycle) { System.out.println("***** Executing " + phase + " phase *****..."); @@ -666,6 +670,11 @@ public class AntMain implements org.apache.tools.ant.launch.AntMain {
private DeploymentPhase[] getLifecycle() { String deployDirString = definedProps.getProperty(DeployPropertyNames.DEPLOY_DIR); + if (deployDirString == null) { + throw new BuildException("Required system property '" + DeployPropertyNames.DEPLOY_DIR + + "' was not specified. Please set this property to the directory where the bundle should be installed (e.g. -D" + + DeployPropertyNames.DEPLOY_DIR + "=/opt/yourapp)."); + } File deployDir = new File(deployDirString); DeploymentsMetadata deployMetadata = new DeploymentsMetadata(deployDir); boolean isRedeploy = deployMetadata.isManaged(); @@ -748,6 +757,7 @@ public class AntMain implements org.apache.tools.ant.launch.AntMain { proxySetup.enableProxies(); }
+ // RHQ NOTE: Besides parsing the build file, this will also execute the implicit ("") target. ProjectHelper.configureProject(project, buildFile); } finally { // put back the original security manager
commit 6c1b4651fdedbfb0900f2440c17e0887f0d6ba61 Merge: dcf8ac0... 6f4eb03... Author: Jay Shaughnessy jshaughn@redhat.com Date: Fri Jun 25 16:28:53 2010 -0400
Merge branch 'release-3.0.0' into master-jay
commit 6f4eb034b12085258f98c92713af8a499ea78261 Author: Simeon Pinder spinder@redhat.com Date: Fri Jun 25 15:53:16 2010 -0400
unit test fix for blob.
diff --git a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/content/test/ContentUIManagerBeanTest.java b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/content/test/ContentUIManagerBeanTest.java index 7fae6e0..5f73b89 100644 --- a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/content/test/ContentUIManagerBeanTest.java +++ b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/content/test/ContentUIManagerBeanTest.java @@ -284,7 +284,7 @@ public class ContentUIManagerBeanTest extends AbstractEJB3Test { } FileInputStream fos = new FileInputStream(originalBinary);
- contentManager.updateBlobStream(fos, packageBits); + contentManager.updateBlobStream(fos, packageBits, null); packageBits = em.find(PackageBits.class, packageBits.getId());
// test that the bits are available and stored in the DB: Reading the Blob
commit 17b0f8bb1a60583a0d1ea24bd894cc9a3dbd5c42 Merge: 863201f... bfd6f7d... Author: Simeon Pinder spinder@redhat.com Date: Fri Jun 25 15:50:49 2010 -0400
Merge branch 'release-3.0.0' of ssh://spinder@git.fedorahosted.org/git/rhq/rhq into release-3.0.0
commit bfd6f7dbff8de49c9ad47712499f106945002127 Merge: 14cad58... eb5d619... Author: Jay Shaughnessy jshaughn@redhat.com Date: Fri Jun 25 15:47:19 2010 -0400
Merge branch 'release-3.0.0' into release-3.0.0-jay
commit 14cad58515eb7b4787e607df428d01702f31468c Author: Jay Shaughnessy jshaughn@redhat.com Date: Fri Jun 25 15:46:21 2010 -0400
[BZ 600543] An interim solution that hopefully will bridge the gap until we impl BZ 608135. Try to ensure that all plugin config updates in a group update get a chance to complete (barring a server loss).
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/job/AbstractGroupConfigurationUpdateJob.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/job/AbstractGroupConfigurationUpdateJob.java index 2efe429..7b92b40 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/job/AbstractGroupConfigurationUpdateJob.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/job/AbstractGroupConfigurationUpdateJob.java @@ -82,7 +82,15 @@ public abstract class AbstractGroupConfigurationUpdateJob implements Job { }
for (Integer childUpdateId : pagedChildUpdateIds) { - executeConfigurationUpdate(configurationManager, childUpdateId, subject); + // failing one update request is not reason to fail all of the remaining updates + // so, wrap in a try catch and gather up the errors to subsequently fail the group update. This + // will especially benefit group plugin config, which currently executes synchronously. + try { + executeConfigurationUpdate(configurationManager, childUpdateId, subject); + } catch (Exception e) { + errorMessages = appendErrorMessages(errorMessages, "Failed Member Update Id=" + childUpdateId, + e.toString()); + } }
rowsProcessed += pagedChildUpdateIds.size(); @@ -93,12 +101,18 @@ public abstract class AbstractGroupConfigurationUpdateJob implements Job { pc.setPageNumber(pc.getPageNumber() + 1); } } catch (Exception e) { - errorMessages = ThrowableUtil.getAllMessages(e); + errorMessages = appendErrorMessages(errorMessages, "Failed Group Update Id=" + groupConfigurationUpdateId, + ThrowableUtil.getAllMessages(e)); } finally { completeGroupConfigurationUpdate(configurationManager, groupConfigurationUpdateId, errorMessages); } }
+ private String appendErrorMessages(String currentMessages, String header, String newMessages) { + currentMessages = (null == currentMessages) ? "" : currentMessages + "\n"; + return currentMessages.concat(" [" + header + ": " + newMessages); + } + private static String createUniqueJobName(ResourceGroup group, Subject subject, String jobNamePrefix) { return createJobGroupName(group, jobNamePrefix) + "-" + subject.getName().hashCode() + "-" + System.currentTimeMillis();
commit eb5d619298ef5aa1d38c10cf308cca8e119403d3 Author: Joseph Marques joseph@redhat.com Date: Fri Jun 25 15:07:25 2010 -0400
BZ-535671: remove compatible group constructs if dynagroup recalculation converts compat->mixed
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerBean.java index b944b6e..5e7707d 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerBean.java @@ -91,7 +91,6 @@ import org.rhq.enterprise.server.operation.GroupOperationSchedule; import org.rhq.enterprise.server.operation.OperationManagerLocal; import org.rhq.enterprise.server.resource.ResourceManagerLocal; import org.rhq.enterprise.server.resource.ResourceTypeManagerLocal; -import org.rhq.enterprise.server.resource.ResourceTypeNotFoundException; import org.rhq.enterprise.server.util.CriteriaQueryGenerator; import org.rhq.enterprise.server.util.CriteriaQueryRunner; import org.rhq.enterprise.server.util.QueryUtility; @@ -252,35 +251,6 @@ public class ResourceGroupManagerBean implements ResourceGroupManagerLocal, Reso ResourceGroupDeleteException { ResourceGroup group = getResourceGroupById(subject, groupId, null);
- // for compatible groups, first recursively remove any referring backing groups for auto-clusters - if (group.getGroupCategory() == GroupCategory.COMPATIBLE) { - for (ResourceGroup referringGroup : group.getClusterBackingGroups()) { - deleteResourceGroup(subject, referringGroup.getId()); - } - } - - // unschedule all jobs for this group (only compatible groups have operations, mixed do not) - if (group.getGroupCategory() == GroupCategory.COMPATIBLE) { - Subject overlord = subjectManager.getOverlord(); - try { - List<GroupOperationSchedule> ops = operationManager.findScheduledGroupOperations(overlord, groupId); - - for (GroupOperationSchedule schedule : ops) { - try { - operationManager.unscheduleGroupOperation(overlord, schedule.getJobId().toString(), groupId); - } catch (UnscheduleException e) { - log.warn("Failed to unschedule job [" + schedule + "] for a group being deleted [" + group - + "]", e); - } - } - } catch (Exception e) { - log.warn("Failed to get jobs for a group being deleted [" + group - + "]; will not attempt to unschedule anything", e); - } - } - - groupAlertDefinitionManager.purgeAllGroupAlertDefinitions(subject, groupId); - for (Role doomedRoleRelationship : group.getRoles()) { group.removeRole(doomedRoleRelationship); entityManager.merge(doomedRoleRelationship); @@ -289,20 +259,64 @@ public class ResourceGroupManagerBean implements ResourceGroupManagerLocal, Reso // remove all resources in the group resourceGroupManager.removeAllResourcesFromGroup(subject, groupId);
+ if (group.getGroupCategory() == GroupCategory.COMPATIBLE) { + removeCompatibleGroupConstructs(subject, group); + } + // break resource and plugin configuration update links in order to preserve individual change history Query q = null;
q = entityManager.createNamedQuery(ResourceConfigurationUpdate.QUERY_DELETE_GROUP_UPDATES_FOR_GROUP); - q.setParameter("groupId", groupId); + q.setParameter("groupId", group.getId()); q.executeUpdate();
q = entityManager.createNamedQuery(PluginConfigurationUpdate.QUERY_DELETE_GROUP_UPDATES_FOR_GROUP); - q.setParameter("groupId", groupId); + q.setParameter("groupId", group.getId()); q.executeUpdate();
entityManager.remove(group); }
+ /* + * TODO: Deletion of all associated group data (except implicit/explicit resource members) should be moved here. + * in other words, we don't want Hibernate cascade annotations to remove that history upon deletion of an + * entity anymore because there are now two cases where group constructs need to be destroyed: + * + * 1) compatible group deletion - a group is deleted, all history removed, entity is gone from the system + * 2) dynagroup recomputation - a group definition is recalculation, a compatible group turns into a mixed + * group, compatible constructs need to be removed, but the entity survives + * + * For now, this implementation should suffice for -- https://bugzilla.redhat.com/show_bug.cgi?id=535671 + */ + private void removeCompatibleGroupConstructs(Subject subject, ResourceGroup group) + throws ResourceGroupDeleteException { + + // for compatible groups, first recursively remove any referring backing groups for auto-clusters + for (ResourceGroup referringGroup : group.getClusterBackingGroups()) { + deleteResourceGroup(subject, referringGroup.getId()); + } + + Subject overlord = subjectManager.getOverlord(); + try { + List<GroupOperationSchedule> ops = operationManager.findScheduledGroupOperations(overlord, group.getId()); + + for (GroupOperationSchedule schedule : ops) { + try { + operationManager.unscheduleGroupOperation(overlord, schedule.getJobId().toString(), group.getId()); + } catch (UnscheduleException e) { + log + .warn("Failed to unschedule job [" + schedule + "] for a group being deleted [" + group + "]", + e); + } + } + } catch (Exception e) { + log.warn("Failed to get jobs for a group being deleted [" + group + + "]; will not attempt to unschedule anything", e); + } + + groupAlertDefinitionManager.purgeAllGroupAlertDefinitions(subject, group.getId()); + } + public ResourceGroup getResourceGroupById(Subject user, int id, GroupCategory category) throws ResourceGroupNotFoundException { ResourceGroup group = entityManager.find(ResourceGroup.class, id); @@ -909,7 +923,7 @@ public class ResourceGroupManagerBean implements ResourceGroupManagerLocal, Reso }
@SuppressWarnings("unchecked") - public void setResourceType(int resourceGroupId) { + public void setResourceType(int resourceGroupId) throws ResourceGroupDeleteException { Query query = entityManager.createNamedQuery(ResourceType.QUERY_GET_EXPLICIT_RESOURCE_TYPE_COUNTS_BY_GROUP); query.setParameter("groupId", resourceGroupId);
@@ -921,16 +935,14 @@ public class ResourceGroupManagerBean implements ResourceGroupManagerLocal, Reso Object[] info = (Object[]) results.get(0); int resourceTypeId = (Integer) info[0];
- try { - ResourceType type = resourceTypeManager.getResourceTypeById(overlord, resourceTypeId); - - resourceGroup.setResourceType(type); - } catch (ResourceTypeNotFoundException rtnfe) { - // we just got the resourceTypeId from the database, so it will exist - // but let's set some reasonable implementation anyway - resourceGroup.setResourceType(null); - } + ResourceType flyWeightType = new ResourceType(); + flyWeightType.setId(resourceTypeId); + resourceGroup.setResourceType(flyWeightType); } else { + if (resourceGroup.getResourceType() != null) { + // converting compatible group to mixed group, remove all corresponding compatible constructs + removeCompatibleGroupConstructs(overlord, resourceGroup); + } resourceGroup.setResourceType(null); } } diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerLocal.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerLocal.java index afac418..5975099 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerLocal.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerLocal.java @@ -93,7 +93,7 @@ public interface ResourceGroupManagerLocal {
ResourceGroup getByGroupDefinitionAndGroupByClause(int groupDefinitionId, String groupByClause);
- void setResourceType(int resourceGroupId); + void setResourceType(int resourceGroupId) throws ResourceGroupDeleteException;
int getExplicitGroupMemberCount(int resourceGroupId);
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/definition/GroupDefinitionManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/definition/GroupDefinitionManagerBean.java index ee0dae9..9a11216 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/definition/GroupDefinitionManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/definition/GroupDefinitionManagerBean.java @@ -52,6 +52,7 @@ import org.rhq.enterprise.server.authz.PermissionException; import org.rhq.enterprise.server.authz.RequiredPermission; import org.rhq.enterprise.server.resource.ResourceManagerLocal; import org.rhq.enterprise.server.resource.group.RecursivityChangeType; +import org.rhq.enterprise.server.resource.group.ResourceGroupDeleteException; import org.rhq.enterprise.server.resource.group.ResourceGroupManagerLocal; import org.rhq.enterprise.server.resource.group.ResourceGroupUpdateException; import org.rhq.enterprise.server.resource.group.definition.exception.GroupDefinitionAlreadyExistsException; @@ -254,8 +255,9 @@ public class GroupDefinitionManagerBean implements GroupDefinitionManagerLocal { @RequiredPermission(Permission.MANAGE_INVENTORY) @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW) // required for the recalculation thread - public void calculateGroupMembership(Subject subject, int groupDefinitionId) throws GroupDefinitionDeleteException, - GroupDefinitionNotFoundException, InvalidExpressionException, ResourceGroupUpdateException { + public void calculateGroupMembership(Subject subject, int groupDefinitionId) throws ResourceGroupDeleteException, + GroupDefinitionDeleteException, GroupDefinitionNotFoundException, InvalidExpressionException, + ResourceGroupUpdateException { /* * even though this method declares to throw it, it should never generate an InvalidExpressionException because * the definition's expression set was validated before it was persisted. conceivably, if the group definition @@ -329,7 +331,8 @@ public class GroupDefinitionManagerBean implements GroupDefinitionManagerLocal { @RequiredPermission(Permission.MANAGE_INVENTORY) @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW) public Integer calculateGroupMembership_helper(Subject overlord, int groupDefinitionId, - ExpressionEvaluator.Result result) throws GroupDefinitionNotFoundException, GroupDefinitionNotFoundException { + ExpressionEvaluator.Result result) throws ResourceGroupDeleteException, GroupDefinitionNotFoundException, + GroupDefinitionNotFoundException { long startTime = System.currentTimeMillis();
GroupDefinition groupDefinition = getById(groupDefinitionId); diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/definition/GroupDefinitionManagerLocal.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/definition/GroupDefinitionManagerLocal.java index b57a35e..d83c77c 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/definition/GroupDefinitionManagerLocal.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/definition/GroupDefinitionManagerLocal.java @@ -25,6 +25,7 @@ import org.rhq.core.domain.criteria.ResourceGroupDefinitionCriteria; import org.rhq.core.domain.resource.group.GroupDefinition; import org.rhq.core.domain.util.PageControl; import org.rhq.core.domain.util.PageList; +import org.rhq.enterprise.server.resource.group.ResourceGroupDeleteException; import org.rhq.enterprise.server.resource.group.ResourceGroupUpdateException; import org.rhq.enterprise.server.resource.group.definition.exception.GroupDefinitionAlreadyExistsException; import org.rhq.enterprise.server.resource.group.definition.exception.GroupDefinitionCreateException; @@ -48,11 +49,11 @@ public interface GroupDefinitionManagerLocal { throws GroupDefinitionAlreadyExistsException, GroupDefinitionUpdateException, InvalidExpressionException, ResourceGroupUpdateException;
- void calculateGroupMembership(Subject subject, int groupDefinitionId) throws GroupDefinitionDeleteException, - GroupDefinitionNotFoundException, InvalidExpressionException; + void calculateGroupMembership(Subject subject, int groupDefinitionId) throws ResourceGroupDeleteException, + GroupDefinitionDeleteException, GroupDefinitionNotFoundException, InvalidExpressionException;
Integer calculateGroupMembership_helper(Subject subject, int groupDefinitionId, ExpressionEvaluator.Result result) - throws GroupDefinitionNotFoundException, GroupDefinitionNotFoundException; + throws ResourceGroupDeleteException, GroupDefinitionNotFoundException, GroupDefinitionNotFoundException;
PageList<GroupDefinition> getGroupDefinitions(Subject subject, PageControl pc);
commit 749156f88d2e834ab5ec835eec4eb4ce3d68aedb Author: Ian Springer ian.springer@redhat.com Date: Fri Jun 25 13:27:50 2010 -0400
make sure augeas 0.0.2 jar, not 0.0.1 jar, is copied into plugin jar's lib dir
diff --git a/modules/plugins/augeas/pom.xml b/modules/plugins/augeas/pom.xml index 531df2c..915106a 100644 --- a/modules/plugins/augeas/pom.xml +++ b/modules/plugins/augeas/pom.xml @@ -17,6 +17,10 @@ <name>RHQ Augeas Plugin</name> <description>An abstract plugin for configuring resources via Augeas</description>
+ <properties> + <augeas.version>0.0.2</augeas.version> + </properties> + <dependencies>
<dependency> @@ -30,11 +34,13 @@ <artifactId>rhq-platform-plugin</artifactId> <version>${project.version}</version> </dependency> - <dependency> + + <dependency> <groupId>commons-io</groupId> <artifactId>commons-io</artifactId> <version>1.4</version> </dependency> + <dependency> <groupId>org.testng</groupId> <artifactId>testng</artifactId> @@ -45,7 +51,7 @@ <dependency> <groupId>net.augeas</groupId> <artifactId>augeas</artifactId> - <version>0.0.2</version> + <version>${augeas.version}</version> </dependency>
<dependency> @@ -79,7 +85,7 @@ <artifactItem> <groupId>net.augeas</groupId> <artifactId>augeas</artifactId> - <version>0.0.1</version> + <version>${augeas.version}</version> </artifactItem>
</artifactItems> @@ -122,7 +128,6 @@
<plugin> <artifactId>maven-antrun-plugin</artifactId> - <version>1.1</version> <executions>
<execution>
commit 7d42b8feaa0bd3071cf36cf79ea58b07bf7673c9 Merge: ed7b01a... d79a2a8... Author: Ian Springer ian.springer@redhat.com Date: Fri Jun 25 13:25:49 2010 -0400
Merge branch 'release-3.0.0' of ssh://git.fedorahosted.org/git/rhq/rhq into release-3.0.0
commit d79a2a881d4a5c7356ce1cef41845c0612cfab4b Merge: e0efd15... 3617607... Author: Heiko W. Rupp hwr@redhat.com Date: Fri Jun 25 18:13:35 2010 +0200
Merge branch 'release-3.0.0' of ssh://git.fedorahosted.org/git/rhq/rhq into release-3.0.0
commit e0efd154e0eac23bb2299b6d0f2241a84fe79522 Author: Heiko W. Rupp hwr@redhat.com Date: Fri Jun 25 18:12:10 2010 +0200
BZ 583833 - re-show the Events icon in the MICA section.
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseResources.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseResources.xhtml index d492ad6..ea8017a 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseResources.xhtml +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseResources.xhtml @@ -27,7 +27,7 @@ <ui:param name="pageTitle" value="Browse Resources"/> <ui:param name="selectedTabName" value="Resources.#{param.subtab}" /> <ui:define name="content"> - + <a4j:keepAlive beanName="BrowseResourcesUIBean"/>
a4j:form @@ -37,7 +37,7 @@ </a4j:form> <h:form id="browseResourcesForm"> <input type="hidden" name="subtab" value="${param.subtab}" /> - + <p/> <h:panelGrid columns="3"> <h:outputText value="Search: " /> @@ -48,7 +48,7 @@ <ui:param name="defaultSavedSearchPattern" value="#{param.searchId}" /> </ui:include>
- <a4j:commandButton id="searchButtonJSF" value="GO" + <a4j:commandButton id="searchButtonJSF" value="GO" reRender="browseResourcesDataTable, browseResourcesDataTableScroller" status="commonStatus" actionListener="#{BrowseResourcesUIBean.clearDataModel}" @@ -85,42 +85,47 @@ <onc:select name="selectedItems" value="#{item.original.resource.id}" /> </rich:column> - + rich:column onc:quickNav <f:param name="id" value="#{item.original.resource.id}"/> - + <onc:icon name="Monitor" - url="/rhq/resource/monitor/graphs.xhtml" + url="/rhq/resource/monitor/graphs.xhtml" alt="Monitor" visible="#{monitorEnabled}"> </onc:icon> - + <onc:icon name="Inventory" - url="/rhq/resource/inventory/view.xhtml" + url="/rhq/resource/inventory/view.xhtml" alt="Inventory"/> - + <onc:icon name="Alert" - url="/rhq/resource/alert/listAlertDefinitions.xhtml" - alt="Alerts" + url="/rhq/resource/alert/listAlertDefinitions.xhtml" + alt="Alerts" visible="#{monitorEnabled}"/> - + <onc:icon name="Configure" - url="/rhq/resource/configuration/view.xhtml" - alt="Configure" + url="/rhq/resource/configuration/view.xhtml" + alt="Configure" visible="#{item.original.resourceFacets.configuration}"/> - + <onc:icon name="Operation" - url="/rhq/resource/operation/resourceOperationScheduleNew.xhtml" - alt="Operations" + url="/rhq/resource/operation/resourceOperationScheduleNew.xhtml" + alt="Operations" visible="#{item.original.resourceFacets.operation}"/> - - <onc:icon name="Content" - url="/rhq/resource/content/view.xhtml" + + <onc:icon name="Events" + url="/rhq/resource/events/history.xhtml" + alt="Events" + visible="#{item.original.resourceFacets.event}"/> + + <onc:icon name="Content" + url="/rhq/resource/content/view.xhtml" alt="Content" visible="#{item.original.resourceFacets.content}"/> - - <!-- Is this necessary? It's being passed for all quick nav urls. --> + + <!-- Is this necessary? It's being passed for all quick nav urls. --> <f:param name="mode" value="list"/> </onc:quickNav> </rich:column> @@ -132,10 +137,10 @@ </onc:sortableColumnHeader> </f:facet>
- <onc:disambiguatedResourceName resourceName="#{item.original.resource.name}" + <onc:disambiguatedResourceName resourceName="#{item.original.resource.name}" resourceId="#{item.original.resource.id}" disambiguationReport="#{item}"/> </rich:column> -<!-- +<!-- rich:column <f:facet name="header"> <onc:sortableColumnHeader sort="r.resourceType.name">
commit 3a473156682b44a9f20c4b53c1235af3bfe4a7a0 Author: Ian Springer ian.springer@redhat.com Date: Fri Jun 25 11:55:38 2010 -0400
upgrade JNA from 3.2.2 to 3.2.5; fix bug in augeas plugin pom where augeas.jar v0.0.1, rather than v0.0.2, was being included in the plugin jar's lib dir
diff --git a/modules/plugins/augeas/pom.xml b/modules/plugins/augeas/pom.xml index 72d9cc4..3e17750 100644 --- a/modules/plugins/augeas/pom.xml +++ b/modules/plugins/augeas/pom.xml @@ -17,6 +17,10 @@ <name>RHQ Augeas Plugin</name> <description>An abstract plugin for configuring resources via Augeas</description>
+ <properties> + <augeas.version>0.0.2</augeas.version> + </properties> + <dependencies>
<dependency> @@ -30,11 +34,13 @@ <artifactId>rhq-platform-plugin</artifactId> <version>${project.version}</version> </dependency> - <dependency> + + <dependency> <groupId>commons-io</groupId> <artifactId>commons-io</artifactId> <version>1.4</version> </dependency> + <dependency> <groupId>org.testng</groupId> <artifactId>testng</artifactId> @@ -45,7 +51,7 @@ <dependency> <groupId>net.augeas</groupId> <artifactId>augeas</artifactId> - <version>0.0.2</version> + <version>${augeas.version}</version> </dependency>
<dependency> @@ -60,7 +66,6 @@ <plugins> <plugin> <artifactId>maven-dependency-plugin</artifactId> - <version>2.0</version> <executions> <execution> <id>copy-plugin-libs</id> @@ -74,13 +79,13 @@ <artifactItem> <groupId>net.java.dev.jna</groupId> <artifactId>jna</artifactId> - <version>3.2.2</version> + <version>${jna.version}</version> </artifactItem>
<artifactItem> <groupId>net.augeas</groupId> <artifactId>augeas</artifactId> - <version>0.0.1</version> + <version>${augeas.version}</version> </artifactItem>
</artifactItems> @@ -123,7 +128,6 @@
<plugin> <artifactId>maven-antrun-plugin</artifactId> - <version>1.1</version> <executions>
<execution> @@ -180,7 +184,6 @@ </plugin> <plugin> <artifactId>maven-dependency-plugin</artifactId> - <version>2.0</version> <executions> <execution> <id>copy-commons-io-jar</id> diff --git a/pom.xml b/pom.xml index dff1c40..b2e8a34 100644 --- a/pom.xml +++ b/pom.xml @@ -82,7 +82,7 @@ <jline.version>0.9.94</jline.version> <sigar.version>1.6.5.132</sigar.version> <quartz.version>1.6.5</quartz.version> - <jna.version>3.2.2</jna.version> + <jna.version>3.2.5</jna.version> <twitter4j.version>2.1.2</twitter4j.version>
<!-- @@ -879,9 +879,9 @@ </repository>
<repository> - <id>jboss-thirdparty-uploads</id> - <name>JBoss Third-Party Uploads</name> - <url>https://repository.jboss.org/nexus/content/repositories/thirdparty-uploads/</url> + <id>jboss-public-repo-group</id> + <name>JBoss Public Repository Group</name> + <url>http://repository.jboss.org/nexus/content/groups/public/</url> <!-- Explicitly disable snapshots, so Maven won't try to check for updates for snapshot internal (rhq-*) deps. --> <snapshots>
commit ed7b01ad0a995bd10219031bc19be268109d1610 Author: Ian Springer ian.springer@redhat.com Date: Fri Jun 25 11:25:46 2010 -0400
use augeas.version prop rather than hard-coding Augeas version
diff --git a/modules/plugins/augeas/pom.xml b/modules/plugins/augeas/pom.xml index 963223b..531df2c 100644 --- a/modules/plugins/augeas/pom.xml +++ b/modules/plugins/augeas/pom.xml @@ -60,7 +60,6 @@ <plugins> <plugin> <artifactId>maven-dependency-plugin</artifactId> - <version>2.0</version> <executions> <execution> <id>copy-plugin-libs</id> @@ -74,7 +73,7 @@ <artifactItem> <groupId>net.java.dev.jna</groupId> <artifactId>jna</artifactId> - <version>3.2.2</version> + <version>${jna.version}</version> </artifactItem>
<artifactItem> @@ -180,7 +179,6 @@ </plugin> <plugin> <artifactId>maven-dependency-plugin</artifactId> - <version>2.0</version> <executions> <execution> <id>copy-commons-io-jar</id>
commit 863201f8b91e01632ec7453940f4b08fd3d0dda7 Author: Simeon Pinder spinder@redhat.com Date: Fri Jun 25 09:53:02 2010 -0400
BZ-597246: fixing errors, modified loadPackageBits to calculate digest and file length as well.
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerBean.java index b2cac05..6ee805e 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerBean.java @@ -18,6 +18,7 @@ */ package org.rhq.enterprise.server.content;
+import java.io.BufferedInputStream; import java.io.ByteArrayInputStream; import java.io.File; import java.io.FileInputStream; @@ -945,7 +946,7 @@ public class ContentManagerBean implements ContentManagerLocal, ContentManagerRe pkgName = packageVersion.getGeneralPackage().getName(); } bits = loadPackageBits(bitStream, packageVersion.getId(), pkgName, packageVersion.getVersion(), - bits); + bits, null); entityManager.merge(bits);
} finally { @@ -1235,17 +1236,13 @@ public class ContentManagerBean implements ContentManagerLocal, ContentManagerRe PackageVersion newPackageVersion = new PackageVersion(existingPackage, version, architecture); newPackageVersion.setDisplayName(existingPackage.getName());
- PackageBits bits = loadPackageBits(packageBitStream, newPackageVersion.getId(), packageName, version, null); + Map<String, String> contentDetails = new HashMap<String, String>(); + PackageBits bits = loadPackageBits(packageBitStream, newPackageVersion.getId(), packageName, version, null, + contentDetails);
newPackageVersion.setPackageBits(bits); - //TODO: write down to file system to calculate length and calculate hash. - newPackageVersion.setFileSize((long) bits.getBits().length); - try { - newPackageVersion.setSHA256(new MessageDigestGenerator(MessageDigestGenerator.SHA_256) - .calcDigestString(bits.getBits())); - } catch (IOException e) { - newPackageVersion.setSHA256(null); - } + newPackageVersion.setFileSize(Long.valueOf(contentDetails.get(UPLOAD_FILE_SIZE)).longValue()); + newPackageVersion.setSHA256(contentDetails.get(UPLOAD_SHA256)); newPackageVersion = persistOrMergePackageVersionSafely(newPackageVersion);
existingPackage.addVersion(newPackageVersion); @@ -1559,7 +1556,7 @@ public class ContentManagerBean implements ContentManagerLocal, ContentManagerRe }
//get the data - PackageBits bits = loadPackageBits(packageBitStream, packageVersion.getId(), packageName, version, null); + PackageBits bits = loadPackageBits(packageBitStream, packageVersion.getId(), packageName, version, null, null);
packageVersion.setPackageBits(bits);
@@ -1583,11 +1580,12 @@ public class ContentManagerBean implements ContentManagerLocal, ContentManagerRe * * @param packageBitStream * @param packageVersionId + * @param contentDetails * @return PackageBits ref populated. */ @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW) private PackageBits loadPackageBits(InputStream packageBitStream, int packageVersionId, String packageName, - String packageVersion, PackageBits existingPkgBits) { + String packageVersion, PackageBits existingPkgBits, Map<String, String> contentDetails) { PackageBits bits = null;
//use or instantiate PackageBits instance. @@ -1608,7 +1606,7 @@ public class ContentManagerBean implements ContentManagerLocal, ContentManagerRe bits = entityManager.find(PackageBits.class, bits.getId());
//write data from stream into db using Hibernate Blob mechanism - updateBlobStream(packageBitStream, bits); + updateBlobStream(packageBitStream, bits, contentDetails);
return bits; } @@ -1617,8 +1615,9 @@ public class ContentManagerBean implements ContentManagerLocal, ContentManagerRe * Blob mechanism with PreparedStatements. As all content into Bits are not stored as type OID, t * * @param stream + * @param contentDetails Map to store content details in used in PackageVersioning */ - public void updateBlobStream(InputStream stream, PackageBits bits) { + public void updateBlobStream(InputStream stream, PackageBits bits, Map<String, String> contentDetails) {
//TODO: are there any db specific limits that we should check/verify here before stuffing // the contents of a stream into the db? Should we just let the db complain and take care of @@ -1632,7 +1631,7 @@ public class ContentManagerBean implements ContentManagerLocal, ContentManagerRe
//persist to db if not already if (bits.getId() <= 0) { - entityManager.persist(this); + entityManager.persist(bits); }
//locate the existing PackageBits instance @@ -1647,7 +1646,6 @@ public class ContentManagerBean implements ContentManagerLocal, ContentManagerRe Connection conn = null; PreparedStatement ps = null; PreparedStatement ps2 = null; - DataSource ds = null; try {
conn = dataSource.getConnection(); @@ -1666,7 +1664,7 @@ public class ContentManagerBean implements ContentManagerLocal, ContentManagerRe Blob blb = rs.getBlob(1);
//copy the stream to the Blob - long transferred = StreamUtil.copy(stream, blb.setBinaryStream(1), false); + long transferred = copyAndDigest(stream, blb.setBinaryStream(1), false, contentDetails); stream.close();
//populate the prepared statement for update @@ -1687,6 +1685,37 @@ public class ContentManagerBean implements ContentManagerLocal, ContentManagerRe log.error("An error occurred while updating Blob with stream for PackageBits[" + bits.getId() + "], " + e.getMessage()); e.printStackTrace(); + } finally { + if (ps != null) { + try { + ps.close(); + } catch (Exception e) { + log.warn("Failed to close prepared statement for package bits [" + bits.getId() + "]"); + } + } + + if (ps2 != null) { + try { + ps2.close(); + } catch (Exception e) { + log.warn("Failed to close prepared statement for package bits [" + bits.getId() + "]"); + } + } + + if (conn != null) { + try { + conn.close(); + } catch (Exception e) { + log.warn("Failed to close connection for package bits [" + bits.getId() + "]"); + } + } + if (stream != null) { + try { + stream.close(); + } catch (Exception e) { + log.warn("Failed to close stream to package bits located at [" + +bits.getId() + "]"); + } + } }
entityManager.merge(bits); @@ -1717,7 +1746,6 @@ public class ContentManagerBean implements ContentManagerLocal, ContentManagerRe ps.setInt(1, bits.getId()); ResultSet results = ps.executeQuery(); if (results.next()) { - // results.next(); //retrieve the Blob Blob blob = results.getBlob(1); //now copy the contents to the stream passed in @@ -1728,4 +1756,63 @@ public class ContentManagerBean implements ContentManagerLocal, ContentManagerRe ex.printStackTrace(); } } + + /** Functions same as StreamUtil.copy(), but calculates SHA hash and file size and write it to + * the Map<String,String> passed in. + * + * @param input + * @param output + * @param closeStreams + * @param contentDetails + * @return + * @throws RuntimeException + */ + private long copyAndDigest(InputStream input, OutputStream output, boolean closeStreams, + Map<String, String> contentDetails) throws RuntimeException { + long numBytesCopied = 0; + int bufferSize = 32768; + MessageDigestGenerator digestGenerator = null; + if (contentDetails != null) { + digestGenerator = new MessageDigestGenerator(MessageDigestGenerator.SHA_256); + } + try { + // make sure we buffer the input + input = new BufferedInputStream(input, bufferSize); + + byte[] buffer = new byte[bufferSize]; + + for (int bytesRead = input.read(buffer); bytesRead != -1; bytesRead = input.read(buffer)) { + output.write(buffer, 0, bytesRead); + numBytesCopied += bytesRead; + if (digestGenerator != null) { + digestGenerator.add(buffer, 0, bytesRead); + } + } + + if (contentDetails != null) {//if we're calculating a digest as well + contentDetails.put(UPLOAD_FILE_SIZE, String.valueOf(numBytesCopied)); + contentDetails.put(UPLOAD_SHA256, digestGenerator.getDigestString()); + } + output.flush(); + } catch (IOException ioe) { + throw new RuntimeException("Stream data cannot be copied", ioe); + } finally { + if (closeStreams) { + try { + output.close(); + } catch (IOException ioe2) { + log.warn("Streams could not be closed", ioe2); + } + + try { + input.close(); + } catch (IOException ioe2) { + log.warn("Streams could not be closed", ioe2); + } + } + } + + return numBytesCopied; + } + } \ No newline at end of file diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerLocal.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerLocal.java index 65b0365..0b0e5a5 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerLocal.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerLocal.java @@ -349,6 +349,6 @@ public interface ContentManagerLocal {
void writeBlobOutToStream(OutputStream stream, PackageBits bits, boolean closeStreams);
- void updateBlobStream(InputStream stream, PackageBits bits); + void updateBlobStream(InputStream stream, PackageBits bits, Map<String, String> contentDetails);
} \ No newline at end of file
commit 3617607ac9b93a68a790a8c465679cb74f9f11f1 Author: Lukas Krejci lkrejci@redhat.com Date: Fri Jun 25 13:56:43 2010 +0200
BZ 601176 - Adding support for '*' as both host and port spec in Listen, and VirtualHost directives. Enhanced the detection of the address a server or vhost is reachable on, thus improving the out-of-the-box availability detection.
diff --git a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheServerComponent.java b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheServerComponent.java index 38ce9dc..0e98116 100644 --- a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheServerComponent.java +++ b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheServerComponent.java @@ -390,7 +390,7 @@ public class ApacheServerComponent implements AugeasRHQComponent<PlatformCompone ApacheParser parser = new ApacheParserImpl(parserTree,getServerRoot().getAbsolutePath());
ApacheConfigReader.buildTree(getHttpdConfFile().getAbsolutePath(), parser); - addr = getAddressUtility().getVirtualHostSampleAddress(parserTree, vhostDefs[0], serverName); + addr = getAddressUtility().getVirtualHostSampleAddress(parserTree, vhostDefs[0], serverName, false); } catch (Exception e) { report.setStatus(CreateResourceStatus.FAILURE); report.setErrorMessage("Wrong format of virtual host resource name."); diff --git a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheServerDiscoveryComponent.java b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheServerDiscoveryComponent.java index 8f6deb7..edffb23 100644 --- a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheServerDiscoveryComponent.java +++ b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheServerDiscoveryComponent.java @@ -235,7 +235,7 @@ public class ApacheServerDiscoveryComponent implements ResourceDiscoveryComponen * @throws Exception */ private static String getUrl(ApacheDirectiveTree serverConfig, String version) throws Exception { - Address addr = HttpdAddressUtility.get(version).getMainServerSampleAddress(serverConfig); + Address addr = HttpdAddressUtility.get(version).getMainServerSampleAddress(serverConfig, null, 0); return addr == null ? null : "http://" + addr.host + ":" + addr.port + "/"; }
diff --git a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheVirtualHostServiceComponent.java b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheVirtualHostServiceComponent.java index 533ebd4..e44fef5 100644 --- a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheVirtualHostServiceComponent.java +++ b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheVirtualHostServiceComponent.java @@ -516,11 +516,17 @@ public class ApacheVirtualHostServiceComponent implements ResourceComponent<Apac
ApacheServerComponent parent = resourceContext.getParentResourceComponent(); if (vhostAddressStrings.length == 1 && MAIN_SERVER_RESOURCE_KEY.equals(vhostAddressStrings[0])) { - vhostAddresses.add(parent.getAddressUtility().getMainServerSampleAddress(tree)); + HttpdAddressUtility.Address serverAddr = parent.getAddressUtility().getMainServerSampleAddress(tree, null, 0); + if (serverAddr != null) { + vhostAddresses.add(serverAddr); + } } else { for (int i = 0; i < vhostAddressStrings.length; ++i) { - vhostAddresses.add(parent.getAddressUtility().getVirtualHostSampleAddress(tree, vhostAddressStrings[i], - vhostServerName)); + HttpdAddressUtility.Address vhostAddr = parent.getAddressUtility().getVirtualHostSampleAddress(tree, vhostAddressStrings[i], + vhostServerName, true); + if (vhostAddr != null) { + vhostAddresses.add(vhostAddr); + } } }
@@ -540,7 +546,10 @@ public class ApacheVirtualHostServiceComponent implements ResourceComponent<Apac String fullPort = portValue.toString();
int snmpPort = Integer.parseInt(fullPort.substring(fullPort.lastIndexOf(".") + 1)); - if (snmpPort == 0) snmpPort = 80; + + //the snmp represent wildcard ports as 0 and so does HttpdAddressUtility.Address class + //we can therefore match the Address generated from the snmp values and the Addresses + //stored for this vhost directly.
HttpdAddressUtility.Address snmpAddress = new HttpdAddressUtility.Address(snmpHost, snmpPort);
@@ -562,8 +571,10 @@ public class ApacheVirtualHostServiceComponent implements ResourceComponent<Apac }
private int matchRate(List<HttpdAddressUtility.Address> addresses, HttpdAddressUtility.Address addressToCheck) throws UnknownHostException { - if (addresses.contains(addressToCheck)) { - return 3; + for(HttpdAddressUtility.Address a : addresses) { + if (HttpdAddressUtility.isAddressConforming(addressToCheck, a.host, a.port)) { + return 3; + } }
//try to get the IP of the address to check @@ -572,8 +583,10 @@ public class ApacheVirtualHostServiceComponent implements ResourceComponent<Apac for(InetAddress ip : ipAddresses) { HttpdAddressUtility.Address newCheck = new HttpdAddressUtility.Address(ip.getHostAddress(), addressToCheck.port);
- if (addresses.contains(newCheck)) { - return 2; + for(HttpdAddressUtility.Address a : addresses) { + if (HttpdAddressUtility.isAddressConforming(newCheck, a.host, a.port)) { + return 2; + } } }
diff --git a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheVirtualHostServiceDiscoveryComponent.java b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheVirtualHostServiceDiscoveryComponent.java index 75e9f35..b308dd4 100644 --- a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheVirtualHostServiceDiscoveryComponent.java +++ b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheVirtualHostServiceDiscoveryComponent.java @@ -49,6 +49,8 @@ import org.rhq.plugins.apache.util.HttpdAddressUtility.Address; */ public class ApacheVirtualHostServiceDiscoveryComponent implements ResourceDiscoveryComponent<ApacheServerComponent> {
+ private static final String COULD_NOT_DETERMINE_THE_VIRTUAL_HOST_ADDRESS = "*** Could not determine the virtual host address ***"; + public static final String LOGS_DIRECTORY_NAME = "logs";
private static final String RT_LOG_FILE_NAME_SUFFIX = "_rt.log"; @@ -97,12 +99,38 @@ public class ApacheVirtualHostServiceDiscoveryComponent implements ResourceDisco
Configuration pluginConfiguration = context.getDefaultPluginConfiguration();
- Address address = serverComponent.getAddressUtility().getVirtualHostSampleAddress(tree, firstAddress, serverName); + Address address = serverComponent.getAddressUtility().getVirtualHostSampleAddress(tree, firstAddress, serverName, false); if (address != null) { - String url = "http://" + address.host + ":" + address.port + "/"; + String hostToPing = address.host; + int portToPing = address.port; + if (address.isPortWildcard()) { + Address serverAddress = serverComponent.getAddressUtility().getMainServerSampleAddress(tree, hostToPing, 0); + if (serverAddress != null) { + portToPing = serverAddress.port; + } else { + portToPing = Address.PORT_WILDCARD_VALUE; + } + } + if (address.isHostDefault() || address.isHostWildcard()) { + Address serverAddress = serverComponent.getAddressUtility().getMainServerSampleAddress(tree, null, portToPing); + + if (serverAddress != null) { + hostToPing = serverAddress.host; + } else { + hostToPing = null; + } + } + + String url; + if (hostToPing != null && portToPing != Address.PORT_WILDCARD_VALUE && portToPing != Address.NO_PORT_SPECIFIED_VALUE) { + url = "http://" + hostToPing + ":" + portToPing + "/"; + } else { + url = COULD_NOT_DETERMINE_THE_VIRTUAL_HOST_ADDRESS; + }
PropertySimple urlProp = new PropertySimple(ApacheVirtualHostServiceComponent.URL_CONFIG_PROP, url); pluginConfiguration.put(urlProp); + }
File rtLogFile = new File(logsDir, address.host + address.port + RT_LOG_FILE_NAME_SUFFIX); @@ -113,7 +141,7 @@ public class ApacheVirtualHostServiceDiscoveryComponent implements ResourceDisco
String resourceName; if (serverName != null) { - resourceName = address.host + ":" + address.port; + resourceName = address.toString(); } else { resourceName = resourceKey; } diff --git a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/util/HttpdAddressUtility.java b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/util/HttpdAddressUtility.java index 1aea3b2..261c446 100644 --- a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/util/HttpdAddressUtility.java +++ b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/util/HttpdAddressUtility.java @@ -25,11 +25,11 @@ package org.rhq.plugins.apache.util;
import java.net.InetAddress; import java.net.UnknownHostException; +import java.util.ArrayList; import java.util.List;
import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.rhq.augeas.node.AugeasNode; import org.rhq.plugins.apache.parser.ApacheDirective; import org.rhq.plugins.apache.parser.ApacheDirectiveTree;
@@ -41,71 +41,54 @@ import org.rhq.plugins.apache.parser.ApacheDirectiveTree; public enum HttpdAddressUtility {
APACHE_1_3 { - public Address getMainServerSampleAddress(ApacheDirectiveTree ag) { + public Address getMainServerSampleAddress(ApacheDirectiveTree ag, String limitToHost, int limitToPort) { try { - Address addr = null; + List<ApacheDirective> ports = ag.search("/Port"); + List<ApacheDirective> bindAddresses = ag.search("/BindAddress"); + List<ApacheDirective> listens = ag.search("/Listen");
- //check if there is a ServerName directive - List<ApacheDirective> serverNameNodes = ag.search("/ServerName"); - - if (serverNameNodes.size() > 0) { - String serverName = serverNameNodes.get(0).getValuesAsString(); - addr = Address.parse(serverName); - } else { - List<ApacheDirective> ports = ag.search("/Port"); - List<ApacheDirective> bindAddresses = ag.search("/BindAddress"); - List<ApacheDirective> listens = ag.search("/Listen"); - - String port = null; - String bindAddress = null; - String listen = null; - - if (ports.size() > 0) { - List<String>values = ports.get(0).getValues(); - if (values.size()>0) - port = values.get(0); - } - - if (bindAddresses.size() > 0) { - List<String>values = bindAddresses.get(0).getValues(); - if (values.size()>0) - bindAddress = values.get(0); - } - - if (listens.size() > 0) { - List<String>values = listens.get(0).getValues(); - if (values.size()>0) - listen = values.get(0); - } - - String host = null; - int portToUse = -1; - - if (bindAddress != null && !"*".equals(bindAddress)) { - host = bindAddress; - } - - if (port != null) { - portToUse = Integer.parseInt(port); + String port = "80"; //this is the default in apache 1.3 + String bindAddress = null; + + List<Address> addressesToMatch = new ArrayList<Address>(); + + if (ports.size() > 0) { + List<String>values = ports.get(0).getValues(); + if (values.size()>0) + port = values.get(0); + } + + if (bindAddresses.size() > 0) { + List<String>values = bindAddresses.get(0).getValues(); + if (values.size()>0) + bindAddress = values.get(0); + } + + //listen directives take precedence over port/bindaddress combo + if (listens.size() > 0) { + for(ApacheDirective l : listens) { + addressesToMatch.add(parseListen(l.getValues().get(0))); } - - if (listen != null) { - Address tmp = Address.parse(listen); - host = tmp.host; - portToUse = tmp.port; - if (portToUse == -1) { - host = null; - portToUse = Integer.parseInt(tmp.host); + } else { + addressesToMatch.add(new Address(bindAddress, Integer.parseInt(port))); + } + + for (Address address : addressesToMatch) { + if (isAddressConforming(address, limitToHost, limitToPort)) { + if (!address.isPortDefined() || address.isPortWildcard()) { + address.port = 80; } + if (address.host == null || address.isHostDefault() || address.isHostWildcard()) { + address = getLocalhost(address.port); + } + + updateWithServerName(address, ag); + + return address; } - - if (host == null) { - host = InetAddress.getLocalHost().getHostName(); - } - - addr = new Address(host, portToUse); } - return addr; + + return null; } catch (Exception e) { log.info("Failed to obtain main server address. Is augeas installed and correct lens in use?");
@@ -114,34 +97,23 @@ public enum HttpdAddressUtility { } }, APACHE_2_x { - public Address getMainServerSampleAddress(ApacheDirectiveTree ag) { + public Address getMainServerSampleAddress(ApacheDirectiveTree ag, String limitToHost, int limitToPort) { try { - Address addr = null; - - //check if there is a ServerName directive - List<ApacheDirective> serverNameNodes = ag.search("/ServerName"); - - if (serverNameNodes.size() > 0) { - String serverName = serverNameNodes.get(0).getValuesAsString(); - addr = Address.parse(serverName); - } else { - //there has to be at least one Listen directive - ApacheDirective listen = ag.search("/Listen").get(0); - - String address = listen.getValues().get(0); - - addr = Address.parse(address); - - if (addr.port == -1) { - addr.port = Integer.parseInt(addr.host); - try { - addr.host = InetAddress.getLocalHost().getHostName(); - } catch (UnknownHostException e) { - throw new IllegalStateException("Unable to get the localhost address.", e); + for(ApacheDirective n : ag.search("/Listen")) { + Address addr = parseListen(n.getValues().get(0)); + if (isAddressConforming(addr, limitToHost, limitToPort)) { + if (addr.host == null || addr.isHostDefault() || addr.isHostWildcard()) { + addr = getLocalhost(addr.port); } + + updateWithServerName(addr, ag); + + return addr; } } - return addr; + + //there has to be at least one Listen directive + throw new IllegalStateException("Could find a listen address on port " + limitToPort); } catch (Exception e) { log.info("Failed to obtain main server address. Is augeas installed and correct lens in use?");
@@ -159,7 +131,12 @@ public enum HttpdAddressUtility { public static class Address { public String host; public int port = -1; - + + public static final String WILDCARD = "*"; + public static final String DEFAULT_HOST = "_default_"; + public static final int PORT_WILDCARD_VALUE = 0; + public static final int NO_PORT_SPECIFIED_VALUE = -1; + public Address(String host, int port) { this.host = host; this.port = port; @@ -174,21 +151,45 @@ public enum HttpdAddressUtility { */ public static Address parse(String address) { int lastColonIdx = address.lastIndexOf(':'); - if (lastColonIdx == -1) { + if (lastColonIdx == NO_PORT_SPECIFIED_VALUE) { return new Address(address, -1); } else { int lastRightBracketPos = address.lastIndexOf(']'); if (lastColonIdx > lastRightBracketPos) { String host = address.substring(0, lastColonIdx); - int port = Integer.parseInt(address.substring(lastColonIdx + 1)); + String portSpec = address.substring(lastColonIdx + 1); + + int port = NO_PORT_SPECIFIED_VALUE; + if (WILDCARD.equals(portSpec)) { + port = PORT_WILDCARD_VALUE; + } else { + port = Integer.parseInt(portSpec); + } + return new Address(host, port); } else { //this is an IP6 address without a port spec - return new Address(address, -1); + return new Address(address, NO_PORT_SPECIFIED_VALUE); } } }
+ public boolean isPortWildcard() { + return port == PORT_WILDCARD_VALUE; + } + + public boolean isPortDefined() { + return port != NO_PORT_SPECIFIED_VALUE; + } + + public boolean isHostWildcard() { + return WILDCARD.equals(host); + } + + public boolean isHostDefault() { + return DEFAULT_HOST.equals(host); + } + @Override public int hashCode() { int hash = port; @@ -210,15 +211,28 @@ public enum HttpdAddressUtility { return this.host.equals(o.host) && this.port == o.port; } } + + @Override + public String toString() { + if (port == NO_PORT_SPECIFIED_VALUE) return host; + else { + String portSpec = port == PORT_WILDCARD_VALUE ? WILDCARD : String.valueOf(port); + + return host + ":" + portSpec; + } + } }
/** * This just constructs a first available address under which the server or one of its virtual hosts can be reached. * * @param ag the tree of the httpd configuration + * @param limitToHost if non-null and different from {@link Address#DEFAULT_HOST} and {@link Address#WILDCARD}, + * the sample address is looked for only for the given host + * @param limitToPort if > 0, the sample address is looked for only for the given port * @return the address or null on failure */ - public abstract Address getMainServerSampleAddress(ApacheDirectiveTree ag); + public abstract Address getMainServerSampleAddress(ApacheDirectiveTree ag, String limitToHost, int limitToPort);
/** * This constructs an address on which given virtual host can be accessed. @@ -226,29 +240,22 @@ public enum HttpdAddressUtility { * @param ag the augeas tree of the httpd configuration * @param virtualHost the port or address:port of the virtual host * @param serverName the server name for the namebased virtual hosts (or null if the virtual host is ip based) - * + * @param snmpModuleCompatibleMode if true, generates a sample address in the same way as snmp module. Namely + * deals with the host name wildcard the same way as snmp module (i.e. by assuming it means "localhost", even though it doesn't have to). * @return the address on which the virtual host can be accessed or null on error */ - public Address getVirtualHostSampleAddress(ApacheDirectiveTree ag, String virtualHost, String serverName) { + public Address getVirtualHostSampleAddress(ApacheDirectiveTree ag, String virtualHost, String serverName, boolean snmpModuleCompatibleMode) { Address addr = Address.parse(virtualHost); - if (addr.port == -1) { - //just port specified - Address serverAddr = getMainServerSampleAddress(ag); - + if (addr.isHostDefault() || addr.isHostWildcard()) { + Address serverAddr = null; + if (snmpModuleCompatibleMode) { + serverAddr = getLocalhost(addr.port); + } else { + serverAddr = getMainServerSampleAddress(ag, null, addr.port); + } if (serverAddr == null) return null; - - addr.port = Integer.parseInt(addr.host); addr.host = serverAddr.host; - } else { - String host = addr.host; - if ("*".equals(host) || "_default_".equals(host)) { - Address serverAddr = getMainServerSampleAddress(ag); - if (serverAddr == null) - return null; - host = serverAddr.host; - } - addr.host = host; }
if (serverName != null) { @@ -259,9 +266,69 @@ public enum HttpdAddressUtility { } else { addr.host = serverName; } - addr.host = addr.host.replaceAll("\*", "replaced-wildcard"); }
return addr; } + + private static Address parseListen(String listenValue) { + Address ret = Address.parse(listenValue); + if (!ret.isPortDefined()) { + try { + ret.port = Integer.parseInt(ret.host); + } catch (NumberFormatException e) { + return null; + } + ret.host = null; + } + + return ret; + } + + public static boolean isAddressConforming(Address listen, String limitingHost, int limitingPort) { + if (Address.DEFAULT_HOST.equals(limitingHost) || Address.WILDCARD.equals(limitingHost)) { + limitingHost = null; + } + + boolean hostOk = limitingHost == null; + boolean portOk = limitingPort <= 0; + + //listen.host == null means that server listens on all addresses + if (!hostOk && (listen.host == null || limitingHost.equals(listen.host))) { + hostOk = true; + } + + if (!portOk && limitingPort == listen.port) { + portOk = true; + } + + return hostOk && portOk; + } + + private static Address getLocalhost(int port) { + try { + return new Address(InetAddress.getLocalHost().getHostAddress(), port); + } catch (UnknownHostException e) { + //well, this is bad, we can get address of the localhost. let's use the force... + return new Address("127.0.0.1", port); + } + } + + private static void updateWithServerName(Address address, ApacheDirectiveTree config) throws UnknownHostException { + //check if there is a ServerName directive + List<ApacheDirective> serverNameNodes = config.search("/ServerName"); + + //if there is a ServerName directive, check that the address + //we're returning indeed corresponds to it. This might not + //be the case if the server listens on more than one interfaces. + if (serverNameNodes.size() > 0) { + String serverName = serverNameNodes.get(0).getValuesAsString(); + InetAddress addrFromServerName = InetAddress.getByName(serverName); + InetAddress addrFromAddress = InetAddress.getByName(address.host); + + if (addrFromAddress.equals(addrFromServerName)) { + address.host = serverName; + } + } + } } diff --git a/modules/plugins/augeas/src/main/java/org/rhq/rhqtransform/impl/PluginDescriptorBasedAugeasConfiguration.java b/modules/plugins/augeas/src/main/java/org/rhq/rhqtransform/impl/PluginDescriptorBasedAugeasConfiguration.java index 8f3e470..cd15ef2 100644 --- a/modules/plugins/augeas/src/main/java/org/rhq/rhqtransform/impl/PluginDescriptorBasedAugeasConfiguration.java +++ b/modules/plugins/augeas/src/main/java/org/rhq/rhqtransform/impl/PluginDescriptorBasedAugeasConfiguration.java @@ -129,7 +129,7 @@ public class PluginDescriptorBasedAugeasConfiguration implements AugeasConfigura }
public static List<String> getGlobList(PropertySimple list) { - if (list != null) { + if (list != null && list.getStringValue() != null) { return Arrays.asList(list.getStringValue().split("\s*\|\s*")); } else { return Collections.emptyList();
commit 4876619ad4df851263624fcf54687c23559b8eaf Author: Joseph Marques joseph@redhat.com Date: Fri Jun 25 00:43:57 2010 -0400
BZ-597174: make category filter more lenient for group-based searching
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/GroupSearchTranslator.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/GroupSearchTranslator.java index a754f43..5a603ed 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/GroupSearchTranslator.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/GroupSearchTranslator.java @@ -1,5 +1,6 @@ package org.rhq.enterprise.server.search.translation;
+import org.rhq.core.domain.resource.ResourceCategory; import org.rhq.enterprise.server.search.translation.antlr.RHQLAdvancedTerm; import org.rhq.enterprise.server.search.translation.antlr.RHQLComparisonOperator; import org.rhq.enterprise.server.search.translation.jpql.SearchFragment; @@ -41,7 +42,7 @@ public class GroupSearchTranslator extends AbstractSearchTranslator {
} else if (path.equals("category")) { return new SearchFragment(SearchFragmentType.WHERE_CLAUSE, // - getJPQLForString(alias + ".resourceType.category", op, filter)); + getJPQLForEnum(alias + ".resourceType.category", op, filter, ResourceCategory.class, false));
} else if (path.equals("type")) { return new SearchFragment(SearchFragmentType.WHERE_CLAUSE, //
commit cba42b61bc8ba3b9b2aaf1afe76754f0f398d850 Author: Joseph Marques joseph@redhat.com Date: Fri Jun 25 00:38:22 2010 -0400
BZ-597174: make category filter more lenient for resource-based searching
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/ResourceSearchTranslator.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/ResourceSearchTranslator.java index 4ed1607..579184b 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/ResourceSearchTranslator.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/translation/ResourceSearchTranslator.java @@ -2,6 +2,7 @@ package org.rhq.enterprise.server.search.translation;
import org.rhq.core.domain.alert.AlertPriority; import org.rhq.core.domain.measurement.AvailabilityType; +import org.rhq.core.domain.resource.ResourceCategory; import org.rhq.core.domain.search.assist.AlertSearchAssistParam; import org.rhq.enterprise.server.search.translation.antlr.RHQLAdvancedTerm; import org.rhq.enterprise.server.search.translation.antlr.RHQLComparisonOperator; @@ -24,7 +25,7 @@ public class ResourceSearchTranslator extends AbstractSearchTranslator {
} else if (path.equals("category")) { return new SearchFragment(SearchFragmentType.WHERE_CLAUSE, // - getJPQLForString(alias + ".resourceType.category", op, filter)); + getJPQLForEnum(alias + ".resourceType.category", op, filter, ResourceCategory.class, false));
} else if (path.equals("type")) { return new SearchFragment(SearchFragmentType.WHERE_CLAUSE, //
commit 9da7f8614a2aceceba960fee8a876e4b0b98df3a Author: Ian Springer ian.springer@redhat.com Date: Fri Jun 25 00:26:37 2010 -0400
include command-line Ant bundle deployer zipfile in rhq-downloads dir and add download link on downloads.xhtml page
diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/admin/DownloadsUIBean.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/admin/DownloadsUIBean.java index 56e38db..bad2170 100644 --- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/admin/DownloadsUIBean.java +++ b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/admin/DownloadsUIBean.java @@ -1,6 +1,6 @@ /* * RHQ Management Platform - * Copyright (C) 2005-2008 Red Hat, Inc. + * Copyright (C) 2005-2010 Red Hat, Inc. * All rights reserved. * * This program is free software; you can redistribute it and/or modify @@ -29,8 +29,8 @@ import java.util.Properties; import org.rhq.enterprise.server.util.LookupUtil;
/** - * Provides data to the page that allows a user to download the agent update binary, client distribution - * or connector binaries. + * Provides data to the page that allows a user to download the agent update binary, client distribution, + * connector binaries, or command-line bundle deployer. * * @author Greg Hinkle */ @@ -38,32 +38,22 @@ public class DownloadsUIBean implements Serializable { private static final long serialVersionUID = 1L;
public Properties getAgentVersionProperties() { - try { File file = LookupUtil.getAgentManager().getAgentUpdateVersionFile();
- Properties p = new Properties(); - p.load(new FileInputStream(file)); + Properties props = new Properties(); + props.load(new FileInputStream(file));
- return p; + return props;
} catch (Exception e) { throw new RuntimeException("Agent download information not available", e); } - }
public List<File> getConnectorDownloadFiles() throws Exception { File downloadDir = getConnectorDownloadsDir(); - File[] filesArray = downloadDir.listFiles(); - List<File> files = new ArrayList<File>(); - if (filesArray != null) { - for (File file : filesArray) { - if (file.isFile()) { - files.add(file); - } - } - } + List<File> files = getFiles(downloadDir); return files; }
@@ -71,7 +61,7 @@ public class DownloadsUIBean implements Serializable { File serverHomeDir = LookupUtil.getCoreServer().getJBossServerHomeDir(); File downloadDir = new File(serverHomeDir, "deploy/rhq.ear/rhq-downloads/connectors"); if (!downloadDir.exists()) { - throw new FileNotFoundException("Missing connectors downloads directory at [" + downloadDir + "]"); + throw new FileNotFoundException("Missing connectors download directory at [" + downloadDir + "]"); } return downloadDir; } @@ -96,4 +86,32 @@ public class DownloadsUIBean implements Serializable { } }
+ public String getBundleDeployerDownloadFileName() throws Exception { + File downloadDir = getBundleDeployerDownloadDir(); + List<File> files = getFiles(downloadDir); + File file = files.get(0); + return file.getName(); + } + + private File getBundleDeployerDownloadDir() throws Exception { + File serverHomeDir = LookupUtil.getCoreServer().getJBossServerHomeDir(); + File downloadDir = new File(serverHomeDir, "deploy/rhq.ear/rhq-downloads/bundle-deployer"); + if (!downloadDir.exists()) { + throw new FileNotFoundException("Missing bundle deployer download directory at [" + downloadDir + "]"); + } + return downloadDir; + } + + private static List<File> getFiles(File downloadDir) { + File[] filesArray = downloadDir.listFiles(); + List<File> files = new ArrayList<File>(); + if (filesArray != null) { + for (File file : filesArray) { + if (file.isFile()) { + files.add(file); + } + } + } + return files; + } } diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/admin/downloads.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/admin/downloads.xhtml index 9ad82f4..834158c 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/admin/downloads.xhtml +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/admin/downloads.xhtml @@ -28,7 +28,6 @@
<ui:define name="body">
- rich:panel <f:facet name="header"> <h:outputText value="Agent Download"/> @@ -51,8 +50,6 @@ </h:panelGroup>
- - <h3>Agent Install</h3>
<p> @@ -75,7 +72,6 @@ where the existing agent is, the default is: rhq-agent This is mutually exclusive of --install - </p>
@@ -113,6 +109,21 @@ </rich:panel>
+ rich:panel + <f:facet name="header"> + <h:outputText value="Bundle Deployer Download"/> + </f:facet> + + <h:panelGrid columns="1" width="100%"> + + <h:outputLink value="/downloads/bundle-deployer/#{DownloadsUIBean.bundleDeployerDownloadFileName}"> + <h:graphicImage value="/images/icons/Save_32.png"/> + <h:outputText value="Download Bundle Deployer"/> + </h:outputLink> + + </h:panelGrid> + </rich:panel> + </ui:define> </ui:composition> -</html> \ No newline at end of file +</html> diff --git a/modules/enterprise/server/container/src/main/scripts/rhq-container.build.xml b/modules/enterprise/server/container/src/main/scripts/rhq-container.build.xml index 4e7a944..238f6d2 100644 --- a/modules/enterprise/server/container/src/main/scripts/rhq-container.build.xml +++ b/modules/enterprise/server/container/src/main/scripts/rhq-container.build.xml @@ -351,6 +351,7 @@ <mkdir dir="${jboss.deploy.dir}/${rhq.earName}/rhq-downloads/rhq-client" /> <mkdir dir="${jboss.deploy.dir}/${rhq.earName}/rhq-downloads/rhq-plugins" /> <mkdir dir="${jboss.deploy.dir}/${rhq.earName}/rhq-downloads/connectors" /> + <mkdir dir="${jboss.deploy.dir}/${rhq.earName}/rhq-downloads/bundle-deployer" />
<!-- deploy the agent update binary to the downloads location --> <echo>Deploying the latest agent update binary and renaming it rhq-enterprise-agent-${rhq.version}.jar</echo> @@ -366,6 +367,13 @@ verbose="true" failonerror="false"/>
+ <!-- deploy the command-line bundle deployer (Ant launcher) to the downloads location. --> + <echo>Deploying the latest command-line bundle deployer</echo> + <copy file="${settings.localRepository}/org/rhq/rhq-ant-bundle-common/${rhq.version}/rhq-ant-bundle-common-${rhq.version}.zip" + tofile="${jboss.deploy.dir}/${rhq.earName}/rhq-downloads/bundle-deployer/rhq-bundle-deployer-${rhq.version}.zip" + verbose="true" + failonerror="false"/> + <!-- optionally package the connectors --> <antcall target="package-connectors" />
commit 31ae5bb82c7c47f807e6c9bb209dbe649d97ea3b Author: Joseph Marques joseph@redhat.com Date: Thu Jun 24 22:26:33 2010 -0400
remove unnecessary reloading of the group definition during updates
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/definition/GroupDefinitionManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/definition/GroupDefinitionManagerBean.java index ebfeccd..ee0dae9 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/definition/GroupDefinitionManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/definition/GroupDefinitionManagerBean.java @@ -269,6 +269,7 @@ public class GroupDefinitionManagerBean implements GroupDefinitionManagerLocal { long startTime = System.currentTimeMillis();
GroupDefinition groupDefinition = getById(groupDefinitionId); + groupDefinition.setLastCalculationTime(System.currentTimeMillis()); // we're calculating now
ExpressionEvaluator evaluator = new ExpressionEvaluator(); for (String expression : groupDefinition.getExpressionAsList()) { @@ -320,10 +321,6 @@ public class GroupDefinitionManagerBean implements GroupDefinitionManagerLocal { groupDefinitionManager.removeManagedResource_helper(subject, groupDefinitionId, doomedGroupId); }
- // re-attach the group, because it was cleared from the session during the callout to the helper - groupDefinition = getById(groupDefinitionId); - groupDefinition.setLastCalculationTime(System.currentTimeMillis()); - long endTime = System.currentTimeMillis();
log.debug("calculateGroupMembership took " + (endTime - startTime) + " millis");
commit 5705abb4352b142bfe840c0dc55e6d02d82de761 Author: Joseph Marques joseph@redhat.com Date: Thu Jun 24 18:22:40 2010 -0400
BZ-601240: more graceful handling of exceptional conditions when loading SearchSuggestions
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java index 435e073..34eed0e 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/execution/SearchAssistManager.java @@ -358,6 +358,14 @@ public class SearchAssistManager { public List<SearchSuggestion> getSuggestions(String expression, int caretPos) { List<SearchSuggestion> results = new ArrayList<SearchSuggestion>();
+ if (subject == null) { + // likely a client's misuse of the API, but gracefully return no saved searches if the user is not found + SearchSuggestion footerMessage = new SearchSuggestion(Kind.InstructionalTextComment, + "Error retrieving saved searches, please refresh page"); + results.add(footerMessage); + return results; + } + try { if (expression == null) { expression = "";
commit e2d53dc7bc6b28181bf93392229a49b8df516f71 Author: Joseph Marques joseph@redhat.com Date: Thu Jun 24 17:22:00 2010 -0400
get rid of massive (now obsolete) native SQL solution for retrieving ResourceGroupComposites for some GroupDefinition
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/group/GroupDefinition.java b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/group/GroupDefinition.java index d4c7ada..48e35cd 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/group/GroupDefinition.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/group/GroupDefinition.java @@ -52,10 +52,6 @@ import org.rhq.core.domain.util.StringUtils; + "SELECT gd " // + " FROM GroupDefinition AS gd " // + " WHERE LOWER(gd.name) = LOWER(:name)"), // - @NamedQuery(name = GroupDefinition.QUERY_FIND_MEMBERS_count, query = "" // - + "SELECT COUNT(rg) " // - + " FROM ResourceGroup rg " // - + " WHERE rg.groupDefinition.id = :groupDefinitionId "), // @NamedQuery(name = GroupDefinition.QUERY_FIND_ALL_MEMBERS, query = "" // + "SELECT rg " // + " FROM ResourceGroup rg " // @@ -96,66 +92,12 @@ public class GroupDefinition implements Serializable { public static final String QUERY_FIND_ALL = "GroupDefinition.findAll"; public static final String QUERY_FIND_BY_NAME = "GroupDefinition.findByName"; public static final String QUERY_FIND_MEMBERS = "GroupDefinition.findMembers"; - public static final String QUERY_FIND_MEMBERS_count = "GroupDefinition.findMembers_count"; public static final String QUERY_FIND_ALL_MEMBERS = "GroupDefinition.findAllMembers_admin"; public static final String QUERY_FIND_MANAGED_RESOURCE_GROUP_IDS_ADMIN = "GroupDefinition.findManagedResourceGroupIds_admin"; public static final String QUERY_FIND_MANAGED_RESOURCE_GROUP_SIZE_ADMIN = "GroupDefinition.findManagedResourceGroupSize_admin"; public static final String QUERY_FIND_IDS_FOR_RECALCULATION = "GroupDefinition.findIdsForRecalculation_admin"; public static final String QUERY_FIND_ALL_RECALCULATING = "GroupDefinition.findAllRecalculating_admin";
- public static final String QUERY_NATIVE_FIND_MEMBERS = "" // - + " SELECT " - + " ( SELECT COUNT(eresAvail.ID) " - + " FROM rhq_resource_avail eresAvail " - + " INNER JOIN rhq_resource eres " - + " ON eresAvail.resource_id = eres.id " - + " INNER JOIN rhq_resource_group_res_exp_map expMap " - + " ON eres.id = expMap.resource_id " - + " WHERE expMap.resource_group_id = rg.id " - + " ) as explicitCount, " - + "" // - + " ( SELECT AVG(eresAvail.availability_type) " - + " FROM rhq_resource_avail eresAvail " - + " INNER JOIN rhq_resource eres " - + " ON eresAvail.resource_id = eres.id " - + " INNER JOIN rhq_resource_group_res_exp_map expMap " - + " ON eres.id = expMap.resource_id " - + " WHERE expMap.resource_group_id = rg.id " - + " ) as explicitAvail, " - + "" // - + " ( SELECT COUNT(iresAvail.ID) " - + " FROM rhq_resource_avail iresAvail " - + " INNER JOIN rhq_resource ires " - + " ON iresAvail.resource_id = ires.id " - + " INNER JOIN rhq_resource_group_res_imp_map impMap " - + " ON ires.id = impMap.resource_id " - + " WHERE impMap.resource_group_id = rg.id " - + " ) as implicitCount, " - + "" // - + " ( SELECT AVG(iresAvail.availability_type) " - + " FROM rhq_resource_avail iresAvail " - + " INNER JOIN rhq_resource ires " - + " ON iresAvail.resource_id = ires.id " - + " INNER JOIN rhq_resource_group_res_imp_map impMap " - + " ON ires.id = impMap.resource_id " - + " WHERE impMap.resource_group_id = rg.id " - + " ) as implicitAvail, " - + "" // - + " rg.id as groupId, " - + " rg.name as groupName, " - + " rg.category as groupCategory, " - + " rg.group_by as groupedBy " - + "" // - + " FROM rhq_resource_group rg " - + "LEFT OUTER JOIN rhq_resource_group_res_imp_map memberMap " - + " ON rg.id = memberMap.resource_group_id " - + "LEFT OUTER JOIN rhq_resource res " - + " ON memberMap.resource_id = res.id " - + "LEFT OUTER JOIN rhq_resource_avail resAvail " - + " ON res.id = resAvail.resource_id " - + " WHERE rg.group_definition_id = ? " - + " GROUP BY rg.id, rg.category, rg.name, rg.group_by "; - @Column(name = "ID", nullable = false) @GeneratedValue(strategy = GenerationType.AUTO, generator = "id") @Id diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/definition/GroupDefinitionManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/definition/GroupDefinitionManagerBean.java index 9dc3430..ebfeccd 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/definition/GroupDefinitionManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/definition/GroupDefinitionManagerBean.java @@ -18,18 +18,12 @@ */ package org.rhq.enterprise.server.resource.group.definition;
-import java.sql.Connection; -import java.sql.PreparedStatement; -import java.sql.ResultSet; import java.util.ArrayList; import java.util.Collection; -import java.util.HashMap; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Set;
-import javax.annotation.PostConstruct; import javax.ejb.EJB; import javax.ejb.Stateless; import javax.ejb.TransactionAttribute; @@ -38,39 +32,25 @@ import javax.persistence.EntityManager; import javax.persistence.NoResultException; import javax.persistence.PersistenceContext; import javax.persistence.Query; -import javax.sql.DataSource;
import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory;
-import org.rhq.core.db.DatabaseType; -import org.rhq.core.db.DatabaseTypeFactory; -import org.rhq.core.db.H2DatabaseType; -import org.rhq.core.db.OracleDatabaseType; -import org.rhq.core.db.PostgresqlDatabaseType; -import org.rhq.core.db.SQLServerDatabaseType; import org.rhq.core.domain.auth.Subject; import org.rhq.core.domain.authz.Permission; import org.rhq.core.domain.criteria.ResourceGroupDefinitionCriteria; -import org.rhq.core.domain.resource.Resource; -import org.rhq.core.domain.resource.ResourceType; -import org.rhq.core.domain.resource.composite.ResourceFacets; import org.rhq.core.domain.resource.group.GroupDefinition; import org.rhq.core.domain.resource.group.ResourceGroup; -import org.rhq.core.domain.resource.group.composite.ResourceGroupComposite; -import org.rhq.core.domain.util.OrderingField; import org.rhq.core.domain.util.PageControl; import org.rhq.core.domain.util.PageList; import org.rhq.core.server.PersistenceUtility; import org.rhq.core.util.collection.ArrayUtils; -import org.rhq.core.util.jdbc.JDBCUtil; import org.rhq.enterprise.server.RHQConstants; import org.rhq.enterprise.server.auth.SubjectManagerLocal; import org.rhq.enterprise.server.authz.AuthorizationManagerLocal; import org.rhq.enterprise.server.authz.PermissionException; import org.rhq.enterprise.server.authz.RequiredPermission; import org.rhq.enterprise.server.resource.ResourceManagerLocal; -import org.rhq.enterprise.server.resource.ResourceTypeManagerLocal; import org.rhq.enterprise.server.resource.group.RecursivityChangeType; import org.rhq.enterprise.server.resource.group.ResourceGroupManagerLocal; import org.rhq.enterprise.server.resource.group.ResourceGroupUpdateException; @@ -88,17 +68,12 @@ import org.rhq.enterprise.server.util.CriteriaQueryGenerator; import org.rhq.enterprise.server.util.CriteriaQueryRunner;
@Stateless -@javax.annotation.Resource(name = "RHQ_DS", mappedName = RHQConstants.DATASOURCE_JNDI_NAME) public class GroupDefinitionManagerBean implements GroupDefinitionManagerLocal { private final Log log = LogFactory.getLog(GroupDefinitionManagerBean.class);
@PersistenceContext(unitName = RHQConstants.PERSISTENCE_UNIT_NAME) private EntityManager entityManager;
- @javax.annotation.Resource(name = "RHQ_DS") - private DataSource rhqDs; - private DatabaseType dbType; - @EJB private GroupDefinitionManagerLocal groupDefinitionManager; // self, for xactional purposes
@@ -106,9 +81,6 @@ public class GroupDefinitionManagerBean implements GroupDefinitionManagerLocal { private ResourceGroupManagerLocal resourceGroupManager;
@EJB - private ResourceTypeManagerLocal resourceTypeManager; - - @EJB private ResourceManagerLocal resourceManager;
@EJB @@ -117,19 +89,6 @@ public class GroupDefinitionManagerBean implements GroupDefinitionManagerLocal { @EJB private AuthorizationManagerLocal authorizationManager;
- @PostConstruct - public void init() { - Connection conn = null; - try { - conn = rhqDs.getConnection(); - dbType = DatabaseTypeFactory.getDatabaseType(conn); - } catch (Exception e) { - throw new RuntimeException(e); - } finally { - JDBCUtil.safeClose(conn); - } - } - @SuppressWarnings("unchecked") @RequiredPermission(Permission.MANAGE_INVENTORY) public void recalculateDynaGroups(Subject subject) { @@ -370,7 +329,6 @@ public class GroupDefinitionManagerBean implements GroupDefinitionManagerLocal { log.debug("calculateGroupMembership took " + (endTime - startTime) + " millis"); }
- @SuppressWarnings("unchecked") @RequiredPermission(Permission.MANAGE_INVENTORY) @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW) public Integer calculateGroupMembership_helper(Subject overlord, int groupDefinitionId, @@ -418,9 +376,6 @@ public class GroupDefinitionManagerBean implements GroupDefinitionManagerLocal {
resourceGroupManager.setResourceType(resourceGroupId);
- entityManager.flush(); - entityManager.clear(); - long endTime = System.currentTimeMillis();
log.debug("calculateGroupMembership_helper took " + (endTime - startTime) + " millis"); @@ -428,122 +383,6 @@ public class GroupDefinitionManagerBean implements GroupDefinitionManagerLocal { return resourceGroupId; }
- @SuppressWarnings("unchecked") - private Map<Integer, ResourceGroup> getIdGroupMap(List<Integer> groupIds) { - if (groupIds == null || groupIds.size() == 0) { - return new HashMap<Integer, ResourceGroup>(); - } - - Query query = entityManager.createNamedQuery(ResourceGroup.QUERY_FIND_BY_IDS_admin); - query.setParameter("ids", groupIds); - List<ResourceGroup> groups = query.getResultList(); - - Map<Integer, ResourceGroup> results = new HashMap<Integer, ResourceGroup>(); - for (ResourceGroup group : groups) { - results.put(group.getId(), group); - } - return results; - } - - @RequiredPermission(Permission.MANAGE_INVENTORY) - public PageList<ResourceGroupComposite> getManagedResourceGroups(Subject subject, int groupDefinitionId, - PageControl pc) throws GroupDefinitionException { - - pc.initDefaultOrderingField("groupName"); - pc.truncateOrderingFields(1); // remove all but the primary sort - OrderingField primary = pc.getOrderingFields().get(0); - String field = primary.getField(); - if (field.endsWith("Avail")) { - String prefix = field.substring(0, field.length() - 5); - String secondaryField = prefix + "Count"; - pc.addDefaultOrderingField(secondaryField, primary.getOrdering()); - } - if (field.equals("groupName") == false) { - pc.addDefaultOrderingField("groupName"); - } - - Connection conn = null; - PreparedStatement stmt = null; - ResultSet rs = null; - - List<Object[]> rawResults = new ArrayList<Object[]>(); - try { - conn = rhqDs.getConnection(); - - String query = GroupDefinition.QUERY_NATIVE_FIND_MEMBERS; - - if (this.dbType instanceof PostgresqlDatabaseType) { - query = PersistenceUtility.addPostgresNativePagingSortingToQuery(query, pc); - } else if (this.dbType instanceof OracleDatabaseType) { - query = PersistenceUtility.addOracleNativePagingSortingToQuery(query, pc); - } else if (this.dbType instanceof H2DatabaseType) { - query = PersistenceUtility.addH2NativePagingSortingToQuery(query, pc); - } else if (this.dbType instanceof SQLServerDatabaseType) { - query = PersistenceUtility.addSQLServerNativePagingSortingToQuery(query, pc); - } else { - throw new RuntimeException("Unknown database type: " + this.dbType); - } - - stmt = conn.prepareStatement(query); - stmt.setInt(1, groupDefinitionId); - - rs = stmt.executeQuery(); - while (rs.next()) { - long explicitCount = rs.getLong(1); - double explicitAvail = rs.getDouble(2); - long implicitCount = rs.getLong(3); - double implicitAvail = rs.getDouble(4); - int groupId = rs.getInt(5); - Object[] next = new Object[] { explicitCount, explicitAvail, implicitCount, implicitAvail, groupId }; - rawResults.add(next); - } - } catch (Throwable t) { - throw new GroupDefinitionException(t); - } finally { - JDBCUtil.safeClose(conn, stmt, rs); - } - - //Query query = PersistenceUtility.createQueryWithOrderBy(entityManager, GroupDefinition.QUERY_FIND_MEMBERS, pc); - Query queryCount = entityManager.createNamedQuery(GroupDefinition.QUERY_FIND_MEMBERS_count); - - //query.setParameter("groupDefinitionId", groupDefinitionId); - queryCount.setParameter("groupDefinitionId", groupDefinitionId); - - //List<Object[]> rawResults = (List<Object[]>) query.getResultList(); - long count = (Long) queryCount.getSingleResult(); - - List<Integer> groupIds = new ArrayList<Integer>(); - for (Object[] row : rawResults) { - groupIds.add(((Number) row[4]).intValue()); - } - Map<Integer, ResourceGroup> groupMap = getIdGroupMap(groupIds); - - List<ResourceGroupComposite> results = new ArrayList<ResourceGroupComposite>(rawResults.size()); - int i = 0; - for (Object[] row : rawResults) { - long explicitCount = (Long) row[0]; - double explicitAvail = (Double) row[1]; - long implicitCount = (Long) row[2]; - double implicitAvail = (Double) row[3]; - - ResourceGroup group = groupMap.get(groupIds.get(i++)); - ResourceType type = group.getResourceType(); - ResourceFacets facets; - if (type == null) { - // mixed group - facets = ResourceFacets.NONE; - } else { - // compatible group - facets = resourceTypeManager.getResourceFacets(group.getResourceType().getId()); - } - ResourceGroupComposite composite = new ResourceGroupComposite(explicitCount, explicitAvail, implicitCount, - implicitAvail, group, facets); - results.add(composite); - } - - return new PageList<ResourceGroupComposite>(results, (int) count, pc); - } - @SuppressWarnings( { "unchecked" }) public PageList<GroupDefinition> getGroupDefinitions(Subject subject, PageControl pc) { pc.initDefaultOrderingField("gd.name"); @@ -560,7 +399,8 @@ public class GroupDefinitionManagerBean implements GroupDefinitionManagerLocal { } }
- public PageList<GroupDefinition> findGroupDefinitionsByCriteria(Subject subject, ResourceGroupDefinitionCriteria criteria) { + public PageList<GroupDefinition> findGroupDefinitionsByCriteria(Subject subject, + ResourceGroupDefinitionCriteria criteria) { CriteriaQueryGenerator generator = new CriteriaQueryGenerator(criteria); if (authorizationManager.isInventoryManager(subject) == false) { if (criteria.isInventoryManagerRequired()) { @@ -569,7 +409,8 @@ public class GroupDefinitionManagerBean implements GroupDefinitionManagerLocal { } }
- CriteriaQueryRunner<GroupDefinition> queryRunner = new CriteriaQueryRunner(criteria, generator, entityManager); + CriteriaQueryRunner<GroupDefinition> queryRunner = new CriteriaQueryRunner<GroupDefinition>(criteria, + generator, entityManager);
return queryRunner.execute(); } diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/definition/GroupDefinitionManagerLocal.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/definition/GroupDefinitionManagerLocal.java index 4738625..b57a35e 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/definition/GroupDefinitionManagerLocal.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/definition/GroupDefinitionManagerLocal.java @@ -23,14 +23,12 @@ import javax.ejb.Local; import org.rhq.core.domain.auth.Subject; import org.rhq.core.domain.criteria.ResourceGroupDefinitionCriteria; import org.rhq.core.domain.resource.group.GroupDefinition; -import org.rhq.core.domain.resource.group.composite.ResourceGroupComposite; import org.rhq.core.domain.util.PageControl; import org.rhq.core.domain.util.PageList; import org.rhq.enterprise.server.resource.group.ResourceGroupUpdateException; import org.rhq.enterprise.server.resource.group.definition.exception.GroupDefinitionAlreadyExistsException; import org.rhq.enterprise.server.resource.group.definition.exception.GroupDefinitionCreateException; import org.rhq.enterprise.server.resource.group.definition.exception.GroupDefinitionDeleteException; -import org.rhq.enterprise.server.resource.group.definition.exception.GroupDefinitionException; import org.rhq.enterprise.server.resource.group.definition.exception.GroupDefinitionNotFoundException; import org.rhq.enterprise.server.resource.group.definition.exception.GroupDefinitionUpdateException; import org.rhq.enterprise.server.resource.group.definition.framework.ExpressionEvaluator; @@ -56,9 +54,6 @@ public interface GroupDefinitionManagerLocal { Integer calculateGroupMembership_helper(Subject subject, int groupDefinitionId, ExpressionEvaluator.Result result) throws GroupDefinitionNotFoundException, GroupDefinitionNotFoundException;
- PageList<ResourceGroupComposite> getManagedResourceGroups(Subject subject, int groupDefinitionId, PageControl pc) - throws GroupDefinitionException; - PageList<GroupDefinition> getGroupDefinitions(Subject subject, PageControl pc);
PageList<GroupDefinition> findGroupDefinitionsByCriteria(Subject subject, ResourceGroupDefinitionCriteria criteria);
commit 47ea32f7c32a1c7d0fd89b04862e49ef9a69fb69 Author: Joseph Marques joseph@redhat.com Date: Thu Jun 24 17:20:35 2010 -0400
re-implement group definition detailed view using ResourceGroupCriteria with groupDef filter
diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/definition/group/GroupDefinitionUIBean.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/definition/group/GroupDefinitionUIBean.java index add5a08..2a2aa52 100644 --- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/definition/group/GroupDefinitionUIBean.java +++ b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/definition/group/GroupDefinitionUIBean.java @@ -18,14 +18,14 @@ */ package org.rhq.enterprise.gui.definition.group;
-import javax.faces.model.DataModel; import javax.faces.application.FacesMessage; +import javax.faces.model.DataModel;
import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.jetbrains.annotations.NotNull;
-import org.rhq.core.domain.auth.Subject; +import org.rhq.core.domain.criteria.ResourceGroupCriteria; import org.rhq.core.domain.resource.group.GroupDefinition; import org.rhq.core.domain.resource.group.composite.ResourceGroupComposite; import org.rhq.core.domain.util.PageControl; @@ -35,7 +35,7 @@ import org.rhq.enterprise.gui.common.framework.PagedDataTableUIBean; import org.rhq.enterprise.gui.common.paging.PageControlView; import org.rhq.enterprise.gui.common.paging.PagedListDataModel; import org.rhq.enterprise.gui.legacy.ParamConstants; -import org.rhq.enterprise.server.resource.group.definition.GroupDefinitionManagerLocal; +import org.rhq.enterprise.server.resource.group.ResourceGroupManagerLocal; import org.rhq.enterprise.server.resource.group.definition.exception.GroupDefinitionException; import org.rhq.enterprise.server.util.LookupUtil;
@@ -46,8 +46,7 @@ public class GroupDefinitionUIBean extends PagedDataTableUIBean {
private GroupDefinition groupDefinition;
- public GroupDefinitionUIBean() throws GroupDefinitionException - { + public GroupDefinitionUIBean() throws GroupDefinitionException { this.groupDefinition = lookupGroupDefinition(); }
@@ -110,6 +109,8 @@ public class GroupDefinitionUIBean extends PagedDataTableUIBean { return dataModel; }
+ private ResourceGroupManagerLocal resourceGroupManager = LookupUtil.getResourceGroupManager(); + private class ListGroupDefinitionMembersDataModel extends PagedListDataModel<ResourceGroupComposite> { public ListGroupDefinitionMembersDataModel(PageControlView view, String beanName) { super(view, beanName); @@ -117,17 +118,16 @@ public class GroupDefinitionUIBean extends PagedDataTableUIBean {
@Override public PageList<ResourceGroupComposite> fetchPage(PageControl pc) { - Subject user = getSubject(); - int groupDefinitionId = groupDefinition.getId(); - - GroupDefinitionManagerLocal groupDefinitionManager = LookupUtil.getGroupDefinitionManager(); + ResourceGroupCriteria criteria = new ResourceGroupCriteria(); + criteria.addFilterGroupDefinitionId(groupDefinition.getId()); + criteria.setPageControl(pc);
try { - return groupDefinitionManager.getManagedResourceGroups(user, groupDefinitionId, pc); - } catch (GroupDefinitionException gde) { + return resourceGroupManager.findResourceGroupCompositesByCriteria(getSubject(), criteria); + } catch (Throwable t) { FacesContextUtility.addMessage(FacesMessage.SEVERITY_ERROR, "Failed to retrieve managed groups: " - + gde.getMessage()); - log.error("Failed to retrieve managed groups", gde); + + t.getMessage()); + log.error("Failed to retrieve managed groups", t); return new PageList<ResourceGroupComposite>(); } } diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/definition/group/view.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/definition/group/view.xhtml index 512dc82..4ecffef 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/definition/group/view.xhtml +++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/definition/group/view.xhtml @@ -151,7 +151,7 @@
rich:column <f:facet name="header"> - <onc:sortableColumnHeader sort="groupName"> + <onc:sortableColumnHeader sort="name"> <h:outputText styleClass="headerText" value="Name" /> </onc:sortableColumnHeader> </f:facet> @@ -175,7 +175,7 @@
rich:column <f:facet name="header"> - <onc:sortableColumnHeader sort="groupedBy"> + <onc:sortableColumnHeader sort="groupByClause"> <h:outputText styleClass="headerText" value="Grouped By" /> </onc:sortableColumnHeader> </f:facet> @@ -186,7 +186,7 @@ <rich:column styleClass="resource-availability-cell"> <f:facet name="header"> <h:panelGroup> - <onc:sortableColumnHeader sort="explicitAvail"> + <onc:sortableColumnHeader sort="1">ui:removeUse zero-based positional ordinal</ui:remove> <h:outputText value="Children" /> </onc:sortableColumnHeader> </h:panelGroup> @@ -199,7 +199,7 @@ <rich:column styleClass="resource-availability-cell"> <f:facet name="header"> <h:panelGroup> - <onc:sortableColumnHeader sort="implicitAvail"> + <onc:sortableColumnHeader sort="3">ui:removeUse zero-based positional ordinal</ui:remove> <h:outputText value="Descendents" /> </onc:sortableColumnHeader> </h:panelGroup>
commit 50e8098383a1d0fe5f25e503584e20e3457e2dc7 Author: Joseph Marques joseph@redhat.com Date: Thu Jun 24 17:19:41 2010 -0400
add the ability to filter ResourceGroupCriteria by its parent group definition add additional authorization check in ResourceGroupManager.find...ByCriteria method
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/ResourceGroupCriteria.java b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/ResourceGroupCriteria.java index bbefbb3..eee833e 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/ResourceGroupCriteria.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/ResourceGroupCriteria.java @@ -54,6 +54,7 @@ public class ResourceGroupCriteria extends TaggedCriteria { private ResourceCategory filterExplicitResourceCategory; // requires overrides private Integer filterExplicitResourceTypeId; // requires overrides private String filterExplicitResourceTypeName; // requires overrides + private Integer filterGroupDefinitionId; // requires overrides
private boolean fetchExplicitResources; private boolean fetchImplicitResources; @@ -105,6 +106,7 @@ public class ResourceGroupCriteria extends TaggedCriteria { + " FROM Resource res " // + " JOIN res.explicitGroups explicitGroup " // + " WHERE resourcegroup.id = explicitGroup.id AND NOT res.resourceType.name = ? )"); + filterOverrides.put("groupDefinitionId", "groupDefinition.id = ?");
sortOverrides.put("resourceTypeName", "resourceType.name"); } @@ -184,6 +186,10 @@ public class ResourceGroupCriteria extends TaggedCriteria { this.filterExplicitResourceTypeName = filterExplicitResourceTypeName; }
+ public void addFilterGroupDefinitionId(Integer filterGroupDefinitionId) { + this.filterGroupDefinitionId = filterGroupDefinitionId; + } + public void fetchExplicitResources(boolean fetchExplicitResources) { this.fetchExplicitResources = fetchExplicitResources; } @@ -227,8 +233,15 @@ public class ResourceGroupCriteria extends TaggedCriteria { }
/** subclasses should override as necessary */ + @Override public boolean isSecurityManagerRequired() { return this.fetchRoles; }
+ @Override + public boolean isInventoryManagerRequired() { + // presently only inventory managers can view/manage group definitions + return this.filterGroupDefinitionId != null; + } + } diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerBean.java index 16bfb39..b944b6e 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerBean.java @@ -1388,6 +1388,12 @@ public class ResourceGroupManagerBean implements ResourceGroupManagerLocal, Reso + "] requires SecurityManager permission for requested query criteria."); }
+ if (criteria.isInventoryManagerRequired() + && !authorizationManager.hasGlobalPermission(subject, Permission.MANAGE_INVENTORY)) { + throw new PermissionException("Subject [" + subject.getName() + + "] requires InventoryManager permission for requested query criteria."); + } + if (authorizationManager.isInventoryManager(subject) == false) { generator.setAuthorizationResourceFragment(CriteriaQueryGenerator.AuthorizationTokenType.GROUP, null, subject.getId());
commit dcf8ac047e9ea8748524275c3d63c0a4c8c750b2 Merge: cc784e9... 065156e... Author: Heiko W. Rupp hwr@redhat.com Date: Thu Jun 24 22:17:42 2010 +0200
Merge branch 'master' of ssh://git.fedorahosted.org/git/rhq/rhq
commit 50294ebe870e04f3673cf075dbf0420dcd083d62 Author: Joseph Marques joseph@redhat.com Date: Thu Jun 24 16:16:49 2010 -0400
BZ-607548: prevent NPE when use operation-based alert notifications
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/alert/notification/AlertNotification.java b/modules/core/domain/src/main/java/org/rhq/core/domain/alert/notification/AlertNotification.java index 4d5c1f0..27da614 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/alert/notification/AlertNotification.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/alert/notification/AlertNotification.java @@ -225,6 +225,9 @@ public class AlertNotification implements Serializable { }
public boolean equalsData(AlertNotification other) { + if (other == null) { + return false; + } boolean results = compare(configuration, other.configuration); if (results) { results = compare(extraConfiguration, other.extraConfiguration); diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/alert/common/AlertNotificationsUIBean.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/alert/common/AlertNotificationsUIBean.java index 82a1e50..dc65e73 100644 --- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/alert/common/AlertNotificationsUIBean.java +++ b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/alert/common/AlertNotificationsUIBean.java @@ -216,7 +216,7 @@ public class AlertNotificationsUIBean extends EnterpriseFacesContextUIBean { */ reloadAlertNotifications(); for (AlertNotification nextNotification : this.alertNotifications) { - if (notificationWithLatestData.equalsData(nextNotification)) { + if (nextNotification.equalsData(notificationWithLatestData)) { this.activeNotification = nextNotification; this.selectedNotifications.clear(); this.selectedNotifications.add(this.activeNotification); diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/alert/common/CustomContentUIBean.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/alert/common/CustomContentUIBean.java index 324a3de..1d9da88 100644 --- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/alert/common/CustomContentUIBean.java +++ b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/alert/common/CustomContentUIBean.java @@ -108,6 +108,8 @@ public class CustomContentUIBean extends EnterpriseFacesContextUIBean {
if (customBackingBean.getExtraParameters() != null) { notification.setExtraConfiguration(customBackingBean.getExtraParameters()); + } else { + notification.setExtraConfiguration(null); } int alertDefinitionId = Integer.parseInt(customBackingBean.getContextId()); alertNotificationManager.updateAlertNotification(getSubject(), alertDefinitionId, notification); diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/plugin/pc/alert/CustomAlertSenderBackingBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/plugin/pc/alert/CustomAlertSenderBackingBean.java index 612a5fa..0e4f47d 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/plugin/pc/alert/CustomAlertSenderBackingBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/plugin/pc/alert/CustomAlertSenderBackingBean.java @@ -18,9 +18,6 @@ */ package org.rhq.enterprise.server.plugin.pc.alert;
-import java.util.Arrays; - -import org.rhq.core.domain.alert.notification.AlertNotification; import org.rhq.core.domain.auth.Subject; import org.rhq.core.domain.configuration.Configuration; import org.rhq.core.domain.configuration.PropertySimple; @@ -164,15 +161,4 @@ public class CustomAlertSenderBackingBean { return ret; }
- final protected void deleteExtraParameters() { - Subject overlord = LookupUtil.getSubjectManager().getOverlord(); - AlertNotification notification = LookupUtil.getAlertNotificationManager().getAlertNotification(overlord, - alertNotificationId); - Configuration extraParameters = notification.getExtraConfiguration(); - notification.setExtraConfiguration(null); - LookupUtil.getAlertNotificationManager().updateAlertNotification(overlord, - notification.getAlertDefinition().getId(), notification); - LookupUtil.getConfigurationManager().deleteConfigurations(Arrays.asList(extraParameters.getId())); - } - } diff --git a/modules/enterprise/server/plugins/alert-operations/src/main/java/org/rhq/enterprise/server/plugins/alertOperations/OperationInfo.java b/modules/enterprise/server/plugins/alert-operations/src/main/java/org/rhq/enterprise/server/plugins/alertOperations/OperationInfo.java index 0241db5..5d81bd0 100644 --- a/modules/enterprise/server/plugins/alert-operations/src/main/java/org/rhq/enterprise/server/plugins/alertOperations/OperationInfo.java +++ b/modules/enterprise/server/plugins/alert-operations/src/main/java/org/rhq/enterprise/server/plugins/alertOperations/OperationInfo.java @@ -55,7 +55,9 @@ public class OperationInfo { String descendantName, String operationId, Configuration arguments) { ResourceSelectionMode selectionMode = null; try { - selectionMode = ResourceSelectionMode.valueOf(mode); + if (mode != null) { + selectionMode = ResourceSelectionMode.valueOf(mode); + } } catch (Throwable t) { } this.mode = selectionMode; diff --git a/modules/enterprise/server/plugins/alert-operations/src/main/java/org/rhq/enterprise/server/plugins/alertOperations/OperationsBackingBean.java b/modules/enterprise/server/plugins/alert-operations/src/main/java/org/rhq/enterprise/server/plugins/alertOperations/OperationsBackingBean.java index 0bf47fa..1552256 100644 --- a/modules/enterprise/server/plugins/alert-operations/src/main/java/org/rhq/enterprise/server/plugins/alertOperations/OperationsBackingBean.java +++ b/modules/enterprise/server/plugins/alert-operations/src/main/java/org/rhq/enterprise/server/plugins/alertOperations/OperationsBackingBean.java @@ -230,7 +230,8 @@ public class OperationsBackingBean extends CustomAlertSenderBackingBean { if (operationDefinitionId != null && !operationDefinitionId.equals("none") && argumentsConfiguration != null) { extraParameters = persistConfiguration(argumentsConfiguration); } else { - deleteExtraParameters(); + extraParameters = null; + //deleteExtraParameters(); }
alertParameters = persistConfiguration(alertParameters);
commit cc784e9496490e0125448b5297b1ac6d82a61843 Author: Heiko W. Rupp hwr@redhat.com Date: Thu Jun 24 22:14:13 2010 +0200
Fix last compile error.
diff --git a/modules/plugins/twitter/src/main/java/org/rhq/plugins/twitter/FeedComponent.java b/modules/plugins/twitter/src/main/java/org/rhq/plugins/twitter/FeedComponent.java index 8c7da3a..9f7bfc4 100644 --- a/modules/plugins/twitter/src/main/java/org/rhq/plugins/twitter/FeedComponent.java +++ b/modules/plugins/twitter/src/main/java/org/rhq/plugins/twitter/FeedComponent.java @@ -19,6 +19,7 @@ package org.rhq.plugins.twitter;
import java.util.List; +import java.util.Properties; import java.util.Set;
import twitter4j.Paging; @@ -27,6 +28,8 @@ import twitter4j.QueryResult; import twitter4j.Status; import twitter4j.Tweet; import twitter4j.Twitter; +import twitter4j.TwitterFactory; +import twitter4j.conf.PropertyConfiguration;
import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -61,10 +64,9 @@ public class FeedComponent implements ResourceComponent<TwitterComponent>, Measu private boolean isSearch = false; private String keyword; private TwitterEventPoller eventPoller; - private String serverUrl; - private String searchBase; + private TwitterFactory tFactory;
- /** + /** * Return availability of this resource * @see org.rhq.core.pluginapi.inventory.ResourceComponent#getAvailability() */ @@ -86,13 +88,23 @@ public class FeedComponent implements ResourceComponent<TwitterComponent>, Measu isSearch = true; keyword = conf.getSimpleValue("keyword","Jopr"); // Jopr is fallback .. just in case
- serverUrl = context.getParentResourceComponent().getServerUrl(); - searchBase = context.getParentResourceComponent().getSearchUrl(); + String serverUrl = context.getParentResourceComponent().getServerUrl(); + String searchBase = context.getParentResourceComponent().getSearchUrl();
eventContext = context.getEventContext(); eventPoller = new TwitterEventPoller(TOPIC_EVENT); eventContext.registerEventPoller(eventPoller, 63);
+ Properties props = new Properties(); + props.put(PropertyConfiguration.SOURCE,"Jopr"); + props.put(PropertyConfiguration.HTTP_USER_AGENT,"Jopr"); + props.put(PropertyConfiguration.SEARCH_BASE_URL, searchBase); + props.put(PropertyConfiguration.REST_BASE_URL, serverUrl); + twitter4j.conf.Configuration tconf = new PropertyConfiguration(props); + + tFactory = new TwitterFactory(tconf); + + }
@@ -116,12 +128,11 @@ public class FeedComponent implements ResourceComponent<TwitterComponent>, Measu
for (MeasurementScheduleRequest req : metrics) { if (req.getName().equals("tweetCount")) { - Twitter twitter = new Twitter(serverUrl); + Twitter twitter = tFactory.getInstance(); Paging paging = new Paging();
MeasurementDataNumeric res; if (isSearch) { - twitter.setSearchBaseURL(searchBase); Query q = new Query(keyword); q.setSinceId(lastId); if (lastId == NOT_YET_SET)
commit e8e51188a5f48d8e722700a89e6335654d869c22 Author: John Mazzitelli mazz@redhat.com Date: Thu Jun 24 16:06:24 2010 -0400
provide a new "gc" agent prompt command that lets you examine the heap/non-heap stats and lets you free up some memory/invoke the garbage collector
diff --git a/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/AgentMain.java b/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/AgentMain.java index ce49fc4..b5d1223 100644 --- a/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/AgentMain.java +++ b/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/AgentMain.java @@ -107,6 +107,7 @@ import org.rhq.enterprise.agent.promptcmd.DownloadPromptCommand; import org.rhq.enterprise.agent.promptcmd.DumpSpoolPromptCommand; import org.rhq.enterprise.agent.promptcmd.ExitPromptCommand; import org.rhq.enterprise.agent.promptcmd.FailoverPromptCommand; +import org.rhq.enterprise.agent.promptcmd.GCPromptCommand; import org.rhq.enterprise.agent.promptcmd.GetConfigPromptCommand; import org.rhq.enterprise.agent.promptcmd.HelpPromptCommand; import org.rhq.enterprise.agent.promptcmd.IdentifyPromptCommand; @@ -2958,7 +2959,7 @@ public class AgentMain { new AvailabilityPromptCommand(), new PiqlPromptCommand(), new IdentifyPromptCommand(), new LogPromptCommand(), new TimerPromptCommand(), new PingPromptCommand(), new DownloadPromptCommand(), new DumpSpoolPromptCommand(), new SenderPromptCommand(), new FailoverPromptCommand(), - new UpdatePromptCommand(), new DebugPromptCommand(), new SleepPromptCommand() }; + new UpdatePromptCommand(), new DebugPromptCommand(), new SleepPromptCommand(), new GCPromptCommand() };
// hold the conflicts StringBuilder conflicts = new StringBuilder(); diff --git a/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/i18n/AgentI18NResourceKeys.java b/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/i18n/AgentI18NResourceKeys.java index d520904..7967b47 100644 --- a/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/i18n/AgentI18NResourceKeys.java +++ b/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/i18n/AgentI18NResourceKeys.java @@ -1619,6 +1619,31 @@ public interface AgentI18NResourceKeys { @I18NMessage("days") String UNITS_DAYS = "units.days";
+ @I18NMessage("gc") + String GC = "PromptCommand.gc"; + + @I18NMessage("gc [--dump] [--free] [--verbose={true|false}]") + String GC_SYNTAX = "PromptCommand.gc.syntax"; + + @I18NMessage("Helps free up memory by invoking the garbage collector") + String GC_HELP = "PromptCommand.gc.help"; + + @I18NMessage("Provides an interface to the garbage collector and memory subsystem.\n\\n" + + "\ -d, --dump : prints out information on current memory usage\n\\n" + + "\ -f, --free : attempts to free up memory and invokes the garbage collector\n\\n" + + "\ -v, --verbose={true|false} : enables/disables verbose gc messages") + String GC_DETAILED_HELP = "PromptCommand.gc.detailed-help"; + + @I18NMessage("Invoking the garbage collector") + String GC_INVOKE = "PromptCommand.gc.invoke"; + + @I18NMessage("{0} ({1}):\n\\n" // + + "\ init={2}\n\\n" // + + "\ max={3}\n\\n" // + + "\ used={4} ({5,number,##}% of committed)\n\\n" // + + "\ commit={6} ({7,number,##}% of max)") + String GC_MEM_USAGE = "PromptCommand.gc.mem-usage"; + @I18NMessage("native") String NATIVE = "PromptCommand.native";
diff --git a/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/promptcmd/GCPromptCommand.java b/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/promptcmd/GCPromptCommand.java new file mode 100644 index 0000000..1f2de30 --- /dev/null +++ b/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/promptcmd/GCPromptCommand.java @@ -0,0 +1,213 @@ +/* + * RHQ Management Platform + * Copyright (C) 2005-2008 Red Hat, Inc. + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ +package org.rhq.enterprise.agent.promptcmd; + +import gnu.getopt.Getopt; +import gnu.getopt.LongOpt; + +import java.beans.Introspector; +import java.io.PrintWriter; +import java.lang.management.ManagementFactory; +import java.lang.management.MemoryMXBean; +import java.lang.management.MemoryPoolMXBean; +import java.lang.management.MemoryType; +import java.lang.management.MemoryUsage; +import java.util.List; + +import mazz.i18n.Msg; + +import org.apache.commons.logging.LogFactory; + +import org.rhq.enterprise.agent.AgentMain; +import org.rhq.enterprise.agent.i18n.AgentI18NFactory; +import org.rhq.enterprise.agent.i18n.AgentI18NResourceKeys; + +/** + * Provides a way to help the agent clean up memory. + * + * @author John Mazzitelli + */ +public class GCPromptCommand implements AgentPromptCommand { + private static final Msg MSG = AgentI18NFactory.getMsg(); + + /** + * @see AgentPromptCommand#getPromptCommandString() + */ + public String getPromptCommandString() { + return MSG.getMsg(AgentI18NResourceKeys.GC); + } + + /** + * @see AgentPromptCommand#execute(AgentMain, String[]) + */ + public boolean execute(AgentMain agent, String[] args) { + processArguments(agent, args); + return true; + } + + /** + * @see AgentPromptCommand#getSyntax() + */ + public String getSyntax() { + return MSG.getMsg(AgentI18NResourceKeys.GC_SYNTAX); + } + + /** + * @see AgentPromptCommand#getHelp() + */ + public String getHelp() { + return MSG.getMsg(AgentI18NResourceKeys.GC_HELP); + } + + /** + * @see AgentPromptCommand#getDetailedHelp() + */ + public String getDetailedHelp() { + return MSG.getMsg(AgentI18NResourceKeys.GC_DETAILED_HELP); + } + + private void processArguments(AgentMain agent, String[] args) { + PrintWriter out = agent.getOut(); + + String sopts = "dfv:"; + LongOpt[] lopts = { new LongOpt("verbose", LongOpt.REQUIRED_ARGUMENT, null, 'v'), + new LongOpt("dump", LongOpt.NO_ARGUMENT, null, 'd'), new LongOpt("free", LongOpt.NO_ARGUMENT, null, 'f') }; + + Getopt getopt = new Getopt(getPromptCommandString(), args, sopts, lopts); + int code; + Boolean verbose = null; + Boolean free = null; + Boolean dump = null; + + while ((code = getopt.getopt()) != -1) { + switch (code) { + case ':': + case '?': + case 1: { + out.println(MSG.getMsg(AgentI18NResourceKeys.HELP_SYNTAX_LABEL, getSyntax())); + break; + } + + case 'v': { + String verboseOpt = getopt.getOptarg(); + verbose = Boolean.valueOf(Boolean.parseBoolean(verboseOpt)); + break; + } + + case 'd': { + dump = Boolean.TRUE; + break; + } + + case 'f': { + free = Boolean.TRUE; + break; + } + } + } + + if ((getopt.getOptind() + 1) < args.length) { + out.println(MSG.getMsg(AgentI18NResourceKeys.HELP_SYNTAX_LABEL, getSyntax())); + } + + if (Boolean.TRUE.equals(dump)) { + printCurrentMemoryUsage(out); + } + + if (verbose != null) { + setVerbosity(verbose.booleanValue()); + } + + if (Boolean.TRUE.equals(free)) { + freeMemory(out); + } + + return; + } + + private void setVerbosity(boolean verbose) { + final MemoryMXBean memoryMxBean = ManagementFactory.getMemoryMXBean(); + memoryMxBean.setVerbose(verbose); + } + + private void freeMemory(PrintWriter out) { + final MemoryMXBean memoryMxBean = ManagementFactory.getMemoryMXBean(); + + printGlobalMemoryUsage(out, memoryMxBean); + + // free up some global static caches + Introspector.flushCaches(); + LogFactory.releaseAll(); + + // invoke the garbage collector + out.println(MSG.getMsg(AgentI18NResourceKeys.GC_INVOKE)); + memoryMxBean.gc(); + + printGlobalMemoryUsage(out, memoryMxBean); + return; + } + + private void printCurrentMemoryUsage(PrintWriter out) { + final MemoryMXBean memoryMxBean = ManagementFactory.getMemoryMXBean(); + printGlobalMemoryUsage(out, memoryMxBean); + + List<MemoryPoolMXBean> poolMxBeans = ManagementFactory.getMemoryPoolMXBeans(); + if (poolMxBeans != null) { + for (MemoryPoolMXBean bean : poolMxBeans) { + if (bean.isValid()) { + String name = bean.getName(); + MemoryType type = bean.getType(); + MemoryUsage usage = bean.getUsage(); + printMemoryUsage(out, name, type, usage); + } + } + } + + return; + } + + private void printGlobalMemoryUsage(PrintWriter out, final MemoryMXBean memoryMxBean) { + printMemoryUsage(out, "GLOBAL", MemoryType.HEAP, memoryMxBean.getHeapMemoryUsage()); + printMemoryUsage(out, "GLOBAL", MemoryType.NON_HEAP, memoryMxBean.getNonHeapMemoryUsage()); + } + + private void printMemoryUsage(PrintWriter out, String name, MemoryType type, MemoryUsage memUsage) { + long init = memUsage.getInit(); + long max = memUsage.getMax(); + long used = memUsage.getUsed(); + long committed = memUsage.getCommitted(); + + String typeStr; + switch (type) { + case HEAP: + typeStr = "Heap"; + break; + case NON_HEAP: + typeStr = "Non-heap"; + break; + default: + typeStr = "?"; + } + + double usedPercentage = (used * 100.0) / committed; + double committedPercentage = (committed * 100.0) / max; + out.println(MSG.getMsg(AgentI18NResourceKeys.GC_MEM_USAGE, name, typeStr, init, max, used, usedPercentage, + committed, committedPercentage)); + } +} \ No newline at end of file
commit 8bbfe126b897a21135b21987aefcce1b45e76cb3 Author: Simeon Pinder spinder@redhat.com Date: Thu Jun 24 14:33:18 2010 -0400
refactoring BZ-597246 a little.
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/content/PackageBits.java b/modules/core/domain/src/main/java/org/rhq/core/domain/content/PackageBits.java index 634ebeb..17ad568 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/content/PackageBits.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/content/PackageBits.java @@ -95,14 +95,20 @@ public class PackageBits implements Serializable { * return <code>null</code>. In this case, the content is probably stored somewhere else on a local file system. * When <code>null</code> is returned, it is assumed that who ever needs the content can know where to find it based * on the {@link PackageVersion} details. + * + * For large file contents, you should use ContentManager.updateBlobStream() to write and + * ContentManager.writeBlobOutToStream() to read/direct file contents into as no byte[] is used. */ @XmlTransient public byte[] getBits() { return bits; }
+ /** For large file contents, you should use ContentManager.updateBlobStream() to write and + * ContentManager.writeBlobOutToStream() to read/direct file contents into as no byte[] is used. + * + */ public void setBits(byte[] bits) { this.bits = bits; } - } \ No newline at end of file diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerBean.java index 5bae392..b2cac05 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerBean.java @@ -939,7 +939,6 @@ public class ContentManagerBean implements ContentManagerLocal, ContentManagerRe
try { PackageBits bits = entityManager.find(PackageBits.class, packageBits.getId()); - // bits.setBits(StreamUtil.slurp(bitStream)); String pkgName = "(set packageName)"; if ((packageVersion != null) && (packageVersion.getGeneralPackage() != null)) { //update it to whatever package name is if we can get to it. @@ -947,7 +946,6 @@ public class ContentManagerBean implements ContentManagerLocal, ContentManagerRe } bits = loadPackageBits(bitStream, packageVersion.getId(), pkgName, packageVersion.getVersion(), bits); - // bits.setBits(StreamUtil.slurp(bitStream)); entityManager.merge(bits);
} finally { @@ -1237,31 +1235,14 @@ public class ContentManagerBean implements ContentManagerLocal, ContentManagerRe PackageVersion newPackageVersion = new PackageVersion(existingPackage, version, architecture); newPackageVersion.setDisplayName(existingPackage.getName());
- // PackageBits bits = loadPackageBits(packageBitStream); PackageBits bits = loadPackageBits(packageBitStream, newPackageVersion.getId(), packageName, version, null); - // // TODO: THIS IS VERY BAD - MUST FIX - DO NOT SLURP THE ENTIRE FILE IN MEMORY - USE JDBC STREAMING - // // Write the content into the newly created package version. This may eventually move, but for now we'll just - // // use the byte array in the package version to store the bits. - // byte[] packageBits; - // try { - // packageBits = StreamUtil.slurp(packageBitStream); - // } catch (RuntimeException re) { - // throw new RuntimeException("Error reading in the package file", re); - // } - // - // PackageBits bits = new PackageBits(); - // try { - // bits.setBits(packageBits); - // } catch (Exception e) { - // log.error("Error saving the package.", e); - // }
newPackageVersion.setPackageBits(bits); + //TODO: write down to file system to calculate length and calculate hash. newPackageVersion.setFileSize((long) bits.getBits().length); try { newPackageVersion.setSHA256(new MessageDigestGenerator(MessageDigestGenerator.SHA_256) .calcDigestString(bits.getBits())); - // .calcDigestString(packageBits)); } catch (IOException e) { newPackageVersion.setSHA256(null); } @@ -1579,23 +1560,6 @@ public class ContentManagerBean implements ContentManagerLocal, ContentManagerRe
//get the data PackageBits bits = loadPackageBits(packageBitStream, packageVersion.getId(), packageName, version, null); - // // TODO: THIS IS VERY BAD - MUST FIX - DO NOT SLURP THE ENTIRE FILE IN MEMORY - USE JDBC STREAMING - // // Write the content into the newly created package version. This may eventually move, but for now we'll just - // // use the byte array in the package version to store the bits. - // byte[] packageBits; - // try { - // packageBits = StreamUtil.slurp(packageBitStream); - // } catch (RuntimeException re) { - // throw new RuntimeException("Error reading in the package file", re); - // } - // - // PackageBits bits = new PackageBits(); - // // bits = new PackageBits(); - // try { - // bits.setBits(packageBits); - // } catch (Exception e) { - // log.error("Error savinf the package.", e); - // }
packageVersion.setPackageBits(bits);
@@ -1643,10 +1607,8 @@ public class ContentManagerBean implements ContentManagerLocal, ContentManagerRe
bits = entityManager.find(PackageBits.class, bits.getId());
- Subject user = null; - //write data from stream into db using Hibernate Blob mechanism - updateBlobStream(user, packageBitStream, bits); + updateBlobStream(packageBitStream, bits);
return bits; } @@ -1656,19 +1618,7 @@ public class ContentManagerBean implements ContentManagerLocal, ContentManagerRe * * @param stream */ - public void updateBlobStream(Subject user, InputStream stream, PackageBits bits) { - - // int resourceId = -1; - // if (bits != null) { - // resourceId = bits.getId(); - // } - // log.info("Updating data for PackageBits [" + bits + "] with resource ID [" + resourceId + "]"); - // - // // Check permissions first - // if (!authorizationManager.hasResourcePermission(user, Permission.MANAGE_CONTENT, resourceId)) { - // throw new PermissionException("User [" + user.getName() - // + "] does not have permission to update packageBits " + bits + " with resource ID [" + resourceId + "]"); - // } + public void updateBlobStream(InputStream stream, PackageBits bits) {
//TODO: are there any db specific limits that we should check/verify here before stuffing // the contents of a stream into the db? Should we just let the db complain and take care of @@ -1747,24 +1697,11 @@ public class ContentManagerBean implements ContentManagerLocal, ContentManagerRe * * @param stream non null stream where contents to be written to. */ - public void writeBlobOutToStream(Subject user, OutputStream stream, PackageBits bits, boolean closeStreams) { - - // int resourceId = -1; - // if (bits != null) { - // resourceId = bits.getId(); - // } - // log.info("Reading data for PackageBits [" + bits + "] with resource ID [" + resourceId + "]"); - // - // // Check permissions first - // if (!authorizationManager.hasResourcePermission(user, Permission.MANAGE_CONTENT, resourceId)) { - // throw new PermissionException("User [" + user.getName() + "] does not have permission to read packageBits " - // + bits + " with resource ID [" + resourceId + "]"); - // } + public void writeBlobOutToStream(OutputStream stream, PackageBits bits, boolean closeStreams) {
if (stream == null) { return; // no locate to write to } - // if ((bits == null) || (bits.getId() <= 0) || bits.getBits() == null) { if ((bits == null) || (bits.getId() <= 0)) { //then PackageBits instance passed in is insufficiently initialized. log.warn("PackageBits insufficiently initialized. No data to write out."); diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerLocal.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerLocal.java index 83c0037..65b0365 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerLocal.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerLocal.java @@ -347,8 +347,8 @@ public interface ContentManagerLocal {
byte[] getPackageBytes(Subject user, int resourceId, int installedPackageId);
- void writeBlobOutToStream(Subject user, OutputStream stream, PackageBits bits, boolean closeStreams); + void writeBlobOutToStream(OutputStream stream, PackageBits bits, boolean closeStreams);
- void updateBlobStream(Subject user, InputStream stream, PackageBits bits); + void updateBlobStream(InputStream stream, PackageBits bits);
} \ No newline at end of file diff --git a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/content/test/ContentUIManagerBeanTest.java b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/content/test/ContentUIManagerBeanTest.java index c8ac4e3..7fae6e0 100644 --- a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/content/test/ContentUIManagerBeanTest.java +++ b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/content/test/ContentUIManagerBeanTest.java @@ -29,7 +29,6 @@ import org.apache.commons.logging.LogFactory; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test;
-import org.rhq.core.domain.auth.Subject; import org.rhq.core.domain.content.Architecture; import org.rhq.core.domain.content.Package; import org.rhq.core.domain.content.PackageBits; @@ -285,8 +284,7 @@ public class ContentUIManagerBeanTest extends AbstractEJB3Test { } FileInputStream fos = new FileInputStream(originalBinary);
- Subject empty = null; - contentManager.updateBlobStream(empty, fos, packageBits); + contentManager.updateBlobStream(fos, packageBits); packageBits = em.find(PackageBits.class, packageBits.getId());
// test that the bits are available and stored in the DB: Reading the Blob @@ -298,7 +296,7 @@ public class ContentUIManagerBeanTest extends AbstractEJB3Test { assert composite.isPackageBitsInDatabase();
FileOutputStream outputStream = new FileOutputStream(retrieved); - contentManager.writeBlobOutToStream(empty, outputStream, packageBits, false); + contentManager.writeBlobOutToStream(outputStream, packageBits, false);
//Check that db content equal to file system content String originalDigest = new MessageDigestGenerator(MessageDigestGenerator.SHA_256)
commit 408bc20049ff0f06738e70b2dbafdbbd83366fdb Author: Simeon Pinder spinder@redhat.com Date: Thu Jun 24 11:03:02 2010 -0400
BZ-597246: changed StreamUtil.slurp to use Hibernate Blob mechanism, and added unit test for read/write Blob data.
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/content/PackageBits.java b/modules/core/domain/src/main/java/org/rhq/core/domain/content/PackageBits.java index 2bf059c..634ebeb 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/content/PackageBits.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/content/PackageBits.java @@ -104,4 +104,5 @@ public class PackageBits implements Serializable { public void setBits(byte[] bits) { this.bits = bits; } + } \ No newline at end of file diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerBean.java index 244478e..5bae392 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerBean.java @@ -24,8 +24,11 @@ import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; +import java.io.OutputStream; +import java.sql.Blob; import java.sql.Connection; import java.sql.PreparedStatement; +import java.sql.ResultSet; import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; @@ -936,7 +939,15 @@ public class ContentManagerBean implements ContentManagerLocal, ContentManagerRe
try { PackageBits bits = entityManager.find(PackageBits.class, packageBits.getId()); - bits.setBits(StreamUtil.slurp(bitStream)); + // bits.setBits(StreamUtil.slurp(bitStream)); + String pkgName = "(set packageName)"; + if ((packageVersion != null) && (packageVersion.getGeneralPackage() != null)) { + //update it to whatever package name is if we can get to it. + pkgName = packageVersion.getGeneralPackage().getName(); + } + bits = loadPackageBits(bitStream, packageVersion.getId(), pkgName, packageVersion.getVersion(), + bits); + // bits.setBits(StreamUtil.slurp(bitStream)); entityManager.merge(bits);
} finally { @@ -1227,28 +1238,30 @@ public class ContentManagerBean implements ContentManagerLocal, ContentManagerRe newPackageVersion.setDisplayName(existingPackage.getName());
// PackageBits bits = loadPackageBits(packageBitStream); - // TODO: THIS IS VERY BAD - MUST FIX - DO NOT SLURP THE ENTIRE FILE IN MEMORY - USE JDBC STREAMING - // Write the content into the newly created package version. This may eventually move, but for now we'll just - // use the byte array in the package version to store the bits. - byte[] packageBits; - try { - packageBits = StreamUtil.slurp(packageBitStream); - } catch (RuntimeException re) { - throw new RuntimeException("Error reading in the package file", re); - } - - PackageBits bits = new PackageBits(); - try { - bits.setBits(packageBits); - } catch (Exception e) { - log.error("Error saving the package.", e); - } + PackageBits bits = loadPackageBits(packageBitStream, newPackageVersion.getId(), packageName, version, null); + // // TODO: THIS IS VERY BAD - MUST FIX - DO NOT SLURP THE ENTIRE FILE IN MEMORY - USE JDBC STREAMING + // // Write the content into the newly created package version. This may eventually move, but for now we'll just + // // use the byte array in the package version to store the bits. + // byte[] packageBits; + // try { + // packageBits = StreamUtil.slurp(packageBitStream); + // } catch (RuntimeException re) { + // throw new RuntimeException("Error reading in the package file", re); + // } + // + // PackageBits bits = new PackageBits(); + // try { + // bits.setBits(packageBits); + // } catch (Exception e) { + // log.error("Error saving the package.", e); + // }
newPackageVersion.setPackageBits(bits); newPackageVersion.setFileSize((long) bits.getBits().length); try { newPackageVersion.setSHA256(new MessageDigestGenerator(MessageDigestGenerator.SHA_256) - .calcDigestString(packageBits)); + .calcDigestString(bits.getBits())); + // .calcDigestString(packageBits)); } catch (IOException e) { newPackageVersion.setSHA256(null); } @@ -1564,24 +1577,25 @@ public class ContentManagerBean implements ContentManagerLocal, ContentManagerRe entityManager.persist(packageVersion); }
- //get the data and persist/merge packageVersion - // PackageBits bits = loadPackageBits(packageBitStream); - // TODO: THIS IS VERY BAD - MUST FIX - DO NOT SLURP THE ENTIRE FILE IN MEMORY - USE JDBC STREAMING - // Write the content into the newly created package version. This may eventually move, but for now we'll just - // use the byte array in the package version to store the bits. - byte[] packageBits; - try { - packageBits = StreamUtil.slurp(packageBitStream); - } catch (RuntimeException re) { - throw new RuntimeException("Error reading in the package file", re); - } - - PackageBits bits = new PackageBits(); - try { - bits.setBits(packageBits); - } catch (Exception e) { - log.error("Error savinf the package.", e); - } + //get the data + PackageBits bits = loadPackageBits(packageBitStream, packageVersion.getId(), packageName, version, null); + // // TODO: THIS IS VERY BAD - MUST FIX - DO NOT SLURP THE ENTIRE FILE IN MEMORY - USE JDBC STREAMING + // // Write the content into the newly created package version. This may eventually move, but for now we'll just + // // use the byte array in the package version to store the bits. + // byte[] packageBits; + // try { + // packageBits = StreamUtil.slurp(packageBitStream); + // } catch (RuntimeException re) { + // throw new RuntimeException("Error reading in the package file", re); + // } + // + // PackageBits bits = new PackageBits(); + // // bits = new PackageBits(); + // try { + // bits.setBits(packageBits); + // } catch (Exception e) { + // log.error("Error savinf the package.", e); + // }
packageVersion.setPackageBits(bits);
@@ -1604,26 +1618,177 @@ public class ContentManagerBean implements ContentManagerLocal, ContentManagerRe /** Pulls in package bits from the stream. Currently inefficient. * * @param packageBitStream + * @param packageVersionId * @return PackageBits ref populated. */ - private PackageBits loadPackageBits(InputStream packageBitStream) { + @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW) + private PackageBits loadPackageBits(InputStream packageBitStream, int packageVersionId, String packageName, + String packageVersion, PackageBits existingPkgBits) { PackageBits bits = null; - // TODO: THIS IS VERY BAD - MUST FIX - DO NOT SLURP THE ENTIRE FILE IN MEMORY - USE JDBC STREAMING - // Write the content into the newly created package version. This may eventually move, but for now we'll just - // use the byte array in the package version to store the bits. - byte[] packageBits; - try { - packageBits = StreamUtil.slurp(packageBitStream); - } catch (RuntimeException re) { - throw new RuntimeException("Error reading in the package file", re); + + //use or instantiate PackageBits instance. + if (existingPkgBits == null) { + bits = new PackageBits(); + entityManager.persist(bits); + } else { + bits = existingPkgBits; }
- bits = new PackageBits(); + //locate related packageVersion + PackageVersion pv = entityManager.find(PackageVersion.class, packageVersionId); + + //associate the two + pv.setPackageBits(bits); + entityManager.flush(); // push the new package bits row to the DB + + bits = entityManager.find(PackageBits.class, bits.getId()); + + Subject user = null; + + //write data from stream into db using Hibernate Blob mechanism + updateBlobStream(user, packageBitStream, bits); + + return bits; + } + + /** Takes an input stream and copies it into the PackageBits table using Hibernate + * Blob mechanism with PreparedStatements. As all content into Bits are not stored as type OID, t + * + * @param stream + */ + public void updateBlobStream(Subject user, InputStream stream, PackageBits bits) { + + // int resourceId = -1; + // if (bits != null) { + // resourceId = bits.getId(); + // } + // log.info("Updating data for PackageBits [" + bits + "] with resource ID [" + resourceId + "]"); + // + // // Check permissions first + // if (!authorizationManager.hasResourcePermission(user, Permission.MANAGE_CONTENT, resourceId)) { + // throw new PermissionException("User [" + user.getName() + // + "] does not have permission to update packageBits " + bits + " with resource ID [" + resourceId + "]"); + // } + + //TODO: are there any db specific limits that we should check/verify here before stuffing + // the contents of a stream into the db? Should we just let the db complain and take care of + // input validation? + if (stream == null) { + return; // no stream content to update. + } + if (bits == null) { + bits = new PackageBits(); + } + + //persist to db if not already + if (bits.getId() <= 0) { + entityManager.persist(this); + } + + //locate the existing PackageBits instance + bits = entityManager.find(PackageBits.class, bits.getId()); + + ///initialize Bits field so non-empty. + bits.setBits(new String("a").getBytes()); + entityManager.merge(bits); + entityManager.flush(); + + //Create prepared statements to work with Blobs and hibernate. + Connection conn = null; + PreparedStatement ps = null; + PreparedStatement ps2 = null; + DataSource ds = null; try { - bits.setBits(packageBits); + + conn = dataSource.getConnection(); + + //we are loading the PackageBits saved in the previous step + //we need to lock the row which will be updated so we are using FOR UPDATE + ps = conn.prepareStatement("SELECT BITS FROM " + PackageBits.TABLE_NAME + " WHERE ID = ? FOR UPDATE"); + ps.setInt(1, bits.getId()); + ResultSet rs = ps.executeQuery(); + if (rs != null) { + while (rs.next()) { + + //We can not create a blob directly because BlobImpl from Hibernate is not acceptable + //for oracle and Connection.createBlob is not working on postgres. + //This blob will be not empty because we saved there a bytes from String("a"). + Blob blb = rs.getBlob(1); + + //copy the stream to the Blob + long transferred = StreamUtil.copy(stream, blb.setBinaryStream(1), false); + stream.close(); + + //populate the prepared statement for update + ps2 = conn.prepareStatement("UPDATE " + PackageBits.TABLE_NAME + " SET bits = ? where id = ?"); + ps2.setBlob(1, blb); + ps2.setInt(2, bits.getId()); + + //initiate the update. + if (ps2.execute()) { + throw new Exception("Unable to upload the package bits to the DB:"); + } + ps2.close(); + } + } + ps.close(); + conn.close(); } catch (Exception e) { - log.error("Error saving the package.", e); + log.error("An error occurred while updating Blob with stream for PackageBits[" + bits.getId() + "], " + + e.getMessage()); + e.printStackTrace(); + } + + entityManager.merge(bits); + entityManager.flush(); + } + + /**Writes the contents of a the Blob out to the stream passed in. + * + * @param stream non null stream where contents to be written to. + */ + public void writeBlobOutToStream(Subject user, OutputStream stream, PackageBits bits, boolean closeStreams) { + + // int resourceId = -1; + // if (bits != null) { + // resourceId = bits.getId(); + // } + // log.info("Reading data for PackageBits [" + bits + "] with resource ID [" + resourceId + "]"); + // + // // Check permissions first + // if (!authorizationManager.hasResourcePermission(user, Permission.MANAGE_CONTENT, resourceId)) { + // throw new PermissionException("User [" + user.getName() + "] does not have permission to read packageBits " + // + bits + " with resource ID [" + resourceId + "]"); + // } + + if (stream == null) { + return; // no locate to write to + } + // if ((bits == null) || (bits.getId() <= 0) || bits.getBits() == null) { + if ((bits == null) || (bits.getId() <= 0)) { + //then PackageBits instance passed in is insufficiently initialized. + log.warn("PackageBits insufficiently initialized. No data to write out."); + return; + } + try { + //open connection + Connection conn = dataSource.getConnection(); + + //prepared statement for retrieval of Blob.bits + PreparedStatement ps = conn + .prepareStatement("SELECT BITS FROM " + PackageBits.TABLE_NAME + " WHERE ID = ?"); + ps.setInt(1, bits.getId()); + ResultSet results = ps.executeQuery(); + if (results.next()) { + // results.next(); + //retrieve the Blob + Blob blob = results.getBlob(1); + //now copy the contents to the stream passed in + StreamUtil.copy(blob.getBinaryStream(), stream, closeStreams); + } + } catch (Exception ex) { + log.error("An error occurred while writing Blob contents out to stream :" + ex.getMessage()); + ex.printStackTrace(); } - return bits; } -} +} \ No newline at end of file diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerLocal.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerLocal.java index fc128a4..83c0037 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerLocal.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerLocal.java @@ -19,6 +19,7 @@ package org.rhq.enterprise.server.content;
import java.io.InputStream; +import java.io.OutputStream; import java.util.List; import java.util.Map; import java.util.Set; @@ -32,6 +33,7 @@ import org.rhq.core.domain.content.Architecture; import org.rhq.core.domain.content.ContentServiceRequest; import org.rhq.core.domain.content.InstalledPackage; import org.rhq.core.domain.content.Package; +import org.rhq.core.domain.content.PackageBits; import org.rhq.core.domain.content.PackageDetailsKey; import org.rhq.core.domain.content.PackageType; import org.rhq.core.domain.content.PackageVersion; @@ -211,9 +213,8 @@ public interface ContentManagerLocal { PackageVersion createPackageVersion(String packageName, int packageTypeId, String version, int architectureId, InputStream packageBitStream);
- PackageVersion getUploadedPackageVersion(String packageName, int packageTypeId, String version, - int architectureId, InputStream packageBitStream, Map<String, String> packageUploadDetails, - int newResourceTypeId); + PackageVersion getUploadedPackageVersion(String packageName, int packageTypeId, String version, int architectureId, + InputStream packageBitStream, Map<String, String> packageUploadDetails, int newResourceTypeId);
/** * Very simple method that persists the given package version within its own transaction. @@ -346,4 +347,8 @@ public interface ContentManagerLocal {
byte[] getPackageBytes(Subject user, int resourceId, int installedPackageId);
+ void writeBlobOutToStream(Subject user, OutputStream stream, PackageBits bits, boolean closeStreams); + + void updateBlobStream(Subject user, InputStream stream, PackageBits bits); + } \ No newline at end of file diff --git a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/content/test/ContentUIManagerBeanTest.java b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/content/test/ContentUIManagerBeanTest.java index b83695f..c8ac4e3 100644 --- a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/content/test/ContentUIManagerBeanTest.java +++ b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/content/test/ContentUIManagerBeanTest.java @@ -18,6 +18,10 @@ */ package org.rhq.enterprise.server.content.test;
+import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; + import javax.persistence.EntityManager;
import org.apache.commons.logging.Log; @@ -25,6 +29,7 @@ import org.apache.commons.logging.LogFactory; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test;
+import org.rhq.core.domain.auth.Subject; import org.rhq.core.domain.content.Architecture; import org.rhq.core.domain.content.Package; import org.rhq.core.domain.content.PackageBits; @@ -32,7 +37,9 @@ import org.rhq.core.domain.content.PackageType; import org.rhq.core.domain.content.PackageVersion; import org.rhq.core.domain.content.composite.LoadedPackageBitsComposite; import org.rhq.core.domain.resource.Resource; +import org.rhq.core.util.MessageDigestGenerator; import org.rhq.enterprise.server.auth.SubjectManagerLocal; +import org.rhq.enterprise.server.content.ContentManagerLocal; import org.rhq.enterprise.server.content.ContentUIManagerLocal; import org.rhq.enterprise.server.test.AbstractEJB3Test; import org.rhq.enterprise.server.util.LookupUtil; @@ -52,6 +59,7 @@ public class ContentUIManagerBeanTest extends AbstractEJB3Test {
private ContentUIManagerLocal contentUIManager; private SubjectManagerLocal subjectManager; + private ContentManagerLocal contentManager;
// Setup --------------------------------------------
@@ -59,6 +67,7 @@ public class ContentUIManagerBeanTest extends AbstractEJB3Test { public void setupBeforeClass() throws Exception { contentUIManager = LookupUtil.getContentUIManager(); subjectManager = LookupUtil.getSubjectManager(); + contentManager = LookupUtil.getContentManager(); }
// Test Cases -------------------------------------------- @@ -214,4 +223,94 @@ public class ContentUIManagerBeanTest extends AbstractEJB3Test { getTransactionManager().rollback(); } } + + @Test(enabled = ENABLE_TESTS) + public void testPackageBitsBlobStream() throws Throwable { + LoadedPackageBitsComposite composite; + + getTransactionManager().begin(); + + try { + EntityManager em = getEntityManager(); + Resource resource = SessionTestHelper.createNewResource(em, "testPkgBitsLargeResource"); + PackageType pkgType = new PackageType("testPkgBitsLargePT", resource.getResourceType()); + org.rhq.core.domain.content.Package pkg = new Package("testPkgBitsLargeP", pkgType); + Architecture arch = new Architecture("testPkgLargeArch"); + PackageVersion pkgVer = new PackageVersion(pkg, "1", arch); + + em.persist(pkgType); + em.persist(pkg); + em.persist(arch); + em.persist(pkgVer); + em.flush(); + + // test that no bits are available right now + composite = contentUIManager.getLoadedPackageBitsComposite(pkgVer.getId()); + assert composite != null; + assert composite.getPackageVersionId() == pkgVer.getId(); + assert composite.getPackageBitsId() == null; + assert !composite.isPackageBitsAvailable(); + assert !composite.isPackageBitsInDatabase(); + + // pretend we loaded the bits, but we stored them somewhere other then the DB + PackageBits packageBits = new PackageBits(); + em.persist(packageBits); + pkgVer.setPackageBits(packageBits); + pkgVer = em.merge(pkgVer); + em.flush(); + + // test that the bits are available, but are not stored in the DB + composite = contentUIManager.getLoadedPackageBitsComposite(pkgVer.getId()); + assert composite != null; + assert composite.getPackageVersionId() == pkgVer.getId(); + assert composite.getPackageBitsId() == packageBits.getId(); + assert composite.isPackageBitsAvailable(); + assert !composite.isPackageBitsInDatabase(); + + // let's make sure there really is no data in the DB + packageBits = em.find(PackageBits.class, packageBits.getId()); + assert packageBits != null; + assert packageBits.getBits() == null; + + // now lets store some bits in the DB using PreparedStatements and BLOB mechanism + // to simulate large file transfers where streaming is used instead of reading entire + // contents into memory every time. + + //any jar should be fine. Use generated server jar + File originalBinary = new File("./target/rhq-enterprise-server.jar"); + //destination once pulled from db + File retrieved = new File("./target/pulled.jar"); + if (retrieved.exists()) { + assertTrue("Unable to delete ./target/pulled.jar for test cleanup.", retrieved.delete()); + } + FileInputStream fos = new FileInputStream(originalBinary); + + Subject empty = null; + contentManager.updateBlobStream(empty, fos, packageBits); + packageBits = em.find(PackageBits.class, packageBits.getId()); + + // test that the bits are available and stored in the DB: Reading the Blob + composite = contentUIManager.getLoadedPackageBitsComposite(pkgVer.getId()); + assert composite != null; + assert composite.getPackageVersionId() == pkgVer.getId(); + assert composite.getPackageBitsId() == packageBits.getId(); + assert composite.isPackageBitsAvailable(); + assert composite.isPackageBitsInDatabase(); + + FileOutputStream outputStream = new FileOutputStream(retrieved); + contentManager.writeBlobOutToStream(empty, outputStream, packageBits, false); + + //Check that db content equal to file system content + String originalDigest = new MessageDigestGenerator(MessageDigestGenerator.SHA_256) + .calcDigestString(originalBinary); + String newDigest = new MessageDigestGenerator(MessageDigestGenerator.SHA_256).calcDigestString(retrieved); + assertEquals("Uploaded and retrieved digests differ:", originalDigest, newDigest); + + } catch (Throwable t) { + t.printStackTrace(); + throw t; + } finally { + getTransactionManager().rollback(); + } + } } \ No newline at end of file
commit d9c7b5f73abdf141dce71b4c938e6b4718954e18 Author: Joseph Marques joseph@redhat.com Date: Thu Jun 24 10:39:21 2010 -0400
BZ-607672: support upgrading alert notification history
diff --git a/modules/core/dbutils/src/main/java/org/rhq/core/db/upgrade/CustomAlertSenderUpgradeTask.java b/modules/core/dbutils/src/main/java/org/rhq/core/db/upgrade/CustomAlertSenderUpgradeTask.java index 6fd0415..4e2f328 100644 --- a/modules/core/dbutils/src/main/java/org/rhq/core/db/upgrade/CustomAlertSenderUpgradeTask.java +++ b/modules/core/dbutils/src/main/java/org/rhq/core/db/upgrade/CustomAlertSenderUpgradeTask.java @@ -23,6 +23,8 @@ import java.sql.SQLException; import java.util.List;
import org.rhq.core.db.DatabaseType; +import org.rhq.core.db.OracleDatabaseType; +import org.rhq.core.db.PostgresqlDatabaseType;
/** * The introduction of custom alert senders brought with it the denormalization of the AlertNotification schema. @@ -57,6 +59,13 @@ public class CustomAlertSenderUpgradeTask implements DatabaseUpgradeTask { this.databaseType = databaseType; this.connection = connection;
+ // upgrade the notification audit trail + upgradeSubjectNotificationLogs(); + upgradeRoleNotificationLogs(); + upgradeEmailNotificationLogs(); + upgradeOperationNotificationLogs(); + + // upgrade the notification rules upgradeSubjectNotifications(); upgradeRoleNotifications(); upgradeEmailNotifications(); @@ -64,6 +73,130 @@ public class CustomAlertSenderUpgradeTask implements DatabaseUpgradeTask { upgradeOperationNotifications(); }
+ private void upgradeSubjectNotificationLogs() throws SQLException { + /* + * alert.alertNotificationLog.sender = "System Users" + * alert.alertNotificationLog.result_state = "DEFERRED_EMAIL" + * alert.alertNotificationLog.message = "Sending to subjects: [<alert.alertNotificationLog.subjects>]" + */ + String field = "notif.subjects"; + String message = concat("'Sending to subjects: '", field); + String insertSQL = getNotificationLogConversionSQL("'System Users'", "'DEFERRED_EMAIL'", message, field); + System.out.println("Executing: " + insertSQL); + databaseType.executeSql(connection, insertSQL); + } + + private void upgradeRoleNotificationLogs() throws SQLException { + /* + * alert.alertNotificationLog.sender = "System Roles" + * alert.alertNotificationLog.result_state = "DEFERRED_EMAIL" + * alert.alertNotificationLog.message = "Sending to roles: [<alert.alertNotificationLog.roles>]" + */ + String field = "notif.roles"; + String message = concat("'Sending to roles: '", field); + String insertSQL = getNotificationLogConversionSQL("'System Roles'", "'DEFERRED_EMAIL'", message, field); + System.out.println("Executing: " + insertSQL); + databaseType.executeSql(connection, insertSQL); + } + + private void upgradeEmailNotificationLogs() throws SQLException { + /* + * alert.alertNotificationLog.sender = "Direct Emails" + * alert.alertNotificationLog.result_state = "DEFERRED_EMAIL" + * alert.alertNotificationLog.message = "Sending to subjects: [<alert.alertNotificationLog.emails>]" + */ + String field = "notif.emails"; + String message = concat("'Sending to addresses: '", field); + String insertSQL = getNotificationLogConversionSQL("'Direct Emails'", "'DEFERRED_EMAIL'", message, field); + System.out.println("Executing: " + insertSQL); + databaseType.executeSql(connection, insertSQL); + } + + private String getNotificationLogConversionSQL(String sender, String resultState, String message, + String notNullField) { + if (databaseType instanceof PostgresqlDatabaseType) { + return "INSERT INTO rhq_alert_notif_log ( id, alert_id, sender, result_state, message )" // + + " SELECT nextval('RHQ_ALERT_NOTIF_LOG_ID_SEQ'), " // + + " notif.alert_id AS notifAlertId, " // + + " " + sender + " AS notifSender, "// + + " " + resultState + " AS notifResultState, " // + + " " + message + " AS notifMessage "// + + " FROM rhq_alert_notif_log notif " // + + " WHERE " + notNullField + " IS NOT NULL"; + } else if (databaseType instanceof OracleDatabaseType) { + return "INSERT INTO rhq_alert_notif_log ( id, alert_id, sender, result_state, message )" // + + " SELECT RHQ_ALERT_NOTIF_LOG_ID_SEQ.nextval, " // + + " notifAlertId, notifSender, notifResultState, notifMessage " + + " FROM ( SELECT notif.alert_id AS notifAlertId, " // + + " " + sender + " AS notifSender, "// + + " " + resultState + " AS notifResultState, " // + + " " + message + " AS notifMessage "// + + " FROM rhq_alert_notif_log notif " // + + " WHERE " + notNullField + " IS NOT NULL )"; + } else { + throw new IllegalStateException(this.getClass().getSimpleName() + " does not support upgrades for " + + databaseType.getName()); + } + } + + private void upgradeOperationNotificationLogs() throws SQLException { + /* + * alert.alertNotificationLog.sender = "Resource Operations" + * alert.alertNotificationLog.result_state = "SUCCESS" + * alert.alertNotificationLog.message = "Executed '<alert.triggeredOperation>' on this resource" + */ + String field = "alert.triggered_operation"; + String message = concat("'Executed "'", field, "'" on this resource'"); + String insertSQL = getNotificationLogInsertionSQL("'Resource Operations'", "'SUCCESS'", message, field); + System.out.println("Executing: " + insertSQL); + databaseType.executeSql(connection, insertSQL); + } + + private String getNotificationLogInsertionSQL(String sender, String resultState, String message, String notNullField) { + if (databaseType instanceof PostgresqlDatabaseType) { + return "INSERT INTO rhq_alert_notif_log ( id, alert_id, sender, result_state, message )" // + + " SELECT nextval('RHQ_ALERT_NOTIF_LOG_ID_SEQ'), " // + + " alert.id AS notifAlertId, " // + + " " + sender + " AS notifSender, "// + + " " + resultState + " AS notifResultState, " // + + " " + message + " AS notifMessage "// + + " FROM rhq_alert alert " // + + " WHERE " + notNullField + " IS NOT NULL"; + } else if (databaseType instanceof OracleDatabaseType) { + return "INSERT INTO rhq_alert_notif_log ( id, alert_id, sender, result_state, message )" // + + " SELECT RHQ_ALERT_NOTIF_LOG_ID_SEQ.nextval, " // + + " notifAlertId, notifSender, notifResultState, notifMessage " + + " FROM ( SELECT alert.id AS notifAlertId, " // + + " " + sender + " AS notifSender, "// + + " " + resultState + " AS notifResultState, " // + + " " + message + " AS notifMessage "// + + " FROM rhq_alert alert " // + + " WHERE " + notNullField + " IS NOT NULL )"; + } else { + throw new IllegalStateException(this.getClass().getSimpleName() + " does not support upgrades for " + + databaseType.getName()); + } + } + + private String concat(String... elements) { + StringBuilder builder = new StringBuilder(); + if (databaseType instanceof PostgresqlDatabaseType || databaseType instanceof OracleDatabaseType) { + boolean first = true; + for (String next : elements) { + if (first) { + first = false; + } else { + builder.append("||"); + } + builder.append(next); + } + } else { + throw new IllegalStateException(this.getClass().getSimpleName() + " does not support upgrades for " + + databaseType.getName()); + } + return builder.toString(); + } + private void upgradeSubjectNotifications() throws SQLException { String dataMapSQL = "" // + " SELECT notif.alert_definition_id, notif.subject_id "// diff --git a/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml b/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml index d10dcf9..1d3bd04 100644 --- a/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml +++ b/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml @@ -2082,6 +2082,20 @@ </schema-directSQL> </schemaSpec> <schemaSpec version="2.70.2"> + <schema-addColumn table="RHQ_ALERT_NOTIF_LOG" column="SENDER" columnType="VARCHAR2" precision="200" /> + <schema-addColumn table="RHQ_ALERT_NOTIF_LOG" column="RESULT_STATE" columnType="VARCHAR2" precision="20" /> + <schema-addColumn table="RHQ_ALERT_NOTIF_LOG" column="MESSAGE" columnType="VARCHAR2" precision="4000" /> + <schema-addColumn table="RHQ_ALERT_NOTIF_LOG" column="ALL_EMAILS" columnType="VARCHAR2" precision="4000" /> + <schema-addColumn table="RHQ_ALERT_NOTIF_LOG" column="EMAILS_FAILED" columnType="VARCHAR2" precision="4000" /> + </schemaSpec> + <schemaSpec version="2.70.3"> + <schema-directSQL> + <statement desc="Dropping unique index RHQ_ALERT_IDX_ALERT"> + DROP INDEX RHQ_ALERT_IDX_ALERT + </statement> + </schema-directSQL> + </schemaSpec> + <schemaSpec version="2.70.4"> <!-- turn first-class notification data into configuration objects for custom alert senders --> <schema-alterColumn table="RHQ_ALERT_NOTIFICATION" column="NOTIFICATION_TYPE" nullable="TRUE" /> <schema-javaTask className="CustomAlertSenderUpgradeTask" /> @@ -2092,7 +2106,7 @@ </schema-directSQL> <schema-deleteColumn table="RHQ_ALERT_NOTIFICATION" column="NOTIFICATION_TYPE" /> </schemaSpec> - <schemaSpec version="2.70.3"> + <schemaSpec version="2.70.5"> <!-- remove first-class alert notification structures from definition side of the model--> <schema-deleteColumn table="RHQ_ALERT_NOTIFICATION" column="snmp_host" /> <schema-deleteColumn table="RHQ_ALERT_NOTIFICATION" column="snmp_port" /> @@ -2100,25 +2114,17 @@ <schema-deleteColumn table="RHQ_ALERT_NOTIFICATION" column="email_address" /> <schema-deleteColumn table="RHQ_ALERT_NOTIFICATION" column="role_id" /> <schema-deleteColumn table="RHQ_ALERT_NOTIFICATION" column="subject_id" /> + <schema-deleteColumn table="RHQ_ALERT_DEFINITION" column="operation_def_id" /> </schemaSpec> - <schemaSpec version="2.70.4"> + <schemaSpec version="2.70.6"> <schema-deleteColumn table="RHQ_ALERT_NOTIF_LOG" column="roles" /> <schema-deleteColumn table="RHQ_ALERT_NOTIF_LOG" column="subjects" /> <schema-deleteColumn table="RHQ_ALERT_NOTIF_LOG" column="emails" /> + <schema-deleteColumn table="RHQ_ALERT" column="triggered_operation" /> </schemaSpec> - <schemaSpec version="2.70.5"> - <schema-addColumn table="RHQ_ALERT_NOTIF_LOG" column="SENDER" columnType="VARCHAR2" precision="200" /> - <schema-addColumn table="RHQ_ALERT_NOTIF_LOG" column="RESULT_STATE" columnType="VARCHAR2" precision="20" /> - <schema-addColumn table="RHQ_ALERT_NOTIF_LOG" column="MESSAGE" columnType="VARCHAR2" precision="4000" /> - <schema-addColumn table="RHQ_ALERT_NOTIF_LOG" column="ALL_EMAILS" columnType="VARCHAR2" precision="4000" /> - <schema-addColumn table="RHQ_ALERT_NOTIF_LOG" column="EMAILS_FAILED" columnType="VARCHAR2" precision="4000" /> - </schemaSpec> - <schemaSpec version="2.70.6"> + <schemaSpec version="2.70.7"> <schema-directSQL> - <statement> - DROP INDEX RHQ_ALERT_IDX_ALERT - </statement> - <statement> + <statement desc="Recreating RHQ_ALERT_IDX_ALERT as non-unique index"> CREATE INDEX RHQ_ALERT_IDX_ALERT ON RHQ_ALERT_NOTIF_LOG (alert_id) </statement> </schema-directSQL> diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/alert/Alert.java b/modules/core/domain/src/main/java/org/rhq/core/domain/alert/Alert.java index 593f223..72d705d 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/alert/Alert.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/alert/Alert.java @@ -238,10 +238,6 @@ public class Alert implements Serializable { @OneToMany(mappedBy = "alert", cascade = CascadeType.ALL) private List<AlertNotificationLog> alertNotificationLogs = new ArrayList<AlertNotificationLog>();
- @Deprecated - @Column(name = "TRIGGERED_OPERATION", nullable = true) - private String triggeredOperation; - /* * recoveryId and willRecover==true are mutually exclusive * @@ -283,9 +279,6 @@ public class Alert implements Serializable { // and unnecessary for creating the link // alertDefinition.addAlert(this); this.ctime = ctime; - if (alertDefinition.getOperationDefinition() != null) { - setTriggeredOperation(alertDefinition.getOperationDefinition().getDisplayName()); - } }
public int getId() { @@ -325,14 +318,6 @@ public class Alert implements Serializable { this.alertNotificationLogs.add(log); }
- public String getTriggeredOperation() { - return triggeredOperation; - } - - public void setTriggeredOperation(String triggeredOperation) { - this.triggeredOperation = triggeredOperation; - } - public Long getAcknowledgeTime() { return acknowledgeTime; } diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/alert/AlertDefinition.java b/modules/core/domain/src/main/java/org/rhq/core/domain/alert/AlertDefinition.java index 07739cf..a64de62 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/alert/AlertDefinition.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/alert/AlertDefinition.java @@ -54,7 +54,6 @@ import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlTransient;
import org.rhq.core.domain.alert.notification.AlertNotification; -import org.rhq.core.domain.operation.OperationDefinition; import org.rhq.core.domain.resource.Resource; import org.rhq.core.domain.resource.ResourceType; import org.rhq.core.domain.resource.group.ResourceGroup; @@ -361,10 +360,6 @@ public class AlertDefinition implements Serializable { @org.hibernate.annotations.Cascade(org.hibernate.annotations.CascadeType.DELETE_ORPHAN) private List<AlertNotification> alertNotifications = new ArrayList<AlertNotification>();
- @JoinColumn(name = "OPERATION_DEF_ID", nullable = true) - @ManyToOne - private OperationDefinition operationDefinition; - /* * As of Sept 29, 2007 there is no reason to expose this at the java layer. However, this is required if we want to * be able to cascade delete the AlertDampeningEvents when an AlertDefinition is removed from the db, due to @@ -409,7 +404,7 @@ public class AlertDefinition implements Serializable { /* * Don't copy the id, ctime, or mtime. */ - this.name = alertDef.name; + setName(alertDef.name); this.description = alertDef.description; this.priority = alertDef.priority; this.enabled = alertDef.enabled; @@ -456,8 +451,6 @@ public class AlertDefinition implements Serializable { } this.removeAllAlertNotifications(); this.getAlertNotifications().addAll(copiedNotifications); - - this.operationDefinition = alertDef.operationDefinition; }
public int getId() { @@ -686,14 +679,6 @@ public class AlertDefinition implements Serializable { this.alertNotifications.clear(); }
- public OperationDefinition getOperationDefinition() { - return operationDefinition; - } - - public void setOperationDefinition(OperationDefinition operationDefinition) { - this.operationDefinition = operationDefinition; - } - public Set<AlertDampeningEvent> getAlertDampeningEvents() { return alertDampeningEvents; } diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/common/monitor/alerts/ViewAlertAction.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/common/monitor/alerts/ViewAlertAction.java index 30454a7..01d4bc3 100644 --- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/common/monitor/alerts/ViewAlertAction.java +++ b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/common/monitor/alerts/ViewAlertAction.java @@ -45,7 +45,6 @@ import org.rhq.core.domain.alert.AlertDefinition; import org.rhq.core.domain.alert.notification.AlertNotificationLog; import org.rhq.core.domain.auth.Subject; import org.rhq.core.domain.measurement.DataType; -import org.rhq.core.domain.measurement.MeasurementCategory; import org.rhq.core.domain.measurement.MeasurementDefinition; import org.rhq.core.server.MeasurementConverter; import org.rhq.enterprise.gui.legacy.AttrConstants; @@ -117,7 +116,7 @@ public class ViewAlertAction extends TilesAction { true); } catch (Exception e) { // check if this is Calltime data - if (definition.getDataType()== DataType.CALLTIME) + if (definition.getDataType() == DataType.CALLTIME) firedValue = condLog.getValue(); else firedValue = "??"; @@ -142,11 +141,6 @@ public class ViewAlertAction extends TilesAction {
request.setAttribute("aNotifLogs", notificationLogs);
- request.setAttribute("controlEnabled", true); // always display control result, even if it's "none" - if (av.getTriggeredOperation() != null) { - request.setAttribute("controlAction", av.getTriggeredOperation()); - } - int recoveryAlertDefId = adv.getRecoveryId(); if (recoveryAlertDefId != 0) { String recoveryAlertName = getRecoveryAlertName(recoveryAlertDefId, subject); diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/common/monitor/alerts/config/EditDefinitionControlActionAction.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/common/monitor/alerts/config/EditDefinitionControlActionAction.java index ac19df3..6d080ef 100644 --- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/common/monitor/alerts/config/EditDefinitionControlActionAction.java +++ b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/common/monitor/alerts/config/EditDefinitionControlActionAction.java @@ -103,8 +103,6 @@ public class EditDefinitionControlActionAction extends BaseAction { operationDefinition = operationManager.getOperationDefinition(subject, operationId); }
- alertDefinition.setOperationDefinition(operationDefinition); - try { if (context == FormContext.Type) { alertTemplateManager.updateAlertTemplate(subject, alertDefinition, false); diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/common/monitor/alerts/config/EditDefinitionControlActionFormPrepareAction.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/common/monitor/alerts/config/EditDefinitionControlActionFormPrepareAction.java index 10fa84e..1086314 100644 --- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/common/monitor/alerts/config/EditDefinitionControlActionFormPrepareAction.java +++ b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/common/monitor/alerts/config/EditDefinitionControlActionFormPrepareAction.java @@ -82,12 +82,14 @@ public class EditDefinitionControlActionFormPrepareAction extends TilesAction { List<OptionItem> operationNames = AlertDefUtil.getControlActions(subject, id, formContext);
// drop-downs + /* replaced by custom alert senders operationsForm.setControlActions(operationNames); if (alertDefinition.getOperationDefinition() != null) { Integer operationId = alertDefinition.getOperationDefinition().getId();
operationsForm.setControlAction(String.valueOf(operationId)); } + */
// properties // AlertDefinition alertDef = AlertDefUtil.getAlertDefinition(request, sessionID, eb); diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/common/monitor/alerts/config/ViewDefinitionAction.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/common/monitor/alerts/config/ViewDefinitionAction.java index 4c395fd..1657d08 100644 --- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/common/monitor/alerts/config/ViewDefinitionAction.java +++ b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/common/monitor/alerts/config/ViewDefinitionAction.java @@ -68,10 +68,6 @@ public class ViewDefinitionAction extends TilesAction { request.setAttribute("recoveryAlertName", recoveryAlertName); }
- if (alertDef.getOperationDefinition() != null) { - request.setAttribute("controlAction", alertDef.getOperationDefinition().getDisplayName()); - } - // enablement AlertDefUtil.setAlertDampeningRequestAttributes(request, alertDef);
commit 4e2823ce36628041c3626d8e131ff2f8f9a3b94d Merge: b324404... 6dc2bab... Author: Heiko W. Rupp hwr@redhat.com Date: Thu Jun 24 14:52:30 2010 +0200
Merge branch 'release-3.0.0' of ssh://git.fedorahosted.org/git/rhq/rhq into release-3.0.0
commit b324404ad3b91849f12afa57fcd5417521274fd2 Author: Heiko W. Rupp hwr@redhat.com Date: Thu Jun 24 14:51:20 2010 +0200
BZ 607580 for traits don't try to parse numeric values and just show the conditions raw value (like for call time data).
diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/common/monitor/alerts/ViewAlertAction.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/common/monitor/alerts/ViewAlertAction.java index b3dbb3b..30454a7 100644 --- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/common/monitor/alerts/ViewAlertAction.java +++ b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/common/monitor/alerts/ViewAlertAction.java @@ -128,6 +128,8 @@ public class ViewAlertAction extends TilesAction { || (category == AlertConditionCategory.EVENT)) { // TODO: jmarques - add validation to make sure condition is a valid regex Pattern alertCondBean.setActualValue(condLog.getValue()); + } else if (category == AlertConditionCategory.TRAIT) { + alertCondBean.setActualValue(condLog.getValue()); } else { alertCondBean.setActualValue("??"); } diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/subsystem/SubsystemAlertHistoryUIBean.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/subsystem/SubsystemAlertHistoryUIBean.java index 208ab29..ca1cd5a 100644 --- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/subsystem/SubsystemAlertHistoryUIBean.java +++ b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/subsystem/SubsystemAlertHistoryUIBean.java @@ -223,7 +223,8 @@ public class SubsystemAlertHistoryUIBean extends SubsystemView {
String firedValue = log.getValue(); if (condition.getMeasurementDefinition() != null) { - if (condition.getMeasurementDefinition().getDataType()== DataType.CALLTIME) + DataType type = condition.getMeasurementDefinition().getDataType(); + if (type == DataType.CALLTIME || type == DataType.TRAIT) firedValue = log.getValue(); else firedValue = MeasurementConverter.format(Double.valueOf(log.getValue()), condition
commit 3beb63086a3e383b11b5de1f438cb5f7629ec1ec Author: Heiko W. Rupp hwr@redhat.com Date: Thu Jun 24 14:17:39 2010 +0200
If this is calltime data, fall back to show the raw codition log and don't try to parse a numeric value.
diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/subsystem/SubsystemAlertHistoryUIBean.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/subsystem/SubsystemAlertHistoryUIBean.java index 892b071..208ab29 100644 --- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/subsystem/SubsystemAlertHistoryUIBean.java +++ b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/subsystem/SubsystemAlertHistoryUIBean.java @@ -28,11 +28,13 @@ import javax.faces.model.DataModel; import javax.faces.model.SelectItem; import javax.servlet.http.HttpServletRequest;
+import org.rhq.core.db.DatabaseType; import org.rhq.core.domain.alert.AlertCondition; import org.rhq.core.domain.alert.AlertConditionCategory; import org.rhq.core.domain.alert.AlertConditionLog; import org.rhq.core.domain.alert.composite.AlertHistoryComposite; import org.rhq.core.domain.auth.Subject; +import org.rhq.core.domain.measurement.DataType; import org.rhq.core.domain.resource.Resource; import org.rhq.core.domain.util.PageControl; import org.rhq.core.domain.util.PageList; @@ -221,8 +223,11 @@ public class SubsystemAlertHistoryUIBean extends SubsystemView {
String firedValue = log.getValue(); if (condition.getMeasurementDefinition() != null) { - firedValue = MeasurementConverter.format(Double.valueOf(log.getValue()), condition - .getMeasurementDefinition().getUnits(), true); + if (condition.getMeasurementDefinition().getDataType()== DataType.CALLTIME) + firedValue = log.getValue(); + else + firedValue = MeasurementConverter.format(Double.valueOf(log.getValue()), condition + .getMeasurementDefinition().getUnits(), true); }
history.setConditionText(displayText);
commit 6dc2bab0cc29ff28f82b8a63cb6c4b07222ff17c Author: hudson auto wnstb@yahoo.com Date: Thu Jun 24 02:54:16 2010 -0400
[maven-release-plugin] prepare for next development iteration
diff --git a/modules/common/ant-bundle/pom.xml b/modules/common/ant-bundle/pom.xml index 6d440ef..eda9133 100644 --- a/modules/common/ant-bundle/pom.xml +++ b/modules/common/ant-bundle/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-common-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/common/filetemplate-bundle/pom.xml b/modules/common/filetemplate-bundle/pom.xml index dbd8dd6..bc7965b 100644 --- a/modules/common/filetemplate-bundle/pom.xml +++ b/modules/common/filetemplate-bundle/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-common-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/common/jboss-as/pom.xml b/modules/common/jboss-as/pom.xml index 1077987..2cf950b 100644 --- a/modules/common/jboss-as/pom.xml +++ b/modules/common/jboss-as/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-common-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/common/pom.xml b/modules/common/pom.xml index 751726e..ee81a94 100644 --- a/modules/common/pom.xml +++ b/modules/common/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/client-api/pom.xml b/modules/core/client-api/pom.xml index 78d1f23..d177f9e 100644 --- a/modules/core/client-api/pom.xml +++ b/modules/core/client-api/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/comm-api/pom.xml b/modules/core/comm-api/pom.xml index f6fadb5..a51f92b 100644 --- a/modules/core/comm-api/pom.xml +++ b/modules/core/comm-api/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/dbutils/pom.xml b/modules/core/dbutils/pom.xml index 84dd23f..92ae1d2 100644 --- a/modules/core/dbutils/pom.xml +++ b/modules/core/dbutils/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/domain/pom.xml b/modules/core/domain/pom.xml index 96cbc8e..e0ced84 100644 --- a/modules/core/domain/pom.xml +++ b/modules/core/domain/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/gui/pom.xml b/modules/core/gui/pom.xml index 0df3808..0911918 100644 --- a/modules/core/gui/pom.xml +++ b/modules/core/gui/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/native-system/pom.xml b/modules/core/native-system/pom.xml index 558b9a2..d47d4c8 100644 --- a/modules/core/native-system/pom.xml +++ b/modules/core/native-system/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/plugin-api/pom.xml b/modules/core/plugin-api/pom.xml index ba389df..e1ce7ef 100644 --- a/modules/core/plugin-api/pom.xml +++ b/modules/core/plugin-api/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/plugin-container/pom.xml b/modules/core/plugin-container/pom.xml index a570e19..2e58102 100644 --- a/modules/core/plugin-container/pom.xml +++ b/modules/core/plugin-container/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/plugin-validator/pom.xml b/modules/core/plugin-validator/pom.xml index c721f21..7739177 100644 --- a/modules/core/plugin-validator/pom.xml +++ b/modules/core/plugin-validator/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/plugindoc/pom.xml b/modules/core/plugindoc/pom.xml index 9e92634..eeb7e81 100644 --- a/modules/core/plugindoc/pom.xml +++ b/modules/core/plugindoc/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/pom.xml b/modules/core/pom.xml index 47cb583..7aad64c 100644 --- a/modules/core/pom.xml +++ b/modules/core/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/util/pom.xml b/modules/core/util/pom.xml index cee7efe..bc41dc5 100644 --- a/modules/core/util/pom.xml +++ b/modules/core/util/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/agent/pom.xml b/modules/enterprise/agent/pom.xml index f917e15..d9f1c1c 100644 --- a/modules/enterprise/agent/pom.xml +++ b/modules/enterprise/agent/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/agentupdate/pom.xml b/modules/enterprise/agentupdate/pom.xml index c569283..8942239 100644 --- a/modules/enterprise/agentupdate/pom.xml +++ b/modules/enterprise/agentupdate/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/comm/pom.xml b/modules/enterprise/comm/pom.xml index 88ef26e..8b9da9c 100644 --- a/modules/enterprise/comm/pom.xml +++ b/modules/enterprise/comm/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/base-perspective-jar/pom.xml b/modules/enterprise/gui/base-perspective-jar/pom.xml index 6a09d32..611eb9d 100644 --- a/modules/enterprise/gui/base-perspective-jar/pom.xml +++ b/modules/enterprise/gui/base-perspective-jar/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/base-perspective-war/pom.xml b/modules/enterprise/gui/base-perspective-war/pom.xml index 643d41e..798a8ca 100644 --- a/modules/enterprise/gui/base-perspective-war/pom.xml +++ b/modules/enterprise/gui/base-perspective-war/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/content_http-war/pom.xml b/modules/enterprise/gui/content_http-war/pom.xml index 3068b31..df05645 100644 --- a/modules/enterprise/gui/content_http-war/pom.xml +++ b/modules/enterprise/gui/content_http-war/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-gui-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/coregui/pom.xml b/modules/enterprise/gui/coregui/pom.xml index 6cd8f92..ca1b68d 100644 --- a/modules/enterprise/gui/coregui/pom.xml +++ b/modules/enterprise/gui/coregui/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/installer-war/pom.xml b/modules/enterprise/gui/installer-war/pom.xml index e908b75..1beadca 100644 --- a/modules/enterprise/gui/installer-war/pom.xml +++ b/modules/enterprise/gui/installer-war/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/pom.xml b/modules/enterprise/gui/pom.xml index f01ec85..0c529ba 100644 --- a/modules/enterprise/gui/pom.xml +++ b/modules/enterprise/gui/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/portal-war/pom.xml b/modules/enterprise/gui/portal-war/pom.xml index a3e6434..783942c 100644 --- a/modules/enterprise/gui/portal-war/pom.xml +++ b/modules/enterprise/gui/portal-war/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/webdav-war/pom.xml b/modules/enterprise/gui/webdav-war/pom.xml index bdef75c..aa880be 100644 --- a/modules/enterprise/gui/webdav-war/pom.xml +++ b/modules/enterprise/gui/webdav-war/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/pom.xml b/modules/enterprise/pom.xml index c3fc4fa..3b0dbb8 100644 --- a/modules/enterprise/pom.xml +++ b/modules/enterprise/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/remoting/cli/pom.xml b/modules/enterprise/remoting/cli/pom.xml index 5e0a013..33966bd 100644 --- a/modules/enterprise/remoting/cli/pom.xml +++ b/modules/enterprise/remoting/cli/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<artifactId>rhq-remoting-cli</artifactId> diff --git a/modules/enterprise/remoting/client-api/pom.xml b/modules/enterprise/remoting/client-api/pom.xml index 57e79e7..605267f 100644 --- a/modules/enterprise/remoting/client-api/pom.xml +++ b/modules/enterprise/remoting/client-api/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<artifactId>rhq-remoting-client-api</artifactId> diff --git a/modules/enterprise/remoting/pom.xml b/modules/enterprise/remoting/pom.xml index 1feb631..910b617 100644 --- a/modules/enterprise/remoting/pom.xml +++ b/modules/enterprise/remoting/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<artifactId>rhq-remoting-parent</artifactId> diff --git a/modules/enterprise/remoting/webservices/pom.xml b/modules/enterprise/remoting/webservices/pom.xml index a4d9ed6..2ea73ee 100644 --- a/modules/enterprise/remoting/webservices/pom.xml +++ b/modules/enterprise/remoting/webservices/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<artifactId>rhq-remoting-webservices</artifactId> diff --git a/modules/enterprise/server/container-lib/pom.xml b/modules/enterprise/server/container-lib/pom.xml index c2acfe1..2c98817 100644 --- a/modules/enterprise/server/container-lib/pom.xml +++ b/modules/enterprise/server/container-lib/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/container/pom.xml b/modules/enterprise/server/container/pom.xml index aee0070..3fd11e8 100644 --- a/modules/enterprise/server/container/pom.xml +++ b/modules/enterprise/server/container/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/ear/pom.xml b/modules/enterprise/server/ear/pom.xml index 6956e3c..bf15866 100644 --- a/modules/enterprise/server/ear/pom.xml +++ b/modules/enterprise/server/ear/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/jar/pom.xml b/modules/enterprise/server/jar/pom.xml index 4f2650b..9e7bb24 100644 --- a/modules/enterprise/server/jar/pom.xml +++ b/modules/enterprise/server/jar/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/alert-email/pom.xml b/modules/enterprise/server/plugins/alert-email/pom.xml index b05532d..dd5bc18 100644 --- a/modules/enterprise/server/plugins/alert-email/pom.xml +++ b/modules/enterprise/server/plugins/alert-email/pom.xml @@ -3,7 +3,7 @@ <parent> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent> <modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-irc/pom.xml b/modules/enterprise/server/plugins/alert-irc/pom.xml index 988e2e3..c0973f3 100644 --- a/modules/enterprise/server/plugins/alert-irc/pom.xml +++ b/modules/enterprise/server/plugins/alert-irc/pom.xml @@ -3,7 +3,7 @@ <parent> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent> <modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-microblog/pom.xml b/modules/enterprise/server/plugins/alert-microblog/pom.xml index b9f3d0c..a62fee8 100644 --- a/modules/enterprise/server/plugins/alert-microblog/pom.xml +++ b/modules/enterprise/server/plugins/alert-microblog/pom.xml @@ -3,7 +3,7 @@ <parent> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent> <modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-mobicents/pom.xml b/modules/enterprise/server/plugins/alert-mobicents/pom.xml index 8a0c7c9..3193539 100644 --- a/modules/enterprise/server/plugins/alert-mobicents/pom.xml +++ b/modules/enterprise/server/plugins/alert-mobicents/pom.xml @@ -3,7 +3,7 @@ <parent> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent> <modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-operations/pom.xml b/modules/enterprise/server/plugins/alert-operations/pom.xml index bf7fe01..e69bfbc 100644 --- a/modules/enterprise/server/plugins/alert-operations/pom.xml +++ b/modules/enterprise/server/plugins/alert-operations/pom.xml @@ -2,7 +2,7 @@ <parent> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent> <modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-roles/pom.xml b/modules/enterprise/server/plugins/alert-roles/pom.xml index 466b99a..ca33bb7 100644 --- a/modules/enterprise/server/plugins/alert-roles/pom.xml +++ b/modules/enterprise/server/plugins/alert-roles/pom.xml @@ -3,7 +3,7 @@ <parent> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent> <modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-snmp/pom.xml b/modules/enterprise/server/plugins/alert-snmp/pom.xml index b743122..af75153 100644 --- a/modules/enterprise/server/plugins/alert-snmp/pom.xml +++ b/modules/enterprise/server/plugins/alert-snmp/pom.xml @@ -3,7 +3,7 @@ <parent> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent> <modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-subject/pom.xml b/modules/enterprise/server/plugins/alert-subject/pom.xml index 97c50f4..09839b8 100644 --- a/modules/enterprise/server/plugins/alert-subject/pom.xml +++ b/modules/enterprise/server/plugins/alert-subject/pom.xml @@ -3,7 +3,7 @@ <parent> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent> <modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/ant-bundle/pom.xml b/modules/enterprise/server/plugins/ant-bundle/pom.xml index 8abb60d..73f405e 100644 --- a/modules/enterprise/server/plugins/ant-bundle/pom.xml +++ b/modules/enterprise/server/plugins/ant-bundle/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/cobbler/pom.xml b/modules/enterprise/server/plugins/cobbler/pom.xml index ce9b430..4c44f10 100644 --- a/modules/enterprise/server/plugins/cobbler/pom.xml +++ b/modules/enterprise/server/plugins/cobbler/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<modelVersion>4.0.0</modelVersion> diff --git a/modules/enterprise/server/plugins/disk/pom.xml b/modules/enterprise/server/plugins/disk/pom.xml index 86a21ef..0033d1b 100644 --- a/modules/enterprise/server/plugins/disk/pom.xml +++ b/modules/enterprise/server/plugins/disk/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml b/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml index b83824c..61965f2 100644 --- a/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml +++ b/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/jboss-software/pom.xml b/modules/enterprise/server/plugins/jboss-software/pom.xml index b8bba65..7451668 100644 --- a/modules/enterprise/server/plugins/jboss-software/pom.xml +++ b/modules/enterprise/server/plugins/jboss-software/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml b/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml index a53f3ad..0ac61d3 100644 --- a/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml +++ b/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml @@ -7,7 +7,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/perspectives/core/pom.xml b/modules/enterprise/server/plugins/perspectives/core/pom.xml index ab30954..5a78451 100644 --- a/modules/enterprise/server/plugins/perspectives/core/pom.xml +++ b/modules/enterprise/server/plugins/perspectives/core/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/pom.xml b/modules/enterprise/server/plugins/pom.xml index 8b6a170..2b16f4a 100644 --- a/modules/enterprise/server/plugins/pom.xml +++ b/modules/enterprise/server/plugins/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/rhnhosted/pom.xml b/modules/enterprise/server/plugins/rhnhosted/pom.xml index 9a96ab0..e4ab9b2 100644 --- a/modules/enterprise/server/plugins/rhnhosted/pom.xml +++ b/modules/enterprise/server/plugins/rhnhosted/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/url/pom.xml b/modules/enterprise/server/plugins/url/pom.xml index 3a96e6d..a6cba32 100644 --- a/modules/enterprise/server/plugins/url/pom.xml +++ b/modules/enterprise/server/plugins/url/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml b/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml index 8bcdcea..9c7cc74 100644 --- a/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml +++ b/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/yum/pom.xml b/modules/enterprise/server/plugins/yum/pom.xml index 2dce331..ebdd3da 100644 --- a/modules/enterprise/server/plugins/yum/pom.xml +++ b/modules/enterprise/server/plugins/yum/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/safe-invoker/pom.xml b/modules/enterprise/server/safe-invoker/pom.xml index 3fd87f6..06c8981 100644 --- a/modules/enterprise/server/safe-invoker/pom.xml +++ b/modules/enterprise/server/safe-invoker/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/sars/agent-sar/pom.xml b/modules/enterprise/server/sars/agent-sar/pom.xml index 7ecbbad..aa278b8 100644 --- a/modules/enterprise/server/sars/agent-sar/pom.xml +++ b/modules/enterprise/server/sars/agent-sar/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-sars-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/sars/pom.xml b/modules/enterprise/server/sars/pom.xml index cadb656..0cc2084 100644 --- a/modules/enterprise/server/sars/pom.xml +++ b/modules/enterprise/server/sars/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/xml-schemas/pom.xml b/modules/enterprise/server/xml-schemas/pom.xml index 8df64c1..14738d0 100644 --- a/modules/enterprise/server/xml-schemas/pom.xml +++ b/modules/enterprise/server/xml-schemas/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/helpers/pluginAnnotations/pom.xml b/modules/helpers/pluginAnnotations/pom.xml index 031c90d..d056f74 100644 --- a/modules/helpers/pluginAnnotations/pom.xml +++ b/modules/helpers/pluginAnnotations/pom.xml @@ -6,7 +6,7 @@ <parent> <groupId>org.rhq.helpers</groupId> <artifactId>rhq-helpers</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq.helpers</groupId> diff --git a/modules/helpers/pluginGen/pom.xml b/modules/helpers/pluginGen/pom.xml index ba37942..28dc9b1 100644 --- a/modules/helpers/pluginGen/pom.xml +++ b/modules/helpers/pluginGen/pom.xml @@ -6,7 +6,7 @@ <parent> <groupId>org.rhq.helpers</groupId> <artifactId>rhq-helpers</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq.helpers</groupId> diff --git a/modules/helpers/pom.xml b/modules/helpers/pom.xml index 762f318..a0721a9 100644 --- a/modules/helpers/pom.xml +++ b/modules/helpers/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq.helpers</groupId> diff --git a/modules/helpers/rtfilter/pom.xml b/modules/helpers/rtfilter/pom.xml index e17c9d8..5d327ee 100644 --- a/modules/helpers/rtfilter/pom.xml +++ b/modules/helpers/rtfilter/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq.helpers</groupId> <artifactId>rhq-helpers</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/aliases/pom.xml b/modules/plugins/aliases/pom.xml index 7006ed8..c37598e 100644 --- a/modules/plugins/aliases/pom.xml +++ b/modules/plugins/aliases/pom.xml @@ -7,7 +7,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/ant-bundle/pom.xml b/modules/plugins/ant-bundle/pom.xml index 851c129..cc160c9 100644 --- a/modules/plugins/ant-bundle/pom.xml +++ b/modules/plugins/ant-bundle/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/apache/pom.xml b/modules/plugins/apache/pom.xml index f2682e9..b4f9208 100644 --- a/modules/plugins/apache/pom.xml +++ b/modules/plugins/apache/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/augeas/pom.xml b/modules/plugins/augeas/pom.xml index 48651cb..963223b 100644 --- a/modules/plugins/augeas/pom.xml +++ b/modules/plugins/augeas/pom.xml @@ -7,7 +7,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/cobbler/pom.xml b/modules/plugins/cobbler/pom.xml index 1e8011a..d920440 100644 --- a/modules/plugins/cobbler/pom.xml +++ b/modules/plugins/cobbler/pom.xml @@ -7,7 +7,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/cron/pom.xml b/modules/plugins/cron/pom.xml index 6ee0662..d5aaad5 100644 --- a/modules/plugins/cron/pom.xml +++ b/modules/plugins/cron/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/database/pom.xml b/modules/plugins/database/pom.xml index 7d98f84..30889f7 100644 --- a/modules/plugins/database/pom.xml +++ b/modules/plugins/database/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/filetemplate-bundle/pom.xml b/modules/plugins/filetemplate-bundle/pom.xml index 05ac956..b79645d 100644 --- a/modules/plugins/filetemplate-bundle/pom.xml +++ b/modules/plugins/filetemplate-bundle/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/grub/pom.xml b/modules/plugins/grub/pom.xml index 1c68b9b..f7cf265 100644 --- a/modules/plugins/grub/pom.xml +++ b/modules/plugins/grub/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/hibernate/pom.xml b/modules/plugins/hibernate/pom.xml index 35fd599..acb08ef 100644 --- a/modules/plugins/hibernate/pom.xml +++ b/modules/plugins/hibernate/pom.xml @@ -6,7 +6,7 @@ <groupId>org.rhq</groupId> <!-- Bypass the jopr-plugins-parent which can not have children. It must build after the plugins in order to execute integration tests on them. --> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.jboss.on</groupId> diff --git a/modules/plugins/hosts/pom.xml b/modules/plugins/hosts/pom.xml index eddd3ed..7dd0fde 100644 --- a/modules/plugins/hosts/pom.xml +++ b/modules/plugins/hosts/pom.xml @@ -7,7 +7,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/hudson/pom.xml b/modules/plugins/hudson/pom.xml index 5d79625..65fa7b8 100644 --- a/modules/plugins/hudson/pom.xml +++ b/modules/plugins/hudson/pom.xml @@ -6,7 +6,7 @@ <parent> <artifactId>rhq-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/iis/pom.xml b/modules/plugins/iis/pom.xml index 7e17c2b..853c020 100644 --- a/modules/plugins/iis/pom.xml +++ b/modules/plugins/iis/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/jboss-as-5/pom.xml b/modules/plugins/jboss-as-5/pom.xml index ceb58be..a0ade77 100644 --- a/modules/plugins/jboss-as-5/pom.xml +++ b/modules/plugins/jboss-as-5/pom.xml @@ -9,7 +9,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.jboss.on</groupId> diff --git a/modules/plugins/jboss-as/pom.xml b/modules/plugins/jboss-as/pom.xml index 54536d9..b9ed2b3 100644 --- a/modules/plugins/jboss-as/pom.xml +++ b/modules/plugins/jboss-as/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.jboss.on</groupId> diff --git a/modules/plugins/jboss-cache-v3/pom.xml b/modules/plugins/jboss-cache-v3/pom.xml index f276b7d..b3846fa 100644 --- a/modules/plugins/jboss-cache-v3/pom.xml +++ b/modules/plugins/jboss-cache-v3/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.jboss.on</groupId> diff --git a/modules/plugins/jboss-cache/pom.xml b/modules/plugins/jboss-cache/pom.xml index f1aa8f9..443e524 100644 --- a/modules/plugins/jboss-cache/pom.xml +++ b/modules/plugins/jboss-cache/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.jboss.on</groupId> diff --git a/modules/plugins/jmx/pom.xml b/modules/plugins/jmx/pom.xml index 6bc1bfa..ac9885a 100644 --- a/modules/plugins/jmx/pom.xml +++ b/modules/plugins/jmx/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/mysql/pom.xml b/modules/plugins/mysql/pom.xml index e488d56..d0c9053 100644 --- a/modules/plugins/mysql/pom.xml +++ b/modules/plugins/mysql/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/netservices/pom.xml b/modules/plugins/netservices/pom.xml index 37d84af..06ae2ae 100644 --- a/modules/plugins/netservices/pom.xml +++ b/modules/plugins/netservices/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/oracle/pom.xml b/modules/plugins/oracle/pom.xml index 75a1aff..1acdb0f 100644 --- a/modules/plugins/oracle/pom.xml +++ b/modules/plugins/oracle/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/perftest/pom.xml b/modules/plugins/perftest/pom.xml index 4e78da5..39c75da 100644 --- a/modules/plugins/perftest/pom.xml +++ b/modules/plugins/perftest/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/platform/pom.xml b/modules/plugins/platform/pom.xml index 87ba78d..97b83b0 100644 --- a/modules/plugins/platform/pom.xml +++ b/modules/plugins/platform/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/pom.xml b/modules/plugins/pom.xml index 4873dae..85d6105 100644 --- a/modules/plugins/pom.xml +++ b/modules/plugins/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/postfix/pom.xml b/modules/plugins/postfix/pom.xml index 1e95ca3..283ab6a 100644 --- a/modules/plugins/postfix/pom.xml +++ b/modules/plugins/postfix/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/postgres/pom.xml b/modules/plugins/postgres/pom.xml index daf3133..5a4466c 100644 --- a/modules/plugins/postgres/pom.xml +++ b/modules/plugins/postgres/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/rhq-agent/pom.xml b/modules/plugins/rhq-agent/pom.xml index b0c26a5..a190dcd 100644 --- a/modules/plugins/rhq-agent/pom.xml +++ b/modules/plugins/rhq-agent/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/rhq-server/pom.xml b/modules/plugins/rhq-server/pom.xml index 98333bb..8f4e675 100644 --- a/modules/plugins/rhq-server/pom.xml +++ b/modules/plugins/rhq-server/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.jboss.on</groupId> diff --git a/modules/plugins/samba/pom.xml b/modules/plugins/samba/pom.xml index d0d0d63..0d41574 100644 --- a/modules/plugins/samba/pom.xml +++ b/modules/plugins/samba/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/script/pom.xml b/modules/plugins/script/pom.xml index 7189f74..7719b14 100644 --- a/modules/plugins/script/pom.xml +++ b/modules/plugins/script/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/snmptrapd/pom.xml b/modules/plugins/snmptrapd/pom.xml index fdb421d..2d9d715 100644 --- a/modules/plugins/snmptrapd/pom.xml +++ b/modules/plugins/snmptrapd/pom.xml @@ -2,7 +2,7 @@ <parent> <artifactId>rhq-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<modelVersion>4.0.0</modelVersion> diff --git a/modules/plugins/sshd/pom.xml b/modules/plugins/sshd/pom.xml index 9c38247..3579496 100644 --- a/modules/plugins/sshd/pom.xml +++ b/modules/plugins/sshd/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/sudoers/pom.xml b/modules/plugins/sudoers/pom.xml index 7932012..41df1b8 100644 --- a/modules/plugins/sudoers/pom.xml +++ b/modules/plugins/sudoers/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/tomcat/pom.xml b/modules/plugins/tomcat/pom.xml index 03e2df8..205d5b0 100644 --- a/modules/plugins/tomcat/pom.xml +++ b/modules/plugins/tomcat/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.jboss.on</groupId> diff --git a/modules/plugins/twitter/pom.xml b/modules/plugins/twitter/pom.xml index cab4269..e299efa 100644 --- a/modules/plugins/twitter/pom.xml +++ b/modules/plugins/twitter/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/validate-all-plugins/pom.xml b/modules/plugins/validate-all-plugins/pom.xml index 4f886fd..b3d5e87 100644 --- a/modules/plugins/validate-all-plugins/pom.xml +++ b/modules/plugins/validate-all-plugins/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/pom.xml b/modules/pom.xml index 9a28ce8..bc96ae3 100644 --- a/modules/pom.xml +++ b/modules/pom.xml @@ -6,7 +6,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/test-utils/pom.xml b/modules/test-utils/pom.xml index 07130df..2235687 100644 --- a/modules/test-utils/pom.xml +++ b/modules/test-utils/pom.xml @@ -4,7 +4,7 @@ <parent> <artifactId>rhq-modules-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> </parent> <artifactId>test-utils</artifactId> <name>RHQ Test Utils</name> diff --git a/pom.xml b/pom.xml index efc840d..95b0dc6 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@
<groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0.GA_QA</version> + <version>3.0.0-SNAPSHOT</version> <packaging>pom</packaging>
<name>RHQ</name>
commit 647a602bece9c1fae7c083d600a314914245bfe7 Author: hudson auto wnstb@yahoo.com Date: Thu Jun 24 02:53:18 2010 -0400
[maven-release-plugin] prepare release RHQ_3_0_0_GA_QA
diff --git a/modules/common/ant-bundle/pom.xml b/modules/common/ant-bundle/pom.xml index eda9133..6d440ef 100644 --- a/modules/common/ant-bundle/pom.xml +++ b/modules/common/ant-bundle/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-common-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/common/filetemplate-bundle/pom.xml b/modules/common/filetemplate-bundle/pom.xml index bc7965b..dbd8dd6 100644 --- a/modules/common/filetemplate-bundle/pom.xml +++ b/modules/common/filetemplate-bundle/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-common-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/common/jboss-as/pom.xml b/modules/common/jboss-as/pom.xml index 2cf950b..1077987 100644 --- a/modules/common/jboss-as/pom.xml +++ b/modules/common/jboss-as/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-common-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/common/pom.xml b/modules/common/pom.xml index ee81a94..751726e 100644 --- a/modules/common/pom.xml +++ b/modules/common/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/client-api/pom.xml b/modules/core/client-api/pom.xml index d177f9e..78d1f23 100644 --- a/modules/core/client-api/pom.xml +++ b/modules/core/client-api/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/comm-api/pom.xml b/modules/core/comm-api/pom.xml index a51f92b..f6fadb5 100644 --- a/modules/core/comm-api/pom.xml +++ b/modules/core/comm-api/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/dbutils/pom.xml b/modules/core/dbutils/pom.xml index 92ae1d2..84dd23f 100644 --- a/modules/core/dbutils/pom.xml +++ b/modules/core/dbutils/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/domain/pom.xml b/modules/core/domain/pom.xml index e0ced84..96cbc8e 100644 --- a/modules/core/domain/pom.xml +++ b/modules/core/domain/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/gui/pom.xml b/modules/core/gui/pom.xml index 0911918..0df3808 100644 --- a/modules/core/gui/pom.xml +++ b/modules/core/gui/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/native-system/pom.xml b/modules/core/native-system/pom.xml index d47d4c8..558b9a2 100644 --- a/modules/core/native-system/pom.xml +++ b/modules/core/native-system/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/plugin-api/pom.xml b/modules/core/plugin-api/pom.xml index e1ce7ef..ba389df 100644 --- a/modules/core/plugin-api/pom.xml +++ b/modules/core/plugin-api/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/plugin-container/pom.xml b/modules/core/plugin-container/pom.xml index 2e58102..a570e19 100644 --- a/modules/core/plugin-container/pom.xml +++ b/modules/core/plugin-container/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/plugin-validator/pom.xml b/modules/core/plugin-validator/pom.xml index 7739177..c721f21 100644 --- a/modules/core/plugin-validator/pom.xml +++ b/modules/core/plugin-validator/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/plugindoc/pom.xml b/modules/core/plugindoc/pom.xml index eeb7e81..9e92634 100644 --- a/modules/core/plugindoc/pom.xml +++ b/modules/core/plugindoc/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/pom.xml b/modules/core/pom.xml index 7aad64c..47cb583 100644 --- a/modules/core/pom.xml +++ b/modules/core/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/core/util/pom.xml b/modules/core/util/pom.xml index bc41dc5..cee7efe 100644 --- a/modules/core/util/pom.xml +++ b/modules/core/util/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-core-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/agent/pom.xml b/modules/enterprise/agent/pom.xml index d9f1c1c..f917e15 100644 --- a/modules/enterprise/agent/pom.xml +++ b/modules/enterprise/agent/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/agentupdate/pom.xml b/modules/enterprise/agentupdate/pom.xml index 8942239..c569283 100644 --- a/modules/enterprise/agentupdate/pom.xml +++ b/modules/enterprise/agentupdate/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/comm/pom.xml b/modules/enterprise/comm/pom.xml index 8b9da9c..88ef26e 100644 --- a/modules/enterprise/comm/pom.xml +++ b/modules/enterprise/comm/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/base-perspective-jar/pom.xml b/modules/enterprise/gui/base-perspective-jar/pom.xml index 611eb9d..6a09d32 100644 --- a/modules/enterprise/gui/base-perspective-jar/pom.xml +++ b/modules/enterprise/gui/base-perspective-jar/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/base-perspective-war/pom.xml b/modules/enterprise/gui/base-perspective-war/pom.xml index 798a8ca..643d41e 100644 --- a/modules/enterprise/gui/base-perspective-war/pom.xml +++ b/modules/enterprise/gui/base-perspective-war/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/content_http-war/pom.xml b/modules/enterprise/gui/content_http-war/pom.xml index df05645..3068b31 100644 --- a/modules/enterprise/gui/content_http-war/pom.xml +++ b/modules/enterprise/gui/content_http-war/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-gui-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/coregui/pom.xml b/modules/enterprise/gui/coregui/pom.xml index ca1b68d..6cd8f92 100644 --- a/modules/enterprise/gui/coregui/pom.xml +++ b/modules/enterprise/gui/coregui/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/installer-war/pom.xml b/modules/enterprise/gui/installer-war/pom.xml index 1beadca..e908b75 100644 --- a/modules/enterprise/gui/installer-war/pom.xml +++ b/modules/enterprise/gui/installer-war/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/pom.xml b/modules/enterprise/gui/pom.xml index 0c529ba..f01ec85 100644 --- a/modules/enterprise/gui/pom.xml +++ b/modules/enterprise/gui/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/portal-war/pom.xml b/modules/enterprise/gui/portal-war/pom.xml index 783942c..a3e6434 100644 --- a/modules/enterprise/gui/portal-war/pom.xml +++ b/modules/enterprise/gui/portal-war/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/gui/webdav-war/pom.xml b/modules/enterprise/gui/webdav-war/pom.xml index aa880be..bdef75c 100644 --- a/modules/enterprise/gui/webdav-war/pom.xml +++ b/modules/enterprise/gui/webdav-war/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/pom.xml b/modules/enterprise/pom.xml index 3b0dbb8..c3fc4fa 100644 --- a/modules/enterprise/pom.xml +++ b/modules/enterprise/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/remoting/cli/pom.xml b/modules/enterprise/remoting/cli/pom.xml index 33966bd..5e0a013 100644 --- a/modules/enterprise/remoting/cli/pom.xml +++ b/modules/enterprise/remoting/cli/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<artifactId>rhq-remoting-cli</artifactId> diff --git a/modules/enterprise/remoting/client-api/pom.xml b/modules/enterprise/remoting/client-api/pom.xml index 605267f..57e79e7 100644 --- a/modules/enterprise/remoting/client-api/pom.xml +++ b/modules/enterprise/remoting/client-api/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<artifactId>rhq-remoting-client-api</artifactId> diff --git a/modules/enterprise/remoting/pom.xml b/modules/enterprise/remoting/pom.xml index 910b617..1feb631 100644 --- a/modules/enterprise/remoting/pom.xml +++ b/modules/enterprise/remoting/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<artifactId>rhq-remoting-parent</artifactId> diff --git a/modules/enterprise/remoting/webservices/pom.xml b/modules/enterprise/remoting/webservices/pom.xml index 2ea73ee..a4d9ed6 100644 --- a/modules/enterprise/remoting/webservices/pom.xml +++ b/modules/enterprise/remoting/webservices/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<artifactId>rhq-remoting-webservices</artifactId> diff --git a/modules/enterprise/server/container-lib/pom.xml b/modules/enterprise/server/container-lib/pom.xml index 2c98817..c2acfe1 100644 --- a/modules/enterprise/server/container-lib/pom.xml +++ b/modules/enterprise/server/container-lib/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/container/pom.xml b/modules/enterprise/server/container/pom.xml index 3fd11e8..aee0070 100644 --- a/modules/enterprise/server/container/pom.xml +++ b/modules/enterprise/server/container/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/ear/pom.xml b/modules/enterprise/server/ear/pom.xml index bf15866..6956e3c 100644 --- a/modules/enterprise/server/ear/pom.xml +++ b/modules/enterprise/server/ear/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/jar/pom.xml b/modules/enterprise/server/jar/pom.xml index 9e7bb24..4f2650b 100644 --- a/modules/enterprise/server/jar/pom.xml +++ b/modules/enterprise/server/jar/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/alert-email/pom.xml b/modules/enterprise/server/plugins/alert-email/pom.xml index dd5bc18..b05532d 100644 --- a/modules/enterprise/server/plugins/alert-email/pom.xml +++ b/modules/enterprise/server/plugins/alert-email/pom.xml @@ -3,7 +3,7 @@ <parent> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent> <modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-irc/pom.xml b/modules/enterprise/server/plugins/alert-irc/pom.xml index c0973f3..988e2e3 100644 --- a/modules/enterprise/server/plugins/alert-irc/pom.xml +++ b/modules/enterprise/server/plugins/alert-irc/pom.xml @@ -3,7 +3,7 @@ <parent> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent> <modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-microblog/pom.xml b/modules/enterprise/server/plugins/alert-microblog/pom.xml index a62fee8..b9f3d0c 100644 --- a/modules/enterprise/server/plugins/alert-microblog/pom.xml +++ b/modules/enterprise/server/plugins/alert-microblog/pom.xml @@ -3,7 +3,7 @@ <parent> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent> <modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-mobicents/pom.xml b/modules/enterprise/server/plugins/alert-mobicents/pom.xml index 3193539..8a0c7c9 100644 --- a/modules/enterprise/server/plugins/alert-mobicents/pom.xml +++ b/modules/enterprise/server/plugins/alert-mobicents/pom.xml @@ -3,7 +3,7 @@ <parent> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent> <modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-operations/pom.xml b/modules/enterprise/server/plugins/alert-operations/pom.xml index e69bfbc..bf7fe01 100644 --- a/modules/enterprise/server/plugins/alert-operations/pom.xml +++ b/modules/enterprise/server/plugins/alert-operations/pom.xml @@ -2,7 +2,7 @@ <parent> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent> <modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-roles/pom.xml b/modules/enterprise/server/plugins/alert-roles/pom.xml index ca33bb7..466b99a 100644 --- a/modules/enterprise/server/plugins/alert-roles/pom.xml +++ b/modules/enterprise/server/plugins/alert-roles/pom.xml @@ -3,7 +3,7 @@ <parent> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent> <modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-snmp/pom.xml b/modules/enterprise/server/plugins/alert-snmp/pom.xml index af75153..b743122 100644 --- a/modules/enterprise/server/plugins/alert-snmp/pom.xml +++ b/modules/enterprise/server/plugins/alert-snmp/pom.xml @@ -3,7 +3,7 @@ <parent> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent> <modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/alert-subject/pom.xml b/modules/enterprise/server/plugins/alert-subject/pom.xml index 09839b8..97c50f4 100644 --- a/modules/enterprise/server/plugins/alert-subject/pom.xml +++ b/modules/enterprise/server/plugins/alert-subject/pom.xml @@ -3,7 +3,7 @@ <parent> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent> <modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/ant-bundle/pom.xml b/modules/enterprise/server/plugins/ant-bundle/pom.xml index 73f405e..8abb60d 100644 --- a/modules/enterprise/server/plugins/ant-bundle/pom.xml +++ b/modules/enterprise/server/plugins/ant-bundle/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/cobbler/pom.xml b/modules/enterprise/server/plugins/cobbler/pom.xml index 4c44f10..ce9b430 100644 --- a/modules/enterprise/server/plugins/cobbler/pom.xml +++ b/modules/enterprise/server/plugins/cobbler/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<modelVersion>4.0.0</modelVersion> diff --git a/modules/enterprise/server/plugins/disk/pom.xml b/modules/enterprise/server/plugins/disk/pom.xml index 0033d1b..86a21ef 100644 --- a/modules/enterprise/server/plugins/disk/pom.xml +++ b/modules/enterprise/server/plugins/disk/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml b/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml index 61965f2..b83824c 100644 --- a/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml +++ b/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/jboss-software/pom.xml b/modules/enterprise/server/plugins/jboss-software/pom.xml index 7451668..b8bba65 100644 --- a/modules/enterprise/server/plugins/jboss-software/pom.xml +++ b/modules/enterprise/server/plugins/jboss-software/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml b/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml index 0ac61d3..a53f3ad 100644 --- a/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml +++ b/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml @@ -7,7 +7,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/perspectives/core/pom.xml b/modules/enterprise/server/plugins/perspectives/core/pom.xml index 5a78451..ab30954 100644 --- a/modules/enterprise/server/plugins/perspectives/core/pom.xml +++ b/modules/enterprise/server/plugins/perspectives/core/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/pom.xml b/modules/enterprise/server/plugins/pom.xml index 2b16f4a..8b6a170 100644 --- a/modules/enterprise/server/plugins/pom.xml +++ b/modules/enterprise/server/plugins/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/rhnhosted/pom.xml b/modules/enterprise/server/plugins/rhnhosted/pom.xml index e4ab9b2..9a96ab0 100644 --- a/modules/enterprise/server/plugins/rhnhosted/pom.xml +++ b/modules/enterprise/server/plugins/rhnhosted/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/url/pom.xml b/modules/enterprise/server/plugins/url/pom.xml index a6cba32..3a96e6d 100644 --- a/modules/enterprise/server/plugins/url/pom.xml +++ b/modules/enterprise/server/plugins/url/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml b/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml index 9c7cc74..8bcdcea 100644 --- a/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml +++ b/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/plugins/yum/pom.xml b/modules/enterprise/server/plugins/yum/pom.xml index ebdd3da..2dce331 100644 --- a/modules/enterprise/server/plugins/yum/pom.xml +++ b/modules/enterprise/server/plugins/yum/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/safe-invoker/pom.xml b/modules/enterprise/server/safe-invoker/pom.xml index 06c8981..3fd87f6 100644 --- a/modules/enterprise/server/safe-invoker/pom.xml +++ b/modules/enterprise/server/safe-invoker/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/sars/agent-sar/pom.xml b/modules/enterprise/server/sars/agent-sar/pom.xml index aa278b8..7ecbbad 100644 --- a/modules/enterprise/server/sars/agent-sar/pom.xml +++ b/modules/enterprise/server/sars/agent-sar/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-enterprise-server-sars-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/sars/pom.xml b/modules/enterprise/server/sars/pom.xml index 0cc2084..cadb656 100644 --- a/modules/enterprise/server/sars/pom.xml +++ b/modules/enterprise/server/sars/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/enterprise/server/xml-schemas/pom.xml b/modules/enterprise/server/xml-schemas/pom.xml index 14738d0..8df64c1 100644 --- a/modules/enterprise/server/xml-schemas/pom.xml +++ b/modules/enterprise/server/xml-schemas/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/helpers/pluginAnnotations/pom.xml b/modules/helpers/pluginAnnotations/pom.xml index d056f74..031c90d 100644 --- a/modules/helpers/pluginAnnotations/pom.xml +++ b/modules/helpers/pluginAnnotations/pom.xml @@ -6,7 +6,7 @@ <parent> <groupId>org.rhq.helpers</groupId> <artifactId>rhq-helpers</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq.helpers</groupId> diff --git a/modules/helpers/pluginGen/pom.xml b/modules/helpers/pluginGen/pom.xml index 28dc9b1..ba37942 100644 --- a/modules/helpers/pluginGen/pom.xml +++ b/modules/helpers/pluginGen/pom.xml @@ -6,7 +6,7 @@ <parent> <groupId>org.rhq.helpers</groupId> <artifactId>rhq-helpers</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq.helpers</groupId> diff --git a/modules/helpers/pom.xml b/modules/helpers/pom.xml index a0721a9..762f318 100644 --- a/modules/helpers/pom.xml +++ b/modules/helpers/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq.helpers</groupId> diff --git a/modules/helpers/rtfilter/pom.xml b/modules/helpers/rtfilter/pom.xml index 5d327ee..e17c9d8 100644 --- a/modules/helpers/rtfilter/pom.xml +++ b/modules/helpers/rtfilter/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq.helpers</groupId> <artifactId>rhq-helpers</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/aliases/pom.xml b/modules/plugins/aliases/pom.xml index c37598e..7006ed8 100644 --- a/modules/plugins/aliases/pom.xml +++ b/modules/plugins/aliases/pom.xml @@ -7,7 +7,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/ant-bundle/pom.xml b/modules/plugins/ant-bundle/pom.xml index cc160c9..851c129 100644 --- a/modules/plugins/ant-bundle/pom.xml +++ b/modules/plugins/ant-bundle/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/apache/pom.xml b/modules/plugins/apache/pom.xml index b4f9208..f2682e9 100644 --- a/modules/plugins/apache/pom.xml +++ b/modules/plugins/apache/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/augeas/pom.xml b/modules/plugins/augeas/pom.xml index 963223b..48651cb 100644 --- a/modules/plugins/augeas/pom.xml +++ b/modules/plugins/augeas/pom.xml @@ -7,7 +7,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/cobbler/pom.xml b/modules/plugins/cobbler/pom.xml index d920440..1e8011a 100644 --- a/modules/plugins/cobbler/pom.xml +++ b/modules/plugins/cobbler/pom.xml @@ -7,7 +7,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/cron/pom.xml b/modules/plugins/cron/pom.xml index d5aaad5..6ee0662 100644 --- a/modules/plugins/cron/pom.xml +++ b/modules/plugins/cron/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/database/pom.xml b/modules/plugins/database/pom.xml index 30889f7..7d98f84 100644 --- a/modules/plugins/database/pom.xml +++ b/modules/plugins/database/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/filetemplate-bundle/pom.xml b/modules/plugins/filetemplate-bundle/pom.xml index b79645d..05ac956 100644 --- a/modules/plugins/filetemplate-bundle/pom.xml +++ b/modules/plugins/filetemplate-bundle/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/grub/pom.xml b/modules/plugins/grub/pom.xml index f7cf265..1c68b9b 100644 --- a/modules/plugins/grub/pom.xml +++ b/modules/plugins/grub/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/hibernate/pom.xml b/modules/plugins/hibernate/pom.xml index acb08ef..35fd599 100644 --- a/modules/plugins/hibernate/pom.xml +++ b/modules/plugins/hibernate/pom.xml @@ -6,7 +6,7 @@ <groupId>org.rhq</groupId> <!-- Bypass the jopr-plugins-parent which can not have children. It must build after the plugins in order to execute integration tests on them. --> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.jboss.on</groupId> diff --git a/modules/plugins/hosts/pom.xml b/modules/plugins/hosts/pom.xml index 7dd0fde..eddd3ed 100644 --- a/modules/plugins/hosts/pom.xml +++ b/modules/plugins/hosts/pom.xml @@ -7,7 +7,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/hudson/pom.xml b/modules/plugins/hudson/pom.xml index 65fa7b8..5d79625 100644 --- a/modules/plugins/hudson/pom.xml +++ b/modules/plugins/hudson/pom.xml @@ -6,7 +6,7 @@ <parent> <artifactId>rhq-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/iis/pom.xml b/modules/plugins/iis/pom.xml index 853c020..7e17c2b 100644 --- a/modules/plugins/iis/pom.xml +++ b/modules/plugins/iis/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/jboss-as-5/pom.xml b/modules/plugins/jboss-as-5/pom.xml index a0ade77..ceb58be 100644 --- a/modules/plugins/jboss-as-5/pom.xml +++ b/modules/plugins/jboss-as-5/pom.xml @@ -9,7 +9,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.jboss.on</groupId> diff --git a/modules/plugins/jboss-as/pom.xml b/modules/plugins/jboss-as/pom.xml index b9ed2b3..54536d9 100644 --- a/modules/plugins/jboss-as/pom.xml +++ b/modules/plugins/jboss-as/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.jboss.on</groupId> diff --git a/modules/plugins/jboss-cache-v3/pom.xml b/modules/plugins/jboss-cache-v3/pom.xml index b3846fa..f276b7d 100644 --- a/modules/plugins/jboss-cache-v3/pom.xml +++ b/modules/plugins/jboss-cache-v3/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.jboss.on</groupId> diff --git a/modules/plugins/jboss-cache/pom.xml b/modules/plugins/jboss-cache/pom.xml index 443e524..f1aa8f9 100644 --- a/modules/plugins/jboss-cache/pom.xml +++ b/modules/plugins/jboss-cache/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.jboss.on</groupId> diff --git a/modules/plugins/jmx/pom.xml b/modules/plugins/jmx/pom.xml index ac9885a..6bc1bfa 100644 --- a/modules/plugins/jmx/pom.xml +++ b/modules/plugins/jmx/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/mysql/pom.xml b/modules/plugins/mysql/pom.xml index d0c9053..e488d56 100644 --- a/modules/plugins/mysql/pom.xml +++ b/modules/plugins/mysql/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/netservices/pom.xml b/modules/plugins/netservices/pom.xml index 06ae2ae..37d84af 100644 --- a/modules/plugins/netservices/pom.xml +++ b/modules/plugins/netservices/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/oracle/pom.xml b/modules/plugins/oracle/pom.xml index 1acdb0f..75a1aff 100644 --- a/modules/plugins/oracle/pom.xml +++ b/modules/plugins/oracle/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/perftest/pom.xml b/modules/plugins/perftest/pom.xml index 39c75da..4e78da5 100644 --- a/modules/plugins/perftest/pom.xml +++ b/modules/plugins/perftest/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/platform/pom.xml b/modules/plugins/platform/pom.xml index 97b83b0..87ba78d 100644 --- a/modules/plugins/platform/pom.xml +++ b/modules/plugins/platform/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/pom.xml b/modules/plugins/pom.xml index 85d6105..4873dae 100644 --- a/modules/plugins/pom.xml +++ b/modules/plugins/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/postfix/pom.xml b/modules/plugins/postfix/pom.xml index 283ab6a..1e95ca3 100644 --- a/modules/plugins/postfix/pom.xml +++ b/modules/plugins/postfix/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/postgres/pom.xml b/modules/plugins/postgres/pom.xml index 5a4466c..daf3133 100644 --- a/modules/plugins/postgres/pom.xml +++ b/modules/plugins/postgres/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/rhq-agent/pom.xml b/modules/plugins/rhq-agent/pom.xml index a190dcd..b0c26a5 100644 --- a/modules/plugins/rhq-agent/pom.xml +++ b/modules/plugins/rhq-agent/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/rhq-server/pom.xml b/modules/plugins/rhq-server/pom.xml index 8f4e675..98333bb 100644 --- a/modules/plugins/rhq-server/pom.xml +++ b/modules/plugins/rhq-server/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.jboss.on</groupId> diff --git a/modules/plugins/samba/pom.xml b/modules/plugins/samba/pom.xml index 0d41574..d0d0d63 100644 --- a/modules/plugins/samba/pom.xml +++ b/modules/plugins/samba/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/script/pom.xml b/modules/plugins/script/pom.xml index 7719b14..7189f74 100644 --- a/modules/plugins/script/pom.xml +++ b/modules/plugins/script/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/snmptrapd/pom.xml b/modules/plugins/snmptrapd/pom.xml index 2d9d715..fdb421d 100644 --- a/modules/plugins/snmptrapd/pom.xml +++ b/modules/plugins/snmptrapd/pom.xml @@ -2,7 +2,7 @@ <parent> <artifactId>rhq-plugins-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<modelVersion>4.0.0</modelVersion> diff --git a/modules/plugins/sshd/pom.xml b/modules/plugins/sshd/pom.xml index 3579496..9c38247 100644 --- a/modules/plugins/sshd/pom.xml +++ b/modules/plugins/sshd/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/sudoers/pom.xml b/modules/plugins/sudoers/pom.xml index 41df1b8..7932012 100644 --- a/modules/plugins/sudoers/pom.xml +++ b/modules/plugins/sudoers/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/tomcat/pom.xml b/modules/plugins/tomcat/pom.xml index 205d5b0..03e2df8 100644 --- a/modules/plugins/tomcat/pom.xml +++ b/modules/plugins/tomcat/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.jboss.on</groupId> diff --git a/modules/plugins/twitter/pom.xml b/modules/plugins/twitter/pom.xml index e299efa..cab4269 100644 --- a/modules/plugins/twitter/pom.xml +++ b/modules/plugins/twitter/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/plugins/validate-all-plugins/pom.xml b/modules/plugins/validate-all-plugins/pom.xml index b3d5e87..4f886fd 100644 --- a/modules/plugins/validate-all-plugins/pom.xml +++ b/modules/plugins/validate-all-plugins/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-plugins-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/pom.xml b/modules/pom.xml index bc96ae3..9a28ce8 100644 --- a/modules/pom.xml +++ b/modules/pom.xml @@ -6,7 +6,7 @@ <parent> <groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent>
<groupId>org.rhq</groupId> diff --git a/modules/test-utils/pom.xml b/modules/test-utils/pom.xml index 2235687..07130df 100644 --- a/modules/test-utils/pom.xml +++ b/modules/test-utils/pom.xml @@ -4,7 +4,7 @@ <parent> <artifactId>rhq-modules-parent</artifactId> <groupId>org.rhq</groupId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> </parent> <artifactId>test-utils</artifactId> <name>RHQ Test Utils</name> diff --git a/pom.xml b/pom.xml index 95b0dc6..efc840d 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@
<groupId>org.rhq</groupId> <artifactId>rhq-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0.GA_QA</version> <packaging>pom</packaging>
<name>RHQ</name>
commit 91f0e1a6aa3d18bb0d6375b9d7280c4bfb5cbd3f Merge: 2ff1981... dc7af8a... Author: John Sanda jsanda@redhat.com Date: Tue Jun 15 16:05:24 2010 -0400
Merge branch 'master' of ssh://git.fedorahosted.org/git/rhq/rhq
commit c809e6802fb6572387b5a8099bce6795ee49a0d8 Author: Lukas Krejci lkrejci@redhat.com Date: Fri Jun 4 17:25:36 2010 +0200
The best disambiguation yet. The types with duplicate names accross the whole type hierarchy are always shown with the plugin info, disambiguated plugin info is pushed down as much as possible so that it appears as close to the resource (or at the resource, ideally). Also, the plugin info is correctly left intact when it was used to disambiguate at least a part of some partition at some level. A couple of minor optimizations.
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerBean.java index 302fdac..10b3830 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerBean.java @@ -2094,6 +2094,6 @@ public class ResourceManagerBean implements ResourceManagerLocal, ResourceManage
public <T> ResourceNamesDisambiguationResult<T> disambiguate(List<T> results, IntExtractor<? super T> extractor, DisambiguationUpdateStrategy updateStrategy) { - return Disambiguator.disambiguate(results, updateStrategy, extractor, entityManager); + return Disambiguator.disambiguate(results, updateStrategy, extractor, entityManager, typeManager.getDuplicateTypeNames()); } } diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/disambiguation/DefaultDisambiguationUpdateStrategies.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/disambiguation/DefaultDisambiguationUpdateStrategies.java index 11ea47d..8a340d5 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/disambiguation/DefaultDisambiguationUpdateStrategies.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/disambiguation/DefaultDisambiguationUpdateStrategies.java @@ -23,7 +23,10 @@
package org.rhq.enterprise.server.resource.disambiguation;
+import java.util.ArrayList; +import java.util.Collections; import java.util.EnumSet; +import java.util.List;
import org.rhq.enterprise.server.resource.disambiguation.MutableDisambiguationReport.Resource;
@@ -39,7 +42,7 @@ public enum DefaultDisambiguationUpdateStrategies implements DisambiguationUpdat */ EXACT { public <T> void update(DisambiguationPolicy policy, MutableDisambiguationReport<T> report) { - updateResources(policy, report); + updateResources(policy, report, true, true); int nofParents = policy.size() - 1; if (nofParents < 0) nofParents = 0; @@ -52,6 +55,10 @@ public enum DefaultDisambiguationUpdateStrategies implements DisambiguationUpdat } } } + + public <T> boolean partitionFurther(ReportPartitions<T> partitions) { + return true; + } },
/** @@ -60,7 +67,7 @@ public enum DefaultDisambiguationUpdateStrategies implements DisambiguationUpdat */ KEEP_AT_LEAST_ONE_PARENT { public <T> void update(DisambiguationPolicy policy, MutableDisambiguationReport<T> report) { - updateResources(policy, report); + updateResources(policy, report, true, true); int nofParents = policy.size() - 1; if (nofParents < 1) nofParents = 1; @@ -74,6 +81,10 @@ public enum DefaultDisambiguationUpdateStrategies implements DisambiguationUpdat public EnumSet<ResourceResolution> resourceLevelRepartitionableResolutions() { return EnumSet.allOf(ResourceResolution.class); } + + public <T> boolean partitionFurther(ReportPartitions<T> partitions) { + return true; + } },
/** @@ -82,7 +93,7 @@ public enum DefaultDisambiguationUpdateStrategies implements DisambiguationUpdat */ KEEP_PARENTS_TO_TOPMOST_SERVERS { public <T> void update(DisambiguationPolicy policy, MutableDisambiguationReport<T> report) { - updateResources(policy, report); + updateResources(policy, report, true, true); //only remove the platform, if the policy doesn't dictate its presence... if (policy.size() > 1 && report.parents.size() > policy.size() - 1) { report.parents.remove(report.parents.size() - 1); @@ -93,6 +104,10 @@ public enum DefaultDisambiguationUpdateStrategies implements DisambiguationUpdat public EnumSet<ResourceResolution> resourceLevelRepartitionableResolutions() { return EnumSet.allOf(ResourceResolution.class); } + + public <T> boolean partitionFurther(ReportPartitions<T> partitions) { + return partitions.getDisambiguationPolicy().size() < Disambiguator.MAXIMUM_DISAMBIGUATED_TREE_DEPTH - 1; + } },
/** @@ -100,7 +115,7 @@ public enum DefaultDisambiguationUpdateStrategies implements DisambiguationUpdat */ KEEP_ALL_PARENTS { public <T> void update(DisambiguationPolicy policy, MutableDisambiguationReport<T> report) { - updateResources(policy, report); + updateResources(policy, report, true, true); //do nothing to the parents, keep them as they are... }
@@ -111,8 +126,16 @@ public enum DefaultDisambiguationUpdateStrategies implements DisambiguationUpdat public EnumSet<ResourceResolution> alwaysRepartitionableResolutions() { return EnumSet.of(ResourceResolution.NAME); } + + public <T> boolean partitionFurther(ReportPartitions<T> partitions) { + //we always keep all the info about the resources in this strategy + //so there's no real need to disambiguate anything. + return false; + } };
+ private static final DisambiguationPolicy.Level overridingResolution = new DisambiguationPolicy.Level(ResourceResolution.TYPE); + /** * This updates the resources in the report according to the resolutions contained in the policy. * This method is called as part of the {@link DisambiguationUpdateStrategy#update(DisambiguationPolicy, MutableDisambiguationReport)} @@ -123,15 +146,29 @@ public enum DefaultDisambiguationUpdateStrategies implements DisambiguationUpdat * @param <T> * @param policy * @param report + * @param honorAmbiguousTypeNamesList whether to honor the list of ambiguous type names as listed in the policy when updating the resources. + * @param pushDownPluginInfo if true, the plugin information is pushed down as low in the resource hierarchy as possible. This means that if + * some parent needs plugin disambiguation or is of an ambiguous type and the resource comes from the same plugin, the plugin info is preserved + * on the resource rather than on the parent. This is mainly useful for the display purposes, because it just + * looks nicer to have that info at a resource than somewhere in the location string. */ - public static <T> void updateResources(DisambiguationPolicy policy, MutableDisambiguationReport<T> report) { - updateResource(policy.get(0), report.resource); + public static <T> void updateResources(DisambiguationPolicy policy, MutableDisambiguationReport<T> report, boolean honorAmbiguousTypeNamesList, boolean pushDownPluginInfo) { + List<String> ambiguousTypeNames = honorAmbiguousTypeNamesList ? policy.getAmbiguousTypeNames() : Collections.<String>emptyList(); + + String resourcePlugin = report.resource.resourceType.plugin; + List<String> parentPlugins = new ArrayList<String>(report.parents.size()); + updateResource(policy.get(0), report.resource, ambiguousTypeNames);
int disambiguationPolicyIndex = 1; while (disambiguationPolicyIndex < policy.size() && disambiguationPolicyIndex - 1 < report.parents.size()) { - ResourceResolution parentResolution = policy.get(disambiguationPolicyIndex); + DisambiguationPolicy.Level resolutionLevel = policy.get(disambiguationPolicyIndex); MutableDisambiguationReport.Resource parent = report.parents.get(disambiguationPolicyIndex - 1); - updateResource(parentResolution, parent); + + if (pushDownPluginInfo) { + parentPlugins.add(parent.resourceType.plugin); + } + + updateResource(resolutionLevel, parent, ambiguousTypeNames);
disambiguationPolicyIndex++; } @@ -142,30 +179,27 @@ public enum DefaultDisambiguationUpdateStrategies implements DisambiguationUpdat //we need to treat those parents as well. Because they are not needed for disambiguation, treat them as //if only the name and type was needed for them. for (; disambiguationPolicyIndex < report.parents.size(); ++disambiguationPolicyIndex) { - updateResource(ResourceResolution.TYPE, report.parents.get(disambiguationPolicyIndex)); + if (pushDownPluginInfo) { + parentPlugins.add(report.parents.get(disambiguationPolicyIndex).resourceType.plugin); + } + updateResource(overridingResolution, report.parents.get(disambiguationPolicyIndex), ambiguousTypeNames); }
- //include the plugin information only if it was actually the deciding resolution of the policy. - if (policy.get(policy.size() - 1) == ResourceResolution.PLUGIN) { - String decidingPlugin = policy.size() > 1 ? report.parents.get(policy.size() - 2).resourceType.plugin : report.resource.resourceType.plugin; - - for (int i = policy.size() - 3; i >= 0; i--) { - if (decidingPlugin.equals(report.parents.get(i).resourceType.plugin)) { - updateResource(ResourceResolution.TYPE, report.parents.get(i)); + if (pushDownPluginInfo) { + for (int i = report.parents.size() - 1; i >= 0; --i) { + String plugin = report.parents.get(i).resourceType.plugin; + if (plugin != null && i > 0 && plugin.equals(parentPlugins.get(i - 1))) { + report.parents.get(i - 1).resourceType.plugin = plugin; + report.parents.get(i).resourceType.plugin = null; } }
- if (policy.size() > 1 && decidingPlugin.equals(report.resource.resourceType.plugin)) { - updateResource(ResourceResolution.TYPE, report.resource); - } - } else { - //ok, this report was in the end resolved by some name or type at the resource level - //or higher up in the parents. This alone uniquely identifies the resource, so there's - //no need to show the (ambigous anyway) plugin info. - updateResource(ResourceResolution.TYPE, report.resource); - - for (MutableDisambiguationReport.Resource parent : report.parents) { - updateResource(ResourceResolution.TYPE, parent); + if (report.parents.size() > 0) { + String plugin = report.parents.get(0).resourceType.plugin; + if (plugin != null && plugin.equals(resourcePlugin)) { + report.resource.resourceType.plugin = resourcePlugin; + report.parents.get(0).resourceType.plugin = null; + } } } } @@ -188,10 +222,17 @@ public enum DefaultDisambiguationUpdateStrategies implements DisambiguationUpdat }
- private static void updateResource(ResourceResolution resolution, Resource resource) { - switch (resolution) { + private static void updateResource(DisambiguationPolicy.Level resolutionLevel, Resource resource, List<String> ambiguousTypeNames) { + switch (resolutionLevel.getResourceResolution()) { case NAME: case TYPE: - resource.resourceType.plugin = null; + if (!ambiguousTypeNames.contains(resource.resourceType.name)) { + resource.resourceType.plugin = null; + } + break; + case PLUGIN: + if (!(resolutionLevel.isDeciding() || ambiguousTypeNames.contains(resource.resourceType.name))) { + resource.resourceType.plugin = null; + } } }
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/disambiguation/DisambiguationPolicy.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/disambiguation/DisambiguationPolicy.java index d4ce232..3387983 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/disambiguation/DisambiguationPolicy.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/disambiguation/DisambiguationPolicy.java @@ -24,6 +24,7 @@ package org.rhq.enterprise.server.resource.disambiguation;
import java.util.ArrayList; +import java.util.List;
/** * A disambiguation policy determines whether two disambiguation reports are still ambiguous or not. @@ -31,31 +32,71 @@ import java.util.ArrayList; * The policy is basically a list of {@link ResourceResolution} instances each corresponding to either * the resource itself of some of its parent in the hierarchy. Each of the {@link ResourceResolution} instances * in the list determines how the appropriate part of the report is disambiguated. - * <p> - * Only last element in this list actually decides whether the two reports are still ambiguous. The thinking - * behind this is that the previous resolutions in the chain are "decided" and the last one is the one - * we are currently trying to determine the correct resolution for. - * * * @author Lukas Krejci */ -public class DisambiguationPolicy extends ArrayList<ResourceResolution> { +public class DisambiguationPolicy extends ArrayList<DisambiguationPolicy.Level> { private static final long serialVersionUID = 1L;
private DisambiguationUpdateStrategy parentsUpdateStrategy; + private List<String> ambiguousTypeNames; + + public static class Level { + private ResourceResolution resourceResolution; + private boolean deciding; + + public Level(ResourceResolution resourceResolution) { + this(resourceResolution, false); + } + + public Level(ResourceResolution resourceResolution, boolean deciding) { + this.resourceResolution = resourceResolution; + this.deciding = deciding; + } + + public boolean isDeciding() { + return deciding; + } + + public void setDeciding(boolean deciding) { + this.deciding = deciding; + } + + public ResourceResolution getResourceResolution() { + return resourceResolution; + } + + public String toString() { + return "Level[" + resourceResolution + (deciding ? ", deciding]" : ", not deciding]"); + } + }
- public DisambiguationPolicy(DisambiguationUpdateStrategy parentsDisambiguationStrategy) { + public DisambiguationPolicy(DisambiguationUpdateStrategy parentsDisambiguationStrategy, List<String> ambiguousTypeNames) { this.parentsUpdateStrategy = parentsDisambiguationStrategy; + this.ambiguousTypeNames = ambiguousTypeNames; }
public DisambiguationPolicy(DisambiguationPolicy other) { - super(other); + for(Level level : other) { + this.add(new Level(level.resourceResolution, level.deciding)); + } this.parentsUpdateStrategy = other.parentsUpdateStrategy; + this.ambiguousTypeNames = other.ambiguousTypeNames; }
- public static DisambiguationPolicy getUniqueNamePolicy(DisambiguationUpdateStrategy parentsDisambiguationStrategy) { - DisambiguationPolicy ret = new DisambiguationPolicy(parentsDisambiguationStrategy); - ret.add(ResourceResolution.NAME); + /** + * Creates a "starting" disambiguation policy that is used to try and disambiguate + * the resources by just their name. + * + * @see #DisambiguationPolicy(DisambiguationUpdateStrategy, List) + * @see #getAmbiguousTypeNames() + * @param parentsDisambiguationStrategy + * @param ambiguousTypeNames the list of ambiguous type names + * @return + */ + public static DisambiguationPolicy getUniqueNamePolicy(DisambiguationUpdateStrategy parentsDisambiguationStrategy, List<String> ambiguousTypeNames) { + DisambiguationPolicy ret = new DisambiguationPolicy(parentsDisambiguationStrategy, ambiguousTypeNames); + ret.add(new Level(ResourceResolution.NAME));
return ret; } @@ -69,6 +110,18 @@ public class DisambiguationPolicy extends ArrayList<ResourceResolution> { }
/** + * @return the list of type names that are defined in multiple plugins. Such type names + * should be disambiguated no matter if it is needed or not. + */ + public List<String> getAmbiguousTypeNames() { + return ambiguousTypeNames; + } + + public void setAmbiguousTypeNames(List<String> ambiguousTypeNames) { + this.ambiguousTypeNames = ambiguousTypeNames; + } + + /** * Tells whether the last resolution in this policy determines the reports ambiguous. * * @param <T> @@ -83,16 +136,19 @@ public class DisambiguationPolicy extends ArrayList<ResourceResolution> { if (ra == null || rb == null) return false;
- ResourceResolution resolution = get(size() - 1); + Level level = getCurrentLevel();
- return resolution.areAmbiguous(ra, rb); + if (level != null) { + return level.getResourceResolution().areAmbiguous(ra, rb); + } else { + return false; + } }
/** - * @return the currently deciding {@link ResourceResolution} (i.e. the last element in this - * policy) + * @return the last element in this policy */ - public ResourceResolution getCurrentResourceResolution() { + public Level getCurrentLevel() { return size() > 0 ? get(size() - 1) : null; }
@@ -104,19 +160,19 @@ public class DisambiguationPolicy extends ArrayList<ResourceResolution> { */ public DisambiguationPolicy getNext() { int lastIdx = size() - 1; - ResourceResolution lastResolution = get(lastIdx); + ResourceResolution lastResolution = get(lastIdx).getResourceResolution();
DisambiguationPolicy ret = new DisambiguationPolicy(this);
switch (lastResolution) { case NAME: - ret.set(lastIdx, ResourceResolution.TYPE); + ret.get(lastIdx).resourceResolution = ResourceResolution.TYPE; break; case TYPE: - ret.set(lastIdx, ResourceResolution.PLUGIN); + ret.get(lastIdx).resourceResolution = ResourceResolution.PLUGIN; break; case PLUGIN: - ret.add(ResourceResolution.NAME); + ret.add(new Level(ResourceResolution.NAME)); break; }
@@ -128,10 +184,10 @@ public class DisambiguationPolicy extends ArrayList<ResourceResolution> { * if the current policy doesn't require repartitioning of unique reports. */ public DisambiguationPolicy getNextRepartitioningPolicy() { - ResourceResolution currentResolution = get(size() - 1); + ResourceResolution currentResolution = getCurrentLevel().getResourceResolution();
- if (parentsUpdateStrategy.alwaysRepartitionableResolutions().contains(currentResolution) || (size() == 1) - && parentsUpdateStrategy.resourceLevelRepartitionableResolutions().contains(currentResolution)) { + if (parentsUpdateStrategy.alwaysRepartitionableResolutions().contains(currentResolution) || (size() == 1 + && parentsUpdateStrategy.resourceLevelRepartitionableResolutions().contains(currentResolution))) {
DisambiguationPolicy newPolicy = getNext();
@@ -141,7 +197,7 @@ public class DisambiguationPolicy extends ArrayList<ResourceResolution> { //therefore, skip the plugin resolution in that case. if (currentResolution == ResourceResolution.TYPE) { newPolicy = newPolicy.getNext(); - newPolicy.set(newPolicy.size() - 2, ResourceResolution.TYPE); + newPolicy.get(newPolicy.size() - 2).resourceResolution = ResourceResolution.TYPE; }
return newPolicy; diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/disambiguation/DisambiguationUpdateStrategy.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/disambiguation/DisambiguationUpdateStrategy.java index 4674c1e..1639644 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/disambiguation/DisambiguationUpdateStrategy.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/disambiguation/DisambiguationUpdateStrategy.java @@ -62,4 +62,19 @@ public interface DisambiguationUpdateStrategy { */ EnumSet<ResourceResolution> alwaysRepartitionableResolutions();
+ /** + * The disambiguation procedure calls this method for every not yet fully unique + * partitions set when it determines that further disambiguation should be performed. + * <p> + * But this is not always necessary, depending on the update strategy implementation. + * <p> + * This method is therefore the means for the update strategy to short-circuit the disambiguation + * procedure when it determines that further disambiguation would not make sense for this strategy. + * + * @param <T> + * @param partitions the partitions object holding a subset of the results being disambiguated along + * with the policy that is used to disambiguate them + * @return true if further disambiguation is useful, false otherwise + */ + <T> boolean partitionFurther(ReportPartitions<T> partitions); } diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/disambiguation/Disambiguator.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/disambiguation/Disambiguator.java index 7adc22e..2baa4db 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/disambiguation/Disambiguator.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/disambiguation/Disambiguator.java @@ -44,6 +44,9 @@ import org.rhq.core.util.IntExtractor; */ public class Disambiguator {
+ /** + * The maximum depth of the resource tree. + */ public static final int MAXIMUM_DISAMBIGUATED_TREE_DEPTH = 7;
private static final String PARENT_INFO_QUERY; @@ -95,11 +98,12 @@ public class Disambiguator { * @param disambiguationUpdateStrategy how is the disambiguation info going to be applied to the results. * @param resourceIdExtractor an object able to extract resource id from an instance of type parameter. * @param entityManager an entityManager to be used to access the database + * @param duplicateTypeNames the list of type names that are ambiguous without plugin spec * @return the disambiguation result or null on error */ public static <T> ResourceNamesDisambiguationResult<T> disambiguate(List<T> results, DisambiguationUpdateStrategy disambiguationUpdateStrategy, IntExtractor<? super T> extractor, - EntityManager entityManager) { + EntityManager entityManager, List<String> duplicateTypeNames) {
if (results.isEmpty()) { return new ResourceNamesDisambiguationResult<T>(new ArrayList<DisambiguationReport<T>>()); @@ -143,7 +147,7 @@ public class Disambiguator { //requires different level of disambiguation, I will then process them individually.
ReportPartitions<T> partitionedReports = new ReportPartitions<T>(DisambiguationPolicy - .getUniqueNamePolicy(disambiguationUpdateStrategy)); + .getUniqueNamePolicy(disambiguationUpdateStrategy, duplicateTypeNames));
@SuppressWarnings("unchecked") List<Object[]> parentsResults = (List<Object[]>) parentsQuery.getResultList(); @@ -206,12 +210,16 @@ public class Disambiguator {
List<ReportPartitions<T>> ambiguousSubPartitions = new ArrayList<ReportPartitions<T>>();
- if (!partitionedReports.isPartitionsUnique()) { - ambiguousSubPartitions.add(partitionedReports); + if (!disambiguationUpdateStrategy.partitionFurther(partitionedReports)) { + updateResourcesInPartitions(disambiguationUpdateStrategy, partitionedReports.getDisambiguationPolicy(), partitionedReports.getAllPartitions()); } else { - repartitionUnique(partitionedReports, disambiguationUpdateStrategy, ambiguousSubPartitions); + if (!partitionedReports.isPartitionsUnique()) { + ambiguousSubPartitions.add(partitionedReports); + } else { + repartitionUnique(partitionedReports, disambiguationUpdateStrategy, ambiguousSubPartitions); + } } - + while (ambiguousSubPartitions.size() > 0) { Iterator<ReportPartitions<T>> subPartitionIterator = ambiguousSubPartitions.iterator(); List<ReportPartitions<T>> newAmbiguousPartitions = new ArrayList<ReportPartitions<T>>(); @@ -219,17 +227,21 @@ public class Disambiguator { while (subPartitionIterator.hasNext()) { ReportPartitions<T> subPartition = subPartitionIterator.next();
- repartitionUnique(subPartition, disambiguationUpdateStrategy, newAmbiguousPartitions); - - for (List<MutableDisambiguationReport<T>> partitionReports : subPartition.getAmbiguousPartitions()) { - ReportPartitions<T> replacementSubpartition = new ReportPartitions<T>(subPartition - .getDisambiguationPolicy().getNext()); - replacementSubpartition.putAll(partitionReports); - if (!replacementSubpartition.isPartitionsUnique()) { - newAmbiguousPartitions.add(replacementSubpartition); - } else { - repartitionUnique(replacementSubpartition, disambiguationUpdateStrategy, newAmbiguousPartitions); + if (disambiguationUpdateStrategy.partitionFurther(subPartition)) { + repartitionUnique(subPartition, disambiguationUpdateStrategy, newAmbiguousPartitions); + + for (List<MutableDisambiguationReport<T>> partitionReports : subPartition.getAmbiguousPartitions()) { + ReportPartitions<T> replacementSubpartition = new ReportPartitions<T>(subPartition + .getDisambiguationPolicy().getNext()); + replacementSubpartition.putAll(partitionReports); + if (!replacementSubpartition.isPartitionsUnique()) { + newAmbiguousPartitions.add(replacementSubpartition); + } else { + repartitionUnique(replacementSubpartition, disambiguationUpdateStrategy, newAmbiguousPartitions); + } } + } else { + updateResourcesInPartitions(disambiguationUpdateStrategy, subPartition.getDisambiguationPolicy(), subPartition.getAllPartitions()); } subPartitionIterator.remove(); } @@ -266,14 +278,17 @@ public class Disambiguator { } else { //ok, there is no other repartitioning policy that we can try. //Let's update the reports in the unique partitions... - for (List<MutableDisambiguationReport<T>> partition : partitions.getUniquePartitions()) { - for (MutableDisambiguationReport<T> report : partition) { - updateStrategy.update(partitions.getDisambiguationPolicy(), report); - } - } - + updateResourcesInPartitions(updateStrategy, partitions.getDisambiguationPolicy(), partitions.getUniquePartitions()); return; } } } + + private static <T> void updateResourcesInPartitions(DisambiguationUpdateStrategy strategy, DisambiguationPolicy policy, List<List<MutableDisambiguationReport<T>>> partitions) { + for (List<MutableDisambiguationReport<T>> partition : partitions) { + for (MutableDisambiguationReport<T> report : partition) { + strategy.update(policy, report); + } + } + } } diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/disambiguation/ReportPartitions.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/disambiguation/ReportPartitions.java index 8fbb9ab..337ef31 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/disambiguation/ReportPartitions.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/disambiguation/ReportPartitions.java @@ -31,6 +31,10 @@ import java.util.List; * This class partitions the reports inserted into it by chunking them up * into sublists containing mutually ambiguous reports. The ambiguity is determined using * a {@link DisambiguationPolicy}. + * <p> + * The ReportPartition instances can form a tree using the {@link #getPreviousPartitioning()} + * and the parameters provided to the constructors. This is handy to keep track of what + * partitions have been disambiguated at what level and how. * * @param <T> the type of the original instances the are being disambiguated. * @@ -40,8 +44,9 @@ public class ReportPartitions<T> {
private static final long serialVersionUID = 1L; private DisambiguationPolicy disambiguationPolicy; - private List<List<MutableDisambiguationReport<T>>> partitions; - + private List<List<MutableDisambiguationReport<T>>> uniquePartitions; + private List<List<MutableDisambiguationReport<T>>> ambiguousPartitions; + /** * Constructs a new instance with no partitions in it. * @@ -49,7 +54,8 @@ public class ReportPartitions<T> { */ public ReportPartitions(DisambiguationPolicy disambiguationPolicy) { this.disambiguationPolicy = disambiguationPolicy; - partitions = new ArrayList<List<MutableDisambiguationReport<T>>>(); + uniquePartitions = new ArrayList<List<MutableDisambiguationReport<T>>>(); + ambiguousPartitions = new ArrayList<List<MutableDisambiguationReport<T>>>(); }
public ReportPartitions(DisambiguationPolicy disambiguationPolicy, ReportPartitions<T> other) { @@ -69,77 +75,89 @@ public class ReportPartitions<T> { }
public List<List<MutableDisambiguationReport<T>>> getAmbiguousPartitions() { - List<List<MutableDisambiguationReport<T>>> ret = new ArrayList<List<MutableDisambiguationReport<T>>>(); - - for (List<MutableDisambiguationReport<T>> partition : partitions) { - if (partition.size() > 1) { - ret.add(partition); - } - } - - return ret; + return Collections.unmodifiableList(ambiguousPartitions); }
public List<List<MutableDisambiguationReport<T>>> getUniquePartitions() { - List<List<MutableDisambiguationReport<T>>> ret = new ArrayList<List<MutableDisambiguationReport<T>>>(); - - for (List<MutableDisambiguationReport<T>> partition : partitions) { - if (partition.size() == 1) { - ret.add(partition); - } - } - - return ret; + return Collections.unmodifiableList(uniquePartitions); }
public List<List<MutableDisambiguationReport<T>>> getAllPartitions() { - return Collections.unmodifiableList(partitions); + List<List<MutableDisambiguationReport<T>>> ret = new ArrayList<List<MutableDisambiguationReport<T>>>(ambiguousPartitions); + ret.addAll(uniquePartitions); + return Collections.unmodifiableList(ret); }
public void put(MutableDisambiguationReport<T> value) { - boolean found = false; - for (List<MutableDisambiguationReport<T>> partition : partitions) { - for (MutableDisambiguationReport<T> partitionPrototype : partition) { - if (disambiguationPolicy.areAmbiguous(partitionPrototype, value)) { - found = true; - break; - } - } - if (found) { - partition.add(value); - break; - } - } - - if (!found) { - List<MutableDisambiguationReport<T>> newPartition = new ArrayList<MutableDisambiguationReport<T>>(); - newPartition.add(value); - partitions.add(newPartition); - } + put(value, true); }
public void putAll(List<MutableDisambiguationReport<T>> values) { for (MutableDisambiguationReport<T> v : values) { - put(v); + put(v, false); } + updatePolicy(); }
public void putAll(ReportPartitions<T> other) { for (List<MutableDisambiguationReport<T>> partition : other.getAllPartitions()) { - putAll(partition); + for (MutableDisambiguationReport<T> v : partition) { + put(v, false); + } } + updatePolicy(); }
public boolean isPartitionsUnique() { - for (List<MutableDisambiguationReport<T>> partition : partitions) { - if (partition.size() > 1) { - return false; + return ambiguousPartitions.size() == 0; + } + + public String toString() { + return "ReportPartitions[policy=" + disambiguationPolicy + ", uniquePartitions=" + uniquePartitions + ", ambiguousPartitions=" + ambiguousPartitions + "]"; + } + + private void put(MutableDisambiguationReport<T> value, boolean updatePolicy) { + if (insertIntoExisting(value, ambiguousPartitions) >= 0) { + return; + } else { + int idx = insertIntoExisting(value, uniquePartitions); + if (idx >= 0) { + ambiguousPartitions.add(uniquePartitions.remove(idx)); + } else { + List<MutableDisambiguationReport<T>> newPartition = new ArrayList<MutableDisambiguationReport<T>>(); + newPartition.add(value); + uniquePartitions.add(newPartition); } } - return true; + + if (updatePolicy) { + updatePolicy(); + } + } + + private void updatePolicy() { + this.disambiguationPolicy.getCurrentLevel().setDeciding(uniquePartitions.size() > 0); } + + private int insertIntoExisting(MutableDisambiguationReport<T> value, List<List<MutableDisambiguationReport<T>>> partitions) { + int idx = -1; + boolean found = false; + for (List<MutableDisambiguationReport<T>> partition : partitions) { + for (MutableDisambiguationReport<T> partitionPrototype : partition) { + if (disambiguationPolicy.areAmbiguous(partitionPrototype, value)) { + found = true; + break; + } + }
- public String toString() { - return "ReportPartitions[policy=" + disambiguationPolicy + ", partitions=" + partitions + "]"; + idx++; + + if (found) { + partition.add(value); + break; + } + } + + return found ? idx : -1; } } \ No newline at end of file
commit 60faf0491dabc3c6ac7b6cf11601bc29b90b2278 Author: Lukas Krejci lkrejci@redhat.com Date: Thu Jun 3 20:28:26 2010 +0200
This is an experimental change to the way the disambiguation works (once more). This tries to deal with the fact that the plugin info is shown when resource of the same name and type are only resolved by parent path (and thus showing the plugin info). This change has a problem though. If an ambiguous partition is partially resolved by a plugin info at resource level, the rest of partition is disambiguated further up by name and then loses the plugin info further below (which would be needed to disambiguate with the previously partially resolved parts).
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/disambiguation/DefaultDisambiguationUpdateStrategies.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/disambiguation/DefaultDisambiguationUpdateStrategies.java index c11c3dd..11ea47d 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/disambiguation/DefaultDisambiguationUpdateStrategies.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/disambiguation/DefaultDisambiguationUpdateStrategies.java @@ -103,10 +103,13 @@ public enum DefaultDisambiguationUpdateStrategies implements DisambiguationUpdat updateResources(policy, report); //do nothing to the parents, keep them as they are... } - - @Override + public EnumSet<ResourceResolution> resourceLevelRepartitionableResolutions() { - return EnumSet.allOf(ResourceResolution.class); + return EnumSet.of(ResourceResolution.NAME); + } + + public EnumSet<ResourceResolution> alwaysRepartitionableResolutions() { + return EnumSet.of(ResourceResolution.NAME); } };
@@ -142,17 +145,28 @@ public enum DefaultDisambiguationUpdateStrategies implements DisambiguationUpdat updateResource(ResourceResolution.TYPE, report.parents.get(disambiguationPolicyIndex)); }
- //don't replicate the plugin information on the parents if it was reported - //on the resource already. - //this has to be done on all the parents, not just the ones that are immediately needed - //for disambiguation. The parents update strategies might leave more parents than those needed. - if (policy.get(0) == ResourceResolution.PLUGIN) { - for (MutableDisambiguationReport.Resource parent : report.parents) { - if (report.resource.resourceType.plugin.equals(parent.resourceType.plugin)) { - - parent.resourceType.plugin = null; + //include the plugin information only if it was actually the deciding resolution of the policy. + if (policy.get(policy.size() - 1) == ResourceResolution.PLUGIN) { + String decidingPlugin = policy.size() > 1 ? report.parents.get(policy.size() - 2).resourceType.plugin : report.resource.resourceType.plugin; + + for (int i = policy.size() - 3; i >= 0; i--) { + if (decidingPlugin.equals(report.parents.get(i).resourceType.plugin)) { + updateResource(ResourceResolution.TYPE, report.parents.get(i)); } } + + if (policy.size() > 1 && decidingPlugin.equals(report.resource.resourceType.plugin)) { + updateResource(ResourceResolution.TYPE, report.resource); + } + } else { + //ok, this report was in the end resolved by some name or type at the resource level + //or higher up in the parents. This alone uniquely identifies the resource, so there's + //no need to show the (ambigous anyway) plugin info. + updateResource(ResourceResolution.TYPE, report.resource); + + for (MutableDisambiguationReport.Resource parent : report.parents) { + updateResource(ResourceResolution.TYPE, parent); + } } }
rhq-commits@lists.fedorahosted.org