Details
-
Type:
New Feature
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 0.2.4
-
Component/s: None
-
Labels:None
Description
Hi,
Before explaining the feature I just would like to give you the context.
I'm a developer on Jawr, which is a open source tool whose the goal is to provide better performance on front end. (Please check https://jawr.dev.java.net/ ).
We would like to add a sprite generation support on Jawr. As we don't want to reinvent the wheel, SmartSprites is definitely a good candidate for it.
I'm currently working on the integration of SmartSprites and Jawr.
For now, SmartSprites is only able to deal with resources defined on a directory on the file system.
The goal of this new feature is the ability to define a resource handler to add a better extensibility to SmartSprites.
For example, we will be able to generate sprites, from CSS defined from a web site (through http ), a jar file....
So the idea here is to introduce abstraction to the resource management through a ResourceHandler.
You will find attached a patch, which add this feature.
As a bonus, I've also add the basis to define which files must be processed. ![]()
Take a look at the SpriteBuilder class.
Don't hesitate to tell me if there are things which are not clear.
I will be glad to help to improve the integration of these tools.
Cheers,
Icefox
Attachments
-
$i18n.getText("admin.common.words.hide")
- smartsprites-patch-resource-management-abstraction.zip
- 23/Jul/09 9:58 PM
- 1.46 MB
- Ibrahim Chaehoi
-
- smartsprites/.classpath 1.0 kB
- smartsprites/.project 0.4 kB
- smartsprites/build-autonomous.xml 1 kB
- smartsprites/build.xml 3 kB
- smartsprites/readme.txt 0.4 kB
- smartsprites/smartsprites.LICENSE 2 kB
- smartsprites/smartsprites.cmd 0.4 kB
- smartsprites/smartsprites.properties 3 kB
- smartsprites/smartsprites.properties.example 3 kB
- smartsprites/smartsprites.sh 0.1 kB
- smartsprites/smartsprites.version 0.0 kB
- smartsprites/lib/args4j-2.0.9.jar 40 kB
- smartsprites/lib/args4j.LICENSE 1 kB
- smartsprites/lib/commons-io-1.4.jar 106 kB
- smartsprites/lib/commons-io.LICENSE 11 kB
- smartsprites/lib/commons-lang-2.3.jar 240 kB
- smartsprites/lib/commons-lang.LICENSE 11 kB
- smartsprites/.../commons-math-1.1.LICENSE 11 kB
- smartsprites/lib/commons-math-1.1.jar 170 kB
- smartsprites/lib/.../fest-assert-1.0a1.jar 66 kB
- smartsprites/lib/.../fest-assert.LICENSE 11 kB
- smartsprites/lib/.../fest-util-0.4.jar 14 kB
- smartsprites/lib/.../fest-util.LICENSE 11 kB
- smartsprites/lib/.../junit-4.4.jar 158 kB
- smartsprites/lib/.../junit.LICENSE 0.2 kB
- smartsprites/.../google-collections.LICENSE 11 kB
- smartsprites/lib/google-collections.jar 470 kB
- smartsprites/lib/smartsprites-0.2.3.jar 78 kB
- smartsprites/src/amd/Quantize.java 31 kB
- smartsprites/.../FileSystemResourceHandler.java 3 kB
$i18n.getText("admin.common.words.show")- smartsprites-patch-resource-management-abstraction.zip
- 23/Jul/09 9:58 PM
- 1.46 MB
- Ibrahim Chaehoi
Activity
Hi Staszek,
It's fine for me, I'm currently working on the integration and I'm not blocked now.
I will try to update you on the status of the integration as you are also concerned ![]()
Enjoy your holidays ![]()
Cheers,
Ibrahim
Hi Ibrahim,
I've committed your patch and some refactorings to it. Most notably, I've simplified the definition of the ResourceHandler interface and added charset support to it. I also added two more invocations of the resource handler to SmartSprites. Please see the following changeset for details:
http://fisheye3.atlassian.com/changelog/carrot2/?cs=3618
Incidentally, as I don't see in your patch any abstraction for writing the results (CSS and sprite images), I'm assuming Jawr would simply specify some temporary directory as the output directory and collect CSS and sprites from there?
Thanks,
S.
Hi Staszek,
You are right, I didn't define an abstraction layer for the output. We will probably use a temporary folder.
But I think that it could be a good idea to define it. I think that it's not too complicated to put in place.
It will give us more flexibility in the way we are handling resource generation.
We only need to define a ResourceWriter which returns an outputStream and an outputWriter from a path.
Thanks for the quick integration of my patch.
Cheers,
Ibrahim
Hi Ibrahim,
I'll take a look at that today or tomorrow. For now it just looks like a matter of adding two methods to the ResourceHandler interface, but I'll also need to make sure it plays nicely with other features I'm planning. I'll keep you posted.
Meanwhile, feel free to download SmartSprites binaries from the build server, these have all the changes I commit. My guess is that it will be easier for you to integrate against smartsprites.jar rather than the source code (easier upgrades etc.).
SmartSprites build status: http://builds.carrot2.org/browse/SMARTSPRITES-HEAD
Artifact downloads (built on the build server): http://download.smartsprites.osinski.name/
Please let me know if I can help any further with the integration.
Cheers,
S.
Ok, I think I'll go ahead and abstract away all java.io.File references from SmartSprites. This will take a bit longer, but should ease the integration pain.
Hi Ibrahim,
I've implemented the abstraction for writing files, please download the binaries from: http://download.smartsprites.osinski.name/. I hope that from this point on, the ResourceHandler interface will not change much. Please let me know if you need any help with Jawr integration.
Thanks,
S.
Hi Staszek,
Sorry but I've been working on the jawr 3.0 release lately.
Unfortunately the smartsprite integration is not part of this release but it's planned for a future release.
Probably the next major one.
I will update you on my progress and I will tell you if I have other points to raise.
Just one point, a lot of Jawr users are using maven to manage their dependencies,
and I would like to know if you plan to release smartSprites on a maven repository.
I would be glad to help you if needed.
Thanks for your help
Cheers,
Ibrahim
Hi Ibrahim,
Take your time with implementation, no rush on my side.
Good point about Maven, I was considering doing this, but was waiting for a real use case to support it. I hope I can get it done for version 0.3.0 at the latest (SMARTSPRITES-49).
Cheers,
S.
Resolving for now, feel free to reopen if you need more changes.
Hi Ibrahim,
What a coincidence, I was just about to add an issue along the lines of this one and with the same goal – integrating with Jawr. I've used Jawr in a couple of projects (e.g.: http://search.carrot2.org) and found it an amazing tool! It would be great to see SmartSprites integrated too, that would nicely simplify our builds
Until the end of the week I'm on holiday so I may not be able to go through and commit the patch right away. I should be able get it in by the end of the next week at the latest. I hope this doesn't block your integration work too heavily? If so or if you have more questions, please shoot, I'll try to speed things up.
Thanks,
Staszek