End Users Uploading Images / Videos to Asset Manager

87 views
Skip to first unread message

mbyis...@gmail.com

unread,
Mar 15, 2012, 10:34:36 AM3/15/12
to RedDot CMS Users
Is there a plug-in for Management Server (RedDot CMS) that allows end
users (not content editors, but actual visitors to the public website)
to upload images and videos into an Asset Manager folder on the CMS?

If not, how have others handled the task of allowing end-users to
upload images and videos?

We are currently building a tool using Vignette Collaboration (Open
Text Social Tools) which will allow end users (visitors to our public
site) to begin and manage their own blogs.

We are running Management Server v.10 as our CMS and deploying into
Delivery Server v.10.

Thanks in advance.

Michael Klosner,
Senior Developer

Jian Huang

unread,
Mar 15, 2012, 10:52:08 AM3/15/12
to reddot-c...@googlegroups.com
Hi Michael,

You mean like how it is done in http://www.solutionexchange.info/?

-Jian

Manuel Schnitger (OpenText)

unread,
Mar 15, 2012, 12:03:46 PM3/15/12
to RedDot CMS Users
Hi Michael,

there are at least two steps to do:
a) You have to transfer the image "somehow" from the PC of the end
user to Management Server. This is not something, that can be done by
the Management Server. But as I believe, that moxt script languages
are able to transfer files from a client PC to another PC (Management
Server), this should be something, that shoudn't be too hard.
b) As soon, as the file (image/video/any other format) is in the file
system of the Management Server, you can use RQL (RedDot Query
Language) in order to upload this file into a folder of the Asset
Manager.

Here is small script, that logs a user on to the Management Server >
lists all files in specific folder of the Management Server and then
uploads all files into a folder of the Asset Manager:

<%@ LANGUAGE="VBSCRIPT" %>
<% Option explicit %>
<% Response.Charset = "UTF-8" %>
<%
Server.ScriptTimeout = 36000
response.buffer = true

'******************************************************************
'** All rights reserved. **
'** Developer: M.Schnitger (ms...@reddot.de) **
'** Company: RedDot Solutions AG, Oldenburg, Germany **
'** Date: 10/2005 **
'** Project: "general" **
'** Modulname: FileUpload.asp **
'** RedDot-Version: 6.5 **
'** Release: 1.0 **
'** Copyright (c) RedDot Solutions AG 2006 **
'******************************************************************

'***************************************
'* Constants
'***************************************

const sPath = "c:\programme\RedDot\CMS\ASP\Icons\" ' where are
the images you would like to upload?
const sFolderGuid = "8DEDDCC6B612432BAB5A38A1D43D48AC" ' in which
folder would you like to upload the images?
const sName = "admin2" ' which
user should perform the action!!!
const sPassword = "admin2"
const sProjectGuid = "F34921CCFD3844F28867C22A345BCD7D" ' What is
the GUID of the project you'd like to upload the files?
dim sTempDir
dim sSubDirGuid
const sUserGuid = "635105CD89FA469683A2EEE87CBC564C" ' admin2
What's the name of the user, that shall perform the upload process?


sTempDir = session("TempDir")
response.write sTempDir



'************
'************


Response.Write "CurrentPath:<b> " & sPath & "</b><br>" &vbcrlf
'***************************************
'* List files in filesystem
'***************************************
dim sFiles,aFiles
sFiles = ListFiles(sPath)
aFiles = split(sFiles,",")

'***************************************
'* Login
'***************************************
dim sLoginGuid
sLoginGuid = Login(sName,sPassword)
Session("LoginGuid") = sLoginGuid


sTempDir = "c:\Programme\RedDot\CMS\ASP\RedDotTemp\" & sLoginGuid &
"\"



Response.write "LoginGuid: " & Session("LoginGuid") & "<br>" &vbcrlf

'***************************************
'* Validate
'***************************************
dim sSessionKey
sSessionKey = Validate(sLoginGuid,sProjectGuid)
Session("SessionKey") = sSessionKey

Response.write "SessionKey: " & Session("SessionKey") & "<br>"
&vbcrlf

