Sitecore media item downloads - asp.net

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.

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.

Adding Google's standard search (not custom) to my website

My intention is to embed Google results in my website. I don't want to customise the domain/s on which the search is performed or anything, just a 'bog standard' Google search based on search parameters I pass it.
2 questions:
How do I display google results on my website as a response to search criteria entered into a textbox I have?
Is there any legislation I need to take into account?
I know my second question sounds rather strange but I'm aware that what I'm appearing to do here is present content driven by Google as though it's my own so want to avoid breaching any copyright or 'same-origin policy' type thing.
What I've Tried/Ways I Know I Could Achieve This
Screen scraping Google's response to a simple web request with the necessary query parameters (but seems a bit excessive)
Google's custom search (but I don't want to customise anything)
I've tagged this question for some more context.
As it is mentioned here
you can use your own XML parser to customize the display for your
search users.
with an http request like this:
GET /search?q=bill+material&output=xml&client=test&site=operations
But it has a limitation on number of requests per day, 500 or 1000 I guess.
Custom Search can be configured to include the entire Web in its results:
From the Google Custom Search homepage, click New search engine.
In the Sites to Search box, enter at least one valid URL (e.g. www.google.com).
Click Create.
On the next page, under Optional next steps, click Edit.
On the Basics tab, under Search Preferences, select Search the entire web but emphasize included sites.
Click Save Changes.
In the left-hand menu, under Control Panel, click Sites.
Delete the site you entered during the initial setup process.

Show list of pages that are opened at the time being

I have a task to list all pages which are opened at that moment and show how many people are on that page.
I am looking for a way to make that happen without keeping any db records or saving information on a text file or smth like that. (Not seccessarily, then. Of course I am going to save that info to a dB, I just wanted to the logic of catching opened page addresses.)
I can of course keep track of every page which are opened till that time, but I want the page address appear on the page when someone opens that address and disappear when user is no longer browsing that address.
Can you give me some ideas how to make that happen using ASP.NET?
Note: I am using web forms with asp.net 4.5
Thanks!
"I just wanted to the logic of catching opened page addresses"
Use javascript in a timed loop (onload and then every 30 seconds perhaps) on every page, to asynchronously post to a page on your server. It should send information identifying the page. This will give you a good idea of how many people currently are on this page.
Store this information in a db in your code-behind, and use this information to report as you wish.
Of course if a user leaves their browser open on one of these pages or opens another tab it will still be reporting as 'open'.
To get the current url in javascript you can use:
var pathname = window.location.pathname;
In google analytics you can see what pages are being used in near-real time.
Why not use that to solve this issue - it's easy to setup.

How to make a box with user options in facebook open graph

I have an online magazine with news articles and i want to make an open graph action that everytime a user reads an article a story to post in his timeline.
I have all the nececery open graph tags in my urls and a login button with publish_actions scope.
I'm one step away from submitting the action for approval but i still cant figure out one thing.
The facebook's documentation says that i need to give users an option to stop auto publishing or remove the app etc. something like the image in the middle of this page http://developers.facebook.com/docs/opengraph/actions/builtin/#read .
I saw it also on yahoo and its exacly the same.
How can i make something like this in my site? The code is ready somewhere or i have to write it myself?
Thanks in advance!
The permission remove, or just a switch to stop publish of action and the delete article functions will have to be developed by you.
I am working on the same things for my app.
creating user CP control panel containing, revoke perms buttons.
a user CP to swich publishing on and off, via true/false in mysql
an array of app activities with delete buttons.

How can I get Gmail-like file uploads for my web app?

