public class ImportPatchAction extends AbstractImportPatchAction implements PatchAction
configurationService, extensionPath, globalPath, patchPath, releasePath, releasesPath| Constructor and Description |
|---|
ImportPatchAction() |
| Modifier and Type | Method and Description |
|---|---|
protected ImpexImportPack |
createGlobalPack(java.lang.String basePath,
java.lang.String fileName,
java.lang.String filePrefix)
This method creates
ImpexImportPack (not language specific). |
protected ImpexImportUnit |
createGlobalUnit(java.lang.String basePath,
java.lang.String fileName,
java.lang.String filePrefix)
This method creates
ImpexImportUnit for global data (not related with organisation unit). |
protected java.util.List<ImpexImportPack> |
createLanguagesVariantsForUnit(ImpexImportPack pack,
java.util.Collection<ImportLanguage> languages)
This method creates unit packages for given array of languages.
|
protected java.util.List<ImpexImportUnit> |
createLanguageVariantsForUnit(ImpexImportUnit unit,
ImportLanguage language)
This method gets given basic unit and clone it to have:
unit that have file name with country isocode suffix.
|
protected ImpexImportPack |
createOrganisationPacks(java.lang.String basePath,
java.lang.String fileName,
java.lang.String filePrefix,
ImportOrganisationUnit unit)
This method creates base
ImpexImportPack (without languages and options) for given
ImportOrganisationUnit. |
protected java.util.List<java.lang.String> |
createPaths(java.util.List<ImportOrganisationUnit> hierarchy,
java.lang.String basePath,
java.lang.String fileName)
This method iterates over unit hierarchy and creates all possible (valid) paths where file that should be imported
can be located.
|
protected java.util.List<ImportOrganisationUnit> |
createUnitHierarchy(ImportOrganisationUnit unit)
This method creates for given
ImportOrganisationUnit a hierarchy path (list of parent units) starting from
one that is on top of hierarchy. |
protected ImpexHeaderOption[][] |
getHeaderOptionsPermutations(ImpexHeaderOption[][] headerOptions)
Creates permutation of given headerOptions.
|
protected boolean |
importPacks(java.util.List<ImpexImportPack> importPacks,
java.lang.String fileName)
Iterates over packs and import them by using
PatchImportService.importImpexUnit(ImpexImportUnit). |
void |
perform(PatchActionData data) |
void |
setPatchImportService(PatchImportService patchImportService) |
protected void |
updatedHeaderOptionsWithLanguageAndAddLangFileSuffix(ImpexImportUnit unit,
ImportLanguage language)
This method updates file name with "_lang" suffix.
Check updatedFilePathWithString(ImpexImportUnit, String).It also extends unit with new option: $lang=[isocode] |
protected void |
updateHeaderOptionsWithLanguage(ImpexImportUnit unit,
ImportLanguage language)
This method extends unit with new option:
$lang=[isocode] |
protected void |
updateImpexOptions(java.util.List<ImpexImportPack> importPackList,
PatchActionData data)
This method will update all ImpexImportUnits that belong to given importPackList with ImpexImportUnitOptions in
case there were defined in data object.
|
protected java.util.List<ImpexImportPack> |
useHeaderOptions(java.util.List<ImpexImportPack> importPacks,
ImpexHeaderOption[][] dataHeaderOptions)
If dataHeaderOptions is empty this method will return importPacks directly.
|
getBasePath, getConfigurationService, getExtensionPath, getGlobalPath, getPatchPath, getPatchPath, getReleasePath, getReleasePath, getReleasesPath, setConfigurationService, setExtensionPath, setGlobalPath, setPatchPath, setReleasePath, setReleasesPathclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetCustomizedNamepublic void perform(PatchActionData data)
perform in interface PatchActionprotected void updateImpexOptions(java.util.List<ImpexImportPack> importPackList, PatchActionData data)
importPackList - container for ImpexImportPackdata - PatchActionData object where array of ImpexImportUnitOption could be defined. In case
this parameter was not set, this method will not do anythingprotected boolean importPacks(java.util.List<ImpexImportPack> importPacks, java.lang.String fileName)
PatchImportService.importImpexUnit(ImpexImportUnit).importPacks - packs that should be importedfileName - impex file nametrue if all packs were successfully imported, false otherwiseprotected java.util.List<ImpexImportPack> useHeaderOptions(java.util.List<ImpexImportPack> importPacks, ImpexHeaderOption[][] dataHeaderOptions)
PermutationUtils.permutate(ImpexHeaderOption[][]) for more details about permutations.importPacks - previously created import pack without header optionsdataHeaderOptions - options that should be considered when do permutationprotected ImpexHeaderOption[][] getHeaderOptionsPermutations(ImpexHeaderOption[][] headerOptions)
PermutationUtils for
more details about permutations.headerOptions - array of ImpexHeaderOptionImpexHeaderOptionprotected ImpexImportPack createGlobalPack(java.lang.String basePath, java.lang.String fileName, java.lang.String filePrefix)
ImpexImportPack (not language specific).basePath - basePath that is unit independentfileName - name of file to be importedfilePrefix - release/patch specific file prefixImpexImportPackprotected ImpexImportPack createOrganisationPacks(java.lang.String basePath, java.lang.String fileName, java.lang.String filePrefix, ImportOrganisationUnit unit)
ImpexImportPack (without languages and options) for given
ImportOrganisationUnit.basePath - basePath that is unit independentfileName - name of file to be importedfilePrefix - release/patch specific file prefixunit - ImportOrganisationUnitImpexImportPackprotected java.util.List<java.lang.String> createPaths(java.util.List<ImportOrganisationUnit> hierarchy, java.lang.String basePath, java.lang.String fileName)
hierarchy - list of parent units (including unit itself, in order top one first) for which unit that file path will
be createdbasePath - basePath that is unit independent (common for all files in given patch)fileName - name of file to be importedprotected java.util.List<ImportOrganisationUnit> createUnitHierarchy(ImportOrganisationUnit unit)
ImportOrganisationUnit a hierarchy path (list of parent units) starting from
one that is on top of hierarchy.unit - ImportOrganisationUnit for which hierarchy is buildprotected ImpexImportUnit createGlobalUnit(java.lang.String basePath, java.lang.String fileName, java.lang.String filePrefix)
ImpexImportUnit for global data (not related with organisation unit). In result there
is only one package created (this method doesn't handle language specific imports).basePath - path to common folder for all impexes from given patchfileName - name of file to be importedfilePrefix - release/patch specific file prefix (in example 01_00)ImpexImportUnit for global dataprotected java.util.List<ImpexImportPack> createLanguagesVariantsForUnit(ImpexImportPack pack, java.util.Collection<ImportLanguage> languages)
pack - base not language specific pack that should be clonedlanguages - collection of languages that should be used for importImpexImportPackprotected java.util.List<ImpexImportUnit> createLanguageVariantsForUnit(ImpexImportUnit unit, ImportLanguage language)
unit - not language specific unit to be clonedlanguage - given language that should be used to create cloneImpexImportUnit to be importedprotected void updatedHeaderOptionsWithLanguageAndAddLangFileSuffix(ImpexImportUnit unit, ImportLanguage language)
updatedFilePathWithString(ImpexImportUnit, String).unit - that contain file path that should be modifiedlanguage - that has isocode used as file suffixprotected void updateHeaderOptionsWithLanguage(ImpexImportUnit unit, ImportLanguage language)
unit - that contain file path that should be modifiedlanguage - that has isocode used as file suffixpublic void setPatchImportService(PatchImportService patchImportService)
Copyright © 2018 SAP SE. All Rights Reserved.