EPAM Activities Version 1

Admin App

Adding an Event

The admin app let’s the user create events. The events are stored in the Easy Table TodoItem in Azure.
There is a table that shows all the non-expired events. There is also an ‘add event’ button.

1_app_main

Click on the add button and you’ll see this screen. In this version, you simply need to supply the event’s name and its expiration time.

2_add_event_screen

Insert the event title and expiration time like so:

3_input_event

Then click on the add button. You’ll see that the adding of the event is in process as the app sends the data to the Azure server.

4_adding_event

Once the data is sent to the server, the app will then pull (refresh) the data from the server. You will get a successful message confirmation.

5_successfully_added

In the Easy Table results, you will see the results:

6_easy_table_result

Once the data is sent to the server, the app will then pull (refresh) the data from the server. This updates the table on our app as you can then see the results.

7_device_result

Expiring (removing) an event

There are two ways for an event to be expired. First way is to simply let the expiration time pass and all client apps remove the event. This is because all client apps are programmed to ONLY show events with non-expired time.

The second way is for the admins to remove the events manually.

1_swipe_to_delete

On a row that you want to remove, swipe left and you’ll see the complete button. Click on it.

2_item_marked_for_removal

You’ll see that the app processes the removal of the item.

3_removal_success

Once its successful, the item will be removed from the backend, and be reflected on the client apps.

Client App

Let the app load up the log in screen. This is Microsoft’s proprietary log in screen.

1_sign_in

Recent Table

Recent table means non expired (expiration time is larger than now) events that are still available for registration:

2_recent_table

You should be able to see the data in the Easy Table with a datetime that is larger than now:

3_recent_easy_table_not_expired

History table means expired events. This means these events’ expired time is less than now. It WILL NOT be viewable in Recent Table. It will be viewable here in history table.

4_history_table

5_history_easy_table_expired

From the main screen, there’s a user icon on the top left. Click on it to go to your user profile.
You will see the scheduled events tab.

Scheduled events are:

  • Non expired events (expired time is larger than now)
  • you’ve registered for it

Currently in our example, there is none. If you do want to register for an event, left swipe it, and click on ‘Register’.

6_scheduled

Registering for the Data

6_a_register

If you want to register for an event, go to the recent table view in the front page. You’ll see events that are available for registration. Left swipe the row and you’ll see a register button. Click on the button to register for that event.

6_b_registered

Once an event is registered, you cannot register for it again. Thus it is grayed out.

6_c_user_profile

Go to your user profile. You will then see that it appears in your scheduled table view.

6_d_easy_data

Go to the Azure Easy Table to verify the data. Then see that your user email appears.

In your User Profile go to the user tab. Previous events means

  • Expired events (expiration time is less than now)
  • You’ve registered for it

7_previous

You can verify the data in the Easy Table. You will see that you’ve registered for this event in the past. Also, the event has expired.

8_scheduled_easy_table_expired

Finally, if someone else wants to log into their account, you need to logout, and let someone else log in.
But if its just you using the app, you don’t need to do anything. The app will automatically refresh your tokens for you.

9_logout

SightCore Training notes

Everything in Sitecore is an item

An item is a unit of content, not a page

Items are not files

Each item has a GUID

Items are represented in a hierarchical structure called Content Tree

Sitecore interfaces display all or part of the Content tree.

Some items are addressable via URL.
Items’ URL is determined by position in the Content Tree.

work in Master database

Client browsers retrieves data from Web Database.
Synchronization between Master and Web database is called publishing.

Which experience editor mode would you use to add a new component? Designing mode

Desktop,
Content Editor,
Experience Editor

Sitecore is ASP.NET application

  • Master – authoring database, work in progress
  • Web – published, live content
  • Core – settings and membership

xDB – MongoDB NoSQL Collection starting with v7.5. Collects information. Then xDB aggregate and pushes them to Reporting DB.

Reporting
SQL server. Replaces Analytics DB previous to v7.5. Multi dimension data. Reporting search for analytics, which comes from Mongo. MongoDB has most detailed data.

File System

website – web root of ur application
database – database files
data – license, site core logs, packages, indexes

