Friday, 7 January 2022

 Hey. 


Here I am writing today about digital marketing expert course DigitalDeepak Internship Program.

Here is the one expert amazingaman who write the best SEO content in many niche Marketing, Travels, Parenting and so on.

Thursday, 26 July 2018

Amazing Technologies

An amazing aspect of the technology is that its natural, consistent & as much ancient as the earth is, still it is so dynamic. The roots of technology found to be in invention of fire or wheel by the first version of mankind.

The world is changing at the light years massive fast pace and so does the technology!! Technology has leaded the mankind to be smarter, swifter & successful. In today's era every passing second witnesses’ an invention at any place of the universe.


1. Sixth Sense Technology


What is sixthsense?

See what Mr Pranav Mistry says 'SixthSense is a wearable gestural interface that augments the physical world around us with digital information and lets us use natural hand gestures to interact with that information. We've evolved over millions of years to sense the world around us.'







Me & Pranav Mistry – friends of schools - shared same batch in our schooling days. We played cricket, competed in many activities & played important roles in many events. It was initial days of computer in India. Now the famous scientist Pranav Mistry is inventing on sixth sense & many more unprecedented, undisclosed secrets of the earth. Its wonderful feeling to write on his invention & patents.

2. Space Research 




NASA & other space research organizations have expanded the reach & greed of greedy human. Well, I mean, Very sooner, we may buy plots on another planets too. Wow ! Just imagine what will be Google's corporate office in 2030! May be something like this, A- 589, Silicon Valley, MARS or JUPITER



3. Drone


"This aircrafts may be remotely controlled or can fly autonomously through software-controlled flight plans in their embedded systems working in conjunction with on board sensors and GPS"



Amazon delivers via drone in seconds only !! It's a revolutionary event in logistics industry across the globe. Giant machinery to micro mini gadgets, they help minimize the process time with enhanced accuracy too.


4. Autonomous car




Cars & cabs need no driver now, It is capable of sensing its environment and navigating without human input. Isn't it amazing? Next generation trains are also rushing at jet speed.


5. Mass production


Mass production from china has changed the global competition scenario . At the same time it spreads a crores of new product options to the class of buyer worldwide. Even the sea & air cargo industry has grown massively & same applies to an internal transportation too. That has leaded to the new generation of roads & over bridges, thanks to the latest technologies & new edition in civil stream...


6. Mobile, Computer & Internet



These are the eternal part of the change channel which has turned the world to the global village & people be the global human beings rather than Russian or American! Motorola launched 1st handled phone in 1973, the story since than is simply incredible! The 21st century smart phones have totally changed common man's life with an edge. It has not only replaced many things but changed the way of our thinking & imagination.


7. Cloud Computing


Data are now saved in cloud, not the one that we see in the sky. In the simplest terms, cloud computing means storing and accessing data and programs over the Internet instead of your computer's hard drive. There are different services provided by IAAS, PAAS, SAAS. 


Nowadays many options in cloud computing provider like Azure, AWS and Google cloud platform. Think of benefits. Its location independent, Low total cost of ownership of infrastructure, Pay as per you use, no maintenance cost, secure, support and scalability and sustainability.

Well, this is just a beginning , The world is going to experience, enjoy & explore this saga as an infinity.


Created by :
Ankur Kella
India

Monday, 10 October 2016

Unable to read Web.Config file in SharePoint 2013 Event receiver

 Introduction:
Generally, we use web.config file’s app settings section to keep configurable and application wide settings that an application requires in order to perform the task properly. This helps in easy maintenance and deployment of the application, because we can easily update the settings and verify without build and deployment. 


Now we read the key value pairs from web.config file as follow:
ConfigurationManager.AppSettings[key]


I need to use these app settings in Item added Event receiver in SharePoint list. Though, the above code worked fine on local environment, but on production server, it gave exception. 
"Object reference not set to an instance of an object"

In the Event receiver, the above code is unable to find and read the web.config app settings, you would've noticed that although code compiles and runs, this comes back null. Well, the very generic answer to why this is, is because the event handler isn't really running within the same context as a Web site that has direct access to the ConfigurationManager.


Approach/solution:
There is a simple solution for this issue, just change the approach of reading the web.config file. 

Below is the method we have implemented to read the web.config file:

public static string GetAppSettingKeyValue(SPSite siteCollection, string key)
        {
            System.Configuration.Configuration config;
            if (string.IsNullOrEmpty(siteCollection.WebApplication.Name))
                throw new ApplicationException("Web application name is empty!");
            config = WebConfigurationManager.OpenWebConfiguration("/", siteCollection.WebApplication.Name);
            AppSettingsSection appSettings = config.AppSettings;
            if (appSettings == null)
                throw new ApplicationException("Web.config appSettings section cannot be found!");
            if (appSettings.Settings[key] == null || string.IsNullOrEmpty(appSettings.Settings[key].Value))
                throw new ApplicationException("Key value cannot be read from settings of appSettings. Make sure this key and its value exist!");
            return appSettings.Settings[key].Value;
        }


