Coverage Report - org.kuali.rice.kew.rule.web.DocumentConfigurationViewAction
 
Classes in this File Line Coverage Branch Coverage Complexity
DocumentConfigurationViewAction
0%
0/175
0%
0/84
2.314
DocumentConfigurationViewAction$PermissionForDisplay
0%
0/13
N/A
2.314
DocumentConfigurationViewAction$ResponsibilityForDisplay
0%
0/13
N/A
2.314
 
 1  
 /*
 2  
  * Copyright 2008-2009 The Kuali Foundation
 3  
  *
 4  
  * Licensed under the Educational Community License, Version 2.0 (the "License");
 5  
  * you may not use this file except in compliance with the License.
 6  
  * You may obtain a copy of the License at
 7  
  *
 8  
  * http://www.opensource.org/licenses/ecl2.php
 9  
  *
 10  
  * Unless required by applicable law or agreed to in writing, software
 11  
  * distributed under the License is distributed on an "AS IS" BASIS,
 12  
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 13  
  * See the License for the specific language governing permissions and
 14  
  * limitations under the License.
 15  
  */
 16  
 package org.kuali.rice.kew.rule.web;
 17  
 
 18  
 import java.util.ArrayList;
 19  
 import java.util.Collections;
 20  
 import java.util.HashMap;
 21  
 import java.util.HashSet;
 22  
 import java.util.LinkedHashMap;
 23  
 import java.util.List;
 24  
 import java.util.Map;
 25  
 import java.util.Set;
 26  
 
 27  
 import javax.servlet.http.HttpServletRequest;
 28  
 import javax.servlet.http.HttpServletResponse;
 29  
 
 30  
 import org.apache.commons.lang.StringUtils;
 31  
 import org.apache.log4j.Logger;
 32  
 import org.apache.struts.action.ActionForm;
 33  
 import org.apache.struts.action.ActionForward;
 34  
 import org.apache.struts.action.ActionMapping;
 35  
 import org.kuali.rice.kew.doctype.bo.DocumentType;
 36  
 import org.kuali.rice.kew.doctype.service.DocumentTypeService;
 37  
 import org.kuali.rice.kew.engine.node.RouteNode;
 38  
 import org.kuali.rice.kew.engine.node.service.RouteNodeService;
 39  
 import org.kuali.rice.kew.service.KEWServiceLocator;
 40  
 import org.kuali.rice.kew.util.KEWConstants;
 41  
 import org.kuali.rice.kew.web.KewKualiAction;
 42  
 import org.kuali.rice.kim.bo.impl.KimAttributes;
 43  
 import org.kuali.rice.kim.bo.role.dto.KimPermissionInfo;
 44  
 import org.kuali.rice.kim.bo.role.dto.KimPermissionTemplateInfo;
 45  
 import org.kuali.rice.kim.bo.role.dto.KimResponsibilityInfo;
 46  
 import org.kuali.rice.kim.bo.role.dto.KimRoleInfo;
 47  
 import org.kuali.rice.kim.bo.role.impl.KimPermissionImpl;
 48  
 import org.kuali.rice.kim.bo.role.impl.KimResponsibilityImpl;
 49  
 import org.kuali.rice.kim.bo.types.dto.AttributeSet;
 50  
 import org.kuali.rice.kim.service.KIMServiceLocator;
 51  
 import org.kuali.rice.kim.service.PermissionService;
 52  
 import org.kuali.rice.kim.service.ResponsibilityService;
 53  
 import org.kuali.rice.kim.service.RoleManagementService;
 54  
 import org.kuali.rice.kns.service.DataDictionaryService;
 55  
 import org.kuali.rice.kns.service.DocumentHelperService;
 56  
 import org.kuali.rice.kns.service.KNSServiceLocator;
 57  
 import org.kuali.rice.kns.service.MaintenanceDocumentDictionaryService;
 58  
 import org.kuali.rice.kns.util.GlobalVariables;
 59  
 import org.kuali.rice.kns.util.KNSConstants;
 60  
 
 61  
 /**
 62  
  * This is a description of what this class does - kellerj don't forget to fill this in. 
 63  
  * 
 64  
  * @author Kuali Rice Team (rice.collab@kuali.org)
 65  
  *
 66  
  */
 67  0
 public class DocumentConfigurationViewAction extends KewKualiAction {
 68  
 
 69  0
         private static final Logger LOG = Logger.getLogger(DocumentConfigurationViewAction.class);
 70  
         
 71  
         private PermissionService permissionService;
 72  
         private RoleManagementService roleService;
 73  
         private ResponsibilityService responsibilityService;
 74  
         private DocumentTypeService documentTypeService;
 75  
         private DataDictionaryService dataDictionaryService;
 76  
         private RouteNodeService routeNodeService;
 77  
         private MaintenanceDocumentDictionaryService maintenanceDocumentDictionaryService;
 78  
         private DocumentHelperService documentHelperService;
 79  
         
 80  
     public ActionForward start(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
 81  0
             populateForm( (DocumentConfigurationViewForm)form );
 82  0
         return mapping.findForward("basic");
 83  
     }
 84  
     
 85  
     protected void populateForm( DocumentConfigurationViewForm form ) {
 86  0
             if ( StringUtils.isNotEmpty( form.getDocumentTypeName() ) ) {
 87  0
                     form.setDocumentType( getDocumentTypeService().findByName( form.getDocumentTypeName() ) ); 
 88  0
                 if ( form.getDocumentType() != null ) {
 89  0
                             form.getDocumentType().getChildrenDocTypes();
 90  0
                             form.setAttributeLabels( new HashMap<String, String>() );
 91  0
                             populateRelatedDocuments( form );
 92  0
                             populatePermissions( form );
 93  0
                             populateRoutingResponsibilities( form );
 94  0
                             populateRoutingExceptionResponsibility( form );
 95  0
                             checkPermissions( form );
 96  
                 }
 97  
             }
 98  0
     }
 99  
 
 100  
     protected void checkPermissions( DocumentConfigurationViewForm form ) {
 101  0
             String docTypeDocumentType = getMaintenanceDocumentDictionaryService().getDocumentTypeName(DocumentType.class);
 102  
         try {
 103  0
             if ((docTypeDocumentType != null) && getDocumentHelperService().getDocumentAuthorizer(docTypeDocumentType).canInitiate(docTypeDocumentType, GlobalVariables.getUserSession().getPerson())) {
 104  0
                 form.setCanInitiateDocumentTypeDocument( true );
 105  
             }
 106  0
         } catch (Exception ex) {
 107  
                         // just skip - and don't display links
 108  0
                 LOG.error( "Unable to check DocumentType initiation permission for "+ docTypeDocumentType, ex );
 109  0
                 }
 110  0
             String permissionDocumentType = getMaintenanceDocumentDictionaryService().getDocumentTypeName(KimPermissionImpl.class);
 111  
         try {
 112  0
             if ((permissionDocumentType != null) && getDocumentHelperService().getDocumentAuthorizer(permissionDocumentType).canInitiate(permissionDocumentType, GlobalVariables.getUserSession().getPerson())) {
 113  0
                 form.setCanInitiatePermissionDocument( true );
 114  
             }
 115  0
         } catch (Exception ex) {
 116  
                         // just skip - and don't display links
 117  0
                 LOG.error( "Unable to check Permission initiation permission for "+ permissionDocumentType, ex );
 118  0
                 }
 119  0
             String responsibilityDocumentType = getMaintenanceDocumentDictionaryService().getDocumentTypeName(KimResponsibilityImpl.class);
 120  
         try {
 121  0
             if ((responsibilityDocumentType != null) && getDocumentHelperService().getDocumentAuthorizer(responsibilityDocumentType).canInitiate(responsibilityDocumentType, GlobalVariables.getUserSession().getPerson())) {
 122  0
                 form.setCanInitiateResponsibilityDocument( true );
 123  
             }
 124  0
         } catch (Exception ex) {
 125  
                         // just skip - and don't display links
 126  0
                 LOG.error( "Unable to check Responsibility initiation permission for "+ responsibilityDocumentType, ex );
 127  0
                 }
 128  0
     }
 129  
     
 130  
     @SuppressWarnings("unchecked")
 131  
         public void populateRelatedDocuments( DocumentConfigurationViewForm form ) {
 132  0
             form.setParentDocumentType( form.getDocumentType().getParentDocType() );
 133  0
             form.setChildDocumentTypes( new ArrayList<DocumentType>( form.getDocumentType().getChildrenDocTypes() ) );
 134  0
     }
 135  
     
 136  
         public void populatePermissions( DocumentConfigurationViewForm form ) {
 137  
                 
 138  0
                 DocumentType docType = form.getDocumentType();
 139  0
                 Map<String,List<KimRoleInfo>> permRoles = new HashMap<String, List<KimRoleInfo>>(); 
 140  0
                 Map<String,String> searchCriteria = new HashMap<String,String>();
 141  0
                 searchCriteria.put("attributeName", "documentTypeName" );
 142  0
                 searchCriteria.put("active", "Y");
 143  
                 // loop over the document hierarchy
 144  0
                 Set<String> seenDocumentPermissions = new HashSet<String>();
 145  0
                 while ( docType != null) {
 146  0
                         String documentTypeName = docType.getName();
 147  0
                         searchCriteria.put("detailCriteria",
 148  
                                         KimAttributes.DOCUMENT_TYPE_NAME+"="+docType.getName()
 149  
                                         );
 150  0
                         List<KimPermissionInfo> perms = getPermissionService().lookupPermissions( searchCriteria, true );
 151  0
                         for ( KimPermissionInfo perm : perms ) {
 152  0
                                 List<String> roleIds = getPermissionService().getRoleIdsForPermissions(Collections.singletonList(perm));
 153  0
                                 permRoles.put( perm.getPermissionId(), getRoleService().getRoles(roleIds) );
 154  0
                                 for ( String attributeName : perm.getDetails().keySet() ) {
 155  0
                                         addAttributeLabel(form, attributeName);
 156  
                                 }
 157  0
                         }
 158  
                         // show the section if the current document or permissions exist
 159  0
                         if ( perms.size() > 0 || documentTypeName.equals( form.getDocumentTypeName() ) ) {
 160  0
                                 ArrayList<PermissionForDisplay> dispPerms = new ArrayList<PermissionForDisplay>( perms.size() );
 161  0
                                 for ( KimPermissionInfo perm : perms ) {
 162  0
                                         if ( perm.getDetails().size() == 1  ) { // only the document type
 163  
                                                 // this is a document type-specific permission, check if seen earlier
 164  0
                                                 if ( seenDocumentPermissions.contains(perm.getTemplate().getNamespaceCode()+"|"+perm.getTemplate().getName()) ) {
 165  0
                                                         dispPerms.add( new PermissionForDisplay( perm, true ) );
 166  
                                                 } else {
 167  0
                                                         dispPerms.add( new PermissionForDisplay( perm, false ) );
 168  0
                                                         seenDocumentPermissions.add(perm.getTemplate().getNamespaceCode()+"|"+perm.getTemplate().getName());
 169  
                                                 }
 170  
                                         } else {
 171  
                                                 // other attributes, can't determine whether this is overridden at another level
 172  0
                                                 dispPerms.add( new PermissionForDisplay( perm, false ) );                                                
 173  
                                         }
 174  
                                 }
 175  0
                                 form.setPermissionsForDocumentType(documentTypeName, dispPerms );
 176  0
                                 form.addDocumentType(documentTypeName);
 177  
                         }
 178  0
                         docType = docType.getParentDocType();                        
 179  0
                 }
 180  
                 
 181  0
                 form.setPermissionRoles( permRoles );
 182  0
         }
 183  
         
 184  
         protected void populateRoutingExceptionResponsibility( DocumentConfigurationViewForm form ) {        
 185  0
                 Map<String,String> searchCriteria = new HashMap<String,String>();
 186  0
                 searchCriteria.put("template.namespaceCode", KNSConstants.KUALI_RICE_WORKFLOW_NAMESPACE);
 187  0
                 searchCriteria.put("template.name", KEWConstants.EXCEPTION_ROUTING_RESPONSIBILITY_TEMPLATE_NAME);
 188  0
                 searchCriteria.put("active", "Y");
 189  0
                 DocumentType docType = form.getDocumentType();
 190  0
                 List<ResponsibilityForDisplay> responsibilities = new ArrayList<ResponsibilityForDisplay>();
 191  0
                 while ( docType != null) {
 192  
                         // pull the responsibilities for this node
 193  0
                         searchCriteria.put("detailCriteria",
 194  
                                         KimAttributes.DOCUMENT_TYPE_NAME+"="+docType.getName()
 195  
                                         );                
 196  0
                         List<? extends KimResponsibilityInfo> resps = getResponsibilityService().lookupResponsibilityInfo( searchCriteria, true );
 197  
                         
 198  0
                         for ( KimResponsibilityInfo r : resps ) {
 199  0
                                 if ( responsibilities.isEmpty() ) {
 200  0
                                         responsibilities.add( new ResponsibilityForDisplay( r, false ) );
 201  
                                 } else {
 202  0
                                         responsibilities.add( new ResponsibilityForDisplay( r, true ) );
 203  
                                 }
 204  
                         }
 205  0
                         docType = docType.getParentDocType();                        
 206  0
                 }
 207  0
                 form.setExceptionResponsibilities( responsibilities );
 208  0
                 for ( ResponsibilityForDisplay responsibility : responsibilities ) {
 209  0
                         List<String> roleIds = getResponsibilityService().getRoleIdsForResponsibility(responsibility.getResp(), null);
 210  0
                         form.getResponsibilityRoles().put( responsibility.getResponsibilityId(), getRoleService().getRoles(roleIds) );
 211  0
                 }
 212  0
         }
 213  
 
 214  
         protected void addAttributeLabel( DocumentConfigurationViewForm form, String attributeName ) {
 215  0
                 if ( !form.getAttributeLabels().containsKey(attributeName) ) {
 216  0
                         form.getAttributeLabels().put(attributeName, 
 217  
                                         getDataDictionaryService().getAttributeLabel(KimAttributes.class, attributeName) );
 218  
                 }
 219  0
         }
 220  
         
 221  
         // loop over nodes
 222  
         // if split node, push onto stack
 223  
                 // note the number of children, this is the number of times the join node needs to be found
 224  
         // when join node found, return to last split on stack
 225  
                 // move to next child of the split
 226  
         
 227  
         protected RouteNode flattenSplitNode( RouteNode splitNode, Map<String,RouteNode> nodes ) {
 228  0
                 nodes.put( splitNode.getRouteNodeName(), splitNode );
 229  0
                 RouteNode joinNode = null;
 230  
                 
 231  0
                 for ( RouteNode nextNode : splitNode.getNextNodes() ) {
 232  0
                         joinNode = flattenRouteNodes(nextNode, nodes);
 233  
                 }
 234  
                 
 235  0
                 if ( joinNode != null ) {
 236  0
                         nodes.put( joinNode.getRouteNodeName(), joinNode );
 237  
                 }
 238  0
                 return joinNode;
 239  
         }
 240  
         
 241  
         /**
 242  
          * @param node
 243  
          * @param nodes
 244  
          * @return The last node processed by this method.
 245  
          */
 246  
         protected RouteNode flattenRouteNodes( RouteNode node, Map<String,RouteNode> nodes ) {
 247  0
                 RouteNode lastProcessedNode = null;
 248  
                 // if we've seen the node before - skip, avoids infinite loop
 249  0
                 if ( nodes.containsKey(node.getRouteNodeName()) ) {
 250  0
                         return node;
 251  
                 }
 252  
                 
 253  0
                 if ( node.getNodeType().contains( "SplitNode" ) ) { // Hacky - but only way when the class may not be present in the KEW JVM
 254  0
                         lastProcessedNode = flattenSplitNode(node, nodes); // special handling to process all split children before continuing
 255  
                         // now, process the join node's children
 256  0
                         for ( RouteNode nextNode : lastProcessedNode.getNextNodes() ) {
 257  0
                                 lastProcessedNode = flattenRouteNodes(nextNode, nodes);
 258  
                         }
 259  0
                 } else if ( node.getNodeType().contains( "JoinNode" ) ) {
 260  0
                         lastProcessedNode = node; // skip, handled by the split node
 261  
                 } else {
 262  
                         // normal node, add to list and process all children
 263  0
                         nodes.put(node.getRouteNodeName(), node);
 264  0
                         for ( RouteNode nextNode : node.getNextNodes() ) {
 265  0
                                 lastProcessedNode = flattenRouteNodes(nextNode, nodes);
 266  
                         }
 267  
                 }
 268  0
                 return lastProcessedNode;
 269  
         }
 270  
         
 271  
         @SuppressWarnings("unchecked")
 272  
         public void populateRoutingResponsibilities( DocumentConfigurationViewForm form ) {
 273  
                 // pull all the responsibilities
 274  
                 // merge the data and attach to route levels
 275  
                 // pull the route levels and store on form
 276  
                 //List<RouteNode> routeNodes = getRouteNodeService().getFlattenedNodes(form.getDocumentType(), true);
 277  0
                 RouteNode rootNode = ((List<org.kuali.rice.kew.engine.node.Process>)form.getDocumentType().getProcesses()).get(0).getInitialRouteNode();
 278  0
                 LinkedHashMap<String, RouteNode> routeNodeMap = new LinkedHashMap<String, RouteNode>();
 279  0
                 flattenRouteNodes(rootNode, routeNodeMap);
 280  
                 
 281  0
                 form.setRouteNodes( new ArrayList<RouteNode>( routeNodeMap.values() ) );
 282  
                 // pull all the responsibilities and store into a map for use by the JSP
 283  
                 
 284  
                 // FILTER TO THE "Review" template only
 285  
                 // pull responsibility roles
 286  0
                 Map<String,String> searchCriteria = new HashMap<String,String>();
 287  0
                 searchCriteria.put("template.namespaceCode", KNSConstants.KUALI_RICE_WORKFLOW_NAMESPACE);
 288  0
                 searchCriteria.put("template.name", KEWConstants.DEFAULT_RESPONSIBILITY_TEMPLATE_NAME);
 289  0
                 searchCriteria.put("active", "Y");
 290  0
                 DocumentType docType = form.getDocumentType();
 291  0
                 Set<KimResponsibilityInfo> responsibilities = new HashSet<KimResponsibilityInfo>();
 292  0
                 Map<String,List<ResponsibilityForDisplay>> nodeToRespMap = new LinkedHashMap<String, List<ResponsibilityForDisplay>>();
 293  0
                 while ( docType != null) {
 294  
                         // pull the responsibilities for this node
 295  0
                         searchCriteria.put("detailCriteria",
 296  
                                         KimAttributes.DOCUMENT_TYPE_NAME+"="+docType.getName()
 297  
                                         );                
 298  0
                         List<? extends KimResponsibilityInfo> resps = getResponsibilityService().lookupResponsibilityInfo( searchCriteria, true );
 299  
                         
 300  0
                         for ( KimResponsibilityInfo r : resps ) {
 301  0
                                 String routeNodeName = r.getDetails().get(KimAttributes.ROUTE_NODE_NAME); 
 302  0
                                 if ( StringUtils.isNotBlank(routeNodeName) ) {
 303  0
                                         if ( !nodeToRespMap.containsKey( routeNodeName ) ) {
 304  0
                                                 nodeToRespMap.put(routeNodeName, new ArrayList<ResponsibilityForDisplay>() );
 305  0
                                                 nodeToRespMap.get(routeNodeName).add( new ResponsibilityForDisplay( r, false ) );
 306  
                                         } else {
 307  
                                                 // check if the responsibility in the existing list is for the current document
 308  
                                                 // if so, OK to add.  Otherwise, a lower level document has overridden this
 309  
                                                 // responsibility (since we are walking up the hierarchy
 310  0
                                                 if ( nodeToRespMap.get(routeNodeName).get(0).getDetails().get( KimAttributes.DOCUMENT_TYPE_NAME ).equals(docType.getName() ) ) {
 311  0
                                                         nodeToRespMap.get(routeNodeName).add( new ResponsibilityForDisplay( r, false ) );
 312  
                                                 } else { // doc type name did not match, mark as overridden
 313  0
                                                         nodeToRespMap.get(routeNodeName).add( new ResponsibilityForDisplay( r, true ) );
 314  
                                                 }
 315  
                                         }
 316  0
                                         responsibilities.add(r);
 317  
                                 }
 318  0
                         }
 319  0
                         docType = docType.getParentDocType();                        
 320  0
                 }
 321  0
                 form.setResponsibilityMap( nodeToRespMap );
 322  
                 
 323  0
                 Map<String,List<KimRoleInfo>> respToRoleMap = new HashMap<String, List<KimRoleInfo>>();
 324  0
                 for ( KimResponsibilityInfo responsibility : responsibilities ) {
 325  0
                         List<String> roleIds = getResponsibilityService().getRoleIdsForResponsibility(responsibility, null);
 326  0
                         respToRoleMap.put( responsibility.getResponsibilityId(), getRoleService().getRoles(roleIds) );
 327  0
                 }
 328  0
                 form.setResponsibilityRoles( respToRoleMap );
 329  0
         }
 330  
         
 331  
         /**
 332  
          * @see org.kuali.rice.kns.web.struts.action.KualiAction#toggleTab(org.apache.struts.action.ActionMapping, org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
 333  
          */
 334  
         @Override
 335  
         public ActionForward toggleTab(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
 336  
                 // Repopulating the form is necessary when toggling tab states on the server side.
 337  0
                 ActionForward actionForward = super.toggleTab(mapping, form, request, response);
 338  0
                 populateForm( (DocumentConfigurationViewForm)form );
 339  0
                 return actionForward;
 340  
         }
 341  
 
 342  
         /**
 343  
          * Internal delegate class to wrap a responsibility and add an overridden flag.
 344  
          */
 345  
         public static class ResponsibilityForDisplay {
 346  
 
 347  
                 private KimResponsibilityInfo resp;
 348  0
                 private boolean overridden = false;
 349  
                 
 350  0
                 public ResponsibilityForDisplay( KimResponsibilityInfo resp, boolean overridden ) {
 351  0
                         this.resp = resp;
 352  0
                         this.overridden = overridden;
 353  0
                 }
 354  
                 
 355  
                 /**
 356  
                  * @return the resp
 357  
                  */
 358  
                 KimResponsibilityInfo getResp() {
 359  0
                         return this.resp;
 360  
                 }
 361  
                 
 362  
                 public boolean isOverridden() {
 363  0
                         return this.overridden;
 364  
                 }
 365  
 
 366  
                 public void setOverridden(boolean overridden) {
 367  0
                         this.overridden = overridden;
 368  0
                 }
 369  
 
 370  
                 public AttributeSet getDetails() {
 371  0
                         return this.resp.getDetails();
 372  
                 }
 373  
 
 374  
                 public String getName() {
 375  0
                         return this.resp.getName();
 376  
                 }
 377  
 
 378  
                 public String getNamespaceCode() {
 379  0
                         return this.resp.getNamespaceCode();
 380  
                 }
 381  
 
 382  
                 public String getResponsibilityId() {
 383  0
                         return this.resp.getResponsibilityId();
 384  
                 }
 385  
         }
 386  
 
 387  0
         public static class PermissionForDisplay {
 388  
                 private KimPermissionInfo perm;
 389  0
                 private boolean overridden = false;
 390  
                 
 391  0
                 public PermissionForDisplay( KimPermissionInfo perm, boolean overridden ) {
 392  0
                         this.perm = perm;
 393  0
                         this.overridden = overridden;
 394  0
                 }
 395  
                 public boolean isOverridden() {
 396  0
                         return this.overridden;
 397  
                 }
 398  
 
 399  
                 public void setOverridden(boolean overridden) {
 400  0
                         this.overridden = overridden;
 401  0
                 }
 402  
                 public AttributeSet getDetails() {
 403  0
                         return this.perm.getDetails();
 404  
                 }
 405  
                 public String getName() {
 406  0
                         return this.perm.getName();
 407  
                 }
 408  
                 public String getNamespaceCode() {
 409  0
                         return this.perm.getNamespaceCode();
 410  
                 }
 411  
                 public String getPermissionId() {
 412  0
                         return this.perm.getPermissionId();
 413  
                 }
 414  
                 public KimPermissionTemplateInfo getTemplate() {
 415  0
                         return this.perm.getTemplate();
 416  
                 }
 417  
                 
 418  
         }
 419  
         
 420  
         /**
 421  
          * @return the permissionService
 422  
          */
 423  
         public PermissionService getPermissionService() {
 424  0
                 if ( permissionService == null ) {
 425  0
                         permissionService = KIMServiceLocator.getPermissionService();
 426  
                 }
 427  0
                 return permissionService;
 428  
         }
 429  
 
 430  
         /**
 431  
          * @return the roleService
 432  
          */
 433  
         public RoleManagementService getRoleService() {
 434  0
                 if ( roleService == null ) {
 435  0
                         roleService = KIMServiceLocator.getRoleManagementService();
 436  
                 }
 437  0
                 return roleService;
 438  
         }
 439  
 
 440  
         /**
 441  
          * @return the responsibilityService
 442  
          */
 443  
         public ResponsibilityService getResponsibilityService() {
 444  0
                 if ( responsibilityService == null ) {
 445  0
                         responsibilityService = KIMServiceLocator.getResponsibilityService();
 446  
                 }
 447  0
                 return responsibilityService;
 448  
         }
 449  
 
 450  
         /**
 451  
          * @return the documentTypeService
 452  
          */
 453  
         public DocumentTypeService getDocumentTypeService() {
 454  0
                 if ( documentTypeService == null ) {
 455  0
                         documentTypeService = KEWServiceLocator.getDocumentTypeService();
 456  
                 }
 457  0
                 return documentTypeService;
 458  
         }
 459  
 
 460  
         public DataDictionaryService getDataDictionaryService() {
 461  0
                 if(dataDictionaryService == null){
 462  0
                         dataDictionaryService = KNSServiceLocator.getDataDictionaryService();
 463  
                 }
 464  0
                 return dataDictionaryService;
 465  
         }
 466  
 
 467  
         public RouteNodeService getRouteNodeService() {
 468  0
                 if ( routeNodeService == null ) {
 469  0
                         routeNodeService = KEWServiceLocator.getRouteNodeService();
 470  
                 }
 471  0
                 return routeNodeService;
 472  
         }
 473  
 
 474  
         public DocumentHelperService getDocumentHelperService() {
 475  0
                 if(documentHelperService == null){
 476  0
                         documentHelperService = KNSServiceLocator.getDocumentHelperService();
 477  
                 }
 478  0
                 return documentHelperService;
 479  
         }
 480  
 
 481  
         public MaintenanceDocumentDictionaryService getMaintenanceDocumentDictionaryService() {
 482  0
                 if(maintenanceDocumentDictionaryService == null){
 483  0
                         maintenanceDocumentDictionaryService = KNSServiceLocator.getMaintenanceDocumentDictionaryService();
 484  
                 }
 485  0
                 return maintenanceDocumentDictionaryService;
 486  
         }
 487  
         
 488  
 }