MVP Connecting The Triads - mvp

I have a main form with a left and right pane. The left pane displays a list of customers and I have a button the user clicks to show orders. When the user clicks this button I want to show the order details view described below in the right pane.
I have an order details form that will be displayed within the right pane of the main form and will show all the orders for the selected customer.
I have defined view interfaces for both views and there is a presenter for each view.
I want the order details to be able to get a hold of the selected customer so that it can obtain the orders for that customer.
How should I go about it? Event Aggregator? Composite Presenter?

Each pane is not a separate view. By doing that you are tying the specifics of the form to the presenter. The basic idea is that when you're editing a list of customers the presenter should not care how the form is setup.
Your two pane view should extract a list of customers from the presenter and use that list to fill out the left pane. Then when an item is clicked it asks the presenter for the list of orders the customers made and other details.
This approach will solve your problem as now there is a single view. When you click on something on the order and it needs to know the current customer you can refer to the tree view (or combo box, or list view, etc) to see what is the currently selected customer.
The trick to avoiding issues like this is to ask yourself what happens if I make a new form that uses completely different UI elements. Will the presenter have to be altered to reflect that? If the presenter does then you have tied it too closely to the implementation of the view.

Related

Magento: Different products in the different store views under the same store?

I have multi website, multi stored Magento shop, and I have a need to make some products available in one store_view, but not available in the other, where both store_views are part of the same store and website.
All my products are configurable with simple products attached to them. Only way I could think of solving this is registering a new product attribute through which I control where each product goes. That works great for the catalog and lists of products, but I have huge problems with single product view and choosing the configurable product options.
I can't seem to find where in Magento core those option are generated, so I could override that and strict some options for each store view. Basically, I need to know where is this
generated. My last resort would be managing this through AJAX, but there is already a lot of AJAX code and calls in that page that it would be confusing.
Any help or tip would be very appreciated.
I am pretty sure that the way above is not working because the attribute enable/disable product has impact at website level and not store or store view!
So if you do like tomakun says the product will be disabled at the whole website and not just for the store view you choose first!
I have the same problem that I want to assign different products all to one website but to different stores.
So far I just found the solution above to change the visibility at store view level.
But I think this not the optimal solution. It should be possible to disable a product on store level!
This feature is already available by default in Magento.
For bulk enabling/disabling products for a particular store view, do the following:
Go to your Catalog > Products
Select a store view above the product list.
You are now viewing all products included in THIS store view.
Once you have the correct store view selected, select the products you want to Enable or Disable using the checkbox on the left.
Now, using the Actions dropdown menu on top right of the product list, choose 'Change Status', select 'Disabled' or 'Enabled' and hit the Submit button.
Doing this will Enable or Disable the selected products from the selected store view (step 2). This is good for bulk actions but you can also do the same for all products one by one:
Open your product, select the relevant store view on top left of the page. Then in the General Tab, you have status: Enabled or Disabled. Choose the option that you want to apply for the current store view and hit Save.
That's it!

URLs in module not pointing the correct category from index page

