implemented user photos! (imagestore table, ImageRetrieve servlet, a lot of
the underlying support) - incidentally, this is a lot of support for the SIG logo as well, just need some front end work for that in the future (of course, we now require JAI 1.1.1)
This commit is contained in:
98
src/com/silverwrist/venice/servlets/ImageRetrieve.java
Normal file
98
src/com/silverwrist/venice/servlets/ImageRetrieve.java
Normal file
@@ -0,0 +1,98 @@
|
||||
/*
|
||||
* The contents of this file are subject to the Mozilla Public License Version 1.1
|
||||
* (the "License"); you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at <http://www.mozilla.org/MPL/>.
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis, WITHOUT
|
||||
* WARRANTY OF ANY KIND, either express or implied. See the License for the specific
|
||||
* language governing rights and limitations under the License.
|
||||
*
|
||||
* The Original Code is the Venice Web Communities System.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
|
||||
* for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
|
||||
* Copyright (C) 2001 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*/
|
||||
package com.silverwrist.venice.servlets;
|
||||
|
||||
import java.io.*;
|
||||
import java.util.*;
|
||||
import javax.servlet.*;
|
||||
import javax.servlet.http.*;
|
||||
import org.apache.log4j.*;
|
||||
import com.silverwrist.venice.core.*;
|
||||
import com.silverwrist.venice.servlets.format.*;
|
||||
|
||||
public class ImageRetrieve extends VeniceServlet
|
||||
{
|
||||
/*--------------------------------------------------------------------------------
|
||||
* Static data members
|
||||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
private static Category logger = Category.getInstance(ImageRetrieve.class);
|
||||
|
||||
/*--------------------------------------------------------------------------------
|
||||
* Overrides from class HttpServlet
|
||||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
public String getServletInfo()
|
||||
{
|
||||
String rc = "ImageRetrieve servlet - Displays images from the database image store\n"
|
||||
+ "Part of the Venice Web Communities System\n";
|
||||
return rc;
|
||||
|
||||
} // end getServletInfo
|
||||
|
||||
/*--------------------------------------------------------------------------------
|
||||
* Overrides from class VeniceServlet
|
||||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
protected VeniceContent doVeniceGet(HttpServletRequest request, VeniceEngine engine,
|
||||
UserContext user, RenderData rdat)
|
||||
throws ServletException, IOException, VeniceServletResult
|
||||
{
|
||||
int imgid; // image ID to retrieve.
|
||||
|
||||
try
|
||||
{ // parse the image ID
|
||||
imgid = Integer.parseInt(request.getPathInfo().substring(1));
|
||||
|
||||
} // end try
|
||||
catch (NumberFormatException nfe)
|
||||
{ // invalid image URL
|
||||
return new ErrorBox(null,"Invalid image URL.",null);
|
||||
|
||||
} // end catch
|
||||
|
||||
// the parameters of the response
|
||||
String type, filename;
|
||||
int length;
|
||||
InputStream data;
|
||||
|
||||
try
|
||||
{ // load the image from the database
|
||||
BinaryData image = engine.loadImage(imgid);
|
||||
|
||||
type = image.getMIMEType();
|
||||
filename = image.getFilename();
|
||||
length = image.getLength();
|
||||
data = image.getData();
|
||||
|
||||
} // end try
|
||||
catch (DataException de)
|
||||
{ // unable to get the user name
|
||||
return new ErrorBox("Database Error","Database error retrieving image: " + de.getMessage(),null);
|
||||
|
||||
} // end catch
|
||||
|
||||
// now we want to send that data back to the user!
|
||||
throw new SendFileResult(type,filename,length,data);
|
||||
|
||||
} // end doVeniceGet
|
||||
|
||||
} // end class ImageRetrieve
|
||||
@@ -62,7 +62,7 @@ public class UserDisplay extends VeniceServlet
|
||||
UserProfile prof = user.getProfile(uname);
|
||||
changeMenuTop(request);
|
||||
setMyLocation(request,"user" + request.getPathInfo());
|
||||
return new UserProfileData(prof);
|
||||
return new UserProfileData(engine,prof);
|
||||
|
||||
} // end try
|
||||
catch (DataException de)
|
||||
@@ -134,7 +134,7 @@ public class UserDisplay extends VeniceServlet
|
||||
logger.debug("redisplaying profile window");
|
||||
changeMenuTop(request);
|
||||
setMyLocation(request,"user" + request.getPathInfo());
|
||||
return new UserProfileData(prof);
|
||||
return new UserProfileData(engine,prof);
|
||||
|
||||
} // end doVenicePost
|
||||
|
||||
|
||||
173
src/com/silverwrist/venice/servlets/UserPhoto.java
Normal file
173
src/com/silverwrist/venice/servlets/UserPhoto.java
Normal file
@@ -0,0 +1,173 @@
|
||||
/*
|
||||
* The contents of this file are subject to the Mozilla Public License Version 1.1
|
||||
* (the "License"); you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at <http://www.mozilla.org/MPL/>.
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis, WITHOUT
|
||||
* WARRANTY OF ANY KIND, either express or implied. See the License for the specific
|
||||
* language governing rights and limitations under the License.
|
||||
*
|
||||
* The Original Code is the Venice Web Communities System.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
|
||||
* for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
|
||||
* Copyright (C) 2001 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*/
|
||||
package com.silverwrist.venice.servlets;
|
||||
|
||||
import java.io.*;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.*;
|
||||
import javax.servlet.*;
|
||||
import javax.servlet.http.*;
|
||||
import org.apache.log4j.*;
|
||||
import com.silverwrist.util.StringUtil;
|
||||
import com.silverwrist.util.ServletMultipartHandler;
|
||||
import com.silverwrist.util.ServletMultipartException;
|
||||
import com.silverwrist.util.image.*;
|
||||
import com.silverwrist.venice.core.*;
|
||||
import com.silverwrist.venice.servlets.format.*;
|
||||
|
||||
public class UserPhoto extends VeniceServlet
|
||||
{
|
||||
/*--------------------------------------------------------------------------------
|
||||
* Static data members
|
||||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
private static Category logger = Category.getInstance(UserPhoto.class);
|
||||
|
||||
/*--------------------------------------------------------------------------------
|
||||
* Overrides from class HttpServlet
|
||||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
public String getServletInfo()
|
||||
{
|
||||
String rc = "UserPhoto servlet - changes the user photo for a user\n"
|
||||
+ "Part of the Venice Web Communities System\n";
|
||||
return rc;
|
||||
|
||||
} // end getServletInfo
|
||||
|
||||
/*--------------------------------------------------------------------------------
|
||||
* Overrides from class VeniceServlet
|
||||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
protected VeniceContent doVeniceGet(HttpServletRequest request, VeniceEngine engine,
|
||||
UserContext user, RenderData rdat)
|
||||
throws ServletException, IOException, VeniceServletResult
|
||||
{
|
||||
String tgt = request.getParameter("tgt"); // target location
|
||||
if (tgt==null)
|
||||
tgt = "top"; // go back to the Top screen if nothing else
|
||||
|
||||
try
|
||||
{ // create the display
|
||||
return new UserPhotoData(engine,user,rdat,tgt);
|
||||
|
||||
} // end try
|
||||
catch (DataException de)
|
||||
{ // error getting at the data stream from the attachment
|
||||
return new ErrorBox("Database Error","Database error generating display: " + de.getMessage(),null);
|
||||
|
||||
} // end catch
|
||||
|
||||
} // end doVeniceGet
|
||||
|
||||
protected VeniceContent doVenicePost(HttpServletRequest request, ServletMultipartHandler mphandler,
|
||||
VeniceEngine engine, UserContext user, RenderData rdat)
|
||||
throws ServletException, IOException, VeniceServletResult
|
||||
{
|
||||
// Get target URL for the operation
|
||||
if (mphandler.isFileParam("tgt"))
|
||||
{ // bogus target URL
|
||||
logger.error("Internal Error: 'tgt' should be a normal param");
|
||||
return new ErrorBox(null,"Internal Error: 'tgt' should be a normal param","top");
|
||||
|
||||
} // end if
|
||||
|
||||
String tgt = mphandler.getValue("tgt");
|
||||
if (tgt==null)
|
||||
tgt = "top"; // go back to the Top screen if nothing else
|
||||
|
||||
if (isImageButtonClicked(mphandler,"cancel"))
|
||||
throw new RedirectResult("account?cmd=P&tgt=" + URLEncoder.encode(tgt));
|
||||
|
||||
if (isImageButtonClicked(mphandler,"upload"))
|
||||
{ // uploading the image here!
|
||||
// also check on file parameter status
|
||||
if (!(mphandler.isFileParam("thepic")))
|
||||
{ // bogus file parameter
|
||||
logger.error("Internal Error: 'thepic' should be a file param");
|
||||
return new ErrorBox(null,"Internal Error: 'thepic' should be a file param",
|
||||
"account?cmd=P&tgt=" + URLEncoder.encode(tgt));
|
||||
|
||||
} // end if
|
||||
|
||||
if (!(mphandler.getContentType("thepic").startsWith("image/")))
|
||||
{ // must be an image type we uploaded!
|
||||
logger.error("Error: 'thepic' not an image type");
|
||||
return new ErrorBox(null,"You did not upload an image file. Try again.",
|
||||
"userphoto?tgt=" + URLEncoder.encode(tgt));
|
||||
|
||||
} // end if
|
||||
|
||||
try
|
||||
{ // get the real picture (normalized to 100x100 size)
|
||||
ImageLengthPair real_pic = ImageNormalizer.normalizeImage(mphandler.getFileContentStream("thepic"),
|
||||
engine.getUserPhotoSize(),"jpeg");
|
||||
|
||||
// set the user photo data!
|
||||
ContactInfo ci = user.getContactInfo();
|
||||
ci.setPhotoData(request.getContextPath() + "/imagedata/","image/jpeg",real_pic.getLength(),
|
||||
real_pic.getData());
|
||||
user.putContactInfo(ci);
|
||||
|
||||
// Jump back to the profile form.
|
||||
throw new RedirectResult("account?cmd=P&tgt=" + URLEncoder.encode(tgt));
|
||||
|
||||
} // end try
|
||||
catch (ServletMultipartException smpe)
|
||||
{ // the servlet multipart parser screwed up
|
||||
logger.error("Servlet multipart error:",smpe);
|
||||
return new ErrorBox(null,"Internal Error: " + smpe.getMessage(),
|
||||
"account?cmd=P&tgt=" + URLEncoder.encode(tgt));
|
||||
|
||||
} // end catch
|
||||
catch (ImageNormalizerException ine)
|
||||
{ // the image was not valid
|
||||
logger.error("Image normalizer error:",ine);
|
||||
return new ErrorBox(null,ine.getMessage(),"userphoto?tgt=" + URLEncoder.encode(tgt));
|
||||
|
||||
} // end catch
|
||||
catch (DataException de)
|
||||
{ // error in the database!
|
||||
logger.error("DataException:",de);
|
||||
return new ErrorBox("Database Error","Database error storing user photo: " + de.getMessage(),
|
||||
"account?cmd=P&tgt=" + URLEncoder.encode(tgt));
|
||||
|
||||
} // end catch
|
||||
catch (EmailException ee)
|
||||
{ // email exception (WTF?)
|
||||
logger.error("Email exception (shouldn't happen):",ee);
|
||||
return new ErrorBox(null,"Internal Error: " + ee.getMessage(),
|
||||
"account?cmd=P&tgt=" + URLEncoder.encode(tgt));
|
||||
|
||||
} // end catch
|
||||
|
||||
} // end if
|
||||
else
|
||||
{ // the button must be wrong!
|
||||
logger.error("no known button click on UserPhoto.doPost");
|
||||
return new ErrorBox("Internal Error","Unknown command button pressed",
|
||||
"account?cmd=P&tgt=" + URLEncoder.encode(tgt));
|
||||
|
||||
} // end else
|
||||
|
||||
} // end doVenicePost
|
||||
|
||||
} // end class UserPhoto
|
||||
@@ -292,6 +292,13 @@ public abstract class VeniceServlet extends HttpServlet
|
||||
|
||||
} // end isImageButtonClicked
|
||||
|
||||
protected static final boolean isImageButtonClicked(ServletMultipartHandler mphandler, String name)
|
||||
{
|
||||
String val = mphandler.getValue(name + ".x");
|
||||
return (val!=null);
|
||||
|
||||
} // end isImageButtonClicked
|
||||
|
||||
protected final void putUserContext(HttpServletRequest request, UserContext ctxt)
|
||||
{
|
||||
Variables.putUserContext(request.getSession(true),ctxt);
|
||||
|
||||
@@ -17,6 +17,8 @@
|
||||
*/
|
||||
package com.silverwrist.venice.servlets.format;
|
||||
|
||||
import java.io.*;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.*;
|
||||
import com.silverwrist.util.LocaleFactory;
|
||||
import com.silverwrist.util.StringUtil;
|
||||
@@ -25,6 +27,66 @@ import com.silverwrist.venice.core.*;
|
||||
|
||||
public class EditProfileDialog extends ContentDialog
|
||||
{
|
||||
/*--------------------------------------------------------------------------------
|
||||
* The photo URL control class.
|
||||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
static class CDUserPhotoControl extends CDBaseFormField
|
||||
{
|
||||
private String linkURL;
|
||||
|
||||
public CDUserPhotoControl(String name, String caption, String linkURL)
|
||||
{
|
||||
super(name,caption,"(click to change)",false);
|
||||
|
||||
} // end constructor
|
||||
|
||||
protected CDUserPhotoControl(CDUserPhotoControl other)
|
||||
{
|
||||
super(other);
|
||||
this.linkURL = other.linkURL;
|
||||
|
||||
} // end constructor
|
||||
|
||||
protected void renderActualField(Writer out, RenderData rdat) throws IOException
|
||||
{
|
||||
if (isEnabled())
|
||||
out.write("<A HREF=\"" + rdat.getEncodedServletPath(linkURL) + "\">");
|
||||
String photo = getValue();
|
||||
if (StringUtil.isStringEmpty(photo))
|
||||
photo = rdat.getFullImagePath("photo_not_avail.gif");
|
||||
out.write("<IMG SRC=\"" + photo + "\" ALT=\"\" BORDER=0 WIDTH=100 HEIGHT=100></A>");
|
||||
if (isEnabled())
|
||||
out.write("</A>");
|
||||
|
||||
} // end renderActualField
|
||||
|
||||
protected void validateContents(String value) throws ValidationException
|
||||
{ // this is a do-nothing value
|
||||
} // end validateContents
|
||||
|
||||
public CDFormField duplicate()
|
||||
{
|
||||
return new CDUserPhotoControl(this);
|
||||
|
||||
} // end clone
|
||||
|
||||
public void setLinkURL(String s)
|
||||
{
|
||||
linkURL = s;
|
||||
|
||||
} // end setLinkURL
|
||||
|
||||
} // end class CDUserPhotoControl
|
||||
|
||||
/*--------------------------------------------------------------------------------
|
||||
* Attributes
|
||||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
private CDUserPhotoControl photo_control;
|
||||
|
||||
/*--------------------------------------------------------------------------------
|
||||
* Constructors
|
||||
*--------------------------------------------------------------------------------
|
||||
@@ -67,7 +129,8 @@ public class EditProfileDialog extends ContentDialog
|
||||
addFormField(new CDTextFormField("url","Home page","(URL)",false,32,255));
|
||||
addFormField(new CDFormCategoryHeader("Personal"));
|
||||
addFormField(new CDTextFormField("descr","Personal description",null,false,32,255));
|
||||
// TODO: add photo selection/uploading method here
|
||||
photo_control = new CDUserPhotoControl("photo","User Photo","userphoto");
|
||||
addFormField(photo_control);
|
||||
addFormField(new CDFormCategoryHeader("User Preferences"));
|
||||
addFormField(new CDLocaleListFormField("locale","Default locale","(for formatting dates/times)",true));
|
||||
addFormField(new CDTimeZoneListFormField("tz","Default time zone",null,true));
|
||||
@@ -79,6 +142,7 @@ public class EditProfileDialog extends ContentDialog
|
||||
protected EditProfileDialog(EditProfileDialog other)
|
||||
{
|
||||
super(other);
|
||||
photo_control = (CDUserPhotoControl)modifyField("photo");
|
||||
|
||||
} // end constructor
|
||||
|
||||
@@ -162,6 +226,8 @@ public class EditProfileDialog extends ContentDialog
|
||||
setFieldValue("pvt_email","Y");
|
||||
setFieldValue("url",ci.getURL());
|
||||
setFieldValue("descr",uc.getDescription());
|
||||
setFieldValue("photo",ci.getPhotoURL());
|
||||
photo_control.setLinkURL("userphoto?tgt=" + URLEncoder.encode(target));
|
||||
setFieldValue("locale",uc.getLocale().toString());
|
||||
setFieldValue("tz",uc.getTimeZone().getID());
|
||||
|
||||
|
||||
126
src/com/silverwrist/venice/servlets/format/UserPhotoData.java
Normal file
126
src/com/silverwrist/venice/servlets/format/UserPhotoData.java
Normal file
@@ -0,0 +1,126 @@
|
||||
/*
|
||||
* The contents of this file are subject to the Mozilla Public License Version 1.1
|
||||
* (the "License"); you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at <http://www.mozilla.org/MPL/>.
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis, WITHOUT
|
||||
* WARRANTY OF ANY KIND, either express or implied. See the License for the specific
|
||||
* language governing rights and limitations under the License.
|
||||
*
|
||||
* The Original Code is the Venice Web Communities System.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
|
||||
* for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
|
||||
* Copyright (C) 2001 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*/
|
||||
package com.silverwrist.venice.servlets.format;
|
||||
|
||||
import java.awt.Dimension;
|
||||
import javax.servlet.*;
|
||||
import javax.servlet.http.*;
|
||||
import com.silverwrist.util.StringUtil;
|
||||
import com.silverwrist.venice.core.*;
|
||||
|
||||
public class UserPhotoData implements JSPRender
|
||||
{
|
||||
/*--------------------------------------------------------------------------------
|
||||
* Static data members
|
||||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
// Attribute name for request attribute
|
||||
protected static final String ATTR_NAME = "com.silverwrist.venice.content.UserPhotoData";
|
||||
|
||||
/*--------------------------------------------------------------------------------
|
||||
* Attributes
|
||||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
private Dimension photo_dims;
|
||||
private String photo_url;
|
||||
private String target;
|
||||
|
||||
/*--------------------------------------------------------------------------------
|
||||
* Constructor
|
||||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
public UserPhotoData(VeniceEngine engine, UserContext user, RenderData rdat, String target)
|
||||
throws DataException
|
||||
{
|
||||
photo_dims = engine.getUserPhotoSize();
|
||||
photo_url = user.getContactInfo().getPhotoURL();
|
||||
if (StringUtil.isStringEmpty(photo_url))
|
||||
photo_url = rdat.getFullImagePath("photo_not_avail.gif");
|
||||
this.target = target;
|
||||
|
||||
} // end constructor
|
||||
|
||||
/*--------------------------------------------------------------------------------
|
||||
* External static functions
|
||||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
public static UserPhotoData retrieve(ServletRequest request)
|
||||
{
|
||||
return (UserPhotoData)(request.getAttribute(ATTR_NAME));
|
||||
|
||||
} // end retrieve
|
||||
|
||||
/*--------------------------------------------------------------------------------
|
||||
* Implementations from interface VeniceContent
|
||||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
public String getPageTitle(RenderData rdat)
|
||||
{
|
||||
return "Set User Photo";
|
||||
|
||||
} // end getPageTitle
|
||||
|
||||
public String getPageQID()
|
||||
{
|
||||
return null;
|
||||
|
||||
} // end getPageQID
|
||||
|
||||
/*--------------------------------------------------------------------------------
|
||||
* Implementations from interface JSPRender
|
||||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
public void store(ServletRequest request)
|
||||
{
|
||||
request.setAttribute(ATTR_NAME,this);
|
||||
|
||||
} // end store
|
||||
|
||||
public String getTargetJSPName()
|
||||
{
|
||||
return "user_photo.jsp";
|
||||
|
||||
} // end getTargetJSPName
|
||||
|
||||
/*--------------------------------------------------------------------------------
|
||||
* External operations
|
||||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
public String getTarget()
|
||||
{
|
||||
return target;
|
||||
|
||||
} // end getTarget
|
||||
|
||||
public String getPhotoTag(RenderData rdat)
|
||||
{
|
||||
StringBuffer buf = new StringBuffer("<IMG SRC=\"");
|
||||
buf.append(photo_url).append("\" ALT=\"\" ALIGN=LEFT WIDTH=").append(photo_dims.width).append(" HEIGHT=");
|
||||
buf.append(photo_dims.height).append(" HSPACE=6 VSPACE=0 BORDER=0>");
|
||||
return buf.toString();
|
||||
|
||||
} // end getPhotoTag
|
||||
|
||||
} // end class UserPhotoData
|
||||
@@ -17,8 +17,10 @@
|
||||
*/
|
||||
package com.silverwrist.venice.servlets.format;
|
||||
|
||||
import java.awt.Dimension;
|
||||
import javax.servlet.ServletRequest;
|
||||
import com.silverwrist.util.StringUtil;
|
||||
import com.silverwrist.venice.core.VeniceEngine;
|
||||
import com.silverwrist.venice.core.UserProfile;
|
||||
|
||||
public class UserProfileData implements JSPRender
|
||||
@@ -36,6 +38,7 @@ public class UserProfileData implements JSPRender
|
||||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
private VeniceEngine engine;
|
||||
private UserProfile prof;
|
||||
|
||||
/*--------------------------------------------------------------------------------
|
||||
@@ -43,8 +46,9 @@ public class UserProfileData implements JSPRender
|
||||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
public UserProfileData(UserProfile prof)
|
||||
public UserProfileData(VeniceEngine engine, UserProfile prof)
|
||||
{
|
||||
this.engine = engine;
|
||||
this.prof = prof;
|
||||
|
||||
} // end constructor
|
||||
@@ -143,13 +147,17 @@ public class UserProfileData implements JSPRender
|
||||
|
||||
} // end getFullName
|
||||
|
||||
public String getPhotoURL(RenderData rdat)
|
||||
public String getPhotoTag(RenderData rdat)
|
||||
{
|
||||
Dimension dim = engine.getUserPhotoSize();
|
||||
StringBuffer buf = new StringBuffer("<IMG SRC=\"");
|
||||
String tmp = prof.getPhotoURL();
|
||||
if (StringUtil.isStringEmpty(tmp))
|
||||
tmp = rdat.getFullImagePath("photo_not_avail.gif");
|
||||
return tmp;
|
||||
buf.append(tmp).append("\" ALT=\"\" ALIGN=LEFT WIDTH=").append(dim.width).append(" HEIGHT=");
|
||||
buf.append(dim.height).append(" BORDER=0>");
|
||||
return buf.toString();
|
||||
|
||||
} // end getPhotoURL
|
||||
} // end getPhotoTag
|
||||
|
||||
} // end class UserProfileData
|
||||
|
||||
Reference in New Issue
Block a user