1 /*
2 * Copyright 2024 Bloomreach (https://www.bloomreach.com)
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 package org.onehippo.forge.channelmanager.pagesupport.document.management;
17
18 /**
19 * Hippo CMS Document/Folder Workflow invocation service interface as possibly deployed as JMX MBean.
20 */
21 public interface DocumentManagementServiceMXBean {
22
23 /**
24 * JMX MBean name to be used.
25 */
26 String NAME = "org.onehippo.forge.channelmanager.pagesupport.document.management:type=DocumentManagementServiceMXBean";
27
28 /**
29 * Obtains an editable draft variant from the document handle location.
30 * @param documentLocation document handle location
31 * @return true if the operation was successful, false otherwise
32 */
33 boolean obtainEditableDocument(String documentLocation);
34
35 /**
36 * Discards the draft variant currently being edited.
37 * @param documentLocation document handle location
38 * @return true if the operation was successful, false otherwise
39 */
40 boolean disposeEditableDocument(String documentLocation);
41
42 /**
43 * Commits the draft variant currently being edited.
44 * @param documentLocation document handle location
45 * @return true if the operation was successful, false otherwise
46 */
47 boolean commitEditableDocument(String documentLocation);
48
49 /**
50 * Takes offline the document.
51 * @param documentLocation document handle location
52 * @return true if the operation was successful, false otherwise
53 */
54 boolean depublishDocument(String documentLocation);
55
56 /**
57 * Publishes the document.
58 * @param documentLocation document handle location
59 * @return true if the operation was successful, false otherwise
60 */
61 boolean publishDocument(String documentLocation);
62
63 /**
64 * Copies the {@code sourceDocumentLocation} to {@code targetFolderLocation} with the {@code targetDocumentName}.
65 * @param sourceDocumentLocation source document handle location
66 * @param targetFolderLocation target folder location
67 * @param targetDocumentName target document handle node name
68 * @return the copied target document handle location
69 */
70 String copyDocument(String sourceDocumentLocation, String targetFolderLocation, String targetDocumentName);
71
72 /**
73 * Translates the {@code sourceFolderLocation} to {@code language} with the {@code name}.
74 * @param sourceFolderLocation source folder location
75 * @param language target language to translate to
76 * @param name target folder name
77 * @return the translated target folder location
78 */
79 String translateFolder(String sourceFolderLocation, String language, String name);
80
81 /**
82 * Translates the {@code sourceDocumentLocation} to {@code language} with the {@code name}.
83 * @param sourceDocumentLocation source document handle location
84 * @param language target language to translate to
85 * @param name target document name
86 * @return the translated target document handle location
87 */
88 String translateDocument(String sourceDocumentLocation, String language, String name);
89
90 }