Installation Scenarios – recommended minimum
Server for CMS
DB server
Content Delivery server

When a request comes in, Sitecor maps URL to an item in the content tree, and dynamically assembles presentation

3 db that are installed by default: Web, Master, and Core

Foundation Features – content versioning, multi language, device

What is the name of the digital marketing management part of the Experience Platform that collects and aggregates contact information?
xDB

Creating Data Templates

– item is unit of data in SiteCore
– has fields organized into field sections. Field section mean group of fields

Data templates – needed to create item
– fundamental building block in Sitecore
– define a type of item
– determine what field sections, field types, and field names compose an item
– field types determine the editor control used in the tools. i.e Image, Rich Text…etc

Deciding the Data Structure Architecture

project should start with focus on designing your data structure (like sql schema)

Building Data Templates

Data Analysis, then build base Templates
Other templates inherit fields from base templates.

Content Base (base template for other templates)
– Heading
– Main Content
– Main Image

Easiest way is to use Sitecore Rocks.

Field Source – extra configuration. Different meaning for different field types.

Image – field source means where you can select images
Rich Text –

An inherited field source, cannot be overridden

An item’s type is determined by “Data template” used to create it.

What is an item composed of?
Field sections and fields

What do you need to specify when creating a new field?
field name, and type.

Inherited Structure

Field names should be “unique”, but field sections with the same name will “merge”.

System define fields by ID. but you only see the name. So try to have unique field names.
So in your derived template, make sure you don’t have the same field name.

However, if your section name is same, its okay, because the parent template and the derived template’s section will merge.

iN WHICH SCENARIO WOULD U use data template inheritance?
When fields are repeated in multiple data templates?

Why is it important to think of your data template creation and inheritance structure from the beginning?
Refactoring template inheritance may cause data loss.

By default, all data templates eventually inherit from which sitecore data template?

standard template.

What happens if the same field name is used in 2 separate inherited data templates?

fields do not merge
both fields will appear (with different ID, but same string)

Standard Values allow you to define defaults

Standard Values Item – Manually create

Child item of the data template
Includes the data template fields and all inherited fields
Always named __Standard Values

Standard Values and Inheritance

Tokens

Tokens are replaced the moment an item is created.

$name, $id, $time, $parented
you can add your own tokens programmatically

i.e:

Heading:
$name

Item is created
Item Name: Holiday

Heading:
“Holiday”

Describe the standard values item:

always named __Standard Values
child item of owning data template
is a special instance of an item – contains all inherited fields

What type of settings can be applied to standard values?
default field values, default insert options, default presentation, default Workflow

What are two types of default field values?

dynamic ( uses tokens ) and static.

How do tokens work?
Tokens are replaced when an item is created. For example, there are tokens for the name of the item or the ID of the parent item.

Name 3 tokens:

$name, $date, $id $parentID

What are Insert Options

Authors require a list of allowed item types (data templates)
Developers and admins are less restricted

Insert Options…
Define allowed child items
Allow authors to build multiple levels of content in the tree
Reduce risk of human error
Usually defined on standard Values
Can be overridden on an item

Insert Options

List of data templates that can be created/inserted under a specific item.

Where should Insert Options be configured?

On the data template’s standard values which can be overridden at item level.

Standard Values – is a child item of a data template and is the mechanism for defaults when items are created.
Field – single line text, rich text, image, general link…etc. type determines the interface that the author sees for editing that field.

Data template vs Standard Values

Data Template – field sections, fields, template icon, base template inheritance

Standard Values – default field values, default insert options….

Data Templates – inheritance, icon,
Data Template Standard Values – Default Values, Insert Options, Tokens

Presentation details?

Configuration that determines what an item looks like when requested by the browser

Break designs into units of reusable functionality.

Creating a Layout

One Layout for all items in our site

A Layout is a canvas or the ‘scaffolding’ for a site.
The training site BasicSitecore defines a single shared Layout for all items within the site.

Assign Layout on standard values (consider setting Layouts on base templates)

A layout is
an .aspx file on the file system
a corresponding Layout definition item in the tree
Linked by the Path field

