Package org.mifosplatform.mix.data

Examples of org.mifosplatform.mix.data.ContextData


        final Element xmlElement = rootElement.addElement(qname);

        final String dimension = taxonomy.getDimension();
        final SimpleDateFormat timeFormat = new SimpleDateFormat("MM_dd_yyyy");

        ContextData context = null;
        if (dimension != null) {
            final String[] dims = dimension.split(":");

            if (dims.length == 2) {
                context = new ContextData(dims[0], dims[1], taxonomy.getType());
                if (this.contextMap.containsKey(context)) {

                } else {

                }
            }
        }

        if (context == null) {
            context = new ContextData(null, null, taxonomy.getType());
        }

        if (!this.contextMap.containsKey(context)) {

            final String startDateStr = timeFormat.format(this.startDate);
            final String endDateStr = timeFormat.format(this.endDate);

            final String contextRefID = (context.getPeriodType() == 0) ? ("As_Of_" + endDateStr + (this.instantScenarioCounter++))
                    : ("Duration_" + startDateStr + "_To_" + endDateStr + (this.durationScenarioCounter++));

            this.contextMap.put(context, contextRefID);
        }
View Full Code Here


    }

    public void addContexts() {
        final SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
        for (final Entry<ContextData, String> entry : this.contextMap.entrySet()) {
            final ContextData context = entry.getKey();
            final Element contextElement = this.root.addElement("context");
            contextElement.addAttribute("id", entry.getValue());
            contextElement.addElement("entity").addElement("identifier").addAttribute("scheme", SCHEME_URL).addText(IDENTIFIER);

            final Element periodElement = contextElement.addElement("period");

            if (context.getPeriodType() == 0) {
                periodElement.addElement("instant").addText(format.format(this.endDate));
            } else {
                periodElement.addElement("startDate").addText(format.format(this.startDate));
                periodElement.addElement("endDate").addText(format.format(this.endDate));
            }

            final String dimension = context.getDimension();
            final String dimType = context.getDimensionType();
            if (dimType != null && dimension != null) {
                contextElement.addElement("scenario").addElement("explicitMember").addAttribute("dimension", dimType).addText(dimension);
            }
        }
View Full Code Here

TOP

Related Classes of org.mifosplatform.mix.data.ContextData

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.