Exemple #1
0
        private static TSetting GetObjectTypedSetting <TSetting>(this IObjectService objectService, IObjectSetting objectSetting) where TSetting : class
        {
            if (objectSetting == null)
            {
                return(null);
            }
            var osb = (ObjectServiceBase)objectService;

            if (objectSetting.SettingSet != null && !string.IsNullOrEmpty(objectSetting.SettingSet.TypeName))
            {
                var typeName            = osb.GetTypeNameInternal(objectSetting.SettingSet.TypeName, objectSetting.Namespace);
                var settingType         = typeof(TSetting);
                var settingInstanceType = TypeHelper.CreateType(typeName, settingType, false);
                if (settingInstanceType != null)
                {
                    var setting = (IConfigSettingElement)TypeHelper.CreateObject(settingInstanceType, typeof(IConfigSettingElement), false);
                    if (setting != null)
                    {
                        setting.ConfigSetting = osb.GetObjectSettingInternal(objectSetting);
                        return((TSetting)setting);
                    }
                }
            }
            return(null);
        }
Exemple #2
0
 public ObjectQueryHandler(
     IObjectService objectService,
     IDistributedCache distributedCache)
 {
     this._objectService    = objectService;
     this._distributedCache = distributedCache;
 }
 public ObjectDefinitionGroupController(IObjectService service,
                                        ILogger <ObjectDefinitionGroupController> logger,
                                        IServiceProvider provider) : base(provider)
 {
     this.objectService = service;
     this.logger        = logger;
 }
 public UploadFileCommand(BucketContentViewModel senderView, IObjectService objectService, IBucketService bucketService, ILoginService loginService)
 {
     _senderView    = senderView;
     _objectService = objectService;
     _bucketService = bucketService;
     _loginService  = loginService;
 }
Exemple #5
0
        /// <summary>
        /// Cancellazione di un folder in DocsPa
        /// </summary>
        /// <param name="idProject">Identificativo univoco del folder</param>
        /// <remarks>
        ///
        /// PreCondizioni:
        ///     Il folder è stato rimosso correttamente in DocsPa
        ///
        /// PostCondizioni:
        ///     Il corrispondente oggetto in documentum per il folder
        ///     è stato rimosso correttamente
        ///
        /// </remarks>
        /// <returns></returns>
        public bool DeleteFolder(DocsPaVO.fascicolazione.Folder folder)
        {
            bool retValue = false;

            try
            {
                DeleteProfile deleteProfile = new DeleteProfile();
                deleteProfile.IsDeepDeleteFolders           = true;
                deleteProfile.IsDeepDeleteChildrenInFolders = true;

                IObjectService objectService = this.GetServiceInstance <IObjectService>(false);

                OperationOptions opts = new OperationOptions();
                opts.DeleteProfile = deleteProfile;

                // Reperimento identity per il sottofascicolo
                ObjectIdentity identity = Dfs4DocsPa.getSottofascicoloIdentityById(folder.systemID);

                objectService.Delete(new ObjectIdentitySet(identity), opts);

                retValue = true;

                logger.Debug(string.Format("Documentum.DeleteFolder: rimosso sottofascicolo con id {0}", folder.systemID));
            }
            catch (Exception ex)
            {
                retValue = false;

                logger.Debug(string.Format("Errore in Documentum.DeleteFolder:\n{0}", ex.ToString()));
            }

            return(retValue);
        }
Exemple #6
0
 public WeChatController(
     ILogger <WeChatController> logger,
     IWeChatContainer container,
     IAppService appService,
     IMenuService menuService,
     IMediaService mediaService,
     INewsService newsService,
     IActivityService activityService,
     IVoteService voteService,
     IUserService userService,
     IScaleService scaleService,
     IUAService uAService,
     IRoleService roleService,
     IPAService pAService,
     IObjectService objectService)
     : base(logger, userService, scaleService, uAService, roleService, pAService, objectService)
 {
     this.logger          = logger;
     this.app             = container.GetApp();
     this.appService      = appService;
     this.menuService     = menuService;
     this.mediaService    = mediaService;
     this.newsService     = newsService;
     this.activityService = activityService;
     this.voteService     = voteService;
 }
