Showing posts with label popup sharepoint 2010. Show all posts
Showing posts with label popup sharepoint 2010. Show all posts

Thursday, November 24, 2011

Series solutions on document management for officer - Part 1

SharePoint is a portal with the strength functionalities for collaboration and content management. There are a lot of new features to improve the activities of user and support the useful tools for almost kind of user who are using SharePoint 2010. That's perfect! However, Microsoft is always only build a framework and background technology for all their product and their partners will build a product as component or build a solutions to help IT Pros or IT Manager build up a service for their business. So, there are many companies only support the solutions or consult the customer by SharePoint administration expert. I've also consulted for some companies and build the solutions for a part of or whole their departments. The best things I have after finish every contract is how to fullfill the requirment while SharePoint features are not enough to reach all situations.

Luckyly, I am a developer. This is the only one advantage and I have to think about it. if I have a budget I just only buy some widgets or components from 3rd party and select the best product to match the requirements. I think this is not difficult but the most imprtant thing is how to mantain the product id there is many many products from another company and developer like me can not handle! In this series, I will show all you guys see some my opinions to solve a little taks but it's actually useful for IT managers, especially end-users.

This is a first topic to talk about requires' Officer, that is how to move a lot of document to another site. The limitation for free here are:

- Not support move multiple items, that mean these documents (files) still are in original list. They are not deleted after copy to new location.
- Not support overwrite method. If this feature is enable, the file is copied to the destination list will not overwrite instead of adding subfix "-(copy)"
- Not support copy the folders, it's avaible upon request.
- Not support cross-site, that means moving these files to another server farm.
- Not support sending to multiple sites

Here are the list of features in free version:
- Copy multilple items to onother location.
- All file types are supported.
- Support for both Foundation and Office Server
- Not need to install or activate Document Set feature.



Note: at the destination URL, please enter the short path, not including SitePage/Default.aspx or default.aspx

Trial version is available here. Download here. Hope this help.

Friday, October 14, 2011

Access denied for Anonymous users with custom xslt

SharePoint Bug

Sometime I had a stress with SharePoint customization, especially on XSLT data transform.
My scenarios is:
- Create a custom view for any list.
- Customize XSLT to render UI for my stituation.
My Problem is:
- With authenticated users, it works fine and smoothly
- Got a notice: Access denied. You do not have permission to perform this action or access this resource for Anonymous users.



I am a "SharePointism", so the first thing I looked into the SharePoint log file. it's very lucky, I got the message: "Error while executing web part: System.UnauthorizedAccessException: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))     at Microsoft.SharePoint.Library.SPRequest.UpdateWebPartCache(String bstrWebUrl, Boolean bAllUsers, String bstrID, Byte[]& ppsaData, Boolean fOMCall)     at Microsoft.SharePoint.WebPartPages.SPWebPartManager.CacheWriteInternal(Guid storageKey, Byte[] cacheData, Storage storage, Boolean omCall)     at Microsoft.SharePoint.WebPartPages.BaseXsltListWebPart.get_CustomizedXsl()     at Microsoft.SharePoint.WebPartPages.BaseXsltListWebPart.LoadXslCompiledTransform(WSSXmlUrlResolver someXmlResolver)     at Microsoft.SharePoint.WebPartPages.DataFormWebPart.GetXslCompiledTransform()     at Microsoft.SharePoint.WebPartPages.DataFormWebPart.PrepareAndPerformTra..."

Just guess that because I turned on the "Data Web Part Caching" and it seems turned on automatically. So, I disable (remove the checked) for this button. And....oh la la... it still doesn't work. However, we should not do like that because the message from SharePoint is not able to update "Cache". So, I tried to change the value CacheXslStorage="false" and ViewFlag="8", but it still end up with "Access denied".

However, i will work fine if there is an authenticated user view the blog detail first, then everybody can view this post without error. Maybe it's WAD or Bug of SharePoint 2010.

Update: We should not apply the cusomize xslt to ListXsltViewWebPart by UI in toolpane. We should open site by SPD, then change the property named "GhostedXslLink" is our customized xsl. This xsl is in layout/xsl folder of 14/hive. The content of this xsl file has reference to customized xslt.

Hope this help

Monday, October 10, 2011

Something in SharePoint (2007 & 2010)

There is a funny thing in SharePoint (in all versions)

1) List

With normal list the URL like http://server_name/site_name/Lists/List_Name
With documents list the URL like http://server_name/site_name/List_Name

2) Site

With normal site, all lists have the full controls on the list such as deleting, saving template,...
With blog site, the Posts list does not have permission to delete or save as the template and after save the blog site as template, we cannot restore the site correctly. All views of Posts list are generated as a list with the same name.

Wednesday, September 15, 2010

How to create a popup window like SharePoint 2010 popup

Everytime we want to create or configure out something on SharePoint 2010 site, Microsoft will show a popup window with the forms according to our action. It looks like:


So, if you want to use popup like SharePoint 2010, it's very easy, just copy and paste the code below:

<a href="javascript:NewItem2(event, your_url)">click example</a>

However, you will only get the default of windows size in the popup. If you want to resize that popup to be smaller or bigger, you must use another function.

<a href="javascript:OpenPopUpPageWithTitle(your_url, CallBackFunction, width, height, null)">Click example</a>

The code above just describe how to open the windows and execute the javascript code after window loading completely. Now, the another purpose is to execute an another javascript function after close window. how to?

You can custom this method with any actions as you want, here is example:

if (typeof SP.UI.Dialog.close == 'function') {
    var old = SP.UI.Dialog.close;
    SP.UI.Dialog.close = function(dlgResult) {
        //TODO: your code here
        //Remember that, your code must be executed before calling original method, because original method will close your popup before you perform something.
         old();
    }
}

Here are some method extracted from SP.UI.Dialog

.get_firstTabStop();
.get_lastTabStop();
.get_url();
.get_html();
.get_title();
.get_args();
.get_allowMaximize();
.get_showClose();
.get_returnValue();

.set_returnValue(value);

....
Good luck to you!