Future publish in Sitecore Part 1

Hello,

I think all of us tried this at some point looking at out of the box features and surprise surprise you cannot do it 🙂

So here is my approach and it is a very simple one which can be extended in a much more complex piece of code but for my requirements it will do.

I have created a cs file with the code:  AutomatedPublish (not sure if its a English word)

public class AutomatedPublish
{
public void FuturePublish(Item[] items, Sitecore.Tasks.CommandItem command, Sitecore.Tasks.ScheduleItem schedule)
{
foreach (var item in items)
{
// The publishOptions determine the source and target database,
// the publish mode and language, and the publish date
Sitecore.Publishing.PublishOptions publishOptions = new Sitecore.Publishing.PublishOptions(
item.Database,
Database.GetDatabase("web"),
Sitecore.Publishing.PublishMode.SingleItem,
item.Languag,System.DateTime.Now);

// Create a publisher with the publishoptions
Sitecore.Publishing.Publisher publisher = new Sitecore.Publishing.Publisher(publishOptions);

// Choose where to publish from
publisher.Options.RootItem = item;

// Publish children as well?
publisher.Options.Deep = false;

// Do the publish!
publisher.Publish();
}
}
}

In sitecore you will have to create the command in the System -> Tasks -> Commands.

Continue reading

The winter is coming

Hello people,

The winter is coming… and I need to start a new running plan otherwise I will lose my freaking mind in this darkness that lies ahead. Luckily the nike running app has a new look and update so lets give it a go. Because I ran before I started with a 8 week plan which has 4-5 runs a week with an average of 25 km per week. In addition the nike running app integrates with the Nike Training Club. It keeps getting better and better.

Also the app for the apple watch is updated so now you can run without your phone.(Awesome!!) but you will need your phone if you want to track the route with the gps.

I will keep you posted with updates along the plan.

getmorefit

#getmorefit #2016gobigger

 

Flying Zuzzi v1.2

Hello,

You can now play Flying Zuzzi on your iPad just search for the game under iPhone apps in the iPad AppStore. It is not yet a native app but it looks good.

 

IMG_2905

Flying Zuzzi

As I was building this app it occurred to me that I need to add some features to it but was it a good ideea to extend an existing app? is this app to much of a copy? do people only create this Flappy Bird game to gain profit ? where is my passion ? what can I bring to the AppStore to be fresh and new?

This are just a few of the questions to which I try to find answers. So I decided to create a final version of my first app ,Flying Zuzzi and move on to something great. I had plans on how to expand this game and make it better but it will never outpass Flappy Bird and its not my idea which makes me feel sad that I will always be in the shadow of the first developer who created this game.

Moving forward I have some good ideas for games and apps so stay true to your passion and find your own way that will bring you joy and fulfillment.

All the best to you,

Vio

Sitecore fun fact #2

Hello,

Publish with related item will not publish the children of the related item.

Example: Carousel item on the homepage which has a data source a item from a bucket.

  • Homepage Carousel
    • Slide 1
    • Slide 2
    • Slide 3

If you publish your home page with related items but your changes are only on the slides SURPRISE it won’t publish the slides.

This can be easly fixed with a custom pipeline.

Just replace the sitecore existing pipeline code with your custom -> Sitecore.Publishing.Pipelines.GetItemReferences.AddItemLinkReferences


public class AddItemLinkReferences : GetItemReferencesProcessor -> GetReferences()
private System.Collections.Generic.IEnumerable<Item> GetReferences(Item item, bool sharedOnly)
{
Assert.ArgumentNotNull(item, "item");
System.Collections.Generic.List<Item> list = new System.Collections.Generic.List<Item>();
ItemLink[] source = item.Links.GetValidLinks();
source = (from link in source
where item.Database.Name.Equals(link.TargetDatabaseName, System.StringComparison.OrdinalIgnoreCase)
select link).ToArray<ItemLink>();
if (sharedOnly)
{
source = source.Where(delegate(ItemLink link)
{
Item sourceItem = link.GetSourceItem();
return sourceItem != null && (ID.IsNullOrEmpty(link.SourceFieldID) || sourceItem.Fields[link.SourceFieldID].Shared);
}).ToArray<ItemLink>();
}
System.Collections.Generic.List<Item> list2 = (from link in source
select link.GetTargetItem() into relatedItem
where relatedItem != null
select relatedItem).ToList<Item>();
  System.Collections.Generic.List<Item> list3 = new List<Item>();
            foreach (var itemS in list2)
            {
                list3.Add(itemS);
                if (itemS.HasChildren)
                {
                    list3.AddRange(itemS.Children);
                }
            }
            foreach (Item current in list3)
            {
                list.AddRange(PublishQueue.GetParents(current));
                list.Add(current);
            }
return list.Distinct(new ItemIdComparer());
}