Exemple #7
0
        /// <summary>
        /// Modifica dei dati di un folder
        /// </summary>
        /// <param name="folder"></param>
        /// <returns></returns>
        public bool ModifyFolder(DocsPaVO.fascicolazione.Folder folder)
        {
            bool retValue = false;

            try
            {
                // Reperimento identity per il sottofascicolo
                ObjectIdentity identity = Dfs4DocsPa.getSottofascicoloIdentityById(folder.systemID);

                DataObject dataObject = new DataObject(identity, ObjectTypes.SOTTOFASCICOLO);

                // Reperimento properties del sottofascicolo
                dataObject.Properties.Properties.AddRange(Dfs4DocsPa.getSottoFascicoloProperties(folder));

                DataPackage dataPackage = new DataPackage(dataObject);

                IObjectService objectService = this.GetServiceInstance <IObjectService>(true);
                dataPackage = objectService.Update(dataPackage, null);

                retValue = (dataPackage.DataObjects.Count == 1);

                if (retValue)
                {
                    logger.Debug(string.Format("Documentum.ModifyFolder: modificato sottofascicolo con id {0}", folder.systemID));
                }
            }
            catch (Exception ex)
            {
                retValue = false;

                logger.Debug(string.Format("Errore in Documentum.ModifyFolder:\n{0}", ex.ToString()));
            }

            return(retValue);
        }
Exemple #8
0
 public DownloadObjectCommand(BucketContentViewModel senderView, IBucketService bucketService, IObjectService objectService, string bucketName)
 {
     _senderView    = senderView;
     _bucketService = bucketService;
     _objectService = objectService;
     _bucketName    = bucketName;
 }
Exemple #9
0
        /// <summary>
        /// Caricamento dei valori delle properties relative allo stato checkout per il documento
        /// </summary>
        /// <param name="documentNumber"></param>
        /// <param name="isStampaRegistro"></param>
        /// <returns></returns>
        protected virtual PropertySet LoadCheckOutProperties(string documentNumber, bool isStampaRegistro)
        {
            ObjectIdentity identity = null;

            if (isStampaRegistro)
            {
                identity = Dfs4DocsPa.getDocumentoStampaRegistroIdentityByDocNumber(documentNumber);
            }
            else
            {
                identity = Dfs4DocsPa.getDocumentoIdentityByDocNumber(documentNumber);
            }

            List <string> filters = new List <string>();

            filters.Add("r_object_id");
            filters.Add("object_name");
            filters.Add("r_lock_owner");
            filters.Add("r_lock_date");
            filters.Add(TypeDocumento.CHECKOUT_LOCAL_FILE_PATH);
            filters.Add(TypeDocumento.CHECKOUT_MACHINE_NAME);

            if (!isStampaRegistro)
            {
                // Caricamento informazioni di checkout specifiche per documenti non di tipo stampa registro
                filters.Add(TypeDocumento.TIPO_PROTOCOLLO);
            }

            IObjectService service    = this.GetServiceInstance <IObjectService>(true);
            DataObject     dataObject = DfsHelper.getAllPropsAndFolders(service, identity, filters, false);

            return(dataObject.Properties);
        }
        public void SetUp()
        {
            objectRepository = new Dictionary <string, object>();

            ReflectionOptimizer.Enable();

            var apiCtx = BuildRoutine.Context()
                         .AsClientApplication(
                codingStyle = BuildRoutine.CodingStyle()
                              .FromBasic()
                              .AddCommonSystemTypes()
                              .AddTypes(GetType().Assembly, t => t.Namespace?.StartsWith("Routine.Test.Performance.Domain") == true)

                              .Use(p => p.ParseableValueTypePattern())

                              .Initializers.Add(c => c.PublicConstructors().When(type.of <BusinessPerformanceInput>()))
                              .Datas.Add(c => c.Properties(m => !m.IsInherited(true, true)))
                              .DataFetchedEagerly.Set(true)
                              .Operations.Add(c => c.Methods(o => !o.IsInherited(true, true)))
                              .IdExtractor.Set(c => c.IdByProperty(m => m.Returns <int>("Id")))
                              .Locator.Set(c => c.Locator(l => l.SingleBy(id => objectRepository[id])))
                              .ValueExtractor.Set(c => c.Value(e => e.By(o => $"{o}")))
                );

            objectService = apiCtx.ObjectService;
            rapp          = apiCtx.Application;

            var _ = objectService.ApplicationModel;
        }
        public ObjectReferenceInterceptionContext(string target, IObjectService objectService, ReferenceData targetReference)
            : base(target)
        {
            this.objectService = objectService;

            TargetReference = targetReference;
        }
 public ObjectController(
     IObjectService objectService,
     IObjectStatusService objectStatusService)
 {
     _objectService       = objectService;
     _objectStatusService = objectStatusService;
 }
