Skip to content

Commit 931460d

Browse files
Merge pull request #539 from Heigvd/dev
preparation for version 0.4.5
2 parents a99c4f2 + e54c999 commit 931460d

File tree

130 files changed

+3591
-1983
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

130 files changed

+3591
-1983
lines changed

colab-api/src/main/java/ch/colabproject/colab/api/controller/card/CardContentManager.java

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
*/
77
package ch.colabproject.colab.api.controller.card;
88

9+
import ch.colabproject.colab.api.controller.common.DeletionManager;
910
import ch.colabproject.colab.api.controller.document.DocumentManager;
1011
import ch.colabproject.colab.api.controller.document.IndexGeneratorHelper;
1112
import ch.colabproject.colab.api.controller.document.RelatedPosition;
@@ -64,6 +65,12 @@ public class CardContentManager {
6465
// injections
6566
// *********************************************************************************************
6667

68+
/**
69+
* Common deletion lifecycle management
70+
*/
71+
@Inject
72+
private DeletionManager deletionManager;
73+
6774
/**
6875
* Card content persistence handler
6976
*/
@@ -251,6 +258,50 @@ public void changeCardContentLexicalConversionStatus(Long id, ConversionStatus s
251258
cardContent.setLexicalConversion(status);
252259
}
253260

261+
/**
262+
* Put the given card content in the bin. (= set DeletionStatus to BIN + set erasure
263+
* tracking data)
264+
*
265+
* @param cardContentId the id of the card content
266+
*/
267+
public void putCardContentInBin(Long cardContentId) {
268+
logger.debug("put in bin card content #{}", cardContentId);
269+
270+
CardContent cardContent = assertAndGetCardContent(cardContentId);
271+
272+
deletionManager.putInBin(cardContent);
273+
}
274+
275+
// /**
276+
// * Restore from the bin. The object won't contain any deletion or erasure data anymore.
277+
// * <p>
278+
// * It means that the card content is back at its place.
279+
// *
280+
// * @param cardContentId the id of the card content
281+
// */
282+
// public void restoreCardContentFromBin(Long cardContentId) {
283+
// logger.debug("restore from bin card content #{}", cardContentId);
284+
//
285+
// CardContent cardContent = assertAndGetCardContent(cardContentId);
286+
//
287+
// deletionManager.restoreFromBin(cardContent);
288+
// }
289+
//
290+
// /**
291+
// * Set the deletion status to TO_DELETE.
292+
// * <p>
293+
// * It means that the card content is only visible in the bin panel.
294+
// *
295+
// * @param cardContentId the id of the card content
296+
// */
297+
// public void markCardContentAsToDeleteForever(Long cardContentId) {
298+
// logger.debug("mark card content #{} as to delete forever", cardContentId);
299+
//
300+
// CardContent cardContent = assertAndGetCardContent(cardContentId);
301+
//
302+
// deletionManager.markAsToDeleteForever(cardContent);
303+
// }
304+
254305
/**
255306
* Delete the given card content
256307
*

0 commit comments

Comments
 (0)