I want to add gmail-like file upload functionality for one of my projects. Can anybody help me with this?
My application is built in vb.net.
I would appreciate any kind of help or guidance.
Thanks
Check out SWFUpload, which is essentially a javascript api to flash's absolutely superior file upload handling capabilities. Best thing out there until the browsers finally catch up.
From link:
Upload multiple files at once by ctrl/shift-selecting in dialog
Javascript callbacks on all events
Get file information before upload starts
Style upload elements with XHTML and css
Display information while files are uploading using HTML
No page reloads necessary
Works on all platforms/browsers that has Flash support.
Degrades gracefully to normal HTML upload form if Flash or
javascript is unavailable
Control filesize before upload starts
Only display chosen filetypes in dialog
Queue uploads, remove/add files before starting upload
Demos
----- iframe upload -----
To start, you want to have an iframe on your page. This is meant for server communication. You'll hide it later, but for now, keep it visible. Give that iframe a name attribute, like "uploader" or something.
Now, in your form, set the target to the iframe's name and the action to a script you have on the server that will accept a file upload (like a normal form with a file upload). Add a link inside that form with the text "Add File". Set that link to run a javascript function which will add a new input to the form. This can be done via the DOM, but I would recommend a javascript library like jquery.
Once the new file input is added to the form, set the blur event of that input to a javascript function that will submit the form and then check it periodically for output. Reading an iframe can be tricky, but it's possible.
Have your file upload script output a "Done." or a filename or something when the upload is complete.
Check it every second or so until there is content. Once you have content, kill your timer and replace the file input with the name of the file (or "File Uploaded") or whatever.
Hide your iframe with css.
From YUI! (Yahoo User Interface), https://yuilibrary.com/yui/docs/uploader/
Multiple file selection in a single "Open File" dialog.
File extension filters to facilitate the user's selection.
Progress tracking for file uploads.
A range of file metadata: filename, size, date created, date modified, and author.
A set of events dispatched on various aspects of the file upload process: file selection, upload progress, upload completion, etc.
Inclusion of additional data in the file upload POST request.
Faster file upload on broadband connections due to the modified SEND buffer size.
Same-page server response upon completion of the file upload.
Totally Free
Here is the gmail uploader clone. This is the exact clone of gmail uploader with some extra facilities. You can see the thumbnails of images after uploading, Drag the thumbnails to change the order and replace any thumbnail. It is done using jQuery.
You can see the demo here. The source code is free to download in a single zip file.
I hope you can easily remove some code and get the desired thing. You may leave comments on the ABCoder blog if you need further help.
For a non-flash solution, you can use NeatUpload. I used it on an extensive project last year with a no-flash requirement. It's very easy to integrate into existing solutions. I thought it was a breeze to work with. Easier, in my limited experience, than working with SWFUpload in ASP.NET. Probably because NeatUpload is built just for ASP.NET.
You may use Flickr Uploader clone instead.
Are you talking about an upload without a full page postback? Take a look at http://www.phpletter.com/Demo/AjaxFileUpload-Demo/, which creates a hidden iframe, copies the input control, and uses the iframe to perform the post to get the file on the server.
If you're looking for the behavior where when the user clicks "attach file" and the file browsing dialog automatically pops up, that can be done via Javascript but doesn't work in FireFox, which has the security precaution of requiring the user to invoke the "Browse" button directly (rather than programmatically through script).
For the "automatic" upload, use Javascript to attach to the "change" event for the "value" property of the the 'input' control so that the will perform when a file has been selected.
Now it has been 2 years, I used the uploadify in my legacy system and it works good. but you need to write some hack code (such like hold the session).
I recommend you use jquery upload, which is pure HTML, no swf, no session problems and really great!
== on 2013, what I wrote:
I am considering which to choose, SWFupload or uploadify .
but on SWFupload's official website , it says that it has not been under active development and the author is hoping someday the SWFupload could revive...
so ... I decided to try "uploadify", which seems supports many options, callbacks with lots of demos. (after checking its source code, I guess the author wraps the "SWFupload v1" and "SWFupload v2" in his "uploadify v3"...)
and there's a full list of this kind of uploaders.
I'd like a little more clarification of "Gmail-like" file uploading.
do you mean how if it sits for a little bit, it automatically attaches it to a draft?
Gmail's code is difficult to find your way around, but if I had to guess, this is how it works:
When you click "attach another file", it inserts a regular input type file control. On IE, it may also programmatically trigger the click event on the "browse" button so the file dialog opens immediately (it doesn't do this on firefox, and I don't have IE handy, but I believe IE allows for this)
After you select a file, it detects the change event of the input control, and starts a timer.
When the timer triggers, it detaches the input element from the form, and adds it to a different form in a hidden iframe, placing a simple link in the main (visible) form. The hidden iframe is then submitted to upload the file. (It may also clone the input element, but I haven't tried whether this works.)
You can use iFrames for this

Resources