I am open for suggestions if you have a better solution.

Thank you,

Vio

The road to my first app

Hello,

The first time I had my own PC was aroud the year 2000. I remember the day like it was yesterday. I was coming up the stairs when I heard my mom say “Come quick we have a suprise for you”. Thinking it is a toy or a tv I would have never imagined it is a PC. It was 486 PC with a 15 inch monitor all white, all shiny. I think a tear of joy was sitting in the corner of my eye and I was stunned for a few minutes.

Since then I always wanted to unterstand how it works and how can I alter the code and create my own programs. My imagination was working non stop thinking of what I could build  starting from creating cool things and pushing it near to hacking NASA :))

Trying to control the software I attended a highschool with extra courses on Computer Science and there I found pascal program. With this choice I hit a wall because it was never how I imagined it would be.

Four years later I thought I could create robots to interact with the world but yet again I hit wall. After the four years at the university I realized that my dreams and my ideas will never be understood by any school. So I pursued my other passion which was web development which I still enjoy today. But, on the back of my head,  I was always thinking for something that could offer me the chance to build something from my own ideas and imagination, something where the possibilities are endless. And then I found Apple Developer program.

While proving  myself that I can really create games, Flying Zuzzi emerged.

Flying Zuzzi

Flying Zuzzi

Here is a link to the app: https://itunes.apple.com/app/id1039702669?mt=8

Thank you for reading,

VP

Sitecore fun fact #1

Hello,

I came across this funny fact today:

  1. If a parent item has an unpublished date set up, lets say today and you save the setting but you don’t publish the change to the web.
  2. Then you go to a child item and publish it.It will delete everything that sits under the parent item to the child but it will not show any warning message like: the version you try to publish will be not displayed. Is life fare ?!?! I don’t know. But it should be some kind of message(my opinion!?).
  3. The only error you will get is this “layout not found” which will make you crazy and will force you to start republishing layouts and sublayouts and eventually punch the monitor 🙂 (which I did, but this may not apply to all)

VP

Flying Zuzzi

Hello people,

Flying Zuzzi

Flying Zuzzi Episode I

This is my first app so please be gentle with Zuzzi as she tries to escape the high gardens where she was held captive by her evil twin Zantos. The story begins in a small kingdom of flufy and colourful animals. King Zantinii had twins, Zuzzi and Zantos and because Zuzzi was first born she was the true heir of the kingdom but her brother Zantos never agreed with this and he was mean with Zuzzi so after the king died he took Zuzzi in the High Gardens of Rocky Mountains and took the throne for himself.

This is just a snippet of the story that follows. So stay tuned and subscribe for the future episodes of Flying Zuzzi.

Flying Zuzzi Episode I: The beginning of an adventure

Zuzzi has to fly over trees and try to advance as much as possible. This game will focus in controlling Zuzzi as you guide her to escape the forrest.

Flying Zuzzi Episode II: Friends join the adventure

Little description: Zuzzi will be joined by her friend Coco.

Flying Zuzzi Episode III: Battle for the throne

Description is secret.

 

Thank you for reading.

Cheers.

Mortal Kombat X on my PS4

Hello,

Finally the Mortal Kombat X game is available for ps4. I really like it because it takes me back to my first arcade game and also to my first experience with PlayStation 1. I did a short video of my favorite character Scorpion fighting Sub Zero.

The graphics are amazing and the game-play is as cool as SubZero powers.

Get over here!!!!

Nike fuel band

Hello runners,

I bought this gadget from amazon because it was out of stock on the Nike website for 120£ which is a massive sum of money for it’s features. Later on to find it back on the Nike website at 89£. Damn you universe for this.Damn_b685d9_2284301

Should I make a list of things that Nike fuel band does?

Non sense, that would be a very short list. Lets make a list of the things missing from it.

Nike Fuel Band SE it does not have:

  1. A vibrate function to let you know about notifications like staying to much without moving.
  2. An alarm to wake you up in the morning.
  3. Funny number 2 it dosent even track properly your sleep. Basically you start a session and then in the morning you tag it as sleep. Which changes the background of the session and shows you a picture of a moon :))))) that’s it.
  4. No GPS.
  5. The poor quality of sessions(log activity). I logged snowboarding but other than the name no OTHER useful information.

In other words this gadget is a fancy watch with LED’s that shows the following: steps, calories and hours won(if you move a lil bit every hour you win it).

You can get all of these information’s in a free app from iTunes. So there is no need for you to spend money on this device. I advice you not to buy it.

My reason to buy was that I wanted a little more information for when I am running but it turns out the Nike Running app is enough. This gadget brings no value. Unless you want to see 10-15 LED`s

My recommendation is to look for other gadgets like Fitbit/Jawbone.

Thank you,

VP