I have 2 modules on my home page. One lists most popular, one lists most recent k2 items from 2 different categories, video and blog. The links to the blog entires go to /blog/item/, so the side bar modules are being displayed correctly. But for some reason the video entries are linking to /component/k2/item/, and on that page the modules that are supposed to on the right do not show up at all. The content area takes up the entire width of the site.
What is further confusing about this situation is that i have duplicates of those modules running on certain interior pages, with the same settings, that link to the items correctly. The only reason i have 2 of the same module is because i need that same module to display below the content on index page, and in the side bar on select interior pages.
I do not have a menu item that links to the video category. The main category is Education, and there are 3 sub categories. blog, video, article. There are only menu items for Blog, and for Education. I already have that same module in the some of the interior pages, and it works fine.
what am i doing wrong?
The solution is pretty simple, the explanation is rather complicated. Here is the solution -
Create a new menu, call it hidden links or something. Doesn't matter what is it called, you will not display this menu on the site.
Create a new menu item for the video category.
Assign your modules to that hidden menu item.
If you don't care about what is happening, just know that you can always create hidden menu items to control layout on pages.
If you do care, get a cold drink and get comfortable...
Menu items in Joomla server several different purposes other than providing links for users to get to content. If you are using the core SEF URLs, this is the first place Joomla looks to create those URLs. In general a URL is built like this - joomla install/parent menu item alias/sub menu item alias/content item/article alias.html. Since your video category does not have a corresponding menu item to use for building URLs, it uses the default URL scheme.
The menu item is also the source for the itemID that every page uses. If a particular page does not have a related menu item, it will inherit the itemID from the previous page usually or in the case of k2 items/joomla article it will inherit the itemID from the menu item that links to the parent category of the content. The itemID is used to determine module menu assignment. This is why getting to a particular page that does not have a menu item 2 different ways will often give you pages that look different, different itemIDs were inherited resulting in different modules being displayed.
Since Joomla really counts on the itemID, you should always specify a menu item for any content you are diplaying, even if you do not want to display a link in the menu. By creating a menu that does not appear in a module, you still get the itemID you need for the content, but the menu never appears anywhere. Usually, a link to a category will be enough since child content will pick up that itemID, but in some cases it makes sense to create menu items to specific content items/articles. You would do this any time you want a specific URL for an item. For example, if you wanted to create a URL like your-site.com/special-offer, you could create the content item for the special offer, then make a menu item with the alias special-offer to get the correct URL.
Joomla also uses the menu item for browser titles and page titles. Your question is not related to that so I'll stop here, but as you can tell it is pretty important to know when to create a menu item for your content.

Magento - Link attributes with sub-categories or include attribute value in navigation

I'm creating a video game ecommerce store and I need to have the navigation structured so that the navigation bar contains all the major consoles. When someone hovers over one of the console navigation links, a drop down menu appears with each genre option. For example, once you hover over Xbox 360, a drop down menu with Action, Adventure, etc. will show up.
My first thought is to create sub-categories in each major category that represent each genre. There would also be a custom attribute field for genre. I would then have to manually export the product database and fill it in for each product.
Is there an easier way to do this that I don't know about? Is it possible to have attributes as the drop-down menu links in the navigation bar?
One thing I've noticed in the Manage Attributes section is the option to Use in Layered Navigation. As far as I can tell, this links the attribute in the sidebar and not the main navigation bar.
For reference, my website is at http://allyourga.me
There is no default functionality to do what you are describing. The default Magento way to accomplish this is via subcategories. You are correct about Layered Navigation, that is a sidebar feature inside the catalog.
You could do some custom coding around showing the attributes in the dropdown menu, but the dropdown links lead to categories anyway, so you'd need to create those regardless. Another approach would be a cronjob that created the necessary categories for the products and placed them into those categories on command. You'll need to add a "console" attribute to make this work as well.
Hope that helps!
Thanks,
Joe

custom menus based on roles in a pivot page application

There is a menu that has all the options. But that needs to be customised based on the role of the use.
Like:
Student will have access only to the student related stuff
Prof will have access to stuff related to him
Student + Prof will have access to both of them put together.
Is there some way like I can hide a specific grid item and display the rest of them in windows phone 7 pivot pages.
In Silverlight, you can hide elements (such as the contents fo a grid) by setting Visibility to Collapsed.

GUI patterns to edit data with many-to-many relationship

