Tag Info

Hot answers tagged

6

If you want a super user to be able to change logos etc, or if the logo is specific to a site collection, place them in a subfolder in /Style Library/Images/. However often you dont want the layout files of your page, or your CSS for that matter, to be changed by end users. This is a good reason to place them somewhere in the v\TEMPLATE\LAYOUTSfolder. These ...


6

I solved this by using a CamlQuery directly after creation to return folders with the same name as a ListItemCollection: SP.CamlQuery query = new SP.CamlQuery(); query.ViewXml = "<View Scope='RecursiveAll'>" + "<Query>" + "<Where>" + "<And>" + ...


5

I think the best solution is to open the document library in an Explorer window (using WebDav) and move or copy stuff around that way. You could also use the Site Content and Structure site action (you need to have the publishing feature enabled on your site) and select all the documents in the folder and move them to a new folder. But this tool is not able ...


5

If you want to create a folder, you have to specify its name in the leafName parameter. change your code to : foreach (SPListItem reparto in reparti.Items) { var folder = dl.Items.Add( dl.RootFolder.ServerRelativeUrl, SPFileSystemObjectType.Folder, "Test" ); folder.Update(); } If it can help, here a ...


4

Based on your last comment I create a webpart to show the Document List on a certain page, and then I applied a filter on a column content to show only certain documents. But in that way the folder structure is lost and all documents are shown flat. I think I can answer your your question now. If you create a new view and select in the ...


4

The rules are "very simple" (see the full KB article here), which is why you should alway use SPUrlUtility to check filenames. Except about folders and files: Folder names •You cannot use the following characters anywhere in a folder name or a server name: ◦tilde ◦number sign ◦percent ◦ampersand ◦asterisk ◦braces ◦backslash ◦colon ...


4

Try not calling clientContext.Load, for example this works for me: var folder = list.RootFolder; clientContext.Load(folder); clientContext.ExecuteQuery(); folder = folder.Folders.Add("Folder 1"); folder.Folders.Add("Folder 2"); clientContext.ExecuteQuery();


4

For SPQuery, use SPQuery.Folder to define the folder: SPFolder folder = list.RootFolder.SubFolders["Folder 1"]; SPQuery query = new SPQuery(); query.Folder = folder; Then, to define content type, you should include the following condition into your Where clause: SPContentType contentType = list.ContentTypes["MyContentType"]; query.Query = ...


4

As long as you reseal it again, as you do, I do not see a problem. Here's a snippet regarding the purpose of sealing: Sometimes, you want to make absolutely sure that someone can’t go in and change your content type via the Windows SharePoint Services user interface. If an administrator were to delete or rename columns in your content type this ...


3

You could create a column that would represent all of your topics. This could be a choice column that you would use to edit the properties of the discussion. Then, you could create a view that groups all discussions based on their topic. You will have the same data all automatically categorized. For the hierarchy, a message can only be created when you ...


3

The filter that worked for my library view... to show only "ABC" related folders and documents is shown below. Remember that SharePoint appears to be unix-based in that things are case-sensitive, so where "Folder" worked in the below filter, "folder" did not. Also note that, since most users who are creating folders don't apply categories, I used the "Name ...


3

I'm assuming you have users setting up their own alerts, so you can't really handle this as the alerts are created, but you can change the behavior of existing alerts programatically. I would recommend iterating through SPWeb.Alerts, check each SPAlert object to see if it's scoped to your list (alert.AlertType == SPAlertType.List && alert.ListID == ...


3

Consider using Chris O'Brien's Sharepoint Content Deployment Wizard: http://www.sharepointnutsandbolts.com/2007/12/introducing-sharepoint-content.html It can be found on CodePlex.


3

I am not sure you can do that with folders, but should consider using Document Sets because they do share metadata with subitems. About documents sets Document Sets is a new feature in SharePoint Server 2010 that enables an organization to manage a single deliverable, or work product, which can include multiple documents or files. A Document Set is a ...


3

If you created the view in code you will need to specify the Scope="Recursive" ViewAttribute Some examples are given here http://sharepointmagazine.net/technical/development/writing-caml-queries-for-retrieving-list-items-from-a-sharepoint-list If you created the views with the SharePoint UI you will need to Modify the view. Expand the "Folders" section ...


