@@ -112,15 +112,8 @@ public void duplicateCase(UUID sourceCaseUuid, UUID targetDirectoryId, String us
112
112
directoryService .duplicateElement (sourceCaseUuid , newCaseId , targetDirectoryId , userId );
113
113
}
114
114
115
- public void createScriptContingencyList (String listName , String content , String description , String userId , UUID parentDirectoryUuid ) {
116
- ElementAttributes elementAttributes = new ElementAttributes (UUID .randomUUID (), listName , CONTINGENCY_LIST , userId , 0L , description );
117
- contingencyListService .insertScriptContingencyList (elementAttributes .getElementUuid (), content );
118
- directoryService .createElement (elementAttributes , parentDirectoryUuid , userId );
119
- }
120
-
121
115
public void duplicateContingencyList (UUID contingencyListsId , UUID targetDirectoryId , String userId , ContingencyListType contingencyListType ) {
122
116
UUID newId = switch (contingencyListType ) {
123
- case SCRIPT -> contingencyListService .duplicateScriptContingencyList (contingencyListsId );
124
117
case FORM -> contingencyListService .duplicateFormContingencyList (contingencyListsId );
125
118
case IDENTIFIERS -> contingencyListService .duplicateIdentifierContingencyList (contingencyListsId );
126
119
};
@@ -133,26 +126,6 @@ public void createFormContingencyList(String listName, String content, String de
133
126
directoryService .createElement (elementAttributes , parentDirectoryUuid , userId );
134
127
}
135
128
136
- public void newScriptFromFormContingencyList (UUID id , String scriptName , String userId , UUID parentDirectoryUuid ) {
137
- ElementAttributes elementAttribute = directoryService .getElementInfos (id ).orElseThrow (() -> new ExploreException (NOT_FOUND ));
138
- if (!elementAttribute .getType ().equals (CONTINGENCY_LIST )) {
139
- throw new ExploreException (NOT_ALLOWED );
140
- }
141
- ElementAttributes newElementAttributes = new ElementAttributes (UUID .randomUUID (), scriptName ,
142
- CONTINGENCY_LIST , userId , 0L , null );
143
- contingencyListService .newScriptFromFormContingencyList (id , newElementAttributes .getElementUuid ());
144
- directoryService .createElement (newElementAttributes , parentDirectoryUuid , userId );
145
- }
146
-
147
- public void replaceFormContingencyListWithScript (UUID id , String userId ) {
148
- ElementAttributes elementAttribute = directoryService .getElementInfos (id ).orElseThrow (() -> new ExploreException (NOT_FOUND ));
149
- if (!elementAttribute .getType ().equals (CONTINGENCY_LIST )) {
150
- throw new ExploreException (NOT_ALLOWED );
151
- }
152
- contingencyListService .replaceFormContingencyListWithScript (id , userId );
153
- directoryService .notifyDirectoryChanged (id , userId );
154
- }
155
-
156
129
public void createIdentifierContingencyList (String listName , String content , String description , String userId , UUID parentDirectoryUuid ) {
157
130
ElementAttributes elementAttributes = new ElementAttributes (UUID .randomUUID (), listName , CONTINGENCY_LIST , userId , 0L , description );
158
131
contingencyListService .insertIdentifierContingencyList (elementAttributes .getElementUuid (), content );
@@ -170,29 +143,6 @@ public void duplicateFilter(UUID sourceFilterId, UUID targetDirectoryId, String
170
143
directoryService .duplicateElement (sourceFilterId , newFilterId , targetDirectoryId , userId );
171
144
}
172
145
173
- public void newScriptFromFilter (UUID filterId , String scriptName , String userId , UUID parentDirectoryUuid ) {
174
- ElementAttributes elementAttribute = directoryService .getElementInfos (filterId ).orElseThrow (() -> new ExploreException (NOT_FOUND ));
175
- if (!elementAttribute .getType ().equals (FILTER )) {
176
- throw new ExploreException (NOT_ALLOWED );
177
- }
178
- ElementAttributes newElementAttributes = new ElementAttributes (UUID .randomUUID (), scriptName ,
179
- FILTER , userId , 0 , null );
180
- filterService .insertNewScriptFromFilter (filterId , newElementAttributes .getElementUuid ());
181
- directoryService .createElement (newElementAttributes , parentDirectoryUuid , userId );
182
- }
183
-
184
- public void replaceFilterWithScript (UUID id , String userId ) {
185
- ElementAttributes elementAttribute = directoryService .getElementInfos (id ).orElseThrow (() -> new ExploreException (NOT_FOUND ));
186
- if (!userId .equals (elementAttribute .getOwner ())) {
187
- throw new ExploreException (NOT_ALLOWED );
188
- }
189
- if (!elementAttribute .getType ().equals (FILTER )) {
190
- throw new ExploreException (NOT_ALLOWED );
191
- }
192
- filterService .replaceFilterWithScript (id , userId );
193
- directoryService .notifyDirectoryChanged (id , userId );
194
- }
195
-
196
146
public void deleteElement (UUID id , String userId ) {
197
147
try {
198
148
directoryService .deleteElement (id , userId );
@@ -260,7 +210,6 @@ private void updateElementNameAndDescription(UUID id, String name, String descri
260
210
261
211
private String getProperPath (ContingencyListType contingencyListType ) {
262
212
return switch (contingencyListType ) {
263
- case SCRIPT -> "/script-contingency-lists/{id}" ;
264
213
case FORM -> "/form-contingency-lists/{id}" ;
265
214
case IDENTIFIERS -> "/identifier-contingency-lists/{id}" ;
266
215
};
0 commit comments