Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-91315

Migrate majority of service modules to use Service Builder dependency-injector=ds property and regenerate without spring files

    Details

    • Type: Story
    • Status: In Development
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Core Infrastructure
    • Labels:
      None

      Description

      Apply new ServiceBuilder property to generate service modules without using spring.

      Apply service-builder attribute

      dependency-injector="ds"

      which specifies dependency injector with DS. Valid values for "dependency-injector" are "spring" and "ds". For new OSGi modules, the default value is "ds", for existing modules or WARs, the default value is "spring".

      Using "ds" will regenerate the module using DS Component annotations and wire everything together using DS. Doing so is incompatible with using any spring.xml files in the module but allows developers to choose how they want to build their services.

      Here are the steps to manually modify a service module to use dependency-injector="ds"

      1. Add the DS annotation option for inherited dependencies
      2. Update build to include com.liferay.portal.aop.api
      3. For each non-generated spring bean do the following:
        1. Set the Component annotation on the *Impl class
          1. If the Impl class is a finder, then use the Finder's interface as the service Component(service = MyFinder.class)
          2. If the Impl class is a remote or local service, then use the AopService interface Component(service = AopService.class)
          3. Set the the Component property attribute on remote and local services
            1. For remote services set the "json.web.service.context.name" and "json.web.service.context.path" properties to enable json web services the values can be found in OSGiBeanProperties in the remote service interface before regenerating
            2. For local services set the "model.class.name" property to enable PersistedModelLocalService service tracking, the value is the full class name of the service entity
        2. Replace all service ServiceReference and BeanReference annotations on fields with DS Reference annotations
      4. Regenerate the service after setting dependency-injector="ds" in the service.xml
      5. Replace all manual afterPropertiesSet() and destory() methods with activate() and deactivate() methods and annotate them with Activate and Deactivate DS annotations
      6. Some references will no longer be generated to avoid causing circular dependencies withing a service module, these can be easily added back by adding the necessary fields to the ServiceImpl with DS Reference annotations to resolve compile failures
      7. Deploy the service module and start the portal
      8. Run system:check in the gogo shell to confirm there are no circular service dependencies
      9. If there are components that are not resolving the most likely issue is circular dependencies between local services using scr:info <component.name> in the gogo shell can help in understanding where the easiest place is to break the dependency circle

        Attachments

          Issue Links

          1.
          Migrate asset-category-property-service to use DS instead of Spring Technical Task Closed Brian Chan  
           
          2.
          Migrate asset-display-page-service to use DS instead of Spring Technical Task Closed Brian Chan  
           
          3.
          Migrate asset-entry-rel-service to use DS instead of Spring Technical Task Closed Brian Chan  
           
          4.
          Migrate asset-service to use DS instead of Spring Technical Task Closed Brian Chan  
           
          5.
          Migrate asset-tag-stats-service to use DS instead of Spring Technical Task Closed Brian Chan  
           
          6.
          Migrate asset-list-service to use DS instead of Spring Technical Task Closed Brian Chan  
           
          7.
          Migrate calendar-service to use DS instead of Spring Technical Task Closed Brian Chan  
           
          8.
          Migrate change-tracking-service to use DS instead of Spring Technical Task Closed Brian Chan  
           
          9.
          Migrate changeset-service to use DS instead of Spring Technical Task Closed Brian Chan  
           
          10.
          Migrate chat-service to use DS instead of Spring Technical Task Closed Brian Chan  
           
          11.
          Migrate contacts-service to use DS instead of Spring Technical Task Closed Brian Chan  
           
          12.
          Migrate document-library-content-service to use DS instead of Spring Technical Task Closed Brian Chan  
           
          13.
          Migrate document-library-file-rank-service to use DS instead of Spring Technical Task Closed Brian Chan  
           
          14.
          Migrate marketplace-service to use DS instead of Spring Technical Task Closed Brian Chan  
           
          15.
          Migrate journal-service to use DS instead of Spring Technical Task Closed Brian Chan  
           
          16.
          Migrate document-library-opener-service to use DS instead of Spring Technical Task Closed Brian Chan  
           
          17.
          Migrate document-library-service to use DS instead of Spring Technical Task Closed Brian Chan  
           
          18.
          Migrate document-library-sync-service to use DS instead of Spring Technical Task Closed Brian Chan  
           
          19.
          Migrate dynamic-data-lists-service to use DS instead of Spring Technical Task Closed Brian Chan  
           
          20.
          Migrate dynamic-data-mapping-service to use DS instead of Spring Technical Task In Progress Shuyang Zhou  
           
          21.
          Migrate portal-background-task-service to use DS instead of Spring Technical Task Closed Brian Chan  
           
          22.
          Migrate fragment-service to use DS instead of Spring Technical Task Closed Brian Chan  
           
          23.
          Migrate flags-service to use DS instead of Spring Technical Task Closed Brian Chan  
           
          24.
          Migrate friendly-url-service to use DS instead of Spring Technical Task Closed Brian Chan  
           
          25.
          Migrate html-preview-service to use DS instead of Spring Technical Task Closed Brian Chan  
           
          26.
          Migrate invitation-invite-members-service to use DS instead of Spring Technical Task Closed Brian Chan  
           

            Activity

              People

              • Assignee:
                shuyang.zhou Shuyang Zhou
                Reporter:
                zheyi.ji Lance Ji (Inactive)
                Recent user:
                Lester Pi
                Participants of an Issue:
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated: