Updating a Topic on a Web Server
THESE PAGES ARE STILL UNDER CONSTRUCTION AND DO NOT NECESSARELY REFLECT THE CURRENT VERSION OF TÓPICO
If your publication resides on a web site, you might prefer not spending your time between Tópico and your FTP software to make frequent updates to the web site. To ease this process, you can setup a small web service that will accept a relative file name and the published topic file content to save them on the server.
THIS TOPIC IS A WORK IN PROGRESS
Creating the Web Service in ASP.NET
To create this web service in ASP.NET, follow these steps:
- From within your ASP.NET project, right click on your project in the solution explorer;
- From the popup menu, select ;
- In the dialog box, select Web Service as the new item template;
- Type updatetopic.asmx as the file name;
- Click the button.
Click the image for a larger view
Programming the Web Service in ASP.NET
The web service needed to update a topic on a server is only a few lines of code. Once you got an empty Web Service template, set the namespace and add the UpdateTopic method, which is highlighted the following VisualBasic.NET code.
Imports System.Web Imports System.Web.Services Imports System.Web.Services.Protocols <WebService(Namespace:="http://www.formedia.ca/topico")> _ <WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _ <Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _ Public Class updatetopic Inherits System.Web.Services.WebService <WebMethod()> _ Public Function UpdateTopic(ByVal sFileName As String, ByVal sFileXml As String, ByVal sPassword As String) As String 'create xml document Dim xmldoc As New XmlDocument Try If sPassword = "USE_A_STRONG_PASSWORD" Then 'load the xml string xmldoc.LoadXml(sFileXml) 'save the file xmldoc.Save(Server.MapPath(sFileName)) 'return Return "ok" Else Return "bad password" End If Catch ex As Exception Return "error : " & ex.ToString End Try End Function End Class
VisualStudio 2003 will generate a template that is a bit different but the UpdateTopic method would be the same. Other platforms could also implement the same Web Service.
Setting up Tópico to use the web service
Back in Tópico, follow these steps to configure the Web Service.
- Select the Collection tab;
- Click the button;
- Enter the online Url of the publication;
- Enter updatetopic.asmx as the file name;
- Enter the password you set in the Web Service above.
When a Professional Edition user starts the program, Tópico checks if there is a Web Service URL. If there is one, Tópico tries to connect to the Web Service and display the publish to web button on the toolbar.
The relative path is the path you want to topic copied to, relative to the Web Service location. The password is to make sure only you can update the topic.
THESE PAGES ARE STILL UNDER CONSTRUCTION AND DO NOT NECESSARELY REFLECT THE CURRENT VERSION OF TÓPICO