Giter VIP home page Giter VIP logo

kentico / training-kentico-k12 Goto Github PK

View Code? Open in Web Editor NEW
23.0 32.0 48.0 425.72 MB

Kentico CMS/EMS MVC training website

Home Page: https://www.kentico.com/services/training/courses/developers/kentico-mvc-for-developers

License: MIT License

C# 60.49% PowerShell 0.01% HTML 0.68% CSS 1.74% JavaScript 21.86% ASP.NET 12.80% Less 2.44%
kentico cms mvc5 training kentico-ems kentico-xperience

training-kentico-k12's Introduction

Kentico CMS/EMS MVC training website

This is an ASP.NET MVC 5 sample project built for the purpose of our Kentico MVC for Developers training.

It is a website of a fictional medical institution named Medio Clinic. See Kentico Xperience sample sites for a detailed description of this and other Xperience sample sites.

How to run the project

To make the project work, follow these steps:

  1. Make sure your computer meets the system requirements outlined in the documentation.
  2. Clone the repo (git clone https://github.com/Kentico/training-kentico-k12).
  3. Extract either a database backup file out of /Db/MedioClinic.zip or, a database build script out of /Db/MedioClinicSqlScript.zip (if you happen to have an older version of SQL Server).
  4. Start your SQL Server management studio and restore either the extracted MedioClinic.bak file or the MedioClinic.sql file.
  5. Register both the administration interface and the Medio Clinic website in IIS.
    • If you register the administration interface as an application that sits under Default Web Site and has a Kentico12_Admin alias, then you won't have to do any adjustments in Visual Studio.
    • The same applies to the Medio Clinic project: If you register it under Default Web Site as Kentico12_MedioClinic, then you should be ready to compile and run.
  6. Open Visual Studio with elevated credentials, open the WebApp.sln solution and build it (Ctrl+Shift+B).
  7. Open the web.config file and adjust the connection string to your SQL Server instance (if your database instance runs on a different machine).
  8. Close the solution.
  9. Open the MedioClinic.sln solution.
    • If you haven't opened Visual Studio with elevated credentials, then you may encounter an error message saying Visual Studio doesn't have access to your local IIS.
    • If you haven't registed the project under Default Web Site as Kentico12_Admin, then you might want to adjust debugging settings through the following steps:
      • Go to the solution explorer
      • Right-click the MedioClinic project
      • Go to the Web tab
      • Under the Servers section > Project Url, set the correct URL according to your IIS configuration.
  10. Build the solution.
  11. Open the /Config/ConnectionStrings.config file to eventually adjust the connection string (in the same way as you did with the administration interface project).

Troubleshooting

If you encounter a problem while going through the course, please let us know either through the course survey or by filing an issue here in GitHub.

training-kentico-k12's People

Contributors

branci avatar enngage avatar eugenecp avatar janlenoch avatar lukas-xb avatar nicholas-westby avatar petrsvihlik avatar simply007 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

training-kentico-k12's Issues

Rename Kentico project

Currently the business logic is in Kentico project which should be named differently. I would use something related to MedioClinic.

Make the preview work

Motivation

In both the pre-production version and the RTM version, following the instructions to make preview work is obviously not enough.

Solution

  1. Attach the Medio Clinic to the full source solution
  2. Add some BPs to "usual suspect" spots
  3. Attach VS to an appropriate w3wp.exe process
  4. Navigate to the admin UI -> Pages
  5. Switch the display mode to "preview"
  6. Click on an arbitrary page
  7. Wait for the debugger to intercept any of the BPs
  8. Find out what went wrong & fix
  9. Commit to a feature branch
  10. Ask for review
  11. Merge

Unify localization keys

In

    public class EmailViewModel : IViewModel
    {
        [Required(ErrorMessage = "general.requireemail")]
        [DisplayName("general.emailaddress")]
        [DataType(DataType.EmailAddress)]
        [EmailAddress(ErrorMessage = "Models.EmailFormat")]
        [MaxLength(100, ErrorMessage = "Models.MaxLength")]
        public string Email { get; set; }
    }

I would expect general.requireemail to be General.RequireEmail to match the Models.EmailFormat format and it is better for readability as well.

This issue present in multiple view models, not just the EmailViewModel I referenced.

Lowercase only syntax is also used in views:

        <div class="col l6 m12 s12">
                <p>
                    <a href="@Url.Action("Register", "Account")" class="kn-smaller">@Html.Localize("Views.Account.RegisterNow")</a>
                    <div class="col s12">
                        <div class="row kn-row-margin">
                            <div class="input-field col s6">
                                @Html.TextBoxFor(m => m.Data.Email, new { @class = "validate", placeholder = Html.DisplayNameFor(m => m.Data.Email) })
                            </div>
                        </div>
                        <div class="row kn-row-margin">
                            <div>
                                <button class="btn waves-effect waves-light red darken-3" type="submit" name="action">@Html.Localize("passreset.title")</button>
                            </div>
                        </div>
                    </div>
                    <a href="@Url.Action("Signin", "Account")" class="kn-smaller">@Html.Localize("Views.Account.ForgotPassword.AlreadyMember")</a>
                </p>

            </div>

Tune up handling of 404s

Motivation

On certain circumstances, requests to /notfound end up with a generic 403 instead of a custom-tailored not found page.

Resolution

Find out the root cause (IIS logging, research, symptom triage), fix & make edits in the course eventually.

Align the repo with company standards

Motivation

The repo should meet the standard OS project requirements.

Design guidelines

Add a README.md, Code of Conduct, license file, issue templates, PR template. Enforce feature branches by making master protected. Consider turning off unnecessary GH features (e.g. projects).

Error Message

I'm at the part in the tutorial where I should be able to see the home page. But I get this error.

Could not load file or assembly 'DotNetOpenAuth.Core, Version=4.1.0.0, Culture=neutral, PublicKeyToken=2780ccd10d57b246' or one of its dependencies. The system cannot find the file specified.

Please separate services from repository

Please separate the services from the repository. You were talking about MVC best practices when implementing Repository instead of using generated providers.

But an even more important best practice is to separate the service layer from the data layer. Which is clearly ignored here.

Rename ViewBagMessage view / action

The ViewbagMessage is not actually using ViewBag and has nothing to do with it (which is a good thing) so I would avoid confusion and renamed it to something more appropriate (e.g. MessageView ...)

Multiple materialize dropdowns not working on master and builder branches.

document.querySelector instead of document.querySelectorAll is used in the master and builder branches, this causes that only one dropdown can be initialized with dropdown content. This is in the main.js file.

Walked into this bug by following the Kentico MVC Identity tutorial from the master branch.

No Default Web Site is present in Local IIS.

Just a quick 'up and running' nit-pick, but my Local IIS either didn't come with a "Default Web Site" or I deleted it years ago when I first installed it. I've been used to setting my Kentico sites up like they would appear on production. I'd normally use admin.medioclinic.develop, and www.medioclinic.develop are my usual local development names, and attempting to do this on the training had some bad results and caused me to have to start back over from the begining.

It would be nice to have some better documentation or at least a link to how to set that up on the readme.md like the following:

Open IIS and find the website named "Default Web Site"
If one doesn't exist, you must create one.
Make sure that it's using an app pool named DefaultAppPool
Set the Physical Path: %SystemDrive%\Inetpub\wwwroot
Leave everything else blank and hit ok.

From there right click the "Default Web Site" and click add application.
Add the physical path of the CMS directory in this project. Set alias to "Kentico12_Admin"
Repeat the above process for the MedioClinic folder with an alias of "Kentico12_MedioClinic"

Thanks!

Dev04-K12 learning module

I just went through the creation of the Landing pages as well as the advanced widgets and when I try to load the following view for the landing page...

`@section Styles {
@Html.Kentico().PageBuilderStyles()
}

@Html.Kentico().EditableArea("top")

@section Scripts {
@Html.Kentico().PageBuilderScripts()
}`

I get the following error:

The following sections have been defined but have not been rendered for the layout page "~/Views/Shared/_Layout.cshtml": "Styles".

Culture repository x service clash

public class CultureRepository : ICultureService

Hi Risa,
DavidB. noticed that the CultureService is among repositories and that it implements IRepository (
public interface ICultureService : IRepository
).

Is this correct - or should this be moved to services & implement the IService instead?
Thanks for looking into it.
L.

Page should serve content in default culture in case it isn't translated into target culture

Motivation

This looks like a common use case:
Not all of the website content might exist in all culture variants. In this case, developers might want to display content in default culture. The training website in the Essentials module should show how to achieve this behavior.

Example submitted by a customer:
For example, I have 5 doctors in my clinic, all of them having an English description but only one of them has been translated into Spanish.
In my live site, in the English culture, I see 5 doctors but when I switch to Spanish, I see only 1 doctor while I would like to see the 4 others even if their associated information is in English.

Proposed solution

Ideally, this behavior will be implemented globally, e.g., by calling CombineWithDefaultCulture() in DocumentQueryService.

Update MenuRepository

The menu repository uses a slightly different approach to get the custom document query service. Was there any reason for that?

Or can the code be updated so that it inherits from the base repository and matches the approach used on the rest of the pages in the first module? E.g., HomeSectionRepo

Compile MVC Application Error

Hi,
When I compile MVC application, I get this error:
"could not load file or assembly 'cms.application dashboard.web.ui, version=12.0.0.0, culture=neutral, publickeytoken=834b12a258f213f9' or one of its dependencies"
Please let me know how I can fix it?

Thanks,
Zoya

Repositories using TopN1

There are some repositories that are getting documents by TopN(1) and FirstOrDefault. This can lead to inconsistent results when using staging.

DocumentQueryService

When preview is enabled the Published call can be left out and LatestVersion doesn't need true as parameter because true is default value of parameter. When preview is not enabled the query should call Published().PublishedVersion() methods.

HTTP Error 401.3 - Unauthorized

I get this error trying to load the admin for the training site. The forward facing site loads fine.

HTTP Error 401.3 - Unauthorized
You do not have permission to view this directory or page because of the access control list (ACL) configuration or encryption settings for this resource on the Web server.

Language selector shows incorrect language.

Brief bug description

Language selector shows incorrect language.

Repro steps

  1. Make sure you browse the MedioClinic page on English.
  2. Go to 'Contact Us'
  3. Click on the language selector
  4. Select spanish
  5. You get a 404 page, because 'Contact Us' does not exist in spanish
  6. Read the language letter on the language selector. (DE for me, but there is no German setup in Kentico)

Expected behavior

The language selector properly shows "EN".

Test environment

  • Platform/OS: Windows 10, Default vanilla installation of the Demo
  • Browser Chrome
  • Commit 827abeb

Screenshots

image

Where can I find the starting site to follow along the tutorials

I am trying to follow along the tutorials, but the only version of the site I can find is the completed one. Is there a way to download a version of the site that matches up with the starting point of the tutorials? It doesn't appear to be a basic kentico installation,

404

oh man... now I am getting a 404 on the home page.
404

Unnecessary exception in Constructor

I believe that having:

UserManager = userManager ?? throw new ArgumentNullException(nameof(userManager));
SignInManager = signInManager ?? throw new ArgumentNullException(nameof(signInManager));
 AuthenticationManager = authenticationManager ?? throw new ArgumentNullException(nameof(authenticationManager));
ErrorHelperService = errorHelperService ?? throw new ArgumentNullException(nameof(errorHelperService));
LocalizationService = localizationService ?? throw new ArgumentNullException(nameof(localizationService));
AvatarRepository = avatarRepository ?? throw new ArgumentNullException(nameof(avatarRepository));

is not necessary as DI container should throw an exception if it cannot instantiate class and thus it should never reach constructor.

I would suggest veryfing this and probably removing the exceptions from constructors.

Unit Tests for the Business and the MedioClinic projects

Motivation

With the way that this implementation differs from how Dancing Goat has been implemented, it would be good to see how we can unit test the Business and MedioClinic projects.

I believe this would help in convincing developers to use MVC as one of the major benefits for migrating to MVC.

Pagebuilder

At least enable page tab for 1 page
At least implement 1 editable text box, widget, form in page tab.

@Url.Kentico().ImageUrl(...), not @Url.KenticoImageUrl(...)

Brief bug description

I suspect a minor code error in Views/Doctors/Detail.cshtml. The following line...

<img src="@Url.KenticoImageUrl(Model.Data.Doctor.Photo.GetPath())" alt="Doctor's photo" />

Repro steps

  1. Add repo to project solution
  2. Attempt to build
  3. See error

Expected behavior

I believe the correct code would be...

<img src="@Url.Kentico().ImageUrl(Model.Data.Doctor.Photo.GetPath(), SizeConstraint.Empty)" alt="Doctor's photo"/>

Test environment

  • Version - Kentico v12.0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.