Skip to content

Commit

Permalink
LSNBLDR-247; restore 2.8 to operation
Browse files Browse the repository at this point in the history
git-svn-id: https://source.sakaiproject.org/svn/lessonbuilder/trunk@125809 66ffb92e-73f9-0310-93c1-f5514f145a0a
  • Loading branch information
clhedrick committed Jun 15, 2013
1 parent 3c8f531 commit 645aa5b
Show file tree
Hide file tree
Showing 8 changed files with 167 additions and 19 deletions.
9 changes: 7 additions & 2 deletions lessonbuilder/README
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,11 @@ and components/pom.xml

other directories take their information from this one.

You'll need to change three things;
You'll need to change four things;

1) Near the top, in the <parent> declaration, the version
should match your version of Sakai. Currently it is
2.9-SNAPHOT. For 2.8 you'd use 2.8.0, 2.8.1, etc.
2.10-SNAPHOT. For 2.8 you'd use 2.8.0, 2.8.1, etc.

2) Look for the <profile> declaration. There are two
profiles. The default is set for 2.9 and later. If you're
Expand Down Expand Up @@ -119,6 +119,11 @@ for the property <hbms> from newhbm to oldhbm.
And in component/pom.xml and tool/pom.xml you'll need to
disable the profile "newspring".

4) 2.9 added a new interface, which we have to use to get optimal
site copying. To allow the code to compile in 2.8, we supply a
dummy declaration. in tool/pom.xml, find the profile "28-hack"
and enable it if you're on 2.8 or before.

Other than that, the properties can be left as is. In particular,
don't change the version of RSF. We depend upon a newer version than
the rest of Sakai.
Expand Down
1 change: 1 addition & 0 deletions lessonbuilder/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@

<!-- NOTE: see also the "optional" profile in tools/pom.xml. That will enable support for several contrib tools -->
<!-- NOTE 2: for releases before 2.10, in components/pom.xml and tool/pom.xml, disable the "newspring" profile -->
<!-- NOTE 3: for releases before 2.10, in tool/pom.xml, enable the the "28-hack" profile -->

<profiles>
<profile>
Expand Down
30 changes: 30 additions & 0 deletions lessonbuilder/tool/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -285,5 +285,35 @@
</dependency>
</dependencies>
</profile>
<profile>
<id>28hack</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<id>add-source</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>src28/java</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>

</profiles>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import java.util.ArrayList;
import java.util.List;
import java.util.HashSet;
import java.util.Set;
import java.util.Collection;

import org.sakaiproject.lessonbuildertool.SimplePageComment;
Expand All @@ -13,6 +14,8 @@
import org.sakaiproject.lessonbuildertool.model.SimplePageToolDao;
import org.sakaiproject.lessonbuildertool.service.GradebookIfc;
import org.sakaiproject.authz.cover.AuthzGroupService;
import org.sakaiproject.authz.api.Member;
import org.sakaiproject.authz.api.AuthzGroup;

