Ignore:
Timestamp:
2017-05-26T18:06:06+02:00 (7 years ago)
Author:
stoecker
Message:

see #14832 - sanity checks for attribution

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/scripts/SyncEditorLayerIndex.groovy

    r12247 r12261  
    251251            if((t = getAttributionUrl(e)))
    252252                stream.write "        <attribution-url>${cdata(t)}</attribution-url>\n"
     253            if((t = getLogoImage(e)))
     254                stream.write "        <logo-image>${cdata(t, true)}</logo-image>\n"
     255            if((t = getLogoUrl(e)))
     256                stream.write "        <logo-url>${cdata(t)}</logo-url>\n"
    253257            if((t = getTermsOfUseText(e)))
    254258                stream.write "        <terms-of-use-text>${cdata(t, true)}</terms-of-use-text>\n"
     
    673677                }
    674678            }
     679            if(getAttributionUrl(j) && !getAttributionText(j)) {
     680                myprintln "* Attribution link without text: ${getDescription(j)}"
     681            }
     682            if(getLogoUrl(j) && !getLogoImage(j)) {
     683                myprintln "* Logo link without image: ${getDescription(j)}"
     684            }
     685            if(getTermsOfUseText(j) && !getTermsOfUseUrl(j)) {
     686                myprintln "* Terms of Use text without link: ${getDescription(j)}"
     687            }
    675688            def js = getShapes(j)
    676689            if(js.size()) {
     
    841854        return null
    842855    }
     856    static String getLogoImage(Object e) {
     857        if (e instanceof ImageryInfo) return e.getAttributionImageRaw()
     858        return null
     859    }
     860    static String getLogoUrl(Object e) {
     861        if (e instanceof ImageryInfo) return e.getAttributionImageURL()
     862        return null
     863    }
    843864    static String getPermissionReferenceUrl(Object e) {
    844865        if (e instanceof ImageryInfo) return e.getPermissionReferenceURL()
Note: See TracChangeset for help on using the changeset viewer.