Mike Halford

Ranch Hand
+ Follow
since Jul 13, 2005
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Mike Halford

Francois Nadeau wrote:Hi Mike,

I am not sure what t2 refers to, but if you are still stuck on this you can use session's createSQLQuery function to query the database within a SQL function.


aha, t2 should've been t . Thanks. I've worked round it now using SQL functions.
Hi Chaps,
I have been using a query in Mysql ..

This won't work on planet Hibernate it complains about the operators in the Sum function. Any ideas on an HQL version of the query ?

I have two classes - abbreviated for clarity.


There are 5 different categories in the categories table and I'm trying to use an outer join to get me the number of times each category occurs in the progress table; e.g.
Error Category A 16839
Error Category B 22871
Error Category C 10
Invalid Entity 6706
No Error 201186

This query is working fine..

EXCEPT that if there are no occurences of a Category in the Progress table
I would like to see Error Category C 0 for example. The trouble is that in such a case the output is:
Error Category A 16839
Error Category B 22871
Invalid Entity 6706
No Error 201186

i.e no count for Error Category C 0.
In good ol' SQL the outer join works fine, but HQL doesn't seem to return null rows. Is this just a feature of HQL or am I doing something wrong???

Is it possible to disable the 'Window'-Close All Perspectives' option via an Eclispe plug-in?

Later that same evening...Yes it is, it's quite straightforward really
[ November 27, 2008: Message edited by: Mike Halford ]
I'm using the Rapid Deployment Feature of WAS6.1. The autoAppInstall is working fine for a standalone server. When I try to deploy to a test box with Network deployment I'm seeing this error message.

ADMA5033E: The target server {0} specified for {2} is a part of cluster {1} but the cluster {1} is not specified in the list of targets.
Explanation: A module can not be installed on a cluster member without also specifying the cluster as a target.
User Response: Specify the cluster as a module target also.

However, I can't find any info on HOW to specify the cluster as a module target. How can I do this?
13 years ago
Woops, it was me not cloning objects properly
14 years ago
I'm now explicitly using PortletScope, just to be on the safe side and it has made no difference. The behaviour is the same if I logon in another browser

I'm using a singleton to build the initial treemap. When the portlet calls the singleton it gets a copy of the TreeMap. The portlet copy of the TreeMap is kept in the PortletSession. The portlet initialises a view bean with data from the TreeMap, the view bean is added to the PortletSession.
14 years ago
Hi Cameron,
Great books I thought you may have spotted my deliberate mistake there but all I'm using to get the session is....
PortletSession portletSession = request.getPortletSession();
14 years ago
I've written a portlet which displays a directory structure that the user can navigate to access files. This is working fine. Putting it simply the directory structure and current state, ie which directory the user has navigated to, is stored in a TreeMap which is stored in the PortletSession.

The requirement is for the user to be able to view two directory structures so I have duplicated the portlet, so I have DirectoryPortlet1 and DirectoryPortlet2. I have each Portlet on a different page.

However, the problem is that if I navigate to a directory on one page, then when I look the other page then then the navigational state is the same. It appears that although I have two portlets they are sharing the same PortletSession. How do I can have a separate session for each portlet?
14 years ago

Originally posted by Sanjay Kannan:
Were you able to solve it.. I can give a try if you still have problem.. mail me your requirement and what you tried till now..

Hi, I ended up editing sideNav.jspf and stepping over the side nav code if the parent of the current node is the relevant label eg:


[ November 27, 2007: Message edited by: Mike Halford ]
14 years ago
I hope I've landed in the right place-hopefully it'll be more use than the InfoCenter

I've added a few pages under a label (the label has a unique name). In topnav.jspf I have the following navigation code....

This works fine, ie just the pages under the Label are shown in the topnav. However when I select one of the pages, the page shows it's siblings in the sidenav -which is not what I want to happen. Setting the pages' navigation theme in Portal Admin doesn't make any difference. So, I'm trying to find a way to tweak sideNav.jspf to not show a menu if a page is a child of the Label with the uniqueName. Trouble is I can't find an easy way to do it

using I can ascertain if the parent node is a label or not but then how do I retrieve the scopeUniqueName from the Label ???

[ November 16, 2007: Message edited by: Mike Halford ]
[ November 16, 2007: Message edited by: Mike Halford ]
14 years ago
Thanks for that link, that's useful. Maybe the stone is going to have to crumble afterall It would seem that they are going to have to change it to a urn.


What does "the code works ok" mean? What failure occurs when the URI scheme name is omitted? The scheme name can also be interpreted as a transport protocol for resource access. So when "http://" is added the "code may start to work" because:

* The addition of the scheme name makes the XML document valid so that it can be processed properly.
* Something is interpreting that URI as an URL and tries to access it (when it shouldn't).

What I meant was that that with the addition of the


the canicalization works.
14 years ago
Thanks, you've made a couple of assumptions about what I've assumed though.
The problem we have is referred to on this page canonicalization. This is the relevant quote

The difficulties arise due to the loss of the following information not available in the data model :
1. base URI, especially in content derived from the replacement text of external general parsed entity references

Further on

The processing SHOULD create a new document in which relative URIs have been converted to absolute URIs, thereby mitigating any security risk for the new

I am aware of that


We have a relative URI in the doc that we are attempting to canonicalize, that is more or less cast in stone. I was asking for suggestions on the most efficient way to work round the problem. The option suggested on w3, ie creating a new doc does seem to be a bit of a performance hit.
14 years ago
Looking at this (from
w3.org stuff)
The difficulties arise due to the loss of the following information not available in the data model:
1. base URI, especially in content derived from the replacement text of external general parsed entity references
2. notations and external unparsed entity references
3. attribute types in the document type declaration

In the first case, note that a document containing a relative URI [URI] is only operational when accessed from a specific URI that provides the proper base URI. In addition, if the document contains external general parsed entity references to content containing relative URIs, then the relative URIs will not be operational in the canonical form, which replaces the entity reference with internal content (thereby implicitly changing the default base URI of that content). Both of these problems can typically be solved by adding support for the xml:base attribute [XBase] to the application, then adding appropriate xml:base attributes to document element and all top-level elements in external entities. In addition, applications often have an opportunity to resolve relative URIs prior to the need for a canonical form. For example, in a digital signature application, a document is often retrieved and processed prior to signature generation. The processing SHOULD create a new document in which relative URIs have been converted to absolute URIs, thereby mitigating any security risk for the new document.

Given that we have the following code flow:
SOAPMessageContext smc; //passed value

SOAPMessage msg = smc.GetMessage();

Canonicalizer c14n = Canonicalizer.getInstance(ALGO_ID_C14N_EXCL_OMIT_COMMENTS);

byte [] body = c14n.canonicalizeSubtree(msg.getBody());


This gives us the ol' 'relative URI being used in the namespace' chestnut.
<ns urLine xmlns:ns="www.ourco.com/release/v4.5" ...>
more stuff here
</ns urLine>

The message is Node-Set contains relative namespace URI ns=www.ourco.com/release/v4.5

The code works ok when the namespace is changed to <ns urLine xmlns:ns="http://www.ourco.com/release/v4.5" ...>

What's the best way of solving the relative uri problem, given that we can't change the passed doc ?
14 years ago
Woops, I'd forgotten about this post. Sorry, the moment has passed now
15 years ago