Class PathEntry
java.lang.Object
org.apache.sling.jcr.contentloader.ImportOptions
org.apache.sling.jcr.contentloader.PathEntry
A path entry from the manifest for initial content.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe autoCheckout directive specifying whether versionable nodes should be checked out when necessarystatic final StringThe checkin directive specifying whether versionable nodes should be checked instatic final StringThe manifest header to specify initial content to be loaded.static final StringThe ignore content readers directive specifying whether the availableContentReaders should be used during content loading.static final StringThe overwriteProperties directive specifying if content properties should be overwritten or just initially added.static final StringThe overwriteProperties directive specifying if content properties should be overwritten or just initially added.static final StringThe overwrite directive specifying if content should be overwritten or just initially added.static final StringThe overwriteProperties directive specifying if content properties should be overwritten or just initially added.static final StringThe path directive specifying the target node where initial content will be loaded.static final StringThe require content readers directive specifying which of the availableContentReaders should exist before content loading.static final StringThe uninstall directive specifying if content should be uninstalled.All directive names which are valid for header Sling-Initial-Contentstatic final StringThe workspace into which the content will be loaded. -
Constructor Summary
ConstructorsConstructorDescriptionPathEntry(ManifestHeader.Entry entry, long bundleLastModified) PathEntry(ManifestHeader.Entry entry, long bundleLastModified, @Nullable String bundleSymbolicName) -
Method Summary
Modifier and TypeMethodDescriptiongetContentPaths(@NotNull Manifest manifest, long bundleLastModified) Parses the "Sling-Initial-Content" header from the given manifest and returns the resolved PathEntriesgetContentPaths(Map<String, String> headers, long bundleLastModified) Parses the "Sling-Initial-Content" header from the given headers and returns the resolved PathEntriesgetContentPaths(org.osgi.framework.Bundle bundle) Parses the "Sling-Initial-Content" header from the given bundle and returns the resolved PathEntrieslonggetPath()booleanSpecifies whether versionable nodes is automatically checked out when necessary.booleanSpecifies whether versionable nodes is automatically checked in at the end of the import operation.booleanisIgnoredImportProvider(String extension) Check if the content reader for the given file extension should be ignored.booleanisImportProviderRequired(@NotNull String name) Check if the given entry name should require a matching registered import provider.booleanisMerge()Specifies whether imported nodes should merge with existing nodes.booleanSpecifies whether imported nodes should overwrite existing nodes.booleanSpecifies whether imported properties should merge with existing properties.booleanSpecifies whether imported properties should overwrite existing properties.boolean
-
Field Details
-
CONTENT_HEADER
The manifest header to specify initial content to be loaded.- See Also:
-
OVERWRITE_DIRECTIVE
The overwrite directive specifying if content should be overwritten or just initially added.- See Also:
-
OVERWRITE_PROPERTIES_DIRECTIVE
The overwriteProperties directive specifying if content properties should be overwritten or just initially added.- See Also:
-
MERGE_PROPERTIES_DIRECTIVE
The overwriteProperties directive specifying if content properties should be overwritten or just initially added.- See Also:
-
MERGE_NODES_DIRECTIVE
The overwriteProperties directive specifying if content properties should be overwritten or just initially added.- See Also:
-
UNINSTALL_DIRECTIVE
The uninstall directive specifying if content should be uninstalled.- See Also:
-
PATH_DIRECTIVE
The path directive specifying the target node where initial content will be loaded.- See Also:
-
WORKSPACE_DIRECTIVE
The workspace into which the content will be loaded.- See Also:
-
CHECKIN_DIRECTIVE
The checkin directive specifying whether versionable nodes should be checked in- See Also:
-
AUTOCHECKOUT_DIRECTIVE
The autoCheckout directive specifying whether versionable nodes should be checked out when necessary- See Also:
-
IGNORE_CONTENT_READERS_DIRECTIVE
The ignore content readers directive specifying whether the availableContentReaders should be used during content loading. This is a string value that defaults to the emptystring.- Since:
- 2.0.4
- See Also:
-
REQUIRE_CONTENT_READERS_DIRECTIVE
The require content readers directive specifying which of the availableContentReaders should exist before content loading. This is a string value that defaults to the emptystring.- Since:
- 2.5.2
- See Also:
-
VALID_DIRECTIVES
All directive names which are valid for header Sling-Initial-Content
-
-
Constructor Details
-
PathEntry
-
PathEntry
public PathEntry(ManifestHeader.Entry entry, long bundleLastModified, @Nullable @Nullable String bundleSymbolicName)
-
-
Method Details
-
getContentPaths
@Nullable public static @Nullable Iterator<PathEntry> getContentPaths(@NotNull @NotNull Manifest manifest, long bundleLastModified) Parses the "Sling-Initial-Content" header from the given manifest and returns the resolved PathEntries- Parameters:
manifest- the manifestbundleLastModified- the timestamp when the bundle has been last modified or -1 if not known- Returns:
- an iterator over the parsed
PathEntryitems ornullin case no "Sling-Initial-Content" header was found in the manifest
-
getContentPaths
@Nullable public static @Nullable Iterator<PathEntry> getContentPaths(org.osgi.framework.Bundle bundle) Parses the "Sling-Initial-Content" header from the given bundle and returns the resolved PathEntries- Parameters:
bundle- the bundle- Returns:
- an iterator over the parsed
PathEntryitems ornullin case no "Sling-Initial-Content" header was found in the bundle's manifest
-
getContentPaths
@Nullable public static @Nullable Iterator<PathEntry> getContentPaths(Map<String, String> headers, long bundleLastModified) Parses the "Sling-Initial-Content" header from the given headers and returns the resolved PathEntries- Parameters:
headers- the manifest headersbundleLastModified- the timestamp when the bundle has been last modified or -1 if not known- Returns:
- an iterator over the parsed
PathEntryitems ornullin case no "Sling-Initial-Content" header was found
-
getLastModified
public long getLastModified() -
getPath
-
isOverwrite
public boolean isOverwrite()Description copied from class:ImportOptionsSpecifies whether imported nodes should overwrite existing nodes. NOTE: this means the existing node will be deleted and a new node will be created in the same location.- Specified by:
isOverwritein classImportOptions- Returns:
- true to overwrite nodes, false otherwise
-
isPropertyOverwrite
public boolean isPropertyOverwrite()Description copied from class:ImportOptionsSpecifies whether imported properties should overwrite existing properties.- Specified by:
isPropertyOverwritein classImportOptions- Returns:
- true to overwrite node properties, false otherwise
-
isUninstall
public boolean isUninstall() -
isCheckin
public boolean isCheckin()Description copied from class:ImportOptionsSpecifies whether versionable nodes is automatically checked in at the end of the import operation.- Specified by:
isCheckinin classImportOptions- Returns:
- true to checkin the versionable nodes, false otherwise
-
isAutoCheckout
public boolean isAutoCheckout()Description copied from class:ImportOptionsSpecifies whether versionable nodes is automatically checked out when necessary.- Overrides:
isAutoCheckoutin classImportOptions- Returns:
- true to checkout the versionable nodes, false otherwise
-
isIgnoredImportProvider
Description copied from class:ImportOptionsCheck if the content reader for the given file extension should be ignored.- Specified by:
isIgnoredImportProviderin classImportOptions- Parameters:
extension- the extension to check- Returns:
- true to ignore the reader, false otherwise
-
getIgnoredContentReaders
-
isImportProviderRequired
Description copied from class:ImportOptionsCheck if the given entry name should require a matching registered import provider.- Specified by:
isImportProviderRequiredin classImportOptions- Parameters:
name- the entry name to check- Returns:
- true to require an import provider, false otherwise
-
getTarget
-
getWorkspace
-
isPropertyMerge
public boolean isPropertyMerge()Description copied from class:ImportOptionsSpecifies whether imported properties should merge with existing properties. NOTE: this means that properties that are not imported will be removed- Overrides:
isPropertyMergein classImportOptions- Returns:
- true to overwrite nodes, false otherwise
-
isMerge
public boolean isMerge()Description copied from class:ImportOptionsSpecifies whether imported nodes should merge with existing nodes. NOTE: this means the existing nodes that are not imported will be deleted.- Overrides:
isMergein classImportOptions- Returns:
- true to overwrite nodes, false otherwise
-