Revision history [back]

click to hide/show revision 1
initial version

answered 2012-12-06 09:08:44 +0800

gganassin gravatar image gganassin flag of Luxembourg

http://www.hybris.com/

I had the same problem once... and due to the deadline i had... the fastest ignorant solution i was able to get out from my magic hat was to place a secured .zul file like:

<zk>
    <div id="resultContainer" apply="duty.core.services.rest.ServicesController" ></div>
</zk>





public class ServicesController extends GenericAutowireComposer {

    private final static Logger _log = Logger.getLogger(ServicesController.class);  
    private final static String SERVICE = "service";

    @Override
    public void doAfterCompose(Component comp) throws Exception {
        super.doAfterCompose(comp);
        String service = Executions.getCurrent().getParameter(SERVICE);
        if (StringUtils.isEmpty(service)) {
            _log.error("no service specified");
            throw new IllegalArgumentException("invalid service called - empty");
        } else {
            ServiceDescriptor serviceDescriptor = (ServiceDescriptor) SpringUtil.getBean(service);
            // ... WHATEVAH like yours:
            EventQueue<Event> queue = EventQueues.lookup("myQueue", EventQueues.APPLICATION, true);
            queue.publish(new Event("myEvent", null, someData));
        }
    }
}

So... i was able to call via a simple HttpURLConnection my .zul file which is finally able to trigger the EventQueue for example. For sure is not elegant… but it damn worked for me :D Giovanni

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More