Saturday, May 16, 2015

Don't support MessageVariable in fromPart - Oracle SOA Suite

Don't support MessageVariable in fromPart -  Oracle SOA Suite:

This error will be thrown while invoking the service with Multipart Message type and the receive activity uses the fromPart to retrieve the parts data and assign to a variables created based on message type or invoke activity uses toPart to assign the data to parts based message type variable.




To resolve this whenever retrieving or assigning values to parts in receive/invoke activity through fromPart or toPart use the element based variables instead using the message type based variable.



Friday, May 15, 2015

window.location.href is not working while clicking on hyper link in IE

window.location.href is not working while clicking on hyper link  in IE

I was trying to redirect to a page while clicking on a hyper link with JQuery Ajax and java script windows.location.href

<a id="signout" href="">signOut<a/>

<script>
    $("#signout").click(function(){

                       $.ajax({
                        type : "POST",
                        async: false,
                        url : "/services/logout",                    
                        success : function() {
                                       window.location="/content/test/test.html";
 },
error : function() {
                                       window.location="/content/test/test.html";
}
});
    } );
</script>

This is working perfectly in both Firefox and Chrome but it is not working in IE.

In IE while redirecting the URL is stripped off to /content/test/(test.html got removed while performing the redirect)

The issue can be fixed as below by adding # in href attribute.

<a id="signout" href="#">signOut<a/>



Friday, May 8, 2015

Removing the Cookie is not working in IE10 and IE11

Removing the Cookie is not working in IE10 and IE11

While trying to remove the cookies in IE10 and IE11 through Java, the cookies are not getting removed in the browser.

The code snippet used to remove the cookie:


Cookie[] cookies = request.getCookies();
if (cookies != null) {
for (int i = 0; i < cookies.length; i++) {
String cookieName = "SampleCookieName";
Cookie cookie = cookies[i];
if (cookieName.equals(cookie.getName())) {
cookie.setPath("/");
cookie.setMaxAge(0);
response.addCookie(cookie);
}
}
}

The root cause of  the issue is IE10 and IE11 expecting the value for the attribute Expires as 0 not for Max-Age.

Fix for the issue - Use the below code to remove the cookies

Cookie[] cookies = request.getCookies();
if (cookies != null) {
for (int i = 0; i < cookies.length; i++) {
String cookieName = "SampleCookie";
Cookie cookie = cookies[i];
if (cookieName.equals(cookie.getName())) {
StringBuilder cookieString = new StringBuilder(cookieHeaderName + "=" + "" + "; ");

cookieString.append("Expires=0" + "; ");
cookieString.append("Version=0; ");
cookieString.append("Path=/; ");
cookieString.append("Max-Age=0" + "; ");
//cookieString.append("HttpOnly");

response.addHeader("Set-Cookie", cookieString.toString());
}
}
}

Refer the following blog to set cookies in IE10 and IE11 - cookie-values-are-not-setting-in-ie10-and-ie11


Thursday, May 7, 2015

Enabling Multi Site supports in Adobe Experience Manager(AEM) through Dispatcher and publisher configurations

Enabling Multi Site supports in Adobe Experience Manager(AEM) through Dispatcher and publisher configurations



Invalidate dispatcher cache after successfull jenkins build - AEM/Adobe CQ5

Invalidate dispatcher cache after successful Jenkins build - AEM/Adobe CQ5

This post will explain how to invalidate the cache in Adobe Experience Manager after successful Jenkins build.

Login to Jenkins console
Open the job and click on configuration
Add post-build step of type  “Execute Shell” and select “Run only if build succeeds”


Enter the below script and click on  - Change the dispatcher host name accordingly.

/usr/bin/curl -H "CQ-Action: DELETE" -H "CQ-Handle:/" -H "Content-Length: 0" -H "Content-Type: application/octet-stream" --noproxy .com http://<<dispatcher host name>>/dispatcher/invalidate.cache


If multiple dispatcher are configured then configure the dispatchers as shown below in the script.

/usr/bin/curl -H "CQ-Action: DELETE" -H "CQ-Handle:/" -H "Content-Length: 0" -H "Content-Type: application/octet-stream" --noproxy .com http://{dispatcher1, dispatcher2, dispatcher3, dispatcher4}.com/dispatcher/invalidate.cache