Package com._1c.g5.v8.dt.dcs.util
Class DcsUtil
java.lang.Object
com._1c.g5.v8.dt.dcs.util.DcsUtil
Вспомогательные функции
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidappendValueList(TypedValueList to, TypedValueList from) Добавить один список в другойstatic voidclearDuplicatesValueList(TypedValueList valueList) Удалить дублирующиеся значения в спискеstatic DataCompositionSettingsCreates new instance ofDataCompositionSettingswith filled properties such as: DcsPackage.Literals.DATA_COMPOSITION_SETTINGS__ITEMS_USER_SETTING_ID filled by random uuid DcsPackage.Literals.DATA_COMPOSITION_SETTINGS__VIEW_MODE filled by DataCompositionSettingsItemViewMode.NORMAL value DcsPackage.Literals.DATA_COMPOSITION_SETTINGS__FILTER filled by new object DcsPackage.Literals.DATA_COMPOSITION_FILTER DcsPackage.Literals.DATA_COMPOSITION_FILTER__USER_SETTING_ID filled by random uuid DcsPackage.Literals.DATA_COMPOSITION_FILTER__VIEW_MODE filled by DataCompositionSettingsItemViewMode.NORMAL value DcsPackage.Literals.DATA_COMPOSITION_SETTINGS__ORDER filled by new object DcsPackage.Literals.DATA_COMPOSITION_ORDER DcsPackage.Literals.DATA_COMPOSITION_ORDER__USER_SETTING_ID filled by random uuid DcsPackage.Literals.DATA_COMPOSITION_ORDER__VIEW_MODE filled by DataCompositionSettingsItemViewMode.NORMAL value DcsPackage.Literals.DATA_COMPOSITION_SETTINGS__CONDITIONAL_APPEARANCE filled by new object DcsPackage.Literals.DATA_COMPOSITION_CONDITIONAL_APPEARANCE DcsPackage.Literals.DATA_COMPOSITION_CONDITIONAL_APPEARANCE__USER_SETTING_ID filled by random uuid DcsPackage.Literals.DATA_COMPOSITION_CONDITIONAL_APPEARANCE__VIEW_MODE filled by DataCompositionSettingsItemViewMode.NORMAL valuestatic FontcreateDefaultFont(Version version) static TypeItemcreateType(String typeName, Version version) Создать тип по имениstatic TypeDescriptioncreateTypeDescription(String typeName, Version version) Создать тип по имениstatic StringdscPathToSynonym(String path) Get field synonym by data pathstatic org.eclipse.emf.ecore.EObjectgetContextObject(IV8Project v8project) Gets context object for resolvingstatic StringgetDateTimePattern(boolean isOnlyDate, boolean isOnlyTime) Get date time patternstatic List<DbViewFieldDef>getFieldsByTypeDescription(SettingsContext settingsContext, TypeDescription typeDescription) Returns fields provided by type description or empty list.static StringgetLangString(LocalString str, Language lang) Получить строку из многоязыковой строки по языкуstatic StringgetLangString(LocalString str, String langCode) Get current string from local stringstatic StringgetLangString(Presentation presentation, Language lang) Get current string from presentation byLanguagestatic StringgetLangString(Presentation presentation, String langCode) Get current string from presentation by lang codestatic StringgetNextName(String template, List<String> names) Сгенерировать следующее имя объектаstatic <T> TgetQlDcsService(Class<T> type) static QuerySchemagetQuerySchema(String queryString, IDtProject project) CreateQuerySchemaby query stringstatic Collection<Type>getResolvedTypes(TypeDescription typeDescription, org.eclipse.emf.ecore.EObject context) Get collection of resolved types from type descriptionstatic Collection<Type>getResolvedTypes(TypeDescriptionSource tdp, SettingsContext settingsContext) Gets the collection of resolved type items, with typesets being taken into the accountstatic TypedValueListgetValueList(IV8Project v8project, String langCode, List<AvailableValue> eList) Create TypedValueList from list of available valuesstatic TypeDescriptionmerge(TypeDescription type1, TypeDescription type2) Check types and mergestatic StringnameToSynonym(String str) Сформировать синоним по имениstatic <T> Tparse(String textToParse, org.eclipse.emf.common.util.URI uri, org.eclipse.emf.ecore.resource.ResourceSet resourceSet, IDtProject dtProject, Map<?, ?> options, List<org.eclipse.emf.ecore.resource.Resource.Diagnostic> outputErrors) static StringpathToSynonym(DcsPath path) Сформировать синоним по путиstatic <T extends org.eclipse.emf.ecore.EObject>
TresolveProxy(T object, SettingsContext settingsContext)
-
Constructor Details
-
DcsUtil
public DcsUtil()
-
-
Method Details
-
createDefaultFont
-
nameToSynonym
Сформировать синоним по имени- Parameters:
str- имя- Returns:
- синоним
-
pathToSynonym
Сформировать синоним по пути- Parameters:
path- путь- Returns:
- синоним
- Throws:
DcsPathException
-
createTypeDescription
Создать тип по имени- Parameters:
typeName- имя типаversion- версия- Returns:
- тип
-
getLangString
Get current string from presentation byLanguage- Parameters:
presentation-Presentationobject contains localized strings, can benulllang-Languageobject for getting presentation string by its lang code, cannot benull- Returns:
- localized string from
Presentationobject corresponding to the specifiedlang, nevernullbut can be empty string ifpresentationisnullorPresentationobject does not have any strings
-
getLangString
Get current string from presentation by lang code- Parameters:
presentation-Presentationobject contains localized strings, can benulllangCode- current language code, cannot benull- Returns:
- localized string from
Presentationobject corresponding to the specifiedlangCode, nevernullbut can be empty string ifpresentationisnullorPresentationobject does not have any strings
-
getLangString
Получить строку из многоязыковой строки по языку- Parameters:
str- многоязыковая строкаlang- язык- Returns:
- строка языка
-
getLangString
Get current string from local string- Parameters:
str- local stringlangCode- current language code- Returns:
- current string
-
getValueList
public static TypedValueList getValueList(IV8Project v8project, String langCode, List<AvailableValue> eList) Create TypedValueList from list of available values- Parameters:
v8project- the V8 project, can't be nulllangCode- current language code, can't be nulleList- list of available values- Returns:
- TypedValueList list, never null
-
appendValueList
Добавить один список в другой- Parameters:
to- цельfrom- добавляемый
-
clearDuplicatesValueList
Удалить дублирующиеся значения в списке- Parameters:
valueList- список
-
getQuerySchema
public static QuerySchema getQuerySchema(String queryString, IDtProject project) throws DcsDataSetInfoException CreateQuerySchemaby query string- Parameters:
queryString- text of the queryproject- actual project containing the query resource- Returns:
- created
QuerySchema - Throws:
DcsDataSetInfoException
-
getQlDcsService
-
createType
Создать тип по имени- Parameters:
typeName- имя типаversion- версия- Returns:
- тип
-
getResolvedTypes
public static Collection<Type> getResolvedTypes(TypeDescription typeDescription, org.eclipse.emf.ecore.EObject context) Get collection of resolved types from type description- Parameters:
typeDescription- type description, can't be nullcontext- context object for resolving, can't be null- Returns:
- collection of resolved types, never null
-
merge
Check types and merge- Parameters:
type1- first type, can't be nulltype2- second type, can't be null- Returns:
- type or null if both types are null
-
getDateTimePattern
Get date time pattern- Parameters:
isOnlyDate- - is show only dateisOnlyTime- - is show only time- Returns:
- date time pattern
-
getContextObject
Gets context object for resolving- Parameters:
v8project- contextIV8Project, can't benull- Returns:
- context object for the
#v8project, nevernull
-
dscPathToSynonym
Get field synonym by data path- Parameters:
path- field data path, can't be null- Returns:
- field synonym, never null
-
getNextName
Сгенерировать следующее имя объекта- Parameters:
template- шаблонная часть имени (НаборДанных), не может бытьnullnames- существующие имена (НаборДанных1, НаборДанных2), не может бытьnull- Returns:
- следующее имя (НаборДанных3), никогда не
null
-
parse
public static <T> T parse(String textToParse, org.eclipse.emf.common.util.URI uri, org.eclipse.emf.ecore.resource.ResourceSet resourceSet, IDtProject dtProject, Map<?, ?> options, List<org.eclipse.emf.ecore.resource.Resource.Diagnostic> outputErrors) -
getResolvedTypes
public static Collection<Type> getResolvedTypes(TypeDescriptionSource tdp, SettingsContext settingsContext) Gets the collection of resolved type items, with typesets being taken into the account- Parameters:
tdp- TheTypeDescriptionSourcethat represent the type. May not benullsettingsContext- The context object to use for the resolution. May not benull- Returns:
- The collection of resolved types. Never
null
-
getFieldsByTypeDescription
public static List<DbViewFieldDef> getFieldsByTypeDescription(SettingsContext settingsContext, TypeDescription typeDescription) Returns fields provided by type description or empty list.- Parameters:
settingsContext- The context object to use for the resolution. May not benulltypeDescription- theTypeDescription(may benull)- Returns:
- fields from dbviews provided by field types or empty list.
-
createDefaultDataCompositionSettings
Creates new instance ofDataCompositionSettingswith filled properties such as:- DcsPackage.Literals.DATA_COMPOSITION_SETTINGS__ITEMS_USER_SETTING_ID filled by random uuid
- DcsPackage.Literals.DATA_COMPOSITION_SETTINGS__VIEW_MODE filled by DataCompositionSettingsItemViewMode.NORMAL value
- DcsPackage.Literals.DATA_COMPOSITION_SETTINGS__FILTER filled by new object DcsPackage.Literals.DATA_COMPOSITION_FILTER
- DcsPackage.Literals.DATA_COMPOSITION_FILTER__USER_SETTING_ID filled by random uuid
- DcsPackage.Literals.DATA_COMPOSITION_FILTER__VIEW_MODE filled by DataCompositionSettingsItemViewMode.NORMAL value
- DcsPackage.Literals.DATA_COMPOSITION_SETTINGS__ORDER filled by new object DcsPackage.Literals.DATA_COMPOSITION_ORDER
- DcsPackage.Literals.DATA_COMPOSITION_ORDER__USER_SETTING_ID filled by random uuid
- DcsPackage.Literals.DATA_COMPOSITION_ORDER__VIEW_MODE filled by DataCompositionSettingsItemViewMode.NORMAL value
- DcsPackage.Literals.DATA_COMPOSITION_SETTINGS__CONDITIONAL_APPEARANCE filled by new object DcsPackage.Literals.DATA_COMPOSITION_CONDITIONAL_APPEARANCE
- DcsPackage.Literals.DATA_COMPOSITION_CONDITIONAL_APPEARANCE__USER_SETTING_ID filled by random uuid
- DcsPackage.Literals.DATA_COMPOSITION_CONDITIONAL_APPEARANCE__VIEW_MODE filled by DataCompositionSettingsItemViewMode.NORMAL value
- Returns:
- new instance of
DataCompositionSettingswith filled properties, nevernull
-
resolveProxy
public static <T extends org.eclipse.emf.ecore.EObject> T resolveProxy(T object, SettingsContext settingsContext)
-