Skip to content

Commit 119f808

Browse files
committed
Added print() support for SiteGroup, ScriptContentData and Site objects
git-svn-id: https://share-extras.googlecode.com/svn/trunk/Javascript Console@1325 a3f5c567-fd0f-3a89-9b71-a290c5a5f590
1 parent 22a8fe9 commit 119f808

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

javascript-console-repo/source/java/de/fme/jsconsole/JavascriptConsoleScriptObject.java

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@
77
import java.util.Map;
88

99
import org.alfresco.repo.jscript.ScriptNode;
10+
import org.alfresco.repo.jscript.ScriptNode.ScriptContentData;
1011
import org.alfresco.repo.security.authority.script.ScriptGroup;
1112
import org.alfresco.repo.security.authority.script.ScriptUser;
13+
import org.alfresco.repo.site.script.Site;
1214
import org.alfresco.service.cmr.repository.ChildAssociationRef;
1315
import org.alfresco.service.cmr.repository.NodeRef;
1416
import org.springframework.extensions.webscripts.ScriptContent;
@@ -77,6 +79,10 @@ private String formatValue(Object value) {
7779
return formatNodeRef((NodeRef) value);
7880
} else if (value instanceof ChildAssociationRef) {
7981
return formatChildAssoc((ChildAssociationRef) value);
82+
} else if (value instanceof ScriptContentData) {
83+
return formatScriptContentData((ScriptContentData) value);
84+
} else if (value instanceof Site) {
85+
return formatSite((Site) value);
8086
} else if (value instanceof Map) {
8187
return formatMap((Map<String, Object>) value);
8288
}
@@ -98,8 +104,12 @@ private String formatScriptUser(ScriptUser value) {
98104
return "ScriptUser: " + value.getUserName() + " (" + value.getFullName()+")";
99105
}
100106

107+
private String formatSite(Site site) {
108+
return "Site: " + site.getShortName() + " (" + site.getTitle() + ", " + site.getNode().getNodeRef() + ")";
109+
}
110+
101111
private String formatScriptGroup(ScriptGroup value) {
102-
return "ScriptGroup: " + value.getShortName() + "(" + value.getFullName() + ")";
112+
return "ScriptGroup: " + value.getShortName() + " (" + value.getFullName() + ")";
103113
}
104114

105115
private String formatScriptContent(ScriptContent value) {
@@ -113,6 +123,10 @@ private String formatChildAssoc(ChildAssociationRef value) {
113123
private String formatNodeRef(NodeRef value) {
114124
return "NodeRef: " + value.toString();
115125
}
126+
127+
private String formatScriptContentData(ScriptContentData value) {
128+
return "ScriptContentData: " + value.getMimetype() + " Size:" + value.getSize() + " URL:" + value.getUrl();
129+
}
116130

117131
private String formatScriptNode(ScriptNode value) {
118132
return value.getName() + " (" + value.getNodeRef() + ")";

0 commit comments

Comments
 (0)