Skip to content

Commit 7040d96

Browse files
author
Daniel Cohen
committed
added new options to url tag
1 parent 7e5c869 commit 7040d96

File tree

2 files changed

+50
-4
lines changed

2 files changed

+50
-4
lines changed

cloudinary-taglib/src/main/java/com/cloudinary/taglib/CloudinaryUrl.java

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,11 @@ public class CloudinaryUrl extends SimpleTagSupport implements DynamicAttributes
3232
private Boolean secure = null;
3333
private Boolean cdnSubdomain = null;
3434
private Boolean signed = null;
35-
35+
private Boolean useRootPath = null;
36+
private Boolean secureCdnSubdomain = null;
37+
3638
private String namedTransformation = null;
39+
private String urlSuffix = null;
3740

3841
/** stores the dynamic attributes */
3942
private Map<String,Object> tagAttrs = new HashMap<String,Object>();
@@ -66,6 +69,10 @@ public void doTag() throws JspException, IOException {
6669
}
6770
if (cdnSubdomain != null) url.cdnSubdomain(cdnSubdomain.booleanValue());
6871
if (signed != null) url.signed(signed.booleanValue());
72+
if (useRootPath != null) url.useRootPath(useRootPath);
73+
if (urlSuffix != null) url.suffix(urlSuffix);
74+
if (secureCdnSubdomain != null) url.secureCdnSubdomain(secureCdnSubdomain);
75+
6976

7077
out.println(url.generate());
7178
}
@@ -162,4 +169,28 @@ private Boolean isSecureRequest() {
162169
ServletRequest request = context.getRequest();
163170
return request.getScheme().equals("https");
164171
}
172+
173+
public Boolean getUseRootPath() {
174+
return useRootPath;
175+
}
176+
177+
public void setUseRootPath(Boolean useRootPath) {
178+
this.useRootPath = useRootPath;
179+
}
180+
181+
public Boolean getSecureCdnSubdomain() {
182+
return secureCdnSubdomain;
183+
}
184+
185+
public void setSecureCdnSubdomain(Boolean secureCdnSubdomain) {
186+
this.secureCdnSubdomain = secureCdnSubdomain;
187+
}
188+
189+
public String getUrlSuffix() {
190+
return urlSuffix;
191+
}
192+
193+
public void setUrlSuffix(String urlSuffix) {
194+
this.urlSuffix = urlSuffix;
195+
}
165196
}

cloudinary-taglib/src/main/resources/META-INF/cloudinary.tld

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
<taglib xmlns="http://java.sun.com/xml/ns/j2ee"
2-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1+
<taglib xmlns="http://java.sun.com/xml/ns/j2ee"
2+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
33
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd"
44
version="2.0">
55
<tlib-version>1.1</tlib-version>
@@ -407,6 +407,21 @@
407407
<required>false</required>
408408
<rtexprvalue>true</rtexprvalue>
409409
</attribute>
410+
<attribute>
411+
<name>urlSuffix</name>
412+
<required>false</required>
413+
<rtexprvalue>true</rtexprvalue>
414+
</attribute>
415+
<attribute>
416+
<name>secureCdnSubdomain</name>
417+
<required>false</required>
418+
<rtexprvalue>true</rtexprvalue>
419+
</attribute>
420+
<attribute>
421+
<name>useRootPath</name>
422+
<required>false</required>
423+
<rtexprvalue>true</rtexprvalue>
424+
</attribute>
410425
<dynamic-attributes>true</dynamic-attributes>
411426
</tag>
412427
<tag>
@@ -429,4 +444,4 @@
429444
<rtexprvalue>true</rtexprvalue>
430445
</attribute>
431446
</tag>
432-
</taglib>
447+
</taglib>

0 commit comments

Comments
 (0)