package xyz.its_me.alfresco;

import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.repository.NodeService;
import org.alfresco.service.cmr.repository.StoreRef;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

@Service
public class DefaultSampleService implements SampleService {
    private final NodeService nodeService;

    @Autowired
    public DefaultSampleService(@Qualifier("nodeService") NodeService nodeService) {
        this.nodeService = nodeService;
        System.out.printf("nodeService: %s\n", nodeService);
    }

    @Override
    public NodeRef getRoot() {
        return nodeService.getRootNode(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE);
    }
}

@@ -358,16 +358,105 @@
 rvice;%0A%0A
+import static org.alfresco.repo.security.authentication.AuthenticationUtil.runAsSystem;%0A%0A
 @Service
@@ -620,17 +620,17 @@
 lifier(%22
-n
+N
 odeServi
@@ -705,69 +705,8 @@
 ce;%0A
-        System.out.printf(%22nodeService: %25s%5Cn%22, nodeService);%0A
     
@@ -767,16 +767,34 @@
   return
+ runAsSystem(() -%3E
  nodeSer
@@ -851,16 +851,17 @@
 ESSTORE)
+)
 ;%0A    %7D%0A

use the public NodeService bean