UIMA
  1. UIMA
  2. UIMA-1570

Unable to set mimetime on a view post the data being added

    Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Trivial Trivial
    • Resolution: Unresolved
    • Affects Version/s: 2.3
    • Fix Version/s: None
    • Component/s: Core Java Framework
    • Labels:
      None

      Description

      I wish to be able to set the mimetype on a view post setting the data. There is currently a getMimtype() function but I can't find a setMimtype() function.

        Activity

        Hide
        Eddie Epstein added a comment -

        I think Burn is correct:

        Well I'd thought the mimetype was tied to the sofa data, rather than to the
        view. I've been using the setSofaDataXXX methods to set both the data & the
        mimetype. Setting the mimetype after setting the data sounds as if you're
        changing the mimetype ... since it provides a way to represent the format of
        the sofa data shouldn't it also be immutable once set?

        The createSofa() was deprecated in favor of createView, but not the
        setSofaDataXXX() methods. These all take a mimetype argument which
        must be set when the data is specified and then neither can be changed.

        Sorry for the confusion,
        Eddie

        Show
        Eddie Epstein added a comment - I think Burn is correct: Well I'd thought the mimetype was tied to the sofa data, rather than to the view. I've been using the setSofaDataXXX methods to set both the data & the mimetype. Setting the mimetype after setting the data sounds as if you're changing the mimetype ... since it provides a way to represent the format of the sofa data shouldn't it also be immutable once set? The createSofa() was deprecated in favor of createView, but not the setSofaDataXXX() methods. These all take a mimetype argument which must be set when the data is specified and then neither can be changed. Sorry for the confusion, Eddie
        Hide
        Tim Cawley added a comment -

        I agree nobody souldn't be able to change the mimetype. My problem is I can't know it when I set the data. I wish to set the mimetype later in the pipeline when I have discovered it.

        The following code appears to work

        int featureCode = jcas.getTypeSystem().getLowLevelTypeSystem().ll_getCodeForFeature(view.getSofa().getType().getFeatureByBaseName(CAS.FEATURE_BASE_NAME_SOFAID));

        view.getLowLevelCas().ll_setStringValue(view.getSofa().getSofaRef(), featureCode, mime);

        I feel like I'm in places your average annotator writer souldn't be and think there should be a higher level method that lets me set the mimetype if its never been set.

        Cheers,
        Tim

        Show
        Tim Cawley added a comment - I agree nobody souldn't be able to change the mimetype. My problem is I can't know it when I set the data. I wish to set the mimetype later in the pipeline when I have discovered it. The following code appears to work int featureCode = jcas.getTypeSystem().getLowLevelTypeSystem().ll_getCodeForFeature(view.getSofa().getType().getFeatureByBaseName(CAS.FEATURE_BASE_NAME_SOFAID)); view.getLowLevelCas().ll_setStringValue(view.getSofa().getSofaRef(), featureCode, mime); I feel like I'm in places your average annotator writer souldn't be and think there should be a higher level method that lets me set the mimetype if its never been set. Cheers, Tim
        Hide
        Marshall Schor added a comment -

        defer past 2.3.0 release

        Show
        Marshall Schor added a comment - defer past 2.3.0 release

          People

          • Assignee:
            Unassigned
            Reporter:
            Tim Cawley
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:

              Development