Skip to content

Commit

Permalink
#1 fixes for cloud browser
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-conway committed Jul 1, 2015
1 parent 819cb45 commit 262101f
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 32 deletions.
2 changes: 1 addition & 1 deletion dot-irods-utilities/src/test/resources/testing.properties
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ test.confirm=${jargon.test.confirm}
test2.irods.resource=test1-resc2
test3.irods.user=test3
test3.irods.password=test
test3.irods.resource=test1-resc3
test3.irods.resource=fedzone1-403-r3Resource
test.irods.host=fedzone1-403.irods.org
test.irods.port=1247
test.irods.zone=fedZone1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,8 @@
import java.util.List;

import org.irods.jargon.core.connection.IRODSAccount;
import org.irods.jargon.core.exception.JargonException;
import org.irods.jargon.core.exception.JargonRuntimeException;
import org.irods.jargon.core.pub.IRODSAccessObjectFactory;
import org.irods.jargon.core.service.AbstractJargonService;
import org.irods.jargon.core.utils.LocalFileUtils;
import org.irods.jargon.core.utils.MiscIRODSUtils;
import org.irods.jargon.vircoll.AbstractVirtualCollection;
import org.irods.jargon.vircoll.VirtualCollectionDiscoveryService;
Expand Down Expand Up @@ -161,19 +158,6 @@ public List<AbstractVirtualCollection> listDefaultUserCollections() {
// add starred folders
virtualCollections.add(new StarredFoldersVirtualCollection());

/*
* Demo code for DFC - this should actually be a serialized thing
*/
String query;
try {
query = LocalFileUtils
.getClasspathResourceFileAsString("/sparql-templates/baseVocabQuery.txt");
} catch (JargonException e) {
log.error("error creating virtual collection for sparql", e);
throw new JargonRuntimeException(
"cannot create virtual collection for sparql", e);
}

log.info("done...");
return virtualCollections;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,14 @@
import org.irods.jargon.core.exception.JargonException;
import org.irods.jargon.core.pub.IRODSAccessObjectFactory;
import org.irods.jargon.core.service.AbstractJargonService;
import org.irods.jargon.usertagging.starring.IRODSStarringService;
import org.irods.jargon.usertagging.starring.IRODSStarringServiceImpl;
import org.irods.jargon.vircoll.AbstractVirtualCollection;
import org.irods.jargon.vircoll.AbstractVirtualCollectionExecutor;
import org.irods.jargon.vircoll.VirtualCollectionExecutorFactory;
import org.irods.jargon.vircoll.types.CollectionBasedVirtualCollection;
import org.irods.jargon.vircoll.types.CollectionBasedVirtualCollectionExecutor;
import org.irods.jargon.vircoll.types.StarredFoldersVirtualCollection;
import org.irods.jargon.vircoll.types.StarredFoldersVirtualCollectionExecutor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand Down Expand Up @@ -46,24 +50,39 @@ public VirtualCollectionFactoryImpl(
super(irodsAccessObjectFactory, irodsAccount);
}

@Override
public StarredFoldersVirtualCollectionExecutor instanceStarredFolderVirtualCollection() {
// TODO Auto-generated method stub
return null;
}

@Override
public CollectionBasedVirtualCollectionExecutor instanceCollectionBasedVirtualCollectionExecutor(
String uniqueName, String parentPath) {
// TODO Auto-generated method stub
return null;
}

@Override
public AbstractVirtualCollectionExecutor instanceExecutorBasedOnVirtualCollection(
AbstractVirtualCollection virtualCollection)
throws DataNotFoundException, JargonException {
// TODO Auto-generated method stub
return null;
log.info("instanceExecutor()");

if (virtualCollection == null) {
throw new IllegalArgumentException(
"null or empty virtualCollection");
}

log.info("virtualCollection:{}", virtualCollection);

log.info("finding executor for vc...");

if (virtualCollection.getType().equals(
CollectionBasedVirtualCollection.MY_TYPE)) {

return new CollectionBasedVirtualCollectionExecutor(
(CollectionBasedVirtualCollection) virtualCollection,
getIrodsAccessObjectFactory(), getIrodsAccount());
} else if (virtualCollection.getType().equals(
StarredFoldersVirtualCollection.MY_TYPE)) {
// TODO: refactor into executor code
IRODSStarringService irodsStarringService = new IRODSStarringServiceImpl(
getIrodsAccessObjectFactory(), getIrodsAccount());
return new StarredFoldersVirtualCollectionExecutor(
(StarredFoldersVirtualCollection) virtualCollection,
getIrodsAccessObjectFactory(), getIrodsAccount(),
irodsStarringService);
} else {
throw new UnsupportedOperationException(
"cannot support collection type yet");
}
}
}

0 comments on commit 262101f

Please sign in to comment.