7. Resolvingprojectdatadependenciesbetweencuppytra

Source: Internet
Author: User

Motivation

This Projectdatastadiums.impex file assumes the presence during import, which is an update operation, which means it may throw an exception.

Cuppytrail/resources/impex/projectdatastadium.impex
... UPDATE Match;id[unique=true];group (code), code) [Unique=true];stadium (code); 1;wc2010:a; competition; emirates;2;wc2010:a; Emirates;3;wc2010:b; Emirates;4;wc2010:b; Villapark ...

Solution Solutions

Create the Systemsetup class because it is completed by Cuppy and triggers the import wc2010 projectdata.

De.hybris.platform.cuppytrail.systemsetup.CuppyTr Ailsystemsetup.java
/* * [y] hybris platform * * copyright  (c)  2000-2012 hybris  ag * all rights reserved. * * this software is the  confidential and proprietary information of hybris *  ("Confidential  information ") . you shall not disclose such confidential *  information and shall use it only in accordance with the  terms of the * license agreement you entered into with  hybris. * * */package de.hybris.platform.cuppytrail.systemsetup; import  de.hybris.platform.core.initialization.systemsetup;import  de.hybris.platform.core.initialization.systemsetup.process;import  de.hybris.platform.core.initialization.systemsetup.type;import  De.hybris.platform.core.initialization.SystemSetupContext;import de.hybris.platform.core.initialization.systemsetupparameter;import  de.hybris.platform.core.initialization.systemsetupparametermethod;import  de.hybris.platform.cuppy.constants.cuppyconstants;import  de.hybris.platform.cuppy.systemsetup.cuppysystemsetup; import java.util.collections;import  java.util.hashmap;import java.util.list;import java.util.map;  /** * class  to load the pre-requisite wc2010 data for projectdatastadium.impex  imports */@SystemSetup (extension =  "Cuppytrail", process = process.all,  Type = type.project) public class cuppytrailsystemsetup extends cuppysystemsetup{       @SystemSetup     public void importprereqsfromcuppy ()     {        //set up the items  to impOrt        final map<string, string[]> params  = new HashMap<String, String[]> ();         final string[] p_basics =        {  Cuppyconstants.param_basics_players };        params.put ( cuppyconstants.extensionname +  "_"  + cuppyconstants.param_basics, p_basics);          final String[] p_wc2010 =         { CuppyConstants.PARAM_WC2010_SETUP };         params.put (cuppyconstants.extensionname +  "_"  + cuppyconstants.param_ wc2010, p_wc2010);          final systemsetupcontext  ctx = new systemsetupcontext (paraMs, type.project, process.all, cuppyconstants.extensionname);          //here we use the same context for both. since  it is a fairly flat data object, this works just fine         //super.importbasics (CTX);         super.importwc2010 (CTX);    }      @Override       @SystemSetupParameterMethod     public list<systemsetupparameter > getsystemsetupparameters ()     {         Return collections.emptylist ();     }}

Finally, it needs to be injected in spring.

Cuppytrail-spring.xml
<bean id= "Cuppytrailsystemsetup" class= "De.hybris.platform.cuppytrail.systemsetup.CuppyTrailSystemSetup" scope = "Tenant" > <property name= "importservice" ref= "Importservice"/></bean>

This cuppytrail import, which is now selected by the Projectdata during the update process, will be triggered before the Convention in the configuration file.

7. Resolvingprojectdatadependenciesbetweencuppytra

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.