[Yanel-dev] How should we handle translations which do not exist yet?

Josias Thöny josias.thoeny at wyona.com
Fri Apr 20 15:28:15 CEST 2007


Michael Wechner wrote:
> Hi
> 
> Thanks to Josias we now can configure the translation managers. Please 
> see for instance
> 
> src/realms/yanel-website/config/yanel-realm-config.xml
> 
> and in action at
> 
> http://127.0.0.1:8080/yanel/yanel-website/en/download/index.html
> 
> Now the german and spanish page do not exist yet and one receives a 404.
> 
> I guess it would make sense that the translation manager is checking if 
> the translations actually exists and
> one can decide within the XSLT what to do about it.
> 
> WDYT?

Actually it's checking for existance already. However it uses the 
exists() method of the resource, and not all resource types implement 
this method. Is there a better way to check?
Attached is a patch for the exists() method of the NodeResource.
It should fix the problem, because if a resource does not exist, it's 
type will always fall back to the NodeResource.
The result is that only language links to existing language versions 
will be shown. Maybe in the case where only one language version exists, 
we shouldn't display the language link. WDYT?

josias


> 
> Cheers
> 
> Michi
> 

-------------- next part --------------
Index: src/resources/file/src/java/org/wyona/yanel/impl/resources/NodeResource.java
===================================================================
--- src/resources/file/src/java/org/wyona/yanel/impl/resources/NodeResource.java	(revision 23920)
+++ src/resources/file/src/java/org/wyona/yanel/impl/resources/NodeResource.java	(working copy)
@@ -284,8 +284,7 @@
     }
 
     public boolean exists() throws Exception {
-        log.warn("Not implemented yet!");
-        return true; 
+        return getRealm().getRepository().existsNode(getPath());
     }
 
     /**


More information about the Yanel-development mailing list