1 person found this helpful
Is the icon you need to introduce a replacement for an existing type? If so I think you can override and replace the IconGenerator and add it to the SkinUtils class. (6.x).
Thanks for the pointer! I'll look into this in more detail tomorrow. Will let you know what I come up with.
P.S.: Should have mentioned that it's Jive 5.0 I'm looking at.
Ouch. I didn't check 5 so not sure those generators are in 5.
So the generators exist in 5. I also found Displaying a Custom Icon for a Content Type, which contains some more detailed information on the approach. However, it looks like IconGenerators are being used only in the following 2 methods of SkinUtils:
These methods are called in some places in FTLs, but SOY files often times use AbstractItemBean which calls SkinUtils.getJiveObjectCss. Following is the call trace for that method:
The generators don't come into play in this trace, at least not in Jive 5. Not sure what the reasoning behind this is, but I'm afraid I won't be able to use the generators to solve this problem.
Any other thoughts, anyone?
I spun up a local Jive 7 instance to see if anything has changed. Everything still looks the same though, I don't see how using a more recent version of Jive would help. Would love if anyone can prove me wrong though.
Sorry I was pulled away for a while. Unfortunately I can only confirm what you found. I was trying a integration with Groovy and using the expandoMeta class to override even the static methods but so far no success.
For anyone interested, I followed Using AspectJ with Spring applications in an attempt to make things work via AspectJ load time weaving. Following is a quick outline:
- Create @Aspect class in plugin
- Add aop.xml to plugin
- Add <context:load-time-weaver/> in spring.xml
- Add -javaagent:/path/to/spring-instrument-3.0.3.RELEASE.jar to startup command
Unfortunately, the result is not very encouraging:
[INFO] [talledLocalContainer] 2014-01-13 11:40:20,590 [localhost-startStop-1] [:] ERROR org.springframework.web.context.ContextLoader - Context initialization failed [INFO] [talledLocalContainer] org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.context.weaving.AspectJWeavingEnabler#0': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'loadTimeWeaver': Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.instrument.classloading.ReflectiveLoadTimeWeaver]: Constructor threw exception; nested exception is java.lang.IllegalStateException: ClassLoader [com.jivesoftware.community.util.ChainingClassLoader] does NOT provide an 'addTransformer(ClassFileTransformer)' method.
I'm no AspectJ expert, but what I'm making of this is that in order to make this work, I'd need to find a way to replace Jive's custom classloader with a LTW-compatible classloader which would likely cause all sorts of problems. I'm putting this approach on ice, but would appreciate any additional input from folks who are more familiar with AspectJ LTW.
I have posted a case for Jive support Customizing SkinUtils via Plugin in Jive7
This case has been posted in this secret group only and so hopefully you should have necessary access. Please feel free to follow and respond to same.
Based on my conversation with Kevin, following is plan of action for this issue
a) Sudhir to create a Jive support case (Done)
b) Kevin to follow up with Jive product management and include Sudhir
c) Based on discussion with Jive product management we need to make a decision around next steps for this customization.
These decision need to happen by Monday next week so that this customization can deloyed to stage. We are holding off this stage deployment due to lack of clarity around future of this customization