Thursday, September 13, 2012

Query Strings Found on SharePoint's List Forms

I love looking for an easier way and this time I've found one that previously worked just a bit weird before...

The issue I've had is when creating items in a particular folder within a list, you have to be very conscious of the BaseName. It MUST be unique within your whole list structure or else the save fails. Look at the comments in the documentation for more details.

I've been building a tree navigation and I've been developing a way to insert folders/items dynamically.  I just found an easier way to create folders wherever I need them to appear in the list. I no longer have to worry about the BaseName as SharePoint takes care of that for me. As I learn of more query strings, I'll append them to this post

Query Strings 

RootFolder=%2FSPDev%2FLists%2FLinkNav%2FmahFolder - Used to control the destination of where your new item will be saved.

Type=0 - Used to tell SharePoint whether you want a folder or an item. 0 = folder; 1 = item.

ContentTypeId=0x01040004B13BF0D61E0D44A7D0327C51C01D8A - Create the content type of your choice.

IsDlg=1 - This query string can be set to anything and will behave as if the form is in a modal. Sometimes this can cause issues because saves/cancels rely on window.frameElement and if the <iframe> isn't present, the form will not work properly.

That's all for now but I'm sure I'll find some more...

Tuesday, August 28, 2012

From the depths of SharePoint's sp.js Pt. 2

So I lied... :)  The function found below is a part of core.js.

A good ol' fashioned
console.dir( GetCurrentCtx().clvp );
generates this bit of awesome:

