Custom List Or Form Library Integration? Advice? - InfoPath Dev
in

InfoPath Dev

Custom List Or Form Library Integration? Advice?

Last post 04-03-2006 07:46 AM by wlarimore. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 03-22-2006 11:53 AM

    Custom List Or Form Library Integration? Advice?

    I need help in figuring this out for my current project. I keep going back and forth on how I want to create my InfoPath solution. I pretty much have settled on a Managed Code VS2005 solution. The requirements are we want a tight integration with Sharepoint. At first we tackled it from the angle of establishing a Custom List and maintaining it with managed code via SPS Lists. But then I started playing around with Form Libraries and saw how integrated the Rich Text and File Attachment handling is - less coding needed.
    So, Which Is The Better Approach - Form Libraries or Custom List?

    Here's some of my requirements in a nutshell:

    fyi - We have a need for role based security - Administrator, Contributor, Reader (we maintain this info in a SQL 2005 db).

    Administrators can...
    create a document in any category
    modify any document
    delete any document in any category

    Contributors can...
    create a document in any category which he has security access
    modify a document in any category which he has security access

    I currently am finding out the userid by this line of code:
    Private thisUserName As String = Environment.UserName

    I figure I can perform the role validations based off of that value. Do y'all agree that a Form Library is the best approach? Will this work with a Deployed Form Template (xsn) into a Sharepoint Form Library?

    Thanks in advance,
    -Wayne

  • 03-24-2006 01:21 AM In reply to

    Re: Custom List Or Form Library Integration? Advice?

    Hi Wayne

    i think we'll need more info on exactly what it is you want to achieve in your solution, before being able to answer your question.

    Custom lists gives you the freedom to publish interrelated data across an entire site (for example you could have several custom lists that had lookup columns to each other based on repeating sections in your IP form). This (submitting to several custom lists/ document libraries) can only be achieved throug custom code.

    In Form libraries you are more limited in your approach. You can choose what IP fields to exhibit and then submit the xml file to that list.

    I dont see any differences in the two approaches regarding security.

    hth
  • 03-24-2006 02:12 AM In reply to

    Re: Custom List Or Form Library Integration? Advice?

    Why are you maintaining security roles outside of SharePoint where it is a builtin feature that does not required any coding to maintain or customize?
    Dean
    Charlotte, NC
  • 03-28-2006 08:46 AM In reply to

    Re: Custom List Or Form Library Integration? Advice?

    AndersR, thanks for your input.

    dlgross, because the security roles are tied to each category that defines the document. For example:

    Sally Jane has Contributor rights to Category Alpha

    The Form will dynamically react (disable/enable) upon Category Selection by the user. Unless I'm missing something I don't believe Sharepoint provides that level of security.
  • 04-03-2006 07:46 AM In reply to

    Re: Custom List Or Form Library Integration? Advice?

    I thought I'd add more to this topic to let it evolve further. The things that I am trying to achieve are this:

    - The Form must have category specific security (as stated above)
    - The user must be able to enter Rich-Text content in one of the controls (a bit tricky with a custom list and managed code)
    - The user must be able to click on the link in SharePoint and it pull up the Form Document (we couldn't figure out how to do this with a custom list)
    - all other validations are trivial in InfoPath

    At the same time we are converting the clients existing data from Lotus Notes (Domino) into Sharepoint. The tool that our conversion specialist is using migrates to custom lists fine, but not form libraries (.xml). Also, the tool doesn't handle tables and images from rich text going into a custom list - so that is still needing attention going into Sharepoint (via managed code).

    I have successfully created the piece within InfoPath that reads in the Custom List but I cannot figure out how to programmatically Save / Post each record in the list in an automated fashion to a Form Library. I keep running into dead ends. My approach is to fill in an infopath form for each custom list record and have infopath Submit or Save it.

    Here's some code snippets I have so far (for conversion):


    '---
    'Code block of custom list retrieval left out for brevity
    '---
    Dim doc As XmlDocument = New XmlDocument
    doc.LoadXml(Replace(xmldata.InnerXml, ControlChars.Lf & ControlChars.Lf, ""))
    Dim nsmgr As XmlNamespaceManager = New XmlNamespaceManager(doc.NameTable)
    nsmgr.AddNamespace("z", "#RowsetSchema")
    nsmgr.AddNamespace("rs", "urn:schemas-microsoft-com:rowset")
    Dim node As XmlNode
    Dim xs As XmlNodeList = doc.SelectNodes("/rs:data", nsmgr)

    Dim xl As XmlNodeList = doc.SelectNodes("/rs:data/z:row", nsmgr)
    For Each node In xl

    For i As Integer = 0 To node.Attributes.Count - 1

    Select Case node.Attributes(i).Name

    Case "ows_Title"
    thisXDocument.DOM.getElementsByTagName("my:title").Item(0).text = CheckForNothing(node.Attributes("ows_Title").Value)
    Case Else
    'additional left out for brevity

    End Select

    Next
    '*** Here's what I thought would work
    '--- it throws error (access is denied - huh?)
    thisXDocument.DOM.save("http://someserver.abcd.com/SP%Database/SP%20Database%20Library/Forms/" + _
    thisXDocument.DOM.getElementsByTagName("my:title").Item(0).text + ".xml")

    '*** Here's my first attempt - no dice
    'thisXDocument.Submit()

    '*** I even tried with a Submit Data Connect to SP
    'thisXDocument.DataObjects("Submit SharePoint Form Library").Query()

    '*** I found this on the web - gives security error as well
    'Dim HttpReq As New MSXML2.XMLHTTP40
    'Dim strUrl As String = "http://someserver.abcd.com/SP%20Database/SP%20Database%20Library/Forms/"
    'Dim strFileName As String = thisXDocument.DOM.getElementsByTagName("my:Title").Item(0).text + ".xml"
    'HttpReq.open("HEAD", strUrl & strFileName, False)
    'HttpReq.send()

    ''*** If XML Document was not found then Publish it
    'If HttpReq.status = 404 Then
    ' HttpReq.open("PUT", strUrl & strFileName, False)
    ' HttpReq.send(thisXDocument.DOM.xml)
    ' If HttpReq.status = 200 Or HttpReq.status = 201 Then
    ' '*** Successful Posting
    ' End If
    'End If

    Next


    Any help or input would be appreciated.
Page 1 of 1 (5 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.