Class VersionBean
- java.lang.Object
-
- com.composum.sling.core.AbstractSlingBean
-
- com.composum.sling.nodes.console.ConsoleSlingBean
-
- com.composum.sling.core.pckgmgr.regpckg.view.VersionBean
-
- All Implemented Interfaces:
com.composum.sling.core.bean.RestrictedBean,PackageView,com.composum.sling.core.SlingBean,AutoCloseable
public class VersionBean extends com.composum.sling.nodes.console.ConsoleSlingBean implements PackageView, AutoCloseable
-
-
Field Summary
Fields Modifier and Type Field Description protected static Comparator<org.apache.jackrabbit.vault.packaging.PackageId>BY_GROUP_AND_NAME_COMPARATORstatic StringDATE_FORMATprotected booleaninvalidprotected booleanloadedprotected Stringnamespaceprotected String[]notInstalledDependenciesprotected static Comparator<org.apache.jackrabbit.vault.packaging.PackageId>PACKAGE_ID_COMPARATORprotected org.apache.jackrabbit.vault.packaging.PackageIdpackageIdprotected org.apache.jackrabbit.vault.packaging.PackagePropertiespackagePropsprotected PackageRegistries.Registriesregistriesprotected StringregistryNamespaceprotected org.apache.jackrabbit.vault.packaging.registry.RegisteredPackageregPckgstatic StringRESOURCE_TYPEprotected String[]satisfiedDependenciesprotected String[]unresolvedDependenciesprotected org.apache.jackrabbit.vault.packaging.VaultPackagevltPckg
-
Constructor Summary
Constructors Constructor Description VersionBean()VersionBean(com.composum.sling.core.BeanContext context, String path)VersionBean(com.composum.sling.core.BeanContext context, String namespace, org.apache.jackrabbit.vault.packaging.PackageId packageId)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcalculateDependencies()voidclose()protected Stringformat(Calendar rawDate, String dateRep)StringgetAcHandlingLabel()StringgetAuditLogUrl()StringgetCreated()StringgetCreatedBy()StringgetCssClasses()String[]getDependencies()StringgetDescription()StringgetDownloadUrl()StringgetFilename()List<org.apache.jackrabbit.vault.fs.api.PathFilterSet>getFilterList()StringgetGroup()StringgetInstallationTime()StringgetLastModified()StringgetLastModifiedBy()StringgetLastWrapped()StringgetLastWrappedBy()StringgetName()StringgetNamespace()Namespace as given in the path.String[]getNotInstalledDependencies()org.apache.jackrabbit.vault.packaging.PackageIdgetPackageId()StringgetPathWithRegistry()Returns a path containing the registry namespace even in merged mode.StringgetProviderLink()StringgetProviderName()StringgetProviderUrl()StringgetRegistryNamespace()Namespace of the registry, if the package was really found.String[]getReplaces()booleangetRequiresRestart()booleangetRequiresRoot()String[]getSatisfiedDependencies()StringgetThumbnailUrl()Thumbnail works only for JCR packages.String[]getUnresolvedDependencies()StringgetUrl()String[]getUsages()StringgetVersion()voidinitialize(com.composum.sling.core.BeanContext context, org.apache.sling.api.resource.Resource resource)booleanisClosed()booleanisInstalled()booleanisValid()voidload(com.composum.sling.core.BeanContext context)protected voidloadPackage()Performs the expensive parts of the loading process (that need actually opening the package) if needed.booleanobsoletes(VersionBean other)True if this obsoletes the other version - that is, it has same group and name but a newer version.-
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, initialize, isPermissible, isReadAllowed, isWriteAllowed, toString, toString
-
-
-
-
Field Detail
-
RESOURCE_TYPE
public static final String RESOURCE_TYPE
- See Also:
- Constant Field Values
-
DATE_FORMAT
public static final String DATE_FORMAT
- See Also:
- Constant Field Values
-
BY_GROUP_AND_NAME_COMPARATOR
protected static final Comparator<org.apache.jackrabbit.vault.packaging.PackageId> BY_GROUP_AND_NAME_COMPARATOR
-
PACKAGE_ID_COMPARATOR
protected static final Comparator<org.apache.jackrabbit.vault.packaging.PackageId> PACKAGE_ID_COMPARATOR
-
namespace
protected String namespace
-
packageId
protected org.apache.jackrabbit.vault.packaging.PackageId packageId
-
loaded
protected boolean loaded
-
regPckg
protected transient org.apache.jackrabbit.vault.packaging.registry.RegisteredPackage regPckg
-
vltPckg
protected transient org.apache.jackrabbit.vault.packaging.VaultPackage vltPckg
-
packageProps
protected transient org.apache.jackrabbit.vault.packaging.PackageProperties packageProps
-
invalid
protected transient boolean invalid
-
registryNamespace
protected transient String registryNamespace
-
registries
protected transient PackageRegistries.Registries registries
-
satisfiedDependencies
protected String[] satisfiedDependencies
-
notInstalledDependencies
protected String[] notInstalledDependencies
-
unresolvedDependencies
protected String[] unresolvedDependencies
-
-
Method Detail
-
initialize
public void initialize(com.composum.sling.core.BeanContext context, org.apache.sling.api.resource.Resource resource)- Specified by:
initializein interfacecom.composum.sling.core.SlingBean- Overrides:
initializein classcom.composum.sling.nodes.console.ConsoleSlingBean
-
load
public void load(com.composum.sling.core.BeanContext context) throws IOException- Throws:
IOException
-
loadPackage
protected void loadPackage()
Performs the expensive parts of the loading process (that need actually opening the package) if needed.
-
getPathWithRegistry
public String getPathWithRegistry()
Returns a path containing the registry namespace even in merged mode.
-
close
public void close()
- Specified by:
closein interfaceAutoCloseable
-
getNamespace
public String getNamespace()
Namespace as given in the path. This is empty in mixed mode - then onlygetRegistryNamespace()is set.- Specified by:
getNamespacein interfacePackageView
-
getRegistryNamespace
public String getRegistryNamespace()
Namespace of the registry, if the package was really found.
-
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()
- Specified by:
getNamein interfacePackageView- Specified by:
getNamein interfacecom.composum.sling.core.SlingBean- Overrides:
getNamein classcom.composum.sling.core.AbstractSlingBean
-
getVersion
public String getVersion()
- Specified by:
getVersionin interfacePackageView
-
isValid
public boolean isValid()
- Specified by:
isValidin interfacePackageView
-
isInstalled
public boolean isInstalled()
- Specified by:
isInstalledin interfacePackageView
-
isClosed
public boolean isClosed()
- Specified by:
isClosedin interfacePackageView
-
getDescription
public String getDescription()
-
getCssClasses
public String getCssClasses()
-
getFilename
public String getFilename()
-
getDownloadUrl
public String getDownloadUrl()
-
getFilterList
public List<org.apache.jackrabbit.vault.fs.api.PathFilterSet> getFilterList()
-
getAuditLogUrl
public String getAuditLogUrl()
-
getInstallationTime
public String getInstallationTime()
-
getCreated
public String getCreated()
-
getCreatedBy
public String getCreatedBy()
-
getLastModified
public String getLastModified()
-
getLastModifiedBy
public String getLastModifiedBy()
-
getLastWrapped
public String getLastWrapped()
-
getLastWrappedBy
public String getLastWrappedBy()
-
getAcHandling
public String getAcHandling()
-
getAcHandlingLabel
public String getAcHandlingLabel()
-
getRequiresRestart
public boolean getRequiresRestart()
-
getRequiresRoot
public boolean getRequiresRoot()
-
getProviderName
public String getProviderName()
-
getProviderUrl
public String getProviderUrl()
-
getProviderLink
public String getProviderLink()
-
getDependencies
public String[] getDependencies()
-
calculateDependencies
protected void calculateDependencies()
-
getSatisfiedDependencies
public String[] getSatisfiedDependencies()
-
getNotInstalledDependencies
public String[] getNotInstalledDependencies()
-
getUnresolvedDependencies
public String[] getUnresolvedDependencies()
-
getReplaces
public String[] getReplaces()
-
getUsages
public String[] getUsages()
-
format
protected String format(Calendar rawDate, String dateRep)
Formats a date, including a workaround for-
getUrl
public String getUrl()
- Overrides:
getUrlin classcom.composum.sling.core.AbstractSlingBean
-
obsoletes
public boolean obsoletes(VersionBean other)
True if this obsoletes the other version - that is, it has same group and name but a newer version.
-
getThumbnailUrl
@Nullable public String getThumbnailUrl() throws IOException
Thumbnail works only for JCR packages.- Throws:
IOException
-
-
-