Note: the item and the file can be referred to as a “layout”

Assigning a Layout
Items must have a Layout to be viewed as web pages

Items must have a Layout to be viewed as web pages
Layouts are part of an item’s presentation details
Recommended practice – assign layouts to the data template’s standard values
An item can have one layout per device ( mobile, print, rss )

Layout – .aspx file

Layout definition item connected to a layout file?
Path field on the layout definition item points to the location of the .aspx file

What is a Component?

Sublayout – (sitecore’s wrapper for a Web User Control)
XSLT Rendering
Sitecore Web Control

All components consists of…

Definition item in Sitecore:

/sitecore/Layout/Sublayouts
/sitecore/Layout/Renderings

File on the file system:

.ascx(Sublayout)
.xslt (XSLT rendering)

Linked by a Path field on definition item

A Sitecore Sublayout is:

– most commonly used component in a web forms implementation
– .ascx file on the file system

Interface

Boxing

http://www.csharpstar.com/difference-between-boxing-and-unboxing-in-c/

Boxing

  • The first two lines of code declare and initialize value type variable i and reference type variable oi.
  • In the third line of code, you want to assign the value of variable i to oi. But oi is a reference type variable and must be assigned a reference to an object in the heap.
  • Variable i, however, is a value type and doesn’t have a reference to an object in the heap.
  • The system therefore box the value of i by doing the following:

    • Creating an object of type int in the heap
    • Copying the value of i to the int object
    • Returning the reference of the int object to oi to store as its reference

    Memory is allocated on the heap that will contain the value type’s data and the other overhead necessary to make the object look like
    every other instance of a managed object of reference type .
    The value of the value type is copied from its current storage location into the newly allocated location on the heap.
    The result of the conversion is a reference to the new storage location on the heap.

    Unboxing

    What is UnBoxing Conversion?

    Unboxing is the process of converting a boxed object back to its value type.Unboxing is an explicit conversion.

    The system performs the following steps when unboxing a value to ValueTypeT:

    It checks that the object being unboxed is actually a boxed value of type ValueTypeT.
    It copies the value of the object to the variable.

Lambda

Search for string in string array

lambda

Result:

otwone
two
threetwo
fotwour
two

LinQ

Result:

otwone
two
threetwo
fotwour
two

Determine if any ints are larger or less

Lambda

Result:

less than or equal to 3: 3
3
more than or equal to 7: 8
8
less than or equal to 3: 1
1
more than or equal to 7: 7
7
more than or equal to 7: 9
9
less than or equal to 3: 2
2
more than or equal to 7: 8
8

Find age in Array of Structs

linQ

Delegates for c#

Doubly Linked List

Situations for using a Doubly Linked list would be

  • deck of cards
  • browser cache
  • Metro

A new node’s previous points left, and next points right. When we add a new node, we pass in the linked list’s tail into the new Node’s constructor.

The new Node will re-wire it so that its previous points to the last node of the linked list (via the tail).

Then have the next of the last node point to the new Node.

Then, the linked list will proceed to re-assign the tail to the new node. Thus, completing the push.

Also, each node is connected with each by 2 traits:

  • The first node’s next points to the second node. The first node’s previous points to the node on its left side. (or bottom, if you are looking at it vertically)
  • The second node’s previous points to the first node. And its next points to the node on its right side. (or top, if you are looking at it vertically)

Getter/Setters

Getter setter is done by first declaring a name that matches your property but with a capital first letter. Then, you use keywords get and write a function for when you retrieve the property.

Use keyword set to write a function where you assign another value to your property. The incoming value is designated as keyword “value”. The value keyword is a contextual keyword, that is, it has a different meaning based on its context.

Inside a set block, it simply means the value that the programmer has set it to.

Outside of a set block, you can use value as a variable identifier, as such:
int value = 5;

You’d use it like this:

myList.Count = 222;

Doubly Linked List source

queue

For queues, we append new node at the tail end, and the tail take on its next.

The head pointer stays in place at the first node. When we execute something, we pop from the queue, and the head moves to next.

Stack

Stack appends (or pushes) at the end. And pops at the end also. hence, all we need is one pointer to do that.