View | Details | Raw Unified | Return to bug 47604
Collapse All | Expand All

(-)src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFWorkbook.java (+9 lines)
Lines 1297-1300 Link Here
1297
    public Collection<XSSFMap> getCustomXMLMappings(){
1297
    public Collection<XSSFMap> getCustomXMLMappings(){
1298
        return mapInfo == null ? new ArrayList<XSSFMap>() : mapInfo.getAllXSSFMaps();
1298
        return mapInfo == null ? new ArrayList<XSSFMap>() : mapInfo.getAllXSSFMaps();
1299
    }
1299
    }
1300
    
1301
    /**
1302
     * 
1303
     * @return the helper class used to query the custom XML mapping defined in this workbook
1304
     */
1305
    public MapInfo getMapInfo(){
1306
    	return mapInfo;
1307
    }
1308
    
1300
}
1309
}
(-)src/ooxml/java/org/apache/poi/xssf/usermodel/helpers/XSSFXmlColumnPr.java (+22 lines)
Lines 47-52 Link Here
47
		return ctXmlColumnPr.getMapId();
47
		return ctXmlColumnPr.getMapId();
48
	}
48
	}
49
	
49
	
50
	public String getXPath(){
51
		return ctXmlColumnPr.getXpath();
52
	}
53
	/**
54
	 * (see Open Office XML Part 4: chapter 3.5.1.3)
55
	 * @return An integer representing the unique identifier of this column. 
56
	 */
57
	public long getId(){
58
		return ctTableColumn.getId();
59
	}
60
	
61
	
62
	/**
63
	 * If the XPath is, for example, /Node1/Node2/Node3 and /Node1/Node2 is the common XPath for the table, the local XPath is /Node3
64
	 * 	
65
	 * @return the local XPath 
66
	 */
50
	public String getLocalXPath(){
67
	public String getLocalXPath(){
51
		String localXPath = "";
68
		String localXPath = "";
52
		int numberOfCommonXPathAxis = table.getCommonXpath().split("/").length-1;
69
		int numberOfCommonXPathAxis = table.getCommonXpath().split("/").length-1;
Lines 59-65 Link Here
59
	}
76
	}
60
77
61
	public Enum getXmlDataType() {
78
	public Enum getXmlDataType() {
79
		
62
		return ctXmlColumnPr.getXmlDataType();
80
		return ctXmlColumnPr.getXmlDataType();
63
	}
81
	}
82
	
83
	
84
	
85
	
64
86
65
}
87
}
(-)src/ooxml/java/org/apache/poi/xssf/usermodel/helpers/XSSFSingleXmlCell.java (-1 / +8 lines)
Lines 48-54 Link Here
48
	}
48
	}
49
	
49
	
50
	/**
50
	/**
51
	 * Gets the XSSFCell referenced by the R attribute
51
	 * Gets the XSSFCell referenced by the R attribute or creates a new one if cell doesn't exists
52
	 * @return the referenced XSSFCell, null if the cell reference is invalid
52
	 * @return the referenced XSSFCell, null if the cell reference is invalid
53
	 */
53
	 */
54
	public XSSFCell getReferencedCell(){
54
	public XSSFCell getReferencedCell(){
Lines 58-64 Link Here
58
		CellReference cellReference =  new CellReference(singleXmlCell.getR()); 
58
		CellReference cellReference =  new CellReference(singleXmlCell.getR()); 
59
		
59
		
60
		XSSFRow row = parent.getXSSFSheet().getRow(cellReference.getRow());
60
		XSSFRow row = parent.getXSSFSheet().getRow(cellReference.getRow());
61
		if(row==null){
62
			row = parent.getXSSFSheet().createRow(cellReference.getRow());
63
		}
64
		
61
		cell = row.getCell(cellReference.getCol());  
65
		cell = row.getCell(cellReference.getCol());  
66
		if(cell==null){
67
			cell = row.createCell(cellReference.getCol());
68
		}
62
		
69
		
63
		
70
		
64
		return cell;
71
		return cell;
(-)src/ooxml/java/org/apache/poi/xssf/model/MapInfo.java (-1 / +13 lines)
Lines 23-29 Link Here
23
import java.util.Collection;
23
import java.util.Collection;
24
import java.util.HashMap;
24
import java.util.HashMap;
25
import java.util.Map;
25
import java.util.Map;
26
import java.util.Iterator;
27
26
28
27
29
import org.apache.poi.POIXMLDocumentPart;
28
import org.apache.poi.POIXMLDocumentPart;
Lines 123-128 Link Here
123
		return maps.get(id);
122
		return maps.get(id);
124
	}
123
	}
125
	
124
	
125
	public XSSFMap getXSSFMapByName(String name){
126
		
127
		XSSFMap matchedMap = null;
128
		
129
		for(XSSFMap map :maps.values()){
130
			if(map.getCtMap().getName()!=null && map.getCtMap().getName().equals(name)){
131
				matchedMap = map;
132
			}
133
		}		
134
		
135
		return matchedMap;
136
	}
137
	
126
	/**
138
	/**
127
	 * 
139
	 * 
128
	 * @return all the mappings configured in this document
140
	 * @return all the mappings configured in this document
(-)src/ooxml/java/org/apache/poi/xssf/extractor/XSSFExportToXml.java (-1 / +1 lines)
Lines 65-71 Link Here
65
 * The output XML Schema must respect this limitations:
65
 * The output XML Schema must respect this limitations:
66
 * 
66
 * 
67
 * <ul>
67
 * <ul>
68
 * <li> all mandatory elements and attributes must be mapped </li>
68
 * <li> all mandatory elements and attributes must be mapped (enable validation to check this)</li>
69
 * 
69
 * 
70
 * <li> no &lt;any&gt; in complex type/element declaration </li>
70
 * <li> no &lt;any&gt; in complex type/element declaration </li>
71
 * <li> no &lt;anyAttribute&gt; attributes declaration </li>
71
 * <li> no &lt;anyAttribute&gt; attributes declaration </li>

Return to bug 47604