// ESRI tags: resource URL
if (esriTags != null) {
String sResourceUrl = Val.chkStr(this.getFirstStoreableString(Meaning.MEANINGTYPE_RESOURCE_URL));
if ((sResourceUrl == null) || (sResourceUrl.length() == 0)) {
ResourceIdentifier ri = ensureResourceIdentifier();
sResourceUrl = esriTags.makeResourceUrl(ri);
if ((sResourceUrl != null) && (sResourceUrl.length() > 0)) {
PropertyMeaning meaning = this.getPropertyMeanings().get(Meaning.MEANINGTYPE_RESOURCE_URL);
IStoreable storeable = this.getStoreables().get(Meaning.MEANINGTYPE_RESOURCE_URL);
if ((meaning != null) && (storeable != null)) {
storeable.setValue(sResourceUrl);
} else if (meaning != null) {
this.addStoreableValue(meaning,sResourceUrl);
}
}
}
}
// try to determine the resource url
String sResourceUrl = Val.chkStr(this.getFirstStoreableString(Meaning.MEANINGTYPE_RESOURCE_URL));
if ((sResourceUrl == null) || (sResourceUrl.length() == 0)) {
IStoreable storeable = this.getStoreables().get("resource.check.urls");
if (storeable != null) {
Object[] values = storeable.getValues();
if ((values != null) && (values.length > 0)) {
boolean resourceUrlResolved = false;
ResourceIdentifier ri = ensureResourceIdentifier();
for (Object value: values) {
if ((value != null) && (value instanceof String)) {
String sValue = Val.chkStr((String)value);
if (sValue.length() > 0) {
sValue = Val.chkStr(this.resolveResourceUrl(schema,dom,esriTags,sValue));
}
if (sValue.length() > 0) {
String aimsct = Val.chkStr(ri.guessArcIMSContentTypeFromUrl(sValue));
if (aimsct.length() > 0) {
String sResUrl = sValue;
PropertyMeaning meaning2 = this.getPropertyMeanings().get(Meaning.MEANINGTYPE_RESOURCE_URL);
IStoreable storeable2 = this.getStoreables().get(Meaning.MEANINGTYPE_RESOURCE_URL);
if ((meaning2 != null) && (storeable2 != null)) {
storeable2.setValue(sResUrl);
} else if (meaning2 != null) {
this.addStoreableValue(meaning2,sResUrl);
}
resourceUrlResolved = true;
break;
}
}
}
}
if (!resourceUrlResolved) {
// if no resource.url has been resolved - take a first non empty
String sResUrl = null;
for (Object value: values) {
if ((value != null) && (value instanceof String)) {
String sValue = Val.chkStr((String)value);
if (sValue.length() > 0) {
sResUrl = sValue;
PropertyMeaning meaning2 = this.getPropertyMeanings().get(Meaning.MEANINGTYPE_RESOURCE_URL);
IStoreable storeable2 = this.getStoreables().get(Meaning.MEANINGTYPE_RESOURCE_URL);
if ((meaning2 != null) && (storeable2 != null)) {
storeable2.setValue(sResUrl);
} else if (meaning2 != null) {
this.addStoreableValue(meaning2,sResUrl);
}
break;
}
}
}
}
}
}
}
// classify the ArcIMS content type from the resource URL
String aimsContentType = Val.chkStr(this.getFirstStoreableValue(Meaning.MEANINGTYPE_CONTENTTYPE));
if (aimsContentType.length() > 0) {
ResourceIdentifier ri = ensureResourceIdentifier();
aimsContentType = Val.chkStr(ri.guessArcIMSContentTypeFromResourceType(aimsContentType));
}
if (aimsContentType.length() == 0) {
PropertyMeaning meaning = this.getPropertyMeanings().get(Meaning.MEANINGTYPE_CONTENTTYPE);
IStoreable storeable = this.getStoreables().get(Meaning.MEANINGTYPE_RESOURCE_URL);
if ((meaning != null) && (storeable != null)) {
Object[] values = storeable.getValues();
if (values != null) {
for (Object value: values) {
if ((value != null) && (value instanceof String)) {
String url = Val.chkStr((String)value);
if (url.length() > 0) {
ResourceIdentifier ri = ensureResourceIdentifier();
aimsContentType = Val.chkStr(ri.guessArcIMSContentTypeFromUrl(url));
if (aimsContentType.length() > 0) {
this.addStoreableValue(meaning,aimsContentType);
break;
}
}