use of com.mindbright.security.x509.Attribute in project n2o-framework by i-novus-llc.
the class IOProcessorImpl method childAttributeEnum.
@Override
public <T extends Enum<T>> void childAttributeEnum(Element element, String childName, String name, Supplier<T> getter, Consumer<T> setter, Class<T> enumClass) {
if (r) {
Element child = element.getChild(childName, element.getNamespace());
if (child == null)
return;
Attribute attribute = child.getAttribute(name);
if (attribute != null) {
setter.accept(stringToEnum(process(attribute.getValue()), enumClass));
}
} else {
if (getter.get() == null)
return;
Element childElement = element.getChild(childName, element.getNamespace());
if (childElement == null) {
childElement = new Element(childName, element.getNamespace());
childElement.setAttribute(new Attribute(name, getter.get().toString()));
element.addContent(childElement);
} else {
childElement.setAttribute(new Attribute(name, getter.get().toString()));
}
}
}
use of com.mindbright.security.x509.Attribute in project SOS by 52North.
the class AbstractNetcdfEncoder method addPublisher.
protected boolean addPublisher(AbstractSensorML sml, String contactRole, NetcdfFileWriter writer) {
SmlResponsibleParty responsibleParty = getResponsibleParty(sml, contactRole);
if (responsibleParty != null) {
if (responsibleParty.isSetOrganizationName()) {
writer.addGroupAttribute(null, new Attribute(ACDDConstants.PUBLISHER_NAME, responsibleParty.getOrganizationName()));
}
if (responsibleParty.isSetEmail()) {
writer.addGroupAttribute(null, new Attribute(ACDDConstants.PUBLISHER_EMAIL, responsibleParty.getEmail()));
}
if (responsibleParty.isSetOnlineResources()) {
writer.addGroupAttribute(null, new Attribute(ACDDConstants.PUBLISHER_URL, responsibleParty.getOnlineResources().get(0)));
}
} else {
String mail = getServiceProvider().getServiceContact().getContactInfo().flatMap(OwsContact::getAddress).map(OwsAddress::getElectronicMailAddress).map(l -> Iterables.getFirst(l, null)).orElse(null);
String name = getServiceProvider().getProviderName();
String url = getServiceProvider().getProviderSite().flatMap(OwsOnlineResource::getHref).map(URI::toString).orElse(null);
writer.addGroupAttribute(null, new Attribute(ACDDConstants.PUBLISHER_NAME, name));
writer.addGroupAttribute(null, new Attribute(ACDDConstants.PUBLISHER_EMAIL, mail));
writer.addGroupAttribute(null, new Attribute(ACDDConstants.PUBLISHER_URL, url));
}
return true;
}
use of com.mindbright.security.x509.Attribute in project SOS by 52North.
the class AbstractNetcdfEncoder method addVariableLongitude.
protected Variable addVariableLongitude(NetcdfFileWriter writer, List<Dimension> dims) {
Variable v = writer.addVariable(null, getVariableDimensionCaseName(CFStandardNames.LONGITUDE.getName()), getDataType(), dims);
v.addAttribute(new Attribute(CFConstants.STANDARD_NAME, CFStandardNames.LONGITUDE.getName()));
v.addAttribute(new Attribute(CFConstants.LONG_NAME, getLongName(CFStandardNames.LONGITUDE.getName())));
v.addAttribute(new Attribute(CFConstants.UNITS, CFConstants.UNITS_DEGREES_EAST));
v.addAttribute(new Attribute(CFConstants.AXIS, CFConstants.AXIS_X));
v.addAttribute(new Attribute(CFConstants.FILL_VALUE, getNetcdfHelper().getFillValue()));
return v;
}
use of com.mindbright.security.x509.Attribute in project SOS by 52North.
the class AbstractOceanSITESEncoder method addVariableHeight.
@Override
protected Variable addVariableHeight(NetcdfFileWriter writer, List<Dimension> dims) {
Variable variable = super.addVariableHeight(writer, dims);
variable.addAttribute(new Attribute(OceanSITESConstants.REFERENCE, OceanSITESConstants.HEIGHT_DEPTH_REFERENCE_DEFAULT));
variable.addAttribute(new Attribute(OceanSITESConstants.COORDINATE_REFERENCE_FRAME, OceanSITESConstants.EPSG_5829));
variable.addAttribute(getDefaultQcIndicatorAttribute());
return variable;
}
use of com.mindbright.security.x509.Attribute in project d3web-KnowWE by denkbares.
the class DOTRenderer method addTargetAttribute.
/**
* Adds the target-attribute to the element.
*
* @created 21.12.2013
*/
private static void addTargetAttribute(Element element) {
Attribute target = new Attribute("target", "_top");
element.setAttribute(target);
}
Aggregations