Class PackageBean
- java.lang.Object
-
- com.composum.sling.core.AbstractSlingBean
-
- com.composum.sling.nodes.console.ConsoleSlingBean
-
- com.composum.sling.core.pckgmgr.regpckg.view.PackageBean
-
- All Implemented Interfaces:
RestrictedBean,PackageView,SlingBean,AutoCloseable,Comparable<PackageBean>
public class PackageBean extends ConsoleSlingBean implements PackageView, Comparable<PackageBean>, AutoCloseable
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.composum.sling.core.AbstractSlingBean
AbstractSlingBean.NodeClosure
-
-
Field Summary
Fields Modifier and Type Field Description protected VersionBeancurrentVersionstatic StringRESOURCE_TYPEprotected Map<String,VersionBean>versionSet-
Fields inherited from class com.composum.sling.core.AbstractSlingBean
context, queryManager, request, resolver, resource, response, session, sling
-
-
Constructor Summary
Constructors Constructor Description PackageBean()PackageBean(BeanContext context, String path)PackageBean(BeanContext context, String namespace, org.apache.jackrabbit.vault.packaging.PackageId packageId)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()intcompareTo(PackageBean other)Collection<VersionBean>getAllVersions()All versions of the package that are currently in the registry.StringgetCssClasses()VersionBeangetCurrentVersion()StringgetDownloadUrl()StringgetGroup()StringgetName()returns the name of the resource wrapped by this beanStringgetNamespace()Collection<VersionBean>getObsoleteVersions()A list of package versions that are obsolete because older than the current version.org.apache.jackrabbit.vault.packaging.PackageIdgetPackageId()StringgetUrl()Returns the URL to the resource of this bean (mapped and with the appropriate extension).StringgetVersion()voidinitialize(BeanContext context)Uses the contexts 'resource' attribute for initialization (content.getResource()).booleanisClosed()booleanisHasAlternativeVersions()True iff there is more than one version of the package present.booleanisInstalled()booleanisValid()voidload(BeanContext context)-
Methods inherited from class com.composum.sling.nodes.console.ConsoleSlingBean
initialize
-
Methods inherited from class com.composum.sling.core.AbstractSlingBean
executeQuery, findBeans, findNodes, findNodes, findPathList, getContentResource, getDomId, getHasTitle, getId, getInherited, getInherited, getNode, getParent, getParent, getPath, getPermissible, getProperty, getProperty, getQueryManager, getRequest, getResolver, getResource, getResponse, getServiceKey, getSession, getSling, getStringId, getTitle, getType, getUsername, isPermissible, isReadAllowed, isWriteAllowed, toString, toString
-
-
-
-
Field Detail
-
RESOURCE_TYPE
public static final String RESOURCE_TYPE
- See Also:
- Constant Field Values
-
currentVersion
protected VersionBean currentVersion
-
versionSet
protected final Map<String,VersionBean> versionSet
-
-
Constructor Detail
-
PackageBean
public PackageBean()
-
PackageBean
public PackageBean(BeanContext context, String path)
-
PackageBean
public PackageBean(BeanContext context, String namespace, org.apache.jackrabbit.vault.packaging.PackageId packageId)
-
-
Method Detail
-
initialize
public void initialize(BeanContext context)
Description copied from class:AbstractSlingBeanUses the contexts 'resource' attribute for initialization (content.getResource()).- Specified by:
initializein interfaceSlingBean- Overrides:
initializein classAbstractSlingBean- Parameters:
context- the scripting context (e.g. a JSP PageContext or a Groovy scripting context)
-
close
public void close() throws Exception- Specified by:
closein interfaceAutoCloseable- Throws:
Exception
-
getNamespace
public String getNamespace()
- Specified by:
getNamespacein interfacePackageView
-
getPackageId
public org.apache.jackrabbit.vault.packaging.PackageId getPackageId()
- Specified by:
getPackageIdin interfacePackageView
-
getGroup
public String getGroup()
- Specified by:
getGroupin interfacePackageView
-
getName
public String getName()
Description copied from interface:SlingBeanreturns the name of the resource wrapped by this bean- Specified by:
getNamein interfacePackageView- Specified by:
getNamein interfaceSlingBean- Overrides:
getNamein classAbstractSlingBean
-
getVersion
public String getVersion()
- Specified by:
getVersionin interfacePackageView
-
getCurrentVersion
public VersionBean getCurrentVersion()
-
isValid
public boolean isValid()
- Specified by:
isValidin interfacePackageView
-
isInstalled
public boolean isInstalled()
- Specified by:
isInstalledin interfacePackageView
-
isClosed
public boolean isClosed()
- Specified by:
isClosedin interfacePackageView
-
load
public void load(BeanContext context) throws IOException
- Throws:
IOException
-
compareTo
public int compareTo(PackageBean other)
- Specified by:
compareToin interfaceComparable<PackageBean>
-
getCssClasses
public String getCssClasses()
-
getDownloadUrl
public String getDownloadUrl()
-
getUrl
public String getUrl()
Description copied from class:AbstractSlingBeanReturns the URL to the resource of this bean (mapped and with the appropriate extension).- Overrides:
getUrlin classAbstractSlingBean- See Also:
LinkUtil.getUrl(SlingHttpServletRequest, String)
-
getAllVersions
public Collection<VersionBean> getAllVersions()
All versions of the package that are currently in the registry.
-
getObsoleteVersions
public Collection<VersionBean> getObsoleteVersions()
A list of package versions that are obsolete because older than the current version.
-
isHasAlternativeVersions
public boolean isHasAlternativeVersions()
True iff there is more than one version of the package present.
-
-