Package org.mycore.frontend
Class MCRLayoutUtilities
java.lang.Object
org.mycore.frontend.MCRLayoutUtilities
Xalan extention for navigation.xsl
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
static final int
static final String
static final int
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
Verifies, if an item of navigation.xml has a given $permission.static boolean
Verifies, if an item of navigation.xml has a given $permission with a stop item ($blockerWebpageID)static String
getAncestorLabels
(Element item) Returns all labels of the ancestor axis for the given item within navigation.xmlstatic long
getDuration
(long startTime) static Document
getNavi()
Returns the navigation.xml as org.jdom2.document, using a cache the enhance loading time.static File
Returns the navigation.xml as File.static URL
Returns the navigation.xml as URL.static String
static Document
static String
getRuleDescr
(String permission, String webpageID) static String
static String
getWebpageACLID
(String webpageID) static String
static boolean
static boolean
itemAccess
(String permission, Element item, boolean access) Verifies a single item on access according to $permission Falls back to version without query if no rule for exact query string exists.static boolean
readAccess
(String webpageID) Verifies a given $webpage-ID (//item/@href) from navigation.xml on read permission, based on ACL-System.static boolean
readAccess
(String webpageID, String blockerWebpageID) Verifies a given $webpage-ID (//item/@href) from navigation.xml on read permission, based on ACL-System.static boolean
webpageAccess
(String permission, String webpageId, boolean access) Verifies a single webpage on access according to $permission.
-
Field Details
-
ALLTRUE
public static final int ALLTRUE- See Also:
-
ONETRUE_ALLTRUE
public static final int ONETRUE_ALLTRUE- See Also:
-
ALL2BLOCKER_TRUE
public static final int ALL2BLOCKER_TRUE- See Also:
-
NAV_RESOURCE
-
-
Constructor Details
-
MCRLayoutUtilities
public MCRLayoutUtilities()
-
-
Method Details
-
readAccess
Verifies a given $webpage-ID (//item/@href) from navigation.xml on read permission, based on ACL-System. To be used by XSL with Xalan-Java-Extension-Call. $blockerWebpageID can be used as already verified item with read access. So, only items of the ancestor axis till and exclusive $blockerWebpageID are verified. Use this, if you want to speed up the check- Parameters:
webpageID
- any item/@href from navigation.xmlblockerWebpageID
- any ancestor item of webpageID from navigation.xml- Returns:
- true if access granted, false if not
-
readAccess
Verifies a given $webpage-ID (//item/@href) from navigation.xml on read permission, based on ACL-System. To be used by XSL with Xalan-Java-Extension-Call.- Parameters:
webpageID
- any item/@href from navigation.xml- Returns:
- true if access granted, false if not
-
getAncestorLabels
Returns all labels of the ancestor axis for the given item within navigation.xml- Parameters:
item
- a navigation item- Returns:
- Label as String, like "labelRoot > labelChild > labelChildOfChild"
-
getAccess
Verifies, if an item of navigation.xml has a given $permission.- Parameters:
webpageID
- item/@hrefpermission
- permission to look forstrategy
- ALLTRUE => all ancestor items of webpageID must have the permission, ONETRUE_ALLTRUE => only 1 ancestor item must have the permission- Returns:
- true, if access, false if no access
-
getAccess
public static boolean getAccess(String webpageID, String permission, int strategy, String blockerWebpageID) Verifies, if an item of navigation.xml has a given $permission with a stop item ($blockerWebpageID)- Parameters:
webpageID
- item/@hrefpermission
- permission to look forstrategy
- ALL2BLOCKER_TRUE => all ancestor items of webpageID till and exlusiv $blockerWebpageID must have the permissionblockerWebpageID
- any ancestor item of webpageID from navigation.xml- Returns:
- true, if access, false if no access
-
itemAccess
Verifies a single item on access according to $permission Falls back to version without query if no rule for exact query string exists.- Parameters:
permission
- an ACL permissionitem
- element to checkaccess
- initial value
-
webpageAccess
Verifies a single webpage on access according to $permission. Falls back to version without query if no rule for exact query string exists.- Parameters:
permission
- an ACL permissionwebpageId
- webpage to checkaccess
- initial value
-
getWebpageACLID
-
getDuration
public static long getDuration(long startTime) -
getWebpageObjIDPrefix
-
hasRule
-
getRuleID
-
getRuleDescr
-
getPermission2ReadWebpage
-