Skip to content
This repository has been archived by the owner on Nov 23, 2021. It is now read-only.

Commit

Permalink
#12 Added element type "html"
Browse files Browse the repository at this point in the history
  • Loading branch information
blaubaer committed Apr 4, 2014
1 parent cb47d1b commit c6b97df
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ public static enum Type {
emailAddress,
url,
phoneNumber,
wikiMarkup
wikiMarkup,
html
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
import com.atlassian.renderer.WikiStyleRenderer;
import com.atlassian.user.User;
import org.echocat.adam.profile.Profile;
import org.echocat.adam.profile.element.ElementModelProvider.DefaultStandardElement;
import org.echocat.adam.template.Template;
import org.echocat.adam.template.TemplateFormat;
import org.springframework.beans.factory.DisposableBean;
Expand Down Expand Up @@ -192,6 +191,12 @@ public String plainToXhtml(@SuppressWarnings("UnusedParameters") @Nonnull Elemen
return result;
}

@Nonnull
@HtmlSafe
public String getAsString(@SuppressWarnings("UnusedParameters") @Nonnull ElementModel mode, @Nullable Object input) {
return input != null ? input.toString() : "";
}

@Nullable
protected String getViewValueFor(@Nonnull ElementModel model, @Nonnull User currentUser, @Nonnull Profile profile) {
final String value = profile.getValue(model);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<textarea name="${elementModel.id}" id="${nodeId}" cols="70" rows="8" class="monospaceInput textarea" data-cip-id="${elementModel.id}"#if($readOnly) readonly#end>$!{generalUtil.htmlEncode($value)}</textarea>
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#if($!value != $!null)
<span class="field-value" id="${nodeId}">$!{elementRenderer.getAsString($elementModel, $value)}</span>
#end
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@
<xsd:enumeration value="url"/>
<xsd:enumeration value="phoneNumber"/>
<xsd:enumeration value="wikiMarkup"/>
<xsd:enumeration value="html"/>
</xsd:restriction>
</xsd:simpleType>

Expand Down

0 comments on commit c6b97df

Please sign in to comment.