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 VersionBean
currentVersion
static String
RESOURCE_TYPE
protected 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 void
close()
int
compareTo(PackageBean other)
Collection<VersionBean>
getAllVersions()
All versions of the package that are currently in the registry.String
getCssClasses()
VersionBean
getCurrentVersion()
String
getDownloadUrl()
String
getGroup()
String
getName()
returns the name of the resource wrapped by this beanString
getNamespace()
Collection<VersionBean>
getObsoleteVersions()
A list of package versions that are obsolete because older than the current version.org.apache.jackrabbit.vault.packaging.PackageId
getPackageId()
String
getUrl()
Returns the URL to the resource of this bean (mapped and with the appropriate extension).String
getVersion()
void
initialize(BeanContext context)
Uses the contexts 'resource' attribute for initialization (content.getResource()).boolean
isClosed()
boolean
isHasAlternativeVersions()
True iff there is more than one version of the package present.boolean
isInstalled()
boolean
isValid()
void
load(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:AbstractSlingBean
Uses the contexts 'resource' attribute for initialization (content.getResource()).- Specified by:
initialize
in interfaceSlingBean
- Overrides:
initialize
in classAbstractSlingBean
- Parameters:
context
- the scripting context (e.g. a JSP PageContext or a Groovy scripting context)
-
close
public void close() throws Exception
- Specified by:
close
in interfaceAutoCloseable
- Throws:
Exception
-
getNamespace
public String getNamespace()
- Specified by:
getNamespace
in interfacePackageView
-
getPackageId
public org.apache.jackrabbit.vault.packaging.PackageId getPackageId()
- Specified by:
getPackageId
in interfacePackageView
-
getGroup
public String getGroup()
- Specified by:
getGroup
in interfacePackageView
-
getName
public String getName()
Description copied from interface:SlingBean
returns the name of the resource wrapped by this bean- Specified by:
getName
in interfacePackageView
- Specified by:
getName
in interfaceSlingBean
- Overrides:
getName
in classAbstractSlingBean
-
getVersion
public String getVersion()
- Specified by:
getVersion
in interfacePackageView
-
getCurrentVersion
public VersionBean getCurrentVersion()
-
isValid
public boolean isValid()
- Specified by:
isValid
in interfacePackageView
-
isInstalled
public boolean isInstalled()
- Specified by:
isInstalled
in interfacePackageView
-
isClosed
public boolean isClosed()
- Specified by:
isClosed
in interfacePackageView
-
load
public void load(BeanContext context) throws IOException
- Throws:
IOException
-
compareTo
public int compareTo(PackageBean other)
- Specified by:
compareTo
in interfaceComparable<PackageBean>
-
getCssClasses
public String getCssClasses()
-
getDownloadUrl
public String getDownloadUrl()
-
getUrl
public String getUrl()
Description copied from class:AbstractSlingBean
Returns the URL to the resource of this bean (mapped and with the appropriate extension).- Overrides:
getUrl
in 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.
-
-