'***************************************
'* File existing? If not > Upload file
'***************************************
dim i,sFileGuid,bFileAlreadyInFolder
for i = 0 to ubound(aFiles)
Response.Write aFiles(i) & "<br>" &vbcrlf
if aFiles(i) <> "" then
bFileAlreadyInFolder =
FileExisting(sFolderGuid,sFolderGuid,aFiles(i))
if NOT bFileAlreadyInFolder then
sFileGuid = UploadFile(sFolderGuid,sFolderGuid,sPath,aFiles(i))
Response.Write "<font color='brown'><b>File uploaded: " & sFileGuid
& "</font></b><br>" &vbcrlf
end if
end if
next

'***************************************
'* Update Folder
'***************************************
call UpdateFolder(sFolderGuid,sFolderGuid,sTempDir)

'***************************************
'* Logout
'***************************************
Logout sLoginGuid
Response.Write "<br>Logged out!<br>"&vbcrlf


'*****************************************************************************
'* List items in a given folder

'*****************************************************************************
function listFiles(sFolder)

Dim objFSO
Dim objFolder
Dim foundFile
Dim sFilename
dim sFilenames


Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.GetFolder(sFolder)

For Each foundFile In objFolder.Files
sFilename = foundFile.name
if left(sFilename,1) <> "~" then
sFilenames = sFilenames & sFilename & ","
end if
Next

listFiles = sFilenames

Set objFSO = Nothing

end function
'******************
'******************


'*************************************************************************
'* Check, if the file we'd like to upload is already existing
'* Wenn kein Subfolder befüllt werden soll, ist die Subfolderguid =
der
'* Folder Guid
'*************************************************************************
function FileExisting(sFolderGuid,sSubDirGuid,sSourcename)

'***************************
'* declare variables
'***************************

dim sSessionKey
dim sLoginGUID
dim RQLObject
dim RqlStatement
dim RqlRequest
dim sError
dim bFileAlreadyInFolder
dim XmlDomFile

'***************************
'* get session values
'***************************
sSessionKey = Session("SessionKey")
sLoginGUID = Session("LoginGUID")

'***************************
'* initialize objects
'***************************
set RQLObject =
Server.CreateObject("RDCMSAsp.RdPageData")
RQLObject.XmlServerClassName = XmlServerClassName
const XmlServerClassName = "RDCMSServer.XmlServer"
const DhtmlClassName = "RDCMSAsp.RdPageData"
const XmlDocumentClassName = "RDCMSXmlDom.RDDocument"
set XmlDomFile =
Server.CreateObject(XmlDocumentClassName)

bFileAlreadyInFolder = false


