Thursday, 3 October 2013

Website Recommanded

Free Web Part
http://www.amrein.com/apps/page.asp?Q=312

SharePoint 2013 Foundation with Yammer Integration

Create a text file, upload to document library with the following content:

<!DOCTYPE HTML>
<html>
<head>
<style>
#embedded-feed{
 border:1px solid #f0f0f0;
 padding:2px;
 height:500px;
 width:278px;
}
</style>
</head>
<body>
<script data-app-id="hyB2pTvrL36Y50py8EWj6A" src="https://assets.yammer.com/platform/yam.js"></script>
<script>
yam.connect.embedFeed(
{ container: '#embedded-feed'
, network: 'xxxx.com'
//, feedType: 'group' // can be 'group', 'topic', or 'user'
//, feedId: '2712' // example feed ID for BSC group
, config: {
 header: false
}
});
</script>
<div id="embedded-feed"></div>
</body>
</html>


In a webpage, insert a content webpart and link to this file, done.

Tuesday, 10 September 2013

SharePoint database Maintenance

USE [SharePoint_Config]
GO
ALTER DATABASE [SharePoint_Config] SET RECOVERY SIMPLE WITH NO_WAIT
DBCC SHRINKFILE('SharePoint_Config_log', 100)
ALTER DATABASE [SharePoint_Config] SET RECOVERY FULL WITH NO_WAIT  
GO

Tuesday, 27 August 2013

Hide Quick Launch Menu Items

<script type="text/javascript">
 var context = null;
 var web = null;
 var currentUser = null;
 var currentUserId = '';
 var value = null;

 ExecuteOrDelayUntilScriptLoaded(hideDiv,"SP.js");
 function hideDiv() {
  context = new SP.ClientContext.get_current();
  web = context.get_web();
  context.load(web, 'EffectiveBasePermissions');
  currentUser = web.get_currentUser();
  currentUser.retrieve();
  context.load(web);
  context.executeQueryAsync(onSuccessMethod, onFaiureMethodl);
 }
 function onSuccessMethod(sender, args) {
  var userObject = web.get_currentUser();
  //alert('User name:' + userObject.get_title() + '\n Login Name:' + userObject.get_loginName());
  var perm = web.get_effectiveBasePermissions();
  if(perm.has(SP.PermissionKind.approveItems)){
   jQuery('#NewProductInformation').css("visibility", "visible");
  }
 }
 function onFaiureMethodl(sender, args) {
  alert('request failed ' + args.get_message() + '\n' + args.get_stackTrace());
 }
</script>

Thursday, 7 March 2013

Print calendar form using standard browser printing function

In master page, add:
@media print {
.cssPrintButton {
 DISPLAY: none
}   
.no-print { display:none; }
    .marginleftzero {
 margin-left:0px !important;
}
}

<div class="TopArea s4-notdlg no-print" style="height: 138px">
<div class="s4-ca s4-ca-dlgNoRibbon marginleftzero" id="MSO_ContentTable">

add one content webpart to disp page
<div class="cssPrintButton"><input onclick="window.print();return false;" type="button" value=" Print this page "/> </div>

Speed up your SharePoint 2013 server

Reduce the CPU impact the search service:

PowerShell: Set-SPEnterpriseSearchService -PerformanceLevel Reduced

Reduce the memory usage by noderunner.exe processes:

1.       Open file in notepad:  C:\Program Files\Microsoft Office Servers\15.0\Search\Runtime\1.0\noderunner.exe.config

2.       Change the value at <nodeRunnerSettings memoryLimitMegabytes="0" /> to 100 (Megabytes) for example.

Friday, 18 January 2013

Upgrade laptop hdd for Windows 2008 R2 OS

As a SharePoint developer I need Hyper V feature, I am using Windows 2008 R2 OS as my laptop system. Laptop hdd is 250G which is not enough. Recently I got a 1TB portable hdd from company lottery. So I start to upgrade my laptop hdd.
1. I tried DriveImage xml, the duplicated hdd cannot start OS
2. I download the diskgenius software from http://www.diskgenius.cn/download.asp and installed on Windows 2008 R2
3. Connect portable hdd to laptop and start disk 2 disk copy
4. Replace laptop hdd with the 1TB hdd
5. Resize partation using diskgenius