Exemplo n.º 1
0
  @Override
  public void init(Map<String, String> parameters) {
    repositoryManager = new FileShareRepositoryManager();
    userManager = new FileShareUserManager();
    typeManager = new FileShareTypeManager();

    wrapperManager = new CmisServiceWrapperManager();
    wrapperManager.addWrappersFromServiceFactoryParameters(parameters);
    wrapperManager.addOuterWrapper(
        ConformanceCmisServiceWrapper.class,
        DEFAULT_MAX_ITEMS_TYPES,
        DEFAULT_DEPTH_TYPES,
        DEFAULT_MAX_ITEMS_OBJECTS,
        DEFAULT_DEPTH_OBJECTS);

    readConfiguration(parameters);
  }
Exemplo n.º 2
0
  @Override
  public CmisService getService(CallContext context) {
    // authenticate the user
    // if the authentication fails, authenticate() throws a
    // CmisPermissionDeniedException
    userManager.authenticate(context);

    // get service object for this thread
    CallContextAwareCmisService service = threadLocalService.get();
    if (service == null) {
      // there is no service object for this thread -> create one
      FileShareCmisService fileShareService = new FileShareCmisService(repositoryManager);

      service = (CallContextAwareCmisService) wrapperManager.wrap(fileShareService);

      threadLocalService.set(service);
    }

    // hand over the call context to the service object
    service.setCallContext(context);

    return service;
  }