Sitefinity: How can you update the revision of a document programmatically? - asp.net

In Sitefinity, almost everything is able to be revisioned. In the backend interface at a page for a content item you can click on Revision History and see revisions.
We're in a situation where we're manually uploading documents in to the Documents & Files library through a custom form. We're able to do this using the Content Lifecycle which has pretty good documentation: http://www.sitefinity.com/documentation/gettingstarted/developers-guide/sitefinity-essentials/modules/content-lifecycle .
What doesn't have any documentation is how to modify a document so that it updates the revision of that document programmatically, not replace it. Right now, we're only able to replace it and the revision history stays empty.

I think you cannot keep the previous version of the document in Sitefinity.
The revision history for the documents keeps track for the metadata only, e.g. Title, Author, etc.
If you replace the file, there is no way to revert it back through the Revision History.
Disclaimer: I haven't tested this in the 7+ versions.

Related

How to add entries in history tab in quality center for requirement tracebility

I want to add the logs for the requirement history for the changes in the requirement tracebility. Currently,the logs for the changes in the requirement tracebilyt are not being captured in the history section.
Is any code or API to make changes in the requirement tracebility visible in the history tab?
thanks
History is not maintained for requirement traceability in QC. What you can do, enable history for comment field from customization and change your qc workflow script such that it adds comment (i.e. added link/removed link with ids) when somebody changes anything in requirement traceability section.
you have to make the Related field history enabled and to do so, you have to have administration rights on the project.
then go to Tools>Customization>Project Entities> Test Cases
then find your field in either the System Fields list or the User Fields list.
select the target field, in the RHS you will see the field properties and one of the properties is History Enabled. check that option and Save then Hit Return.
Log out of the project and re-Login.
now changes to that field will be tracked and appear in the History tab.

How to discard draft of edited Content Item in Orchard

In our system, an Editor will constantly make changes/updates to existing Content Items and saving them as drafts.They however do not have the permission to publish updated Content Items. It is the job of a Proofreader to vet through the changes and approve them (publish). If a Proofreader thinks that the changes made to a particular Content Item is not suitable, he/she should be able to discard/reject the draft without affecting the published version of that Content Item prior to changes.
Does Orchard have this kind of functionality?
Orchard keeps all versions and i think you can not delete them. this has been asked many times. Do look at modules like 'Version Manager' (out of date) and Rijkshuisstijl.VersionManager - 0.2
.

Updating an already downloaded podcast feed

So, I have a podcast feed in the RSS 2.0 format and it works fine.
What I would like to be able to do is rearrange the items in the feed, or even add data to items. The problem is that these items have already been downloaded into my podcast app.
Is there anything I can do to the xml file to trigger the client to refresh the feed and bust out of what has already been cached, besides deleting and re-subscribing?
There isn't an element or flag you can send to tell feed readers or podcatchers to remove or delete an already downloaded (or cached) item.
You can send an updated item if you change the <guid> field, which will cause readers to see it as a new item to download or fetch.
You can also update the entire contents of the item and readers may or may not (depending on their settings) replace it on the user's side, essentially "deleting" it in a sense with the newer or corrected version.
Alternatively, if you switch to sending out with an Atom feed format, there is the <updated> element, which tells readers when the item was last updated, but again, whether or not the reader downloads a fresh copy is up to its build/settings.

Sitecore media item downloads

I need to get number of downloads per document in Media Library. I am using Sitecore 6.4.1 and Sitecore OMS 1.1.1. Is there a Sitecore built-in way or API that allow me to retrieve such information?
Well you cannot make sure that the download has completed, but a hit is registered so you can go to the media item, click the analyze tab and then reports. As far as I remember you should now be able to select a report of hits.
The first thing that you need to make sure that the download is captured by OMS. You have to associate the download event with the item that is downloaded. Once you do that, you can go to the download report and see the number of times it's been downloaded. If you don't associate the download event with the item, however, it will not trigger the page event and therefore will not be trackable in OMS.

Scheduling and publishing replacement pages in a CMS

Does anyone have any ideas or know of any plugins to allow pages to be scheduled and replaced.
preamble:
currently evaluating different content management systems for a new project, we create new pages and also updating existing pages for example as part of a 'maintenance release'.
We will be using either PHP (preferably) or C#
Problem:
We would like our users to be write and save a new revision of an existing page with a go-live date and time in the future, at this date and time we would like the page to be live replacing the existing page, but all links to the page, url etc to be the same.
Currently:
We have two separate installs and schedule updates to pages using a cron job and a PHP script running some mysql queries - this has failed us at critical times in the past when it has failed to run.
finally:
We could probably write this ourselves, either in our own CMS or as a plugin to an existing CMS - simply:
SELECT latest_revision from posts_pages_table
WHERE publishable='yes'
AND max(revision_date);
but does anyone have any experience of this with an existing CMS or from a technical point of view foresee any problems?
How for example in a wordpress backend will a user be sure they are updating the latest version of a page if it hasn't gone 'live' yet.
We have looked at all existing CMSs and searched google but scheduling updates to pages seems to be an uncommon occurrence so relying on some guidance from the trusty SO crowd.
thanks
If you are fine with PHP, you can use SilverStripe. To achieve what you are asking you'd use the CMS Workflow module.
SilverStripe CMS comes with two stages built-in: live and draft. You can keep reworking the draft version, which remain private until you are ready to publish. In the normal scenario you would just push to live.
With the CMS Workflow installed, you can additionally choose the date when the modification should go live ("embargo"). This stores your draft version for "later", and only pushes to live at the date you've chosen (this plugs in via the cron job).
There is also an "expiry" you can set on the page, at which point the page will be unpublished and will no longer be available publicly.
Embargo, expiry and publishing operations do not affect the URL nor ID of the page, so all the relations stay intact while you are reworking the page via the CMS.
References:
PDF manual, see page 16 for description of the embargo
Module page with a short description
Source
In Joomla, there is a way to do this out of the box without touching any code. Here's how I would do it -
Create a category for the page that will be getting replaced
Create a menu item pointing to that category. Set it to display 1 item only, ordered by newest date
Create a template override so that the category item displays like an article detail page
Create new articles with a start publish date that determines when it starts displaying
Basically, you'd be displaying a category but it would look like an article. It would always pull the newest article that has reached it's start publish date. It would be easy to keep track of because you would have copies of every version you post, each update you would simply make a copy of the last one to edit.
You could probably write something custom to accomplish the same thing, but why spend the time and effort when it can be done easily with a template override?

Resources