Package mc.core.domain.i18n.text.work
Class TextServiceConcept
java.lang.Object
mc.core.domain.i18n.text.work.TextServiceConcept
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidsetTextForDataValue(Node entity, Attribute attribute, String text, Locale locale, String textEN, Locale localeEN) voidcase EXCLUSIVE:
- get existing TextSet for field (by reflection).voidsetTextForTextSet(TextSet textSet, String text, Locale locale) case EXCLUSIVE:
- set text(s) on given textSet
- find using entity.voidsetTextSetForEntity(IBaseEntity entity, TextSet textSet) for SHARED only! what to do on EXCLUSIVE?
-
Constructor Details
-
TextServiceConcept
public TextServiceConcept()
-
-
Method Details
-
setTextForEntity
public void setTextForEntity(Node entity, String text, Locale locale, String textEN, Locale localeEN) throws ApplicationException case EXCLUSIVE:
- get existing TextSet for field (by reflection). create and store if null
- set text(s) for locale(s)
- compare old/new and write version history. set entity modified (EDIT event)
- set textSet for field
case SHARED:
- find textSet by text, locale, type, concept
- if found: set for field. if not found: create with text(s) and set for field
- compare old/new and write version history. set entity modified (EDIT event)
EDGE CASES for SHARED:
- if more than one text/locale pairs: masterLocale of entity leads?
- if translate locale changed -> find using entities and setModified!
- is there a tvTO flag "correction" in this use case? in other words: may affect this use case other entities?- Throws:
ApplicationException
-
setTextForDataValue
public void setTextForDataValue(Node entity, Attribute attribute, String text, Locale locale, String textEN, Locale localeEN) throws ApplicationException - Throws:
ApplicationException
-
setTextSetForEntity
for SHARED only! what to do on EXCLUSIVE? -
setTextForTextSet
public void setTextForTextSet(TextSet textSet, String text, Locale locale) throws mc.core.system.validation.ValidationException case EXCLUSIVE:
- set text(s) on given textSet
- find using entity. determine possible fields by reflection or ModelConstraints
- compare old/new and write version history. set entity modified (EDIT event)
case SHARED:
- set text(s) on given textSet
- compare old/new
- if changes, find using entities and setModified (background job!)- Throws:
mc.core.system.validation.ValidationException
-