Click to See Complete Forum and Search --> : Help


curioususer
07-08-2003, 12:10 PM
Hey everyone I am using the code i have below to access docushare (minus the serverurl username and passwords) and i need some help when i use the page the select box comes up empty any ideas on why?



ML>
<HEAD>
<TITLE>File Pick List</TITLE>
</HEAD>
<BODY BGCOLOR="#000000" TEXT="#ff0000" LINK="#FF0000" VLINK="#800000" ALINK="#FF00FF" BACKGROUND="?">
<!-- #Include File="CDocushare.asp" -->

<%
Dim RootContext, ds, arr, i

Set ds = New CDocushare

ds.Login "*******", "*******", "*****docushare/"

arr = ds.GetCollectionfiles(157)
For i = 0 To UBound(arr)
Response.Write arr(i).Title & "<br>"
Next

Response.Write "<p align=center><b>Project Context: " & RootContext & "</b></p>"
%>
<FORM ACTION="Attributes.asp" METHOD=post>
<table border="1" cellspacing="1" cellpadding="1" summary="File Pick List Formatting" width="100%">
<caption><em>Pick The Files and Destination Location</em></caption>
<tr>
<td>
<SELECT NAME="PickFiles" MULTIPLE SIZE="8" length="100">
<%
For i = 0 to Ubound(arr) %>
<OPTION value="<%= arr(i).Title %>">
<%
Next
%>
</SELECT><br>
Source Files
</td>
<td>
<INPUT TYPE="reset" NAME="resetForm" VALUE="Reset"><br>
<INPUT TYPE="submit" NAME="submitList" VALUE="Add Files">
</td>
<td>
Destination Location
</td>
</table><INPUT type=hidden name=Project value=<% = RootContext %>>
</FORM>
</BODY>
</HTML>

curioususer
07-10-2003, 09:12 AM
Thanks Dave... :D
and if you have time I have another question...

I am using recursion to go through folders which are called collections in docushare and I need to create a way to put them in a tree or a select box somehow so the user can pick one to send the chosen file to. i can pull the names of the files and all im just not sure the best setup for them to pick the files with. any ideas would be appreciated! here is the snippet used for listing the files...

<%
Set rootCollection = ds.GetCollection(**)
rootCollection.DSLoadProps
'Call the recursive listing
ListCollection rootCollection

'Recurse through folders
Function ListCollection(oCollection)
Dim childEnum, counter, childCollection, childFile
'Do something with the parent here
Response.Write oCollection.Title & "<BR>"
'Get a list of the child collections of this collection
childEnum = ds.GetCollectionCollections(oCollection.HandleNum)
'Order the collections by name - Docushare kindly leaves this up to us.
OrderByTitle childEnum
'Loop through the children
For Each childCollection In childEnum
'Call this function for each child collection
ListCollection childCollection
'Free memory after finishing up with the child
Set childCollection = Nothing
Next
End Function

'Order an array of IItemObj's
Sub OrderByTitle(ByRef oArray)
Dim counter, insert, temp
For counter = 1 To UBound(oArray)
Set temp = oArray(counter)
For insert = counter-1 To 1 Step -1
If temp.Title > oArray(insert).Title Then
Set oArray(insert+1) = temp
'Don't move anything else...move on to next item
Exit For
Else
'Bump back this object
Set oArray(insert+1) = oArray(insert)
End If
Next
Next
End Sub
%>