what is the use of ContentService calss

while creating a plugin we have some class like ContentService and SmartServiceContext what is the use of these classes.

Can some one help me with the detailed concept of accessing a document from a Appian to use that document in plugin.

Thanks

  Discussion posts and replies are publicly visible

  • In Appian each node needs to be executed with the privilege of a user, this can be set via the assignment tab in the node properties. When you have a smart service, this privilege setting from the configuration on its properties will be passed into the smartservice's core code through the constructor of the smartservice's class as SmartServiceContext type object.

    Now coming to content service, Appian has exposed a varied range of services to do operations specific to each type of engine or category of appian artefact. For instance if you need to do a operation related the below appian objects you need the specific service. 

    User creation/update - UserProfileService

    Group Creation/update - GroupService

    Create/Delete/Edit/Evaluate Contents (Documents, folders, expression rules) - ContentService

    Access Process Instance Details - ProcessExecutionService

    Access Process Model Details - ProcessDesignService

    .. Etc.,

    So based on your requirement you can create additional constructor parameters of your required Service. And Appian will automatically identify the new parameter in the constructor and pass the service object to your class's constructor when your class is instantiated and executed when the process flow reaches the node.

    Once you have the content service, you have the necessary privilege to access Appian's content related APIs.

    Refer the Appian Public Java API Docs to understand the functionality of each API and to get the list of available APIs for each Servcie.

    Hope that helps you!

    Thanks,

    Raghu