Jedes Wiki muss gelegentlich mal aufgeräumt werden. Bei größeren Organisationen passiert es häufig, dass Bereiche angelegt, aber nicht mehr aktiv genutzt werden. Das folgende SQL-Skript listet alle Confluence-Bereiche, Erstellungsdatum sowie Datum der letzten Änderung. Durch Klick auf eine Spaltenüberschrift kann man auf- und absteigend sortieren. Bereiche, deren letzte Änderung lange zurückliegt, sollte man sich mal genauer ansehen und ggf. löschen oder deren Inhalte woanders unterbringen.
Und so sieht es aus:
select
count(CONTENT.spaceid) as "Page count",
'[' || SPACES.spacename || '|http://www.schirmacher.de/display/' || SPACES.spacekey || ']' as "Space Name",
SPACES.lastmodifier as "Last Edited by",
to_char(SPACES.creationdate, 'YYYY-MM-DD') as "Space created",
to_char(SPACES.lastmoddate, 'YYYY-MM-DD') as "Space modified",
to_char(max(CONTENT.lastmoddate), 'YYYY-MM-DD') as "Content modified"
from
SPACES, CONTENT
where
SPACES.spaceid = CONTENT.spaceid
group by
CONTENT.spaceid,
SPACES.spacename,
SPACES.spacekey,
SPACES.creator,
SPACES.creationdate,
SPACES.lastmodifier,
SPACES.lastmoddate;
Macro Aufruf mit MySQL Syntax
{sql:dataSource=ConfluenceDS|output=wiki} select count(CONTENT.spaceid) as "Page count", concat('[', concat(SPACES.spacename, concat('|http://www.schirmacher.de/display/', concat(SPACES.spacekey, ']')))) as "Space Name", SPACES.lastmodifier as "Last Edited by", date_format(SPACES.creationdate,'%Y-%m-%d') as "Space created", date_format(SPACES.lastmoddate,'%Y-%m-%d') as "Space modified", date_format(max(CONTENT.lastmoddate),'%Y-%m-%d') as "Content modified" from SPACES, CONTENT where SPACES.spaceid = CONTENT.spaceid group by CONTENT.spaceid, SPACES.spacename, SPACES.spacekey, SPACES.creator, SPACES.creationdate, SPACES.lastmodifier, SPACES.lastmoddate {sql}
Macro Aufruf mit PostgreSQL Syntax
{sql:dataSource=ConfluenceDS|output=wiki} select count(CONTENT.spaceid) as "Page count", '[' || SPACES.spacename || '|http://www.schirmacher.de/display/' || SPACES.spacekey || ']' as "Space Name", SPACES.lastmodifier as "Last Edited by", to_char(SPACES.creationdate, 'YYYY-MM-DD') as "Space created", to_char(SPACES.lastmoddate, 'YYYY-MM-DD') as "Space modified", to_char(max(CONTENT.lastmoddate), 'YYYY-MM-DD') as "Content modified" from SPACES, CONTENT where SPACES.spaceid = CONTENT.spaceid group by CONTENT.spaceid, SPACES.spacename, SPACES.spacekey, SPACES.creator, SPACES.creationdate, SPACES.lastmodifier, SPACES.lastmoddate; {sql}
Macro Aufruf mit Oracle Syntax
{sql:dataSource=ConfluenceDS|output=wiki} select count(CONTENT.spaceid) as "Page count", concat('[', concat(SPACES.spacename, concat('|http://www.schirmacher.de/display/', concat(SPACES.spacekey, ']')))) as "Space Name", SPACES.lastmodifier as "Last Edited by", to_char(SPACES.creationdate,'YYYY-MM-DD') as "Space created", to_char(SPACES.lastmoddate,'YYYY-MM-DD') as "Space modified", to_char(max(CONTENT.lastmoddate),'YYYY-MM-DD') as "Content modified" from SPACES, CONTENT where SPACES.spaceid = CONTENT.spaceid group by CONTENT.spaceid, SPACES.spacename, SPACES.spacekey, SPACES.creator, SPACES.creationdate, SPACES.lastmodifier, SPACES.lastmoddate {sql}