Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SAK-45827 - gradebook classic jsf upgrade #20

Open
wants to merge 3 commits into
base: 21.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 0 additions & 32 deletions app/business/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -68,16 +68,6 @@
<scope>provided</scope>
<version>${sakai.version}</version>
</dependency>
<!-- this is required for any Sakai JSF tool -->
<dependency>
<groupId>org.sakaiproject.jsf</groupId>
<artifactId>jsf-tool</artifactId>
</dependency>
<!-- these are to get full Sakai integration -->
<dependency>
<groupId>org.sakaiproject.jsf</groupId>
<artifactId>jsf-app</artifactId>
</dependency>
<!-- sakai2 plugin -->
<!--
The Gradebook itself has no need of a Uuid generator.
Expand Down Expand Up @@ -163,22 +153,6 @@
<artifactId>dom4j</artifactId>
<version>2.1.3</version>
</dependency>
<!-- MyFaces JSF -->
<dependency>
<groupId>org.apache.myfaces.core</groupId>
<artifactId>myfaces-api</artifactId>
<version>1.1.5</version>
</dependency>
<dependency>
<groupId>org.apache.myfaces.core</groupId>
<artifactId>myfaces-impl</artifactId>
<version>1.1.5</version>
</dependency>
<dependency>
<groupId>org.apache.myfaces.tomahawk</groupId>
<artifactId>tomahawk</artifactId>
<version>1.1.14</version>
</dependency>
<!-- Needed by MyFaces ExtensionsFilter -->
<dependency>
<groupId>commons-fileupload</groupId>
Expand All @@ -203,11 +177,5 @@
<groupId>javax.servlet.jsp</groupId>
<artifactId>javax.servlet.jsp-api</artifactId>
</dependency>
<!-- Sakai tag library -->
<dependency>
<groupId>org.sakaiproject.jsf</groupId>
<artifactId>myfaces-widgets-depend</artifactId>
<type>pom</type>
</dependency>
</dependencies>
</project>
38 changes: 13 additions & 25 deletions app/sakai-tool/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@

<!-- this is required for any Sakai JSF tool -->
<dependency>
<groupId>org.sakaiproject.jsf</groupId>
<artifactId>jsf-tool</artifactId>
<groupId>org.sakaiproject.jsf2</groupId>
<artifactId>jsf2-tool</artifactId>
</dependency>
<!-- these are to get full Sakai integration -->
<dependency>
<groupId>org.sakaiproject.jsf</groupId>
<artifactId>jsf-app</artifactId>
<groupId>org.sakaiproject.jsf2</groupId>
<artifactId>jsf2-app</artifactId>
<exclusions>
<exclusion>
<groupId>javax.faces</groupId>
Expand Down Expand Up @@ -97,21 +97,10 @@
<scope>provided</scope>
</dependency>


<!-- MyFaces JSF -->
<dependency>
<groupId>org.apache.myfaces.core</groupId>
<artifactId>myfaces-api</artifactId>
<version>1.1.10</version>
</dependency>
<dependency>
<groupId>org.apache.myfaces.core</groupId>
<artifactId>myfaces-impl</artifactId>
<version>1.1.10</version>
</dependency>

<dependency>
<groupId>org.apache.myfaces.tomahawk</groupId>
<artifactId>tomahawk</artifactId>
<artifactId>tomahawk21</artifactId>
<version>1.1.14</version>
</dependency>
<!-- Needed by MyFaces ExtensionsFilter -->
Expand All @@ -125,16 +114,15 @@
<version>1.1.2</version>
</dependency>

<!-- Sakai tag library -->
<dependency>
<groupId>org.sakaiproject.jsf</groupId>
<artifactId>myfaces-widgets-depend</artifactId>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.sakaiproject.jsf</groupId>
<artifactId>jsf-spreadsheet</artifactId>
<groupId>org.sakaiproject.jsf2</groupId>
<artifactId>jsf2-spreadsheet</artifactId>
</dependency>
<dependency>
<groupId>org.jboss.weld.servlet</groupId>
<artifactId>weld-servlet-shaded</artifactId>
<version>${sakai.weld.shaded.version}</version>
</dependency>
</dependencies>
<build>
<plugins>
Expand Down
6 changes: 6 additions & 0 deletions app/sakai-tool/src/webapp/META-INF/context.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<Context>
<Resource name="BeanManager"
auth="Container"
type="javax.enterprise.inject.spi.BeanManager"
factory="org.jboss.weld.resources.ManagerObjectFactory" />
</Context>
6 changes: 6 additions & 0 deletions app/sakai-tool/src/webapp/WEB-INF/beans.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/beans_2_0.xsd"
bean-discovery-mode="all" version="2.0">
</beans>
9 changes: 6 additions & 3 deletions app/sakai-tool/src/webapp/WEB-INF/faces-application.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
<?xml version="1.0"?>
<!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN" "http://java.sun.com/dtd/web-facesconfig_1_0.dtd">
<faces-config>
<faces-config xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
http://xmlns.jcp.org/xml/ns/javaee/web-facesconfig_2_3.xsd"
version="2.3">
<application>
<!-- Sakai VariableResolver for JSF -->
<variable-resolver>
org.sakaiproject.jsf.app.SakaiVariableResolver
org.sakaiproject.jsf2.app.SakaiVariableResolver
</variable-resolver>
<!-- End of deployment-specific properties -->

