Package org.ametys.web.filter
Class SharedContentsHelper
- java.lang.Object
-
- org.ametys.web.filter.SharedContentsHelper
-
public final class SharedContentsHelper extends Object
Helper for creating expression for shared contents
-
-
Constructor Summary
Constructors Modifier Constructor Description private
SharedContentsHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
copyTitle(Content srcContent, DefaultSharedContent targetContent)
Copy the title of the source content to the target contentstatic Query
getContentAccessQuery(Site currentSite, Iterable<Site> sites)
Get the expression for shared contentsstatic Query
getContentAccessQuery(Site currentSite, Site site)
Get the expression for shared contentsstatic Query
getContentAccessQueryForPrivateClosedSites(Collection<String> siteNames)
Get the expression corresponding to the shared contents of privates sitesstatic Query
getContentAccessQueryForPrivateOrProtectedOutsideSites(Collection<String> siteNames)
Get the expression corresponding to the shared contents of private or protected sitesstatic Query
getContentAccessQueryForPublicOrProtectedClosedSites(Collection<String> siteNames)
Get the expression corresponding to the shared contents of public or protected sitesstatic Query
getContentAccessQueryForPublicOutsideSites(Collection<String> siteNames)
Get the expression corresponding to the shared contents of public sitesstatic Expression
getSharedContentsExpression(Site currentSite, AmetysObjectIterable<Site> sites)
Get the expression for shared contentsstatic Expression
getSharedContentsExpression(Site currentSite, Site site)
Get the expression for shared contentsstatic Expression
getSharedContentsExpressionForPrivateClosedSites(List<String> siteNames)
Get the expression corresponding to the shared contents of privates sitesstatic Expression
getSharedContentsExpressionForPrivateOrProtectedOutsideSites(List<String> siteNames)
Get the expression corresponding to the shared contents of private or protected sitesstatic Expression
getSharedContentsExpressionForPublicOrProtectedClosedSites(List<String> siteNames)
Get the expression corresponding to the shared contents of public or protected sitesstatic Expression
getSharedContentsExpressionForPublicOutsideSites(List<String> siteNames)
Get the expression corresponding to the shared contents of public sites
-
-
-
Constructor Detail
-
SharedContentsHelper
private SharedContentsHelper()
-
-
Method Detail
-
copyTitle
public static void copyTitle(Content srcContent, DefaultSharedContent targetContent) throws AmetysRepositoryException
Copy the title of the source content to the target content- Parameters:
srcContent
- The source contenttargetContent
- The shared target content- Throws:
AmetysRepositoryException
- if an error occurs.
-
getSharedContentsExpression
public static Expression getSharedContentsExpression(Site currentSite, Site site)
Get the expression for shared contents- Parameters:
currentSite
- the current sitesite
- the site of contents to find- Returns:
- the expression to aware of privacy of contents or null if sites are equals
-
getSharedContentsExpression
public static Expression getSharedContentsExpression(Site currentSite, AmetysObjectIterable<Site> sites)
Get the expression for shared contents- Parameters:
currentSite
- the current sitesites
- all sites- Returns:
- the expression to aware of privacy of contents
-
getSharedContentsExpressionForPrivateClosedSites
public static Expression getSharedContentsExpressionForPrivateClosedSites(List<String> siteNames)
Get the expression corresponding to the shared contents of privates sites- Parameters:
siteNames
- the site names of private and closed sites- Returns:
- the expression corresponding to the shared contents of privates sites
-
getSharedContentsExpressionForPublicOrProtectedClosedSites
public static Expression getSharedContentsExpressionForPublicOrProtectedClosedSites(List<String> siteNames)
Get the expression corresponding to the shared contents of public or protected sites- Parameters:
siteNames
- the list of public or protected sites- Returns:
- the expression corresponding to the shared contents of public or protected sites
-
getSharedContentsExpressionForPublicOutsideSites
public static Expression getSharedContentsExpressionForPublicOutsideSites(List<String> siteNames)
Get the expression corresponding to the shared contents of public sites- Parameters:
siteNames
- the list of public sites- Returns:
- the expression corresponding to the shared contents of public sites
-
getSharedContentsExpressionForPrivateOrProtectedOutsideSites
public static Expression getSharedContentsExpressionForPrivateOrProtectedOutsideSites(List<String> siteNames)
Get the expression corresponding to the shared contents of private or protected sites- Parameters:
siteNames
- the list of private or protected sites- Returns:
- the expression corresponding to the shared contents of private or protected sites
-
getContentAccessQuery
public static Query getContentAccessQuery(Site currentSite, Site site)
Get the expression for shared contents- Parameters:
currentSite
- the current sitesite
- the site of contents to find- Returns:
- the expression to aware of privacy of contents or null if sites are equals
-
getContentAccessQuery
public static Query getContentAccessQuery(Site currentSite, Iterable<Site> sites)
Get the expression for shared contents- Parameters:
currentSite
- the current sitesites
- all sites- Returns:
- the expression to aware of privacy of contents
-
getContentAccessQueryForPrivateClosedSites
public static Query getContentAccessQueryForPrivateClosedSites(Collection<String> siteNames)
Get the expression corresponding to the shared contents of privates sites- Parameters:
siteNames
- the site names of private and closed sites- Returns:
- the expression corresponding to the shared contents of privates sites
-
getContentAccessQueryForPublicOrProtectedClosedSites
public static Query getContentAccessQueryForPublicOrProtectedClosedSites(Collection<String> siteNames)
Get the expression corresponding to the shared contents of public or protected sites- Parameters:
siteNames
- the list of public or protected sites- Returns:
- the expression corresponding to the shared contents of public or protected sites
-
getContentAccessQueryForPublicOutsideSites
public static Query getContentAccessQueryForPublicOutsideSites(Collection<String> siteNames)
Get the expression corresponding to the shared contents of public sites- Parameters:
siteNames
- the list of public sites- Returns:
- the expression corresponding to the shared contents of public sites
-
getContentAccessQueryForPrivateOrProtectedOutsideSites
public static Query getContentAccessQueryForPrivateOrProtectedOutsideSites(Collection<String> siteNames)
Get the expression corresponding to the shared contents of private or protected sites- Parameters:
siteNames
- the list of private or protected sites- Returns:
- the expression corresponding to the shared contents of private or protected sites
-
-