public class GradingBean {
public String id;
Expand Down Expand Up @@ -137,18 +140,15 @@ private boolean gradeStudentPage() {
if (group == null)
r = gradebookIfc.updateExternalAssessmentScore(simplePageBean.getCurrentSiteId(), pageItem.getGradebookId(), page.getOwner(), Double.toString(Double.valueOf(points)));
else {
HashSet<String>groups = new HashSet<String>();
if (group != null)
group = "/site/" + simplePageBean.getCurrentSiteId() + "/group/" + group;
groups.add(group);
Collection<String>users = AuthzGroupService.getAuthzUsersInGroups(groups);
group = "/site/" + simplePageBean.getCurrentSiteId() + "/group/" + group;
AuthzGroup g = AuthzGroupService.getAuthzGroup(group);
Set<Member> members = g.getMembers();
// if we have more than one user, in theory some might fail and some succeed. For the
// moment just update the grade
r = true;
for (String u: users)
gradebookIfc.updateExternalAssessmentScore(simplePageBean.getCurrentSiteId(), pageItem.getGradebookId(),
u, Double.toString(Double.valueOf(points)));

for (Member m: members)
gradebookIfc.updateExternalAssessmentScore(simplePageBean.getCurrentSiteId(), pageItem.getGradebookId(),
m.getUserId(), Double.toString(Double.valueOf(points)));
}
}catch(Exception ex) {
System.out.println("Exception updating grade " + ex);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@
import org.sakaiproject.authz.api.SecurityAdvisor;
import org.sakaiproject.authz.api.SecurityService;
import org.sakaiproject.authz.cover.AuthzGroupService;
import org.sakaiproject.authz.api.AuthzGroup;
import org.sakaiproject.authz.api.Member;
import org.sakaiproject.component.cover.ServerConfigurationService;
import org.sakaiproject.content.api.ContentCollection;
import org.sakaiproject.content.api.ContentCollectionEdit;
Expand Down Expand Up @@ -6015,13 +6017,15 @@ private void regradeStudentPages(SimplePageItem pageItem) {
String group = c.getGroup();
if (group != null)
group = "/site/" + getCurrentSiteId() + "/group/" + group;
HashSet groups = new HashSet<Group>();

groups.add(group);
Collection<String>users = AuthzGroupService.getAuthzUsersInGroups(groups);
for (String user: users) {
gradebookIfc.updateExternalAssessmentScore(getCurrentSiteId(), pageItem.getGradebookId(),
user, String.valueOf(c.getPoints()));
try {
AuthzGroup g = AuthzGroupService.getAuthzGroup(group);
Set<Member> members = g.getMembers();
for (Member m: members) {
gradebookIfc.updateExternalAssessmentScore(getCurrentSiteId(), pageItem.getGradebookId(),
m.getUserId(), String.valueOf(c.getPoints()));
}
} catch (Exception e) {
System.out.println("unable to get members of group " + group);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -738,10 +738,18 @@ else if (pageItem.getPageId() == 0)
String skinRepo = null;
String iconBase = null;

UIComponent titlediv = UIOutput.make(tofill, "titlediv");
// we need to do special CSS for old portal
if (helpurl == null)
titlediv.decorate(new UIStyleDecorator("oldPortal"));

if (helpurl != null || reseturl != null) {
skinName = simplePageBean.getCurrentSite().getSkin();
if (skinName == null)
skinName = ServerConfigurationService.getString("skin.default", "default");
// weird hack. automatically add neo if neo portal enabled
if (!skinName.startsWith("neo"))
skinName = "neo-" + skinName;
skinRepo = ServerConfigurationService.getString("skin.repo", "/library/skin");
iconBase = skinRepo + "/" + skinName + "/images/";
}
Expand Down
100 changes: 100 additions & 0 deletions lessonbuilder/tool/src/webapp/css/Simplepagetool.css
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@
left: 10px;
margin: 20px;
}
.neoPortletTitleWrap {
padding-bottom: 6px
}
.breadcrumbs a[title="Reset"] {

}
Expand Down Expand Up @@ -805,6 +808,103 @@ div[role="dialog"] {
background: url(images/reload_h.png) center left no-repeat !important
}
*/
.neoPortletTitleWrap {
border-radius:0
}
.portletTitle {
width: 100%;
height: 100%;
overflow: hidden;
}
.portletTitle .action {
padding: 2px -1px 6px 2px;
text-align: right;
vertical-align: middle;
}
.portletTitle .action a#jsr-edit {
padding: 2px;
background: url(../images/page_edit.gif) center right no-repeat;
}
.portletTitle .action a#jsr-edit:hover {
background: url(../images/page_edit.gif) center right no-repeat
}
.portletTitle .action img {
margin: 0;
vertical-align: text-bottom;
width: 18px;
border: none;
height: 18px;
}
.portletTitle .action a.help {
background: url(../images/help.gif) center right no-repeat;
text-align: left;
padding: 0;
text-decoration: none !important;
width: 1em;
height: 1.5em;
outline: none;
}
.portletTitle .title a:focus, .portletTitle .action a:focus {
outline: black dotted thin
}
.portletTitle .action a.help:hover, .portletTitle .action a.help:focus {
background: url(../images/help_h.gif) center right no-repeat
}
.portletTitle .action a.tool-directurl{
padding:2px;
background: url(/library/image/silk/link.png) center right no-repeat;
}
.portletTitle .action a.tool-directurl:hover{
background: url(/library/image/silk/link_go.png) center right no-repeat;
}
.direct-url-wrap {
font-size: 85%;
color: #555;
}
.direct-url-wrap textarea {
color: #000;
overflow:auto;
width:250px;
display:block;
}
.portletTitle .title {
padding: 2px 4px 6px 0;
height: 1em;
float: left;
color: #000;
}
.portletTitle .title img {
margin: 0;
vertical-align: text-bottom;
width: 18px;
border: none;
height: 18px;
}
.portletTitle .title h2 {
display: inline;
margin: 0;
padding: 0;
color: #444;
font-weight: bold;
font-family: 'Helvetica Neue', Arial, sans-serif;
font-size: 1.2em !important;
}
.portletTitle .title h2 a {
text-decoration: none;
}
.portletTitle .title h2 .siteTitle {
color: #333
}
.portletTitle .title a.reload {
background: url(../images/reload.gif) center left no-repeat;
text-decoration: none !important;
border: 1px solid #fff;
height: 1.5em;
outline: none;
}
.portletTitle .title a.reload:hover, .portletTitle .title a.reload:focus {
background: url(../images/reload_h.gif) center left no-repeat
}

/*
alternate treatment for list - can go in tool.css
Expand Down
2 changes: 1 addition & 1 deletion lessonbuilder/tool/src/webapp/templates/ShowPage.html
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@

<br rsf:id="breakAfterWarnings" />

<div class="neoPortletTitleWrap">
<div rsf:id="titlediv" class="neoPortletTitleWrap">
<div class="portletTitle">
<div class="title">
<div rsf:id="crumbdiv" class="fullwidth breadcrumbs" role="navigation">
Expand Down

0 comments on commit 645aa5b

Please sign in to comment.