delete publishing report for a project

24 views
Skip to first unread message

Jo

unread,
Aug 18, 2010, 3:51:45 AM8/18/10
to RedDot CMS Users
Hi,

We have a long list of publishing report for our live project in
reddot cms.
Other than dleting it manually one by one, is there any way that we
could delete it , like for a motnhs report?

I tried to write a script, which didn't work as expected.I tried to
run the script as scheduled job. This is based on another post here.

-------------------------------------------start
code----------------------------------------------------------------------------------------------------
<%

'***************************************************** Settings
*****************************************************

ProjectGUID = "8517ABAA4EB248C795B3344E7B31EE4C" 'Project GUID
pageGUID = "F5D623EFABBF407CAE52BF267D775986" 'GUID of page that
contains text field
linkGUID = "9336EB5B39154C1DACEC9285719E2D7P" 'GUID of anchor or list
that the above page is connected to
folderGUID = "00F18BD2FD6D4E5DB005E8F644737AC0" 'GUID of resource
manager folder where images are stored
textField = "txt_images" 'Name of text field to update
Username = "xxx" 'Username of user with sufficient rights to
publish page
Password = "xxx" 'Password of above user
reportGUID = "44787BD40B04479C861632D089826358" 'GUID of the job
report
daysno = "100" 'delete
reports before x days

'*************************************************** End Settings
***************************************************
%>

<html>
<head>
<style>
body {
font-family: Verdana;
font-size: 0.8em;
}
.error {
color: #f00;
}
</style>

</head>
<body>

<%
'on error resume next

' ### Define server objects
set objIO = Server.CreateObject("RDCMSAsp.RDPageData")
objIO.XmlServerClassName = "RDCMSServer.XmlServer"
set objXML=Server.CreateObject("Microsoft.XMLDOM")



' ### Login to CMS
xmlData = "<IODATA>" &_
"<ADMINISTRATION action=""login"" name=""" & Username & """
password=""" & Password & """/>" &_
"</IODATA>"
loginData = objIO.ServerExecuteXml(xmlData, strError)
Call objXML.LoadXML(loginData)
set loginData = objXML.selectSingleNode("//IODATA/LOGIN")
LoginGUID = loginData.getAttribute("guid")


' ### Retrieve session guid
xmlData = "<IODATA loginguid=""" & LoginGUID & """>" &_
"<ADMINISTRATION action=""validate"" guid=""" &
LoginGUID & """ useragent=""script"">" &_
"<PROJECT guid=""" & ProjectGuid & """/>" &_
"</ADMINISTRATION>" &_
"</IODATA>"
sessionData = objIO.ServerExecuteXml(xmlData, strError)
Call objXML.LoadXML(sessionData)
set sessionData = objXML.selectSingleNode("//IODATA/SERVER")
SessionKey = sessionData.getAttribute("key")

Response.Write ("SessionKey : "+SessionKey+" ")


xmlData = "<IODATA sessionkey="""" & SessionKey & """">"&_
"<PROJECT guid=""" & ProjectGuid & """
sessionkey="""" & SessionKey & """">" &_
"<EXPORTREPORT guid=""" & reportGUID & """
action=""deleteall""/>" &_
"</PROJECT>" &_
"</IODATA>"

sessionData = objIO.ServerExecuteXml(xmlData, strError)
Call objXML.LoadXML(sessionData)

'days=""" & daysno & """

Response.Write ("deleted ??")


' ### Log out
xmlData = "<IODATA loginguid=""" & LoginGUID & """>" &_
"<ADMINISTRATION><LOGOUT guid=""" & LoginGUID & """ /
></ADMINISTRATION>" &_
"</IODATA>"
objIO.ServerExecuteXml xmlData, strError


Response.Write ("Job reports deleted.")


' ### Dispose of objects
set objXML = nothing
set objIO = nothing
%>


</body>
</html>

--------------------------------------------------------end
code------------------------------------------------------------------------------

Please anybody help me on this ?

Thanks,
Jo
Message has been deleted

Jo

unread,
Aug 18, 2010, 3:52:31 PM8/18/10
to RedDot CMS Users
Thank you Neil,

We are on version 9 and it has also has got that option. But I don't
want to delete all the reports in one go. I just want to delete
specific days. Can we achieve that using a script or scheduled job?

Thanks,
Jo

On Aug 18, 1:57 pm, Neil <n.feg...@gmail.com> wrote:
> Hi
>
> What version are you using? We are on v10 and there is an option to
> 'Delete Job Reports' in the action menu when selecting Administer
> Publication > Job Reports, which deletes all reports in one go.
>
> Neil
> > Jo- Hide quoted text -
>
> - Show quoted text -

markus giesen

unread,
Aug 23, 2010, 12:00:45 AM8/23/10
to RedDot CMS Users
you can always write your own batch job outside of CMS and run it as
scheduled task on your Windows Server..
Would that work?

Jo

unread,
Aug 23, 2010, 3:40:01 AM8/23/10
to RedDot CMS Users
Thanks Markus,

Could you look at the above code which has done as a scheduled job
inside cms?
Is that what you meant ?

Thanks,
Jo

markus giesen

unread,
Aug 23, 2010, 5:21:36 AM8/23/10
to RedDot CMS Users
Hey Jo,

I actually meant a simpler approach. Your log files are stored on the
CMS server, most likely somewhere under:
\Program Files\Open Text\WS\MS\ASP\LOG\...

I would bypass the CMS and just delete them using a .bat file or
a .net executable which gets triggered as scheduled event.
No RQL needed I'd say.

Cheers,
Markus

PaulG

unread,
Aug 25, 2010, 10:19:16 PM8/25/10
to RedDot CMS Users
I think publish reports have both a database record and file in the
file system - so RQL is probably the way to go, although you can do it
directly in Server Manager - no need for asp/vbs script.

In server manager, there should be a sample job which you can use to
do this called "DeleteExportReport"
Obviously, you'll need to configure the schedule, supply a valid usr/
pwd and replace the [#xxx#] variables with actual constants
([!yyy!] variables will be substituted at runtime).

Paul.
> > > > > - Show quoted text -- Hide quoted text -

Jo

unread,
Aug 26, 2010, 4:26:03 AM8/26/10
to RedDot CMS Users
Hi,

Thanks Markus and Paul.

Yes I have created a job in server manager to delete the publishing
job files in the file system /Log/Publishing as you said.
It is deleting the files on the file system. But the reports actually
shown on the CMS is not deleting ( Administer Publication - Job
Reports)

Is there any way to delete those reports other than manually doing it?
I know we can do it all in one click in Action Menu.
But what if I want to keep a week's report ?

Thanks,
Jo

PaulG

unread,
Aug 29, 2010, 10:00:58 PM8/29/10
to RedDot CMS Users
Using the RQL in the example job seems to work fine for me.
There's also a "days" parameter to specifiy the number of days to keep
(doesn't seem to be mentioned in the RQL doco, but is in that sample
job)


<IODATA loginguid="[!guid_login!]">
<ADMINISTRATION action="validate" guid="[!guid_login!]"
useragent="Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0;
T312461)">
<PROJECT guid="[#ProjectGUID#]"/>
</ADMINISTRATION></IODATA><IODATA sessionkey="[!key!]">
<PROJECT guid="[!guid_project!]" sessionkey="[!key!]">
<EXPORTREPORT days="[#days#]" action="deleteall"/>
</PROJECT></IODATA>
Reply all
Reply to author
Forward
0 new messages