Does anyone know if there is a package available for Umbraco 7 which will produce a report listing content changes that have been made in a specified date range?
I would like to be able to specify a date range and have a list of all content changes. Ideally I would like to have the date, time, user and content before and after the publish.
Does anyone know if this is possible?
I stumbled across this post and thought you might like to know I've written such a package (for Umbraco 7.4 > ). You can filter by date range, log type and other parameters.
https://our.umbraco.org/projects/developer-tools/diplo-audit-log-viewer/
I don't think there is any package related to audit trail.
However, it should not be too hard to achieve what you want by querying the database.
First of, according to your description, you would need to join three table
umbracoLog - this is where audit trail information is stored
umbracoUser - to get the name who perform the action
umbracoNode - to get the node information which got action perform
So a sql could be:
SELECT TOP 1000 [umbracoLog].[id]
,[userId]
, userName
,[NodeId]
, umbracoNode.text
,[Datestamp]
,[logHeader]
,[logComment]
FROM [molweb2].[dbo].[umbracoLog]
inner join umbracoUser on userId = umbracoUser.id
inner join umbracoNode on NodeId = umbracoNode.id
Then base on what you need to filter, just add the relevant where condition.
For Example,
Show only between 2015/11/02 to 2016/01/12:
where Datestamp > '20151102' and Datestamp < '20160112'
Be careful, the current sql does not filter out non content audit trail.
Related
I have a bunch of data in InfluxDB about "articles", and each article has a domain value associated with it.
I was hoping to display the number of articles, by domain. I might be wrong, but I feel like what I want in SQL is this:
select domain, count(*) from articles group by domain;
However, this gives me this error:
ERR: mixing aggregate and non-aggregate queries is not supported
What am I doing wrong?
I suspect that your domain is a field and not a tag. You can only group by a tag (and time intervals).
If your domain was a tag there would be no problem with the query. Although selecting the tag could be redundant since it is already included in the results as the group identifier.
I think Jan Garaj's comment is somewhat inaccurate.
I don't know why you don't get an error that you can't group by domain if it is in fact a field. But perhaps the query parser is just first complaining about you having a field that is in fact not being aggregated in any way when it should be.
EDIT: but to address your question, the way you approach it is the right way.
You need to use correct InfluxDB syntax for GROUP BY (tag is not included in the SELECT clause):
select count(*) from articles group by domain;
How do you quickly get the maximum (or minimum) value for a property of all instances of a relationship? You can assume the machine I'm running this on is well within the recommended spec's for the cpu and memory size of graph and the heap size is set accordingly.
Facts:
Using Neo4j v2.2.3
Only have access to modify graph via Cypher query language which I'm hitting via PHP or in the web interfacxe--would love to avoid any solution that requires java coding.
I've got a relationship, call it likes that has a single property id that is an integer.
There's about 100 million of these relationships and growing
Every day I grab new likes from a MySQL table to add to the graph within in Neo4j
The relationship property id is actually the primary key (auto incrementing integer) from the raw MySQL table.
I only want to add new likes so before querying MySQL for the new entries I want to get the max id from the likes, so I can use it in my SQL query as SELECT * FROM likes_table WHERE id > max_neo4j_like_property_id
How can I accomplish getting the max id property from neo4j in a optimal way? Please indicate the create statement needed for any index as well as the query you'd used to get the final result.
I've tried creating an index as follows:
CREATE INDEX ON :likes(id);
After the index is online I've tried:
MATCH ()-[r:likes]-() RETURN r.i ORDER BY r.id DESC LIMIT 1
as well as:
MATCH ()-[r:likes]->() RETURN MAX(r.id)
They work but take freaking forever as the explain plan for both indicate no indexes being used.
UPDATE: Holy $?##$?!!!! It looks like the new schema indexes aren't functional for relationships even though you can create them and show them with :schema. It also looks as if there's no way with cypher directly to create Legacy Indexes which look like they might solve this issue.
If you need to query relationship properties, it is generally a sign of a model issue.
The need of this query reveals you that you would better extract these properties into a node, that you'll then be able to query faster.
I don't say it is 100% the case, but certainly 99% of the people seen so far with the same problem has been demonstrating this model concern.
What is your model right now ?
Also you don't use labels at all in your query, likes have a context bound to the nodes.
I am using a SQL query for a specified and faster search in my Rails app, currently I have the following query that works wonderfully for gathering the data from the initial search:
SELECT * FROM selected_tables
WHERE field1 LIKE '%#{present_param}'
AND field2 LIKE '%#{present_param2}'
And so on like that, with each LIKE line only appearing if the relevant parameter is present from the form.
So I am now able to get back a large amount of results from this query, but they're not ordered in any helpful way. I need some way of ordering the results based on their relevance to the original user input from the form, but I can't seem to find anything on google about it. Is there a way in SQL (specifically postgresql) that I can order the results based on this?
To be clear, when I say relevance I mean that a given search keyword should be in the title or company name for the result, not just present somewhere in the content.
For example: if you search "Sony" you get Sony Electronics first, not another listing containing Sony somewhere in the middle of its name.
I ended up using a series of Case/When statements that were weighted with various integer scores to apply priority to my results. They work wonderfully and turned out something like this:
SELECT title, company, user, CASE
WHEN upper(company_name) LIKE '%#{word[0].upcase}%' THEN 3
WHEN upper(company_name) LIKE '%#{company_name.upcase}%' THEN 2
ELSE 0 END as score
FROM selected_tables
WHERE company_name LIKE '%#{company_name}%'
ORDER BY score DESC;
My client has decided they want to rename a very commonly used data item name.
So, for example, the database has a column called 'Cost' and they see 'Cost' on a heap of reports.
The client now wants to see 'Net Cost' everywhere.
So we need to change every occurrence of 'Cost' and change it to 'Net Cost'
I can do this in Framework Manager easily enough, and I can even run Tools > Report Dependency to find all the reports that use the 'Cost' column. But if there's 4,000 of them, that's a lot of work to update them all.
One idea is to deploy the entire content store to a Cognos Deployment zip file, extract that & do a global search & replace on the XML. But that's going to be messy & dangerous.
Option 2 is to use MotioPI to do a search & replace. I don't think the client will spring for buying this product just for this task.
Are there other options?
has anyone written anything in the Cognos SDK which will do a rename?
has someone investigated the Content Store database to the degree
that they could do a rename on all the report specs in SQL?
are there other options I've overlooked?
Any ideas would be greatly welcomed ...
Your first option is the way to go. This essentially boils down to an XML find-and-replace scenario. You'll need to isolate just the instances of the word "Cost" which are relevant to you. This may involve the start and end tags.
To change the data source reference across reports, you'll need to find and replace on the three part name [Presentation Layer].[Namespace].[Cost]. If there are filters on the item, they may just reference the one part name from the Query. Likewise, any derived queries would reference the two part name. Handle these by looking through the XML report spec and figuring out how to isolate the text.
I'm assuming your column names are set to inherit the business name from the model and not hard coded (Source Type should be Data Item Label, NOT Text). If not, you'll need to handle these as well. Looking at the XML, you would see <staticValue>Cost</staticValue> for these.
It's not really dangerous as you have a backup. Just take multiple passes, each with as granular a find and replace as possible.
Motio will just look at the values inside the tags, so you will be unable to isolate Cost, thus it can't be used for this. However, it would come in handy for mass validation of reports after the find and replace. A one seat license for the year could be justified by the amount of development time it could save here.
Have you tried using DRU? (http://www-01.ibm.com/support/docview.wss?uid=swg24021248)
I have used this tool before to do what you are describing.
Good luck.
You can at least search for text in the Content Store (v10.2.1) using something like:
set define off
select distinct T4.name as folder_name, T2.name as report_name
from cmobjprops7 T1
inner join cmobjnames T2 on T1.cmid=T2.cmid
inner join cmobjects T3 on T1.cmid=T3.cmid
inner join cmobjnames T4 on T3.pcmid=T4.cmid
inner join ( -- only want the latest version (this still shows reports that have been deleted)
Select T4.name as folder_name, T2.name as report_name, max(T3.modified) as latest_version_date
from cmobjnames T2
inner join cmobjects T3 on T2.cmid=T3.cmid
inner join cmobjnames T4 on T3.pcmid=T4.cmid
Where T2.Name like ‘%myReport%’ -- search only reports with 'myReport' i the name
and substr(T4.name,1,1) in ('Project Zeus','Project Jupiter') -- search only folders with this in the name
Group by T4.name, T2.name
) TL on TL.folder_name=T4.name and TL.report_name=T2.name and TL.latest_version_date=T3.modified
where T1.spec like '%[namespace].[column_name]%' -- text you want to find
and substr(T4.name,1,2) in ('Project Zeus','Project Jupiter')
order by 1 desc, 2;
I would like to create a report that shows the iteration status in real time. I was able to create a query on the Tfs_Warehouse database (see below) however I found that this database is populated from the Tfs_Collection database on timely basis.
Is there a way that I can see the changes to the work items reflected in the report right away?
SELECT *
FROM [CurrentWorkItemView] c
left join [vDimWorkItemTreeOverlay] t on t.WorkItemSK = c.WorkItemSK
where c.IterationName = #iteration and c.System_WorkItemType = 'User Story'
order by c.Microsoft_VSTS_Common_StackRank, c.System_id
Note: this not the full query because I couldn't fit it nicely. Basically it joins 2 table (CurrentWorkItemView and vDimWorkItemTreeOverlay) to get the user stories and associated tasks to each user story.
No, not through the warehouse. When you need up to date information from the work items, use a work item query in Excel or Visual Studio.
You can also use the TFS api to query the operational datastore directly.