Exemple #13
0
        internal static ObjectDescription CreateFromSetting(IObjectService objectService, Type objectType, IObjectSetting setting)
        {
            var description = new ObjectDescription(objectType);
            var parameters  = setting.ConstructorParameters;

            if (parameters != null && parameters.Length > 0)
            {
                description.ConstructorParameters = parameters.Select(x => {
                    var value = new ValueDescription {
                        Name  = x.Name,
                        Type  = objectService.GetOrCreateType(x.TypeName),
                        Value = x.Value
                    };
                    return((IValueDescription)value);
                }).ToArray();
            }
            var properties = setting.Properties;

            if (properties != null && properties.Length > 0)
            {
                description.Properties = properties.Select(x => {
                    var value = new ValueDescription {
                        Name  = x.Name,
                        Type  = objectService.GetOrCreateType(x.TypeName),
                        Value = x.Value
                    };
                    return((IValueDescription)value);
                }).ToArray();
            }
            return(description);
        }
Exemple #14
0
 public ServiceHandler(IObjectService objectService, ServiceContainer container, Type contractType, ServiceFactory serviceFactory)
 {
     this.ObjectService  = objectService;
     this.Container      = container;
     this.ServiceFactory = serviceFactory;
     this.InitService(contractType);
 }
 public JWTAuthAttribute(string featureName)
 {
     _featureName   = featureName;
     _objectService = new ObjectService <UserViewModel>();
     _authModel     = JwtTokenService.GetAuthModel();
     _jwtService    = new JWTService(_authModel.SecretKey);
 }
 public void Init()
 {
     Access.SetTempDirectory(System.IO.Path.GetTempPath());
     _access        = new Access(TestConstants.SATELLITE_URL, TestConstants.VALID_API_KEY, TestConstants.ENCRYPTION_SECRET);
     _bucketService = new BucketService(_access);
     _objectService = new ObjectService(_access);
 }
Exemple #17
0
        public virtual void Init(IObjectService objectService, IResultHandlerFactoryContextSetting setting)
        {
            this.ObjectService = objectService;

            if (setting.ModuleEnabled)
            {
                this.Modules = this.ObjectService.GetObjects <IResultModule>();
            }

            this.DefaultResultHandler = this.ObjectService.GetObject <IResultHandler>(setting.DefaultHandlerName);
            var handlers       = this.Handlers = new Dictionary <Type, IResultHandler>();
            var coreAttributes = ((IObjectServiceInternal)objectService).CoreAttributes;

            coreAttributes.TryGetValue(typeof(ResultHandlerAttribute), out var attributes);
            if (attributes != null && attributes.Count > 0)
            {
                foreach (ResultHandlerAttribute attribute in attributes)
                {
                    if (this.ObjectService.GetObject(attribute.OwnerType) is IResultHandler resultHandler)
                    {
                        handlers.Add(attribute.HandleType, resultHandler);
                    }
                }
            }
        }
 public AvailableObjectsController(
     IObjectService objectService
     , mydbContext context)
 {
     _objectService = objectService;
     _context       = context;
 }
 public ObjectServiceDemo(String defaultRepository, String secondaryRepository, String userName, String password)
     : base(defaultRepository, secondaryRepository, userName, password)
 {
     ServiceFactory serviceFactory = ServiceFactory.Instance;
     objectService =
         serviceFactory.GetRemoteService<IObjectService>(DemoServiceContext);
 }
Exemple #20
0
 public EmployeeObjectController(
     IObjectService objectService,
     IEmployeeObjectService employeeObjectService)
 {
     this.objectService         = objectService;
     this.employeeObjectService = employeeObjectService;
 }
