Grouping by a Metadata Column in a SharePoint Document Library

Hi All,
I have a document library with a managed metadata column. Now I need to create a view in which i need to group by the metadata column but I'm not able to see the managed metadata column in the Group By Columns list. Is it possible to accomplish this? Can
anyone pls help me out. Thank you.

It's kind of a lot of code... but here goes!
This all goes into a separate JS file:
(Tip, to copy this code chunk, it's easiest to start your selection outside the code block)
var js_MultiFilter = (function () {
function js_MultiFilter(listName, site) {
this.document = document; f (typeof listName == "undefined") { listName = 'Documents'; }if (typeof site == "undefined") { this.useCurrentSite = true; }else { this.useCurrentSite = false; }this.listName = listName;this.listRootfolder = "";this.site = site;this.notificationEnabled = true;this.filterFields = []; this.filterNames = []; this.selectModes = []; this.filterValueLists = []; this.displayFields = []; this.displayNames = []; this.displayModes = []; this.items = []; this.potentialFilters = []; this.queryFields = []; this.selectedFilters = []; this.sortField = "Title"; this.sortDesc = false; this.selectMode = "checkbox"; this.filterHeadingClass = "js_MFFilterHeading"; this.filterTableClass = "js_MFFilterTable"; this.filterColumnClass = "js_MFFilterColumn"; this.innerFilterColumnClass = "js_MFInnerFilterColumn"; this.filterCheckboxClass = "js_MFFilterCell"; this.displayOuterClass = "js_MFResultOuter"; this.displayTableClass = "js_MFResultTable"; this.displayRowClass = "js_MFResultRow";
this.displayHeaderClass = "js_MFResultHeader"; this.displayCellClass = "js_MFResultCell"; this.filterLabelClass = "js_MFFilterLabel"; this.filterLabelHoverClass = "js_MFFilterHoverLabel"; this.filterLabelSelectClass = "js_MFFilterSelectLabel"; this.filterLabelUnusedClass = "js_MFFilterUnusedLabel"; this.resultCountClass = "js_MFResultCount"; this.maxResultHeight = "270px"; this.rowLimit = 100; this.divId; this.evenColumnWidths = true; this.evenFilterColumnWidths = true; this.resultsId = "js_MultiFilterResults1"; this.showMetadataGuids = false; this.maxFilterHeight = 13;
/*Methods*/ this.containsString = containsString; this.getIndexOf = getIndexOf; this.addDisplayField = addDisplayField; this.addStaticDisplayField = addStaticDisplayField; this.addFilterField = addFilterField; this.bindToDiv = bindToDiv; this.onQuerySucceeded = onQuerySucceeded; this.onQueryFailed = onQueryFailed; this.getValueAsString = getValueAsString; this.showLoading = showLoading; this.removeLoading = removeLoading; this.toggleAndApplyFilter = toggleAndApplyFilter; this.applyFilter = applyFilter; this.insertDefaultCss = insertDefaultCss; this.get_defaultCss = get_defaultCss; this.isPageInEditMode = isPageInEditMode; this.HoverFilterLabel = HoverFilterLabel; this.DeHoverFilterLabel = DeHoverFilterLabel;
/*Interface Functions*/
function isPageInEditMode() { return (document.forms[0].elements["MSOLayout_InDesignMode"].value == "1") }
function addFilterField(fieldName, displayName, selectMode) { if (typeof (displayName) == "undefined") { displayName = fieldName; } if (typeof (selectMode) == "undefined") { selectMode = this.selectMode; } this.filterFields.push(fieldName); this.filterNames.push(displayName); this.selectModes.push(selectMode.toString().toLowerCase()); var filterValueList = []; this.filterValueLists.push(filterValueList); var potFilterValueList = []; this.potentialFilters.push(potFilterValueList); if (!this.containsString(this.queryFields, fieldName)) { this.queryFields.push(fieldName); } }
function addDisplayField(fieldName, displayName, displayMode) { if (typeof (displayName) == "undefined") { displayName = fieldName; } if (typeof (displayMode) == "undefined") { displayMode = "default"; } this.displayFields.push(fieldName); this.displayNames.push(displayName); this.displayModes.push(displayMode); if (!this.containsString(this.queryFields, fieldName)) { this.queryFields.push(fieldName); } }
function addStaticDisplayField(displayText, displayName, displayMode) { if (typeof (displayName) == "undefined") { displayName = displayText; } if (typeof (displayMode) == "undefined") { displayMode = "default"; } this.displayFields.push("@" + displayText); this.displayNames.push(displayName); this.displayModes.push(displayMode); }
function insertDefaultCss(RevertToDefaultStyles) { var js_style = this.document.createElement("style"); js_style.type = "text/css"; document.getElementsByTagName("head")[0].appendChild(js_style); var newCss = this.get_defaultCss(RevertToDefaultStyles); if (typeof js_style.styleSheet != "undefined") { js_style.styleSheet.cssText = newCss; } else { js_style.appendChild(this.document.createTextNode(newCss)); } }
function bindToDiv(divId) { /* Causes the control to appear in the specified div.*/ if (typeof (divId) != "undefined") { this.divId = divId; } if (this.notificationEnabled) { showLoading(this); } var clientContext; if (this.useCurrentSite) { clientContext = new SP.ClientContext.get_current(); } else { clientContext = new SP.ClientContext(this.site); } var web = clientContext.get_web(); var lists = web.get_lists(); var list = lists.getByTitle(this.listName); var camlQuery = new SP.CamlQuery(); var descending = ""; if (this.sortDesc) { descending = " Ascending='False'"; } var camlString = '<View><Query><OrderBy><FieldRef Name=\'' + this.sortField + '\'' + descending + '/></OrderBy></Query><RowLimit>' + this.rowLimit + '</RowLimit></View>'; camlQuery.set_viewXml(camlString); this.collListItem = list.getItems(camlQuery); var strFields = "ID,"; if (containsString(this.displayModes, "fileref", true)) { strFields += "FileRef," }
for (var i = 0; i < this.queryFields.length; i++) { strFields += this.queryFields[i] + ","; } strFields = strFields.substring(0, strFields.length - 1); this.listRootfolder = list.get_rootFolder(); clientContext.load(this.listRootfolder); clientContext.load(this.collListItem, "Include(" + strFields + ")"); clientContext.executeQueryAsync(Function.createDelegate(this, this.onQuerySucceeded), Function.createDelegate(this, this.onQueryFailed)); }
function showLoading(parent) { parent.notifyId = SP.UI.Notify.addNotification("Loading...", true); }
function removeLoading(parent) { SP.UI.Notify.removeNotification(parent.notifyId); }
function getValueAsString(fieldValue, activeHyperlinks, showLinkUrl, displayMode, additionalFieldValue) { var localNull = null; if (typeof (displayMode) == "undefined") { displayMode = "default"; } /*wraps hyperlink text in <a> tag*/ if (typeof (activeHyperlinks) == "undefined") { activeHyperlinks = false; } /*causes hyperlinks to display URL by default instead of description*/ if (typeof (showLinkUrl) == "undefined") { showLinkUrl = true; } var returnValue = []; var isArray = false if (typeof (fieldValue) == "object" && fieldValue != localNull) { if (fieldValue[0] != localNull) { if (fieldValue.length) { for (var i = 0; i < fieldValue.length; i++) { returnValue.push(this.getValueAsString(fieldValue[i])); isArray = true; } } } } if (!isArray) { if (fieldIsText(fieldValue)) { if (displayMode.toString().toLowerCase() == "link") { returnValue = '<a href="' + fieldValue + '">' + fieldValue + '</a>'; }
else if (displayMode.toString().toLowerCase() == "display") { returnValue = '<a href="' + this.listRootfolder.get_serverRelativeUrl() + '/Forms/DispForm.aspx?ID=' + additionalFieldValue + '">' + fieldValue + '</a>'; } else if (displayMode.toString().toLowerCase() == "edit") { returnValue = '<a href="' + this.listRootfolder.get_serverRelativeUrl() + '/Forms/EditForm.aspx?ID=' + additionalFieldValue + '">' + fieldValue + '</a>'; } else if (displayMode.toString().toLowerCase() == "fileref") { returnValue = '<a href="' + additionalFieldValue + '">' + fieldValue + '</a>'; } else { returnValue = fieldValue; } } else { if (fieldValue == localNull) { returnValue = ""; } else { if (fieldIsDate(fieldValue)) { returnValue = fieldValue._toFormattedString(); } else { if (fieldIsHyperlink(fieldValue)) { var desc = fieldValue.get_description(); var url = fieldValue.get_url(); if (showLinkUrl) { if (url != localNull) { returnValue = url; } else { if (desc != localNull) { returnValue = desc; } } }
else { if (desc != localNull) { returnValue = desc; } else { if (url != localNull) { returnValue = url; } } } if (activeHyperlinks && url != localNull) { returnValue = '<a href="' + url + '">' + returnValue + '</a>'; } } else { if (fieldIsLookup(fieldValue)) { if (displayMode.toString().toLowerCase() == "link") { returnValue = '<a href="' + fieldValue.get_lookupValue() + '">' + fieldValue.get_lookupValue() + '</a>'; } else { if(fieldValue.get_lookupValue() == ""){ /* When doing a lookup count, the lookup ID is used */ returnValue = fieldValue.get_lookupId(); }else{ returnValue = fieldValue.get_lookupValue(); } } } else { returnValue = ""; } } } } } } return returnValue; }
function onQuerySucceeded(sender, args) { var listItemEnumerator = this.collListItem.getEnumerator(); while (listItemEnumerator.moveNext()) { var oListItem = listItemEnumerator.get_current(); var localNull = null; var item = new Object(); item.filterValues = []; item.displayValues = []; for (var i = 0; i < this.filterFields.length; i++) { var filterValue = []; /*Collect all filter values*/ var rawValue = this.getValueAsString(oListItem.get_item(this.filterFields[i])); if (typeof (rawValue) == "string") { filterValue.push(rawValue); } else { filterValue = rawValue; } for (var k = 0; k < filterValue.length; k++) { /*if this value hasn't been encountered before, add it to our filter value list for this filter field*/ var thisvalue = filterValue[k]; if (this.showMetadataGuids == false) { if (thisvalue.indexOf('|') != -1) { thisvalue = thisvalue.split('|')[0]; } } if (!containsString(this.filterValueLists[i], thisvalue)) { this.filterValueLists[i].push(thisvalue); } } item.filterValues.push(filterValue); }
for (var j = 0; j < this.displayFields.length; j++) { var initialValue = this.displayFields[j]; if (initialValue.startsWith("@")) { initialValue = initialValue.substring(initialValue.indexOf("@") + 1); } else { initialValue = oListItem.get_item(this.displayFields[j]) } /*Collect all display values*/ if (this.displayModes[j] == "fileref") { var displayValue = this.getValueAsString(initialValue, true, false, this.displayModes[j], oListItem.get_item("FileRef")); } else { var displayValue = this.getValueAsString(initialValue, true, false, this.displayModes[j], oListItem.get_item("ID")); } item.displayValues.push(displayValue); } this.items.push(item); } var filterSelectBoxes = []; for (var i = 0; i < this.filterFields.length; i++) { var selectbox = this.document.createElement("div"); selectbox.className = this.filterColumnClass; selectbox.setAttribute("index", i); var heading = this.document.createElement("div"); heading.className = this.filterHeadingClass;
heading.innerHTML = this.filterNames[i]; selectbox.appendChild(heading); var columnContainer = document.createElement("div"); selectbox.appendChild(columnContainer); var innerColumns = []; for (var j = 0; j < this.filterValueLists[i].length; j += this.maxFilterHeight) { var innerColumn = document.createElement("div"); innerColumn.className = this.innerFilterColumnClass; innerColumns.push(innerColumn); columnContainer.appendChild(innerColumn); } this.filterValueLists[i].sort(); for (var j = 0; j < this.filterValueLists[i].length; j++) { var input = document.createElement("input"); input.type = this.selectModes[i]; input.className = this.filterCheckboxClass; var checkboxText = this.filterValueLists[i][j]; input.setAttribute("name", this.filterFields[i]); input.id = "js_mf_" + i + "_" + j; var labelid = "label_" + i + "_" + j; input.setAttribute("label", labelid); input.value = checkboxText; var checkboxlabel = document.createTextNode(checkboxText); var checkboxlabelspan = document.createElement("span");
checkboxlabelspan.className = this.filterLabelClass; checkboxlabelspan.id = labelid; checkboxlabelspan.setAttribute("checkbox", input.id); checkboxlabelspan.appendChild(checkboxlabel); var parent = this;
/*ADD EVENT HANDLER*/ if (input.addEventListener) { /*chrome, firefox, and new IE*/ input.addEventListener("change", function (element) { parent.applyFilter(element, parent) }); input.addEventListener("click", function (element) { parent.applyFilter(element, parent) }); checkboxlabelspan.addEventListener("click", function (element) { parent.toggleAndApplyFilter(element, parent) }); checkboxlabelspan.addEventListener("mouseenter", function (element) { parent.HoverFilterLabel(element, parent) }); checkboxlabelspan.addEventListener("mouseout", function (element) { parent.DeHoverFilterLabel(element, parent) }); } else { /*legacy internet explorer*/ input.attachEvent("onchange", function (element) { parent.applyFilter(element, parent) }); input.attachEvent("onclick", function (element) { parent.applyFilter(element, parent) }); checkboxlabelspan.attachEvent("onclick", function (element) { parent.toggleAndApplyFilter(element, parent) });
checkboxlabelspan.attachEvent("onmouseenter", function (element) { parent.HoverFilterLabel(element, parent) }); checkboxlabelspan.attachEvent("onmouseout", function (element) { parent.DeHoverFilterLabel(element, parent) }); } var currentColumnIndex = 0; for (var k = 0; k < innerColumns.length; k++) { if (j >= k * this.maxFilterHeight) currentColumnIndex = k; } var currentColumn = innerColumns[currentColumnIndex]; currentColumn.appendChild(input); currentColumn.appendChild(checkboxlabelspan); currentColumn.appendChild(document.createElement("br")); } filterSelectBoxes.push(selectbox); } var htmlToWrite = document.createElement("div"); htmlToWrite.className = this.filterTableClass; for (var i = 0; i < filterSelectBoxes.length; i++) { htmlToWrite.appendChild(filterSelectBoxes[i]); }
/*clear the loading image and add our filters*/ document.getElementById(this.divId).innerHTML = ""; document.getElementById(this.divId).appendChild(htmlToWrite);
/*Create the div to display the results*/ var detailsDiv = document.createElement("div"); detailsDiv.className = this.displayOuterClass; var detailIdstring = "Details"; iterator = 0; var detailsId = detailIdstring + iterator; while (this.document.getElementById(detailsId) != localNull) { iterator = iterator + 1; detailsId = detailIdstring + iterator; } detailsDiv.id = detailsId; this.resultsId = detailsId;
/*create a div for a row within the results table*/ var detailDiv = document.createElement("div"); detailDiv.className = this.displayRowClass; detailDiv.appendChild(document.createTextNode("<img src='/_layouts/images/loading.gif' />")); detailsDiv.appendChild(detailDiv);
/*Add the results below the filters*/ document.getElementById(this.divId).appendChild(detailsDiv); for (var i = 0; i < this.filterFields.length; i++) { var selectedFieldArray = []; this.selectedFilters.push(selectedFieldArray); } if (this.notificationEnabled) { this.removeLoading(this); } applyFilter(null, this); }
function DeHoverFilterLabel(labelel, parent) { var sourcelabel = labelel.srcElement; if (typeof (sourcelabel) == "undefined") { sourcelabel = labelel; } var checkboxid = sourcelabel.getAttribute("checkbox"); var el = document.getElementById(checkboxid); if (el.checked) { sourcelabel.className = parent.filterLabelSelectClass; } else if (sourcelabel.getAttribute("unused") == "unused") { sourcelabel.className = parent.filterLabelUnusedClass; } else { sourcelabel.className = parent.filterLabelClass; } }
function SelectFilterLabel(labelel, parent) { var sourcelabel = labelel.srcElement; if (typeof (sourcelabel) == "undefined") { sourcelabel = labelel; hover = false; } var checkboxid = sourcelabel.getAttribute("checkbox"); var el = document.getElementById(checkboxid); if (el.checked) { sourcelabel.className = parent.filterLabelSelectClass; } }
function HoverFilterLabel(labelel, parent) { var sourcelabel = labelel.srcElement; var hover = true; if (typeof (sourcelabel) == "undefined") { sourcelabel = labelel; } var checkboxid = sourcelabel.getAttribute("checkbox"); var el = document.getElementById(checkboxid); if (el.checked) { sourcelabel.className = parent.filterLabelSelectClass; } else if (sourcelabel.getAttribute("unused") == "unused") { sourcelabel.className = parent.filterLabelUnusedClass; } else if (hover) { sourcelabel.className = parent.filterLabelHoverClass; } else { sourcelabel.className = parent.filterLabelClass; } }
function toggleAndApplyFilter(labelel, parent) { var sourcelabel = labelel.srcElement; if (typeof (sourcelabel) == "undefined") { sourcelabel = labelel; } var checkboxid = sourcelabel.getAttribute("checkbox"); var el = document.getElementById(checkboxid); var select = false; if (el.checked) { el.checked = false; } else { el.checked = true; select = true; } parent.applyFilter(el, parent); if (select) { sourcelabel.className = parent.filterLabelSelectClass; } else { sourcelabel.className = parent.filterLabelHoverClass; } }
function applyFilter(el, parent) { var localNull = null; var resultcount = 0; if (el != localNull) { var element = el.srcElement; if (typeof (element) == "undefined") { element = el; } SelectFilterLabel(document.getElementById(element.getAttribute("label")), parent); var filter = element.value; var parentNode = element.parentNode; var tempElement = element.parentNode; while (tempElement.getAttribute("index") == localNull) { tempElement = tempElement.parentNode; } var fieldIndex = tempElement.getAttribute("index"); var elements = document.getElementsByName(element.getAttribute("name")); for (var inc = 0; inc < elements.length; inc++) { var thisel = elements[inc]; if (typeof (thisel.getAttribute("label")) != "undefined") { DeHoverFilterLabel(document.getElementById(thisel.getAttribute("label")), parent); } } if (element.checked) {
if (parent.selectModes[fieldIndex] == "radio") { /*remove all other filters in this field.*/ parent.selectedFilters[fieldIndex] = []; } if (!containsString(parent.selectedFilters[fieldIndex], filter)) { parent.selectedFilters[fieldIndex].push(filter); } } else { var index = getIndexOf(parent.selectedFilters[fieldIndex], filter); if (typeof (index) != "undefined") { parent.selectedFilters[fieldIndex].splice(index, 1); } } } var resultsOuterDiv = document.createElement("div"); resultsOuterDiv.className = parent.displayTableClass; document.getElementById(parent.resultsId).innerHTML = ""; document.getElementById(parent.resultsId).appendChild(resultsOuterDiv); var resultsHeaderDiv = document.createElement("div"); resultsHeaderDiv.className = parent.displayRowClass; for (var i = 0; i < parent.displayNames.length; i++) { var headerCell = document.createElement("div"); headerCell.className = parent.displayHeaderClass; headerCell.innerHTML = parent.displayNames[i]; resultsHeaderDiv.appendChild(headerCell); }
resultsOuterDiv.appendChild(resultsHeaderDiv); for (var i = 0; i < parent.potentialFilters.length; i++) { parent.potentialFilters[i] = []; /*initialize an array of empty arrays (one per filter)*/ } for (var i = 0; i < parent.items.length; i++) { /*for each item...*/ var itemfields = parent.items[i].filterValues var itemContainsAllSelectedValues = true; for (var j = 0; j < parent.selectedFilters.length; j++) { /*for each filter field*/ for (var k = 0; k < parent.selectedFilters[j].length; k++) { /*for each selected filter value*/ if (parent.selectedFilters[j].length == 0) continue; /*skip it if nothing is selected.*/ var thisvalue = parent.items[i].filterValues[j]; /*check if the item has that value within that field*/ if (!containsString(thisvalue, parent.selectedFilters[j][k], this.showMetadataGuids)) { itemContainsAllSelectedValues = false; break; } if (!itemContainsAllSelectedValues) break; } }
if (itemContainsAllSelectedValues) { resultcount++; var rowDiv = document.createElement("div"); rowDiv.className = parent.displayRowClass; for (var j = 0; j < parent.items[i].displayValues.length; j++) { var cellDiv = document.createElement("div"); cellDiv.className = parent.displayCellClass; cellDiv.innerHTML = parent.items[i].displayValues[j]; rowDiv.appendChild(cellDiv); } for (var j = 0; j < parent.items[i].filterValues.length; j++) { for (var k = 0; k < parent.items[i].filterValues[j].length; k++) { parent.potentialFilters[j].push(parent.items[i].filterValues[j][k]); } } resultsOuterDiv.appendChild(rowDiv); } } if (resultcount == 0) { var rowDiv = document.createElement("div"); rowDiv.className = parent.displayRowClass; var cellDiv = document.createElement("div"); cellDiv.className = parent.displayCellClass; cellDiv.innerHTML = "No results were found for the specified criteria."; rowDiv.appendChild(cellDiv); resultsOuterDiv.appendChild(rowDiv); }
/*Stylize dead-end filter options*/ for (var i = 0; i < parent.filterValueLists.length; i++) { for (var j = 0; j < parent.filterValueLists[i].length; j++) { var labelid = "label_" + i + "_" + j; var checkboxid = "js_mf_" + i + "_" + j; var filterCheck = document.getElementById(checkboxid); var fieldValue = parent.filterValueLists[i][j]; var tempElement = filterCheck.parentNode; while (tempElement.getAttribute("index") == localNull) { tempElement = tempElement.parentNode; } var fieldIndex = tempElement.getAttribute("index"); if (!containsString(parent.potentialFilters[fieldIndex], fieldValue, parent.showMetadataGuids)) { document.getElementById(labelid).className = parent.filterLabelUnusedClass; document.getElementById(labelid).setAttribute("unused", "unused"); } else { if (document.getElementById(checkboxid).checked) { document.getElementById(labelid).className = parent.filterLabelSelectClass; } else { document.getElementById(labelid).className = parent.filterLabelClass; }
document.getElementById(labelid).setAttribute("unused", "false"); } } } var resultCountId = "js_mf_resultcount"; var resultCountDiv; if (document.getElementById(resultCountId) == null) { resultCountDiv = document.createElement("div"); resultCountDiv.id = "js_mf_resultcount"; resultCountDiv.className = parent.resultCountClass; document.getElementById(parent.divId).appendChild(resultCountDiv) } else { resultCountDiv = document.getElementById(resultCountId); } if (resultcount == 1) { resultCountDiv.innerHTML = resultcount + " result"; } else { resultCountDiv.innerHTML = resultcount + " results"; } }
function onQueryFailed(sender, args) { this.removeLoading(this); this.document.getElementById(this.divId).innerHTML = 'The page was unable to populate the data this time.' + '<br/><span style="color:white">' + args.get_message() + '</span>\n'; }
function get_defaultCss(useTheseClasses, includeStyleTags) { if (typeof useTheseClasses != "boolean") useTheseClasses = true; if (useTheseClasses) { this.filterHeadingClass = "js_Heading"; this.filterTableClass = "js_MFFilterTable"; this.filterColumnClass = "js_MFFilterColumn"; this.filterCheckboxClass = "js_MFFilterCell"; this.displayOuterClass = "js_MFResultOuter"; this.displayTableClass = "js_MFResultTable"; this.displayRowClass = "js_MFResultRow"; this.displayHeaderClass = "js_MFResultHeader"; this.displayCellClass = "js_MFResultCell"; this.filterLabelClass = "js_MFFilterLabel"; } if (typeof includeStyleTags != "boolean") includeStyleTags = false; var openstyletag = ""; var closestyletag = ""; if (includeStyleTags) { openstyletag = "<style>"; closestyletag = "</style>"; } var leftright_padding = "padding-left:2px;padding-right:2px;"; var tableLayoutFixed = ""; var filterTableLayoutFixed = ""; if (this.evenColumnWidths || this.dockResultHeaders) { tableLayoutFixed = "table-layout:fixed; "; }
if (this.evenFilterColumnWidths) { filterTableLayoutFixed = "table-layout:fixed; "; } return openstyletag + "." + this.filterHeadingClass + "{font-weight:bold;background:#DDDDDD;text-align:center;}." + this.filterTableClass + "{background:#EEEEEE;display:table;width:100%;"+filterTableLayoutFixed+"}." + this.filterColumnClass + "{ display:table-cell;border-left:1px solid #CCC; border-right:1px solid #CCC;}." + this.filterCheckboxClass + "{padding-left: 5px;}." + this.displayOuterClass + "{height:" + this.maxResultHeight + "; overflow:auto; border:1px solid #CCC;}." + this.displayTableClass + "{display:table; " + tableLayoutFixed + "width:100%; text-align:left;}." + this.displayRowClass + "{width:100%;text-align:left;display:table-row;border-bottom:1px solid #EEEEEE;}." + this.displayHeaderClass + "{background:gray;color:white;display:table-cell; padding:5px; font-weight:bold;}." + this.displayCellClass + "{border-right:solid #CCC 1px; " + "border-left:0px;border-top:0px;border-bottom:1px solid #EEEEEE;"
+ "display:table-cell;padding:5px;}." + this.innerFilterColumnClass + "{float:left;}." + this.filterLabelClass + "{margin:1px; cursor:pointer;" + leftright_padding + "}." + this.filterLabelHoverClass + "{cursor:pointer; margin:1px;text-decoration:underline;" + leftright_padding + "}." + this.filterLabelSelectClass + "{background: #555; color:white; cursor:pointer; border:1px solid #555;" + leftright_padding + "}." + this.filterLabelUnusedClass + "{color:#bbb;margin:1px;cursor:default;" + leftright_padding + "}." + this.resultCountClass + "{text-align:right;font-weight:bold;}" + closestyletag; }
function fieldIsLookup(field) { return (typeof field.get_lookupValue == 'function'); }
function fieldIsDate(field) { return (typeof field._toFormattedString == 'function'); }
function fieldIsHyperlink(field) { return (typeof field.get_url == 'function'); }
function fieldIsText(field) { return (typeof field == 'string'); }
/* HELPER FUNCTIONS*/
/* Helper function to imitate Array.contains() method */ function containsString(strArray, text, showMetadataGuids) { if (typeof (showMetadataGuids) == "undefined") { showMetadataGuids = true; } var contains = false; for (i in strArray) { if (strArray[i] == text) { contains = true; break; } else if (showMetadataGuids == false) { if (strArray[i].indexOf('|') != -1) { if (strArray[i].split('|')[0] == text) { contains = true; break; } } } } return contains; }
/* Helper function to imitate Array.indexOf() method */ function getIndexOf(strArray, text) { for (i in strArray) { if (strArray[i] == text) return i; } }
return js_MultiFilter;})();
Then you can reference the JS file and put the filter control on your page like so:
<div id="js_MultiFilterExample"><img src="/_layouts/images/loading.gif"/></div>
<script src="/[wherever you saved your js file]/js_MultiFilter.js"></script>
<script>
ExecuteOrDelayUntilScriptLoaded(newInstance, "sp.js");
function newInstance(){
var mf = new js_MultiFilter("Library Name"); // pass the list display name
//// Optional Parameters
//mf.maxResultHeight = "100%"; // set the max height of the results (default: "270px")
mf.sortField = "FileLeafRef"; // specify internal name of field to sort results by (default: Title)
//mf.sortDesc = true; // sort descending (default: false)
//mf.evenColumnWidths = false; // equal result column widths (disable at own risk) (default: true)
mf.evenFilterColumnWidths = false; // equal filter column widths (default: true)
//mf.rowLimit = 500; // increase the result row limit imposed on the query (default: 100)
//mf.notificationEnabled = false; // show the fly-out Loading notification (default: true)
//mf.selectMode = "radio"; // Specify the default select mode i.e. checkbox or radio (default: checkbox)
//mf.showMetadataGuids = true; // Do not trim the GUID suffix from managed metadata filters (default: false)
//mf.maxFilterHeight = 20 ; // Specify the maximum number of options to display in a column before adding another column (default: 13)
//// Filter and Display Fields
mf.addFilterField("Category","Category","radio"); // (internal name, display name (optional), select mode (optional))
mf.addFilterField("Tags");
//// addDisplayField() displays an additional field from each list item
//// addStaticDisplayField() adds a column that displays the same text for every item
mf.addDisplayField("FileLeafRef","Link to Doc","fileref"); // (internal name, display name (optional), display mode (optional))
mf.addStaticDisplayField("View Properties","Display Form","display"); // (display text, display name (optional), display mode (optional))
mf.addDisplayField("Author","Created By");
mf.addDisplayField("Modified");
//// Valid display modes are: default (display value as text), link (treat the value as a hyperlink),
//// display (link to library display form), edit (link to library edit form), and fileref (link to document)
//// CSS classes used by the control
//mf.filterHeadingClass = "js_MFFilterHeading";
//mf.filterTableClass = "js_MFFilterTable";
//mf.filterColumnClass = "js_MFFilterColumn";
//mf.filterInnerColumnClass = "js_MFInnerFilterColumn";
//mf.filterCheckboxClass = "js_MFFilterCell";
//mf.displayOuterClass = "js_MFResultOuter";
//mf.displayTableClass = "js_MFResultTable";
//mf.displayRowClass = "js_MFResultRow";
//mf.displayHeaderClass = "js_MFResultHeader";
//mf.displayCellClass = "js_MFResultCell";
//mf.filterLabelHoverClass = "js_MFFilterHoverLabel";
//mf.filterLabelSelectClass = "js_MFFilterSelectLabel";
//mf.filterLabelUnusedClass = "js_MFFilterUnusedLabel";
//mf.resultCountClass = "js_MFResultCount";
mf.insertDefaultCss();
mf.bindToDiv("js_MultiFilterExample");
</script>
Uncomment anything you need to change!

Similar Messages

  • Issue when filtering with Managed Metadata Columns in Share Point Document Library

    Hi All
    I have a document library, and a four Metadata Columns in it, with each column having a number of term in it. I have no issues in adding a document or in term sets. We have set property of Managed Metadata Column as Allow Multiple Values. So some of the items
    in library contains values with only one term set. While other documents contains values with multiple values.
    We have a number of country sites having the document library  with same metadata columns. In document library default view i am showing Metadata column, User want to filter the documents (view) based on Metadata column selected.
    The filtering is giving inconsistent behavior. In production server it is giving in error with some correlation ID. On our development machine some times it is working fine and some other times it is given error of Validation of Viewstate MAC failed. i tried
    on different countries sites.
    I checked we have already kept the Metadata Navigation and Filtering under site action feature as activated. It was even more weird when i deactivated the feature on one country site and the filtering was working fine. And on other country site where i
    kept the feature as activated and the filtering was giving an error.
    Thanks & Regards
    Amit

    Hi Amit,
    Have you checked the ULS error message for more information with correlation ID?
    Please try using the library metadata navigation to filter these managed metadata columns value via configuring library "Metadata navigation settings" after you enabled the "Metadata Navigation and Filtering" feature,
    then check if the issue would still persist.
    Please see more information from below article with similar issue.
    http://blog.tippoint.net/filter-by-managed-metadata-field-in-asset-picker-dialog/
    Thanks,
    Daniel Yang
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you havefeedback for TechNet Subscriber Support, contact [email protected] 
    Daniel Yang
    TechNet Community Support

  • Sharepoint document library file name column in content database?

    Hi,
    How to get a sharepoint document library file name column in content database?
    Thanks
    Poomani Sankaran

    You're not supposed to develop any solutions accessing the content database directly. It's not supported. Document Library Filename is stored in LeafName column, table: AllDocs.
    2.2.6.1 AllDocs Table
    This post is my own opinion and does not necessarily reflect the opinion or view of Slalom.

  • Attaching Attributes to Image For Loading to SharePoint Document Library

    We currently have a need to create a searchable document library which will consist solely of images. The standard metadata for a file/image won't suffice in this case. We have some custom attributes that will need to be searchable.
    Essentially, we will have a library of receipt images for expense reporting purposes. We get these images from a third party who handles all of our expense reporting. There are two large zipped files we receive: one file contains all the actual expense report
    "data" that was processed that day(amount, date, client, job, etc.) and the second file contains all the receipt images for those expense report items. Each data file contains data for individual expense reports, and each expense report is assigned
    a unique ID. Each line item in an expense report is also assigned a unique ID. Lastly, each receipt image for a line item of a specific expense report is also assigned a unique ID.
    The zipped image file only contains images. There is a main image file - this contains several smaller zipped files. Each of the smaller zipped files contains all receipt images for a specific expense report. Each image file name is comprosed of three parts:
    The expense report identifier, the unique image identifier, and the expense report line item identifier.
    So, to put this all into perspective:
    On Thursday, we received an image file named extract_images_p006320452r3_20140904171423
    This file contained images for the following unique expense reports:
    The compressed file 95FB8C488519427793FC contains the following receipt images:
    The "data" file - as mentioned before - contains the actual info about the expense and image. These include: date of transaction, date approved, vendor, amount. GL code, type, function, client, project, billable or not, and several other attributes.
    All of this information - including the location of the images - is stored in a SQL Server database and then placed in an SSAS cube.
    The images are related back to the underlying data via the expense report id, and line item id.
    What I need to be able to do is to somehow "tag" these images with all their underlying attributes, load then into a SharePoint document library, and make them searchable.
    I have already figured out that I would need to create several SharePoint lists based on the available values in my OLAP cube (essentially a dataset each for clients, vendors, etc.). The part I have no idea how to accomplish is how to tag each image with
    its respective information.
    All the pertinent info is stored in the database tables, just don't know how to attach it to each image.
    Hopefully, this made some kind of sense. If anyone has any idea on how to even remotely accomplish such a thing, your input would be greatly appreciated!
    Thanks in advance!
    A. M. Robinson

    You will have to develop a custom solution to do this. I am assuming you have taken the first steps to define separate document libraries for the expense reports and images along with site columns and contenttypes. You would define the site columns based
    on the data you want to search on and assign these to corresponding contenttypes. So basically a contenttype for expense reports and receipts possibly. You would link the two contenttypes using the expense report id.
    Your custom solution would have to break apart the zip files and upload and index (set site column data) for each file. Then the user could search on the expense report id and get all the files associated with the expense report.
    An alternative could be to use one document library and have all the files uploaded into their own document set (folder).
    Blog | SharePoint Field Notes Dev Tools |
    SPFastDeploy | SPRemoteAPIExplorer

  • Linking a programmatically created folder in SharePoint Document Library.

    I have created folders within a document library using InfoPath & C#. To that folder I uploaded several documents using several file attachment controls within the same InfoPath Form using the code behind the form.  Now I want to create an Hyperlink
    to each folder in another document folder's column that has the relationship with the previously created folder.
    When I googled I saw there are lot of articles to create Folders ,uploading documents to folders in a SharePoint Library but I cannot understand how to create a hyperlink in a SharePoint Document Library field column.
    Could someone help me to solve this matter?
    Thanks,
    Regards,
    Chiranthaka

    Why don’t you create a hyperlink column to store the hyperlink value, or you can use a lookup column to lookup the related folder item?
    Qiao Wei
    TechNet Community Support

  • How to connect SharePoint Document Library with Local file system?

    Hi
    I have a SharePoint Document library and in my local system i have 3TB files. It is very difficult to upload 3TB files in SharePoint.
    I want a file details in SharePoint Document Library but physical file would be in local.
    While click the file in Document library. The document should open from local.
    Anyone help me on it.
    Thanks & Regards
    Poomani Sankaran

    Hi,
    your requirement doesn't work out-of-the-box as all data uploaded to SharePoint needs to be stored in SQL database. Thus in your case 3 TB of fileshare would need to move to SQL.
    In case you don't want to go this way, there are 3rd party vendors who offer Software like AvePoint Connector. Products like these use SQL RBS (Storage Externalization API) so that files remain in your file system but metadata is kept in SharePoint. If you
    need more information on that, please let me know.
    Regards,
    Dennis

  • SPMenu Field for sharepoint document library

    I have written code where it will show the Sharepoint document library in sp grid view.It
    is showing the grid but i want the default spmenu field for the type icon. please see the attached image. Below is the code of mine
    private void CreateBoundField(string sDataField, string sHeaderText, bool bReadOnly, SPGridView theGridView)
    BoundField field = new BoundField();
    field.DataField = sDataField;
    field.HeaderText = sHeaderText;
    field.HtmlEncode = false;
    field.HeaderStyle.ForeColor = ColorTranslator.FromHtml("#808080");
    field.HeaderStyle.Font.Names = new string[] { "verdana", "arial", "helvetica", "sans-serif" };
    field.ItemStyle.HorizontalAlign = System.Web.UI.WebControls.HorizontalAlign.Center;
    if (sHeaderText.ToLower().Equals("type"))
    field.ItemStyle.HorizontalAlign = System.Web.UI.WebControls.HorizontalAlign.Center;
    field.ItemStyle.Width = Unit.Pixel(35);
    field.HeaderStyle.Width = Unit.Pixel(35);
    field.ReadOnly = bReadOnly;
    if (!bReadOnly)
    field.SortExpression = sDataField;
    field.Visible = true;
    theGridView.Columns.Add(field);
    SPGridView gv = new SPGridView();
    gv.ID = "gv";
    gv.EmptyDataText = "No items found!";
    gv.AllowSorting = true;
    gv.AllowFiltering = true;
    gv.AutoGenerateColumns = false;
    gv.EnableSortingAndPagingCallbacks = true;
    CreateBoundField("Type", "Type", false, gv);
    CreateBoundField("Title", "Title", false, gv);
    CreateBoundField("Date", "Date", false, gv);
    CreateBoundField("ProcessTask", "ProcessTask", false, gv);
    DataTable dt = new DataTable();
    SPWeb web = SPContext.Current.Web;
    SPListItemCollection items = web.Lists["Shared Documents"].Items;
    dt.Columns.Add("Type");
    dt.Columns.Add("Title");
    dt.Columns.Add("Date");
    dt.Columns.Add("ProcessTask");
    foreach (SPListItem item in items)
    DataRow dr = dt.NewRow();
    string value = item["ProcessTask"].ToString();
    value = value.Substring(value.LastIndexOf(";#") + 2);
    string docicon = SPUtility.ConcatUrls("/_layouts/images",
    SPUtility.MapToIcon(item.Web, SPUtility.ConcatUrls(item.Web.Url, item.Url), "", IconSize.Size16));
    dr["Type"] = string.Format("<img src='{0}' />", docicon);
    dr["Title"] = item.Title;
    dr["Date"] = item["Created"].ToString().Split(' ')[0];
    dr["ProcessTask"] = value;
    dt.Rows.Add(dr);
    gv.DataSource = dt;
    gv.DataBind();
    this.Controls.Add(gv);
    SPListItemCollection _GridCollection = SPContext.Current.Web.Lists["Shared Documents"].Items;
    DataTable _MyDatabale = _GridCollection.GetDataTable();
    gvdetails.DataSource = _MyDatabale;
    gvdetails.DataBind();
    I want the default menu pop up like the below attached image. Can any one help me to
    modify the above code and get me the attached out put.
    Thanks,
    Sandy.

    Hi,
    According to your post, my understanding is that you wanted to show the SharePoint document library in GridView.
    You need to get hold of the SPFile object, which is a property of a ListItem item, and get the ServerRelativeUrl property. Then you need to add code to an <a> tag .
    Here is a similar thread for your reference:
    http://sharepoint.stackexchange.com/questions/88139/code-download-file-from-doc-icon-image-in-sharepoint-2010
    More information:
    Bind SharePoint 2010 Document Library to GridView:
    http://sppractices.blogspot.com/2013/03/bind-sharepoint-2010-document-library.html
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

  • Create a new document in Sharepoint Document Library/OneDrive on iPad/Safari

    Hi,
    My users are having trouble creating a new document from OneDrive in Safari on their iPads. The screen goes grey like its going to show the popup to select the new file type, but the popup never comes up. If they clear their cache, it works for exactly 1
    time and then goes back to this behavior. I'm not exactly sure if it worked before and/or when it stopped working. The iPad I have tested was at the latest 8.2 version of IOS and my Sharepoint farm is an On-Prem install of 2013 with SP1 mark2. My WAC farm
    is also 2013 SP1.
    Any suggestions?
    Thanks,
    Matt

    Hi,
    I understand you are suffering the issue when create a document in Sharepoint Document Library/OneDrive on  iPad.
    According to the official article
    https://technet.microsoft.com/en-us/library/fp161353.aspx?f=255&MSPPError=-2147217396, the version of your iOS should be in the supported list. I guess the issue may start after you installed an update, and if there is any other version (low versions)
    of iPads in your company, please use a different version device to test the issue.
    Meanwhile, to determine whether the issue is related to your SharePoint environment, I suggest you just to register an Office 365 trail account, and test the issue with SharePoint Online. In case the same issue happens with SharePoint Online, the issue should
    be related to your client device, and my next suggestion is to contact support of your device manufacture.
    Once you need any help from SharePoint end, please don’t hesitate to come back, and we are always happy to support you.
    Best Regards,
    Lisa Chen
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • Not able to create sub folder using SharePoint web service in large SharePoint document library (Item count view threshold limit)

    We are trying to create folder & subfolder in a SharePoint document library using SharePoint default(dws) web service. Document library has unique permission as well as item level permission. It was working as expected. Once item count crosses
    view threshold limit ( 5000) , create folder web method completes with an error and it creates a folder in SharePoint.
    Request:
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:dws="http://schemas.microsoft.com/sharepoint/soap/dws/">
       <soapenv:Header/>
       <soapenv:Body>
          <dws:CreateFolder>
             <!--Optional:-->
             <dws:url>Shared Documents/VenTest02092015v1</dws:url>
          </dws:CreateFolder>
       </soapenv:Body>
    </soapenv:Envelope>
     Response:
    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
       <soap:Body>
          <CreateFolderResponse xmlns="http://schemas.microsoft.com/sharepoint/soap/dws/">
             <CreateFolderResult>&lt;Error ID="2">Failed&lt;/Error></CreateFolderResult>
          </CreateFolderResponse>
       </soap:Body>
    </soap:Envelope>
     While trying to create subfolder under the above created folder service throws an exception saying
    FolderNotFound.
    Though we are able to create subfolder from SharePoint UI successfully. 
    Request
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:dws="http://schemas.microsoft.com/sharepoint/soap/dws/">
       <soapenv:Header/>
       <soapenv:Body>
          <dws:CreateFolder>
             <!--Optional:-->
             <dws:url>Shared Documents/VenTest02092015v1/REQ-1</dws:url>
          </dws:CreateFolder>
       </soapenv:Body>
    </soapenv:Envelope>
    Response:
    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
       <soap:Body>
          <CreateFolderResponse xmlns="http://schemas.microsoft.com/sharepoint/soap/dws/">
             <CreateFolderResult>&lt;Error ID="10">FolderNotFound&lt;/Error></CreateFolderResult>
          </CreateFolderResponse>
       </soap:Body>
    </soap:Envelope>

    Yes, you're probably hitting the 5000 list item threshold (
    http://sharepoint.stackexchange.com/questions/105937/overcoming-5000-file-document-library-limits ). I assume you can do it via the UI because you're probably logged in as an admin in which case, out of memory, the threshold is 20.000 items. You can extend
    this limit, but you probably shouldn't.
    Kind regards,
    Margriet Bruggeman
    Lois & Clark IT Services
    web site: http://www.loisandclark.eu
    blog: http://www.sharepointdragons.com

  • Ssrs sharepoint 2013 error: "A delivery error has occurred ...not a sharepoint document library..."

    Greetings SSRS/SharePoint experts,
    SharePoint 2013 with SSRS - Creating a subscription to a report that is in SharePoint
    I'm trying to create a subscription to publish a report to a sharepoint document library.
    I've configured all the settings and on clicking OK get the following error:
    "A delivery error has occurred. ---> Microsoft.ReportingSerives.Diagnostics.Utilities.DeliveryErrorException: A delivery error has occurred. ---> Microsoft.ReportingServices.Diagnostics.Utilities.InvalidExtensionParameter: One of the extension
    parameters is not valid for the following reason: The delivery path is either not a SharePoint Document Library Folder or does not exist in the Share Point farm."
    SQL Server Developer Edition 2012 SP1
    SharePoint 2013 Standard
    Just wondering if anyone has a solution.
    I've tried changing the proxy settings as per this post
    http://social.technet.microsoft.com/Forums/en-US/19817dc7-6725-40d8-befa-1b94099a71bd/sql-server-2012-reporting-services-in-sharepoint-2013-integrated-mode-dilivery-extension
    Workaround is to not use a sharepoint document library but write the report to a windows file share (this works but is not optimal).
    Hoping someone at Microsoft or an expert will come back with something.
    Kind regards
    Gio

    Hi,
    Can you check the SharePoint ULS log located at : C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\LOGS, and look at the log there when the error occurs?
    You can also check the Application Event Log on the SQL Server to see if there are any additional errors.
    Tracy Cai
    TechNet Community Support

  • Download older version of a file from SharePoint Document Library using CSOM and 404 error

    Hi,
    I am trying to download previous versions including Major and Minor versions of documents from SharePoint Online using CSOM. I get 404 error when I try to download the file. I found several posts on various discussion forums where people are getting same
    error but none of those have any solution/answer. Below is one of the threads and sample code I have tried that results in 404 error. If I use the link in browser directly, I am able to download the file. Also I am able to download the current version of file
    using CSOM without any problem, it is only the older versions that give me 404 in CSOM.
    http://qandasys.info/how-to-download-the-historical-file-version-content-using-csom/
    public int GetStreamFromFile(string docid, string lib, string fileurl, ClientContext clientContext, int iuserid, string Version, bool isCurrrent)
    if(!isCurrent)
    List LibraryName = clientContext.Web.Lists.GetByTitle(lib);
    clientContext.Load(LibraryName);
    clientContext.ExecuteQuery();
    CamlQuery camlQuery = new CamlQuery();
    camlQuery.ViewXml = "" + fileurl +
    Microsoft.SharePoint.Client.ListItemCollection collListItem = LibraryName.GetItems(camlQuery);
    clientContext.Load(collListItem, items => items.Include(item => item.Id, item => item["FileLeafRef"], item => item["LinkFilename"],
    item => item["FileRef"], item => item["File_x0020_Size"], item => item["DocIcon"], item => item.File.Versions));
    //clientContext.Load(collListItem);
    clientContext.ExecuteQuery();
    foreach (Microsoft.SharePoint.Client.ListItem oListItem in collListItem)
    //string fileurl1 = (string)oListItem["FileRef"];
    //string filename = (string)oListItem["LinkFilename"];
    foreach (FileVersion version in oListItem.File.Versions)
    if (Version == version.VersionLabel)
    //Added excutequery to get object one more time as per blog
    //http://social.technet.microsoft.com/Forums/de-DE/sharepointdevelopmentprevious/thread/88a05256-8694-4e40-863d-6c77512e079b
    clientContext.ExecuteQuery();
    FileInformation fileInformation = ClientOM.File.OpenBinaryDirect(clientContext,version.Url);
    bytesarr = ReadFully(fileInformation.Stream);
    Darwaish

    Hi,
    According to your description,
    I know you want to get older version of a file from SharePoint Document Library using Client Object Model.
    The following code snippet for your reference:
    public void GetVersions()
    ClientContext clientContext = new ClientContext(“http://SPSite”);
    Web site = clientContext.Web;
    clientContext.Load(site);
    clientContext.ExecuteQuery();
    File file = site.GetFileByServerRelativeUrl(“/Shared Documents/mydocument.doc”);
    clientContext.Load(file);
    clientContext.ExecuteQuery();
    ListItem currentItem = file.ListItemAllFields;
    clientContext.Load(currentItem);
    clientContext.ExecuteQuery();
    FileVersionCollection versions = file.Versions;
    clientContext.Load(versions);
    clientContext.ExecuteQuery();
    if (versions != null)
    foreach(FileVersion _version in versions)
    Console.WriteLine(“Version : {0}”,_version.VersionLabel);
    More information:
    http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.client.file.versions.aspx
    Best Regards,
    Dennis Guo

  • Advice needed for provider hosted web application - authentication and access to SharePoint document library

    I haven't done SharePoint 2013 development with claims so I apologize in advance if my assumptions and questions are way out in left field.
    I'm trying to understand SharePoint 2013 claims authentication for a scenario that involves:
    A SharePoint provided hosted (web forms) app that will pull information and assets (e.g. PDFs) from SharePoint into the web page.
    It will be a VS 2012 solution with asp.net.identity feature.
    Security will be set for internal users, federated external users and forms-based external users.  Based on their security and (claim type) role it will define what information and assets that can be retrieved from SharePoint
    I have looked through MSDN and other sources to understand.
    This one helped with my understanding 
    Federated Identity for Web Applications and assumed that the general concept could be applied to forms-based identity for non-Federated external users .
    What I have now:
    VS 2012 solution web forms application set to Provider Host with asp.net.identity feature and its required membership tables.
    I can create new users and associate claims to the new user.
    I can log in with a user from the membership tables and it will take me to a default.aspx page.  I have added code to it that displays the claims associated to a user.
    For POC purposes I'd like to retrieve documents that are associated to this user from the default.aspx page.
    This is where I am having trouble understanding:  Is my understand correct?
    Internal users
    since they are internal on the network i am assuming that they would already have access to SharePoint and they would already be configured to what documents that they have available to them.
    Federated external users & Forms authentication external users
    it seems to me that the authentication for external users are separate from SharePoint authentication process.
    changes to the configuration settings are necessary in SharePoint, IIS, web application.
    I believe this is what i read.
    claims processes (e.g. mappings) need to be set up in SharePoint
    as long as external users are authenticated then things are ok b/c they would have claims associated to the user and the configuration in SharePoint takes are of the rest.
    This statement bothers me because I think it's wrong.
    So basically i'm stuck with if my understanding is correct: once a user is authenticated either by federated identity or asp.net.identity authentication that it should go to the provider hosted default.aspx page because the claim is authenticated and means
    that it should have access to it and the SharePoint document library based on some claim property.  I could then write the calls to retrieve from a document library and SharePoint will know based on some claim property that the logged in user can only
    access certain documents.
    It just sounds too good to be true and that i'm missing something in the thought process.
    Thanks in advance for taking the time to read.
    greenwasabi

    Hi GreenWasabi,
    i agree this is an interesting topic to discuss,
    as you can check from the article, you may check this example from the codeplex:http://claimsid.codeplex.com/
    when i thinking regarding this topic, its looks like an environment with multiple of realms,
    from what you understand, its correct that all the authentication is based from the provider, so for example i have a windows live ID and internal ID, then when i login windows live ID, it will be authenticated using windows live ID server.
    here is the example for the webservice:
    http://claimsid.codeplex.com/wikipage?title=Federated%20Identity%20for%20Web%20Services&referringTitle=Home
    as i know, if you using this federated, i am not quite sure that you will need to go to the provider page literally, perhaps you can check this example if we are using azure:
    http://social.technet.microsoft.com/wiki/contents/articles/22309.integrating-windows-live-id-google-and-facebook-accounts-with-sharepoint-2013-white-paper.aspx
    Regards,
    Aries
    Microsoft Online Community Support
    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

  • Save output of powershell script to a SharePoint document library?

    Hi
    I've got the PS script below which scripts out our SQL replication so disaster recovery.  Is there a way to output this to a SharePoint document library so that way we can version control the file to keep multiple copies and it also avoids outputting
    this to a file share.  We would still need to have the files with the .sql extension format which is an allowed file type in our farm.
    Thanks
    #Load command-line parameters - if they exist
    param ([string]$sqlserver, [string]$filename)
    #Reference RMO Assembly
    [reflection.assembly]::LoadWithPartialName("Microsoft.SqlServer.Replication") | out-null
    [reflection.assembly]::LoadWithPartialName("Microsoft.SqlServer.Rmo") | out-null
    function errorhandler([string]$errormsg)
        writetofile ("-- Replication Script Generator run at: " + (date)) $filename 1
        writetofile ("-- [Replication Script ERROR] " + $errormsg) $filename 0
    function writetofile([string]$text, [string]$myfilename, [int]$cr_prefix)
        if ($cr_prefix -eq 1) { "" >> $myfilename }
        $text >> $myfilename
    function initializefile([string]$myfilename)
        "" > $myfilename
    trap {errorhandler($_); Break}
    #Deal with absent parameters
    [string] $hostname=hostname
    if ($sqlserver -eq "") {$sqlserver = read-host -prompt "Please enter the server name or leave blank for Hostname"}
    #if ($filename -eq "")  {$filename = read-host -prompt "Please enter the file name (eg 'c:\ReplicationBackupScript.sql')..."}
    if ($sqlserver -eq "")   {$sqlserver = $hostname}
    if ($filename -eq "")   {$filename = "d:\Rep\CreateReplication-$(get-date -format ddMMyyyy).sql"}
    # Clear file contents
    if (Test-Path  ($filename)) {Clear-Content $filename}
    $repsvr=New-Object "Microsoft.SqlServer.Replication.ReplicationServer" $sqlserver
    initializefile $filename
    # if we don't have any replicated databases then there's no point in carrying on
    if ($repsvr.ReplicationDatabases.Count -eq 0)
        writetofile ("-- Replication Script Generator run at: " + (date)) $filename 0
        writetofile "-- ZERO replicated databases on $sqlserver!!!" $filename 1
        EXIT
    # similarly, if we don't have any publications then there's no point in carrying on
    [int] $Count_Tran_Pub = 0
    [int] $Count_Merge_Pub = 0
    foreach($replicateddatabase in $repsvr.ReplicationDatabases)
            $Count_Tran_Pub = $Count_Tran_Pub + $replicateddatabase.TransPublications.Count
            $Count_Merge_Pub = $Count_Merge_Pub + $replicateddatabase.MergePublications.Count
    if (($Count_Tran_Pub + $Count_Merge_Pub) -eq 0)
        writetofile ("-- Replication Script Generator run at: " + (date)) $filename 0
        writetofile "-- ZERO Publications on $sqlserver!!!" $filename 1
        EXIT
    # if we got this far we know that there are some publications so we'll script them out
    # the $scriptargs controls exactly what the script contains
    # for a full list of the $scriptargs see the end of this script
    $scriptargs = [Microsoft.SqlServer.Replication.scriptoptions]::Creation `
    -bor  [Microsoft.SqlServer.Replication.scriptoptions]::IncludeEnableReplicationDB `
    -bor  [Microsoft.SqlServer.Replication.scriptoptions]::IncludeCreateLogreaderAgent `
    -bor  [Microsoft.SqlServer.Replication.scriptoptions]::IncludePublicationAccesses `
    -bor  [Microsoft.SqlServer.Replication.scriptoptions]::IncludeArticles `
    -bor  [Microsoft.SqlServer.Replication.scriptoptions]::IncludePublisherSideSubscriptions `
    -bor  [Microsoft.SqlServer.Replication.scriptoptions]::IncludeSubscriberSideSubscriptions
    writetofile ("-- Replication Script Generator run at: " + (date)) $filename 0
    writetofile "-- PUBLICATIONS ON $sqlserver" $filename 1
    writetofile "-- TRANSACTIONAL PUBLICATIONS ($Count_Tran_Pub)" $filename 1
    foreach($replicateddatabase in $repsvr.ReplicationDatabases)
        if ($replicateddatabase.TransPublications.Count -gt 0)
            foreach($tranpub in $replicateddatabase.TransPublications)
                writetofile "/********************************************************************************" $filename 0
                writetofile ("***** Writing to file script for publication: " + $tranpub.Name) $filename 0
                writetofile "********************************************************************************/" $filename 0
                [string] $myscript=$tranpub.script($scriptargs) 
                writetofile $myscript $filename 0
    writetofile "-- MERGE PUBLICATIONS ($Count_Merge_Pub)" $filename 1
    foreach($replicateddatabase in $repsvr.ReplicationDatabases)
        if ($replicateddatabase.MergePublications.Count -gt 0)
            foreach($mergepub in $replicateddatabase.MergePublications)
                writetofile "/********************************************************************************" $filename 0
                writetofile ("***** Writing to file script for publication: " + $mergepub.Name) $filename 0
                writetofile "********************************************************************************/" $filename 0
                [string] $myscript=$mergepub.script($scriptargs) 
                writetofile $myscript $filename 0

    Check out Using PowerShell to upload a scripts output to SharePoint
    Jason Warren
    @jaspnwarren
    jasonwarren.ca
    habaneroconsulting.com/Insights

  • Word opening in Client Application in SharePoint document library when feature is not activated in manage features in site collection

    Hello, I wish for all Word documents to open in the browser for my SharePoint document library on my team site.
    The feature 'open in client application' is not activated in Features for the site collection and the setting in the document library is set on 'Use the server default (open in the browser)
    When I select File > new> from the ribbon in the document library - it still opens Word in the client application?
    Any ideas on this?
    Is there a general Office 365 setting over riding SharePoint somewhere?
    Regards
    kegan1

    Okie don't open up a ticket. Can you please open internet explorer...See if its the latest version. Once you have done that can you login to the SharePoint site. Then go to the internet wheel option  in top right corner > select manage add on >
    Click on toolbars and extensions on left > then click on SharePoint open documents in client and disable it. Close the browser completely now for the changes to take effect. Open internet explorer once again and then try to go to site collection click on
    file and create new. The word will open up in browser now. This has to be done on each and every machine in your firm so that users will be able to open up only in browser. Out of the box there is only one way is to customize the ribbon and remove the new
    option from there or creating an all together new ribbon for your SharePoint from visual studio.

  • Upload a document from a form into a SharePoint document library

    The idea is that I have a form which I want to allow users to upload files into my SharePoint document library. I am just not just what to do after the 'HasFile' Statement. Some small snippets of my code below. I am just not sure how from the fileupload ID
    to get it into my document library. Please provide code.
    <asp:FileUpload ID="FileUpload1" runat="server" />
    <asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click" />
    Server side code
    protected void Button1_Click(object sender, EventArgs e)
    if (FileUpload1.HasFile)

    protected
    void
    Button1_Click(object
    sender,
    EventArgs
    e)
       if
    (FileUpload1.HasFile)
            // Assuming you have list current context. Or else get reference to the list instance from the parent SPWeb     var list
    = SPContext.Current.List;
         list.RootFolder.Files.Add(FileUpload1.FileName,
    FileUpload1.FileBytes).Update();

Maybe you are looking for

  • Oracle Client 10g Express Edition (ADO, C++, Visual Studio 2008)

    OS: Windows XP SP2 I made a test programm allowing to work with Oracle 10g Express Edition. Connection with server works, commands are followed, but at the exit from function wmain Visual Studio it buzzez (слышал такое, если нет, то посмотри по друго

  • Data warehouse, time dimension

    Dear folks, My boss asked me an interesting question, but I couldn't answer, because I'm not an Oracle expert, I'd rather describe myself as Cognos developoer. We have a ROLAP data warehouse, and there is a time dimension table, the primary key colum

  • Terrible update

    so i downloaded the new update and my phone is going crazy! none of my themes are there...even one i got after the lousy update! this is the worst "service" ive ever received from this company! they added apps i dont need or care about to use up load

  • Machine Access Restriction Timeout

    Hi Community, we use  Anyconnect Client for Machine Authentication. Authentication is for  WLAN done by WLC that asks ACS5.3 that uses Active Directory as the identity store. You have enabled Machine Authentication and Machine  Access Restrictions (M

  • Can't do anything with AV Scripts or Multicolumn Scripts

    Have a script for an animation, written in AV format, so that specific shots and dialog can be sync'd.  However, I can't generate any lists or reports anything from this AV script.  Want to make a breakdown of all locations, all characters, and all o