1) Comments
2) Facebook exception handling (would of been useful yesterday)
3) Addition of Facebook.getAppFriends to javascript API (more useful than existing all friends method)
4) Fixes to Document Library sample

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@7262 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
David Caruana
2007-10-31 14:59:35 +00:00
parent 4ed645e960
commit 84fcadf793
13 changed files with 430 additions and 58 deletions

View File

@@ -208,7 +208,9 @@
<bean id="webscript.org.alfresco.indexpackage.get" class="org.alfresco.web.scripts.bean.IndexPackage" parent="webscript" /> <bean id="webscript.org.alfresco.indexpackage.get" class="org.alfresco.web.scripts.bean.IndexPackage" parent="webscript" />
<!-- Maintain list of available Web APIs --> <!-- Maintain list of available Web APIs -->
<bean id="webscript.org.alfresco.index.post" class="org.alfresco.web.scripts.bean.IndexUpdate" parent="webscript" /> <bean id="webscript.org.alfresco.index.post" class="org.alfresco.web.scripts.bean.IndexUpdate" parent="webscript" >
<property name="facebookService" ref="facebook.service"/>
</bean>
<!-- Retrieve Web Script Description Document --> <!-- Retrieve Web Script Description Document -->
<bean id="webscript.org.alfresco.scriptdescription.get" class="org.alfresco.web.scripts.bean.ServiceDescription" parent="webscript" /> <bean id="webscript.org.alfresco.scriptdescription.get" class="org.alfresco.web.scripts.bean.ServiceDescription" parent="webscript" />

View File