Expand Down
1 change: 1 addition & 0 deletions app/sakai-tool/src/webapp/WEB-INF/spring-facades.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
</property>
<property name="serverConfigurationService"
ref="org.sakaiproject.component.api.ServerConfigurationService"/>
<property name="userTimeService" ref="org.sakaiproject.time.api.UserTimeService" />
</bean>

<!--
Expand Down
10 changes: 6 additions & 4 deletions app/sakai-tool/src/webapp/WEB-INF/web.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<?xml version="1.0"?>
<web-app id="WebApp_9" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<web-app
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
version="3.0">
<display-name>sakai-gradebook-tool</display-name>
<description>Sakai Gradebook Tool Integration</description>

Expand Down Expand Up @@ -77,7 +79,7 @@
sakai.gradebook.addItem.helper
</servlet-name>
<servlet-class>
org.sakaiproject.jsf.util.HelperAwareJsfTool
org.sakaiproject.jsf2.util.HelperAwareJsfTool
</servlet-class>
<init-param>
<param-name>default</param-name>
Expand Down
2 changes: 1 addition & 1 deletion app/sakai-tool/src/webapp/inc/preludeEmbedded.jspf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"
%><%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"
%><%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"
%><%@ taglib uri="http://sakaiproject.org/jsf/sakai" prefix="sakai"
%><%@ taglib uri="http://sakaiproject.org/jsf2/sakai" prefix="sakai"
%><%@ taglib uri="http://sakaiproject.org/jsf/gradebook" prefix="gbx"
%><jsp:useBean id="msgs" class="org.sakaiproject.util.ResourceLoader" scope="session">
<jsp:setProperty name="msgs" property="baseName" value="org.sakaiproject.tool.gradebook.bundle.Messages"/>
Expand Down
2 changes: 1 addition & 1 deletion app/sakai-tool/src/webapp/inc/preludeEmbeddedClassic.jspf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
<%@ taglib uri="http://sakaiproject.org/jsf/sakai" prefix="sakai"%>
<%@ taglib uri="http://sakaiproject.org/jsf2/sakai" prefix="sakai"%>
<%@ taglib uri="http://sakaiproject.org/jsf/gradebook" prefix="gbx"%>
<jsp:useBean id="msgs" class="org.sakaiproject.util.ResourceLoader" scope="session">
<jsp:setProperty name="msgs" property="baseName" value="org.sakaiproject.tool.gradebook.bundle.Messages"/>
Expand Down
34 changes: 14 additions & 20 deletions app/ui/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,13 @@
</dependency>
<!-- this is required for any Sakai JSF tool -->
<dependency>
<groupId>org.sakaiproject.jsf</groupId>
<artifactId>jsf-tool</artifactId>
<groupId>org.sakaiproject.jsf2</groupId>
<artifactId>jsf2-tool</artifactId>
</dependency>
<!-- these are to get full Sakai integration -->
<dependency>
<groupId>org.sakaiproject.jsf</groupId>
<artifactId>jsf-app</artifactId>
<groupId>org.sakaiproject.jsf2</groupId>
<artifactId>jsf2-app</artifactId>
</dependency>
<!-- sakai2 plugin -->
<!--
Expand Down Expand Up @@ -188,20 +188,9 @@
<artifactId>dom4j</artifactId>
<version>2.1.3</version>
</dependency>
<!-- MyFaces JSF -->
<dependency>
<groupId>org.apache.myfaces.core</groupId>
<artifactId>myfaces-api</artifactId>
<version>1.1.5</version>
</dependency>
<dependency>
<groupId>org.apache.myfaces.core</groupId>
<artifactId>myfaces-impl</artifactId>
<version>1.1.5</version>
</dependency>
<dependency>
<groupId>org.apache.myfaces.tomahawk</groupId>
<artifactId>tomahawk</artifactId>
<artifactId>tomahawk21</artifactId>
<version>1.1.14</version>
<exclusions>
<exclusion>
Expand Down Expand Up @@ -239,13 +228,13 @@
</dependency>
<!-- Sakai tag library -->
<dependency>
<groupId>org.sakaiproject.jsf</groupId>
<artifactId>myfaces-widgets-depend</artifactId>
<groupId>org.sakaiproject.jsf2</groupId>
<artifactId>jsf2-widgets-sun-depend</artifactId>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.sakaiproject.jsf</groupId>
<artifactId>jsf-spreadsheet</artifactId>
<groupId>org.sakaiproject.jsf2</groupId>
<artifactId>jsf2-spreadsheet</artifactId>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
Expand All @@ -257,6 +246,11 @@
<artifactId>poi-ooxml</artifactId>
<version>${sakai.poi.version}</version>
</dependency>
<dependency>
<groupId>javax.el</groupId>
<artifactId>javax.el-api</artifactId>
<version>3.0.0</version>
</dependency>
</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@ score_not_counted_tooltip=Not counted towards course grade
# the format description string must be localized by hand to match
# whatever the standard Java "short" date format is for the locale.
# (Also see the DateTimeConverter.CONVERSION validator message below.)
date_entry_format_description=(mm/dd/yy)
date_entry_format_description=(mm/dd/yyyy)
date_entry_today_is=Today is
date_entry_week_header=Wk
date_entry_format=MM/dd/yy
date_entry_format=MM/dd/yyyy
date_entry_goto=Go To Current Month

