Crawling MySites on https

by Robi 6. August 2013 15:10
Small trick… If you are going to crawl My Sites which are configured on https, you need to set your content source to crawl sps3s://mysites instead of sps3://mysites. If you try to crawl sps3 when your mysites web application is configured with SSL, you get the: »Object not found« Error in your crawl logs.  Hope it helps!!!


SharePoint | SharePoint 2013

Picture gallery with Galleria and Content Query Web part

by Robi 13. August 2012 09:56
Following E. Struyf 's Blog for making a picture gallery from the assets library: Making an Image Gallery Inside the Asset Library: Part 1 - E. Struyf 's Blog I thought that it has to be a way to get pictures from picture gallery with the Content Query Web Part and modify the results so that it can work for the galleria. So, the first step of course would be to download all the necessary files. To download files go to the galleria we page and extract the zip file. You can copy all files to the Style library, where I made the JS folder to save the jQuery library file, downloaded from the web site. Galleria files  Download Galleria   Screen shot of the Style library\JS folder. For the galleria to work, you will need: Jquery library Galleria.classic.css Galleria.classic.min.js Galleria-1.2.7.min.js Classic-loader.gif Classic-map.png. XSL files Next thing to do is to modify the ContentQueryMain.xsl and ItemStyle.xsl. In ContentQueryMain you need to modify the div in which pictures will be displayed. In order to do that just add the class gallery to the div id=''{concat('cbqwp',$ClientId)}''. You will specify the branding later on for the .gallery class. ContentQueryMain.xsl  In ItemStyle.xsl you need to add a new xsl:template, which will be used for rendering pictures in CQWP. Important part here is to change the variable SafeLinkUrl. So to get the full picture not just the picture thumbnail you need to select the LinkUrl column for the UrlColumnName. ItemStyle.xsl <xsl:template name="ImageGallery" match="Row[@Style='ImageGallery']" mode="itemstyle">      <xsl:variable name="SafeLinkUrl">         <xsl:call-template name="OuterTemplate.GetSafeLink">          <xsl:with-param name="UrlColumnName" select="'LinkUrl'"/>         </xsl:call-template>     </xsl:variable>                      <img src="{@LinkUrl}"/> </xsl:template>  Gallery page Next thing to do is to create and modify the web part page where the gallery will be shown. Edit the file in advanced mode in SharePoint Designer 2010 and just after the PlaceHolderMain opening tag add the following code (modify reference to your script files if needed): <link type="text/css" rel="stylesheet" href="../../Style Library/js/galleria.classic.css"/> <script type="text/javascript" src="../../Style Library/js/jquery-1.7.2.min.js"></script> <script type="text/javascript" src="../../Style Library/js/galleria.classic.min.js"></script> <script type="text/javascript" src="../../Style Library/js/galleria-1.2.7.min.js"></script> <script type="text/javascript"> $(document).ready(function(){     $(".gallery img").unwrap().unwrap();          $('.gallery').galleria({     width: 700,     height: 467 });     Galleria.loadTheme('../../Style Library/js/galleria.classic.min.js');'.gallery');  }); </script> This code will add reference to the files in Style library, JavaScript, CSS,… $(".gallery img").unwrap().unwrap(); unwraps the pictures form the <li> tag and <ul> tag which CQWP adds when it displays the pictures and needs to be done so that galleria can step in action and create the actual gallery. Galleria.loadTheme and just runs the galleria to create the picture gallery.  At the end of the page, just after the </asp:content> add the style tag, which will apply background, height and width to the gallery div of the Content Query Web Part. This was set in ContentQueryMain.xsl  <style type="text/css">     .gallery{     width:700px;     height: 472px;     background: #000;     margin:auto;     text-align:center;     } </style> Content Query web part On the page add the CQWP and Edit Web part. For the picture source select the picture gallery where your pictures are saved. You can also specify filter for the pictures. What is important in the CQWP settings is that you apply the ItemStyle you previously created in ItemStyle.xsl called ImageGallery. Save the CQWP settings, save the page and refresh it. And the final result is: Robert Vončina Kompas Xnet d.o.o.


SharePoint | SharePoint 2010 | Development

Send document as attachment from search results

by Robi 4. May 2012 11:13
Client of ours wanted to have a new functionality in search results so that users could send documents they find in search as attachments. So I began digging into xsl which search result core uses to display search result and come up with the following solution. To get to the xsl for search core web part you first need to enter something as a search query. Then on the search result page open Site Actions and then click Edit page In the Search Core results web part properties in the Display Properties clear the »Use Location Visualization« check box and then click on XSL Editor Click on XSL Editor and copy all of the contents to your favorite text editor like Notepad++ to view the contents more clearly Xsl:Param First thing you need to do is add additional parameter in the beginning of Search core XSL Xsl:template You need to create a new xsl template which has the same name as you xsl:param. I gave it a name »SendAsAttachment«. In this xsl template, I added a javascript function which creates new ActiveXObject. Link which makes a call to this function is only called for documents. That is why there are xsl:if statements which are checking the »site« string length and the size of the document. If both are greater than 0, a link is added. Xsl:call-template The final thing you need to do in Search core result xsl is to call your xsl:template. You need to do that in the "<div class="srch-Metadata2">" in the "<p class="srch-Metadata1">". I put my xsl:call template code just below the ViewInBrowser xsl template.   Now that you modified all the necessary you need to copy all of the text back to the XSL Editor in the search core result web part properties. Save the web part, save the page and the enter a search query. When you get back the results you should see the newly generated link beside your documents in the search results. If you click on the link, nothing will probably happen. This is because by default unsigned Active X scripts are disabled in the browser. If you want to be able to create new email with document as attachment, open Internet Options in your browser and go to Security Tab. Click Custom and then find "Initialize and script ActiveX controls not marked as safe…" If you choose prompt than you get a pop-up window: Just click Yes and new email with attachment and subject set as document title will be created. Hope this will be helpful to you as well. modified DefaultSearch Core.xml (25.83 kb)



Display members of AD group in SharePoint 2010

by Robi 9. December 2011 17:16
Hi, Because I got a question so many times if you can show members of AD groups on SharePoin site, I decided to build a web part that would replace the Site Users web part.   The usage is pretty simple, what you need to do is deploy a wsp package that you can find inside the bin\release folder.   Next step is to add a web part to your site and what you need to do is enter some information to access the Active Directory.   You need to enter: user name to connect to AD in the format: domain\username domain information for LDAP query in format of: DC=corp,DC=xnet,DC=si you need to enter FQDN of a domain controller to which the ldap query will be sent: Hopefully some one will find this web part usefull. You can find solution attached in a zip file.   For comments and suggestions please contact me at: THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.   There were some bug fixes so I published a new version of a Web Part.   Skupine Web (219.37 kb)


SharePoint | Development | SharePoint 2010

Crawl BCS Data

by Robi 29. June 2011 12:26
Hi, One of our clients wants to crawl data that they store in SQL Database so I created a new External Content Type to test the solution and gave it a name of TestSql. To crawl BCS content source, you need to give a default content access account or account you want to crawl you content source Execute permissions on External Content Type. Click on the Drop down and select Set Permissions. Add your search account and select Execute Permissions.   Next, you need to define new content source in Search Service Application administration. In order to do that, click on Content Sources category and then New Content Source. Give your Content source a meaningful name, select Line of Business Data and select BCS Service Application where you External Content type is saved. Create Crawl Schedules and perform a full crawl of your Content Source.  When full crawl is finished you can search for your line of Business data. Go to your portal site and search for your data. Notice that link to that data is somewhat strange.   To correct this "issue" you need to create Profile Pages for BCS Data. Go back to your BCS Service application and on the Ribbon, in the Profile Pages section click Configure. You need to specify SharePoint site to host Profile pages.  When Profile page host is created, you can now Create/Upgrade Profile page. Select External Content Type and click Create/Upgrade button. When operation is finished, perform a full crawl of this Content Source and you should now get results similar to this:   When you click on the link you get BCS Data directly from your SQL Server:   Hope it helps! Enjoy!




<<  September 2018  >>

View posts in large calendar

Page List

Month List