Inhalte aufrufen

Profilbild

Best aproach for a new kind of dashboard


  • Bitte melden Sie sich an, um eine Antwort zu verfassen.
7 Antworten zu diesem Thema

#1 net4u

net4u

    Advanced Member

  • Members
  • PunktPunktPunkt
  • 48 Beiträge

Geschrieben: 17 September 2015 - 14:23

Hi,

 

I plan to implement a kind of dashboard/OLAP tool.

What can be the best and simple approach to do this? At first sight I think obvious at a simple view for this but also I think to not interfere with natural evolution of SmartStore. On other way I may think at a plugin.

Anyway I must have acces to catalog, categories, manufacturers and customers. I think to be available thru admin menu as direct menu entry at root level.

Any opinions?

 

thnx



#2 Marcus Gesing

Marcus Gesing

    SmartStore AG

  • Administrators
  • 3799 Beiträge

Geschrieben: 17 September 2015 - 15:16

A new plugin that provide new admin-page(s) would be a solution. The attached image shows an example of the head of such a page.
It's also possible to append new menu items to the admin menu, see for instance \src\Plugins\SmartStore.GoogleMerchantCenter\AdminMenu.cs.
Use the service project to access entities from your plugin, for example ICategoryService, IProductService, IManufacturerService,
ICustomerService.

Angehängte Bilder


Marcus Gesing

Smartstore AG


#3 net4u

net4u

    Advanced Member

  • Members
  • PunktPunktPunkt
  • 48 Beiträge

Geschrieben: 17 September 2015 - 19:07

Thank you Marcus

 

By the nature of what I want to implement, my "product" is simple and predictable. Mostly I need a ViewModel as data source in very generic speaking. An I need to interfere as low as possible with possible future changes in SmartStore.

 

It exist an plugin example that produce as final result a view, for having an example of implemenatation?



#4 Marcus Gesing

Marcus Gesing

    SmartStore AG

  • Administrators
  • 3799 Beiträge

Geschrieben: 17 September 2015 - 19:46

There is no plugin that exactly do what you plan to do but it's not difficult to develop. The main thing with regard to views is what you can see in above screenshot, namely setting "Layout" to the admin layout view path which gives you the admin frame around your view. All the rest is standard MVC as you can see in any .NET plugin: a plugin class inherited from BasePlugin, creating controller, view model and view, and mapping a route to your controller (see RouteProvider.cs).

Marcus Gesing

Smartstore AG


#5 net4u

net4u

    Advanced Member

  • Members
  • PunktPunktPunkt
  • 48 Beiträge

Geschrieben: 17 September 2015 - 20:00

Thanks again Marcus,

 

Maybe I was not enough clear. Of course is not exist now a plugin to do this.

I know how to implement this need I have, in terms of MVC application (let say a new empty application). I just have to understand how to implement this as plugin (e.g. a plugin that render a view that say "Hello world and have a nice day @model.name") for SmartStore



#6 Marcus Gesing

Marcus Gesing

    SmartStore AG

  • Administrators
  • 3799 Beiträge

Geschrieben: 17 September 2015 - 20:42

I've extended the dev tools plugin to demonstrate that.

 

The page can be accessed through /Plugin/SmartStore.DevTools/BackendExtension or uncomment the menu appending in AdminMenu.cs to append a link to the plugin menu item.

Marcus Gesing

Smartstore AG


#7 net4u

net4u

    Advanced Member

  • Members
  • PunktPunktPunkt
  • 48 Beiträge

Geschrieben: 18 September 2015 - 07:38

Thanks again.

 

If I want to relocate this not under Plugins submenu, but for example under Dashboard or Sales submenu, or simply as root level menu entry where I have to change? I see pluginsNode, but I don't know what are the others node(s).



#8 Murat Cakir

Murat Cakir

    SmartStore AG

  • Administrators
  • 1118 Beiträge

Geschrieben: 18 September 2015 - 17:04

The pluginsNode passed to AdminMenu.BuildMenuCore() is a TreeNode with powerful navigation capablities. You can add yout custom menu item wherever you want:

pluginsNode.Parent.Append(menuItem);

Adds your custom menu item to the end of the root menu (because parent of pluginsNode is the root)

pluginsNode.Root.SelectNode(x => x.Value.Id == "sales").Prepend(menuItem);

Finds the menu item with ID sales (see sitemap.config for ID reference) and adds your custom menu item as its first child.


Murat Cakir
SmartStore AG