How to run the D2 Rest plugin project locally using Spring

Gopi Parthiban
edited September 5 in Documentum #1

Hi All,

We have created a new plugin project using d2rest smartview sdk [23.4] and on top of it we have created a D2-Rest plugin as well.

If we build the project and deploy it to the ls-rest server, the endpoint works and we dont have any issues. however , we want to develop our custom D2 Rest plugin and want to test the changes locally using spring boot.

We created a spring main class and tried to run the project but getting the below error

———

APPLICATION FAILED TO START

Description:

Field sessionRepository in com.emc.documentum.rest.dfc.SessionAwareAbstractManager required a bean of type 'com.emc.documentum.rest.dfc.RepositorySession' that could not be found.

The injection point has the following annotations:
- @org.springframework.beans.factory.annotation.Autowired(required=true)

Action:

Consider defining a bean of type 'com.emc.documentum.rest.dfc.RepositorySession' in your configuration.

———

How to run the D2 Rest plugin project locally using Spring? Any guidance would be appreciated!

Thanks,

Gopi

Best Answer

  • Michael McCollough
    Michael McCollough E Community Moderator
    #2 Answer ✓

    The SmartView SDK debugger only works for locally debugging UI components. As part of the SDK configuration you have to specify a SmartView instance to work against. The section is the guide is named "Debug Smartview code" which is for debugging UI components. In the section it also states:

    For doing pure rest plugin development, you can deploy d2-rest or ls-rest or dctm-rest as needed. In your workspace setup you can configure your workspace assistant to build the jar and deploy to your local deployed instance {restapp}/WEB-INF/lib to debug and run locally. You could also create another maven task to copy the generated jar from the normal workspace jar to your local running instance as well, maven has a lot of flexibility.

    While the SmartView SDK is geared towards Smart View development, the assistant features for doing rest endpoints still makes it a valuable companion for doing just rest services. Rest services are server side and therefore require you to use rest application deployment to create a local install (server) to run/debug against.

    Hopefully this helps clarify.

Answers

  • Kyle Pettit
    Kyle Pettit E Community Moderator

    I am not entirely sure on the root of the issue, but just wanted to be sure you knew the spring framework in D2 was upgraded in 23.4 - in case that has anything to do with this.


    Kyle Pettit
    Documentum D2 Product manager

  • Michael McCollough
    Michael McCollough E Community Moderator
    #4 Answer ✓

    The SmartView SDK debugger only works for locally debugging UI components. As part of the SDK configuration you have to specify a SmartView instance to work against. The section is the guide is named "Debug Smartview code" which is for debugging UI components. In the section it also states:

    For doing pure rest plugin development, you can deploy d2-rest or ls-rest or dctm-rest as needed. In your workspace setup you can configure your workspace assistant to build the jar and deploy to your local deployed instance {restapp}/WEB-INF/lib to debug and run locally. You could also create another maven task to copy the generated jar from the normal workspace jar to your local running instance as well, maven has a lot of flexibility.

    While the SmartView SDK is geared towards Smart View development, the assistant features for doing rest endpoints still makes it a valuable companion for doing just rest services. Rest services are server side and therefore require you to use rest application deployment to create a local install (server) to run/debug against.

    Hopefully this helps clarify.

  • Thanks @Michael McCollough for the information!