And then we just have to call the above method from event receiver’s events with necessary parameters to read the settings as below:
GetAppSettingKeyValue(new SPSite(properties.SiteId), key);

Here, first parameter is SPSite object and the second parameter is a app settings key, for which we need to read value from web.config file.

Thus all we need to do is, just change the approach of reading web.config file and we are done! Now, we can successfully read the app settings configuration.

PowerShell script to get updated content in whole site between two dates.


Introduction:

As a part of migration of SharePoint site from 2010 to 2013 environment, I need to perform a content migration from 2010 to 2013. As a migration process, content database of 2010 production site was migrated to 2013 environment. Yet the 2010 production site was in use and 2013 site is still doing setups and updates for live production. In this mean time, 2010 site has many content updates going on obviously as site is being used by a giant company. So how to get the contents of site which is updated after content DB backup is taken from 2010?

Solution:

I have prepared two scripts.
  1. First script will read for the Site URL, Start Date and End Date from user and give whole inverntory count of lists/libraries/sites which are updated between two dates. And it will give the csv file with no of items for each object which are update between 2 dates.
  2. This script will read for the Site URL, Start Date and End Date from user and give all items which are updated between two dates from whole site collection. This will also give the csv file with Site URL, List name and, Item URL for each item which are update between 2 dates. 

Thus, I was able to get all the items which are updated after content DB is migrated to 2013 site and updated those items manually.

In addition, we can use this script multiple times till the 2013 site actually goes live and can have up to date content on new live site!!

Thanks for reading this blog !





Friday, 30 September 2016

Multilingual site options in SharePoint - Google Translate



Introduction
There are multiple ways that you can have multilingual sites in SharePoint. Like MUI, Variation, Google Translate. This blog will explain the basic concepts of all 3 options and you can use the best that suites your requirement.


1. Multilingual User Interface(MUI)
This option creates a site in default language selected when creating site. For example, if the Chinese language is selected when the site is created, the site user interface will appear in Chinese. We need to add different language pack and configure site for multiple languages.

Limitations:
It only affects the site administration pages and OOTB SharePoint Menus, welcome message, column headers etc. But it doesn’t support user-created content, such as list item data, documents and web pages in libraries, custom permission levels, and custom groups. Also, it requires publishing feature, and thus requires SharePoint Server and will not work with SharePoint Foundation.

2. Variations
When variation is enabled, SharePoint will automatically build a variation of the site in parallel. This option creates a source variation site that is used to author content in one language, and then it will sync that content to one or more target variation sites in other languages. For example, you can author and publish content in English language for http://yoursitename.com/en, and use variation to sync content to http://yoursitename.com/fr, where it can be translated to French and publish it.
Limitations:
SharePoint will create two alternate versions of the site for you as you build out the structure of the source site. This option basically increases the content DB size as it creates the new site collection for each variation. It can’t translate any content you build on the source site. You will need to recreate the content from the source site in your Variation sites. It requires publishing so can work on SharePoint Server and will not work with SharePoint Foundation.

3. Google Translation
The final option to consider when creating a multilingual site is using the machine translation tool. Google Translation is free option for language translation in SharePoint. The SharePoint site is run through a translation engine and re-rendered in the selected language. It works with SharePoint foundation too. Here we will see how can we convert whole SharePoint site content in preferred language.
How to implement multilingual site using Google Translate:

I have created a WSP package in SharePoint solution which contains:
1. User Control - For a dropdown control which contains a list of available languages.
2. JavaScript - To translate the content in other languages.
3. Custom master page – to add control in it, so that the translation control will be available throughout the site.

Step 1:
Create a user-control(.ascx) file in which you need to create a dropdown list to select a language to translate your site content in a web browser. Here, I have added only few languages, but you can add as many as you need.

e.g.
<li role="presentation"><a href="#" data-lang="Indonesian" role="menuitem" tabindex="-1">Indonesian </a> </li>


 
<div id="google_translate_element" style="display: none !important;"></div>
<div class="dropdown" style="margin: 0px; text-align: right; padding-right: 0px;">
<!-- Use CSS to replace link text with flag icons -->
<a class="dropdown-toggle" id="translatebutton" data-toggle="dropdown" aria-expanded="true"><!--<img/>--> Translate </a>
<div class="dropdown-menu dropdown-menu-right translation-links" role="menu" aria-labelledby="dropdownMenu1" id="translateblock">
<div id="translateblocknotice">Select your language </div>
<ul class="col-md-3 col-xs-6 translateblockcolumn">
<li role="presentation">
<a href="#" data-lang="English" role="menuitem" tabindex="-1"> English </a> </li>
<li role="presentation">
<a href="#" data-lang="Afrikaans" role="menuitem" tabindex="-1"> Afrikaans </a></li>
<li role="presentation">
<a href="#" data-lang="Albanian" role="menuitem" tabindex="-1"> Albanian </a> </li> <li role="presentation">
<a href="#" data-lang="Swahili" role="menuitem" tabindex="-1"> Swahili </a> </li> </ul>
</div>
</div>