Exemple #21
0
        public void OnExecuting(object sender, ExecutionCancelEventArgs e)
        {
            IEngine engine = sender as IEngine;

            CreateObjectCommand createObjectCommand = CreateObjectCommand.Evaluate(engine, e.Command);

            if (createObjectCommand == null)
            {
                return;
            }

            IObjectService   objectService   = engine.GetService <IObjectService>();
            ISchemaService   schemaService   = engine.GetService <ISchemaService>();
            IDatabaseService databaseService = engine.GetService <IDatabaseService>();

            databaseService.EnsureTransaction();

            Type type = objectService.GetTypeByName(createObjectCommand.ClassName);

            //Create a new object of the class
            object obj = objectService.CreateObject(type);

            //Set the properties of the new object
            if (createObjectCommand.Values != null)
            {
                foreach (string propertyName in createObjectCommand.Values.Keys)
                {
                    if (schemaService.HasProperty(createObjectCommand.ClassName, propertyName))
                    {
                        objectService.SetProperty(obj, propertyName, createObjectCommand.Values[propertyName]);
                    }
                }
            }
        }
Exemple #22
0
        //处理定义在类上的扩展器
        public static void ExtenderInit <T, TA>(IObjectService objectService, T instance, IDictionary items = null) where TA : ServiceExtenderAttribute
        {
            var attributes = objectService.AsObjectServiceInternal().CoreAttributes;

            if (!attributes.TryGetValue(typeof(TA), out var list))
            {
                return;
            }
            if (list == null || list.Count <= 0)
            {
                return;
            }
            items = items ?? new Hashtable();
            var orderList = list.OrderByDescending(x => x.Priority);

            foreach (TA attribute in orderList)
            {
                var type = attribute?.OwnerType;
                if (type != null)
                {
                    var extender = objectService.GetOrCreateObject(type) as IObjectExtender <T>;
                    extender?.Init(instance, items);
                }
            }
        }
Exemple #23
0
        /// <summary>
        /// Verifica credenziali utente
        /// </summary>
        /// <param name="userName"></param>
        protected virtual bool VerifyCredentials(string userName, string authenticationToken, out DocsPaVO.utente.UserLogin.LoginResult loginResult)
        {
            bool retValue = false;

            loginResult = UserLogin.LoginResult.APPLICATION_ERROR;
            try
            {
                ObjectIdentity identity = Dfs4DocsPa.getUserHomeFolderIdentity(userName);

                IObjectService objectService = DctmServiceFactory.GetServiceInstance <IObjectService>(authenticationToken);
                logger.Debug("Inizio richiamo authenticationToken");
                DataPackage dataPackage = objectService.Get(new ObjectIdentitySet(identity), null);
                logger.Debug("Fine chiamata  authenticationToken");
                retValue = (dataPackage != null);
            }

/*
 *       catch (Emc.Documentum.FS.Runtime.AuthenticationException exAuth)
 *      {
 *          //AuthenticationException - Exception in com.emc.documentum.fs.rt
 *          //Exception which is raised when authentication errors occur
 *          loginResult = DocsPaVO.utente.UserLogin.LoginResult.UNKNOWN_DTCM_USER;
 *          retValue = false;
 *
 *          logger.Debug(string.Format("Credenziali utente DTCM non valide: '{0}'", userName));
 *      }
 */
            catch (Emc.Documentum.FS.Runtime.ServiceInvocationException exServiceInvocation)
            {
                //AuthenticationException - Exception in com.emc.documentum.fs.rt
                //Exception which is raised when authentication errors occur
                loginResult = DocsPaVO.utente.UserLogin.LoginResult.DTCM_SERVICE_NO_CONTACT;
                retValue    = false;

                logger.Debug(string.Format("Errore nel tentativo di contattare i servizi DOCUMENTUM: '{0}'", userName));
            }

            /*
             *     catch (Emc.Documentum.FS.Runtime.ServiceException exService)
             *     {
             *         //AuthenticationException - Exception in com.emc.documentum.fs.rt
             *         //Exception which is raised when authentication errors occur
             *         loginResult = DocsPaVO.utente.UserLogin.LoginResult.DTCM_SERVICE_NO_CONTACT;
             *         retValue = false;
             *
             *         logger.Debug(string.Format("Errore nel tentativo di contattare i servizi DTCM: '{0}'", userName));
             *     }
             */
            catch (Exception ex)
            {
                //AuthenticationException - Exception in com.emc.documentum.fs.rt
                //Exception which is raised when authentication errors occur
                loginResult = DocsPaVO.utente.UserLogin.LoginResult.UNKNOWN_USER;
                retValue    = false;

                logger.DebugFormat("Credenziali utente non DCTM valide: '{0}'  msg {1} stk {2}", userName, ex.Message, ex.StackTrace);
            }

            return(retValue);
        }
