tes

http://sharepointworks.blogspot.com/2009/05/repairing-supporting-files-sharepoint.html

Repairing Supporting Files: “SharePoint alerts doesnt work” & “Invalid page URL”

Symtoms:
We have the form customized and ready and working but suddenly… just when we are going to make use of the alert system of Sharepoint, it doesn't work, throwing the message "Unknown error" when trying to subscribe to an alert.
The option for New, Display or Edit list items makes the error: "Invalid page URL".

Cause:
The bad functionality of these alerts is related with the messages "Invalid page URL" when creating a newListItem or the error "An unexpected error has occurred" when we do click in the edition of a listItem. They both produce when corrupting a Sharepoint List though the Supproting files remain unconfigured.
The problem happens when customizing an ASPX page like editform or newform, because we have deleted the ListFormWebPart which comes by default.

Correct customization procedure (Official):
If you want to customize the controls which appear in the NewForm.aspx and don't want to show the ListFormWebPart which appears by default, we can hide it instead of deleting it following these steps:

1. Start Sharepoint Designer 2007 and open the NewForm.aspx page from the list.
2. Right click on the ListFormWebPart and then click Web Part Properties.
3. Expand Layout, click on the checkbox "Hidden" and finally click "OK".

Procedure for repairing a screwed page or list:
The old procedure was… delete the list and create it again for personalize it later using the procedure, but there is another way.

1. Open the NewForm.aspx, EditForm.aspx and DispForm.aspx in the Sharepoint Designer.

2. Search the following tag: <WebPartPages:WebPartZone runat="server" FrameType="None" ID="Main" Title="loc:Main"><ZoneTemplate> in the screwed page.

3. Paste between the tags <ZoneTemplate> Paste here <ZoneTemplate> this code:

<WebPartPages:ListFormWebPart runat="server" __MarkupType="xmlmarkup" WebPart="true" __WebPartId=" {MY NEW GENERATED GUID}" >
<WebPart xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.microsoft.com/WebPart/v2">
<Title> LIST NAME</Title><FrameType>None</FrameType><Description /> <IsIncluded>true</IsIncluded><PartOrder>1</PartOrder><FrameState>Normal</FrameState> <Height /> <Width /><AllowRemove>true</AllowRemove> <AllowZoneChange>true</AllowZoneChange><AllowMinimize>true</AllowMinimize><AllowConnect>true</AllowConnect><AllowEdit>true</AllowEdit> <AllowHide>true</AllowHide><IsVisible>false</IsVisible> <DetailLink /> <HelpLink /><HelpMode>Modeless</HelpMode><Dir>Default</Dir> <PartImageSmall /> <MissingAssembly>Cannot import this Web Part.</MissingAssembly><PartImageLarge /> <IsIncludedFilter /><ExportControlledProperties>true</ExportControlledProperties>
<ListName xmlns="http://schemas.microsoft.com/WebPart/v2/ListForm"> {MY SHAREPOINT’S GUID FROM THE LIST}</ListName>
<ListItemId xmlns="http://schemas.microsoft.com/WebPart/v2/ListForm">0</ListItemId>
< ControlMode xmlns="http://schemas.microsoft.com/WebPart/v2/ListForm"> Edit</ControlMode> <TemplateName xmlns="http://schemas.microsoft.com/WebPart/v2/ListForm">ListForm</TemplateName>
< FormType xmlns="http://schemas.microsoft.com/WebPart/v2/ListForm"> 6</FormType><ViewFlag xmlns="http://schemas.microsoft.com/WebPart/v2/ListForm">1048576</ViewFlag>
<ID>g_ MY_NEW_GUID_REPLACING_DASHES_BY_LOW_DASHES</ID> </WebPart></WebPartPages:ListFormWebPart>

4. In the line of <ControlMode if the page is:
EditForm we have to put Edit
NewForm we have to put New
DispForm we have to put Display

5. In the line of <FormType if the page is :
EditForm we have to put 6
NewForm we have to put 8
DispForm we have to put 4

