[TXTREC-48] Support complex field types Created: 07/Aug/19  Updated: 12/Sep/19  Resolved: 29/Aug/19

Status: Closed
Project: Text Classification
Component/s: None
Affects Version/s: None
Fix Version/s: 1.0

Type: Story Priority: Neutral
Reporter: Ilgun Ilgun Assignee: Evzen Fochr
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 0d
Time Spent: 1.5d
Original Estimate: Not Specified

Attachments: PNG File Screen Shot 2019-08-28 at 4.41.33 PM.png     PNG File TXTREC-48-composite-1.png     PNG File TXTREC-48-composite-2.png     PNG File switchable-1.png     PNG File switchable-2.png     PNG File switchable-3.png    
Issue Links:
Cloners
clones TXTREC-26 Have components included by field typ... Closed
Relates
relates to TXTREC-64 Support "by property name" in PageTex... Open
dependency
is depended upon by TXTREC-58 DOC: how to configure a custom text a... Closed
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Documentation update required:
Yes
Date of First Response:
Epic Link: Txt Classification integration
Sprint: Add-Ons 18, Add-Ons 19
Story Points: 8

 Description   

Currently, we support only text and richText fields. We should ideally be supporting all possible fields.

Hence, we need a generic extractor or similar to do the job.

 

aggregateDefinition:
  fieldTypes: [composite, multi, imageText and others] 

 

 

AC

  • Generic solution to extract text from all fields


 Comments   
Comment by Le Hai Thanh [ 27/Aug/19 ]

QA:

Config

aggregateDefinition:
  fieldTypes: [text, richText, composite, switchable]

Text: 

The rise of Headless CMS

Before digital became so complex, it was a marketing world. Large global marketing teams worked in a centralised CMS with decentralised content authoring. Rolling out websites across countries was easy, with no dependency on IT to manage content or build pages. For development, in-depth knowledge of the CMS was required so everything digital was outsourced to a web agency. Nowadays, companies have their own agile, digital teams that know how to shape the customer experience with a variety of technologies and tools. Digital has become a core business. The biggest drivers for a headless CMS are independence and the continuing expansion of channels. Large companies, especially, don’t want to be dependent on one system and one supplier. For things like loyalty, A/B testing and big data analytics they want to be able to use the best of breed. With a headless CMS, tools are integrated into an ecosystem. If a tool doesn’t fit the bill? Then it can be easily replaced. Secondly, the number of relevant channels has proliferated. E-commerce flows via mobile, tablets and of course desktops, while new channels like car commerce or Amazon’s Alexa are creating new blue oceans for the early adopters. With a headless CMS, you’ll ensure a fast release cycle for both your content and new features as they become available by exposing content through a reusable API. While a headless CMS is great for running an efficient system, it also has to be effective. Content management is not getting the right attention and that impacts the business. Is a Headless CMS Right for Your Enterprise? Download this free white paper to make the right choice for your business The importance of content Imagine not being able to run your marketing campaigns because there are not enough developers available. Or having no idea how your content will be presented before you publish to a live site, only knowing that your results won’t be optimal. Authors using a headless CMS quickly become frustrated, just as developers working on campaign pages instead of new features. And while developers are figuring out how to let Google index the full funnel, there is also the danger that they take a different approach each time. There is no structure enforced. To some, this may sound like a mere operational nuisance. But as e-commerce sites are becoming increasingly experience driven, the effective and efficient management of content is more important than ever. And that requires a good authorship experience.

 

Comment by Le Hai Thanh [ 27/Aug/19 ]

Case1: composite field (FAILED)

form:
  tabs:
    - name: tabMain
      fields:
        - name: title
          fieldType: composite
          label: Event
          fields:
            - name: title
              fieldType: text
              label: Title
            - name: richText
              fieldType: richText
              label: Desc
  commit:
    class: info.magnolia.ui.admincentral.dialog.action.SaveDialogActionDefinition
  cancel:
    class: info.magnolia.ui.admincentral.dialog.action.CancelDialogActionDefinition

 

LOG:

2019-08-27 09:18:59,796 ERROR info.magnolia.ai.text.amazon.AmazonTextClassifier : Input classification [texts] can't be null or empty.

 https://documentation.magnolia-cms.com/display/DOCS61/Composite+field

Comment by Le Hai Thanh [ 27/Aug/19 ]

Case2: switchable (FAILED)

https://documentation.magnolia-cms.com/display/DOCS61/Switchable+field


 

 

 

2019-08-27 09:33:07,018 ERROR info.magnolia.ai.text.amazon.AmazonTextClassifier : Input classification [texts] can't be null or empty.

 

Comment by Le Hai Thanh [ 28/Aug/19 ]

Case 3: composite fields contains switchable (FAILED)

form:
  tabs:
    - name: tabEvent
      label: Event
      fields:
        - name: title
          fieldType: composite
          transformerClass:  info.magnolia.ui.form.field.transformer.composite.DelegatingCompositeFieldTransformer
          label: Event
          fields:
            - name: title
              fieldType: text
              label: Title
            - name: message
              fieldType: switchable
              label: Message
              options:
                - name: plainText
                  label: Plain
                  selected: true
                  value: plainText
                - name: richText
                  label: Rich
                  value: richText
              fields:
                - name: plainText
                  fieldType: text
                  label: Plain text message
                  rows: 5
                - name: richText
                  fieldType: richText
                  label: Rich text message
                  height: 200actions:
  commit:
    class: info.magnolia.ui.admincentral.dialog.action.SaveDialogActionDefinition
  cancel:
    class: info.magnolia.ui.admincentral.dialog.action.CancelDialogActionDefinition

 

Comment by Evzen Fochr [ 28/Aug/19 ]

It is because you used DelegatingCompositeFieldTransformer for composite field. I would keep solution as it is and special cases as this one will be solved by implement "by property name"

Comment by Le Hai Thanh [ 29/Aug/19 ]

Re-tested 3 cases above and they are passed.

  1. composite field: text + rich text
  2. switchable field: text + rich text
  3. composite: text + switchable (text + rich text)

Thanks,

Generated at Mon Feb 12 11:04:56 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.