Subversion Repositories SmartDukaan

Rev

Rev 1061 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1061 Rev 2170
Line 5... Line 5...
5
 
5
 
6
import in.shop2020.metamodel.definitions.BulletDefinition;
6
import in.shop2020.metamodel.definitions.BulletDefinition;
7
import in.shop2020.metamodel.definitions.Catalog;
7
import in.shop2020.metamodel.definitions.Catalog;
8
import in.shop2020.metamodel.definitions.DefinitionsContainer;
8
import in.shop2020.metamodel.definitions.DefinitionsContainer;
9
import in.shop2020.metamodel.definitions.FeatureDefinition;
9
import in.shop2020.metamodel.definitions.FeatureDefinition;
-
 
10
import in.shop2020.metamodel.definitions.HelpDocDefinition;
10
import in.shop2020.metamodel.definitions.RuleDefinition;
11
import in.shop2020.metamodel.definitions.RuleDefinition;
11
 
12
 
12
/**
13
/**
13
 * Utility class that supports FeatureDefinition class. All related 
14
 * Utility class that supports FeatureDefinition class. All related 
14
 * objects are fetched from database and aggregated here.
15
 * objects are fetched from database and aggregated here.
Line 32... Line 33...
32
	 * Expanded from Normalization Rule Definition ID
33
	 * Expanded from Normalization Rule Definition ID
33
	 */
34
	 */
34
	private RuleDefinition normalizationRuleDefinition;
35
	private RuleDefinition normalizationRuleDefinition;
35
	
36
	
36
	/**
37
	/**
-
 
38
	 * Expanded of helpDocDefinition
-
 
39
	 */
-
 
40
	private HelpDocDefinition helpDocDefinition;
-
 
41
	
-
 
42
	/**
37
	 * Takes FeatureDefinition object as input and converts all references 
43
	 * Takes FeatureDefinition object as input and converts all references 
38
	 * into corresponding detail objects
44
	 * into corresponding detail objects
39
	 * 
45
	 * 
40
	 * @param featureDefintion Feature Definition object
46
	 * @param featureDefintion Feature Definition object
41
	 * @throws Exception 
47
	 * @throws Exception 
Line 48... Line 54...
48
		this.setAllowsBlank(featureDefinition.allowsBlank());
54
		this.setAllowsBlank(featureDefinition.allowsBlank());
49
		this.setDescription(featureDefinition.getDescription());
55
		this.setDescription(featureDefinition.getDescription());
50
		this.setBulletDefinition(featureDefinition.getBulletDefinition());
56
		this.setBulletDefinition(featureDefinition.getBulletDefinition());
51
		this.setNormalizationRuleDefinitionID(
57
		this.setNormalizationRuleDefinitionID(
52
				featureDefinition.getNormalizationRuleDefinitionID());
58
				featureDefinition.getNormalizationRuleDefinitionID());
-
 
59
		this.setHelpDocDefinitionID(featureDefinition.getHelpDocDefinitionID());
53
		
60
		
54
		DefinitionsContainer defs = 
61
		DefinitionsContainer defs = 
55
			Catalog.getInstance().getDefinitionsContainer();
62
			Catalog.getInstance().getDefinitionsContainer();
56
		
63
		
57
		// Expand BulletDefinition
64
		// Expand BulletDefinition
Line 65... Line 72...
65
			this.normalizationRuleDefinition  = 
72
			this.normalizationRuleDefinition  = 
66
				defs.getNormalizationRuleDefinition(ruleDefinitionID);
73
				defs.getNormalizationRuleDefinition(ruleDefinitionID);
67
		}
74
		}
68
		
75
		
69
		this.expandedBulletDefinition = new ExpandedBulletDefinition(bulletDef);
76
		this.expandedBulletDefinition = new ExpandedBulletDefinition(bulletDef);
-
 
77
		
-
 
78
		
-
 
79
		// Expand help doc definition ID
-
 
80
        long helpDocDefinitionID = featureDefinition.getHelpDocDefinitionID();
-
 
81
        
-
 
82
        if(helpDocDefinitionID != 0L) {
-
 
83
            this.helpDocDefinition  = 
-
 
84
                defs.getHelpDocDefinition(helpDocDefinitionID);
-
 
85
        }
70
	}
86
	}
71
 
87
 
72
	/**
88
	/**
73
	 * @return the expandedBulletDefinition ExpandedBulletDefinition object
89
	 * @return the expandedBulletDefinition ExpandedBulletDefinition object
74
	 */
90
	 */
Line 81... Line 97...
81
	 */
97
	 */
82
	public RuleDefinition getNormalizationRuleDefinition() {
98
	public RuleDefinition getNormalizationRuleDefinition() {
83
		return normalizationRuleDefinition;
99
		return normalizationRuleDefinition;
84
	}
100
	}
85
 
101
 
-
 
102
    /**
-
 
103
     * @param helpDocDefinition the helpDocDefinition to set
-
 
104
     */
-
 
105
    public void setHelpDocDefinition(HelpDocDefinition helpDocDefinition) {
-
 
106
        this.helpDocDefinition = helpDocDefinition;
-
 
107
    }
-
 
108
 
-
 
109
    /**
-
 
110
     * @return the helpDocDefinition
-
 
111
     */
-
 
112
    public HelpDocDefinition getHelpDocDefinition() {
-
 
113
        return helpDocDefinition;
-
 
114
    }
-
 
115
    
-
 
116
    
86
	/* (non-Javadoc)
117
	/* (non-Javadoc)
87
	 * @see java.lang.Object#toString()
118
	 * @see java.lang.Object#toString()
88
	 */
119
	 */
89
	@Override
120
	@Override
90
	public String toString() {
121
	public String toString() {
Line 97... Line 128...
97
				+ ", getNormalizationRuleDefinitionID()="
128
				+ ", getNormalizationRuleDefinitionID()="
98
				+ getNormalizationRuleDefinitionID() + ", toString()="
129
				+ getNormalizationRuleDefinitionID() + ", toString()="
99
				+ super.toString() + ", getID()=" + getID() + "]";
130
				+ super.toString() + ", getID()=" + getID() + "]";
100
	}
131
	}
101
 
132
 
-
 
133
 
102
}
134
}