@@ -114,11 +114,21 @@ public class FormData implements Serializable, Scopeable
return Context.getCurrentContext().newArray(this.scope, fields); return Context.getCurrentContext().newArray(this.scope, fields);
} }
/**
* Gets parameters encoded in the form data
*
* @return map (name, value) of parameters
*/
/*package*/ Map<String, String> getParameters() /*package*/ Map<String, String> getParameters()
{ {
return getParametersMap(); return getParametersMap();
} }
/**
* Gets files encoded in form data
*
* @return map (name, ScriptContent) of files
*/
/*package*/ Map<String, ScriptContent> getFiles() /*package*/ Map<String, ScriptContent> getFiles()
{ {
return getFilesMap(); return getFilesMap();
@@ -127,7 +137,7 @@ public class FormData implements Serializable, Scopeable
/** /**
* Helper to parse servlet request form data * Helper to parse servlet request form data
* *
* @return parsed form data * @return map of all form fields
*/ */
private Map<String, FormField> getFieldsMap() private Map<String, FormField> getFieldsMap()
{ {
@@ -155,6 +165,11 @@ public class FormData implements Serializable, Scopeable
return fields; return fields;
} }
/**
* Helper to parse servlet request form data
*
* @return map of all form parameters
*/
private Map<String, String> getParametersMap() private Map<String, String> getParametersMap()
{ {
if (parameters == null) if (parameters == null)
@@ -173,6 +188,11 @@ public class FormData implements Serializable, Scopeable
return parameters; return parameters;
} }
/**
* Helper to parse servlet request form data
*
* @return map of all form files
*/
private Map<String, ScriptContent> getFilesMap() private Map<String, ScriptContent> getFilesMap()
{ {
if (files == null) if (files == null)

View File

@@ -32,6 +32,7 @@ import java.util.Map;
import org.alfresco.web.scripts.DeclarativeWebScript; import org.alfresco.web.scripts.DeclarativeWebScript;
import org.alfresco.web.scripts.WebScriptRequest; import org.alfresco.web.scripts.WebScriptRequest;
import org.alfresco.web.scripts.WebScriptStatus; import org.alfresco.web.scripts.WebScriptStatus;
import org.alfresco.web.scripts.facebook.FacebookService;
/** /**
@@ -41,6 +42,16 @@ import org.alfresco.web.scripts.WebScriptStatus;
*/ */
public class IndexUpdate extends DeclarativeWebScript public class IndexUpdate extends DeclarativeWebScript
{ {
// component dependencies
private FacebookService facebookService;
/**
* @param facebookService facebook service
*/
public void setFacebookService(FacebookService facebookService)
{
this.facebookService = facebookService;
}
/* (non-Javadoc) /* (non-Javadoc)
* @see org.alfresco.web.scripts.DeclarativeWebScript#executeImpl(org.alfresco.web.scripts.WebScriptRequest, org.alfresco.web.scripts.WebScriptResponse) * @see org.alfresco.web.scripts.DeclarativeWebScript#executeImpl(org.alfresco.web.scripts.WebScriptRequest, org.alfresco.web.scripts.WebScriptResponse)
@@ -54,9 +65,19 @@ public class IndexUpdate extends DeclarativeWebScript
String reset = req.getParameter("reset"); String reset = req.getParameter("reset");
if (reset != null && reset.equals("on")) if (reset != null && reset.equals("on"))
{ {
// reset list of web scripts
int previousCount = getWebScriptRegistry().getWebScripts().size(); int previousCount = getWebScriptRegistry().getWebScripts().size();
getWebScriptRegistry().reset(); getWebScriptRegistry().reset();
tasks.add("Reset Web Scripts Registry; found " + getWebScriptRegistry().getWebScripts().size() + " Web Scripts. Previously, there were " + previousCount + "."); tasks.add("Reset Web Scripts Registry; found " + getWebScriptRegistry().getWebScripts().size() + " Web Scripts. Previously, there were " + previousCount + ".");
// reset facebook service
// TODO: Determine more appropriate place to put this
int appCount = facebookService.getAppModels().size();
if (appCount > 0)
{
facebookService.reset();
tasks.add("Reset " + appCount + " Facebook Applications.");
}
} }
// create model for rendering // create model for rendering

View File

@@ -37,7 +37,7 @@ import org.alfresco.web.scripts.WebScriptServletRuntime;
/** /**
* HTTP Servlet Web Script Runtime * Runtime to support requests from Facebook
* *
* @author davidc * @author davidc
*/ */

View File

@@ -49,9 +49,7 @@ public class FacebookAPIServlet extends WebScriptServlet
private static final Log logger = LogFactory.getLog(FacebookAPIServlet.class); private static final Log logger = LogFactory.getLog(FacebookAPIServlet.class);
/* /* (non-Javadoc)
* (non-Javadoc)
*
* @see javax.servlet.http.HttpServlet#service(javax.servlet.http.HttpServletRequest, * @see javax.servlet.http.HttpServlet#service(javax.servlet.http.HttpServletRequest,
* javax.servlet.http.HttpServletResponse) * javax.servlet.http.HttpServletResponse)
*/ */
@@ -64,8 +62,8 @@ public class FacebookAPIServlet extends WebScriptServlet
runtime.executeScript(); runtime.executeScript();
} }
/** /* (non-Javadoc)
* @return default authenticator (bean name) * @see org.alfresco.web.scripts.WebScriptServlet#getDefaultAuthenticator()
*/ */
@Override @Override
protected String getDefaultAuthenticator() protected String getDefaultAuthenticator()

View File

@@ -1,37 +1,86 @@
/*
* Copyright (C) 2005-2007 Alfresco Software Limited.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* As a special exception to the terms and conditions of version 2.0 of
* the GPL, you may redistribute this Program in connection with Free/Libre
* and Open Source Software ("FLOSS") applications as described in Alfresco's
* FLOSS exception. You should have recieved a copy of the text describing
* the FLOSS exception, and it is also available here:
* http://www.alfresco.com/legal/licensing"
*/
package org.alfresco.web.scripts.facebook; package org.alfresco.web.scripts.facebook;
/**
* Facebook Application
*
* @author davidc
*/
public class FacebookAppModel public class FacebookAppModel
{ {
String appId; String appId;
String apiKey; String apiKey;
String secretKey; String secretKey;
/**
* Construct
*
* @param apiKey
*/
public FacebookAppModel(String apiKey) public FacebookAppModel(String apiKey)
{ {
this.apiKey = apiKey; this.apiKey = apiKey;
} }
/**
* @return application apiKey
*/
public String getApiKey() public String getApiKey()
{ {
return apiKey; return apiKey;
} }
/**
* @return application secret
*/
public String getSecret() public String getSecret()
{ {
return secretKey; return secretKey;
} }
/**
* @param secretKey application secret
*/
public void setSecret(String secretKey) public void setSecret(String secretKey)
{ {
this.secretKey = secretKey; this.secretKey = secretKey;
} }
/**
* @return application id
*/
public String getId() public String getId()
{ {
return appId; return appId;
} }
/**
* @param appId application id
*/
public void setId(String appId) public void setId(String appId)
{ {
this.appId = appId; this.appId = appId;

View File

@@ -36,6 +36,14 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
/**
* Web Script Authenticator that supports Facebook authentication
* mechanism.
*
* Upon success, the request is authenticated as the Facebook User Id.
*
* @author davidc
*/
public class FacebookAuthenticator implements WebScriptServletAuthenticator public class FacebookAuthenticator implements WebScriptServletAuthenticator
{ {
// Logger // Logger

View File

@@ -0,0 +1,54 @@
/*
* Copyright (C) 2005-2007 Alfresco Software Limited.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* As a special exception to the terms and conditions of version 2.0 of
* the GPL, you may redistribute this Program in connection with Free/Libre
* and Open Source Software ("FLOSS") applications as described in Alfresco's
* FLOSS exception. You should have recieved a copy of the text describing
* the FLOSS exception, and it is also available here:
* http://www.alfresco.com/legal/licensing"
*/
package org.alfresco.web.scripts.facebook;
/**
* Facebook Error.
*
* @author David Caruana
*/
public class FacebookError extends RuntimeException
{
private static final long serialVersionUID = -7338963365877285084L;
private int code = -1;
public FacebookError(String msg)
{
super(msg);
}
public FacebookError(int code, String msg)
{
super(msg);
this.code = code;
}
public int getCode()
{
return code;
}
}

View File

@@ -1,3 +1,27 @@
/*
* Copyright (C) 2005-2007 Alfresco Software Limited.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* As a special exception to the terms and conditions of version 2.0 of
* the GPL, you may redistribute this Program in connection with Free/Libre
* and Open Source Software ("FLOSS") applications as described in Alfresco's
* FLOSS exception. You should have recieved a copy of the text describing
* the FLOSS exception, and it is also available here:
* http://www.alfresco.com/legal/licensing"
*/
package org.alfresco.web.scripts.facebook; package org.alfresco.web.scripts.facebook;
import java.io.IOException; import java.io.IOException;
@@ -11,6 +35,11 @@ import com.facebook.api.FacebookException;
import com.facebook.api.FacebookRestClient; import com.facebook.api.FacebookRestClient;
/**
* Facebook Javascript API
*
* @author davidc
*/
public class FacebookModel public class FacebookModel
{ {
// Logger // Logger
@@ -19,12 +48,22 @@ public class FacebookModel
private FacebookServletRequest req; private FacebookServletRequest req;
private FacebookRestClient client; private FacebookRestClient client;
private String[] friends; private String[] friends;
private String[] appFriends;
/**
* Construct
*
* @param req
*/
public FacebookModel(FacebookServletRequest req) public FacebookModel(FacebookServletRequest req)
{ {
this.req = req; this.req = req;
} }
/**
* @return the facebook rest client
*/
private FacebookRestClient getClient() private FacebookRestClient getClient()
{ {
if (client == null) if (client == null)
@@ -40,10 +79,16 @@ public class FacebookModel
{ {
client = new FacebookRestClient(apiKey, secretKey, sessionKey); client = new FacebookRestClient(apiKey, secretKey, sessionKey);
} }
if (logger.isDebugEnabled())
client.setDebug(true);
} }
return client; return client;
} }
/**
* @return all friends of the logged in facebook user
*/
public String[] getFriends() public String[] getFriends()
{ {
if (friends == null) if (friends == null)
@@ -53,81 +98,152 @@ public class FacebookModel
{ {
try try
{ {
Document friendsDoc = getClient().friends_get(); Document response = getClient().friends_get();
NodeList uids = friendsDoc.getElementsByTagName("uid"); NodeList uids = response.getElementsByTagName("uid");
friends = new String[uids.getLength()]; String[] uidsArray = new String[uids.getLength()];
for (int i = 0; i < uids.getLength(); i++) for (int i = 0; i < uids.getLength(); i++)
{ {
friends[i] = uids.item(i).getTextContent(); uidsArray[i] = uids.item(i).getTextContent();
} }
friends = uidsArray;
} }
catch(Exception e) catch(FacebookException e)
{ {
friends = new String[0]; throw new FacebookError(e.getCode(), e.getMessage());
}
catch(IOException e)
{
throw new FacebookError(e.getMessage());
} }
} }
} }
return friends; return friends;
} }
/**
* @return friends who are users of the current application
*/
public String[] getAppFriends()
{
if (appFriends == null)
{
try
{
Document response = getClient().friends_getAppUsers();
NodeList uids = response.getElementsByTagName("uid");
String[] uidsArray = new String[uids.getLength()];
for (int i = 0; i < uids.getLength(); i++)
{
uidsArray[i] = uids.item(i).getTextContent();
}
appFriends = uidsArray;
}
catch(FacebookException e)
{
throw new FacebookError(e.getCode(), e.getMessage());
}
catch(IOException e)
{
throw new FacebookError(e.getMessage());
}
}
return appFriends;
}
/**
* Post User Action
*
* For details see:
* http://wiki.developers.facebook.com/index.php/Feed.publishActionOfUser
*
* @param title
* @param body
* @return
*/
public int postUserAction(String title, String body)
{
try
{
Document response = getClient().feed_publishActionOfUser(title, body);
int status = Integer.parseInt(response.getDocumentElement().getTextContent());
return status;
}
catch (FacebookException e)
{
if (logger.isErrorEnabled())
logger.error("Failed to post user action [title=" + title + ", body=" + body + "] due to " + e.toString());
throw new FacebookError(e.getCode(), e.getMessage());
}
catch (IOException e)
{
if (logger.isErrorEnabled())
logger.error("Failed to post user action [title=" + title + ", body=" + body + "] due to " + e.toString());
throw new FacebookError(e.getMessage());
}
}
/**
* @return user id of logged in facebook user
*/
public String getUser() public String getUser()
{ {
return req.getUserId(); return req.getUserId();
} }
/**
* @return application id of current application
*/
public String getAppId() public String getAppId()
{ {
return req.getAppId(); return req.getAppId();
} }
/**
* @return session key of current facebook session
*/
public String getSessionKey() public String getSessionKey()
{ {
return req.getSessionKey(); return req.getSessionKey();
} }
/**
* @return application api key
*/
public String getApiKey() public String getApiKey()
{ {
return req.getApiKey(); return req.getApiKey();
} }
public String getCanvasPath() /**
{ * @return application secret key
return req.getCanvasPath(); */
}
public String getCanvasURL()
{
return "http://apps.facebook.com/" + getCanvasPath();
}
public String getPageURL()
{
return "http://apps.facebook.com" + req.getPathInfo();
}
public String getSecret() public String getSecret()
{ {
return req.getSecretKey(); return req.getSecretKey();
} }
public boolean postUserAction(String title, String body) /**
* @return facebook canvas path (as entered into 'Create Application' dialog)
*/
public String getCanvasPath()
{ {
try return req.getCanvasPath();
}
/**
* @return facebook canvas url (http://apps.facebook.com/canvasPath)
*/
public String getCanvasURL()
{ {
Document result = getClient().feed_publishActionOfUser(title, body); return "http://apps.facebook.com/" + getCanvasPath();
// TODO: check result
return true;
} }
catch (FacebookException e)
/**
* @return facebook page url (http://apps.facebook.com/canvasPath/page)
*/
public String getPageURL()
{ {
if (logger.isDebugEnabled()) return "http://apps.facebook.com" + req.getPagePath();
logger.debug("Failed to post user action [title=" + title + ", body=" + body + "] due to " + e.toString());
}
catch (IOException e)
{
if (logger.isDebugEnabled())
logger.debug("Failed to post user action [title=" + title + ", body=" + body + "] due to " + e.toString());
}
return false;
} }
} }

View File

@@ -1,3 +1,27 @@
/*
* Copyright (C) 2005-2007 Alfresco Software Limited.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* As a special exception to the terms and conditions of version 2.0 of
* the GPL, you may redistribute this Program in connection with Free/Libre
* and Open Source Software ("FLOSS") applications as described in Alfresco's
* FLOSS exception. You should have recieved a copy of the text describing
* the FLOSS exception, and it is also available here:
* http://www.alfresco.com/legal/licensing"
*/
package org.alfresco.web.scripts.facebook; package org.alfresco.web.scripts.facebook;
import java.util.HashMap; import java.util.HashMap;
@@ -12,6 +36,11 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
/**
* Facebook Service
*
* @author davidc
*/
public class FacebookService public class FacebookService
{ {
// Logger // Logger
@@ -21,17 +50,25 @@ public class FacebookService
private Map<String, FacebookAppModel> apps = new HashMap<String, FacebookAppModel>(); private Map<String, FacebookAppModel> apps = new HashMap<String, FacebookAppModel>();
private ReentrantReadWriteLock appsLock = new ReentrantReadWriteLock(); private ReentrantReadWriteLock appsLock = new ReentrantReadWriteLock();
// Component dependencies
private WebScriptRegistry registry; private WebScriptRegistry registry;
private WebScriptContext context; private WebScriptContext context;
/**
* @param registry Web Script Registry
*/
public void setRegistry(WebScriptRegistry registry) public void setRegistry(WebScriptRegistry registry)
{ {
this.registry = registry; this.registry = registry;
} }
/**
* Gets the application model for the given application api key
*
* @param apiKey api key
* @return application model
*/
FacebookAppModel getAppModel(String apiKey) FacebookAppModel getAppModel(String apiKey)
{ {
FacebookAppModel facebookApp = null; FacebookAppModel facebookApp = null;
@@ -98,11 +135,19 @@ public class FacebookService
} }
} }
/**
* Gets currently known Facebook Applications
*
* @return map (name, application) of known applications
*/
public Map<String, FacebookAppModel> getAppModels() public Map<String, FacebookAppModel> getAppModels()
{ {
return apps; return apps;
} }
/**
* Reset Facebook Service
*/
public void reset() public void reset()
{ {
appsLock.writeLock().lock(); appsLock.writeLock().lock();
@@ -115,4 +160,5 @@ public class FacebookService
appsLock.writeLock().unlock(); appsLock.writeLock().unlock();
} }
} }
} }

View File

@@ -50,9 +50,7 @@ public class FacebookServlet extends FacebookAPIServlet
protected FacebookService facebookService; protected FacebookService facebookService;
/* /* (non-Javadoc)
* (non-Javadoc)
*
* @see javax.servlet.http.HttpServlet#service(javax.servlet.http.HttpServletRequest, * @see javax.servlet.http.HttpServlet#service(javax.servlet.http.HttpServletRequest,
* javax.servlet.http.HttpServletResponse) * javax.servlet.http.HttpServletResponse)
*/ */
@@ -65,6 +63,9 @@ public class FacebookServlet extends FacebookAPIServlet
runtime.executeScript(); runtime.executeScript();
} }
/* (non-Javadoc)
* @see org.alfresco.web.scripts.WebScriptServlet#initServlet(org.springframework.context.ApplicationContext)
*/
@Override @Override
protected void initServlet(ApplicationContext context) protected void initServlet(ApplicationContext context)
{ {

View File

@@ -33,7 +33,7 @@ import org.alfresco.web.scripts.WebScriptServletRequest;
/** /**
* HTTP Servlet Web Script Request * Facebook Servlet Request
* *
* @author davidc * @author davidc
*/ */
@@ -57,47 +57,74 @@ public class FacebookServletRequest extends WebScriptServletRequest
this.pathInfo = pathInfo; this.pathInfo = pathInfo;
} }
/**
* @param secretKey application secret
*/
/*package*/ void setSecretKey(String secretKey) /*package*/ void setSecretKey(String secretKey)
{ {
this.secretKey = secretKey; this.secretKey = secretKey;
} }
/**
* @param appId application id
*/
/*package*/ void setAppId(String appId) /*package*/ void setAppId(String appId)
{ {
this.appId = appId; this.appId = appId;
} }
/**
* @return application api key
*/
public String getApiKey() public String getApiKey()
{ {
return getParameter("fb_sig_api_key"); return getParameter("fb_sig_api_key");
} }
/**
* @return Facebook user id
*/
public String getUserId() public String getUserId()
{ {
return getParameter("fb_sig_user"); return getParameter("fb_sig_user");
} }
/**
* @return session key
*/
public String getSessionKey() public String getSessionKey()
{ {
return getParameter("fb_sig_session_key"); return getParameter("fb_sig_session_key");
} }
/**
* @return true => within Facebook canvas
*/
public boolean isInCanvas() public boolean isInCanvas()
{ {
String canvas = getParameter("fb_sig_api_key"); String canvas = getParameter("fb_sig_api_key");
return (canvas == null || canvas.equals("1")); return (canvas == null || canvas.equals("1"));
} }
/**
* @return application secret
*/
public String getSecretKey() public String getSecretKey()
{ {
return secretKey; return secretKey;
} }
/**
* @return application id
*/
public String getAppId() public String getAppId()
{ {
return appId; return appId;
} }
/**
* @return application canvas path
*/
public String getCanvasPath() public String getCanvasPath()
{ {
String pathInfo = getPathInfo(); String pathInfo = getPathInfo();
@@ -109,6 +136,22 @@ public class FacebookServletRequest extends WebScriptServletRequest
return pathSegments[2]; return pathSegments[2];
} }
/**
* @return application page path
*/
public String getPagePath()
{
String pagePath = getPathInfo();
if (pagePath.startsWith("/facebook"))
{
pagePath = pathInfo.substring("/facebook".length());
}
return pagePath;
}
/**
* @return friends of authenticated Facebook user
*/
public String[] getFriends() public String[] getFriends()
{ {
String[] friends; String[] friends;
@@ -117,9 +160,13 @@ public class FacebookServletRequest extends WebScriptServletRequest
return friends; return friends;
} }
/* (non-Javadoc)
* @see org.alfresco.web.scripts.WebScriptServletRequest#getPathInfo()
*/
@Override @Override
public String getPathInfo() public String getPathInfo()
{ {
return pathInfo; return pathInfo;
} }
} }

