Revision: 45516
Author: aschrijvers
Date: 2014-07-15 17:45:40 +0200 (Tue, 15 Jul 2014)
Log Message:
-----------
HSTTWO-3025 add availability as extra check
Modified Paths:
--------------
hippo-cms7/site-toolkit/trunk/components/resourcebundle/src/main/java/org/hippoecm/hst/resourcebundle/internal/HippoRepositoryResourceBundleFamilyFactory.java
Modified:
hippo-cms7/site-toolkit/trunk/components/resourcebundle/src/main/java/org/hippoecm/hst/resourcebundle/internal/HippoRepositoryResourceBundleFamilyFactory.java
===================================================================
---
hippo-cms7/site-toolkit/trunk/components/resourcebundle/src/main/java/org/hippoecm/hst/resourcebundle/internal/HippoRepositoryResourceBundleFamilyFactory.java
2014-07-15 15:30:18 UTC (rev 45515)
+++
hippo-cms7/site-toolkit/trunk/components/resourcebundle/src/main/java/org/hippoecm/hst/resourcebundle/internal/HippoRepositoryResourceBundleFamilyFactory.java
2014-07-15 15:45:40 UTC (rev 45516)
@@ -39,6 +39,7 @@
import org.hippoecm.hst.resourcebundle.PlaceHolderEmptyResourceBundleFamily;
import org.hippoecm.hst.resourcebundle.ResourceBundleFamily;
import org.hippoecm.hst.resourcebundle.SimpleListResourceBundle;
+import org.hippoecm.repository.api.HippoNodeType;
import org.hippoecm.repository.util.NodeIterable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -76,7 +77,14 @@
for (Credentials credentials : creds) {
try {
// the order by @resourcebundle:id is only added to avoid that
QueryResult#getSize() or QueryResult#getNodes#getSize can return -1
- String statement = "//element(*,
resourcebundle:resourcebundle)[@resourcebundle:id='" + basename + "'] order by
@resourcebundle:id";
+ String hippoAvailabilityConstraint =
HippoNodeType.HIPPO_AVAILABILITY ;
+ if (credentials == previewCredentials) {
+ hippoAvailabilityConstraint += "='preview'";
+ } else {
+ hippoAvailabilityConstraint += "='live'";
+ }
+ String statement = "//element(*,
resourcebundle:resourcebundle)[@resourcebundle:id='" + basename + "' and " +
+ " "+hippoAvailabilityConstraint+"] order by
@resourcebundle:id";
session = repository.login(credentials);
Query query =
session.getWorkspace().getQueryManager().createQuery(statement, Query.XPATH);
_______________________________________________
Hippocms-svn mailing list
[email protected]
https://lists.onehippo.org/mailman/listinfo/hippocms-svn