08-27-2008 01:10 PM
<cffunction name="getTicket" returntype="string">
<cftry>
<cfhttp url="#APPLICATION.alfrescoRoot#/service/api/login?u=#APPLICATION.alfrescoUsername&pw=#APPLICATION.alfrescoPassword" method="GET">
<cfdump var="#XmlParse(Trim(cfhttp.FileContent))#">
<cfscript>
xmlTicketResponse = XmlParse(Trim(cfhttp.FileContent));
ticket = xmlTicketResponse.ticket.xmlText;
return ticket;
</cfscript>
<cfcatch type="any">
<cfset message = "components.titlemanager.alfresco.getTicket() failed.">
<cflog application="false" file="#APPLICATION.logfile#" type="error" text="#message#">
</cfcatch>
</cftry>
</cffunction>
<cffunction name="createPublisher">
<cfargument name="publisher_name" type="string">
<cfargument name="publisher_id" type="Numeric">
<cftry>
<cfset ticket = getTicket()>
<cfoutput>#APPLICATION.alfrescoRoot#/service/createPublisher?publisherName=#URLEncodedFormat(ARGUMENTS.publisher_name)#&publisher_id=#ARGUMENTS.publisher_id#&ticket=#ticket#</cfoutput>
<cfhttp url="#APPLICATION.alfrescoRoot#/service/createPublisher?publisherName=#URLEncodedFormat(ARGUMENTS.publisher_name)#&publisher_id=#ARGUMENTS.publisher_id#&ticket=#ticket#"
method="GET">
<cfdump var="#cfhttp.FileContent#">
<cfcatch type="any">
<cfset message = "components.titlemanager.alfresco.createPublisher failed. publisher_name: #ARGUMENTS.publisher_name#, publisher_id: #ARGUMENTS.publisher_id#">
<cflog application="false" file="#APPLICATION.logfile#" type="error" text="#message#">
</cfcatch>
</cftry>
</cffunction>
<webscript>
<shortname>Create publisher</shortname>
<description>Create publisher folder</description>
<url>/createPublisher?publisherName={publisherNameArgument}&publisherId={publisherIdArgument}</url>
<url>/createPublisher.xml?publisherName={publisherNameArgument}&publisherId={publisherIdArgument}</url>
<format default="xml">argument</format>
<authentication>user</authentication>
<transaction>required</transaction>
</webscript>
05-14-2009 03:49 PM
05-20-2009 11:25 AM
02-07-2011 08:01 PM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.