Esempio n. 1
0
        /** Uploads a single file using the FileManagement utilities. */
        public void uploadSingleFile(FileManagementUtility fmsFileManagement, DataManagementService dmService)
        {
            GetDatasetWriteTicketsInputData[] inputs = { getSingleGetDatasetWriteTicketsInputData(dmService) };
            ServiceData response = fmsFileManagement.PutFiles(inputs);

            if (response.sizeOfPartialErrors() > 0)
            {
                System.Console.Out.WriteLine("FileManagementService single upload returned partial errrors: " + response.sizeOfPartialErrors());
            }

            // Delete all objects created
            ModelObject[] datasets = { inputs[0].Dataset };
            dmService.DeleteObjects(datasets);
        }
Esempio n. 2
0
        /** Uploads multiple files using the FileManagement utilities. */
        public void uploadMultipleFiles(FileManagementUtility fMSFileManagement, DataManagementService dmService)
        {
            GetDatasetWriteTicketsInputData[] inputs = getMultipleGetDatasetWriteTicketsInputData(dmService);
            ServiceData response = fMSFileManagement.PutFiles(inputs);

            if (response.sizeOfPartialErrors() > 0)
            {
                System.Console.Out.WriteLine("FileManagementService multiple upload returned partial errrors: " + response.sizeOfPartialErrors());
            }

            // Delete all objects created
            ModelObject[] datasets = new ModelObject[inputs.Length];
            for (int i = 0; i < inputs.Length; ++i)
            {
                datasets[i] = inputs[i].Dataset;
            }
            dmService.DeleteObjects(datasets);
        }
Esempio n. 3
0
        /**
         * Delete the Items
         *
         * @param items     Array of Items to delete
         *
         * @throws ServiceException    If any partial errors are returned
         */
        public void deleteItems(Item[] items) //throws ServiceException
        {
            // Get the service stub
            DataManagementService dmService = DataManagementService.getService(MyFormAppSession.getConnection());

            // *****************************
            // Execute the service operation
            // *****************************
            ServiceData serviceData = dmService.DeleteObjects(items);

            // The AppXPartialErrorListener is logging the partial errors returned
            // In this simple example if any partial errors occur we will throw a
            // ServiceException
            if (serviceData.sizeOfPartialErrors() > 0)
            {
                throw new ServiceException("DataManagementService.deleteObjects returned a partial error.");
            }
        }
Esempio n. 4
0
        public String deleteItem(String codeNumber)
        {
            String Msg = "执行成功";
            DataManagementService dmService = DataManagementService.getService(Session2.getConnection());

            ////删除前,取消发布
            //ModelObject itemReversion = findModel("", new string[] { "iid" }, new string[] { codeNumber });
            ////取消发布流程
            //workflow_publish("", itemReversion);

            //调用查询构建器,查询ITEM
            ModelObject itemObj = findModel(cfg.get("query_builder_ItemById_name")
                                            , new string[] { cfg.get("query_builder_ItemById_queryKey") }, new string[] { codeNumber });
            ServiceData serviceData = dmService.DeleteObjects(new ModelObject[] { itemObj });

            //if (serviceData.sizeOfPartialErrors() > 0)
            //{
            //    Msg = "删除ITEM失败,已发布的ITEM不能删除或无权限删除:" + serviceData.GetPartialError(0).Messages[0];
            //    throw new Exception("删除ITEM失败,已发布的ITEM不能删除或无权限删除:" + serviceData.GetPartialError(0).Messages[0]);
            //}


            return(Msg);
        }