diff --git a/ccm-core/src/com/arsdigita/categorization/Category.java b/ccm-core/src/com/arsdigita/categorization/Category.java index 177fdee05..5671abe00 100755 --- a/ccm-core/src/com/arsdigita/categorization/Category.java +++ b/ccm-core/src/com/arsdigita/categorization/Category.java @@ -386,7 +386,10 @@ public class Category extends ACSObject { localizationExists(locale)) { // Return value of isEnabled from localized version, so categories could be disabled depending on locale - return m_categoryLocalizationCollection.getName(); + String name = m_categoryLocalizationCollection.getName(); + m_categoryLocalizationCollection.rewind(); + return name; + //return m_categoryLocalizationCollection.getName(); } else { @@ -563,7 +566,10 @@ public class Category extends ACSObject { localizationExists(locale)) { // Return value of isEnabled from localized version, so categories could be disabled depending on locale - return m_categoryLocalizationCollection.getDescription(); + String description = m_categoryLocalizationCollection.getDescription(); + m_categoryLocalizationCollection.rewind(); + return description; + //return m_categoryLocalizationCollection.getDescription(); } else { @@ -633,7 +639,10 @@ public class Category extends ACSObject { localizationExists(locale)) { // Return value of isEnabled from localized version, so categories could be disabled depending on locale - return m_categoryLocalizationCollection.getURL(); + String url = m_categoryLocalizationCollection.getURL(); + //return m_categoryLocalizationCollection.getURL(); + m_categoryLocalizationCollection.rewind(); + return url; } else { @@ -704,7 +713,10 @@ public class Category extends ACSObject { localizationExists(locale)) { // Return value of isEnabled from localized version, so categories could be disabled depending on locale - return m_categoryLocalizationCollection.isEnabled(); + boolean isEnabled = m_categoryLocalizationCollection.isEnabled(); + m_categoryLocalizationCollection.rewind(); + return isEnabled; + //return m_categoryLocalizationCollection.isEnabled(); } else { diff --git a/ccm-core/src/com/arsdigita/categorization/CategoryLocalizationCollection.java b/ccm-core/src/com/arsdigita/categorization/CategoryLocalizationCollection.java index 3f0e014d5..a3f6c62ba 100644 --- a/ccm-core/src/com/arsdigita/categorization/CategoryLocalizationCollection.java +++ b/ccm-core/src/com/arsdigita/categorization/CategoryLocalizationCollection.java @@ -33,6 +33,8 @@ import com.arsdigita.persistence.DataCollection; **/ public class CategoryLocalizationCollection extends ACSObjectCollection { + private String lastFoundLocale; + public CategoryLocalizationCollection(Category category) { super(category.getLocalizations().getDataCollection()); } @@ -111,10 +113,11 @@ public class CategoryLocalizationCollection extends ACSObjectCollection { /** * Search for the requested localization in the Collection * + * @param locale * @return result of the search. If true, the CollectionCursor is set to the position of the requested locale. */ public boolean localizationExists(String locale) { - + // Really string comparison using != ?? // && !locale.isEmpty() ? if (!m_dataCollection.isEmpty() && locale != "") { diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciMemberSciDepartmentsCollection.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciMemberSciDepartmentsCollection.java index 6e136b2ea..87d0f566e 100644 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciMemberSciDepartmentsCollection.java +++ b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciMemberSciDepartmentsCollection.java @@ -40,7 +40,7 @@ public class SciMemberSciDepartmentsCollection extends DomainCollection { public SciMemberSciDepartmentsCollection(DataCollection dataCollection) { super(dataCollection); - m_dataCollection.addFilter(String.format("type = %s", + m_dataCollection.addFilter(String.format("type = '%s'", ContentType. findByAssociatedObjectType(SciDepartment.class.getName()).getID(). toString())); diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciMemberSciOrganizationsCollection.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciMemberSciOrganizationsCollection.java index 4470203b5..bdace84a8 100644 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciMemberSciOrganizationsCollection.java +++ b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciMemberSciOrganizationsCollection.java @@ -40,7 +40,7 @@ public class SciMemberSciOrganizationsCollection extends DomainCollection { public SciMemberSciOrganizationsCollection(DataCollection dataCollection) { super(dataCollection); - m_dataCollection.addFilter(String.format("type = %s", + m_dataCollection.addFilter(String.format("type = '%s'", ContentType. findByAssociatedObjectType(SciOrganization.class.getName()). getID().toString())); diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciMemberSciProjectsCollection.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciMemberSciProjectsCollection.java index 2ad19c2d8..36aab5820 100644 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciMemberSciProjectsCollection.java +++ b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciMemberSciProjectsCollection.java @@ -40,7 +40,7 @@ public class SciMemberSciProjectsCollection extends DomainCollection { public SciMemberSciProjectsCollection(DataCollection dataCollection) { super(dataCollection); - m_dataCollection.addFilter(String.format("type = %s", + m_dataCollection.addFilter(String.format("type = '%s'", ContentType. findByAssociatedObjectType(SciProject.class.getName()).getID(). toString())); diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationPanel.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationPanel.java index b774832fe..cb7abccd1 100644 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationPanel.java +++ b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationPanel.java @@ -194,7 +194,7 @@ public class SciOrganizationPanel extends SciOrganizationBasePanel { GenericOrganizationalUnitPersonCollection heads; heads = department.getPersons(); - heads.addFilter("link.role_name = 'head'"); + heads.addFilter("link.role_name = 'head' and link.status = 'active'"); heads.addOrder("surname asc, givenname asc"); if (heads.size() > 0) {