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