08-16-2010 05:19 PM
public class SiteMgrWebScript extends AbstractWebScript
{
public void execute(WebScriptRequest req, WebScriptResponse res) throws IOException
{
try {
08-18-2010 07:13 AM
public class SiteMgrWebScript extends AbstractWebScript
{
protected SiteService siteService;
public void setSiteService(SiteService siteService){ this.siteService =siteService; }
<bean id="yourwebscriptId"
class="yourPackage.SiteMgrWebScript"
parent="webscript">
<property name="siteService">
<ref bean="SiteService" />
</property>
</bean>
08-23-2010 07:16 PM
<webscript>
<shortname>Create some sites</shortname>
<description>Hands back a little bit of JSON</description>
<url>/demo/simple</url>
<authentication>user</authentication>
<transaction>required</transaction>
<format default="">argument</format>
</webscript>
08-24-2010 07:30 PM
HTTP Status 500 -
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
javax.servlet.ServletException: Could not resolve view with name 'site/testShort/dashboard' in servlet with name 'Spring Surf Dispatcher Servlet'
org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1042)
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:798)
public class SiteMgrWebScript extends AbstractWebScript
{
protected SiteService siteService;
public void setSiteService(SiteService ss) { siteService = ss; }
public void execute(WebScriptRequest req, WebScriptResponse res)
throws IOException
{
try {
List<SiteInfo> sites = siteService.listSites( "admin" );
SiteInfo siTest = siteService.getSite( "testShort" );
if ( siTest != null ) {
System.out.println( "SITE ALREADY EXISTS, deleting first." );
siteService.deleteSite( "testShort" );
} else {
System.out.println( "SITE DOES NOT EXIST, no need deleting." );
}
SiteInfo siNew = siteService.createSite(
"site-dashboard", "testShort", "testTitle", "testDesc", SiteVisibility.PUBLIC );
System.out.println( "Now we need to do the Share stuff, make the dashboard, etc??? How to do in Java???" );
// build a json object and put some data in it
JSONObject obj = new JSONObject();
obj.put("Success", "Site created without throwing exception.");
String jsonString = obj.toString();
res.getWriter().write(jsonString);
} catch ( JSONException e ) {
System.err.println( e.toString() );
throw new WebScriptException("Unable to serialize JSON");
}
}
09-08-2010 08:22 AM
09-15-2010 04:29 AM
09-27-2010 05:32 PM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.