Skip to content

Installation Instructions

Preparations

  • Check that the requirements are met.
  • Ask the customer to contact SSNF and provide us with an API user

Installation

Step-by-step instructions on how to perform a new installation of the add-on.

1. Add Package Dependency

Add limepkg-cesar2-integration as a dependency to your solution.

poetry add limepkg-cesar2-integration

To avoid limepkg-cesar2-integration from updating by mistake when working with the solution it is recommended to lock down the version. If you do so, make sure to lock down all its dependencies as well.

After adding the package, you can list the installed version:

poetry show limepkg-cesar2-integration

Then update the pyproject.toml for the package, just edit it in the [tool.poetry.dependencies] section with the exact version number from the output. Below is an example what it might look like:

[tool.poetry.dependencies]
limepkg-cesar2-integration = '1.1.3'

Finally run poetry lock to make sure the new version locks work together in practice.

Remember, with this change it is no longer enough to just do poetry update to get the latest version of Cesar2 Integration. You will have to update each of these version locked dependencies yourself.

2. Custom Limeobjects

  1. Create a custom limeobject class for the lime type that corresponds to cesar. Decorate it with @cesar. This decorator will inject some of the necessary business logic.

    from lime_type.limeobjects import LimeObject
    from limepkg_cesar2_integration.decorators import cesar
    
    
    @cesar()
    class Cesar(LimeObject):
        pass
    
    
    def register_limeobject_classes(register_class):
        register_class('cesar', Cesar)
    

3. Scheduled task

  1. In your solution, navigate to your tasks folder and open the init.py file that you find inside. If you don't have one, run the command lime-project generate scheduled-task to generate the structure that is needed. In the init.py file, import the 2 tasks in the cesar package and register it as a scheduled task with the desired intervals.
  2. fetch_from_cesar2: here once an hour (be careful and don't be too agressive in your scheduling... especially in cloud):
  3. check_if_cases_are_archived: here once a day (This only marks cases as closed when we can no longer find them in the api):

        from limepkg_cesar2_integration.tasks import integration
        from lime_task.schedule import ScheduledTask, TaskSession, CronTab
        import os
    
    
        def get_task_modules():
            return [] # The task is already registered in the cesar2 package. Should not be included here.
    
    
        def register_scheduled_tasks():
            cesar2_task_session = TaskSession(
                user_name="[email protected]",
                language="sv"
            )
            return [
                ScheduledTask(task=integration.fetch_from_cesar2,
                schedule=CronTab(hour="*", minute="0"),
                args=[],
                session=cesar2_task_session),
                ScheduledTask(task=integration.check_if_cases_are_archived,
                schedule=CronTab(hour="23", minute="0"),
                args=[],
                session=cesar2_task_session)
            ]
    

4. Set up Users and Groups

The following user will be installed via the Setup in limeadmin.

  1. Create a [email protected] user and give it admin permissions. This user is used by the scheduled task that creates runs the integration. Use the following settings:
    • Password: Type a really long nonsense password. Do not store it anywhere (it is not needed).
    • Active: No
    • Type: Integration
    • Login: LIME PRO Authentication (default in Cloud)

5. Set up Database Structure

Tables and fields contains all required and recommended fields. It is possible to set them up manually, or use the Setup in Lime Admin.

  1. Download the following LIP package for Cesar2 from the latest release.
  2. Install the LIP packages through VBA by running lip.installfromzip
  3. In LISA:
    • Insert descriptives
    • Insert SQL on updates
    • Insert icons
  4. On the cesar limetype: insert relations to objects that a cesar case may concern. Usually a helpdesk or deal, where the user will work with the case.

6. Set up Web Client

To be able to use the new lime types and features from this package, they need to be configured in Lime Admin. For the quickest setup be sure to import the provided config files.

The things that need to be configured are:

7. Application Config

  1. In your a application_config.yaml, add the url to the Cesar2 API and add one or more accounts to fetch data with.

        Lime App:
            config:
                limepkg_cesar2_integration:
                    url: 'https://cesar2.ssnf.org/bios/rest/dpwholesale/'
                    accounts:
                        - username: 'USERNAME1'
                          secret: 'SECRET'
                        - username: 'USERNAME2'
                          secret: 'SECRET'
    
    2. For all the accounts that are being used, add an option for field cesar_business with the username as key.

You should now be able to start configuring your Cesar2 Integration. 🎉🎉🎉

Head to the configuration section if you want to tweak and tune your Cesar2 Integration setup to your customer's needs.