Jim Cantwell
in

InfoPath Dev

Jim Cantwell

  • Multiple Credential Prompts

    You may have come across SharePoint sites where you get repeated credential prompts.  Or, you get prompted multiple times setting up a data connection in your InfoPath form.  This issue cropped up with the introduction of Windows Vista and continues on with Windows 7 and most likely Windows 8.  The issue involves a fully qualified domain name (FQDN) being accessed with the WEBDAV protocol that SharePoint utilizes with client access.

    While the KB article indicates a hotfix is available, the fix has integrated into Windows 7 service packs for quite some time.

    The fix is to setup a registry key AuthForwardServerList with the list of FQDN sites that need to be treated as Local Intranet.  This allows your credentials to be pass through the communication layers and to the server you are authenticating against. 

    For complete details on the procedure, see KB 943280

  • Prevent the Open/Save dialog prompt when opening DBXL document from SharePoint 2010 site

    If you have added a dataview to list DBXL documents, you will find that links will give you an open/save prompt.  This little code snippet will prevent the dialog on a SharePoint 2010 page (it may also work for SharePoint 2007, but I haven't tried it).

    onclick="var b = StsOpenEnsureEx2('SharePoint.OpenXMLDocuments'); b.EditDocument2(window, '{@Link}', 'InfoPath.Document'); return false;"

    Also, check out Jo-Anne's blog on using a shared javascript file to do the same that will work for SharePoint 2007:

    http://www.infopathdev.com/blogs/jo-anne_alfafara/archive/2010/10/15/best-way-to-launch-forms-from-sharepoint.aspx

     

  • Configuring an Intranet/Extranet DBXL site for IPFS use

    You may have an internal SharePoint site which is extended to an Extranet or Internet zone.  A simple InfoPath browser form will work fine in both zones without modification.  But when you add data connections to connect to an external web service, such as DBXL, it can become problematic.  When using Alternate Access Mappings (AAM), SharePoint will redirect calls to any referenced internal url to the url of the site the user accesses the form.  Say you have an internal site http://sharepoint, and is extended to the extranet zone as http://portal.domain.com.  If your form has a data connection to http://sharepoint/QdabraWebService/DbxlDocumentService.asmx ,it will be redirected to http://portal.domain.com/QdabraWebService/DbxlDocumentService.asmx when opening the form from http://portal.domain.com

    When DBXL is installed, it is installed under the SharePoint site selected during installation.  In this scenario, it resides on http://sharepoint.  So when the form attempts to access it through http://portal.domain.com, it cannot be found.  To remedy this situation, and allow the browser form to submit without special casing the extranet scenario, you can create a QdabraWebService virtual directory under the extranet site which maps to the physical disk location of the QdabraWebService on the internal site.

    Creating the virtual directory will vary slightly between IIS6 and IIS7. 

    In IIS7:

    1) Open IIS Manager

    2) Right-click the extranet site, select "Add Virtual Directory"

    3) Provide the Alias "QdabraWebService" and physical path of the QdabraWebService under the internal site (e.g. C:\inetpub\wwwroot\wss\VirtualDirectories\80\QdabraWebService)

    4) Right-click the newly added QdabraWebService directory under the extranet site and select "Convert to Application"

    5) The DBXL webservice APIs are now available on the extranet site and an IPFS form using DBXL services should now function.

    In II6:

    1) Open IIS Manager

    2) Right-click the extranet site and select "New", "Virtual Directory"

    3) Provide the Alias "QdabraWebService" and physical path of the QdabraWebService under the internal site (e.g. C:\inetpub\wwwroot\wss\VirtualDirectories\80\QdabraWebService) and configure for "Read" and "Run Scripts" in the permissions dialog.

    4) The DBXL webservice APIs are now available on the extranet site and an IPFS form using DBXL services should now function.

    The document and template urls will not function on the extranet site.  Accessing http://portal.domain.com/QdabraWebService/Forms/MyForm/template.xsn will result in an HTTP 404 Not Found.    These access methods can be enabled by additional configuration of the virtual directory, but is not recommended.  IPFS forms should be opened from the SharePoint site to function properly in both intranet and extranet scenarios.

  • Integrating Qdabra DBXL with Nintex Workflow

    This document covers how to integrate the DBXL web service with Nintex Workflow 2010.  The scenario goes through saving an InfoPath form to a SharePoint library and then running a Nintex Workflow on the form, which submits the form to DBXL for shredding and further processing.

  • Best Practice for Database Redundancy with DBXL

    Large enterprises generally have redundancy mechanisms in place for critical SQL databases and are managed by an IT staff.  For those without the large IT staff to manage your systems, you may still need something more than nightly backups.  For high-availability without high cost,  SQL Server 2005 Standard and Enterprise Edition introduced database mirroring support.  Using a passive SQL Server to mirror the DBXL database, you can obtain high-availability without the need for an additional SQL Server license.  The SQL instance can be on an existing or new server (including VMs) with sufficient resources to host the database.   Just remember when using VMs, that failovers should reside on different physical hosts.  For additional information, refer to SQL Server 2005 Books Online topic “Overview of Database Mirroring”.

    SQL Server 2005 Workgroup does not support database mirroring but does support transaction log shipping, which is similar to asynchronous database mirroring.  For additional information, refer to SQL Server 2005 Books Online topic “Understanding Log Shipping”.

    Additional licensing information can be obtained here.

    Note: Qdabra DBXL has not been tested with automatic failover and may require manual failover configuration.

    Posted May 18 2009, 01:02 PM by ErnestoM with 1 comment(s)
    Filed under: ,
  • Pass Parameters to InfoPath

    There is sometimes the need to pass arguments to InfoPath when opening a form. You either want to switch to a specific view, or maybe want to turn on a diagnostic feature in your code. By leveraging the merge functionality of InfoPath, you can pass simple arguments or a complex set of data to your form.

    Define A Parameters Schema

    You will need to define a schema for your parameters. The example uses a simple repeating Param element containing name/value pairs like this:

    <Params>
        <Param name="" value="" />
    </Params>

    Enable Merge Functionality

    The next step is to enable the necessary merge functionality for your form. This is accomplished by editing the manifest.xsf as follows:

    <xsf:importParameters enabled="yes" useScriptHandler="yes"></xsf:importParameters>

    The enabled and useScriptHandler attributes of the importParameters element should be set to yes.

    Add OnMergeRequest/OnAfterImport Code

    The OnMergeRequest event is fired whenever a merge request is executed and merging is enabled in your form. If your form supports merges other than for parameter passing, this code will need modification to support that. This example expects a specific schema, and will just silently ignore any merge requests that do not use the expected schema. It is recommended to perform most work in OnAfterImport, as things like switching views cannot be done in the OnMergeRequest event.

    var g_fArgumentsPassed = false;
    var g_argsDOM = null;

    function XDocument::OnMergeRequest(eventObj)
    {
        var dom = eventObj.DOM;

        // Add your validation here that the DOM passed is the
        // schema expected, and only set eventObj.ReturnStatus to true
        // if a valid schema.
        if (dom.selectNodes("/Params/Param").nextNode())
        {
            g_fArgumentsPassed = true;
            g_argsDOM = dom;
        }
        // We silently ignore any bad requests by always setting the ReturnStatus to true
        eventObj.ReturnStatus = true;
    }

    function XDocument::OnAfterImport(eventObj)
    {
        if (g_fArgumentsPassed)
        {
            var nodes;
            var node;
            var paramName, paramValue;
           
            nodes = g_argsDOM.selectNodes("/Params/Param");

            while (node = nodes.nextNode())
            {
                paramName = node.selectSingleNode("@name").text;
                paramValue = node.selectSingleNode("@value").text;
                if (paramName == "Cancel")
                {
                    // Switch to cancellation view
                    XDocument.View.SwitchView("Cancel Order"); 
                }
                else if (paramName == "view")
                {
                    // Switch to requested view
                    XDocument.View.SwitchView(paramValue); 
                }
            }
            // Clear flag, as this could be called again if another merge is performed
            g_fArgumentsPassed = false;
        }
    }


    Test Your OnMergeRequest/OnAfterImport Code

    The simplest way to test your code is to use File | Merge Forms menu command. This menu option will be enabled after modifying your form's manifest.xsf as done above. If you are using the example parameter schema, create an XML file containing the content below, and select the file in the dialog presented when you use the Merge Forms command.

    <?xml version="1.0" encoding="UTF-8" ?>
    <Params>
        <Param name="Cancel" value="" />
    </Params>

    Opening a Document and Passing Parameters From a Web Page

    Installed with Microsoft Office is the "SharePoint.OpenXMLDocuments" object. The MergeDocuments2 method can be used to open a document or template and pass the URLs as merge files, which in this case will be a parameters file.

    This script below works in conjunction with a merge view of a SharePoint form library. When a single merge checkbox is selected, it will open the document using MergeDocuments2. A URL to the CancelParams.xml file containing the arguments to be passed as an argument to MergeDocuments2.

    <script>
    function CancelOrder()
    {
        var cItemsChecked = 0;
        var selectedOrder;

        var chkCombineCollection = document.all.chkCombine;
        for (i=0; i<chkCombineCollection.length; i++)
        {
            if (chkCombineCollection[i].checked)
            {
                selectedOrder = chkCombineCollection[i];
                cItemsChecked++;
            }
        }

        // Single item selected will not be a collection and can be determined when
        // the checked property is true
        if (cItemsChecked == 0 && document.all.chkCombine.checked)
        {
            selectedOrder = document.all.chkCombine;
            cItemsChecked = 1;
        }

        if (cItemsChecked != 1)
        {
            alert("Please select exactly one order to cancel.");
            return;
        }

        xmlDocObject = new ActiveXObject("SharePoint.OpenXMLDocuments");

        if (xmlDocObject)
        {
          var strTempLoc = "
    http://servername/Order Form/Forms/template.xsn"
          var strSaveLoc = "
    http://servername/Order Form";

          // This is the document collection which the MergeDocuments2 call takes
          // In this case, we are only passing one file containing the arguments
          var docCol = Array( {checked:true, HREF:"
    http://servername/Parameters/CancelOrder.xml"} );

          // Declare an iterator function for the collection of documents.
          function item(index)
          {
             return docCol[index];
          }

          // wrap the collection and the interator into an object suitable
          // for MergeDocuments2 call.
          var docWrap = {length:docCol.length, item:item};

          // If opening a new file, pass the url to the template instead of the document url
          xmlDocObject.MergeDocuments2(window, selectedOrder.HREF, docWrap, strSaveLoc);
        }

    }
    </script>

    Pass Parameters to InfoPath From the Command Line

    To pass parameters to InfoPath from the command line, you use the optional /aggregate switch. You may pass in multiple forms to the template, separating them with the pipe character: "|". You may use optional quotes around the entire list of forms, but not around each individual form.

    An example command line would look like the following:

    InfoPath.exe /aggregate "ParamFile1.xml|ParamFile2.xml|ParamFile3.xml" MyFormTemplate.xsn

Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.