The following tables list the method names and objects that are available to turn functionality on and off for supported events in the view models for the starter store. The JavaScript code for the view models typically can be found in a path that resembles the following after you map a drive to the SharePoint Server 2013 files. (Z:\Scripts\ViewModel)
The following table lists methods for
Microsoft.Dynamics.Retail.SharePoint.Web.UI.ViewModel.AddToCartViewModel. The code for this view model is found in the file AddToCart.js.
Method Name Data Objects Available
Description OnAddToCart,
OffAddToCart None Raised on a call to AddToCart. OnAddToCartSuccess,
OffAddToCartSuccess ShoppingCart Raised after a successful return from AddToCart. OnAddToCartFailure,
OffAddToCartFailure None Raised if no response is returned from a call to AddToCart.
The following table lists methods for the
Microsoft.Dynamics.Retail.SharePoint.Web.UI.ViewModel.CheckoutViewModel. The code for this view model is found in the file Checkout.js.
Method Name Data Objects Available
Description OnCheckout,
OffCheckout None Raised on a call to the Checkout method. OnNoItemCheckout,
OffNoItemCheckout None Raised on a successful response to the AddToCart method. The following table lists methods for the
Microsoft.Dynamics.Retail.SharePoint.Web.UI.ViewModel.ShoppingCartViewModel . The code for this view model is found in the file ShoppingCart.js.
Method Name Data Objects Available
Description OnBeforeRender,
OffBeforeRender ShoppingCart Raised on a call to the Render method of the shopping cart view. OnAfterRender,
OffAfterRender ShoppingCart Raised after execution of the Render method of the shopping cart view.
OnRemoveFromCart,
OffRemoveFromCart ShoppingCart Raised on a call to the RemoveFromTCart method. OnUpdateQuantity,
OffUpdateQuantity ShoppingCart Raised on a call to the UpdateQuantitymethod.
The following table lists methods for the
Microsoft.Dynamics.Retail.SharePoint.Web.UI.ViewModel.MiniShoppingCartViewM odel. The code for this view model is found in the file MiniShoppingCart.js.
Method Name Data Objects Available
Description OnBeforeRender,
OffBeforeRender ShoppingCart Raised on a call to the Render method of the MiniShoppingCartViewModel. OnAfterRender,
OffAfterRender ShoppingCart Raised after execution of the Render method of the MiniShoppingCartViewModel. OnShow, OffShow None Raised on a call to the Show method
of the MiniShoppingCartViewModel. OnHide, OffHide None Raised on a call to the Hide method of
the MiniShoppingCartViewModel.
Design and Import/Export Packages
In SharePoint 2013, Design Manager help web developers and designers build and export the visual design of a SharePoint site collection as a package. This package can be distributed easily to customers or other designated groups for installation on their site collections. This new feature reduces the complexity of transporting designs, and makes it easier for customers to outsource the visual design of their sites. For example, some usage scenarios can include the following:
New Design - A company with limited web design capabilities might contract a vendor agency to update their current SharePoint site with a more modern interpretation. The agency can create the site and easily package the contents for importing back into the company SharePoint farm.
Customization
Cross-Site Publishing - An enterprise IT department that uses cross- site publishing in SharePoint 2013 may have to share a visual design across multiple site collections. They create the site in-house and want a simple way to transport the design across several SharePoint
websites. The design package functionality through Device Manager enables them to export and import with reduced administrative support and complexity.
This topic can help you understand design packaging in SharePoint 2013 by providing an overview of package creation. This topic also offers workflow
guidance for package exporting and importing and discusses required permissions for specific operations and design package architecture.
Creating a design package
A user creates a design package, which is known as a SharePoint solution package (.wsp file), on their SharePoint site through Design Manager in Site Settings. The steps for creating the package follows other Design Manager steps for branding and publishing a SharePoint site. This includes uploading design files, creating a master page, and editing page layouts. After the site is published, it is a fairly simple process to create the .wsp file for export.
This figure displays the option in Design Manager for naming and creating the design package.
FIGURE 3.4: CREATING A DESIGN PACKAGE
You also can import a design package from another SharePoint 2013 site collection through Design Manager on the Welcome page, or by selecting Import design package in Site Settings.
There is a check box for including the search configuration in the design package. Select this option if you are designing a site and creating conditional search results or controlling the search experience. This configuration contains assets like query rules, result sources, result types, and any schema and ranking models. To make sure that the import of the search configuration does not fail, there must not be duplicate names for any elements of the search configuration. For example, if you have a query rule in a site collection named SampleQueryRule, and you
import it into another site collection with an existing rule named
SampleQueryRule, importing the search configuration fails. To prevent this, you can rename or delete the query rule on the source or on the target. Result sources and the schema also have to be uniquely named.
If you want to include a search configuration in your design package, you must start the following features at the site level under Manage Site Features before you export the design package:
Search Config Data Content Types Search Config Data Site Columns Search Config List Instance Feature Search Config Template Feature
If you want your design to be published on the target of import, you should publish all design assets or disable major versioning in design-related libraries on the source of export. Design Manager exports only the most recent version of each asset from the source. For example, if you have version 1.1 of a master page on the source it will be copied to the target as a draft; however, version 1.0 is not copied. Also, files that are checked out are not exported.
Exporting and importing a design package
You can approach an end-to-end packaging workflow in several ways, with much of the approach depending on your objectives and available design resources. You may decide to outsource to a vendor agency, or do the work in-house if you have internal resourcing. The following table provides a sample workflow and exchange between a client and a vendor agency over the design, exporting, and importing of the design package. It also provides the required permissions for design-related operations, and packaging operations.
ID Action Description
1 Customer contracts vendor agency to create visual design.
The vendor designer creates site, based on company requirements.
Note: The vendor designer must have the
Designers permission level to use Design Manager and create and export packages. More specifically, the vendor designer must have the Design
permission that enables viewing, adding, updating, deleting, approving, and customizing of visual designs.
2 Vendor designer exports visual design into a
The vendor designer exports the SharePoint solution package (.wsp file) after the other required
Customization
ID Action Description
design package. branding and publishing steps are completed. The design package is delivered to the customer by using a security channel.
3 Customer imports visual design into their specified SharePoint 2013 site collection.
The customer receives the design package by using a security channel.
By using the Welcome page in Design Manager or by selecting Import design package in Site Settings, the customer imports the .wsp file and applies the design package to the specified site collection.
Note: The customer must have the
Designers permission level to use Design Manager and import design packages.