Skip to content

Commit dde0160

Browse files
committed
added ALLOW_HISTORY_SHARE to demo context.xml and minor improvements on history share endpoint
1 parent 9ad3b56 commit dde0160

2 files changed

Lines changed: 5 additions & 6 deletions

File tree

src/main/java/de/unirostock/sems/cbarchive/web/rest/ShareApi.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -179,10 +179,10 @@ public Response setWorkspaceHistory( @CookieParam(Fields.COOKIE_PATH) String old
179179
}
180180

181181
// user stuff
182-
// sets first workspace as active one
182+
// current active workspace does not get changed
183183
UserManager user = null;
184184
try {
185-
user = new UserManager( historyList[0] );
185+
user = new UserManager( oldUserPath );
186186
} catch (IOException e) {
187187
LOGGER.error(e, "Cannot create user");
188188
return buildErrorResponse(500, null, "user not creatable!", e.getMessage() );
@@ -215,10 +215,6 @@ public Response setWorkspaceHistory( @CookieParam(Fields.COOKIE_PATH) String old
215215
}
216216
}
217217

218-
// set first history entry as current
219-
history.setCurrentWorkspace( user.getWorkspaceId() );
220-
LOGGER.info("Set current workspace id to ", user.getWorkspaceId(), " from ", oldUserPath);
221-
222218
if( oldUserPath != null && !oldUserPath.isEmpty() && history.containsWorkspace( oldUserPath ) == false ) {
223219
Workspace workspace = WorkspaceManager.getInstance().getWorkspace(oldUserPath);
224220
if( workspace != null ) {

src/main/resources/CombineArchiveWeb.example.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@
2626
<Parameter name="STATS_PUBLIC" value="true" override="false" />
2727
<!-- Set a secret to access full stats by adding an url parameter, even if the stats are disabled. Leave blank to disable this feature -->
2828
<Parameter name="STATS_SECRET" value="" override="false" />
29+
<!-- allows to share the entire workspace history, this does not effect the UI, but enables the /share/history endpoint,
30+
which is used by the migration PHP script. Disabled by default. -->
31+
<Parameter name="ALLOW_SHARING_HISTORY" value="false" override="false" />
2932

3033
<!-- Quotas -->
3134

0 commit comments

Comments
 (0)