{

 ctx : [object Object],

 tab : [object],

 pagingTab : null,

 tBody : null,

 wpq : "WebPartWPQ4",

 inplUrl : "http://portal/SPDev/_layouts/inplview.aspx?List={49AFC299-FC30-4EE9-9571-50B3B366969E}&View={876230CC-BE1A-4845-8998-652BB77C891C}&ViewCount=7&ListViewPageUrl=http://portal/SPDev/pages/spUtils.aspx&IsXslView=TRUE",

 trEmpty : null,

 rootFolder : null,

 rootFolderGuid : null,

 rgpag : null,

 wpid : null,

 isEditing : false,

 dsrc : null,

 isInserting : false,

 strGroupName : null,

 strGroupCache : null,

 bRequestOutstanding : false,

 isEcbInfo : false,

 queueEcbInfo : ,

 fnEcbCallback : null,

 rgpaging : ,

 focusInfo : null,

 CUIItemInfo : [object Object],

 Init : function CLVPInit(){ULSiIp:;var f=this.ctx.listBaseType==1,d;if(this.ctx.listTemplate=="109"){this.ctx.clvp=null;return}d=this.ctx.listName+"-"+this.ctx.view;var b=GetElementsByName(d);if(b.length==0&&f){d="onetidDoclibViewTbl0";b=GetElementsByName(d)}va,

 RestoreNavigation : function CLVPRestoreNavigation(){ULSiIp:;var a=window.location.hash,c=this.InplViewUrl(),b=this.RefreshCurrent(true);b=b.substr(c.length+1);if(a.indexOf("InplviewHash=")==1){a=DecodeHashAsQueryString(a);var d=a.substr(14,38);if(d!=this.ctx.view)return;a=,

 FindWebPartDiv : function CLVPFindWebPartDiv(b){ULSiIp:;var a=b;while(a!=null&&a.tagName!="DIV")a=a.parentNode;return a},

 SyncPagingTables : function CLVPSyncPagingTables(){ULSiIp:;var b=this.pagingTab,a=document.getElementById("topPagingCell"+this.wpq.substr(7));if(b==null){if(a!=null)a.style.display="none";return}if(a!=null){a.style.display="";if(GetInnerText(a)!=GetInnerText(b))a.innerHTML,

 RehookPaging : function CLVPRehookPaging(){ULSiIp:;if(typeof this.ctx.noAJAX!="undefined"&&this.ctx.noAJAX)return;var tab=this.pagingTab;if(tab==null){this.SyncPagingTables();return}for(var lnks=tab.getElementsByTagName("A"),i=0;i<lnks.length;i++){var lnk=lnks[i],str=",

 FilterString : function CLVPFilterString(){ULSiIp:;if(this.rgpaging==null)return null;var a,d,b=[],c=true;for(a in this.rgpaging)if(a.indexOf("Filter")==0||a.indexOf("Sort")==0){if(c)c=false;else b.push("&");b.push(a);b.push("=");b.push(this.rgpaging[a])}return b.join(,

 RefreshPaging : function CLVPRefreshPaging(c,a,b){ULSiIp:;if(a!=null)this.tBody=document.getElementById(a);var d=this.isEditing?"JsGrid":null;return this.RefreshPagingEx(c,true,d,b)},

 RefreshPagingEx : function CLVPRefreshPagingEx(e,q,p,t){ULSiIp:;var s=GetUrlKeyValue("PageFirstRow",false,e)=="1";if(s)e=RemoveOnlyPagingArgs(e);var v=new CUrl(e),h=v.query;if(h.length>0)h=h.substr(1);var i=h.split("&"),f,a=[];if(p!=null)a.push("&Cmd="+p);else this.isEdit,

 ResetSelection : function CLVPResetSelection(){ULSiIp:;var a=this.ctx,f=true;this.CUIItemInfo=null;if(CountSelectedItems(a)>0){var h=a.dictSel;a.dictSel=[];a.CurrentSelectedItems=0;var g=window.location.href;if(g.indexOf("Filter")==-1&&g.indexOf("Sort")==-1){var d=this.t,

 WebPartId : function CLVPWebPartId(){ULSiIp:;if(this.wpid==null){if(this.tab!=null){var a=this.tab;a=GetAncestor(a,"DIV");if(a!=null){if(a.getAttribute("WebPartID2")!=null){this.wpid=a.getAttribute("WebPartID2");return this.wpid}if(a.getAttribute("WebPartID")!=null),

 RefreshCore : function CLVPRefreshCore(strUrl){ULSiIp:;MenuHtc_hide();var req;if(window.XMLHttpRequest)req=new XMLHttpRequest;else req=new ActiveXObject("Microsoft.XMLHTTP");var additionalPostData="";if(typeof this.ctx.overrideSelectCommand!="undefined"){additionalPos,

 RefreshCurrent : function CLVPRefreshCurrent(){ULSiIp:;var a=document.URL;STSNavigate(a)},

 GetQueryString : function CLVPGetQueryString(){ULSiIp:;if(this.tab!=null&&this.tab.getAttribute("FilterLink")!=null)return this.tab.getAttribute("FilterLink");else return document.URL},

 RefreshEcbInfo : function CLVPRefreshEcbInfo(b){ULSiIp:;var a=this.GetQueryString();a=FixUrlFromClvp2(this,a,false);this.isEcbInfo=true;this.strGroupName=b;var c=this;this.RefreshPagingEx(a,false,"EcbView")},

 CacheEcbInfo : function CLVPCacheEcbInfo(b){ULSiIp:;if(this.ctx.HasRelatedCascadeLists==1&&this.ctx.CascadeDeleteWarningMessage==null){var j="<CascadeDeleteWarningMessage>",k="</CascadeDeleteWarningMessage>";if(b.startsWith(j)){var g=b.indexOf(k);if(g!==-1){this.ctx.Ca,

 EnsureEcbInfo : function CLVPEnsureEcbInfo(c,f,a){ULSiIp:;var g="ecbtab_ctx"+this.ctx.ctxId,b=document.getElementById(g);if(b==null&&this.tab!=null&&this.tab.parentNode==null)for(var d=0;d<this.tab.childNodes.length;d++){var e=this.tab.childNodes[d];if(e.id==g)b=e}if(b&,

 InvalidateEcbInfo : function CLVPInvalidateEcbInfo(){ULSiIp:;var b="ecbtab_ctx"+this.ctx.ctxId,a=document.getElementById(b);if(a!=null){this.tab.removeChild(a);this.DeleteGroupNameCache()}},

 GetEcbInfo : function CLVPGetEcbInfo(b){ULSiIp:;var a=this.EnsureEcbInfo();if(a!=null)if(a.dict!=null)return a.dict[b];return null},

 SwitchToEdit : function CLVPSwitchToEdit(){ULSiIp:;var a=document.URL;a=FixUrlFromClvp2(this,a,false);this.RefreshPagingEx(a,false,"JsGrid")},

 EnsureChangeContext : function CLVPEnsureChangeContext(){ULSiIp:;if(this.cctx==null)this.cctx=new SP.ClientContext(null)},

 DeleteItemCore : function CLVPDeleteItemCore(c,f){ULSiIp:;var h=this.ctx.listBaseType==1;this.EnsureChangeContext();var a=null;if(typeof this.rgehs=="undefined")this.rgehs=[];var b,e;b=new SP.ExceptionHandlingScope(this.cctx);this.rgehs.push(b);e=b.startScope();this.cctx,

 CheckoutItem : function CLVPCheckoutItem(f,d){ULSiIp:;this.EnsureChangeContext();if(typeof this.rgehs=="undefined")this.rgehs=[];var a,c,b=null;if(d!=0)return;a=new SP.ExceptionHandlingScope(this.cctx);this.rgehs.push(a);c=a.startScope();b=this.cctx.get_web().get_lists,

 DiscardCheckoutItem : function CLVPDiscardCheckoutItem(e,g){ULSiIp:;this.EnsureChangeContext();if(typeof this.rgehs=="undefined")this.rgehs=[];var b=null,a,f;if(g!=0)return;a=new SP.ExceptionHandlingScope(this.cctx);this.rgehs.push(a);f=a.startScope();b=this.cctx.get_web().ge,

 CheckinItem : function CLVPCheckinItem(g,j,a){ULSiIp:;this.EnsureChangeContext();if(typeof this.rgehs=="undefined")this.rgehs=[];var c=null,b,h;if(j!=0)return;b=new SP.ExceptionHandlingScope(this.cctx);this.rgehs.push(b);h=b.startScope();c=this.cctx.get_web().get_list,

 ManageCopies : function CLVPManageCopies(f,e){ULSiIp:;if(e!=0)return;var b=this.GetEcbInfo(f);if(b!=null&&b.getAttribute("Url")!=null){var d=this.ctx.HttpRoot+"/_layouts/managecopies.aspx?ItemUrl="+b.getAttribute("Url")+"&Source="+GetSource(),a=window["ctx"+this.ctx.ct,

 ShowErrorDialog : function CLVPShowErrorDialog(g){ULSiIp:;var i,a=[],d=null,c=false;for(i in this.rgehs){var b=this.rgehs[i];if(b.get_hasException()){var f="s4-dlg-err-itm";if(!c){f="s4-dlg-err-firstitm";c=true;a.push(SP.Res.dlgTitleError)}var k=b.get_errorMessage();a.pus,

 InplViewUrl : function CLVPInplViewUrl(){ULSiIp:;if(this.inplUrl!=null)return this.inplUrl;var a=[],b=escapeUrlForCallback(this.ctx.HttpRoot);a.push(b);b[b.length-1]!="/"&&a.push("/");a.push("_layouts/inplview.aspx?List=");a.push(this.ctx.listName);if(this.ctx.view!=n,

 InplViewUrlTrim : function CLVPInplViewUrlTrim(a){ULSiIp:;var b="";if(a)if(typeof this.ctx.overrideFilterQstring!="undefined")b=a.substr(this.InplViewUrl().length-this.ctx.overrideFilterQstring.length);else b=a.substr(this.InplViewUrl().length+1);return b},

 ShowPopup : function CLVPShowPopup(a){ULSiIp:;MenuHtc_hide();if(typeof this.fnOnCommitPopup!="undefined"&&this.fnOnCommitPopup!=null)OpenPopUpPage(a,this.fnOnCommitPopup);else OpenPopUpPage(a,RefreshPage);return false},

 ValidateField : function CLVPValidateField(e,d,a,b){ULSiIp:;var c=this.FieldCommand("FldValidate",e,d,a,b),f={callback:a,newval:b,strCmd:c};if(this.qvalidate==null)this.qvalidate=[];this.qvalidate.push(f);if(!this.isValidating){this.isValidating=true;this.RefreshCore(c),

 FieldCommand : function CLVPFieldCommand(j,h,d,m,f){ULSiIp:;var a=[];a.push(this.InplViewUrl());a.push("&Cmd=");a.push(j);a.push("&Field=");a.push(d);a.push("&FieldValue=");var b=h.GetProp(d),c,n=this.gridParam.tableViewParams.columns.GetColumnByKey(d),k=jsGridParams.t,

 IsInGroupCache : function CLVPIsInGroupCache(a){ULSiIp:;if(this.strGroupCache==null)return false;return this.strGroupCache.indexOf(a+"$")!=-1},

 CacheGroupName : function CLVPCacheGroupName(a){ULSiIp:;if(this.strGroupCache==null)this.strGroupCache=a+"$";else this.strGroupCache=this.strGroupCache+a+"$"},

 DeleteGroupNameCache : function CLVPDeleteGroupNameCache(){ULSiIp:;if(this.strGroupCache==null)return;var b=0,a;a=this.strGroupCache.indexOf("$",b);while(a!=-1){var d=this.strGroupCache.substring(b,a),e="ecbtab_ctx"+this.ctx.ctxId+"_"+d,c=document.getElementById(e);c&&this.tab,

 EnqueueEcbInfoRequest : function CLVPEnqueueEcbInfoRequest(b){ULSiIp:;for(var a=0;a<this.queueEcbInfo.length;a++)if(this.queueEcbInfo[a]==b)return;this.queueEcbInfo.push(b)},

 NoOutstandingECBRequests : function CLVPNoOutstandingECBRequests(){ULSiIp:;if(this.isEcbInfo)return false;if(this.queueEcbInfo.length>0)return false;return true}

}

That makes a bunch of noise, however, you'll see an interesting URL at the property named: inplUrl. 
Upon visiting this URL, you'll see all of your data for that particular view.  This seems very attractive for AJAX applications in SharePoint.  Look for more to come in regards to this...

Cheers,
Matthew

Tuesday, July 24, 2012

From the depths of SharePoint's sp.js Pt. 1

<Part 1>

Crack open your favorite browser tools and run:

ExecuteOrDelayUntilScriptLoaded( function() { console.dir( SP.Res ); }, 'sp.js');

The results will be:

LOG: {

 lcid : "1033",

 autocompleteAccessibleMenuName : "Autocomplete Menu",

 autocompleteLoading : "Loading...",

 autocompleteListNotFound : "List Not Found.",

 autocompleteListTooLarge : "List is too large to support Autocomplete.",

 autocompleteNoResults : "Item does not exist.",

 autocompleteTooManyResults : "Enter more of the name to see suggestions.",

 autocompleteList : "List:",

 autocompleteView : "View:",

 noObjectPathAssociatedWithObject : "The object is not associated with an object identity or the object identity is invalid.",

 propertyHasNotBeenInitialized : "The property or field has not been initialized. It has not been requested or the request has not been executed. It may need to be explicitly requested.",

 collectionHasNotBeenInitialized : "The collection has not been initialized. It has not been requested or the request has not been executed. It may need to be explicitly requested.",

 requestEmptyQueryName : "The property or query name is empty.",

 requestHasBeenExecuted : "Request has been executed.",

 requestAbortedOrTimedOut : "The request was aborted or timed out.",

 requestUnexpectedResponseWithStatus : "Unexpected response from server. The status code of response is '{0}'. The status text of response is '{1}'.",

 requestUnexpectedResponse : "Unexpected response from server.",

 invalidUsageOfExceptionHandlingScope : "Incorrect usage of exception handling scope.",

 unknownError : "Unknown Error",

 unknownResponseData : "Unexpected response data from server.",

 notSupportedQueryExpressionWithExpressionDetail : "The query expression '{0}' is not supported.",

 collectionModified : "The collection was modified. Enumeration operation may not execute.",

 cui_AddPerson : "Add Person or Group",

 calendarPrevMonth : "Previous Month",

 calendarNextMonth : "Next Month",

 calendarPrevWeek : "Previous Week",

 calendarNextWeek : "Next Week",

 calendarPrevDay : "Previous Day",

 calendarNextDay : "Next Day",

 oneMore : "1 more item",

 twoMore : "{0} more items",

 collapse : "collapse",

 calendarItemNew : "Add",

 calendarMenuLoading : "Loading items...",

 calendarRecurrenceException : "Exception to Recurring Event",

 calendarRecurrence : "Recurring Event",

 calendarNotifyLoading : "Loading calendar...",

 calendarNotifyUpdating : "Updating...",

 calendarErrorHeader : "Error",

 calendarClientDateOutOfSupportedRangeError : "Specified calendar is out of supported date range.",

 calendarDisabledWhileEditing : "This page may have been modified. You may need to reload this page to render the calendar view.",

 calendarDeleteConfirm : "Are you sure you want to delete this item?",

 calendarDateTimeSeparator : " - ",

 calendarViewEvent : "View Properties",

 calendarOpenItem : "Open",

 calendarResolveError : "No exact match was found for {0}.",

 invalidMerge : "The cells you are trying to merge do not have the same height or width. Change the size of the adjacent cells to match the selected cell before merging.",

 fontSizeUnitPt : "pt",

 fontSizeUnitPx : "px",

 fontSizeUnitEm : "em",

 fontSizeUnitCm : "cm",

 fontSizeUnitIn : "in",

 fontSizeUnitMm : "mm",

 fonts : "Fonts",

 themeFonts : "Theme Fonts",

 errorClipboard : "Your browser is not configured to allow access to your computer's clipboard. Use Control+X for Cut, Control+C for Copy, and Control+V for Paste.",

 clipboardNoAccess : "Your browser is not configured to allow access to your computer's clipboard. ",

 colorPickerStandardHeaderText : "Standard Colors",

 colorPickerThemeHeaderText : "Theme Colors",

 colorPickerMoreColorsText : "More Colors...",

 customBackgroundColorTitle : "Background Color",

 customColorTitle : "Color",

 editHtmlSourceTitle : "HTML Source",

 menuArrangeFloatTitle : "Float",

 menuArrangeInlineTitle : "Inline",

 selectMenuItemWithNumber : "{0} ({1})",

 selectMenuCENTER : "Centered text",

 selectMenuDIR : "Directory list",

 selectMenuFONT : "Font",

 selectMenuPLAINTEXT : "Plain text",

 selectMenuS : "Strikethrough",

 selectMenuSTRIKE : "Strikethrough",

 selectMenuU : "Underline",

 selectMenuXMP : "Plain text block",

 selectMenuRT : "Ruby text",

 selectMenuRUBY : "Ruby",

 selectMenuA : "Anchor",

 selectMenuABBR : "Abbreviation",

 selectMenuACRONYM : "Acronym",

 selectMenuADDRESS : "Address",

 selectMenuB : "Bold",

 selectMenuBDO : "Bi-directional text",

 selectMenuBIG : "Big text",

 selectMenuBLOCKQUOTE : "Quotation",

 selectMenuCAPTION : "Caption",

 selectMenuCITE : "Citation",

 selectMenuCODE : "Code",

 selectMenuDD : "Definition description",

 selectMenuDEL : "Deleted text",

 selectMenuDFN : "Definition",

 selectMenuDIV : "Text division",

 selectMenuDL : "Definition list",

 selectMenuDT : "Definition term",

 selectMenuEM : "Emphasized text",

 selectMenuFIELDSET : "Fieldset",

 selectMenuH1 : "Heading 1",

 selectMenuH2 : "Heading 2",

 selectMenuH3 : "Heading 3",

 selectMenuH4 : "Heading 4",

 selectMenuH5 : "Heading 5",

 selectMenuH6 : "Heading 6",

 selectMenuHR : "Horizontal rule",

 selectMenuI : "Italic",

 selectMenuIMG : "Image",

 selectMenuINS : "Inserted Text",

 selectMenuLABEL : "Label",

 selectMenuLEGEND : "Fieldset legend",

 selectMenuLI : "List Item",

 selectMenuMARQUEE : "Marquee",

 selectMenuMENU : "Menu list",

 selectMenuNOBR : "No line breaks",

 selectMenuOL : "Ordered list",

 selectMenuP : "Paragraph",

 selectMenuPRE : "Pre-formatted text",

 selectMenuQ : "Short quotation",

 selectMenuSAMP : "Sample",

 selectMenuSMALL : "Small text",

 selectMenuSPAN : "Span",

 selectMenuSTRONG : "Strong text",

 selectMenuSUB : "Subscript",

 selectMenuSUP : "Superscript",

 selectMenuTABLE : "Table",

 selectMenuTBODY : "Table body",

 selectMenuTD : "Table cell",

 selectMenuTFOOT : "Table foot",

 selectMenuTH : "Table header cell",

 selectMenuTHEAD : "Table head",

 selectMenuTR : "Table row",

 selectMenuTT : "Teletype text",

 selectMenuUL : "Unordered list",

 onPasteTooltip : "Paste Options",

 pasteTextLabel : "Keep Text Only",

 pasteStripLabel : "Remove Inline Styles",

 pasteHtmlLabel : "Keep Inline Styles",

 onCellTooltip : "Cell Menu",

 deleteRowLabel : "Delete Row",

 deleteColumnLabel : "Delete Column",

 splitCellLabel : "Split Cell",

 insertRowAboveLabel : "Insert Above",

 insertRowBelowLabel : "Insert Below",

 insertColumnLeftLabel : "Insert Left",

 insertColumnRightLabel : "Insert Right",

 pasteWaitScreenTitle : "Paste",

 pasteWaitScreenText : "Pasting...",

 xhtmlWaitScreenTitle : "XHTML",

 xhtmlWaitScreenText : "Converting to XHTML...",

 xhtmlDone : "XHTML conversion completed",

 htmlSourceChangedTitle : "Warning",

 htmlSourceChangedText : "The HTML source you entered might have been modified.",

 keyboardShortcutUndo_AccessKey : "Z",

 keyboardShortcutUndo_Ctrl : "t",

 keyboardShortcutUndo_Shift : "f",

 keyboardShortcutUndo_Alt : "f",

 keyboardShortcutRedo_AccessKey : "Y",

 keyboardShortcutRedo_Ctrl : "t",

 keyboardShortcutRedo_Shift : "f",

 keyboardShortcutRedo_Alt : "f",

 keyboardShortcutSelectAll_AccessKey : "A",

 keyboardShortcutSelectAll_Ctrl : "t",

 keyboardShortcutSelectAll_Shift : "f",

 keyboardShortcutSelectAll_Alt : "f",

 keyboardShortcutBold_AccessKey : "B",

 keyboardShortcutBold_Ctrl : "t",

 keyboardShortcutBold_Shift : "f",

 keyboardShortcutBold_Alt : "f",

 keyboardShortcutItalic_AccessKey : "I",

 keyboardShortcutItalic_Ctrl : "t",

 keyboardShortcutItalic_Shift : "f",

 keyboardShortcutItalic_Alt : "f",

 keyboardShortcutUnderline_AccessKey : "U",

 keyboardShortcutUnderline_Ctrl : "t",

 keyboardShortcutUnderline_Shift : "f",

 keyboardShortcutUnderline_Alt : "f",

 keyboardShortcutClearFormatting_AccessKey : " ",

 keyboardShortcutClearFormatting_Ctrl : "t",

 keyboardShortcutClearFormatting_Shift : "f",

 keyboardShortcutClearFormatting_Alt : "f",

 keyboardShortcutIndent_AccessKey : "M",

 keyboardShortcutIndent_Ctrl : "t",

 keyboardShortcutIndent_Shift : "f",

 keyboardShortcutIndent_Alt : "f",

 keyboardShortcutOutdent_AccessKey : "M",

 keyboardShortcutOutdent_Ctrl : "t",

 keyboardShortcutOutdent_Shift : "t",

 keyboardShortcutOutdent_Alt : "f",

 keyboardShortcutLeftAlign_AccessKey : "L",

 keyboardShortcutLeftAlign_Ctrl : "t",

 keyboardShortcutLeftAlign_Shift : "f",

 keyboardShortcutLeftAlign_Alt : "f",

 keyboardShortcutCenterAlign_AccessKey : "E",

 keyboardShortcutCenterAlign_Ctrl : "t",

 keyboardShortcutCenterAlign_Shift : "f",

 keyboardShortcutCenterAlign_Alt : "f",

 keyboardShortcutRightAlign_AccessKey : "R",

 keyboardShortcutRightAlign_Ctrl : "t",

 keyboardShortcutRightAlign_Shift : "f",

 keyboardShortcutRightAlign_Alt : "f",

 keyboardShortcutMakeHyperlink_AccessKey : "K",

 keyboardShortcutMakeHyperlink_Ctrl : "t",

 keyboardShortcutMakeHyperlink_Shift : "f",

 keyboardShortcutMakeHyperlink_Alt : "f",

 tablePreviewChar : "_",

 textStyleExampleText : "AaBbCcDdEeFfGgHhIiJjKkLlMm",

 reverting : "Reverting...",

 sending : "Sending...",

 emailDefaultBody : "Sample",

 saving : "Saving...",

 saved : "Saved",

 processingRequest : "Processing request...",

 deleting : "Deleting...",

 pageIsSiteHomePage : "This page is now the site homepage.",

 saveChangeDialogTitle : "Save Changes",

 saveChangeDialogDesc : "Do you want to save the changes you made to this page?",

 saveConflictStatusBarTitle : "Save Conflict:",

 saveFailed : "Cannot save the page.",

 buttonYes : "Yes",

 buttonNo : "No",

 buttonCancel : "Cancel",

 layoutsNotSupported : "This feature does not support the Layouts Editor.",

 dropdownImageAltText : "Dropdown",

 checkAltText : "Check",

 uncheckAltText : "Uncheck",

 editListItems : "Edit List Items",

 moreItems : "Not all items are shown...",

 dropdownLoading : "Loading...",

 getDataError : "This service isn't available right now.",

 getDataErrorRetry : "Click here to try again.",

 defaultViewDescription : "Default View",

 personalViewDescription : "Personal View",

 publicViewDescription : "Public View",

 moderationViewDescription : "Moderation View",

 close : "Close",

 restore : "Restore",

 maximize : "Maximize",

 dialogLoading : "Loading...",

 dialogLoadingText : "Please wait while the content loads.",

 hiddenButtonValueBeforeDialog : "Wrap focus to the end of the dialog",

 hiddenButtonValueAfterDialog : "Wrap focus to the beginning of the dialog",

 defaultDialogTitle : "Dialog",

 defaultDialogWidth : "768",

 defaultDialogHeight : "576",

 modelessDialogsNotImplemented : "Modeless dialogs are not implemented.",

 dialogCancelAK : "C",

 confirmWelcomePage : "If you make this page the home page for this site, users will no longer be able to see the old site home page. Do you want to set this page as this site's home page?",

 relationships_UnknownError : "Unknown Error.",

 relationships_RelatedFieldsFetchFailed : "Failed to retrieve related lists for this list.",

 relationships_DocLibHasNoRelatedLists : "The {0} document library does not have any related lists.",

 relationships_ListHasNoRelatedLists : "The {0} list does not have any related lists.",

 relationships_RelatedFetchFieldsTookTooLong : "A timeout occurred while retrieving related lists for this list.",

 relationships_ListFormsFetchFailed : "Failed to retrieve forms for list.",

 relationships_NoNewEditDisplayListForms : "This list does not contain any forms.",

 relationships_DefaultDisplayForm : "Default Display Form",

 relationships_DefaultNewForm : "Default New Form",

 relationships_DefaultEditForm : "Default Edit Form",

 relationships_CTForms : "Content Type Forms",

 relationships_CTDisplayForm : "({0}) Display Form",

 relationships_CTNewForm : "({0}) New Form",

 relationships_CTEditForm : "({0}) Edit Form",

 relationships_ToolTipTitle : "Insert Related Items Web Part",

 dlgTitleDel : "Delete Items",

 dlgTitleCheckin : "Check In Files",

 dlgTitleCheckout : "Check Out Files",

 dlgTitleError : "The server has encountered the following error(s):",

 errorDialogTitleText : "Error",

 genericLoading : "Loading...",

 webPartNotDisplay : "This web part cannot be displayed. Save and stop editing the page to see the web part.",

 viewGroupDefault : "Default",

 viewGroupPersonal : "Personal",

 viewGroupPublic : "Public",

 viewGroupModerated : "Moderated",

 viewGroupOther : "Other",

 modifyViewLabel : "Modify View",

 modifyInDesignerLabel : "Modify in SharePoint Designer (Advanced)",

 workflowSettingsLabel : "Workflow Settings",

 associateWorkflowLabel : "Add a Workflow",

 createWorkflowInDesignerLabel : "Create a Workflow in SharePoint Designer",

 createReUsableWorkflowInDesignerLabel : "Create a Reusable Workflow in SharePoint Designer",

 sendToOtherLocation : "Other Location",

 okButtonCaption : "OK",

 detailsView : "Details",

 thumbnailsView : "Thumbnails",

 filmstripView : "Filmstrip",

 modifyThisView : "Modify this view",

 createView : "Create view",

 editColEditable : "Editable",

 editColReadOnly : "Read Only",

 deleteText : "Delete",

 deleteFailed : "This item could not be deleted",

 requiredField : "This field requires a value.",

 serverCommError : "Unable to communicate with the server.",

 savingToServer : "Changes are currently being saved back to the server.  If you leave now, some of those changes may be lost.",

 changesHaveNotBeenSaved : "Changes have been made that have not yet been saved back to the server.  If you leave now, all of those changes will be lost.",

 docAlreadyExists : "The specified name is already in use.  A summary task cannot have the same name as another summary task in the current list.",

 ganttListName : "Project Tasks",

 createWaitScreenCancel : "Cancel",

 checkInComments : "Comments:",

 okButtonText : "OK",

 continueButtonText : "Continue",

 cancelButtonText : "Cancel",

 okCancelButtonWidth : "6em",

 alignRight : "right",

 pageStateCancelApprovalLabel : "Cancel Approval",

 pageStateDiscardCheckoutLabel : "Discard Check Out",

 pageStateDontSaveLabel : "Exit Without Saving",

 pageStateEditLabel : "Edit",

 pageStateSaveLabel : "Save",

 pageStateCheckinLabel : "Check In",

 pageStateCheckoutLabel : "Check Out",

 pageStateOverrideCheckoutLabel : "Override Check Out",

 pageStatePublishLabel : "Publish",

 pageStateSaveAndStopEditingLabel : "Save and Stop Editing",

 pageStateSubmitForApprovalLabel : "Submit for Approval",

 pageStateUnpublishLabel : "Unpublish",

 pageStateApproveLabel : "Approve",

 pageStateRejectLabel : "Reject",

 pageStateSaveBeforeNavigateUnknownError : "The page took too long to save. You can click "Cancel", and then try to save the page again. If you click "OK", you might lose unsaved data.",

 pageStateSaveBeforeNavigateNotCheckedOutWarning : "To save your changes before continuing, click "OK". To continue without saving changes, click "Cancel".",

 pageStateSaveBeforeNavigateLastChanceWarning : "You have made changes to your page that have not yet been saved. Are you sure you want to discard those changes?",

 tenantAdmin_SiteCollectionNewDialogTitle : "Create Site Collection",

 tenantAdmin_SiteCollectionDeleteDialogTitle : "Delete Site Collections",

 tenantAdmin_SiteCollectionPropertiesDialogTitle : "Site Collection Properties",

 tenantAdmin_SiteCollectionOwnersDialogTitle : "Site Collection Owners",

 tenantAdmin_SiteCollectionDiskQuotaDialogTitle : "Site Collection Disk Quota",

 rteDialog_Height : "175",

 rteDialog_Width : "400",

 renamePageDialog_Title : "Rename Page",

 webPartPageRecycleConfirmation : "Are you sure you want to send this page to the site Recycle Bin?",

 webPartPageDeleteConfirmation : "Are you sure you want to permanently delete this page?"

}

Some mighty fine messages ready for reuse...  I'll continue to post some more obscure things I'm finding as I dig deeper into the depths of sp.js.  

Monday, April 2, 2012

Modifying the default language in InfoPath

This will be a quick exercise on how to change the language you can write within InfoPath 2007...

Click on Form Options
Crack open your favorite form builder and then click on Tools.  From that menu, click on Programming on the left...  You should already know where I'm going with this.  Let's change that default (C#) to something nonsensical, unstructured and putrid; yet everyone seems to be jumping on the bandwagon: JavaScript or in this case JScript. Whatev...







(¸¸.♥➷♥•*¨)¸.•´¸.•*¨) ¸.•*¨)
(¸.•´(¸. ¸.•´¸.•*¨) ¸.♥➷•*¨)
─▀██▀─▄███▄─▀██─██▀██▀▀▀█─
──██─███─███─██─██─██▄█──conquers
──██─▀██▄██▀─▀█▄█▀─██▀█──all ♥➷♥
─▄██▄▄█▀▀▀─────▀──▄██▄▄▄█
¸.•´¸.•*¨) ¸♥.•*¨) (¸.•´¸♥➷♥¸.•´♥¸.•´♥¸.•*¨)♥.•*¨)¸.•*♥¸


Form Options



















(¸¸.♥➷♥•*¨)¸.•´¸.•*¨) ¸.•*¨)
(¸.•´(¸. ¸.•´¸.•*¨) ¸.♥➷•*¨)
─▀██▀─▄███▄─▀██─██▀██▀▀▀█─
──██─███─███─██─██─██▄█──conquers
──██─▀██▄██▀─▀█▄█▀─██▀█──all ♥➷♥
─▄██▄▄█▀▀▀─────▀──▄██▄▄▄█
¸.•´¸.•*¨) ¸♥.•*¨) (¸.•´¸♥➷♥¸.•´♥¸.•´♥¸.•*¨)♥.•*¨)¸.•*♥¸




I've decided from now on any InfoPath post will need something extra for me, so I can start to

░░░░░░░░░░░░▄▄
░░░░░░░░░░░█░░█
░░░░░░░░░░░█░░█
░░░░░░░░░░█░░░█
░░░░░░░░░█░░░░█
███████▄▄█░░░░░██████▄
▓▓▓▓▓▓█░░░░░░░░░░░░░░█
▓▓▓▓▓▓█░░░░░░░░░░░░░░█
▓▓▓▓▓▓█░░░░░░░░░░░░░░█
▓▓▓▓▓▓█░░░░░░░░░░░░░░█
▓▓▓▓▓▓█░░░░░░░░░░░░░░█
▓▓▓▓▓▓█████░░░░░░░░░█       
██████▀░░░░▀▀██████▀

it...

Want to see what damage I can do?  Stay tuned...

Monday, March 26, 2012

Get the ID of any SharePoint Wiki page

Hello _spPageContextInfo!!!
I found this little gem by viewing the source of my site spdwiki.com.  Simply running a console.dir() on this object reveals these properties:


  1. alertsEnabled: true
  2. allowSilverlightPrompt: "True"
  3. currentLanguage: 1033
  4. pageItemId: 1
  5. pageListId: "{15d98081-a722-48ad-a30c-c25d4c31a228}"
  6. siteServerRelativeUrl: "/"
  7. userId: 1
  8. webLanguage: 1033
  9. webServerRelativeUrl: "/"
  10. webUIVersion: 4


I've noticed running this same inquiry on a different site, say http://www.sharepointfabian.com, the properties are different:


  1. alertsEnabled: true
  2. allowSilverlightPrompt: "True"
  3. currentLanguage: 1033
  4. pageListId: "{a4668dd2-4dac-4cce-baf0-ddb1ea4f2d5e}"
  5. siteServerRelativeUrl: "/"
  6. webLanguage: 1033
  7. webServerRelativeUrl: "/blog"
  8. webUIVersion: 4


It's safe to say, this is because the latter is a blog and not a wiki.

What to make of all of this?  I'm able to display pertinent data accordingly and no longer required to rely on the text of the page name.

var pageID = _spPageContextInfo.pageItemId;

It's a much cleaner solution that just feels good.

I've been working on a commenting system for a SharePoint 2010 system.  Knowing some of these internal variables that are floating around is invaluable.  Hope you find this useful as well.

Yes Josh, I'm going to finish this finally. ;-)