Exemple #1
0
        /**
         * Reserve Revision IDs
         *
         * @param items       Array of Items to reserve Ids for
         *
         * @return Map of RevisionIds
         *
         * @throws ServiceException  If any partial errors are returned
         */
        public Hashtable generateRevisionIds(Item[] items) //throws ServiceException
        {
            // Get the service stub
            DataManagementService dmService = DataManagementService.getService(MyFormAppSession.getConnection());

            GenerateRevisionIdsResponse response = null;

            GenerateRevisionIdsProperties[] input = null;
            input = new GenerateRevisionIdsProperties[items.Length];

            for (int i = 0; i < items.Length; i++)
            {
                GenerateRevisionIdsProperties property = new GenerateRevisionIdsProperties();
                property.Item     = items[i];
                property.ItemType = "";
                input[i]          = property;
            }

            // *****************************
            // Execute the service operation
            // *****************************
            response = dmService.GenerateRevisionIds(input);

            // The AppXPartialErrorListener is logging the partial errors returned
            // In this simple example if any partial errors occur we will throw a
            // ServiceException
            if (response.ServiceData.sizeOfPartialErrors() > 0)
            {
                throw new ServiceException("DataManagementService.generateRevisionIds returned a partial error.");
            }

            return(response.OutputRevisionIds);
        }