public class OneUtils extends Object
Modifier and Type | Method and Description |
---|---|
static String |
convertToKey(String guid) |
static String |
createModelerGUID() |
static List<String> |
extractGroupIds(String groupIdString) |
static List<String> |
extractUserIds(String userIdString) |
static List<AnyWorkObjectDefinition> |
filterLatestActiveDefinitions(List<AnyWorkObjectDefinition> definitions)
Filters the latest active definitions in the specified list of definitions.
|
static AnyWorkObjectDefinition |
getActiveDefinition(AnyWorkObjectDefinition anyWorkObjectDefinition)
Returns the specified
AnyWorkObjectDefinition if it is active, based on the OneConstants.ACTIVE property. |
static int |
getPositiveInteger(String parameterName,
String integer) |
static List<AnyWorkObjectDefinition> |
groupByModelIdAndFilterBylatestCreationTime(List<AnyWorkObjectDefinition> definitions)
Groups by model id and filters for the latest created definition and returns the latest one.
|
static boolean |
matchesIdPattern(String value)
Checks whether the given
String value matches against the ID_PATTERN . |
static String |
stripGearPrefix(String baseId) |
static String |
toCleanFileName(String name)
Converts the given name to a 'clean' file name that can be used safely in filesystems / ZIP files.
|
public static String createModelerGUID()
public static List<AnyWorkObjectDefinition> filterLatestActiveDefinitions(List<AnyWorkObjectDefinition> definitions)
Filters the latest active definitions in the specified list of definitions. For a detailed description see groupByModelIdAndFilterBylatestCreationTime(List)
.
definitions
- the definitions to filterpublic static AnyWorkObjectDefinition getActiveDefinition(AnyWorkObjectDefinition anyWorkObjectDefinition)
Returns the specified AnyWorkObjectDefinition
if it is active, based on the OneConstants.ACTIVE
property.
anyWorkObjectDefinition
- the definition to check if it is activeAnyWorkObjectDefinition
if it is active, based on the OneConstants.ACTIVE
property, null otherwisepublic static List<AnyWorkObjectDefinition> groupByModelIdAndFilterBylatestCreationTime(List<AnyWorkObjectDefinition> definitions)
Groups by model id and filters for the latest created definition and returns the latest one. <p> Since each definition deployment now gets its own key, we use the model id property and the creation time to locate the latest version (the key cannot be used in this case). For some definitions the guid is not available, so in this case we fall back to using the key and version number.
definitions
- the definitions to filter for the latest versionspublic static boolean matchesIdPattern(String value)
Checks whether the given String
value matches against the ID_PATTERN
. This is used to check if
the given value has the format of an id such that a call to the database can be omitted.
value
- the string to checkID_PATTERN
, false otherwisepublic static String toCleanFileName(String name)
Converts the given name to a 'clean' file name that can be used safely in filesystems / ZIP files.
The file name has:
non-alphanumeric characters removed
whitespace replaced with underscores
converted to lower case
name
- the input nameCopyright © 2010 - 2019 edorasware ag. All Rights Reserved.