6. In the line <ListName we have to put the GUID of the Sharepoint's List that we are repairing. Also change <Title putting the name of the list.
(It can be obtained in the Sharepoint Site by customizing the list or in "Site Settings > Site Libraries and Lists" and looking in the link of customize of the list appears the GUID, right clicking and copying the direct access)

The line would stay like this:
<ListName xmlns="htp:// schemas.microsoft.com/WebPart/v2/ListForm">{046F5668-1891-4781-9B44-90AC0C0B600A}</ListName>

7. Generate a new GUID with guidgen.exe or using the page: http://www.somacon.com/p113.php

8. In the line <ID put the new GUID replacing the dashes by low dashes leaving a "g_" in the beginning. Example: If the GUID is 870850be-fd2c-44d6-818e-ab2914fb2d71 it should stay like this g_870850be_fd2c_44d6_818e_ab2914fb2d71

9. Save (I don't recommend to save before), it is possible that you must close and open again the page to see the result of the reparation.

10. Repeat this same operation for the pages NewForm.aspx, EditForm.aspx, DispForm.aspx and all of the attachments of Supporting Files will stay repaired. By this point we would have repaired the list, the alerts, the RSS and the actions of New, Edit and Display so:

Everything will work properly

 

http://kartooz.wordpress.com/

SharePoint Content Approval – Never ending workflow

The Content Approval feature permits you to create a list or a document library where items or files that are submitted by users are not visible to other site users until the items or the files are approved by a user (such as the site administrator) who belongs to a site group that has the Manage Lists right.

When you add a new item or when you modify an existing item in a list or a document library after you enable content approval for that list or document library, the item is marked as Pending. Pending items are only visible to the user who created or modified the item and to users with the Manage Lists right. Pending items are not visible to users until the item is approved. When an item is approved, it is marked as Approved and is visible to all users. When an item is rejected, it is marked as Rejected, and is returned to the user who created it.

 

Use a workflow to manage content approval for a library

You can use a workflow to manage content approval (also called moderation) in libraries for which content approval is required.

Enabling OOTB Approval workflow for a list:

tes

 

tes

The Problem : 

In a SharePoint list after you are done with enabling content approval and creating an OOTB approval workflow, you might experience a strange behavior during the approval process.

The workflow can run endlessly. Every time the workflow task is approved, it triggers a Item Updated event which in turn starts another instance of the workflow…So the item remains pending even after the approval ! (After the workflow instance completes another instance is started because of the item updated event triggered by the workflow approval.

This happens in the list. The reason for the difference in behavior is the way the workflow setup is done for the list and document library. We will come to the settings in the library shortly.

The workaround Solution:

The solution is to handle the ItemUpdated event and update the Moderation status programmatically after turning off the event. The code is listed below.

  
    
class UpdateWorkflowStatus : SPItemEventReceiver
{
public override void ItemUpdating(SPItemEventProperties properties)
{
EventLog m_EventLog
= new EventLog( "" );
m_EventLog.Source
= " Approval Workflow Status Update " ;
try
{
base .ItemUpdating(properties);
if (properties.AfterProperties[ " _ModerationStatus " ] != null && properties.ListItem[ " _ModerationStatus " ] != null )
{
if (properties.AfterProperties[ " _ModerationStatus " ].ToString() != properties.ListItem[ " _ModerationStatus " ].ToString())
{
this .DisableEventFiring();
properties.Status
= SPEventReceiverStatus.CancelNoError;
properties.ListItem[
" _ModerationStatus " ] = properties.AfterProperties[ " _ModerationStatus " ].ToString();
properties.ListItem.Update();
this .EnableEventFiring();
}
}
}
catch (Exception ex)
{
m_EventLog.WriteEntry(
" Workflow Status Update Event Handler Error : " + ex.Message,EventLogEntryType.Error);
}
}
}

The reason why it won’t happen in a document library is that the way the settings are done. In a document library for the content approval minor and major version has to be enabled. And any edit that happens becomes a minor version and a workflow gets triggered only when the major version is published.

tes

tes

BUT ! there is a way to reproduce it in document library as well. You should create the workflow first and then enable content approval, you will end up in the same problem that I explained for the list !!!

 

你可能感兴趣的:(T)