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_COMPARATOR
static String
DATE_FORMAT
protected boolean
invalid
protected boolean
loaded
protected String
namespace
protected String[]
notInstalledDependencies
protected static Comparator<org.apache.jackrabbit.vault.packaging.PackageId>
PACKAGE_ID_COMPARATOR
protected org.apache.jackrabbit.vault.packaging.PackageId
packageId
protected org.apache.jackrabbit.vault.packaging.PackageProperties
packageProps
protected PackageRegistries.Registries
registries
protected String
registryNamespace
protected org.apache.jackrabbit.vault.packaging.registry.RegisteredPackage
regPckg
static String
RESOURCE_TYPE
protected String[]
satisfiedDependencies
protected String[]
unresolvedDependencies
protected org.apache.jackrabbit.vault.packaging.VaultPackage
vltPckg
-
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 void
calculateDependencies()
void
close()
protected String
format(Calendar rawDate, String dateRep)
String
getAcHandlingLabel()
String
getAuditLogUrl()
String
getCreated()
String
getCreatedBy()
String
getCssClasses()
String[]
getDependencies()
String
getDescription()
String
getDownloadUrl()
String
getFilename()
List<org.apache.jackrabbit.vault.fs.api.PathFilterSet>
getFilterList()
String
getGroup()
String
getInstallationTime()
String
getLastModified()
String
getLastModifiedBy()
String
getLastWrapped()
String
getLastWrappedBy()
String
getName()
String
getNamespace()
Namespace as given in the path.String[]
getNotInstalledDependencies()
org.apache.jackrabbit.vault.packaging.PackageId
getPackageId()
String
getPathWithRegistry()
Returns a path containing the registry namespace even in merged mode.String
getProviderLink()
String
getProviderName()
String
getProviderUrl()
String
getRegistryNamespace()
Namespace of the registry, if the package was really found.String[]
getReplaces()
boolean
getRequiresRestart()
boolean
getRequiresRoot()
String[]
getSatisfiedDependencies()
String
getThumbnailUrl()
Thumbnail works only for JCR packages.String[]
getUnresolvedDependencies()
String
getUrl()
String[]
getUsages()
String
getVersion()
void
initialize(com.composum.sling.core.BeanContext context, org.apache.sling.api.resource.Resource resource)
boolean
isClosed()
boolean
isInstalled()
boolean
isValid()
void
load(com.composum.sling.core.BeanContext context)
protected void
loadPackage()
Performs the expensive parts of the loading process (that need actually opening the package) if needed.boolean
obsoletes(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:
initialize
in interfacecom.composum.sling.core.SlingBean
- Overrides:
initialize
in 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:
close
in interfaceAutoCloseable
-
getNamespace
public String getNamespace()
Namespace as given in the path. This is empty in mixed mode - then onlygetRegistryNamespace()
is set.- Specified by:
getNamespace
in 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:
getPackageId
in interfacePackageView
-
getGroup
public String getGroup()
- Specified by:
getGroup
in interfacePackageView
-
getName
public String getName()
- Specified by:
getName
in interfacePackageView
- Specified by:
getName
in interfacecom.composum.sling.core.SlingBean
- Overrides:
getName
in classcom.composum.sling.core.AbstractSlingBean
-
getVersion
public String getVersion()
- Specified by:
getVersion
in interfacePackageView
-
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
-
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:
getUrl
in 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
-
-
-