View File

@@ -38,7 +38,7 @@ import org.apache.commons.logging.LogFactory;
/** /**
* HTTP Servlet Web Script Runtime * Facebook Canvas Page Servlet.
* *
* @author davidc * @author davidc
*/ */
@@ -47,6 +47,7 @@ public class FacebookServletRuntime extends FacebookAPIRuntime
// Logger // Logger
private static final Log logger = LogFactory.getLog(FacebookServletRuntime.class); private static final Log logger = LogFactory.getLog(FacebookServletRuntime.class);
// Component dependencies
protected FacebookService facebookService; protected FacebookService facebookService;
/** /**
@@ -86,18 +87,27 @@ public class FacebookServletRuntime extends FacebookAPIRuntime
return fbreq; return fbreq;
} }
/* (non-Javadoc)
* @see org.alfresco.web.scripts.WebScriptServletRuntime#getScriptUrl()
*/
@Override @Override
protected String getScriptUrl() protected String getScriptUrl()
{ {
return "/facebook" + super.getScriptUrl(); return "/facebook" + super.getScriptUrl();
} }
/* (non-Javadoc)
* @see org.alfresco.web.scripts.WebScriptRuntime#getStatusCodeTemplate(int)
*/
@Override @Override
protected String getStatusCodeTemplate(int statusCode) protected String getStatusCodeTemplate(int statusCode)
{ {
return "/fbml." + statusCode + ".ftl"; return "/fbml." + statusCode + ".ftl";
} }
/* (non-Javadoc)
* @see org.alfresco.web.scripts.WebScriptRuntime#getStatusTemplate()
*/
@Override @Override
protected String getStatusTemplate() protected String getStatusTemplate()
{ {