示例#1
0
        private void AddServiceObjectMethods(ServiceObject so)
        {
            //add methods
            AddGetItemByIdMethod(so);
            AddUpdateItemByIdMethod(so);
            AddBreakItemInheritanceByIdMethod(so);
            AddResetItemInheritanceByIdMethod(so);
            AddAddItemPermissionByIdMethod(so);
            AddRemoveItemPermissionByIdMethod(so);
            AddGetItemPermissionByIdMethod(so);
            AddGetItemsMethod(so);

            if (!so.IsDocumentLibrary())
            {
                AddCreateItemMethod(so);
                AddDeleteItemByIdMethod(so);
                AddGetItemByTitleMethod(so);
            }
            else
            {
                AddGetItemByNameMethod(so);
                AddCreateDocumentMethod(so);
                AddDeleteDocumentByIdMethod(so);
                AddGetDocumentByIdMethod(so);
                AddGetDocumentsMethod(so);
                AddRenameDocumentByIdMethod(so);
                AddCopyDocumentByNameMethod(so);
                AddMoveDocumentByNameMethod(so);
                AddCheckInDocumentByNameMethod(so);
                AddCheckInDocumentByIdMethod(so);
                AddCheckOutDocumentByIdMethod(so);
                AddCheckOutDocumentByNameMethod(so);

                if (so.IsDocumentSetLibrary())
                {
                    AddCreateDocumentSetByNameMethod(so);
                    AddUpdateDocumentSetByNameMethod(so);
                    AddGetDocSetMethod(so);
                    AddGetDocumentSetsMethod(so);
                    AddRenameDocumentSetMethod(so);
                    AddDeleteDocumentSetMethod(so);
                }
            }

            if (so.IsSPFolderEnabled())
            {
                AddCreateFolderMethod(so);
                AddDeleteFolderMethod(so);
                AddRenameFolderMethod(so);
                AddBreakFolderInheritanceByNameMethod(so);
                AddResetFolderInheritanceByNameMethod(so);
                AddAddFolderPermissionByNameMethod(so);
                AddRemoveFolderPermissionByNameMethod(so);
                AddGetFolderPermissionByIdMethod(so);
                AddMoveFolderMethod(so);
            }
        }
示例#2
0
        private void AddInputServiceObjectPropertie(ServiceObject so)
        {
            //add recursively property
            Property recursivelyNameProperty = NewProperty(Constants.SOProperties.Recursively, Constants.SOProperties.Recursively_DisplayName, true, SoType.YesNo, "Recursively do this operation");

            so.Properties.Add(recursivelyNameProperty);
            //add folder name property
            Property folderNameProperty = NewProperty(Constants.SOProperties.FolderName, Constants.SOProperties.FolderName_DisplayName, true, SoType.Text, "The foldername to apply this operation to");

            so.Properties.Add(folderNameProperty);

            //add linkToItem property
            Property linkToItemProperty = NewProperty(Constants.SOProperties.LinkToItem, Constants.SOProperties.LinkToItem_DisplayName, true, SoType.Text, "Link To Item");

            so.Properties.Add(linkToItemProperty);

            //add userLogins property
            Property userLoginsProperty = NewProperty(Constants.SOProperties.UserLogins, Constants.SOProperties.UserLogins_DisplayName, true, SoType.Text, "User logins separated by semicolon");

            so.Properties.Add(userLoginsProperty);

            //add groupLogins property
            Property groupLoginsProperty = NewProperty(Constants.SOProperties.GroupLogins, Constants.SOProperties.GroupLogins_DisplayName, true, SoType.Text, "Group logins separated by semicolon");

            so.Properties.Add(groupLoginsProperty);

            //add permission property
            Property permissionProperty = NewProperty(Constants.SOProperties.Permission, Constants.SOProperties.Permission_DisplayName, true, SoType.Text, "Role Definition Name");

            so.Properties.Add(permissionProperty);

            //add userOrGroup property
            Property userOrGroupProperty = NewProperty(Constants.SOProperties.UserOrGroup, Constants.SOProperties.UserOrGroup_DisplayName, true, SoType.Text, "User or group login");

            so.Properties.Add(userOrGroupProperty);

            //add DestinationURL property
            Property destinationURLProperty = NewProperty(Constants.SOProperties.DestinationURL, Constants.SOProperties.DestinationURL_DisplayName, true, SoType.Text, "The destination URL");

            so.Properties.Add(destinationURLProperty);

            //add DestinationLibrary property
            Property destinationLibraryProperty = NewProperty(Constants.SOProperties.DestinationLibrary, Constants.SOProperties.DestinationLibrary_DisplayName, true, SoType.Text, "The system name of the list");

            so.Properties.Add(destinationLibraryProperty);

            //add DestinationListLibrary property
            Property destinationListLibraryProperty = NewProperty(Constants.SOProperties.DestinationListLibrary, Constants.SOProperties.DestinationListLibrary_DisplayName, true, SoType.Text, "The system name of the list/library");

            so.Properties.Add(destinationListLibraryProperty);

            //add DestinationFolder property
            Property destinationFolderProperty = NewProperty(Constants.SOProperties.DestinationFolder, Constants.SOProperties.DestinationFolder_DisplayName, true, SoType.Text, "The foldername to apply this operation to");

            so.Properties.Add(destinationFolderProperty);

            if (so.IsDocumentLibrary())
            {
                //add overwriteExistingDocument property
                Property overwriteExistingDocument = NewProperty(Constants.SOProperties.OverwriteExistingDocument,
                                                                 Constants.SOProperties.OverwriteExistingDocument_DisplayName,
                                                                 true, SoType.YesNo, "Overwrite Existing Document");
                so.Properties.Add(overwriteExistingDocument);
                //add newFileName property
                Property newFileNameProperty = NewProperty(Constants.SOProperties.NewFileName, Constants.SOProperties.NewFileName_DisplayName, true, SoType.Text, "New File Name");
                so.Properties.Add(newFileNameProperty);

                //properties used in Check In Functionality
                Property checkInComments = NewProperty(Constants.SOProperties.CheckInComment, Constants.SOProperties.CheckInComment_DisplayName, true, SoType.Memo, "Check In Comments");
                so.Properties.Add(checkInComments);

                Property retainCheckout = NewProperty(Constants.SOProperties.RetainCheckOut, Constants.SOProperties.RetainCheckOut_DisplayName, true, SoType.YesNo, "Retain Checkout");
                so.Properties.Add(retainCheckout);

                Property useCheckedInVersion = NewProperty(Constants.SOProperties.UseCheckedInVersion, Constants.SOProperties.UseCheckedInVersion_DisplayName, true, SoType.YesNo, "Used Checked In version");
                so.Properties.Add(useCheckedInVersion);

                //property use in CheckOut functionality
                Property useCheckedOutVersion = NewProperty(Constants.SOProperties.UseCheckedOutVersion, Constants.SOProperties.UseCheckedOutVersion_DisplayName, true, SoType.YesNo, "Used Checked Out version");
                so.Properties.Add(useCheckedOutVersion);

                if (so.IsDocumentSetLibrary())
                {
                    //property use in CheckOut functionality
                    Property docSetName = NewProperty(Constants.SOProperties.DocSetName, Constants.SOProperties.DocSetName_DisplayName, true, SoType.Text, "Document Set Name");
                    so.Properties.Add(docSetName);

                    Property docSetNewName = NewProperty(Constants.SOProperties.DocSetNewName, Constants.SOProperties.DocSetNewName_DisplayName, true, SoType.Text, "New Document Set Name");
                    so.Properties.Add(docSetNewName);
                }
            }
        }