What are the possible ways in which we can deploys files to:-

  1. The SharePoint hive (folders in hive)
  2. The SharePoint content db (libraries, etc)

By files I mean css, js, masterpage, site page, html page, images, doc files, ppt, and other files. Ofcourse there will be ways to deploy them to hive and ways to deploy them to the content db which will depend upon the requirements. I am just making an attempt to collect the possible ways for reference and planning.

Incase you feel its broad topic it would be nice of you to list out the ways. Explanations are not expected.

Here is a sample answer:-

1. The SharePoint hive (folders in hive)

-mapped layout folders (project -> add item)

-mapped images folder (project -> add item)

-mapped folder (project -> add item)

2. The SharePoint content db (libraries, etc)

-Use modules (project -> add item -> select module, then update the elements.xml)

  • What is the difference between thi question and this one? sharepoint.stackexchange.com/questions/91900/… – Robert Lindgren Mar 4 '14 at 14:09
  • I would like to know what are various possible options one has inorder to deploy css js images doc and all sorts of files into the hive, and also into the config db as the case maybe. The question marked as duplicate is my question itself, which is basically asking about possible ways to deploy wsps to sharepoint. What is wrong in starting another question and asking about deploying files? Is it wrong? – variable Mar 4 '14 at 18:22
  • 1
    I think that even if this is not doomed a duplicate, it is still much to broad to be fully solvable in ages paragraphs (which is a rule if thumb for how widely scoped questions we allow). You are better of splitting in to different, much more specific and limited questions :) – Robert Lindgren Mar 4 '14 at 18:28
  • 2
    Also, you should take some time and accept answers or upvote some good efforts on your previous questions, where applicable, to premier the users that has tried to help you – Robert Lindgren Mar 4 '14 at 18:32
  • 2
    As the person that stands to gain here on at least 2 of your questions I second Robert's question to upvote good efforts ;). Thanks Robert! – Cameron Verhelst Mar 4 '14 at 18:50

That's a very broad question.

  • data = content like List Items or Documents
  • definitions = content types, site columns, spwebs, spsites, sptimerjobs, workflows
  • when I say "Add" I don't mean you can't change or delete stuff.

I'm not sure this list is conclusive or correct, but of the top of my head:

  1. SharePoint Hive
    1. Farm Solutions
      • Layouts folder mappings
      • Other mapped folders
      • Features
      • Resource files
      • Application Pages
      • ControlTemplates
      • ...
  2. SharePoint Content DB
    1. User / Farm Solution (Server Object Model)
      • Configure definitions through Code
      • Add data through Code
      • Configure some types of definitions through CAML
      • Add data through Code
    2. PowerShell (Server Object Model)
      • Add data through Code
    3. Client Object Model
      • Add some definitions through Code
      • Add data through Code
    4. Web Services
      • Add data through Code
    5. SharePoint Designer
      • Add code in specific cases (mostly client side stuff)
      • Some definitions can be added
      • Add data
    6. UI
      • Configure Definitions
      • Add data

Web Services might allow some definitions to be added but I'm not sure.

EDIT: So what you're really asking is: What options do we have to put files and how do you decide which to take ?

I suggest not to think too much in terms of Content DB vs Hive, I find it easier to just decide on what the use case is and how to make it available, for example, is it just needed in one Subsite ? Use a Library or something (Content DB), is it more of a global kinda thing, like a masterpage, you want to have it in a solution, only one real option here is the master page gallery (Hive, as it's accessed through _layouts and thus a virtual folder).

You'll find that depending on your use case, usually there's just one place to put it, and sometimes you have options:

  • Images
    • Content DB (meaning, Site Collection or Site really)
      • Site Collection Images Library
      • Style Library (very common to use this)
      • Publishing Images Library
      • Custom libary
    • Hive
      • Layouts/Images I believe ?
  • Style files (CSS,JS)
    • Content DB (ditto)
      • Style Library
      • So far it's the only agreed upon place to put these I believe
    • Hive
      • Don't know by heart but maybe there's a layouts folder where some JS and css is stored ?
  • Web Parts
    • Hive
      • Web Part Gallery
  • Master Pages / Page Layouts
    • Hive
      • Master Page Gallery
  • Control Templates
    • Hive
      • Layouts/ControlTemplates or something :)

In some cases your javascript code is maybe so specific you decide to put it directly in the page (although not advised), so this could be considered another option (Content DB).

Another Stack Exchange question with some good insights: CSS Files in _Layouts or Document Library?

  • I appreciate your attempt to answer my question. You have provided valuable inputs. I wonder what the moderators are upto because some people have lethargically closed the question.. the question that they say is duplicate is not at all related to this question.. I know its broad, but its not so broad that one cannot list out the methods... I have not asked for explanations. – variable Mar 4 '14 at 18:28
  • 1
    Is there reason you dismiss my answer as an attempt ? Do you require specifics on each or do you not feel I have listed all possible scenarios as to how you might deploy your files ;)? – Cameron Verhelst Mar 4 '14 at 18:49
  • 1
    For example, it's unclear to me if you're looking to find out the options in the deploy method or the options in the deploy destination for putting these files. – Cameron Verhelst Mar 4 '14 at 18:52
  • Sorry but I am researching on the methods provided by you, definitely helpful hence upvoted. – variable Mar 4 '14 at 18:54
  • 2
    I don't think I will, as you indeed seem to be asking to just give you the documentation of every possible SharePoint Hive folder one is able to put data in as a SP Developer. You will find that while developing, you will research your requirement and may or may not find a certain folder useful for the purpose, thus I don't see the value in listing a description of every folder on here. Are you dealing with a specific problem or are you researching because you need to make a proposal for something big and complex ? If this is the case and you supply more info we may be of more help. – Cameron Verhelst Mar 4 '14 at 18:59

Not the answer you're looking for? Browse other questions tagged or ask your own question.