RQLStatement = "<IODATA loginguid=""" & sLoginGuid & """
sessionkey=""" & sSessionKey & """>"&_
"<PROJECT>"&_
"<FOLDER guid=""" & sFolderGuid & """
subdirguid=""" & sSubDirGuid & """>"&_
"<FILE action=""check"" sourcename=""" &
sSourcename & """ />"&_
"</FOLDER>"&_
"</PROJECT>"&_
"</IODATA>"
RQLRequest = RQLObject.ServerExecuteXml(RQLStatement, sError)
if sError>"" then Response.write "Error -> check
image:</BR></BR>"+sError

XmlDomFile.LoadXML (RQLRequest)

if
instr(XmlDomFile.ChildNodes("FOLDER").ChildNodes("FILE").GetNodeAttribute("newsourcename").AttributeValue,"(1)")
> 0 then
bFileAlreadyInFolder = true
end if


'Response.Write "<font color='lightblue'>" &
server.HTMLEncode(RqlStatement) & "</font><p>"
'Response.Write "<font color='navy'>" &
server.HTMLEncode(RqlRequest) & "</font><p>"

FileExisting = bFileAlreadyInFolder

end function
'**********
'**********


'*************************************************************************
'* Upload file
'* (it is assumed, that the files are already on the cms server)
'*************************************************************************
function UploadFile(sFolderGuid,sSubDirGuid,sSourcePath,sSourcename)

'***************************
'* declare variables
'***************************

dim sSessionKey
dim sLoginGUID
dim RQLObject
dim RqlStatement
dim RqlRequest
dim sError
dim sTempDir
dim sSubFolderGuid
dim XmlDomFile
dim sFileGuid


'***************************
'* get session values
'***************************
sSessionKey = Session("SessionKey")
sLoginGUID = Session("LoginGUID")

'***************************
'* initialize objects
'***************************
set RQLObject =
Server.CreateObject("RDCMSAsp.RdPageData")
RQLObject.XmlServerClassName = XmlServerClassName
const XmlServerClassName = "RDCMSServer.XmlServer"
const DhtmlClassName = "RDCMSAsp.RdPageData"
const XmlDocumentClassName = "RDCMSXmlDom.RDDocument"
set XmlDomFile =
Server.CreateObject(XmlDocumentClassName)


sTempDir = "c:\Programme\RedDot\CMS\ASP\RedDotTemp\" & sLoginGuid &
"\"


RQLStatement = "<IODATA loginguid=""" & sLoginGuid & """
sessionkey=""" & sSessionKey & """>"&_
"<MEDIA>"&_
"<FOLDER tempdir=""" & sTempDir & """ guid=""" & sFolderGuid &
""" subdirguid=""" & sSubDirGuid & """ filecount="""">"&_
"<FILE action=""save"" overwrite=""1"" sourcename=""" &
sSourcename & """ sourcepath=""" & sSourcePath & """/>"&_
"</FOLDER>"&_
"</MEDIA>"&_
"</IODATA>"
RQLRequest = RQLObject.ServerExecuteXml(RQLStatement, sError)
if sError>"" then Response.write "Error -> check
image:</BR></BR>"+sError

XmlDomFile.LoadXml(RqlRequest)

sFileGuid =
XmlDomFile.ChildNodes("FILE").GetNodeAttribute("guid").AttributeValue

'Response.Write server.HTMLEncode(RqlStatement) &
"<p>"
'Response.Write server.HTMLEncode(RqlRequest) &
"<p>"

UploadFile = sFileGuid
end function
'**********
'**********


'*********************************************************************************
'* Login
'*********************************************************************************
function Login(sName,sPassword)

'***************************
'* declare variables
'***************************
dim XmlDom
dim RqlObject
dim RqlStatement
dim RqlRequest
dim sLoginGuid
dim sError

'***************************
'* initialize objects
'***************************
set XmlDom =
Server.CreateObject("RDCMSAspObj.RdObject")
set RQLObject =
Server.CreateObject("RDCMSAsp.RdPageData")
RQLObject.XmlServerClassName = XmlServerClassName
const XmlServerClassName = "RDCMSServer.XmlServer"
const DhtmlClassName = "RDCMSAsp.RdPageData"


RQLStatement = "<IODATA>" & _
"<ADMINISTRATION action=""login"" name=""" & sName &
""" password=""" & sPassword & """/>" & _
"</IODATA>"
RQLRequest = RQLObject.ServerExecuteXml(RQLStatement, sError)
if sError>"" then Response.write "Login Error:</BR></
BR>"+sError

XMLDOM.LoadXml cstr(RQLRequest)

sLoginGuid = XMLDOM.objects("LOGIN")("guid")

Login = sLoginGuid

end function
'**********
'**********

'*********************************************************************************
'* Validate (connect to project)
'*********************************************************************************
function Validate(sLoginGuid,sProjectGuid)


'***************************
'* declare variables
'***************************
dim XmlDom
dim RqlObject
dim RqlStatement
dim RqlRequest
'dim sLoginGuid
dim sError
dim sSessionKey

'***************************
'* initialize objects
'***************************
set XmlDom =
Server.CreateObject("RDCMSAspObj.RdObject")
set RQLObject =
Server.CreateObject("RDCMSAsp.RdPageData")
RQLObject.XmlServerClassName = XmlServerClassName
const XmlServerClassName = "RDCMSServer.XmlServer"
const DhtmlClassName = "RDCMSAsp.RdPageData"

RQLStatement = "<IODATA loginguid=""" & sLoginGuid & """>"&_
"<ADMINISTRATION action=""validate"" guid=""" & sLoginGuid &
""" checkonly=""1"" useragent=""script"" >"&_
"<PROJECT guid=""" & sProjectGuid & """ />"&_
"</ADMINISTRATION>"&_
"</IODATA>"
RQLRequest = RQLObject.ServerExecuteXml(RQLStatement, sError)
if sError>"" then Response.write "An error has
occured:</BR></BR>"+sError

XMLDOM.LoadXml cstr(RQLRequest)

sSessionKey=XMLDOM.objects("SERVER")("key")

Validate = sSessionKey

end function
'**********
'**********

'*********************************************************************************
'* Logout
'*********************************************************************************
function Logout(sLoginGuid)


'***************************
'* declare variables
'***************************
dim XmlDom
dim RqlObject
dim RqlStatement
dim RqlRequest
dim sError

'***************************
'* initialize objects
'***************************
set XmlDom =
Server.CreateObject("RDCMSAspObj.RdObject")
set RQLObject =
Server.CreateObject("RDCMSAsp.RdPageData")
RQLObject.XmlServerClassName = XmlServerClassName
const XmlServerClassName = "RDCMSServer.XmlServer"
const DhtmlClassName = "RDCMSAsp.RdPageData"

RQLStatement = "<IODATA loginguid=""" & sLoginGuid & """>"&_
"<ADMINISTRATION>"&_
"<LOGOUT guid=""" & sLoginGUID & """ />"&_
"</ADMINISTRATION>"&_
"</IODATA>"
RQLRequest = RQLObject.ServerExecuteXml(RQLStatement, sError)

if sError>"" then Response.write "Logout Error"+sError

end function
'**********
'**********


'*********************************************************************************
'* Update Folder (thumbnails)
'*********************************************************************************
function UpdateFolder(sFolderGuid,sSubDirGuid,sTempDir)


'***************************
'* declare variables
'***************************
dim XmlDom
dim RqlObject
dim RqlStatement
dim RqlRequest
dim sError
dim sUserGuid

'***************************
'* initialize objects
'***************************
set XmlDom =
Server.CreateObject("RDCMSAspObj.RdObject")
set RQLObject =
Server.CreateObject("RDCMSAsp.RdPageData")
RQLObject.XmlServerClassName = XmlServerClassName
const XmlServerClassName = "RDCMSServer.XmlServer"
const DhtmlClassName = "RDCMSAsp.RdPageData"

RQLStatement = "<IODATA loginguid=""" & sLoginGuid & """
sessionkey=""" & sSessionKey & """>"&_
"<MEDIA>"&_
"<FOLDER guid=""" & sFolderGuid & """ subdirguid=""" &
sSubDirGuid & """ action=""updatecatalog"" tempdir=""" & sTempDir &
""" userguid=""" & sUserGuid & """ subject=""""
updatethumbnails=""0"" />"&_
"</MEDIA>"&_
"</IODATA>"
RQLRequest = RQLObject.ServerExecuteXml(RQLStatement, sError)

