Skip to content

Commit

Permalink
Remove fcr:locks feature
Browse files Browse the repository at this point in the history
  • Loading branch information
cbeer committed Oct 15, 2014
1 parent caf36e8 commit 86d012b
Show file tree
Hide file tree
Showing 27 changed files with 5 additions and 1,673 deletions.
166 changes: 0 additions & 166 deletions fcrepo-http-api/src/main/java/org/fcrepo/http/api/FedoraLocks.java

This file was deleted.

Expand Up @@ -162,7 +162,7 @@ void init() throws IOException {
}

final List<String> otherTemplates =
ImmutableList.of("jcr:nodetypes", "node", "fcr:versions", "fcr:lock", "fcr:fixity");
ImmutableList.of("jcr:nodetypes", "node", "fcr:versions", "fcr:fixity");

for (final String key : otherTemplates) {
final Template template =
Expand Down
Expand Up @@ -21,7 +21,6 @@
import static java.util.Collections.singletonMap;
import static org.fcrepo.jcr.FedoraJcrTypes.ROOT;
import static org.fcrepo.kernel.RdfLexicon.HAS_FIXITY_SERVICE;
import static org.fcrepo.kernel.RdfLexicon.HAS_LOCK;
import static org.fcrepo.kernel.RdfLexicon.HAS_SERIALIZATION;
import static org.fcrepo.kernel.RdfLexicon.HAS_TRANSACTION_SERVICE;
import static org.fcrepo.kernel.RdfLexicon.HAS_VERSION_HISTORY;
Expand All @@ -35,7 +34,6 @@

import org.fcrepo.http.api.FedoraExport;
import org.fcrepo.http.api.FedoraFixity;
import org.fcrepo.http.api.FedoraLocks;
import org.fcrepo.http.api.FedoraVersioning;
import org.fcrepo.http.api.repository.FedoraRepositoryExport;
import org.fcrepo.http.api.repository.FedoraRepositoryTransactions;
Expand Down Expand Up @@ -107,23 +105,6 @@ private void addNodeStatements(final FedoraResource resource, final UriInfo uriI
final Map<String, String> pathMap =
singletonMap("path", resource.getPath().substring(1));

try {
// hasLock
if (resource.getNode().isLocked()) {
final String path = resource.getPath();
final Node lockHoldingNode
= resource.getNode().getSession().getWorkspace()
.getLockManager().getLock(path).getNode();
final Map<String, String> lockedNodePathMap =
singletonMap("path", lockHoldingNode.getPath().substring(1));
model.add(s, HAS_LOCK, createResource(uriInfo
.getBaseUriBuilder().path(FedoraLocks.class).buildFromMap(
lockedNodePathMap, false).toASCIIString()));
}
} catch (final RepositoryException e) {
throw new RepositoryRuntimeException(e);
}

// fcr:versions
if (resource.hasType(NodeType.MIX_VERSIONABLE)) {
model.add(s, HAS_VERSION_HISTORY, createResource(uriInfo
Expand Down
18 changes: 0 additions & 18 deletions fcrepo-http-api/src/main/resources/views/common-node-actions.vsl
Expand Up @@ -110,7 +110,6 @@ WHERE { }

#if ($writable == true)
#set ($serializations = $rdf.find($nodeany, $topic, $helpers.asNode($rdfLexicon.HAS_SERIALIZATION), $nodeany))
#set ($isLockable = $helpers.isRdfResource($rdf, $topic, $rdfLexicon.MIX_NAMESPACE, "lockable"))

#if($serializations.hasNext())
<form id="action_import" action="fcr:import" method="POST">
Expand Down Expand Up @@ -161,23 +160,6 @@ WHERE { }
</form>
#end

#if($isLockable)
#set ($lockUrl = $helpers.getLockUrl($rdf, $topic))
#set ($viewDisplay = "none")
#set ($createDisplay = "block")
#if ($lockUrl && $lockUrl.length() > 0)
#set ($viewDisplay = "block")
#set ($createDisplay = "none")
#end
<div class="actions collapse visible-lg visible-md" id="div_lock">
<h3>Locks</h3>
<div class="form-group" id="div_view_lock" style="display:$viewDisplay">
<div class="control-label">Item is Locked!</div>
<button type="button" id="btn_view_lock" class="btn btn-primary" onClick="javascript:viewLock('$lockUrl');">View Lock</button>
</div>
<hr />
</div>
#end
#end

#if ($writable == true)
Expand Down
26 changes: 0 additions & 26 deletions fcrepo-http-api/src/main/resources/views/common.js
Expand Up @@ -242,32 +242,6 @@ function deleteItem()
return false;
}

function createLock()
{
var uri = $('#main').attr('resource');
var isDeep = false;
if ($('#deep_id').prop('checked'))
isDeep = true;
$.ajax({
type: "POST",
url: uri + "/fcr:lock?deep=" + isDeep,
success: function() {
$('#div_create_lock').hide();
$('#div_view_lock').show();
}
}).fail( ajaxErrorHandler);
}

function viewLock(lockUrl)
{
$('#div_view_lock').hide();
if (!lockUrl || lockUrl.length === 0) {
var uri = $('#main').attr('resource');
lockUrl = uri + "/fcr:lock";
}
window.location.href = lockUrl;
}

function updateFile()
{
var update_file = document.getElementById("update_file").files[0];
Expand Down
61 changes: 0 additions & 61 deletions fcrepo-http-api/src/main/resources/views/fcr-lock.vsl

This file was deleted.

0 comments on commit 86d012b

Please sign in to comment.