tag:blogger.com,1999:blog-52153482517664149572024-03-13T15:53:54.000-04:00Resilient CoderResilient Coder is a blog that will contain tutorials, tips, tricks, and various tidbits that I discover in my coding (mis)fortunes.
My primary focuses are Groovy, Grails, Google Web Toolkit (GWT), Javascript, and anything related.Stan Bhttp://www.blogger.com/profile/11534458230420815599noreply@blogger.comBlogger7125tag:blogger.com,1999:blog-5215348251766414957.post-16966140030887765052011-12-13T14:22:00.001-05:002011-12-13T14:24:02.403-05:00Offtopic: Removed AdsJust a note. I removed ads, if it bothered anyone before, sorry. I know some (maybe most) used an ad-blocker so it didn't really affect them.<br />
<br />
I have plans on migrating this blog to a nicer look soon, something more presentable. Details to come...<br />
<br />
On a second note: <a href="http://www.sencha.com/products/touch/tour">Sencha Touch Roadshow</a> in NYC was great today. Great insight on some things and great to chat with some of the guys behind the framework.Stan Bhttp://www.blogger.com/profile/11534458230420815599noreply@blogger.com0tag:blogger.com,1999:blog-5215348251766414957.post-67600034349585501682011-11-21T12:35:00.001-05:002011-11-21T12:35:42.181-05:00IBM JAX-WS JAXB Troubles and Work AroundSo one of my recent projects involved sending some data to a SOAP service. Something I took to be trivial. It was until the requirement of MTOM bindings, SAML assertions and a huge schema came into play.<br />
<br />
IBM WebSphere 6.1 (WAS) doesn't support MTOM so we had to use WAS 8.<br />
<br />
Then I hit this wonderful error:<br />
<br />
Caused by: java.lang.ClassCastException: oasis.names.tc.ebxml_regrep.xsd.rim._3.ExtrinsicObjectType incompatible with javax.xml.bind.JAXBElement<br />
at oasis.names.tc.ebxml_regrep.xsd.rim._3.RegistryObjectListType_JAXB_Serialization_Stub.write(oasis.names.tc.ebxml_regrep.xsd.rim._3.RegistryObjectListType_JAXB_Serialization_Stub.java)<br />
at oasis.names.tc.ebxml_regrep.xsd.lcm._3.SubmitObjectsRequest_JAXB_Serialization_Stub.write(oasis.names.tc.ebxml_regrep.xsd.lcm._3.SubmitObjectsRequest_JAXB_Serialization_Stub.java)<br />
at ihe.iti.xds_b._2007.ProvideAndRegisterDocumentSetRequestType_JAXB_Serialization_Stub.write(ihe.iti.xds_b._2007.ProvideAndRegisterDocumentSetRequestType_JAXB_Serialization_Stub.java)<br />
<br />
After a ticket with IBM I finally received the workaround after 3 weeks.<br />
<br />
<br />
Set the following custom JVM property<br />
com.ibm.xml.xlxp.jaxb.opti.level = 0<br />
<br />
<br />
For those who do not know how to set custom properties:<br />
<a href="http://publib.boulder.ibm.com/infocenter/wasinfo/v8r0/index.jsp?topic=%2Fcom.ibm.websphere.nd.iseries.doc%2Finfo%2Fiseriesnd%2Fae%2Fxrun_jvm.html" title="blocked::http://publib.boulder.ibm.com/infocenter/wasinfo/v8r0/index.jsp?topic=/com.ibm.websphere.nd.iseries.doc/info/iseriesnd/ae/xrun_jvm.html">http://publib.boulder.ibm.com/infocenter/wasinfo/v8r0/index.jsp?topic=%2Fcom.ibm.websphere.nd.iseries.doc%2Finfo%2Fiseriesnd%2Fae%2Fxrun_jvm.html</a>Stan Bhttp://www.blogger.com/profile/11534458230420815599noreply@blogger.com0tag:blogger.com,1999:blog-5215348251766414957.post-58639179796088881602011-10-14T11:03:00.002-04:002011-10-14T11:04:09.385-04:00Reading Metadata values in Grails scriptsAfter reading the useful post by Kevin Gill on adding build numbers to the grails build: <a href="http://www.wthr.us/2010/07/08/adding-an-auto-incrementing-build-number-to-a-grails-application/">Adding Auto Incrementing Build Number to a Grails Application</a><br />
<br />
I began to wonder how to attach the build number to the project war file. Turns out the solution was simpler than I had thought.<br />
<br />
grails.project.war.file = "target/${appName}-${appVersion}-${grails.util.Metadata.current.'app.buildNumber'.toInteger()+1}.war"Stan Bhttp://www.blogger.com/profile/11534458230420815599noreply@blogger.com0tag:blogger.com,1999:blog-5215348251766414957.post-56525539667576309452011-10-03T14:16:00.002-04:002011-10-03T14:17:41.810-04:00Refresh Browser v1.1Just a bit of self promotion...<br />
<br />
My iPad app that I built for the guys at Breakpoint IT, Refresh Browser, had its first maintenance release (v1.1)<br />
<br />
<a href="http://itunes.apple.com/qa/app/refresh-browser/id442132171?mt=8">http://itunes.apple.com/qa/app/refresh-browser/id442132171?mt=8</a><br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="http://itunes.apple.com/qa/app/refresh-browser/id442132171?mt=8"><img border="0" src="http://a4.mzstatic.com/us/r1000/094/Purple/a1/af/f3/mzl.wzldthbm.175x175-75.jpg" /></a></div><br />
So check it out and support!Stan Bhttp://www.blogger.com/profile/11534458230420815599noreply@blogger.com0tag:blogger.com,1999:blog-5215348251766414957.post-50986967991673062872011-04-20T21:27:00.002-04:002011-04-20T21:29:53.107-04:00Adobe LiveCycle ES2.5 Migration WoesSo recently I had to migrate LiveCycle ES to ES2 / ES2.5<br />
<br />
Surprisingly the install and deployment of the application went smooth. When I got Workbench installed and everything up and running it was time to migrate the old forms over to a new application and get everything working. All was well until I hit the Deploy button.<br />
<br />
<b> The resource [resourceUri] is exclusive-locked by user [userId].</b><br />
<br />
When this used to happen in LiveCycle ES there was always an unlock option in the context menu, in ES2.5 it's nowhere to be found. Numerous calls to Adobe Support no help. Until today I stumbled upon <a href="http://help.adobe.com/en_US/livecycle/9.0/programLC/help/index.htm?content=000326.html">Locking a resource using the Java API</a>. I'm not sure where this was before but it contained some valuable information. So I quickly wrote up the source for my server running on WebSphere 6.1.<br />
<br />
<pre >import java.util.*;
import com.adobe.idp.dsc.clientsdk.ServiceClientFactory;
import com.adobe.idp.dsc.clientsdk.ServiceClientFactoryProperties;
import com.adobe.repository.bindings.dsc.client.ResourceRepositoryClient;
import com.adobe.repository.infomodel.bean.*;
public class UnlockFile {
public static void main(String[] args) {
try {
Properties connectionProps = new Properties();
connectionProps.setProperty(
ServiceClientFactoryProperties.DSC_DEFAULT_EJB_ENDPOINT,
"iiop://myhost:2809");
connectionProps.setProperty(
ServiceClientFactoryProperties.DSC_TRANSPORT_PROTOCOL,
ServiceClientFactoryProperties.DSC_EJB_PROTOCOL);
connectionProps.setProperty(
ServiceClientFactoryProperties.DSC_SERVER_TYPE,
ServiceClientFactoryProperties.DSC_WEBSPHERE_SERVER_TYPE);
connectionProps.setProperty(
ServiceClientFactoryProperties.DSC_CREDENTIAL_USERNAME,
"login");
connectionProps.setProperty(
ServiceClientFactoryProperties.DSC_CREDENTIAL_PASSWORD,
"pass");
ServiceClientFactory myFactory = ServiceClientFactory
.createInstance(connectionProps);
ResourceRepositoryClient repositoryClient = new ResourceRepositoryClient(
myFactory);
String resourceUri = "/MyResourceDir/";
for (Resource resource : (List<resource>) repositoryClient
.listMembers(resourceUri)) {
repositoryClient.unlockResource(resource.getPath());
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
</pre><br />
What I did here to make my life easier instead of going through 50 forms 1 by 1 You can pass in their parent directory as a ResourceURI. <br />
<br />
Hope this helps. Thanks to the Adobe docs, wish they were much easier to find though. Seems they became better for crawlers recently because I haven't seen these links when I was searching for this a little while ago.Stan Bhttp://www.blogger.com/profile/11534458230420815599noreply@blogger.com0tag:blogger.com,1999:blog-5215348251766414957.post-74099561220691076172011-04-07T18:56:00.002-04:002011-04-07T19:06:58.951-04:00Sencha Touch Scrolling a Non Touch Blackberry OS 6 DeviceThis is a follow up to my <a href="http://resilientcoder.blogspot.com/2011/03/getting-sencha-touch-to-work-on-non.html">first post</a> about getting clicking to work on Non-Touch Blackberry OS 6 devices with the Sencha Touch framework.<br />
<br />
I have come up with a way to get the components to scroll when you move your mouse to the edges. It is a bit rough around the edges and can use some polish but it's a working example and can be used.<br />
<br />
This does not require any hacking of the Sencha Touch library which is both good and bad. The good is that you don't have to mess with the library risking something to get broken the bad is that you have to add this for every panel.<br />
<br />
Without further ado here's an example Panel implementing a List:<br />
<br />
<pre class="brush: javascript">var scrollList;
app.views.scrollList = Ext.extend(Ext.Panel, {
listeners: {
mousemove: {
element: 'el',
fn: function (evt, div, el) {
if (scrollList.scroller.offsetBoundary.top == 0) {
scrollList.scroller.updateBoundary();
}
var maxOffset = scrollList.scroller.offsetBoundary[1] - 400;
if (evt.xy[1] > 300 && scrollList.scroller.offset.y >= maxOffset) {
var offset = -1 * scrollList.scroller.offset.y + 10;
scrollList.scroller.scrollTo({
x: 0,
y: offset
});
} else if (evt.xy[1] < 60 && scrollList.scroller.offset.y <= 0) {
scrollList.scroller.scrollTo({
x: 0,
y: (-1 * scrollList.scroller.offset.y) - 10
});
}
}
}
},
dockedItems: [{
xtype: 'toolbar',
title: 'Scroll List'
}],
items: [{
xtype: 'list',
id: 'scrollList',
height: 275,
scroll: 'vertical',
store: app.stores.scrollList,
itemTpl: '{a}, {b}',
onItemDisclosure: function (record) {
}
}],
initComponent: function () {
app.stores.scrollList.load();
app.views.scrollList.superclass.initComponent.apply(this, arguments);
scrollList = Ext.getCmp('scrollList');
}
});
</pre>
What we do here is we attach a mousemove listener to the underlying panel and call the scrollTo() function on the list's Ext.util.Scroller instance.
If anyone has any improvements/suggestions/their own implementation I would love to hear it.
<br>
Here's a demo:
<iframe title="YouTube video player" width="480" height="390" src="http://www.youtube.com/embed/CRK5pI2W2K8" frameborder="0" allowfullscreen></iframe>
<br />
<br />
Hope this helps those who have hit this problem and hopefully Sencha will implement this the "right" way.Stan Bhttp://www.blogger.com/profile/11534458230420815599noreply@blogger.com10tag:blogger.com,1999:blog-5215348251766414957.post-2308414764723167012011-03-28T03:14:00.001-04:002011-03-28T03:15:20.083-04:00Getting Sencha Touch to work on Non Touch Blackberry 6 DevicesRecently I decided to begin researching the current batch of options for cross-platform mobile development with a primary target device being the Blackberry Bold.<br />
The good news is the phone runs a WebKit browser, the bad news is that the phone still sucks. Nonetheless, without much digging a seemingly wonderful framework was brought to my attention from a company I'm familiar with, Sencha, the company behind the <a href="http://www.sencha.com/products/extgwt/">Ext-GWT</a> framework. <br />
<a href="http://www.sencha.com/products/touch/">Sencha Touch</a> is probably the most powerful HTML5 mobile frameworks out today. However with all its greatness it has one shortcoming: Though they state they have Blackberry 6 support, they really only support one Blackberry 6 device, the Torch. <br />
<br />
So what happens when you try to access an app built using Sencha Touch on a non-touch Blackberry? It renders well but you can't click anything, making the app just eye candy.<br />
<br />
Alas, there is a quick and dirty solution to it.<br />
<br />
<span style="font-size: x-small;"><b>NOTE: </b>There are two versions of Sencha Touch, the open source (GPLv3) and the paid commercial license. This solution involves modifying the Sencha Touch source. I only show it as a demonstration, use it as-is. </span><br />
<br />
<span style="font-size: x-small;"><span style="font-size: small;">Sencha Touch provides a wrapper for mouse & touch events to support gestures, dragging and touching. This modification involves making Sencha think of the Blackberry as if it were a standalone browser in terms of input. This may not be the best/only/right solution but it's a start. </span></span><br />
<br />
<span style="font-size: x-small;"><span style="font-size: small;">I looked at the sencha-touch-debug.js file since its detailed and I could understand what was going on. </span></span><br />
<span style="font-size: x-small;"><span style="font-size: small;"> </span></span><br />
<span style="font-size: x-small;"><span style="font-size: small;">The three changes that need to be made are:</span></span><br />
<blockquote><span style="font-size: x-small;"><span style="font-size: small;">Line 4763:</span></span><br />
Touch: ('ontouchstart' in window) && (!Ext.is.Desktop && !Ext.is.Blackberry),<br />
<br />
Line 13964:<br />
if (!Ext.desktop && !Ext.Blackberry) {...}<br />
<br />
Line 18217:<br />
if (Ext.is.Desktop || Ext.is.Blackberry) {...}</blockquote><br />
There you have it.<br />
<br />
Hopefully future versions of Sencha Touch will implement support for non-touch Blackberry 6 devices through a much better way than my hack.Stan Bhttp://www.blogger.com/profile/11534458230420815599noreply@blogger.com15