if sError>"" then Response.write "Logout Error"+sError


response.write "<p><font color='red'>" &
server.htmlencode(rqlstatement) & "</font><hr>"
response.write "<font color='green'>" &
server.htmlencode(rqlrequest) & "<p>"

end function
'**********
'**********
%>

Best regards,
Manuel

P.S.: If you need to know more about RQL programming, then maybe this
blog might be a good start ;-) http://manuelschnitger.wordpress.com

On 15 Mrz., 15:34, "mbyisra...@gmail.com" <mbyisra...@gmail.com>
wrote:

mbyis...@gmail.com

unread,
Mar 15, 2012, 12:23:16 PM3/15/12
to RedDot CMS Users
Hi Jian,

I see images on the Soultion Exchange, but it doesn't seem to me that
end users are uploading them. What I am looking for is a solution
whereby end users, who have no access to Management Server CMS, can
upload images and videos.

Thanks,
Michael

On Mar 15, 10:52 am, Jian Huang <jhuangsoftw...@gmail.com> wrote:
> Hi Michael,
>
> You mean like how it is done inhttp://www.solutionexchange.info/?

Manuel Schnitger (OpenText)

unread,
Mar 16, 2012, 3:24:37 AM3/16/12
to RedDot CMS Users
Hi Michael,

all images of all solutions at SolutionExchange were uploaded by end
users. Just create a solution page and try to upload images. If this
is then, what you want, you should contact Danny, as he has set up the
environment.

Best regards,
Manuel

On 15 Mrz., 17:23, "mbyisra...@gmail.com" <mbyisra...@gmail.com>
wrote:

mbyis...@gmail.com

unread,
Mar 16, 2012, 4:25:24 PM3/16/12
to RedDot CMS Users
OK, Thank you Manuel. I will look into it. And thanks for the RQL
code.

-Michael
Reply all
Reply to author
Forward
0 new messages