Skip to content

Commit 7a8ecd7

Browse files
Merge 26.3 to develop
2 parents 7c71a1b + f3f6600 commit 7a8ecd7

File tree

16 files changed

+30
-934
lines changed

16 files changed

+30
-934
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/*
2+
* Copyright (c) 2026 LabKey Corporation
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
-- Remove the Rating table as the rating system has been removed
18+
DROP TABLE IF EXISTS skylinetoolsstore.Rating;

SkylineToolsStore/resources/schemas/skylinetoolsstore.xml

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -40,17 +40,4 @@
4040
<ns:column columnName="Languages"/>
4141
</ns:columns>
4242
</ns:table>
43-
<ns:table tableName="rating" tableDbType="TABLE">
44-
<ns:columns>
45-
<ns:column columnName="_ts"/>
46-
<ns:column columnName="rowid"/>
47-
<ns:column columnName="createdby"/>
48-
<ns:column columnName="created"/>
49-
<ns:column columnName="modified"/>
50-
<ns:column columnName="rating"/>
51-
<ns:column columnName="toolid"/>
52-
<ns:column columnName="review"/>
53-
<ns:column columnName="title"/>
54-
</ns:columns>
55-
</ns:table>
5643
</ns:tables>

SkylineToolsStore/src/org/labkey/skylinetoolsstore/RatingManager.java

Lines changed: 0 additions & 129 deletions
This file was deleted.

SkylineToolsStore/src/org/labkey/skylinetoolsstore/SkylineToolsStoreController.java

Lines changed: 8 additions & 150 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@
7878
import org.labkey.api.view.UnauthorizedException;
7979
import org.labkey.api.webdav.WebdavResource;
8080
import org.labkey.api.webdav.WebdavService;
81-
import org.labkey.skylinetoolsstore.model.Rating;
8281
import org.labkey.skylinetoolsstore.model.SkylineTool;
8382
import org.labkey.skylinetoolsstore.view.SkylineToolDetails;
8483
import org.labkey.skylinetoolsstore.view.SkylineToolStoreUrls;
@@ -613,7 +612,8 @@ else if (!getContainer().hasPermission(getUser(), InsertPermission.class))
613612
@Override
614613
public void addNavTrail(NavTree root)
615614
{
616-
root.addChild(getToolStoreNav(getContainer())).addChild("Upload Tool", getURL());
615+
root.addChild(getToolStoreNav(getContainer()));
616+
root.addChild("Upload Tool", getURL());
617617
}
618618

619619
public ActionURL getURL()
@@ -645,151 +645,6 @@ private void redirectToToolStoreContainer(SkylineTool tool, ActionURL originalUr
645645
}
646646
}
647647

648-
@RequiresNoPermission
649-
public class SubmitRatingAction extends AbstractController implements PermissionCheckable
650-
{
651-
private static final String NO_TITLE = "You did not enter a valid title.";
652-
private static final String NO_RATING = "You did not submit a valid rating. Ratings must be between 1 and 5.";
653-
private static final String NO_REVIEW = "You did not submit a valid review.";
654-
private static final String ALREADY_REVIEWED = "You have already left a review for this tool.";
655-
656-
public SubmitRatingAction()
657-
{
658-
}
659-
660-
@Override
661-
protected ModelAndView handleRequestInternal(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws Exception
662-
{
663-
final User user = getUser();
664-
final String toolIdString = httpServletRequest.getParameter("toolId");
665-
int toolId = (toolIdString != null && !toolIdString.isEmpty()) ? Integer.parseInt(toolIdString) : -1;
666-
667-
final String ratingIdString = httpServletRequest.getParameter("ratingId");
668-
int ratingId;
669-
try {
670-
ratingId = (ratingIdString != null && !ratingIdString.isEmpty()) ? Integer.parseInt(ratingIdString) : -1;
671-
} catch(Exception e) {
672-
return new JspView<>("/org/labkey/skylinetoolsstore/view/SkylineRating.jsp", null);
673-
}
674-
Rating rating = (ratingId < 0) ? null : RatingManager.get().getRatingById(ratingId);
675-
final SkylineTool tool = SkylineToolsStoreManager.get().getTool((toolId >= 0) ? toolId : rating.getToolId());
676-
677-
final String ratingValueString = httpServletRequest.getParameter("value");
678-
final int ratingValue;
679-
try {
680-
ratingValue = Integer.parseInt(ratingValueString);
681-
} catch(Exception e) {
682-
return new JspView<>("/org/labkey/skylinetoolsstore/view/SkylineRating.jsp", null);
683-
}
684-
final String ratingTitle = httpServletRequest.getParameter("title");
685-
final String review = httpServletRequest.getParameter("review");
686-
687-
if (ratingId < 0 && RatingManager.get().userLeftRating(tool.getIdentifier(), getUser()))
688-
{
689-
getViewContext().getRequest().setAttribute(BindingResult.MODEL_KEY_PREFIX + "form",
690-
ALREADY_REVIEWED);
691-
getViewContext().getRequest().setAttribute(BindingResult.MODEL_KEY_PREFIX + "hideForm",
692-
true);
693-
}
694-
else if (ratingTitle == null || ratingTitle.isEmpty())
695-
{
696-
getViewContext().getRequest().setAttribute(BindingResult.MODEL_KEY_PREFIX + "form",
697-
NO_TITLE);
698-
}
699-
else if (ratingValue < 1 || ratingValue > 5)
700-
{
701-
getViewContext().getRequest().setAttribute(BindingResult.MODEL_KEY_PREFIX + "form",
702-
NO_RATING);
703-
}
704-
else if (review == null || review.isEmpty())
705-
{
706-
getViewContext().getRequest().setAttribute(BindingResult.MODEL_KEY_PREFIX + "form",
707-
NO_REVIEW);
708-
}
709-
else if (user.isGuest())
710-
{
711-
throw new Exception();
712-
}
713-
else if (tool == null || (ratingId >= 0 && rating == null))
714-
{
715-
throw new Exception();
716-
}
717-
else
718-
{
719-
if (rating == null)
720-
{
721-
// Adding new rating
722-
rating = new Rating(ratingValue, review, toolId, ratingTitle);
723-
rating.setContainer(getContainer().getId());
724-
RatingManager.get().insertRating(user, rating);
725-
}
726-
else
727-
{
728-
// Editing existing rating
729-
if (rating.getCreatedBy() != user.getUserId() && !getUser().hasSiteAdminPermission())
730-
{
731-
throw new Exception();
732-
}
733-
rating.setTitle(ratingTitle);
734-
rating.setRating(ratingValue);
735-
rating.setReview(review);
736-
RatingManager.get().editRating(rating, user);
737-
}
738-
return HttpView.redirect(SkylineToolStoreUrls.getToolDetailsUrl(tool));
739-
}
740-
741-
if (toolId >= 0)
742-
getViewContext().getRequest().setAttribute(BindingResult.MODEL_KEY_PREFIX + "toolId", toolId);
743-
if (ratingId >= 0)
744-
getViewContext().getRequest().setAttribute(BindingResult.MODEL_KEY_PREFIX + "ratingId", ratingId);
745-
if (ratingTitle != null)
746-
getViewContext().getRequest().setAttribute(BindingResult.MODEL_KEY_PREFIX + "formTitle", ratingTitle);
747-
getViewContext().getRequest().setAttribute(BindingResult.MODEL_KEY_PREFIX + "formValue", ratingValue);
748-
if (review != null)
749-
getViewContext().getRequest().setAttribute(BindingResult.MODEL_KEY_PREFIX + "formReview", review);
750-
751-
return new JspView<>("/org/labkey/skylinetoolsstore/view/SkylineRating.jsp", null);
752-
}
753-
754-
@Override
755-
public void checkPermissions() throws UnauthorizedException
756-
{
757-
758-
}
759-
}
760-
761-
@RequiresNoPermission
762-
public class DeleteRatingAction extends AbstractController implements PermissionCheckable
763-
{
764-
public DeleteRatingAction()
765-
{
766-
}
767-
768-
@Override
769-
public ModelAndView handleRequestInternal(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws Exception
770-
{
771-
int id = NumberUtils.toInt(httpServletRequest.getParameter("id"), -1);
772-
int user = getUser().getUserId();
773-
final Rating rating = RatingManager.get().getRatingById(id);
774-
if(rating != null)
775-
{
776-
if (user == rating.getCreatedBy() || getUser().hasSiteAdminPermission())
777-
RatingManager.get().deleteRating(id);
778-
else
779-
throw new Exception();
780-
}
781-
782-
final SkylineTool tool = SkylineToolsStoreManager.get().getTool(rating.getToolId());
783-
return HttpView.redirect(SkylineToolStoreUrls.getToolDetailsUrl(tool));
784-
}
785-
786-
@Override
787-
public void checkPermissions() throws UnauthorizedException
788-
{
789-
790-
}
791-
}
792-
793648
@RequiresNoPermission
794649
public class InsertSupplementAction extends AbstractController implements PermissionCheckable
795650
{
@@ -948,7 +803,6 @@ public boolean handlePost(IdForm idForm, BindException errors) throws Exception
948803
// TODO: Should be in a transaction
949804
for (SkylineTool toDelete : SkylineToolsStoreManager.get().getToolsByIdentifier(tool.getIdentifier()))
950805
{
951-
RatingManager.get().deleteRatingsByToolId(toDelete.getRowId());
952806
ContainerManager.delete(toDelete.lookupContainer(), getUser());
953807
}
954808

@@ -1027,7 +881,6 @@ public ModelAndView handleRequestInternal(HttpServletRequest httpServletRequest,
1027881
if (tools.length == 1)
1028882
throw new Exception();
1029883

1030-
RatingManager.get().deleteRatingsByToolId(tool.getRowId());
1031884
ContainerManager.delete(tools[0].lookupContainer(), getUser());
1032885

1033886
if (tools.length > 1)
@@ -1088,7 +941,12 @@ else if (toolLsid != null &&
1088941
// Cookie expires after 1 day
1089942
final int expires = 24 * 60 * 60;
1090943

1091-
SkylineToolsStoreManager.get().recordToolDownload(tool);
944+
// Download counter is an incidental write on a GET action — use ignoreSqlUpdates()
945+
// to avoid the dev-mode mutating SQL assertion (like auditing writes)
946+
try (var ignored = SpringActionController.ignoreSqlUpdates())
947+
{
948+
SkylineToolsStoreManager.get().recordToolDownload(tool);
949+
}
1092950

1093951
DateFormat df = new SimpleDateFormat("EEE, dd-MMM-yyyy HH:mm:ss 'GMT'", Locale.US);
1094952
Calendar calendar = Calendar.getInstance();

SkylineToolsStore/src/org/labkey/skylinetoolsstore/SkylineToolsStoreModule.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public String getName()
5252
@Override
5353
public @Nullable Double getSchemaVersion()
5454
{
55-
return 16.2;
55+
return 25.001;
5656
}
5757

5858
@Override

SkylineToolsStore/src/org/labkey/skylinetoolsstore/SkylineToolsStoreSchema.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,4 @@ public TableInfo getTableInfoSkylineTool()
5656
{
5757
return getSchema().getTable("SkylineTool");
5858
}
59-
60-
public TableInfo getTableInfoRating()
61-
{
62-
return getSchema().getTable("Rating");
63-
}
6459
}

0 commit comments

Comments
 (0)