Author: dpillot
Date: Wed Sep 12 17:39:03 2007
New Revision: 778

URL: https://svndev.jahia.net/websvn/listing.php?sc=3D1&rev=3D778&repname=
=3Dcorporate_portal_templates_v2
Log:
http://www.jahia.net/jira/browse/TEMPLATES-250

Modified:
    branches/JAHIA-5-0-SP-BRANCH/src/jsp/blogs/eventlistener.inc

Modified: branches/JAHIA-5-0-SP-BRANCH/src/jsp/blogs/eventlistener.inc
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/branches/JAHIA-5-0-SP=
-BRANCH/src/jsp/blogs/eventlistener.inc&rev=3D778&repname=3Dcorporate_porta=
l_templates_v2
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- branches/JAHIA-5-0-SP-BRANCH/src/jsp/blogs/eventlistener.inc (original)
+++ branches/JAHIA-5-0-SP-BRANCH/src/jsp/blogs/eventlistener.inc Wed Sep 12=
 17:39:03 2007
@@ -1,24 +1,25 @@
 <%--
 Copyright 2002-2006 Jahia Ltd
 =

-Licensed under the JAHIA COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (JCDD=
L), =

-Version 1.0 (the "License"), or (at your option) any later version; you ma=
y =

-not use this file except in compliance with the License. You should have =

-received a copy of the License along with this program; if not, you may ob=
tain =

-a copy of the License at =

+Licensed under the JAHIA COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (JCDD=
L),
+Version 1.0 (the "License"), or (at your option) any later version; you may
+not use this file except in compliance with the License. You should have
+received a copy of the License along with this program; if not, you may ob=
tain
+a copy of the License at
 =

  http://www.jahia.org/license/
 =

-Unless required by applicable law or agreed to in writing, software =

-distributed under the License is distributed on an "AS IS" BASIS, =

-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. =

-See the License for the specific language governing permissions and =

+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
 limitations under the License.
 --%>
 <[EMAIL PROTECTED] import=3D"org.jahia.services.acl.JahiaBaseACL"%>
 <[EMAIL PROTECTED] import=3D"org.jahia.services.acl.ACLInfo"%>
 <[EMAIL PROTECTED] import=3D"org.jahia.hibernate.model.JahiaAclEntry"%>
 <[EMAIL PROTECTED] 
import=3D"org.jahia.services.usermanager.JahiaGroupManagerService"=
%>
+<%@ page import=3D"java.util.ArrayList" %>
 <%
 if ( "blogs".equals(theContainer.getDefinition().getName()) ){
     if ( "addContainerEngineAfterInit".equals(eventName) ) {
@@ -75,9 +76,9 @@
         }
     } else if ( "containerAdded".equals(eventName) ) {
         JahiaBaseACL theACL =3D new JahiaBaseACL(theContainer.getAclID());
-                =

+
         theACL.setInheritance(ACLInfo.NO_INHERITANCE);
-            =

+
         JahiaAclEntry readPermission =3D new JahiaAclEntry();
         readPermission.setPermission(JahiaBaseACL.READ_RIGHTS, JahiaAclEnt=
ry.ACL_YES);
         theACL.setGroupEntry(ServicesRegistry.getInstance().getJahiaGroupM=
anagerService().lookupGroup(
@@ -88,9 +89,9 @@
         adminPermission.setPermission(JahiaBaseACL.WRITE_RIGHTS, JahiaAclE=
ntry.ACL_YES);
         adminPermission.setPermission(JahiaBaseACL.ADMIN_RIGHTS, JahiaAclE=
ntry.ACL_YES);
         theACL.setUserEntry(jParams.getUser(), adminPermission);
-               =

-    =

-    =

+
+
+
         JahiaPage blogPage =3D (JahiaPage) theContainer.getFieldObject("bl=
ogPage");
         if (blogPage !=3D null) {
             logger.debug("Activate blogPage ["+blogPage.getID()+"]");
@@ -139,11 +140,18 @@
                 EntryLoadRequest elr =3D new EntryLoadRequest(EntryLoadReq=
uest.STAGING_WORKFLOW_STATE, 0,
                         jParams.getEntryLoadRequest().getLocales());
                 jParams.setSubstituteEntryLoadRequest(elr);
-            }            =

-        // container validation
-            Set languageCodes =3D new HashSet();
-            languageCodes.add(ContentObject.SHARED_LANGUAGE);
-            languageCodes.add(jParams.getLocale().toString());
+            }
+        // container validation (for all active languages)
+                ArrayList localeslist =3D jParams.getSite().
+                        getLanguageSettingsAsLocales(false);
+                Set languageCodes =3D new HashSet();
+                languageCodes.add(ContentObject.SHARED_LANGUAGE);
+                for (int j =3D 0; j < localeslist.size(); j++) {
+                    Locale loc =3D (Locale) localeslist.get(j);
+                    languageCodes.add(loc.toString());
+                    logger.debug("validating in "+loc.toString());
+                }
+
 =

             JahiaSaveVersion saveVersion =3D
                 ServicesRegistry.getInstance().getJahiaVersionService().
@@ -171,7 +179,7 @@
         } finally {
               if (substitutedElr)
                   jParams.resetSubstituteEntryLoadRequest();
-        }                =

+        }
 =

     }
 }

_______________________________________________
cvs_list mailing list
[email protected]
http://lists.jahia.org/cgi-bin/mailman/listinfo/cvs_list

Reply via email to