I finished the documentation on our MediaElement repository integration in Web Site Management 11 SP1. It can be found in the Web Site Management Community within the OpenText Knowledge Center. It's a wiki and is open to be changed by you ;-)
I'm eagerly waiting for feedback on the documentation. Is it understandable? Is something missing?
Posts mit dem Label Interfaces werden angezeigt. Alle Posts anzeigen
Posts mit dem Label Interfaces werden angezeigt. Alle Posts anzeigen
Mittwoch, 9. Januar 2013
Montag, 4. Juli 2011
Using PDF 1.6 With OpenText Web Site Management Asset Manager
Reading metadata from PDF 1.6 documents in the released OpenText Web Site Management Server
versions is not working at the moment, as a quite old 3rd party component (pdfinfo.exe) used by the
AssetManager is not supporting newer PDF versions.
There is a pretty easy way to come around this limitation. All you need is the freely available
iTextSharp library and this small piece of code to create a console application called PDFInfo.exe
that behaves like the old version, but can handle the newest PDF versions:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using iTextSharp.text.pdf;
namespace PDFInfo
{
class PDFInfo
{
static void Main(string[] args)
{
PdfReader reader = new PdfReader(args[0]);
Dictionary<string,string> infos = reader.Info;
foreach (string key in infos.Keys)
{
string value = infos[key];
switch (key) {
// check if the date has to be transformed otherwise
case "CreationDate":
case "ModDate":
value = value.Replace("D:","");
value = value.Trim();
break;
}
Console.WriteLine("{0}: {1}",key.ToLower(),value);
}
Console.WriteLine("Pages: {0}",reader.NumberOfPages);
Console.WriteLine("Encrypted: {0}",reader.IsEncrypted() ? "yes" : "no");
}
}
}
A full featured sample can be downloaded here. Please be aware that this
sample is using iTextsharp that is licensed under the Affero General Public License.
To actually use this small console program in your Web Site Management Server, build the console
app and copy the .exe file into your %RDCMS%\MediaCatalog folder. Please make a backup copy of
the old before.
Please also note that WSM is only executing the process for 5 seconds. If the process needs more
time, e.g. with large documents, the process will be killed and no metadata is read. There is no
configuration possibility to change this threshold value.
The sample is provided without any warranty. Please try it on your own risk.
versions is not working at the moment, as a quite old 3rd party component (pdfinfo.exe) used by the
AssetManager is not supporting newer PDF versions.
There is a pretty easy way to come around this limitation. All you need is the freely available
iTextSharp library and this small piece of code to create a console application called PDFInfo.exe
that behaves like the old version, but can handle the newest PDF versions:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using iTextSharp.text.pdf;
namespace PDFInfo
{
class PDFInfo
{
static void Main(string[] args)
{
PdfReader reader = new PdfReader(args[0]);
Dictionary<string,string> infos = reader.Info;
foreach (string key in infos.Keys)
{
string value = infos[key];
switch (key) {
// check if the date has to be transformed otherwise
case "CreationDate":
case "ModDate":
value = value.Replace("D:","");
value = value.Trim();
break;
}
Console.WriteLine("{0}: {1}",key.ToLower(),value);
}
Console.WriteLine("Pages: {0}",reader.NumberOfPages);
Console.WriteLine("Encrypted: {0}",reader.IsEncrypted() ? "yes" : "no");
}
}
}
A full featured sample can be downloaded here. Please be aware that this
sample is using iTextsharp that is licensed under the Affero General Public License.
To actually use this small console program in your Web Site Management Server, build the console
app and copy the .exe file into your %RDCMS%\MediaCatalog folder. Please make a backup copy of
the old before.
Please also note that WSM is only executing the process for 5 seconds. If the process needs more
time, e.g. with large documents, the process will be killed and no metadata is read. There is no
configuration possibility to change this threshold value.
The sample is provided without any warranty. Please try it on your own risk.
Freitag, 1. Juli 2011
Using WCF to create an RQL client for Web Site Management
A few days ago, I posted about executing RQLs in version 11. I clarified that the currently shown
way of using some .NET objects instead of the old COM+ components, is just a temporary way till
the RDCMSCMSXmlServer Web Service has been implemented with the means of WCF.
I'll now show you in detail how to create a WCF based RQL client that can already be used from
CMS version 7.5 on, I guess. At least WSM 10.1 will work fine with this implementation.
All the steps can be done in around 15 minutes.
As a short outline, the steps are:
1. Create a new console application project in Visual Studio
2. Add a service reference to http://localhost/cms/webservice/RDCMSXMLServer.wsdl
3. A new XMLServerSoapPortClient is generated
4. Use the generated client to connect to WSM
5. That's it
Easy? Yepp, there's not much code you'll have to write manually for this example. As always, in
a real project, you'll have to do some additional work, e.g. creating a separate assembly containing
the client and additional convenience methods for sending certain actions. Probably making the
assembly COMVisible if it has to be called from your old legacy ASP code.
way of using some .NET objects instead of the old COM+ components, is just a temporary way till
the RDCMSCMSXmlServer Web Service has been implemented with the means of WCF.
I'll now show you in detail how to create a WCF based RQL client that can already be used from
CMS version 7.5 on, I guess. At least WSM 10.1 will work fine with this implementation.
All the steps can be done in around 15 minutes.
As a short outline, the steps are:
1. Create a new console application project in Visual Studio
2. Add a service reference to http://localhost/cms/webservice/RDCMSXMLServer.wsdl
3. A new XMLServerSoapPortClient is generated
4. Use the generated client to connect to WSM
5. That's it
Easy? Yepp, there's not much code you'll have to write manually for this example. As always, in
a real project, you'll have to do some additional work, e.g. creating a separate assembly containing
the client and additional convenience methods for sending certain actions. Probably making the
assembly COMVisible if it has to be called from your old legacy ASP code.
Mittwoch, 29. Juni 2011
Developing Custom RenderTags
Did you ever think of implementing your own RenderTag to ease up template development?
Management Server already provides everything you need for that task. There was only one small bug that was actually blocking the load mechanism of custom RenderTags. This was fixed for version 11 now and will soon be available in one of the next hotfixes for 10.1 SP2.
Here are the steps to develop your own RenderTag:
1. Open up Visual Studio and create a new class library project, e.g. My.CustomRenderTag
2. Add references to Reddot.CMS and Reddot.CMS.Rendering
3. Now add a new class and implement the Reddot.CMS.Rendering.IRenderTag interface, e.g. HelloWorldRenderTag:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Reddot.CMS.Rendering.Tags;
using Reddot.CMS.Rendering.Objects;
using System.Xml;
using Reddot.CMS.Rendering;
namespace My.CustomRenderTag
{
public class HelloWorldRenderTag : IRenderTag
{
public HelloWorldRenderTag()
{
}
public void Render(RenderStream outputStream, TagProcessor tagProcessor, XmlNode tag, ObjectLoadManager objectLoadManager, PageBuildContext context)
{
string text = tag.InnerText;
if (string.IsNullOrEmpty(text))
{
outputStream.WriteLine("Hello World!");
}
else
{
outputStream.WriteLine("Hello {0}!", tag.InnerText);
} }
}
}
4. Build the project
5. Adapt the main.config in your ASP directory:
add the following line in the <RenderTag>-section:
<RenderTags>
<Tag name="helloworld" typename="HelloWorldRenderTag" namespace="My.CustomRenderTag" filename="<PathToAssembly>\My.CustomRenderTag.dll" />
6. Kill the RDCMSServiceProcess.exe
7. Now add your new RenderTag (<helloworld>) to your template
Management Server already provides everything you need for that task. There was only one small bug that was actually blocking the load mechanism of custom RenderTags. This was fixed for version 11 now and will soon be available in one of the next hotfixes for 10.1 SP2.
Here are the steps to develop your own RenderTag:
1. Open up Visual Studio and create a new class library project, e.g. My.CustomRenderTag
2. Add references to Reddot.CMS and Reddot.CMS.Rendering
3. Now add a new class and implement the Reddot.CMS.Rendering.IRenderTag interface, e.g. HelloWorldRenderTag:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Reddot.CMS.Rendering.Tags;
using Reddot.CMS.Rendering.Objects;
using System.Xml;
using Reddot.CMS.Rendering;
namespace My.CustomRenderTag
{
public class HelloWorldRenderTag : IRenderTag
{
public HelloWorldRenderTag()
{
}
public void Render(RenderStream outputStream, TagProcessor tagProcessor, XmlNode tag, ObjectLoadManager objectLoadManager, PageBuildContext context)
{
string text = tag.InnerText;
if (string.IsNullOrEmpty(text))
{
outputStream.WriteLine("Hello World!");
}
else
{
outputStream.WriteLine("Hello {0}!", tag.InnerText);
} }
}
}
4. Build the project
5. Adapt the main.config in your ASP directory:
add the following line in the <RenderTag>-section:
<RenderTags>
<Tag name="helloworld" typename="HelloWorldRenderTag" namespace="My.CustomRenderTag" filename="<PathToAssembly>\My.CustomRenderTag.dll" />
6. Kill the RDCMSServiceProcess.exe
7. Now add your new RenderTag (<helloworld>) to your template
Abonnieren
Posts (Atom)