Exemple #24
0
 /// <summary>
 /// Reperimento istanza IObjectService
 /// </summary>
 /// <returns></returns>
 protected IObjectService GetObjectServiceInstance()
 {
     if (this._objectServiceInstance == null)
     {
         this._objectServiceInstance = DctmServiceFactory.GetServiceInstance <IObjectService>(this.InfoUtente.dst);
     }
     return(this._objectServiceInstance);
 }
Exemple #25
0
 public AccessControl(mydbContext context, IUserService userService, IAccessService accessService, IObjectService objectService, ILoggerService logger)
 {
     _context       = context;
     _userService   = userService;
     _accessService = accessService;
     _objectService = objectService;
     _logger        = logger;
 }
Exemple #26
0
        // The service should reject inserting an object on a replace operation if the object doesn't already exist
        public async Task Upsert_fails_Not_Found(string id, string json)
        {
            IObjectService service        = _fixture.CustomersService;
            var            collectionName = "customers";
            var            result         = await service.ReplaceAsync("bookstore", collectionName, id, json);

            Assert.Equal(404, result.Status);
        }
Exemple #27
0
        public async Task Get_Object_fail_Not_Found(string id)
        {
            IObjectService service        = _fixture.CustomersService;
            var            collectionName = "customers";
            var            getResult      = await service.GetAsync("bookstore", collectionName, id);

            Assert.Equal(404, getResult.Status);
        }
Exemple #28
0
        public ObjectServiceDemo(String defaultRepository, String secondaryRepository, String userName, String password, String domain)
            : base(defaultRepository, secondaryRepository, userName, password)
        {
            ServiceFactory serviceFactory = ServiceFactory.Instance;

            objectService =
                serviceFactory.GetRemoteService <IObjectService>(DemoServiceContext, "core", domain);
        }
Exemple #29
0
 public GalaxyHub(IAuthenticationService authService, IObjectService objectService, IGameService gameService, IMapService mapService, ILootService lootService)
 {
     _lootService   = lootService;
     _authService   = authService;
     _gameService   = gameService;
     _objectService = objectService;
     _mapService    = mapService;
 }
Exemple #30
0
        // Disallow updating an object with malformed Json
        public async Task Replace_fails_Malformed_Json(string id, string json)
        {
            IObjectService service        = _fixture.CustomersService;
            var            collectionName = "customers";
            var            result         = await service.ReplaceAsync("bookstore", collectionName, id, json);

            Assert.Equal(400, result.Status);
        }
 public ItemsController(IGameService gameService, IAuthenticationService authenticationService, IObjectService objectService, ICookie cookie, ICookieManager cookieManager)
 {
     _gameService           = gameService;
     _authenticationService = authenticationService;
     _cookie        = cookie;
     _cookieManager = cookieManager;
     _objectService = objectService;
 }
Exemple #32
0
 public Github(IUserService userService, IRepositoryService repositoryService, INetworkService networkService,
               IIssueService issueService, IObjectService objectService, ICommitService commitService)
 {
     Users = userService;
     Repositories = repositoryService;
     Networks = networkService;
     Issues = issueService;
     Objects = objectService;
     Commits = commitService;
 }
Exemple #33
0
 public ObjectServiceContext(IObjectService objectService)
     : this(objectService, new HybridDictionary())
 {
 }
Exemple #34
0
 protected override void Init(IObjectService objectService)
 {
     base.Init(objectService);
     objectService.ObjectBuilder.ObjectCreating += ObjectBuilderOnObjectCreating;
     objectService.ObjectBuilder.ObjectCreated += ObjectBuilderOnObjectCreated;
 }
Exemple #35
0
 public ObjectServiceContext(IObjectService objectService, IDictionary items)
     : base(items)
 {
     this.ObjectService = objectService;
 }
 public void Setup()
 {
     ObjectRepository = GithubServiceLocator.Get<IObjectService>();
 }