<script src="https://code.jquery.com/jquery-3.1.0.min.js" integrity="sha256-cCueBR6CsyA4/9szpPfrX3s49M9vUU5BgtiJj06wt/s=" crossorigin="anonymous"></script>
<script src="http://translate.googleapis.com/translate_static/js/element/10/element_main.js" type="text/javascript"></script>
<script src="http://translate.google.com/translate_a/element.js?cb=googleTranslateElementInit" type="text/javascript"></script>
<script type="text/javascript">
function googleTranslateElementInit() {
new google.translate.TranslateElement({
pageLanguage: 'en', layout:
google.translate.TranslateElement.InlineLayout.SIMPLE
},
'google_translate_element');
}
</script>

<script type="text/javascript">
$('.translation-links a').click(function () {
var lang = $(this).data('lang');
var $frame = $('.goog-te-menu-frame:first');
if (!$frame.size()) {
alert("Error: Could not find Google translate frame.");
return false;
}
$frame.contents().find('.goog-te-menu2-item span.text:contains(' + lang + ')').get(0).click();
return false;
});
</script>


Step 2
Open the master page and add the user control we have created at your convenient place.
After adding the user control, the code in master page will look like this:

<div class="col-lg-6 col-xs-5" id="translate">
<!--SPM:<%@ Register TagPrefix="ucTranslator" TagName="Translator" Src="~/_controltemplates/15/MyProject/Translator.ascx" %>-->
<!--CS: Start Create Snippets From Custom ASP.NET Markup Snippet-->
<!--SPM:<ucTranslator:Translator runat="server" id="Translator"/>-->
<!--CE: End Create Snippets From Custom ASP.NET Markup Snippet-->
</div>

Step 3
Build and deploy the solution.

Results
Here is a site in which you can find a Translate link in top of the page. Click on Translate and click On any language, you will get your site translated in the selected language.


Link button called 'Translate' is added.


























On clicking Translate, it displays available languages to translate content into.





I have clicked here on Chinese to translate content in Chinese language.


The limitation of this approach is that, it won’t work with left to right language like Arabic. It will just convert the content in Arabic language but the whole UI of the site which translates from Right to left through variation option, cannot be done with google translate.

Console application - accessing all webparts of a publishing page

Introduction:


Recently, we have been working on a SharePoint console app that finds invalid metadata terms assigned to web part properties. To get started we were trying to get all web parts on a publishing page.



Problem​:

There were several CQWP on page which were showing as error webparts when you get them using LimitedWebPartManager.



Solution:

Since CQWP and other publishing site web parts uses HttpContext.Current, we have to create a fake object in order to get it working properly. Here is the code that was included before GetLimitedWebPart call:


   1:  if (HttpContext.Current == null)
   2:  {
   3:  HttpRequest request = new HttpRequest("", web.Url, "");
   4:  HttpContext.Current = new HttpContext(request,
   5:  new HttpResponse(new StringWriter()));
   6:  HttpContext.Current.Items["HttpHandlerSPWeb"] = web;
   7:  WindowsPrincipal wP = new WindowsPrincipal(System.Security.Principal.WindowsIdentity.GetCurrent());
   8:  HttpContext.Current.User = Thread.CurrentPrincipal = wP;
   9:  }​

Wednesday, 14 September 2016

SharePoint List View: Filter by Me and My SharePoint Groups

Scenario 
I have a SharePoint List containing task items. Tasks are assigned to a specific SharePoint Group or individual user. Each group has its own members. Requirement is, if current user is member of any of those groups, can see assigned tasks under My Tasks View.

Approach
There are few possible solutions, one of them is to modify Query filter via SharePoint Designer.

Filtering a list view by group membership
Step: 1
Open SharePoint designer then open site.  Select the Task List under Lists and Libraries. (For example, here we have selected "ResourceDocumentTypes").


Step: 2
When you select task list you will see a panel on right side named "Views". Select the view that needs to be modified. (For this example it’s "My Events")







Step: 3
Note: If you cannot edit file, you must select advanced mode.

In source view, search for <Query> and you will see View Query. If you have already modified view as filtered by [Me]. In that case, you need to modify the query which contains

<Query><Where><Eq><FieldRef Name="AssignedTo"/><Value Type="Integer"><UserID 

Type="Integer"/></Value></Eq></Where></Query>

With below code:

<Query>
<Where>
<Or>
<Membership Type="CurrentUserGroups"><FieldRef Name=" AssignedTo"/>
<Membership>
<Eq>
<FieldRef Name="AssignedTo"/><Value Type="Integer"><UserID Type="Integer"/></Value>
<Eq>
<Or>
</Where>
</Query>

Be sure to change the "FieldRef Name" to your own field, and click Save. Done!

Now, User can see all task items where “AssignedTo” field contains a SharePoint Group that logged in user is a member of and also assigned to him/her directly.

Results
Here is a list view showing all tasks assigned to different SharePoint Groups:
Below is filtered list view showing only tasks assigned to SharePoint Groups for which current user is a member.