/// <summary> /// Read the list of ids for a compound library /// </summary> /// <param name="libId"></param> /// <returns></returns> public static CidList ReadLibrary( int libId) { if (ServiceFacade.UseRemoteServices) { Mobius.Services.Native.INativeSession nativeClient = ServiceFacade.CreateNativeSessionProxy(); Services.Native.NativeMethodTransportObject resultObject = ServiceFacade.InvokeNativeMethod(nativeClient, (int)Services.Native.ServiceCodes.MobiusCidListService, (int)Services.Native.ServiceOpCodes.MobiusCidListService.ReadLibrary, new Services.Native.NativeMethodTransportObject(new object[] { libId })); ((System.ServiceModel.IClientChannel)nativeClient).Close(); if (resultObject == null || resultObject.Value == null) { return(null); } UserObject uo = UserObject.DeserializeBinary((byte[])resultObject.Value); MetaTable mt = MetaTableCollection.Get(MetaTable.PrimaryRootTable); CidList cidList = CidList.Deserialize(uo, mt); return(cidList); } else { return(UAL.CidListDao.ReadLibrary(libId)); } }
/// <summary> /// Read a compoundId list given the listId /// </summary> /// <param name="listId"></param> /// <param name="mt"></param> /// <returns></returns> public static CidList Read( int listId, MetaTable mt) { UserObject uo = UserObjectDao.Read(listId); if (uo == null) { return(new CidList()); } else { return(CidList.Deserialize(uo, mt)); } }
/// <summary> /// Read a compound id list given an internal list name (e.g. FOLDER_123.name or LIST_1234) /// </summary> /// <param name="name"></param> /// <param name="mt"></param> /// <returns></returns> public static CidList Read( string internalName, MetaTable mt, bool allowLocalRead) { UserObject uo, uo2; string fileName, cn; int i1; uo = UserObjectUtil.ParseInternalUserObjectName(internalName, UserObjectType.CnList); if (uo == null) { return(null); } if (allowLocalRead && UserObject.IsCurrentObjectInternalName(internalName)) // get from the current query { return(ReadCurrentListLocal()); } uo2 = UserObjectDao.Read(uo); // get from the server side if (uo2 == null) { MessageBoxMx.ShowError( "Unable to find list: " + internalName + "\r\n\r\n" + CommandExec.GetUserObjectReadAccessErrorMessage(uo.Id, "list")); return(null); } CidList cnList = CidList.Deserialize(uo2, mt); if (UserObject.IsCurrentObjectInternalName(internalName)) // if current list store keys with query { SessionManager.CurrentResultKeys = cnList.ToStringList(); } return(cnList); }
/// <summary> /// Read a compound id list given a list name /// </summary> /// <param name="name"></param> /// <returns></returns> public static CidList Read( string name, MetaTable mt) { UserObject uo; CidList cnList = new CidList(); string fileName, cn; int i1; uo = UserObject.ParseInternalUserObjectName(name, UserObjectType.CnList, Security.UserName); if (uo == null) { return(null); } uo = UserObjectDao.Read(uo); if (uo == null) { return(new CidList()); } return(CidList.Deserialize(uo, mt)); }