RegistryController getComponentBindings bug?

sito <[email protected]>
Newsgroups gmane.comp.cms.infoglue.devel
Message-ID <[email protected]>
The "viewContentTreeForMultipleAssetComponentBinding.vm" generates code  
inside SiteNode attribute "ComponentStructure".
example: ---- <binding assetKey="" entity="Content" 
entityId="262997"></binding>----
This  code contains "assetKey" attribute which doesn't match with the 
Pattern of the function "RegistryController.getComponentBindings()", and 
this shouldn't happen.

Our solution patch accepts this attribute:

### Eclipse Workspace Patch 1.0
#P IG2972UIB
Index: 
src/java/org/infoglue/cms/controllers/kernel/impl/simple/RegistryController.java
===================================================================
RCS file: 
/home/cvsroot/infoglue/src/java/org/infoglue/cms/controllers/kernel/impl/simple/RegistryController.java,v
retrieving revision 1.37
diff -u -r1.37 RegistryController.java
--- 
src/java/org/infoglue/cms/controllers/kernel/impl/simple/RegistryController.java    
9 Jul 2008 15:34:34 -0000    1.37
+++ 
src/java/org/infoglue/cms/controllers/kernel/impl/simple/RegistryController.java    
16 Oct 2009 12:08:31 -0000
@@ -684,7 +684,7 @@
     {
         List foundComponents = new ArrayList();
 
-        Pattern pattern = Pattern.compile("<binding entity=\".*?\" 
entityId=\".*?\">");
+        Pattern pattern = Pattern.compile("<binding (assetKey=\"\" 
)?entity=\".*?\" entityId=\".*?\">");
         Matcher matcher = pattern.matcher(versionValue);
         while ( matcher.find() )
         {
@@ -693,13 +693,13 @@
             String entityName;
             String entityId;
            
-            int entityNameStartIndex = match.indexOf("\"");
-            int entityNameEndIndex = match.indexOf("\"", 
entityNameStartIndex + 1);
+            int entityNameStartIndex = match.indexOf("entity=\"");
+            int entityNameEndIndex = match.indexOf("\"", 
entityNameStartIndex + 8);
             logger.info("entityNameStartIndex:" + entityNameStartIndex);
             logger.info("entityNameEndIndex:" + entityNameEndIndex);
             if(entityNameStartIndex > 0 && entityNameEndIndex > 0 && 
entityNameEndIndex > entityNameStartIndex)
             {
-                entityName = match.substring(entityNameStartIndex + 1, 
entityNameEndIndex);
+                entityName = match.substring(entityNameStartIndex + 8, 
entityNameEndIndex);
                 logger.info("entityName:" + entityName);
 
                 int entityIdStartIndex = match.indexOf("\"", 
entityNameEndIndex + 1);

-- 
--------------======ooOO000OOoo======---------------
Vicente Javier Rosselló Ferrer
E-mail: vrossello [arroba] uib.es
Tel: 971 17 2884
Centre de Tecnologies de la Informació a la UIB
CTI - http://www.cti.uib.es
Edifici Anselm Turmeda
Ctra. Valldemossa 7.5km
Universitat de les Illes Balears - http://www.uib.es
==================================================== 



------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.