Class Publications
- java.lang.Object
-
- com._1c.g5.v8.dt.platform.services.core.webservers.Publications
-
public final class Publications extends Object
Publications utility methods.- Restriction:
- This class is not intended to be sub-classed by clients.
- Restriction:
- This class is not intended to be instantiated by clients.
-
-
Field Summary
Fields Modifier and Type Field Description static Pattern
ALLOWED_LETTERS
static int
MAX_OPEN_ID_LIFETIME
static Pattern
NOT_ALLOWED_NAME_PATTERN
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static org.eclipse.core.runtime.IStatus
appendValidationStatus(Publication publication, org.eclipse.core.runtime.IStatus status)
Append the given multi status validation to the given publication instance.static Publication
findByName(String name, Collection<Publication> publications)
Returns the publication by the given name.static String
generateName(InfobaseReference infobase, PublicationType type)
Generates publication name for the given infobase and publication type.static List<String>
getNames(Collection<Publication> publications)
Returns collection of all names of given publications.static String
getRuntimeComponent(Publication publication)
Returns 1C:Enterprise runtime component type by the publication instance.static org.eclipse.core.runtime.IStatus
getValidationStatus(Publication publication)
Returns validation status of given publication instance.static boolean
isValidName(String name)
Returns whether the given name is valid for publication.static String
normalizeName(String name)
Normalize publication name.static Collection<Publication>
ofType(Collection<Publication> publications, PublicationType type)
Filter collection of publications to get publications with the given type only.
-
-
-
Field Detail
-
MAX_OPEN_ID_LIFETIME
public static final int MAX_OPEN_ID_LIFETIME
- See Also:
- Constant Field Values
-
NOT_ALLOWED_NAME_PATTERN
public static final Pattern NOT_ALLOWED_NAME_PATTERN
-
ALLOWED_LETTERS
public static final Pattern ALLOWED_LETTERS
-
-
Method Detail
-
findByName
public static Publication findByName(String name, Collection<Publication> publications)
Returns the publication by the given name. Can returnnull
.- Parameters:
name
- the name to find publication with, cannot benull
publications
- collection of publications to search in, cannot benull
- Returns:
- publication by the given name or
null
if not found
-
getNames
public static List<String> getNames(Collection<Publication> publications)
Returns collection of all names of given publications.- Parameters:
publications
- publications to get names to, cannot benull
- Returns:
- list of all names, never
null
-
ofType
public static Collection<Publication> ofType(Collection<Publication> publications, PublicationType type)
Filter collection of publications to get publications with the given type only.- Parameters:
publications
- publications to get names to, cannot benull
type
- the publication type, cannot benull
- Returns:
- publications with the given type only, never
null
-
getRuntimeComponent
public static String getRuntimeComponent(Publication publication)
Returns 1C:Enterprise runtime component type by the publication instance.- Parameters:
publication
- the publication to get 1C:Enterprise runtime component type for, cannot benull
- Returns:
- 1C:Enterprise runtime component type, never
null
-
generateName
public static String generateName(InfobaseReference infobase, PublicationType type)
Generates publication name for the given infobase and publication type. Name may be generated by the:- Infobase name, if result is valud
- Infobase location (file or server) if result is valud
May return empty string.
- Parameters:
infobase
- the infobase to use for name generation, cannot benull
type
- the publication type, cannot benull
- Returns:
- a generated publication name, never
null
; may return empty string when name cannot be correctly generated for the given infobase and type
-
normalizeName
public static String normalizeName(String name)
Normalize publication name. All disallowed symbols will be removed.- Parameters:
name
- the name to normalize, cannot benull
- Returns:
- normalized publication name, never
null
-
isValidName
public static boolean isValidName(String name)
Returns whether the given name is valid for publication.- Parameters:
name
- the name to check, cannot benull
- Returns:
- whether the given name is valid for publication
-
getValidationStatus
public static org.eclipse.core.runtime.IStatus getValidationStatus(Publication publication)
Returns validation status of given publication instance.- Parameters:
publication
- the publication instance to get validation status for, cannot benull
- Returns:
- the validation status, never
null
-
appendValidationStatus
public static org.eclipse.core.runtime.IStatus appendValidationStatus(Publication publication, org.eclipse.core.runtime.IStatus status)
Append the given multi status validation to the given publication instance.- Parameters:
publication
- the publication instance to append validation status for, cannot benull
status
- the status validation to append, cannot benull
- Returns:
- the updated status, never
null
-
-