# Overview page.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

import lombok.extern.slf4j.Slf4j;

import org.sakaiproject.jsf.util.LocaleUtil;
import org.sakaiproject.jsf2.util.LocaleUtil;
import org.sakaiproject.tool.gradebook.ui.MessagingBean;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@
import org.apache.myfaces.component.UserRoleUtils;
import org.apache.myfaces.component.html.ext.HtmlDataTable;
import org.apache.myfaces.custom.sortheader.HtmlCommandSortHeader;
import org.apache.myfaces.shared_impl.renderkit.html.HTML;
import org.apache.myfaces.shared_impl.renderkit.html.HtmlLinkRendererBase;
import org.apache.myfaces.shared_tomahawk.renderkit.html.HTML;
import org.apache.myfaces.shared_tomahawk.renderkit.html.HtmlLinkRendererBase;

/**
* Based on org.apache.myfaces.custom.sortheader.HtmlSortHeaderRenderer.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@
*/
@Slf4j
public class PointsConverter extends NumberConverter {

public static final String NULL_PLACEHOLDER = "NULL_PLACEHOLDER";

public PointsConverter() {
setType("number");
ResourceLoader rl = new ResourceLoader();
Expand All @@ -48,7 +51,7 @@ public String getAsString(FacesContext context, UIComponent component, Object va
if (log.isDebugEnabled()) log.debug("getAsString(" + context + ", " + component + ", " + value + ")");

String formattedScore;
if (value == null) {
if (value == null || NULL_PLACEHOLDER.equals(value)) {
formattedScore = FacesUtil.getLocalizedString("score_null_placeholder");
} else {
if (value instanceof Number) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

import lombok.extern.slf4j.Slf4j;

import org.apache.myfaces.shared_impl.renderkit.html.HTML;
import org.apache.myfaces.shared_tomahawk.renderkit.html.HTML;

import org.sakaiproject.tool.cover.ToolManager;
import org.sakaiproject.tool.gradebook.Category;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
package org.sakaiproject.tool.gradebook.jsf.gradebookItemTable;

import javax.faces.application.Application;
import javax.faces.component.UIComponent;
import javax.faces.component.UIData;
import javax.faces.context.FacesContext;

import org.apache.myfaces.component.html.ext.HtmlDataTable;
import org.apache.myfaces.taglib.html.HtmlDataTableTag;
import org.sakaiproject.jsf.util.TagUtil;
import org.apache.myfaces.shared_tomahawk.taglib.html.HtmlDataTableTag;
import org.sakaiproject.jsf2.util.TagUtil;

public class GradebookItemTableTag extends HtmlDataTableTag {
private String sortColumn;
private String sortAscending;
private String expanded;
private java.lang.String value;
private java.lang.String _var;
private java.lang.String _rendered;
private String cellpadding;
private String cellspacing;
private String columnClasses;
Expand Down Expand Up @@ -47,11 +49,12 @@ protected void setProperties(UIComponent component)
TagUtil.setString(component, "rowIndexVar", rowIndexVar);

TagUtil.setString(component, "value", value);
TagUtil.setBoolean(component, "rendered", _rendered);
if (_var != null) {
data.setVar(_var);
}
//Application application = FacesContext.getCurrentInstance().getApplication();
//data.setValueBinding("value", application.createValueBinding(value));
Application application = FacesContext.getCurrentInstance().getApplication();
data.setValueBinding("value", application.createValueBinding(value));
}


Expand Down Expand Up @@ -135,4 +138,16 @@ public void setRowIndexVar(String rowIndexVar) {
public String getRowIndexVar() {
return rowIndexVar;
}

public void setValue(java.lang.String value) {
this.value = value;
}

public void setVar(java.lang.String _var) {
this._var = _var;
}

public void setRendered(java.lang.String _rendered) {
this._rendered = _rendered;
}
}
Loading