Index: lams_common/conf/hibernate/mappings/org/lamsfoundation/lams/tool/BasicToolVO.hbm.xml =================================================================== RCS file: /usr/local/cvsroot/lams_common/conf/hibernate/mappings/org/lamsfoundation/lams/tool/BasicToolVO.hbm.xml,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_common/conf/hibernate/mappings/org/lamsfoundation/lams/tool/BasicToolVO.hbm.xml 27 Jun 2005 00:41:37 -0000 1.1 @@ -0,0 +1,303 @@ + + + + + + + + + @hibernate.class + table="lams_tool" + + true + + + + @hibernate.id + generator-class="identity" + type="java.lang.Long" + column="tool_id" + + + + + + + + + @hibernate.property + column="learner_url" + length="65535" + not-null="true" + + + + + @hibernate.property + column="grouping_support_type_id" + length="3" + not-null="true" + + + + + @hibernate.property + column="author_url" + length="65535" + + + + + @hibernate.property + column="supports_define_later_flag" + length="1" + not-null="true" + + + + + + @hibernate.property + column="supports_moderation_flag" + length="1" + not-null="true" + + + + + + @hibernate.property + column="supports_run_offline_flag" + length="1" + not-null="true" + + + + + + @hibernate.property + column="supports_contribute_flag" + length="1" + not-null="true" + + + + + + @hibernate.property + column="valid_flag" + length="1" + not-null="true" + + + + + + @hibernate.property + column="define_later_url" + length="65535" + + + + + @hibernate.property + column="default_tool_content_id" + length="20" + not-null="false" + + + + + @hibernate.property + column="tool_signature" + length="64" + not-null="true" + + + + + @hibernate.property + column="tool_display_name" + length="255" + not-null="true" + + + + + @hibernate.property + column="description" + length="65535" + + + + + @hibernate.property column="create_date_time" + length="19" not-null="true" + + + + + @hibernate.property + column="class_name" + length="65535" + not-null="true" + + + + + @hibernate.property + column="export_portfolio_url" + length="65535" + not-null="true" + + + + + + @hibernate.property + column="monitor_url" + length="65535" + not-null="true" + + + + + + @hibernate.property + column="moderation_url" + length="65535" + not-null="true" + + + + + + @hibernate.property + column="contribute_url" + length="65535" + not-null="true" + + + + + Index: lams_common/src/java/org/lamsfoundation/lams/tool/BasicToolVO.java =================================================================== RCS file: /usr/local/cvsroot/lams_common/src/java/org/lamsfoundation/lams/tool/BasicToolVO.java,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_common/src/java/org/lamsfoundation/lams/tool/BasicToolVO.java 27 Jun 2005 00:41:37 -0000 1.1 @@ -0,0 +1,480 @@ +/**************************************************************** + * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + * ============================================================= + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ +package org.lamsfoundation.lams.tool; + +import java.io.Serializable; +import java.util.Date; + +import org.apache.commons.lang.builder.EqualsBuilder; +import org.apache.commons.lang.builder.HashCodeBuilder; +import org.apache.commons.lang.builder.ToStringBuilder; + + +/** + * + * @hibernate.class table="lams_tool" + */ +public class BasicToolVO implements Serializable { + + /** identifier field */ + private Long toolId; + + /** persistent field */ + private String learnerUrl; + + /** persistent field */ + private boolean supportsGrouping; + + /** nullable persistent field */ + private String authorUrl; + + /** persistent field */ + private boolean supportsDefineLater; + + /** persistent field */ + private boolean supportsModeration; + + /** persistent field */ + private boolean supportsRunOffline; + + /** persistent field */ + private boolean supportsContribute; + + /** persistent field */ + private boolean valid; + + /** nullable persistent field */ + private String defineLaterUrl; + + /** nullable persistent field */ + private long defaultToolContentId; + + /** persistent field */ + private String toolSignature; + + /** persistent field */ + private String toolDisplayName; + + /** nullable persistent field */ + private String description; + + /** persistent field */ + private String serviceName; + + /** persistent field */ + private Date createDateTime; + + /** persistent field */ + private String exportPortfolioUrl; + + /** persistent field */ + private String monitorUrl; + + /** persistent field */ + private String contributeUrl; + + /** persistent field */ + private String moderationUrl; + + /** persistent field */ + private Integer groupingSupportTypeId; + + /** full constructor */ + public BasicToolVO(Long toolId, + String learnerUrl, + boolean supportsGrouping, + String authorUrl, + boolean supportsDefineLater, + boolean supportsModeration, + boolean supportsRunOffline, + boolean supportsContribute, + String defineLaterUrl, + long defaultToolContentId, + String toolSignature, + String toolDisplayName, + String description, + String className, + String exportPortfolioUrl, + Integer groupingSupportTypeId, + Date createDateTime, + String monitorUrl, + String contributeUrl, + String moderationUrl) + { + this.toolId = toolId; + this.learnerUrl = learnerUrl; + this.supportsGrouping = supportsGrouping; + this.authorUrl = authorUrl; + this.supportsDefineLater = supportsDefineLater; + this.supportsModeration = supportsModeration; + this.supportsContribute = supportsContribute; + this.supportsRunOffline = supportsRunOffline; + this.defineLaterUrl = defineLaterUrl; + this.defaultToolContentId = defaultToolContentId; + this.toolSignature = toolSignature; + this.toolDisplayName = toolDisplayName; + this.description = description; + this.serviceName = className; + this.exportPortfolioUrl = exportPortfolioUrl; + this.groupingSupportTypeId = groupingSupportTypeId; + this.createDateTime = createDateTime; + this.monitorUrl = monitorUrl; + this.contributeUrl = contributeUrl; + this.moderationUrl = moderationUrl; + } + + /** default constructor */ + public BasicToolVO() { + } + + /** minimal constructor */ + public BasicToolVO(Long toolId, + String learnerUrl, + boolean supportsGrouping, + boolean supportsDefineLater, + boolean supportsModeration, + boolean supportsContribute, + boolean supportsRunOffline, + long defaultToolContentId, + String toolSignature, + String toolDisplayName, + String className, + String exportPortfolioUrl, + Integer groupingSupportTypeId, + Date createDateTime, + String monitorUrl) + { + this.toolId = toolId; + this.learnerUrl = learnerUrl; + this.supportsGrouping = supportsGrouping; + this.supportsDefineLater = supportsDefineLater; + this.supportsModeration = supportsModeration; + this.supportsContribute = supportsContribute; + this.supportsRunOffline = supportsRunOffline; + this.defaultToolContentId = defaultToolContentId; + this.toolSignature = toolSignature; + this.toolDisplayName = toolDisplayName; + this.serviceName = className; + this.exportPortfolioUrl = exportPortfolioUrl; + this.groupingSupportTypeId = groupingSupportTypeId; + this.createDateTime = createDateTime; + this.monitorUrl = monitorUrl; + } + + /** + * @hibernate.id generator-class="identity" type="java.lang.Long" + * column="tool_id" + */ + public Long getToolId() { + return this.toolId; + } + + public void setToolId(Long toolId) { + this.toolId = toolId; + } + + /** + * @hibernate.property column="learner_url"length="65535" + * not-null="true" + */ + public String getLearnerUrl() { + return this.learnerUrl; + } + + public void setLearnerUrl(String learnerUrl) { + this.learnerUrl = learnerUrl; + } + + /** + * @hibernate.property column="supports_contribute_flag" length="1" + * not-null="true" + * @return Returns the supportsContribute. + */ + public boolean getSupportsContribute() + { + return supportsContribute; + } + /** + * @param supportsContribute The supportsContribute to set. + */ + public void setSupportsContribute(boolean supportsContribute) + { + this.supportsContribute = supportsContribute; + } + + /** + * @hibernate.property column="author_url" length="65535" + */ + public String getAuthorUrl() { + return this.authorUrl; + } + + public void setAuthorUrl(String authorUrl) { + this.authorUrl = authorUrl; + } + + /** + * @hibernate.property column="supports_define_later_flag" length="1" + * not-null="true" + */ + public boolean getSupportsDefineLater() { + return this.supportsDefineLater; + } + + public void setSupportsDefineLater(boolean supportsDefineLater) { + this.supportsDefineLater = supportsDefineLater; + } + + /** + * @hibernate.property column="supports_moderation_flag" length="1" + * not-null="true" + * @return Returns the supportsModeration. + */ + public boolean getSupportsModeration() + { + return supportsModeration; + } + /** + * @param supportsModeration The supportsModeration to set. + */ + public void setSupportsModeration(boolean supportsModeration) + { + this.supportsModeration = supportsModeration; + } + + /** + * @hibernate.property column="supports_run_offline_flag" length="1" + * not-null="true" + * @return Returns the supportsRunOffline. + */ + public boolean getSupportsRunOffline() + { + return supportsRunOffline; + } + + /** + * @param supportsRunOffline The supportsRunOffline to set. + */ + public void setSupportsRunOffline(boolean supportsRunOffline) + { + this.supportsRunOffline = supportsRunOffline; + } + + /** + * @hibernate.property column="define_later_url" length="65535" + */ + public String getDefineLaterUrl() { + return this.defineLaterUrl; + } + + public void setDefineLaterUrl(String defineLaterUrl) { + this.defineLaterUrl = defineLaterUrl; + } + + /** + * @hibernate.property column="default_tool_content_id" length="20" + * not-null="false" + */ + public long getDefaultToolContentId() { + return this.defaultToolContentId; + } + + public void setDefaultToolContentId(long defaultToolContentId) { + this.defaultToolContentId = defaultToolContentId; + } + + /** + * @hibernate.property column="tool_signature" length="64" + * not-null="true" + */ + public String getToolSignature() { + return this.toolSignature; + } + + public void setToolSignature(String toolSignature) { + this.toolSignature = toolSignature; + } + + /** + * @hibernate.property column="tool_display_name" length="255" + * not-null="true" + */ + public String getToolDisplayName() { + return this.toolDisplayName; + } + + public void setToolDisplayName(String toolDisplayName) { + this.toolDisplayName = toolDisplayName; + } + + /** + * @hibernate.property column="description" length="65535" + */ + public String getDescription() { + return this.description; + } + + public void setDescription(String description) { + this.description = description; + } + + /** + * @hibernate.property column="service_name" length="65535" + * not-null="true" + */ + public String getServiceName() { + return this.serviceName; + } + + public void setServiceName(String serviceName) { + this.serviceName = serviceName; + } + + /** + * @hibernate.property column="export_portfolio_url" length="65535" + * not-null="true" + */ + public String getExportPortfolioUrl() { + return this.exportPortfolioUrl; + } + + public void setExportPortfolioUrl(String exportPortfolioUrl) { + this.exportPortfolioUrl = exportPortfolioUrl; + } + + /** + * @hibernate.property column="valid_flag" length="1" + * not-null="true" + * @return Returns the valid. + */ + public boolean isValid() + { + return valid; + } + /** + * @param valid The valid to set. + */ + public void setValid(boolean valid) + { + this.valid = valid; + } + /** + * @return Returns the groupingSupportTypeId. + */ + public Integer getGroupingSupportTypeId() + { + return groupingSupportTypeId; + } + /** + * @param groupingSupportTypeId The groupingSupportTypeId to set. + */ + public void setGroupingSupportTypeId(Integer groupingSupportTypeId) + { + this.groupingSupportTypeId = groupingSupportTypeId; + } + + /** + * @hibernate.property column="create_date_time" + length="19" not-null="true" + * @return Returns the createDateTime. + */ + public Date getCreateDateTime() + { + return createDateTime; + } + /** + * @param createDateTime The createDateTime to set. + */ + public void setCreateDateTime(Date createDateTime) + { + this.createDateTime = createDateTime; + } + + + /** + * @hibernate.property column="contribute_url" length="65535" + * @return Returns the contributeUrl. + */ + public String getContributeUrl() + { + return contributeUrl; + } + /** + * @param contributeUrl The contributUrl to set. + */ + public void setContributeUrl(String contributeUrl) + { + this.contributeUrl = contributeUrl; + } + /** + * @hibernate.property column="moderation_url" length="65535" + * @return Returns the moderationUrl. + */ + public String getModerationUrl() + { + return moderationUrl; + } + /** + * @param moderationUrl The moderationUrl to set. + */ + public void setModerationUrl(String moderationUrl) + { + this.moderationUrl = moderationUrl; + } + /** + * @hibernate.property column="monitor_url" length="65535" + * @return Returns the monitorUrl. + */ + public String getMonitorUrl() + { + return monitorUrl; + } + /** + * @param monitorUrl The monitorUrl to set. + */ + public void setMonitorUrl(String monitorUrl) + { + this.monitorUrl = monitorUrl; + } + public String toString() { + return new ToStringBuilder(this) + .append("toolId", getToolId()) + .toString(); + } + + public boolean equals(Object other) { + if ( (this == other ) ) return true; + if ( !(other instanceof Tool) ) return false; + Tool castOther = (Tool) other; + return new EqualsBuilder() + .append(this.getToolId(), castOther.getToolId()) + .isEquals(); + } + + public int hashCode() { + return new HashCodeBuilder() + .append(getToolId()) + .toHashCode(); + } + +} Index: lams_common/src/java/org/lamsfoundation/lams/tool/dao/IToolDAO.java =================================================================== RCS file: /usr/local/cvsroot/lams_common/src/java/org/lamsfoundation/lams/tool/dao/IToolDAO.java,v diff -u -r1.3 -r1.4 --- lams_common/src/java/org/lamsfoundation/lams/tool/dao/IToolDAO.java 24 Jun 2005 08:32:41 -0000 1.3 +++ lams_common/src/java/org/lamsfoundation/lams/tool/dao/IToolDAO.java 27 Jun 2005 00:41:36 -0000 1.4 @@ -11,6 +11,7 @@ import java.util.List; +import org.lamsfoundation.lams.tool.BasicToolVO; import org.lamsfoundation.lams.tool.Tool; @@ -25,6 +26,6 @@ public Tool getToolByID(Long toolID); public List getAllTools(); - public Tool getToolBySignature(final String toolSignature); + public BasicToolVO getToolBySignature(final String toolSignature); public long getToolDefaultContentIdBySignature(final String toolSignature); } Index: lams_common/src/java/org/lamsfoundation/lams/tool/dao/hibernate/ToolDAO.java =================================================================== RCS file: /usr/local/cvsroot/lams_common/src/java/org/lamsfoundation/lams/tool/dao/hibernate/ToolDAO.java,v diff -u -r1.3 -r1.4 --- lams_common/src/java/org/lamsfoundation/lams/tool/dao/hibernate/ToolDAO.java 24 Jun 2005 08:33:58 -0000 1.3 +++ lams_common/src/java/org/lamsfoundation/lams/tool/dao/hibernate/ToolDAO.java 27 Jun 2005 00:41:37 -0000 1.4 @@ -14,6 +14,7 @@ import net.sf.hibernate.HibernateException; import net.sf.hibernate.Session; +import org.lamsfoundation.lams.tool.BasicToolVO; import org.lamsfoundation.lams.tool.Tool; import org.lamsfoundation.lams.tool.dao.IToolDAO; import org.springframework.orm.hibernate.HibernateCallback; @@ -29,7 +30,7 @@ public class ToolDAO extends HibernateDaoSupport implements IToolDAO { private static final String FIND_ALL = "from obj in class " + Tool.class.getName(); - private static final String LOAD_TOOL_BY_SIG = "from tool in class Tool where tool.toolSignature=:toolSignature"; + private static final String LOAD_TOOL_BY_SIG = "from tool in class BasicToolVO where tool.toolSignature=:toolSignature"; /** @@ -44,9 +45,9 @@ return this.getHibernateTemplate().find(FIND_ALL); } - public Tool getToolBySignature(final String toolSignature) + public BasicToolVO getToolBySignature(final String toolSignature) { - return (Tool) getHibernateTemplate().execute(new HibernateCallback() + return (BasicToolVO) getHibernateTemplate().execute(new HibernateCallback() { public Object doInHibernate(Session session) throws HibernateException { @@ -59,7 +60,7 @@ public long getToolDefaultContentIdBySignature(final String toolSignature) { - Tool tool= (Tool) getHibernateTemplate().execute(new HibernateCallback() + BasicToolVO tool= (BasicToolVO) getHibernateTemplate().execute(new HibernateCallback() { public Object doInHibernate(Session session) throws HibernateException { Index: lams_common/src/java/org/lamsfoundation/lams/tool/service/ILamsToolService.java =================================================================== RCS file: /usr/local/cvsroot/lams_common/src/java/org/lamsfoundation/lams/tool/service/ILamsToolService.java,v diff -u -r1.9 -r1.10 --- lams_common/src/java/org/lamsfoundation/lams/tool/service/ILamsToolService.java 24 Jun 2005 08:33:08 -0000 1.9 +++ lams_common/src/java/org/lamsfoundation/lams/tool/service/ILamsToolService.java 27 Jun 2005 00:41:37 -0000 1.10 @@ -24,7 +24,7 @@ import java.util.List; -import org.lamsfoundation.lams.tool.Tool; +import org.lamsfoundation.lams.tool.BasicToolVO; /** @@ -50,7 +50,7 @@ */ public List getAllPotentialLearners(long toolContentID) throws LamsToolServiceException; - public Tool getToolBySignature(final String toolSignature); + public BasicToolVO getToolBySignature(final String toolSignature); public long getToolDefaultContentIdBySignature(final String toolSignature); } Index: lams_common/src/java/org/lamsfoundation/lams/tool/service/LamsToolService.java =================================================================== RCS file: /usr/local/cvsroot/lams_common/src/java/org/lamsfoundation/lams/tool/service/LamsToolService.java,v diff -u -r1.9 -r1.10 --- lams_common/src/java/org/lamsfoundation/lams/tool/service/LamsToolService.java 24 Jun 2005 08:33:24 -0000 1.9 +++ lams_common/src/java/org/lamsfoundation/lams/tool/service/LamsToolService.java 27 Jun 2005 00:41:37 -0000 1.10 @@ -24,7 +24,7 @@ import java.util.List; -import org.lamsfoundation.lams.tool.Tool; +import org.lamsfoundation.lams.tool.BasicToolVO; import org.lamsfoundation.lams.tool.dao.IToolDAO; @@ -48,7 +48,7 @@ return null; } - public Tool getToolBySignature(final String toolSignature) + public BasicToolVO getToolBySignature(final String toolSignature) { return toolDAO.getToolBySignature(toolSignature); } Index: lams_common/test/java/org/lamsfoundation/lams/tool/dao/TestToolDAO.java =================================================================== RCS file: /usr/local/cvsroot/lams_common/test/java/org/lamsfoundation/lams/tool/dao/Attic/TestToolDAO.java,v diff -u -r1.6 -r1.7 --- lams_common/test/java/org/lamsfoundation/lams/tool/dao/TestToolDAO.java 24 Jun 2005 08:35:22 -0000 1.6 +++ lams_common/test/java/org/lamsfoundation/lams/tool/dao/TestToolDAO.java 27 Jun 2005 00:41:36 -0000 1.7 @@ -11,7 +11,7 @@ import java.util.List; -import org.lamsfoundation.lams.tool.Tool; +import org.lamsfoundation.lams.tool.BasicToolVO; import org.lamsfoundation.lams.tool.ToolDataAccessTestCase; @@ -51,7 +51,7 @@ public void testGetToolBySignature() { - Tool testTool = toolDao.getToolBySignature("voting_signature"); + BasicToolVO testTool = toolDao.getToolBySignature("voting_signature"); assertEquals(new Long(9),testTool.getToolId()); }