Skip to main content

Content Transport: Install an existing server available feature

Comments

5 comments

  • Zendesk API User
    Author: hoebbel - 12/9/2024 7:58

    Hello Daniel,

    maybe this example code will help you ("/path/to/feature/feature.zip" has to be an existing feature)

    import de.espirit.firstspirit.io.FileSystemsAgent; import de.espirit.firstspirit.feature.FeatureInstallAgent; import de.espirit.firstspirit.transport.LayerMapper; fileSystemsAgent = context.requireSpecialist(FileSystemsAgent.TYPE); featureFile = new File("/path/to/feature/feature.zip"); fileInput = new FileInputStream(featureFile); featureInstallagent = context.requireSpecialist(FeatureInstallAgent.TYPE); featureFile = featureInstallagent.uploadFeatureFile(fileInput); layerMapper = de.espirit.firstspirit.transport.LayerMapper.CREATE_NEW_DEFAULT_LAYER_MAPPER; sah = featureInstallagent.installFeature(featureFile, layerMapper); result = sah.getResult(); context.logInfo("Feature installed. Updated elements: " + result.getUpdatedElements());

     

    Best regards
    Holger

    0
  • Zendesk API User
    Author: daniel_philippi - 12/10/2024 14:01

    No

    I would like to use an existing feature zip that is available in the server storage.

    I know the name and I would like to have access like it is possible with FeatureAgent.getFeatureFiles().

    I want to do the same as I can do in a schedule task: content transport --> storage

    0
  • Zendesk API User
    Author: hoebbel - 12/10/2024 15:06

    As the feature storages are not part of the API as far as I know, this is unfortunately not possible.
    If this access is desired, please create a corresponding idea.

    0
  • Zendesk API User
    Author: daniel_philippi - 12/10/2024 15:34

    Too bad. That would have beed just nice to have and would make my life a bit easier. But ok, I will go another way.

    Thanks!

    0
  • Zendesk API User
    Author: daniel_philippi - 12/12/2024 16:31

    I figured out a workaround.

    As the features are stored in the filesystem of the firstspirit server (we mounted another filesystem to that folder so we can access it with multiple FS servers (d, q and p)) the only option I need to put into the script Holger mentioned is the path to the features folder.

    To get the latest feature zip file I had to search for it inside the folder and then I was able to install it with the script. Not as I expected it, but it is solving my problem perfectly!
    Now I can offer now various action templates that install different feature ZIPs into various projects and I can control the feature to be installed in one place inside the server manager! Perfect!

    0

Please sign in to leave a comment.