3

How about something like this: public static Folder EnsureFolder(ClientContext ctx, Folder ParentFolder, string FolderPath) { //Split up the incoming path so we have the first element as the a new sub-folder name //and add it to ParentFolder folders collection string[] PathElements = FolderPath.Split(new char[] { '/' }, ...


3

Every user who should see the + Add Document link are the users who have at least contribute access to that particular list. Please verify that all your users who should have the add link have that permission. Here's a walk through trough: (1) Access the list all items by clicking the header link. Your URL should end with <list name>/AllItems.aspx if ...


3

This took forever to figure out, but of course it is simple once you got it. Instead of pasting a bunch of code, here is the context and then the raw HTTP POST request that I ended up with. The documentation is actually right here: http://msdn.microsoft.com/en-us/library/dd962796(v=office.12).aspx Syntax for the slug header is as following: ...


3

In 2013 (but not in 2010 as you say) you can nest Document Sets. So then the only differences is the fancy WelcomePage and the possibility to add Shared Metadata between the document set it self and all contained files. And as you write, the fact that you do not have version history on folders, but on Document Sets. More about document sets from TechNet ...


2

So not using the Obj Model or code I would simply use Open Explorer view from the Library Ribbon. I would navigate to the source folder and use the option. I would than navigate to the target and do the same. The result should be two different explorer windows representing each Sharepoint folder. From there it is matter of copying and pasting in the ...


2

Create a event reciever using the following code and then attach the event reciever to your document libraries. private bool CanDeleteFolder(SPWeb web) { // check to see if the user is in the owners group SPUser user = web.CurrentUser; if (!user.IsSiteAdmin) { return false; } else { //admins can delete folder ...


2

To copy contents from one site or document library, you need to perform the folowing three actions: 1) Create a document library and corresponding folders in the destination path. 2) Open both source and destination paths in Explorer by hitting the "Open with Explorer" icon that can be found tab the "Library" tab. 3) start copying/moving documents. For ...


2

Perhaps you could make a granular backup of the complete library, then restore that to the destination site and delete everything you don't need once it's restored. If you want to move the folder to a specific library in the destination site, restore the library to a dummy library in the destination site, then move the folder, then delete the dummy ...


2

What particular reason would you need to do this? SharePoint provides these types of virtual folders already, and I bet then can satisfy your requirement as is. If you're curious though, they are set up in IIS. Read here for more info: http://learn.iis.net/page.aspx/150/understanding-sites-applications-and-virtual-directories-on-iis-7/


2

You can get all the folders with the following: function GetFolders() { var context = new SP.ClientContext.get_current(); var web = context.get_web(); var list = web.get_lists().getByTitle('DocumentLibraryName'); var query = SP.CamlQuery.createAllFoldersQuery(); var allItems = list.getItems(query); context.load(allItems); ...


2

You can create event receiver that will check that task is closed and disallow adding file and redirecting to custom page, where the details will be shown. Please check the article related how to implement in in SP2007 - http://www.sharepointkings.com/2008/06/redirection-from-event-handler.html. But in my opinion archiving process will be better, as @Kit ...


2

I managed to find an answer myself, well almost atleast. Based on Rob D'Ora's answer (which didn't worked, even though it looked like the right thing) I created a method to turn alerts on/off. (Maybe not the most efficient way, but it works) public static void ToggleAlertStatus(SPWeb web, Guid listID, SPAlertType alertType, SPAlertStatus alertStatus) ...


2

You can enable the management of content types in the document library. Add the Link to Document content type to the library. Then in the folder of your choosing, select the Link to Document from the New menu and point it to the file you'd like. Rinse/repeat as nessary. (Steps above taken from memory of SP 2007, exact process for 2010 may be different).


2

It looks like folders aren't offically supported by Microsoft within Document Sets. See the Document Sets planning (SharePoint Server 2010) From the document: Folders are not allowed in document sets, and metadata navigation cannot be used in a Document Set There may be an unsupported way, but it will likely cause problems.



Only top voted, non community-wiki answers of a minimum length are eligible