Skip to content

Instantly share code, notes, and snippets.

View ppmdo's full-sized avatar

Pablo ppmdo

  • Germany
View GitHub Profile
@ppmdo
ppmdo / treeManipulation.hs
Created May 9, 2021 20:49
Haskell Tree Manipulation
data Tree = Leaf | Node Int Tree Tree deriving Show
treeDepth :: Tree -> Int
treeDepth Leaf = 0
treeDepth (Node _ leftSubtree rightSubtree) =
1 + max (treeDepth leftSubtree) (treeDepth rightSubtree)
treeSum :: Tree -> Int
treeSum Leaf = 0
treeSum (Node x leftSubtree rightSubtree) =
@ppmdo
ppmdo / submit_archive
Created February 16, 2018 23:34
Changes to submit_archive
# Item Archived email message
#
# {0} Submitter's Full Name
# {1} Submitter's Email Address
# {2} Item's Title
# {3} Name of collection
# {4} handle
#
Subject: DSpace: Submission Approved and Archived
@ppmdo
ppmdo / WorkflowManager.java
Created February 16, 2018 23:27
Changes to WorkflowManager.java
+++ b/dspace-api/src/main/java/org/dspace/workflow/WorkflowManager.java
@@ -764,6 +764,11 @@ public class WorkflowManager
}
email.addRecipient(ep.getEmail());
+ // Also send email to broadcast address set in "mail.broadcast" in dspace.cfg
+ String broadcast_email = ConfigurationManager.getProperty("mail.broadcast");
+ email.addRecipient(broadcast_email);
// Adds arguments to the email to notify who made the submission
@ppmdo
ppmdo / changes_xmlui_aspect_administrative.txt
Created February 16, 2018 22:58
Changes to XMLUI Administrative Aspect
community/CreateCommunityForm.java
43,44c43
< private static final Message T_label_order = message("xmlui.administrative.community.EditCommunityMetadataForm.label_order");
< private static final Message T_label_short_description = message("xmlui.administrative.community.EditCommunityMetadataForm.label_short_description");
---
> private static final Message T_label_short_description = message("xmlui.administrative.community.EditCommunityMetadataForm.label_short_description");
90,94d88
< metadataList.addLabel(T_label_order);
< Text order = metadataList.addItem().addText("order");
@ppmdo
ppmdo / DspaceObject.java
Created February 16, 2018 22:53
Changes to DspaceObject.java
@@ -1377,6 +1377,8 @@ public abstract class DSpaceObject
return new String[]{"eperson","lastname",null};
case "phone":
return new String[]{"eperson","phone",null};
+ case "order":
+ return new String[]{MetadataSchema.DC_SCHEMA, "identifier", "other"};
case "language":
return new String[]{"eperson","language",null};
default:
@@ -1384,4 +1386,4 @@ public abstract class DSpaceObject
@ppmdo
ppmdo / Community.java
Created February 16, 2018 22:50
Changes to dspace-api/src/main/java/org/dspace/content/Community.java
@@ -60,6 +60,7 @@ public class Community extends DSpaceObject
private Group admins;
// Keys for accessing Community metadata
+ public static final String ORDER = "order";
public static final String COPYRIGHT_TEXT = "copyright_text";
public static final String INTRODUCTORY_TEXT = "introductory_text";
public static final String SHORT_DESCRIPTION = "short_description";
@@ -267,7 +268,7 @@ public class Community extends DSpaceObject
tri = DatabaseManager.query(context,