use of com.agiletec.plugins.jacms.aps.system.services.resource.model.ImageResourceDimension in project entando-core by entando.
the class ImageDimensionDOM method getDimensions.
/**
* Restitusce la mappa delle dimensioni di resize previste.
* @return La mappa delle dimensioni di resize previste.
*/
public Map<Integer, ImageResourceDimension> getDimensions() {
Map<Integer, ImageResourceDimension> dimensions = new HashMap<Integer, ImageResourceDimension>();
List<Element> dimensionElements = _doc.getRootElement().getChildren(TAB_DIMENSION);
if (null != dimensionElements && dimensionElements.size() > 0) {
Iterator<Element> dimensionElementsIter = dimensionElements.iterator();
while (dimensionElementsIter.hasNext()) {
Element currentElement = (Element) dimensionElementsIter.next();
ImageResourceDimension dimension = new ImageResourceDimension();
Element idElement = currentElement.getChild(TAB_ID);
if (null != idElement) {
String id = idElement.getText();
dimension.setIdDim(Integer.parseInt(id));
}
Element dimxElement = currentElement.getChild(TAB_DIMX);
if (null != dimxElement) {
String dimx = dimxElement.getText();
dimension.setDimx(Integer.parseInt(dimx));
}
Element dimyElement = currentElement.getChild(TAB_DIMY);
if (null != dimyElement) {
String dimy = dimyElement.getText();
dimension.setDimy(Integer.parseInt(dimy));
}
dimensions.put(new Integer(dimension.getIdDim()), dimension);
_logger.debug("Definita dimensione di resize: {}", dimension.getIdDim());
}
}
return dimensions;
}
use of com.agiletec.plugins.jacms.aps.system.services.resource.model.ImageResourceDimension in project entando-core by entando.
the class ResourceFinderAction method getImageDimensions.
public List<ImageResourceDimension> getImageDimensions() {
Map<Integer, ImageResourceDimension> master = this.getImageDimensionManager().getImageDimensions();
List<ImageResourceDimension> dimensions = new ArrayList<ImageResourceDimension>(master.values());
BeanComparator comparator = new BeanComparator("dimx");
Collections.sort(dimensions, comparator);
return dimensions;
}
Aggregations