Sitecore auto-publish for media and folders - media

We have a structure for the media items and web page items that works something like – section -> year -> month -> day -> article/media. Currently these date folders and images uploaded to the media library are either published manually by a user or by a scheduled publish task that runs every 15 minutes resulting in a brief delay for the media or article to show up.
Is there a way to auto-publish these folders/images right after they are created? I know items can be set to workflow with finalized state having an ‘Auto-Publish’ command below it that fires right after the item reaches that final state.
I do not want to set workflow on folders and images which are based on system templates.Is there a pipeline or command I can tap into to auto-publish folders/media library on save?
Any other recommendations are welcome too.

I do not recommend auto-publishing them upon creating because if you create a folder, it will publish, then another and it will do another publish. Each publish operation will clear the Sitecore caches.
Instead, I recommend you maybe create a pipeline processor for publishing or an event handler for publishing and if you're on a media item being published, traverse up its parents in the media library (folders) and initiate the publish from there till you find one that has been published (that's you're break point on the traversal). You'd need to determine the code to see if its published. This is just one approach though.

I think you will have to create a new handler for item:saved and then check the template on it. I don't believe there is a specific pipeline for media items.

Related

Custom form in Outlook Task is not syncing

My partner and I created a custom task form to be used in Outlook using the developer mode to do that, and we published it to the Organization Forms Library for anyone to open. We're running into issues that I personally can't seem to find on how to resolve:
Custom forms aren't syncing correctly.
When I complete out the custom form, and I assign it to someone else they might be missing details like the dates I picked from the date picker, and text within the text box are gone too. It's very odd that sometimes some would get all the details that an end-user would input but that's like a 1/8 chance. I feel like there's a disconnect where it just won't behave like any other task. Cache mode or no cache mode doesn't matter it seems. When the person assigns it back with changes made on their end, those changes aren't seen on my side. I just have the same original details that I made when I first made it. We're on Exchange Server 2010.
Looks like a custom form was not published correctly to others in the organization. Try to create a new Outlook item on other machines with your custom forms to make sure they were deployed correctly.
Note, message forms default to separate layouts for composing and reading. Many people find their first message form doesn't look right when they receive an item created with it. That's simply because they forgot to click the Edit Read Page button and customize the Read layout!
You may find the Customizing Outlook Message Forms article helpful.

moving cs cart to another directory without data

Firstly, I have made a sub directory for development and installed cs cart MVE in it.
I want to copy the current cs cart sub-directory and add it to the main domain folder without the testing dummy data I have added in the development phase.
How can I do that?
Secondly, if I have made new changes in the future on the development folder, how can I apply this change to the main domain folder?
Thanks a lot for the help in advance.
Note: a step-by-step guide will be very helpful!
There are a few ways to accomplish those results. First of all, if you just want the demo data to be removed you can alter the database and do the following:
Alter the table and remove every single product, property, banner, etc. Though if you have this code setup you could just run it in one time. Though I do not recommend this as this is way more work than needed and this wont get rid of the images and such stored by the demo data.
You can also do the following:
Go to the products section, click the checkbox in the top left and after that click the gear icon in the top right and select: "Delete selection". Do this a few times and for everything needed (banners, payment methods, shipping methods, etc.) and you are all set.
Or you can do this (recommended):
You can do a store-import of your current store and then switch the directories around so you have no downtime. This is also the way I do my development. You can get the store-import addon for free in the cs-cart marketplace.
But if you were looking for a way just to copy a store without transferring any data you could think about what you want to copy. Basically every setting is stored in the database (so are this similar?). Furthermore every image path, etc. is stored in the database (so are these similar?). And so on. The best way I see how you can do this is by running a store import (this will give you the option to remove all the demo data before importing the new data, you could install a new version of cs-cart with no data, then it will delete all the current data you allready have.)
Hopefully my answer suffices, feel free to ask if you stumble across some problems.

Fineuploader open queued items

Is it possible to open files directly from the list of the stored items. I want to implement this function so that the user can check the files before they getting uploaded.
If you would like to allow users to open submitted files in an external application via the browsers by clicking on these files (for example), this is not really possible. The browser does not provide sufficient access to the file system to make this possible. As Mark mentioned, Fine Uploader will already optionally generate previews for images. We intend to look into providing client-side previews for audio and video files in the future as well.

How to detect back button -vs- GoBack() in WP7 app

Maybe I'm over-thinking this, but here's what I'm trying to accomplish.
I have two MVVM projects (assemblies) in my WP7 app. One page in the main project will call another page in the second project. The second page will allow the user to browse through a list of files on the web and select one to be downloaded to Isolated Storage. The files are rather small.
For a little background: I want two assemblies because this file-selection feature is not used often in the app and I want the Main assembly to be as small as possible to decrease startup time. I also want to be able to re-use this file-selection/download component in other apps.
The simple thing I'm trying to figure out is that when the user selects the file and it is downloaded, I will execute a GoBack() to return to the calling page. On the calling page, I need to know if, in fact, the user downloaded a file or if they cancelled out of the operation by simply hitting the back button. I thought the obvious thing might be to just check for the existence of the file in Isolated storage, but that just feel like a bit of a kludge to me.
I also thought about the Messenger, but I'm not sure how that would work across two assemblies.
Any advice would be appreciated.
Thanks
It is tough to know without looking at the code. However, I would suggest that you could pass back a value to the page depending on whether you successfully downloaded your file. Navigate with the value as follows (pass true or false depending on download success):
NavigationService.Navigate(new Uri(("/Page.xaml?download=true", UriKind.Relative));
Then evaluate the page in the destination as follows:
string download = "";
if (NavigationContext.QueryString.TryGetValue("download", out imageurl))
{
}

A solution to embed affiliate data (id/logo) into an installer

I think about a solution (I guess, server based solution), which inserts affiliate ids/logos into an windows installer (setup.exe, set's up a video converter program, nothing fancy) on the fly.
I see the process like this:
1) User clicks on the link with affiliate ID, link requests server for a download file, system on the fly inserts affiliate's logo and id in to this installer... but I guess this solution is rather a science fiction, cause I can't imagine that this can be done on the fly in seconds.
2) So as the second way of doing this, I see a script/program which automatically creates setup files with affiliate's logos and ID's and stores it on the server, for example, once a day.
Any solutions available on the market of doing this? Or, maybe, this can be achieved with simple HEX editing?

Resources