if ( proxyDsHandlers.size() == 1 && proxyDsHandlers.containsKey( "latest.xml") )
{
Object o = proxyDsHandlers.get( "latest.xml");
if ( o instanceof SimpleLatestProxyDsHandler )
{
SimpleLatestProxyDsHandler pdh = (SimpleLatestProxyDsHandler) o;
String name = pdh.getProxyDatasetName();
boolean top = pdh.isLocateAtTopOrBottom();
String serviceName = pdh.getProxyDatasetService( null ).getName();
addProxiesElem = new Element( "addLatest", defNS );
if ( name.equals( "latest.xml") && top && serviceName.equals( "latest"))
return addProxiesElem;
else
{
Element simpleLatestElem = new Element( "simpleLatest", defNS );
simpleLatestElem.setAttribute( "name", name);
simpleLatestElem.setAttribute( "top", top ? "true" : "false");
simpleLatestElem.setAttribute( "servicName", serviceName );
addProxiesElem.addContent( simpleLatestElem );
return addProxiesElem;
}
}
}
// Write "addProxies" element
addProxiesElem = new Element( "addProxies", defNS );
for ( Iterator it = proxyDsHandlers.keySet().iterator(); it.hasNext(); )
{
String curName = (String) it.next();
ProxyDatasetHandler curPdh = (ProxyDatasetHandler) proxyDsHandlers.get( curName );
if ( curPdh instanceof SimpleLatestProxyDsHandler )
{
SimpleLatestProxyDsHandler sPdh = (SimpleLatestProxyDsHandler) curPdh;
Element simpleLatestElem = new Element( "simpleLatest", defNS );
simpleLatestElem.setAttribute( "name", sPdh.getProxyDatasetName() );
simpleLatestElem.setAttribute( "top", sPdh.isLocateAtTopOrBottom() ? "true" : "false" );
simpleLatestElem.setAttribute( "servicName", sPdh.getProxyDatasetService( null ).getName() );
addProxiesElem.addContent( simpleLatestElem );
}
else if ( curPdh instanceof LatestCompleteProxyDsHandler )
{
LatestCompleteProxyDsHandler lcPdh = (LatestCompleteProxyDsHandler) curPdh;