Wednesday, June 29, 2005

Backup/Restore wss sites: using smigrate

1. Use smigrate to backup a site .
Example syntax: smigrate -w http://sps/sites/example -f d:\bckp\backup.fwp

2. Use a Cabinet decompression utility such as EXTRACT to decompress all of the files out of the FWP file.
You can get the EXTRACT utility from the Microsoft CAB SDK at: http://msdn.microsoft.com/library/en-us/dncabsdk/html/cabdl.asp, althoughany utility that can decompress CAB files will suffice.

Example syntax: EXTRACT /A /E backup.fwp /L c:\files

3. Browse to the "files" folder and open the manifest.xml file.

4. Change location (LCID) and language settings and any custom list type entries to built-in list type entries.
For example, to turn location and language settings:
vti_defaultlanguage="SWde"tovti_defaultlanguage="SRen-us"
Same thing with keys "LCID" Value "1033" - is for US"1031" is for DE (search for string 1031\ and replace it with 1033\)

5. Save your changes.

6. Use a Cabinet compression utility such as CABARC to compress all of the files in the "files" folder into a FWP file.
You can get the CABARC utility from the Microsoft CAB SDK at: http://msdn.microsoft.com/library/en-us/dncabsdk/html/cabdl.asp, although any utility that can generate CAB files will suffice.

Example syntax: CABARC N backup.fwp c:\files\*.*

7. Use smigrate to restore the fixed FWP file to a new site but first you have to create a project site without using a template.

Example syntax: smigrate -r -w http://sps/sites/example -f backup.fwp

Note that each site has its own manifest file.
If you don't use the "-e" switch with smigrate during the backup, then smigrate will also backup allof the sites below the one you specify.
If that happens, you will need to alter the manifest file for each site in the FWP below the one you specified.
You can find the manifest files for a site's immediate child sites listed in the "" section in the manifest file.
Sometimes you see greater font size then excepted. Open site default.aspx in frontpage and edit it.
In html code search after /1031/ows.css and change it to /1033/ows.css.

Generally I publish things that i have not found easily, but always those things are published because are useful to me. In that case i found it easily on the Tarik Eker Blog, but i published it on my blog as a fast ShorCut to me.

Wednesday, June 15, 2005

OnSaveRequest Event tip

OnSaveRequest Event

Occurs when the save operation is invoked from the Microsoft Office InfoPath 2003 user interface or by using the Save or SaveAs method of the XDocument object in the InfoPath object model.
Function XDocument::OnSaveRequest(ByRef pEvent As SaveEvent)
pEvent Required SaveEvent. A reference to the SaveEvent object.
Remarks
If the ReturnStatus property of the SaveEvent object is set to False, InfoPath cancels the save operation. If an error occurs in the code for the OnSaveRequest event handler, InfoPath ignores the error and relies on the ReturnStatus property of the SaveEvent object. If the ReturnStatus property is not explicitly set, the default value of False is used.
The ReturnStatus property works in conjunction with the IsCancelled property when the InfoPath form is closing. If the document has changes that have not been saved and the user cancels the save operation, the IsCancelled property can be set to True to allow InfoPath to close.
Note This object model member is not supported when the Disable Service Pack features option on the Advanced tab of the Options dialog box in InfoPath is selected or when Microsoft Office 2003 Service Pack 1 or later is not installed. Any form that implements this object model member in its code will generate an error message if it is opened in InfoPath when service pack features are disabled or unavailable.
Example
In the following example, the OnSaveRequest event handler is used to create an XMLHTTP object for transporting the form's underlying XML document:function XDocument::OnSaveRequest(eventObj)
{
// Write the code to be run before saving here.
XDocument.UI.Alert("Begin saving form.");
eventObj.IsCancelled = eventObj.PerformSaveOperation();
// Write the code to be run after saving here.
XDocument.UI.Alert("Form saved.");
eventObj.ReturnStatus = true;
}


I 'd like to add that it is needed a little configuration item so as to that event be fired, because you 'll have the problem that the event is not fired.

You must do some steps:

At Design Mode of your Infopath Form
Go to Tools/Form Options menu
On the Open & Save Tab, On the Save behavior section, check the "Save using custom code" option.

Thursday, June 09, 2005

Sharepoint Events

Today i needed to trap some events on a Sharepoint Document Library

And i found this sample that works fine.

Take a look at

http://msdn.microsoft.com/office/understanding/sharepoint/articles/default.aspx?pull=/library/en-us/odc_SP2003_ta/html/sharepoint_wsseventing.asp#odc_sharepoint_wsseventing_enablingeventsfordocumentlibraries