I often run into a situation where I need to come up with a GUI to edit data that has a n:m relationship. I'm looking for user friendly GUI ideas.
[table1]
|
/|\
[table2]
\|/
|
[table3]
Usually the GUI resembles something like this:
Grid that shows all items from table1
Add table3 item... (shows modal window with table3 items)
Grid that shows all items from table3
After the user picked a table3 item, I add a new row to table2 and refresh the grids.
Disadvantages:
You can only add table3 items to table1, and not the other way around;
You can only browse table1 items and see related table3 items;
I need to have one filtered grid of table3 items, and a similar one to pick new items;
My question:
Does anyone know a better way to visually browse and edit data that has a n:m relationship?
Or any nice patterns that I could "steal" from existing software packages?
Solution 1
If the data sets are not too big, use a table and allow users to place checks in cells (table 1 is X axis and table3 is Y axis).
You can probably do this for larger table1/3 data sets as long as you allow users to filter or otherwise limit which values are displayed on x and y axis.
Solution 2
To quote from this page, "A many-to-many relationship is really two one-to-many relationships with a junction/link table".
As such, you can, as one solution, simply take your own solution and resolve your first 2 dis-advantages by having screens/dialogs to go table 1=>3 as well as 3=>1.
Not a perfect solution but at least provides all the needed functionality
Solution 3
Somewhat similar to your own solution:
Show a table based on table1, with:
B. col1 containing table1 elements
C. col2 containing a list of all elements from table3 already associated with this element from table1.
The list can be either horizontal if there are usually few elements associated, or vertical (scrollable) if horizontal to too wide.
The important part is that every displayed element from table3 has a "delete" icon (x) next to it to allow removal quickly.
Allow choosing which element from table1 you want to add mappings to.
There are 2 ways of doing this - either add a checkbox to every row in your table, and have one button labeled "add relationships to selected rows" (wording needs improvement),
or simply have a 3-rd column in the table, containing button/link for adding relationships to that individual row.
The former is a good idea if the user is likely to often add exactly the same set of element from table3 to several rows from table1.
When "Add" button/link is clicked, you display a filterable multi-select list of elements from table3, with "add selected" button.
As in your solution (see my #2), this is a-symmetrical so you should implement a mirror UI for mapping from table3 to table1 if needed.
This is an old question, but as I faced the same problem again just now, I came up with this:
2 grids, side by side, showing table1 and table3 items, with paging, if necessary.
Both grids have a top toolbar which allows filtering by a value from the opposite table. Depending on your data and your gui framework, it can be a drop-down combo grid, or an auto-complete text input.
Both grids have checkboxes (last or first column)
Both grids contain an inline button/action on each row, to automatically filter the other grid on that item.
Only one grid is shown/marked as "active" or "master" at any given time (to make it clear to the user, which side of the relationship they are viewing/controlling).
When you select an item in grid1, grid1 becomes active and all items in the other grid have checkboxes ticked if they are associated with the selected item.
Vice versa, when you select an item in grid2 (table3), grid2 becomes active, all checkboxes in grid2 are blank (or dimmed-out) and checkboxes in grid1 indicate an association with the selected item.
The filtering part is made easier based on the inline button described in step 4.
I believe this solution would satisfy all your requirements.
Here's a possible solution, given in the form of an employees-to-projects m:m relationship. Each employee can work on many projects, each project can involve many employees.
From left to right, you show the following:
A panel showing the details of the currently selected employee.
A list of all employees, where each item in the list shows the employee's name as a clickable link or button (to display details in the detail panel). At the head of the list is a toggle button which filters the projects list to only those associated with the currently selected employee. At the foot of the list is a button to add a new employee, which display an empty details panel ready to accept input.
A vertical space in the middle with a single "Link" button allowing the user to link the currently selected employee with the currently selected project. Clicking this button would open a dialog allowing the user to enter details of the link (i.e. how long the employee is assigned, what role the eployee will play, etc).
A list of all projects, where each item in the list shows the project's name as a clickable link or button (to display details in the detail panel). At the head of the list is a toggle button which filters the employees list to only those associated with the currently selected projet. At the foot of the list is a button to add a new project, which display an empty details panel ready to accept input.
A panel showing the details of the currently selected project.
Obviously, you'd have to limit the size of the details panels, maybe by only showing the details relevant to the m:m relationship. You might even add a button on the details panel to open a more detailed pop-up window, or you might do away with the details panel altogether, if you're mainly interested in managing the links. This UI would work really well on wide-aspect screens.
HTH! Klay
Let me use the One Customer Has 0 or many Orders relationship example. If user wants to see the Orders of particular form I would suggest the following Use Case:
The User clicks the Search Customer link:
The System presents the Search Customer Form having the search criteria to filter on
The User fills the Search Criteria and hits the Search button
The System presents a list of the Customer ... by the matched criteria
The User hits the Open button in front of A Customer
The System presents the Customer ( in totally new page with "Back to Search Button ")
The new Page has 3 panels - 1 panel for Customer Details , second Panel for the list of Orders and 3 panel which gets populated when a Order is clicked. If the number of Orders is greater than 20 I would put a Search Orders link which guides to entirely new Search form for Orders with a predefined CustomerId fixed with the current CustomerId selected.

Resources