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: Closed
    • Priority: Minor
    • Resolution: Completed
    • Affects Version/s: None
    • Fix Version/s: 7.2.X, Master
    • 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 Closed 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  
          27.
          Migrate mail-reader-service to use DS instead of Spring Technical Task Closed Brian Chan  
          28.
          Migrate knowledge-base-service to use DS instead of Spring Technical Task Closed Brian Chan  
          29.
          Migrate sharing-service to use DS instead of Spring Technical Task Closed Brian Chan  
          30.
          Migrate microblogs-service to use DS instead of Spring Technical Task Closed Brian Chan  
          31.
          Migrate reading-time-service to use DS instead of Spring Technical Task Closed Brian Chan  
          32.
          Migrate trash-service to use DS instead of Spring Technical Task Closed Brian Chan  
          33.
          Migrate external-reference-service to use DS instead of Spring Technical Task Closed Brian Chan  
          34.
          Migrate site-service to use DS instead of Spring Technical Task Closed Brian Chan  
          35.
          Migrate sync-service to use DS instead of Spring Technical Task Closed Brian Chan  
          36.
          Migrate portal-lock-service to use DS instead of Spring Technical Task Closed Brian Chan  
          37.
          Migrate subscription-service to use DS instead of Spring Technical Task Closed Brian Chan  
          38.
          Migrate polls-service to use DS instead of Spring Technical Task Closed Brian Chan  
          39.
          Migrate portal-security-audit-storage-service to use DS instead of Spring Technical Task Closed Brian Chan  
          40.
          Migrate site-navigation-service to use DS instead of Spring Technical Task Closed Brian Chan  
          41.
          Migrate portal-security-wedeploy-auth-service to use DS instead of Spring Technical Task Closed Brian Chan  
          42.
          Migrate push-notifications-service to use DS instead of Spring Technical Task Closed Brian Chan  
          43.
          Migrate mobile-device-rules-service to use DS instead of Spring Technical Task Closed Shuyang Zhou  
          44.
          Migrate screens-service to use DS instead of Spring Technical Task Closed Brian Chan  
          45.
          Migrate portal-security-service-access-policy-service to use DS instead of Spring Technical Task Closed Brian Chan  
          46.
          Migrate portal-instances-service to use DS instead of Spring Technical Task Closed Brian Chan  
          47.
          Migrate wiki-service to use DS instead of Spring Technical Task Closed Brian Chan  
          48.
          Migrate layout-page-template-service to use DS instead of Spring Technical Task Closed Brian Chan  
          49.
          Migrate segments-service to use DS instead of Spring Technical Task Closed Brian Chan  
          50.
          Migrate portal-workflow-kaleo-service to use DS instead of Spring Technical Task Closed Brian Chan  
          51.
          Migrate dynamic-data-mapping-service to use DS instead of Spring Technical Task Closed Brian Chan  
          52.
          Migrate message-boards-service to use DS instead of Spring Technical Task Closed Brian Chan  

            Activity

              People

              • Assignee:
                victor.ware Victor Ware
                Reporter:
                zheyi.ji Lance Ji (Inactive)
                Recent user:
                Leon Chi
                Participants of an Issue:
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Packages

                  Version Package
                  7.2.X
                  Master