[JBoss JIRA] (SHRINKDESC-119) Create a Builder SPI
by Andrew Rubinger (JIRA)
Andrew Rubinger created SHRINKDESC-119:
------------------------------------------
Summary: Create a Builder SPI
Key: SHRINKDESC-119
URL: https://issues.jboss.org/browse/SHRINKDESC-119
Project: ShrinkWrap Descriptors
Issue Type: Feature Request
Reporter: Andrew Rubinger
Apart from the SWD object model, we could make it much easier to populate the metadata by introducing a "Builder" (name to be discussed) SPI. The purpose here would be a pluggable mechanism to accomplish code like the following:
{code}WebAppDescriptor desc = create(WebAppDescriptor.class)
.add(type(Servlet.class)
.className("com.acme.MyServlet")
.name("MyServletName"))
.add(build(Servlet.class)
.from(MyServlet.class));{code}
Here the WepAppDescriptor gets data added by scanning in annotations observed on the user's MyServlet, relieving the user of supplying the configuration manually.
A more full example is detailed in this Gist contributed by Aslak:
https://gist.github.com/1025597
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
11 years, 11 months
[JBoss JIRA] Created: (SHRINKWRAP-247) Support recursive addition of web resources
by Karel Piwko (JIRA)
Support recursive addition of web resources
--------------------------------------------
Key: SHRINKWRAP-247
URL: https://issues.jboss.org/browse/SHRINKWRAP-247
Project: ShrinkWrap
Issue Type: Feature Request
Affects Versions: 1.0.0-alpha-11
Reporter: Karel Piwko
Assignee: Karel Piwko
Priority: Critical
Fix For: 1.0.0-alpha-12
There should be a similar way to include web resources recursively as for classes.
Imagine that you would like to build a complete WAR used for functional tests, than the deployment method body will look like:
WebArchive war = ShrinkWrap.create(WebArchive.class, "practice0x-testing.war")
.addLibraries(Dependencies.use(MavenDependencies.class).resolveFrom("pom.xml", new ScopeFilter("", "compile")))
.addPackages(true, NO_TEST_CLASSES, org.jboss.lectures.auction.AuctionManager.class.getPackage())
.addResource(new File("src/main/webapp/detail.xhtml"), ArchivePaths.create("detail.xhtml"))
.addResource(new File("src/main/webapp/index.html"), ArchivePaths.create("index.html"))
.addResource(new File("src/main/webapp/list.xhtml"), ArchivePaths.create("list.xhtml"))
.addResource(new File("src/main/webapp/myAuctions.xhtml"), ArchivePaths.create("myAuctions.xhtml"))
.addResource(new File("src/main/webapp/myOverview.xhtml"), ArchivePaths.create("myOverview.xhtml"))
.addResource(new File("src/main/webapp/newAuction.xhtml"), ArchivePaths.create("newAuction.xhtml"))
.addResource(new File("src/main/webapp/newAuctionDetails.xhtml"), ArchivePaths.create("newAuctionDetails.xhtml"))
.addResource(new File("src/main/webapp/newAuctionSummary.xhtml"), ArchivePaths.create("newAuctionSummary.xhtml"))
.addResource(new File("src/main/webapp/script.js"), ArchivePaths.create("script.js"))
.addResource(new File("src/main/webapp/style.css"), ArchivePaths.create("style.css"))
.addResource(new File("src/main/webapp/style.ie6.css"), ArchivePaths.create("style.ie6.css"))
.addResource(new File("src/main/webapp/style.ie7.css"), ArchivePaths.create("style.ie7.css"))
.addResource(new File("src/main/webapp/images/01.png"), ArchivePaths.create("images/01.png"))
.addResource(new File("src/main/webapp/images/02.png"), ArchivePaths.create("images/02.png"))
.addResource(new File("src/main/webapp/images/03.png"), ArchivePaths.create("images/03.png"))
.addResource(new File("src/main/webapp/images/Block-h.png"), ArchivePaths.create("images/Block-h.png"))
.addResource(new File("src/main/webapp/images/Block-s.png"), ArchivePaths.create("images/Block-s.png"))
.addResource(new File("src/main/webapp/images/Block-v.png"), ArchivePaths.create("images/Block-v.png"))
.addResource(new File("src/main/webapp/images/BlockContentBullets.png"), ArchivePaths.create("images/BlockContentBullets.png"))
.addResource(new File("src/main/webapp/images/BlockHeader.png"), ArchivePaths.create("images/BlockHeader.png"))
.addResource(new File("src/main/webapp/images/BlockHeaderIcon.png"), ArchivePaths.create("images/BlockHeaderIcon.png"))
.addResource(new File("src/main/webapp/images/Button.png"), ArchivePaths.create("images/Button.png"))
.addResource(new File("src/main/webapp/images/Footer.png"), ArchivePaths.create("images/Footer.png"))
.addResource(new File("src/main/webapp/images/Header.jpg"), ArchivePaths.create("images/Header.jpg"))
.addResource(new File("src/main/webapp/images/Header.png"), ArchivePaths.create("images/Header.png"))
.addResource(new File("src/main/webapp/images/MenuItem.png"), ArchivePaths.create("images/MenuItem.png"))
.addResource(new File("src/main/webapp/images/Page-BgGlare.png"), ArchivePaths.create("images/Page-BgGlare.png"))
.addResource(new File("src/main/webapp/images/Page-BgSimpleGradient.jpg"), ArchivePaths.create("images/Page-BgSimpleGradient.jpg"))
.addResource(new File("src/main/webapp/images/PostQuote.png"), ArchivePaths.create("images/PostQuote.png"))
.addResource(new File("src/main/webapp/images/Sheet-h.png"), ArchivePaths.create("images/Sheet-h.png"))
.addResource(new File("src/main/webapp/images/Sheet-s.png"), ArchivePaths.create("images/Sheet-s.png"))
.addResource(new File("src/main/webapp/images/Sheet-v.png"), ArchivePaths.create("images/Sheet-v.png"))
.addResource(new File("src/main/webapp/images/contact.jpg"), ArchivePaths.create("images/contact.jpg"))
.addResource(new File("src/main/webapp/images/link photo.txt"), ArchivePaths.create("images/link photo.txt"))
.addResource(new File("src/main/webapp/images/nav.png"), ArchivePaths.create("images/nav.png"))
.addResource(new File("src/main/webapp/images/rssIcon.png"), ArchivePaths.create("images/rssIcon.png"))
.addResource(new File("src/main/webapp/images/spacer.gif"), ArchivePaths.create("images/spacer.gif"))
.addResource(new File("src/main/webapp/images/spectacles.gif"), ArchivePaths.create("images/spectacles.gif"))
.addResource(new File("src/main/webapp/images/subitem-bg.png"), ArchivePaths.create("images/subitem-bg.png"))
.addResource(new File("src/main/webapp/resources/auction/auctionList.xhtml"), ArchivePaths.create("resources/auction/auctionList.xhtml"))
.addResource(new File("src/main/webapp/resources/auction/menuItem.xhtml"), ArchivePaths.create("resources/auction/menuItem.xhtml"))
.addResource(new File("src/main/webapp/templates/home.xhtml"), ArchivePaths.create("templates/home.xhtml"))
.addResource(new File("src/main/webapp/templates/menu.xhtml"), ArchivePaths.create("templates/menu.xhtml"))
.addResource(new File("src/main/webapp/templates/login.xhtml"), ArchivePaths.create("templates/login.xhtml"))
.addWebResource(new File("src/main/webapp/WEB-INF/beans.xml"), "beans.xml")
.addWebResource(new File("src/main/webapp/WEB-INF/faces-config.xml"), "faces-config.xml")
.addWebResource(new File("src/main/webapp/WEB-INF/jboss-scanning.xml"), "jboss-scanning.xml")
.addWebResource(new File("src/main/resources/import.sql"), ArchivePaths.create("classes/import.sql"))
.addManifestResource(new File("src/main/resources/META-INF/persistence.xml"))
.setWebXML(new File("src/main/webapp/WEB-INF/web.xml"));
This could be massively reduced using a recursive addResources() call with a filter.
(ommiting incomming API changes in SHRINKWRAP-241)
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
11 years, 11 months
[JBoss JIRA] Created: (SHRINKWRAP-249) Support add directory content
by Aslak Knutsen (JIRA)
Support add directory content
-----------------------------
Key: SHRINKWRAP-249
URL: https://issues.jboss.org/browse/SHRINKWRAP-249
Project: ShrinkWrap
Issue Type: Feature Request
Components: api, impl-base
Affects Versions: 1.0.0-alpha-11
Reporter: Aslak Knutsen
A common use case is to add multiple Assets from your directory structure:
addManifestResource("src/main/resources/META-INF/name", "name")
addManifestResource("src/main/resources/META-INF/name2", "name2")
This can be quite painful if you have a lot of items, e.g. html/jsp/jsf
We should support adding of recursive directory content, where target path is resolved as relative to where you add from:
addManifestResource("src/main/resources/META-INF/")
The expected target in the archive would be, root + CONTAINER_PATH + ('file.getName()' + parentDirectory if in a subdirectory of specified import source )
src/main/resources/META-INF/test.html -> (CONTAINER_PATH) + test.html
src/main/resources/META-INF/images/test.jpg -> (CONTAINER_PATH) + images/test.jpg
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years
[JBoss JIRA] (SHRINKWRAP-364) API Signature nconsistency for .addAsManifestResource() and .addAsWebResource()
by Hanspeter Gisler (Created) (JIRA)
API Signature nconsistency for .addAsManifestResource() and .addAsWebResource()
-------------------------------------------------------------------------------
Key: SHRINKWRAP-364
URL: https://issues.jboss.org/browse/SHRINKWRAP-364
Project: ShrinkWrap
Issue Type: Enhancement
Components: api
Affects Versions: 1.0.0-beta-6
Environment: Windows 64bit, Netbeans 7.07, Glassfish 3.1.1, Maven 3.03, testng 6.3, arquillian resolver 1.1.0-alpha-1
Reporter: Hanspeter Gisler
If adding for example a bean.xml to a Java-Archives META-INF directory, I have to write:
{code}
...
.addAsManifestResource(beansFile, ArchivePaths.create("beans.xml"))
...
{code}
If I want to add the beans.xml to a Web-Archives WEB-INF directory, I have to write:
{code}
...
.addAsWebResource(beansFile, ArchivePaths.create("WEB-INF/beans.xml"))
...
{code}
This is error prone, as I have to remember, that addAsManifestResource puts the file into META-INF on its own, addAsWebResource on the otherhand puts it into root.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years
[JBoss JIRA] (SHRINKDESC-113) Move DescriptorNamespace out of the Public API
by Andrew Rubinger (JIRA)
Andrew Rubinger created SHRINKDESC-113:
------------------------------------------
Summary: Move DescriptorNamespace out of the Public API
Key: SHRINKDESC-113
URL: https://issues.jboss.org/browse/SHRINKDESC-113
Project: ShrinkWrap Descriptors
Issue Type: Task
Reporter: Andrew Rubinger
Assignee: Andrew Rubinger
This needs some discussion before being done. It'd break backwards-compatibility with the 1.x series.
DescriptorNamespace is mutable, which conflicts with the goals outlined in SHRINKDESC-21. We're not really testing its direct usage at the moment, and I wonder what reason end-users would have to be invoking its operations to muck around with the "namespace" of a domain object. Currently all descriptors are supporting its operations by extension:
{code}public interface WebAppDescriptor extends Descriptor, DescriptorNamespace<WebAppDescriptor>{code}
...and the methods in question as defined by DescriptorNamespace are:
{code}
public T addDefaultNamespaces();
public T addNamespace(String name, String value);
public List<String> getNamespaces();
public T removeAllNamespaces();{code}
Note that Ralf's work in SHRINKDESC-21 also splits this into DescriptorNamespace and DescriptorMutableNamespace.
My feeling is that neither should be part of the API; maybe SPI or just internals.
Discuss if it's appropriate to remove this and break the backwards-compatibility with the 1.x series. In this case, I'm willing to entertain this exception.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years