use of org.cytoscape.group.CyGroupFactory in project cytoscape-impl by cytoscape.
the class CyActivator method start.
@Override
public void start(BundleContext bc) {
CyServiceRegistrar serviceRegistrar = getService(bc, CyServiceRegistrar.class);
CyEventHelper cyEventHelperRef = getService(bc, CyEventHelper.class);
CyNetworkNaming cyNetworkNamingServiceRef = getService(bc, CyNetworkNaming.class);
UndoSupport undoSupportServiceRef = getService(bc, UndoSupport.class);
CyNetworkViewFactory cyNetworkViewFactoryServiceRef = getService(bc, CyNetworkViewFactory.class);
CyNetworkFactory cyNetworkFactoryServiceRef = getService(bc, CyNetworkFactory.class);
CyRootNetworkManager cyRootNetworkFactoryServiceRef = getService(bc, CyRootNetworkManager.class);
VisualMappingManager visualMappingManagerServiceRef = getService(bc, VisualMappingManager.class);
CyNetworkViewWriterManager networkViewWriterManagerServiceRef = getService(bc, CyNetworkViewWriterManager.class);
CyNetworkManager cyNetworkManagerServiceRef = getService(bc, CyNetworkManager.class);
CyNetworkViewManager cyNetworkViewManagerServiceRef = getService(bc, CyNetworkViewManager.class);
CyApplicationManager cyApplicationManagerServiceRef = getService(bc, CyApplicationManager.class);
CySessionManager cySessionManagerServiceRef = getService(bc, CySessionManager.class);
CyTableFactory cyTableFactoryServiceRef = getService(bc, CyTableFactory.class);
CyTableManager cyTableManagerServiceRef = getService(bc, CyTableManager.class);
CyLayoutAlgorithmManager cyLayoutsServiceRef = getService(bc, CyLayoutAlgorithmManager.class);
CyTableWriterManager cyTableWriterManagerRef = getService(bc, CyTableWriterManager.class);
SynchronousTaskManager<?> synchronousTaskManagerServiceRef = getService(bc, SynchronousTaskManager.class);
TunableSetter tunableSetterServiceRef = getService(bc, TunableSetter.class);
CyRootNetworkManager rootNetworkManagerServiceRef = getService(bc, CyRootNetworkManager.class);
CyNetworkTableManager cyNetworkTableManagerServiceRef = getService(bc, CyNetworkTableManager.class);
RenderingEngineManager renderingEngineManagerServiceRef = getService(bc, RenderingEngineManager.class);
CyNetworkViewFactory nullNetworkViewFactory = getService(bc, CyNetworkViewFactory.class, "(id=NullCyNetworkViewFactory)");
CyGroupManager cyGroupManager = getService(bc, CyGroupManager.class);
CyGroupFactory cyGroupFactory = getService(bc, CyGroupFactory.class);
{
DynamicTaskFactoryProvisionerImpl factory = new DynamicTaskFactoryProvisionerImpl(serviceRegistrar);
registerAllServices(bc, factory);
}
createPreferencesTaskFactories(bc, serviceRegistrar);
createFilterTaskFactories(bc, serviceRegistrar);
createTableTaskFactories(bc, serviceRegistrar, undoSupportServiceRef, cyNetworkManagerServiceRef, cyApplicationManagerServiceRef, cyTableFactoryServiceRef, cyTableManagerServiceRef, cyTableWriterManagerRef, tunableSetterServiceRef, rootNetworkManagerServiceRef, cyNetworkTableManagerServiceRef);
createNetworkTaskFactories(bc, serviceRegistrar, cyEventHelperRef, cyNetworkNamingServiceRef, undoSupportServiceRef, cyNetworkViewFactoryServiceRef, cyNetworkFactoryServiceRef, cyRootNetworkFactoryServiceRef, visualMappingManagerServiceRef, cyNetworkManagerServiceRef, cyNetworkViewManagerServiceRef, cyApplicationManagerServiceRef, synchronousTaskManagerServiceRef, rootNetworkManagerServiceRef, cyNetworkTableManagerServiceRef, renderingEngineManagerServiceRef, nullNetworkViewFactory, cyGroupManager, cyGroupFactory, networkViewWriterManagerServiceRef, tunableSetterServiceRef);
createViewTaskFactories(bc, cyEventHelperRef, undoSupportServiceRef, visualMappingManagerServiceRef, networkViewWriterManagerServiceRef, cyNetworkViewManagerServiceRef, cyApplicationManagerServiceRef, cyLayoutsServiceRef, tunableSetterServiceRef, renderingEngineManagerServiceRef, cyNetworkManagerServiceRef, cySessionManagerServiceRef, serviceRegistrar);
createVizmapTaskFactories(bc, serviceRegistrar);
createSessionTaskFactories(bc, serviceRegistrar);
createGroupTaskFactories(bc, undoSupportServiceRef, cyApplicationManagerServiceRef, cyGroupManager, cyGroupFactory, serviceRegistrar);
createNodeEdgeTaskFactories(bc, serviceRegistrar, cyEventHelperRef, undoSupportServiceRef, cyNetworkViewManagerServiceRef, tunableSetterServiceRef, cyApplicationManagerServiceRef, cyTableManagerServiceRef, renderingEngineManagerServiceRef, visualMappingManagerServiceRef);
createLayoutTaskFactories(bc, serviceRegistrar);
createHelpTaskFactories(bc, serviceRegistrar);
}
use of org.cytoscape.group.CyGroupFactory in project cytoscape-impl by cytoscape.
the class CloneNetworkTaskFactoryTest method testObserver.
@Test
public void testObserver() throws Exception {
NetworkViewTestSupport viewSupport = new NetworkViewTestSupport();
NetworkTestSupport networkSupport = new NetworkTestSupport();
CyNetworkManager networkMgr = Mockito.mock(CyNetworkManager.class);
CyNetworkViewManager networkViewMgr = Mockito.mock(CyNetworkViewManager.class);
VisualMappingManager vmm = Mockito.mock(VisualMappingManager.class);
CyNetworkFactory netFactory = networkSupport.getNetworkFactory();
CyNetworkViewFactory netViewFactory = viewSupport.getNetworkViewFactory();
CyNetworkNaming naming = Mockito.mock(CyNetworkNaming.class);
CyApplicationManager appMgr = Mockito.mock(CyApplicationManager.class);
CyNetworkTableManager netTableMgr = Mockito.mock(CyNetworkTableManager.class);
CyRootNetworkManager rootNetMgr = new CyRootNetworkManagerImpl();
CyGroupManager groupMgr = Mockito.mock(CyGroupManager.class);
CyGroupFactory groupFactory = Mockito.mock(CyGroupFactory.class);
RenderingEngineManager renderingEngineMgr = Mockito.mock(RenderingEngineManager.class);
CyNetworkViewFactory nullNetworkViewFactory = new NullCyNetworkViewFactory();
CyServiceRegistrar serviceRegistrar = Mockito.mock(CyServiceRegistrar.class);
CloneNetworkTaskFactoryImpl factory = new CloneNetworkTaskFactoryImpl(networkMgr, networkViewMgr, vmm, netFactory, netViewFactory, naming, appMgr, netTableMgr, rootNetMgr, groupMgr, groupFactory, renderingEngineMgr, nullNetworkViewFactory, serviceRegistrar);
CyNetwork network = netFactory.createNetwork();
TaskObserver observer = Mockito.mock(TaskObserver.class);
TaskIterator iterator = factory.createTaskIterator(network);
TaskMonitor taskMonitor = Mockito.mock(TaskMonitor.class);
while (iterator.hasNext()) {
Task t = iterator.next();
t.run(taskMonitor);
if (t instanceof ObservableTask)
observer.taskFinished((ObservableTask) t);
}
Mockito.verify(observer, Mockito.times(1)).taskFinished(Mockito.any(ObservableTask.class));
}
use of org.cytoscape.group.CyGroupFactory in project clusterMaker2 by RBVI.
the class CyActivator method start.
public void start(BundleContext bc) {
// See if we have a graphics console or not
boolean haveGUI = true;
CySwingApplication swingAppRef = getService(bc, CySwingApplication.class);
if (swingAppRef == null) {
// if haveGUI is false, we don't want to provide any hooks to the treeview
haveGUI = false;
}
CyApplicationManager appRef = getService(bc, CyApplicationManager.class);
CyServiceRegistrar serviceRegistrar = getService(bc, CyServiceRegistrar.class);
CyGroupManager groupManager = getService(bc, CyGroupManager.class);
CyGroupFactory groupFactory = getService(bc, CyGroupFactory.class);
CyTableFactory tableFactory = getService(bc, CyTableFactory.class);
CyTableManager tableManager = getService(bc, CyTableManager.class);
// Create our context object. This will probably keep track of all of the
// registered clustering algorithms, settings, etc.
ClusterManagerImpl clusterManager = new ClusterManagerImpl(appRef, serviceRegistrar, groupFactory, groupManager, tableFactory, tableManager);
registerServiceListener(bc, clusterManager, "addClusterAlgorithm", "removeClusterAlgorithm", ClusterTaskFactory.class);
registerServiceListener(bc, clusterManager, "addClusterVisualizer", "removeClusterVisualizer", ClusterVizFactory.class);
registerServiceListener(bc, clusterManager, "addRankingAlgorithm", "removeRankingAlgorithm", RankFactory.class);
// Register each of our algorithms
// Attribute clusterers
registerService(bc, new AttributeClusterTaskFactory(clusterManager), ClusterTaskFactory.class, new Properties());
registerService(bc, new AutoSOMETaskFactory(clusterManager, true), ClusterTaskFactory.class, new Properties());
registerService(bc, new FeatureVectorTaskFactory(clusterManager), ClusterTaskFactory.class, new Properties());
registerService(bc, new HierarchicalTaskFactory(clusterManager), ClusterTaskFactory.class, new Properties());
registerService(bc, new KMeansTaskFactory(clusterManager), ClusterTaskFactory.class, new Properties());
registerService(bc, new KMedoidTaskFactory(clusterManager), ClusterTaskFactory.class, new Properties());
registerService(bc, new HopachPAMTaskFactory(clusterManager), ClusterTaskFactory.class, new Properties());
registerService(bc, new PAMTaskFactory(clusterManager), ClusterTaskFactory.class, new Properties());
// FIXME: FFT is seriously broken!
registerService(bc, new FFTTaskFactory(clusterManager), ClusterTaskFactory.class, new Properties());
registerService(bc, new DBSCANTaskFactory(clusterManager), ClusterTaskFactory.class, new Properties());
/*
* Hold off on these until we get improve the performance sufficiently
* to allow them to be useful
*/
// registerService(bc, new BicFinderTaskFactory(clusterManager),
// ClusterTaskFactory.class, new Properties());
// registerService(bc, new BiMineTaskFactory(clusterManager),
// ClusterTaskFactory.class, new Properties());
registerService(bc, new ChengChurchTaskFactory(clusterManager), ClusterTaskFactory.class, new Properties());
// Network clusterers
registerService(bc, new NetworkClusterTaskFactory(clusterManager), ClusterTaskFactory.class, new Properties());
registerService(bc, new APClusterTaskFactory(clusterManager), ClusterTaskFactory.class, new Properties());
registerService(bc, new AutoSOMETaskFactory(clusterManager, false), ClusterTaskFactory.class, new Properties());
registerService(bc, new FuzzifierTaskFactory(clusterManager), ClusterTaskFactory.class, new Properties());
registerService(bc, new GLayClusterTaskFactory(clusterManager), ClusterTaskFactory.class, new Properties());
registerService(bc, new ConnectedComponentsTaskFactory(clusterManager), ClusterTaskFactory.class, new Properties());
registerService(bc, new FCMClusterTaskFactory(clusterManager), ClusterTaskFactory.class, new Properties());
registerService(bc, new MCLClusterTaskFactory(clusterManager), ClusterTaskFactory.class, new Properties());
registerService(bc, new MCODEClusterTaskFactory(clusterManager), ClusterTaskFactory.class, new Properties());
registerService(bc, new SCPSClusterTaskFactory(clusterManager), ClusterTaskFactory.class, new Properties());
registerService(bc, new TransClustClusterTaskFactory(clusterManager), ClusterTaskFactory.class, new Properties());
// Cluster ranking
registerService(bc, new MAATaskFactory(clusterManager), RankFactory.class, new Properties());
registerService(bc, new MAMTaskFactory(clusterManager), RankFactory.class, new Properties());
registerService(bc, new PRWPTaskFactory(clusterManager), RankFactory.class, new Properties());
registerService(bc, new PRTaskFactory(clusterManager), RankFactory.class, new Properties());
registerService(bc, new HITSTaskFactory(clusterManager), RankFactory.class, new Properties());
// Filters
registerService(bc, new FilterTaskFactory(clusterManager), ClusterTaskFactory.class, new Properties());
registerService(bc, new BestNeighborFilterTaskFactory(clusterManager), ClusterTaskFactory.class, new Properties());
registerService(bc, new CuttingEdgeFilterTaskFactory(clusterManager), ClusterTaskFactory.class, new Properties());
registerService(bc, new DensityFilterTaskFactory(clusterManager), ClusterTaskFactory.class, new Properties());
registerService(bc, new HairCutFilterTaskFactory(clusterManager), ClusterTaskFactory.class, new Properties());
// registerService(bc, new UITaskFactory(clusterManager), ClusterTaskFactory.class, new Properties());
// Visualizations
registerService(bc, new NewNetworkViewFactory(clusterManager, false), ClusterVizFactory.class, new Properties());
registerService(bc, new NewNetworkViewFactory(clusterManager, true), ClusterVizFactory.class, new Properties());
registerService(bc, new HeatMapViewTaskFactory(clusterManager), ClusterVizFactory.class, new Properties());
registerService(bc, new KnnViewTaskFactory(clusterManager), ClusterVizFactory.class, new Properties());
registerService(bc, new BiclusterViewTaskFactory(clusterManager), ClusterVizFactory.class, new Properties());
registerService(bc, new TreeViewTaskFactory(clusterManager), ClusterVizFactory.class, new Properties());
registerService(bc, new CreateResultsPanelTaskFactory(clusterManager, true), ClusterVizFactory.class, new Properties());
registerService(bc, new CreateRankingPanelTaskFactory(clusterManager, true), ClusterVizFactory.class, new Properties());
registerService(bc, new DestroyResultsPanelTaskFactory(clusterManager, true), ClusterVizFactory.class, new Properties());
registerService(bc, new DestroyRankingPanelTaskFactory(clusterManager, true), ClusterVizFactory.class, new Properties());
// Dimensionality Reduction
// registerService(bc, new PCAMenuTaskFactory(clusterManager), ClusterTaskFactory.class, new Properties());
registerService(bc, new PCATaskFactory(clusterManager), ClusterTaskFactory.class, new Properties());
registerService(bc, new PCoATaskFactory(clusterManager), ClusterTaskFactory.class, new Properties());
registerService(bc, new tSNETaskFactory(clusterManager), ClusterTaskFactory.class, new Properties());
{
// Link Network Selections
LinkSelectionTaskFactory linkTaskFactory = new LinkSelectionTaskFactory(clusterManager);
Properties linkSelectionProps = new Properties();
linkSelectionProps.setProperty(INSERT_SEPARATOR_BEFORE, "true");
linkSelectionProps.setProperty(PREFERRED_MENU, "Apps.clusterMaker Visualizations");
linkSelectionProps.setProperty(TITLE, "Link selection across networks");
linkSelectionProps.setProperty(COMMAND, "linkSelection");
linkSelectionProps.setProperty(COMMAND_NAMESPACE, "clusterviz");
linkSelectionProps.setProperty(ENABLE_FOR, "networkAndView");
linkSelectionProps.setProperty(IN_MENU_BAR, "true");
linkSelectionProps.setProperty(MENU_GRAVITY, "100.0");
registerService(bc, linkTaskFactory, NetworkTaskFactory.class, linkSelectionProps);
}
{
// UnLink Network Selections
UnlinkSelectionTaskFactory unlinkTaskFactory = new UnlinkSelectionTaskFactory(clusterManager);
Properties unlinkSelectionProps = new Properties();
unlinkSelectionProps.setProperty(PREFERRED_MENU, "Apps.clusterMaker Visualizations");
unlinkSelectionProps.setProperty(TITLE, "Unlink selection across networks");
unlinkSelectionProps.setProperty(COMMAND, "unlinkSelection");
unlinkSelectionProps.setProperty(COMMAND_NAMESPACE, "clusterviz");
unlinkSelectionProps.setProperty(ENABLE_FOR, "networkAndView");
unlinkSelectionProps.setProperty(IN_MENU_BAR, "true");
unlinkSelectionProps.setProperty(MENU_GRAVITY, "100.0");
registerService(bc, unlinkTaskFactory, NetworkTaskFactory.class, unlinkSelectionProps);
}
// Commands
// These task factories provide useful commands that only make sense in the context of REST or
// the command interface
{
TaskFactory commandTaskFactory = new CommandTaskFactory(clusterManager, "hascluster");
Properties props = new Properties();
props.setProperty(COMMAND_NAMESPACE, "cluster");
props.setProperty(COMMAND, CommandTaskFactory.HASCLUSTER);
props.setProperty(COMMAND_DESCRIPTION, "Test to see if this network has a cluster of the requested type");
registerService(bc, commandTaskFactory, TaskFactory.class, props);
}
{
TaskFactory commandTaskFactory = new CommandTaskFactory(clusterManager, "getnetworkcluster");
Properties props = new Properties();
props.setProperty(COMMAND_NAMESPACE, "cluster");
props.setProperty(COMMAND, CommandTaskFactory.GETNETWORKCLUSTER);
props.setProperty(COMMAND_DESCRIPTION, "Get a cluster network cluster result");
registerService(bc, commandTaskFactory, TaskFactory.class, props);
}
{
TaskFactory commandTaskFactory = new CommandTaskFactory(clusterManager, "getcluster");
Properties props = new Properties();
props.setProperty(COMMAND_NAMESPACE, "cluster");
props.setProperty(COMMAND, CommandTaskFactory.GETCLUSTER);
props.setProperty(COMMAND_DESCRIPTION, "Get an attribute cluster result");
registerService(bc, commandTaskFactory, TaskFactory.class, props);
}
}
use of org.cytoscape.group.CyGroupFactory in project cytoscape-impl by cytoscape.
the class GroupUtil method createGroups.
private void createGroups(final CySubNetwork net, final Set<CyNetworkView> viewSet, final Set<CyNode> collapsedChildren) {
// Look for possible meta-nodes by inspecting the groups metadata in the network's hidden table
final CyRootNetwork rootNet = net.getRootNetwork();
final List<CyNode> nodes = net.getNodeList();
final CyGroupFactory groupFactory = serviceRegistrar.getService(CyGroupFactory.class);
// Iterate each node and check if they have network pointers
for (final CyNode n : nodes) {
final CyNetwork netPointer = n.getNetworkPointer();
if (netPointer == null)
continue;
// Retrieve the internal nodes and edges
final CyRow dnRow = net.getRow(n, CyNetwork.DEFAULT_ATTRS);
final CyRow hnRow = net.getRow(n, CyNetwork.HIDDEN_ATTRS);
final CyRow snRow = netPointer.getRow(netPointer, CyNetwork.HIDDEN_ATTRS);
if (!dnRow.isSet(GROUP_STATE_ATTRIBUTE) && !hnRow.isSet(GROUP_STATE_ATTRIBUTE) && !hnRow.isSet(GROUP_ATTRIBUTE))
continue;
// Check for nested groups recursively
createGroups((CySubNetwork) netPointer, null, collapsedChildren);
boolean collapsed = false;
boolean nodeShown = false;
boolean cy2group = false;
if (hnRow.isSet(GROUP_STATE_ATTRIBUTE)) {
// 2.x metadata
Integer grState = hnRow.get(GROUP_STATE_ATTRIBUTE, Integer.class);
cy2group = true;
if (grState.intValue() == 2)
collapsed = true;
} else if (dnRow.isSet(GROUP_STATE_ATTRIBUTE)) {
// 2.x metadata
Integer grState = dnRow.get(GROUP_STATE_ATTRIBUTE, Integer.class);
cy2group = true;
if (grState.intValue() == 2)
collapsed = true;
} else {
List<Long> collapsedList = snRow.getList(GROUP_COLLAPSED_ATTRIBUTE, Long.class);
if (collapsedList != null) {
// Are we collapsed in this network?
for (Long suid : collapsedList) {
if (suid.equals(net.getSUID())) {
collapsed = true;
break;
}
}
}
List<Long> shownList = snRow.getList(GROUP_NODE_SHOWN_ATTRIBUTE, Long.class);
if (shownList != null) {
// Are we showing our group node in this network?
for (Long suid : shownList) {
if (suid.equals(net.getSUID())) {
// Yup
nodeShown = true;
break;
}
}
}
}
// we create the group
if (!collapsed) {
if (!nodeShown) {
net.removeNodes(Collections.singletonList(n));
rootNet.restoreNode(n);
}
// Add our internal edges into the network (if they aren't already)
for (CyEdge edge : netPointer.getEdgeList()) {
if (net.containsEdge(edge))
continue;
net.addEdge(edge);
}
// If we're a cy2 group, remember our state
if (cy2group) {
CyTable hnTable = rootNet.getTable(CyNode.class, CyNetwork.HIDDEN_ATTRS);
if (hnTable.getColumn(GROUP_STATE_ATTRIBUTE) == null) {
hnTable.createColumn(GROUP_STATE_ATTRIBUTE, Integer.class, false);
}
hnTable.getRow(n.getSUID()).set(GROUP_STATE_ATTRIBUTE, 1);
}
}
// Create the group
final CyGroup group;
// TODO: Do not create more than one instance of a CyGroup for the same group node.
// if (groupMgr.isGroup(n, rootNet)) {
// group = groupMgr.getGroup(n, rootNet);
// group.addGroupToNetwork(net);
// group.collapse(net);
// } else {
group = groupFactory.createGroup(net, n, true);
// CyRow groupNodeRow = net.getRow(n, CyNetwork.HIDDEN_ATTRS);
if (snRow.isSet(EXTERNAL_EDGE_ATTRIBUTE)) {
List<Long> externalIDs = snRow.getList(EXTERNAL_EDGE_ATTRIBUTE, Long.class);
List<CyEdge> externalEdges = new ArrayList<CyEdge>();
for (Long suid : externalIDs) {
CyEdge newEdge = rootNet.getEdge(suid);
if (newEdge != null) {
// Don't add the edge if it already exists
if (!isMeta(group, newEdge) || !metaExists(group, newEdge)) {
externalEdges.add(newEdge);
}
}
}
if (cy2group && collapsed) {
updateMetaEdges(net, n);
}
group.addEdges(externalEdges);
}
// if we're collapsed.
if (cy2group) {
if (collapsed) {
// Update the locations of child nodes
updateChildOffsets(netPointer, net, n);
}
// If the group is collapsed, we need to provide the location information so we can expand it
if (viewSet != null) {
if (collapsed) {
for (CyNetworkView view : viewSet) {
if (view.getModel().equals(net))
updateGroupNodeLocation(view, n);
disableNestedNetworkIcon(view, n);
}
}
}
}
if (collapsed) {
if (collapsedChildren.contains(n) && net.containsNode(n))
net.removeNodes(Collections.singleton(n));
collapsedChildren.addAll(netPointer.getNodeList());
}
}
// TODO: If this is a 2.x group, clean up
if (net.getDefaultNodeTable().getColumn(GROUP_STATE_ATTRIBUTE) != null)
net.getDefaultNodeTable().deleteColumn(GROUP_STATE_ATTRIBUTE);
if (net.getDefaultNodeTable().getColumn(GROUP_ISLOCAL_ATTRIBUTE) != null)
net.getDefaultNodeTable().deleteColumn(GROUP_ISLOCAL_ATTRIBUTE);
}
use of org.cytoscape.group.CyGroupFactory in project cytoscape-impl by cytoscape.
the class CyActivator method start.
@Override
public void start(BundleContext bc) {
CyServiceRegistrar serviceRegistrar = getService(bc, CyServiceRegistrar.class);
CyApplicationConfiguration cyApplicationConfigurationRef = getService(bc, CyApplicationConfiguration.class);
CyApplicationManager cyApplicationManagerRef = getService(bc, CyApplicationManager.class);
CyEventHelper cyEventHelperRef = getService(bc, CyEventHelper.class);
CyGroupAggregationManager cyGroupAggregationManagerRef = getService(bc, CyGroupAggregationManager.class);
CyGroupFactory cyGroupFactoryRef = getService(bc, CyGroupFactory.class);
CyGroupManager cyGroupManagerRef = getService(bc, CyGroupManager.class);
CyLayoutAlgorithmManager cyLayoutAlgorithmManagerRef = getService(bc, CyLayoutAlgorithmManager.class);
CyNetworkFactory cyNetworkFactoryRef = getService(bc, CyNetworkFactory.class);
CyNetworkManager cyNetworkManagerRef = getService(bc, CyNetworkManager.class);
CyNetworkViewFactory cyNetworkViewFactoryRef = getService(bc, CyNetworkViewFactory.class);
CyNetworkViewManager cyNetworkViewManagerRef = getService(bc, CyNetworkViewManager.class);
CyNetworkReaderManager cyNetworkViewReaderManagerRef = getService(bc, CyNetworkReaderManager.class);
CyNetworkViewWriterManager cyNetworkViewWriterManagerRef = getService(bc, CyNetworkViewWriterManager.class);
CyProperty<Properties> cyPropertyRef = getService(bc, CyProperty.class, "(cyPropertyName=cytoscape3.props)");
CyPropertyReaderManager cyPropertyReaderManagerRef = getService(bc, CyPropertyReaderManager.class);
CyPropertyWriterManager cyPropertyWriterManagerRef = getService(bc, CyPropertyWriterManager.class);
CyRootNetworkManager cyRootNetworkFactoryRef = getService(bc, CyRootNetworkManager.class);
CySessionManager cySessionManagerRef = getService(bc, CySessionManager.class);
CySessionReaderManager cySessionReaderManagerRef = getService(bc, CySessionReaderManager.class);
CySessionWriterManager cySessionWriterManagerRef = getService(bc, CySessionWriterManager.class);
CySwingApplication cySwingApplicationRef = getService(bc, CySwingApplication.class);
CyTableFactory cyTableFactoryRef = getService(bc, CyTableFactory.class);
CyTableManager cyTableManagerRef = getService(bc, CyTableManager.class);
CyTableReaderManager cyTableReaderManagerRef = getService(bc, CyTableReaderManager.class);
CyTableWriterManager cyTableWriterManagerRef = getService(bc, CyTableWriterManager.class);
PanelTaskManager panelTaskManagerRef = getService(bc, PanelTaskManager.class);
DialogTaskManager dialogTaskManagerRef = getService(bc, DialogTaskManager.class);
PresentationWriterManager presentationWriterManagerRef = getService(bc, PresentationWriterManager.class);
RenderingEngineManager renderingEngineManagerRef = getService(bc, RenderingEngineManager.class);
TaskManager taskManagerRef = getService(bc, TaskManager.class);
UndoSupport undoSupportRef = getService(bc, UndoSupport.class);
TunablePropertySerializerFactory tunablePropertySerializerFactoryRef = getService(bc, TunablePropertySerializerFactory.class);
VisualMappingManager visualMappingManagerRef = getService(bc, VisualMappingManager.class);
VisualStyleFactory visualStyleFactoryRef = getService(bc, VisualStyleFactory.class);
CyVersion cytoscapeVersionService = getService(bc, CyVersion.class);
CyApplicationConfiguration cyApplicationConfigurationServiceRef = getService(bc, CyApplicationConfiguration.class);
VisualMappingFunctionFactory vmfFactoryC = getService(bc, VisualMappingFunctionFactory.class, "(mapping.type=continuous)");
VisualMappingFunctionFactory vmfFactoryD = getService(bc, VisualMappingFunctionFactory.class, "(mapping.type=discrete)");
VisualMappingFunctionFactory vmfFactoryP = getService(bc, VisualMappingFunctionFactory.class, "(mapping.type=passthrough)");
DataSourceManager dataSourceManager = getService(bc, DataSourceManager.class);
// Start of core-task services
LoadVizmapFileTaskFactory loadVizmapFileTaskFactory = getService(bc, LoadVizmapFileTaskFactory.class);
LoadNetworkFileTaskFactory loadNetworkFileTaskFactory = getService(bc, LoadNetworkFileTaskFactory.class);
LoadNetworkURLTaskFactory loadNetworkURLTaskFactory = getService(bc, LoadNetworkURLTaskFactory.class);
DeleteSelectedNodesAndEdgesTaskFactory deleteSelectedNodesAndEdgesTaskFactory = getService(bc, DeleteSelectedNodesAndEdgesTaskFactory.class);
SelectAllTaskFactory selectAllTaskFactory = getService(bc, SelectAllTaskFactory.class);
SelectAllEdgesTaskFactory selectAllEdgesTaskFactory = getService(bc, SelectAllEdgesTaskFactory.class);
SelectAllNodesTaskFactory selectAllNodesTaskFactory = getService(bc, SelectAllNodesTaskFactory.class);
SelectAdjacentEdgesTaskFactory selectAdjacentEdgesTaskFactory = getService(bc, SelectAdjacentEdgesTaskFactory.class);
SelectConnectedNodesTaskFactory selectConnectedNodesTaskFactory = getService(bc, SelectConnectedNodesTaskFactory.class);
SelectFirstNeighborsTaskFactory selectFirstNeighborsTaskFactory = getService(bc, SelectFirstNeighborsTaskFactory.class, "(title=Undirected)");
SelectFirstNeighborsTaskFactory selectFirstNeighborsTaskFactoryInEdge = getService(bc, SelectFirstNeighborsTaskFactory.class, "(title=Directed: Incoming)");
SelectFirstNeighborsTaskFactory selectFirstNeighborsTaskFactoryOutEdge = getService(bc, SelectFirstNeighborsTaskFactory.class, "(title=Directed: Outgoing)");
DeselectAllTaskFactory deselectAllTaskFactory = getService(bc, DeselectAllTaskFactory.class);
DeselectAllEdgesTaskFactory deselectAllEdgesTaskFactory = getService(bc, DeselectAllEdgesTaskFactory.class);
DeselectAllNodesTaskFactory deselectAllNodesTaskFactory = getService(bc, DeselectAllNodesTaskFactory.class);
InvertSelectedEdgesTaskFactory invertSelectedEdgesTaskFactory = getService(bc, InvertSelectedEdgesTaskFactory.class);
InvertSelectedNodesTaskFactory invertSelectedNodesTaskFactory = getService(bc, InvertSelectedNodesTaskFactory.class);
SelectFromFileListTaskFactory selectFromFileListTaskFactory = getService(bc, SelectFromFileListTaskFactory.class);
SelectFirstNeighborsNodeViewTaskFactory selectFirstNeighborsNodeViewTaskFactory = getService(bc, SelectFirstNeighborsNodeViewTaskFactory.class);
HideSelectedTaskFactory hideSelectedTaskFactory = getService(bc, HideSelectedTaskFactory.class);
HideSelectedNodesTaskFactory hideSelectedNodesTaskFactory = getService(bc, HideSelectedNodesTaskFactory.class);
HideSelectedEdgesTaskFactory hideSelectedEdgesTaskFactory = getService(bc, HideSelectedEdgesTaskFactory.class);
UnHideAllTaskFactory unHideAllTaskFactory = getService(bc, UnHideAllTaskFactory.class);
UnHideAllNodesTaskFactory unHideAllNodesTaskFactory = getService(bc, UnHideAllNodesTaskFactory.class);
UnHideAllEdgesTaskFactory unHideAllEdgesTaskFactory = getService(bc, UnHideAllEdgesTaskFactory.class);
NewEmptyNetworkViewFactory newEmptyNetworkTaskFactory = getService(bc, NewEmptyNetworkViewFactory.class);
CloneNetworkTaskFactory cloneNetworkTaskFactory = getService(bc, CloneNetworkTaskFactory.class);
NewNetworkSelectedNodesAndEdgesTaskFactory newNetworkSelectedNodesEdgesTaskFactory = getService(bc, NewNetworkSelectedNodesAndEdgesTaskFactory.class);
NewNetworkSelectedNodesOnlyTaskFactory newNetworkSelectedNodesOnlyTaskFactory = getService(bc, NewNetworkSelectedNodesOnlyTaskFactory.class);
DestroyNetworkTaskFactory destroyNetworkTaskFactory = getService(bc, DestroyNetworkTaskFactory.class);
DestroyNetworkViewTaskFactory destroyNetworkViewTaskFactory = getService(bc, DestroyNetworkViewTaskFactory.class);
NewSessionTaskFactory newSessionTaskFactory = getService(bc, NewSessionTaskFactory.class);
OpenSessionTaskFactory openSessionTaskFactory = getService(bc, OpenSessionTaskFactory.class);
SaveSessionAsTaskFactory saveSessionAsTaskFactory = getService(bc, SaveSessionAsTaskFactory.class);
EditNetworkTitleTaskFactory editNetworkTitleTaskFactory = getService(bc, EditNetworkTitleTaskFactory.class);
CreateNetworkViewTaskFactory createNetworkViewTaskFactory = getService(bc, CreateNetworkViewTaskFactory.class);
ExportNetworkImageTaskFactory exportNetworkImageTaskFactory = getService(bc, ExportNetworkImageTaskFactory.class);
ExportNetworkViewTaskFactory exportNetworkViewTaskFactory = getService(bc, ExportNetworkViewTaskFactory.class);
ExportSelectedTableTaskFactory exportSelectedTableTaskFactory = getService(bc, ExportSelectedTableTaskFactory.class);
ExportTableTaskFactory exportTableTaskFactory = getService(bc, ExportTableTaskFactory.class);
ApplyPreferredLayoutTaskFactory applyPreferredLayoutTaskFactory = getService(bc, ApplyPreferredLayoutTaskFactory.class);
DeleteColumnTaskFactory deleteColumnTaskFactory = getService(bc, DeleteColumnTaskFactory.class);
RenameColumnTaskFactory renameColumnTaskFactory = getService(bc, RenameColumnTaskFactory.class);
DeleteTableTaskFactory deleteTableTaskFactory = getService(bc, DeleteTableTaskFactory.class);
ExportVizmapTaskFactory exportVizmapTaskFactory = getService(bc, ExportVizmapTaskFactory.class);
ConnectSelectedNodesTaskFactory connectSelectedNodesTaskFactory = getService(bc, ConnectSelectedNodesTaskFactory.class);
MapGlobalToLocalTableTaskFactory mapGlobal = getService(bc, MapGlobalToLocalTableTaskFactory.class);
ApplyVisualStyleTaskFactory applyVisualStyleTaskFactory = getService(bc, ApplyVisualStyleTaskFactory.class);
MapTableToNetworkTablesTaskFactory mapNetworkAttrTaskFactory = getService(bc, MapTableToNetworkTablesTaskFactory.class);
GroupNodesTaskFactory groupNodesTaskFactory = getService(bc, GroupNodesTaskFactory.class);
UnGroupTaskFactory unGroupTaskFactory = getService(bc, UnGroupTaskFactory.class);
CollapseGroupTaskFactory collapseGroupTaskFactory = getService(bc, CollapseGroupTaskFactory.class);
ExpandGroupTaskFactory expandGroupTaskFactory = getService(bc, ExpandGroupTaskFactory.class);
UnGroupNodesTaskFactory unGroupNodesTaskFactory = getService(bc, UnGroupNodesTaskFactory.class);
// End of core-task services
// Command execution services
CommandExecutorTaskFactory cyCommandExecutorTaskFactory = getService(bc, CommandExecutorTaskFactory.class);
AvailableCommands availableCommands = getService(bc, AvailableCommands.class);
StreamUtil streamUtilServiceRef = getService(bc, StreamUtil.class);
FileUtil fileUtilServiceRef = getService(bc, FileUtil.class);
CySwingAppAdapter cyAppAdapter = new CyAppAdapterImpl(cyApplicationConfigurationRef, cyApplicationManagerRef, cyEventHelperRef, cyGroupAggregationManagerRef, cyGroupFactoryRef, cyGroupManagerRef, cyLayoutAlgorithmManagerRef, cyNetworkFactoryRef, cyNetworkManagerRef, cyNetworkViewFactoryRef, cyNetworkViewManagerRef, cyNetworkViewReaderManagerRef, cyNetworkViewWriterManagerRef, cyPropertyRef, cyPropertyReaderManagerRef, cyPropertyWriterManagerRef, cyRootNetworkFactoryRef, serviceRegistrar, cySessionManagerRef, cySessionReaderManagerRef, cySessionWriterManagerRef, cySwingApplicationRef, cyTableFactoryRef, cyTableManagerRef, cyTableReaderManagerRef, cyTableWriterManagerRef, cytoscapeVersionService, dialogTaskManagerRef, panelTaskManagerRef, presentationWriterManagerRef, renderingEngineManagerRef, taskManagerRef, undoSupportRef, tunablePropertySerializerFactoryRef, vmfFactoryC, vmfFactoryD, vmfFactoryP, visualMappingManagerRef, visualStyleFactoryRef, dataSourceManager, // from core-task-api
loadVizmapFileTaskFactory, loadNetworkFileTaskFactory, loadNetworkURLTaskFactory, deleteSelectedNodesAndEdgesTaskFactory, selectAllTaskFactory, selectAllEdgesTaskFactory, selectAllNodesTaskFactory, selectAdjacentEdgesTaskFactory, selectConnectedNodesTaskFactory, selectFirstNeighborsTaskFactory, selectFirstNeighborsTaskFactoryInEdge, selectFirstNeighborsTaskFactoryOutEdge, deselectAllTaskFactory, deselectAllEdgesTaskFactory, deselectAllNodesTaskFactory, invertSelectedEdgesTaskFactory, invertSelectedNodesTaskFactory, selectFromFileListTaskFactory, selectFirstNeighborsNodeViewTaskFactory, hideSelectedTaskFactory, hideSelectedNodesTaskFactory, hideSelectedEdgesTaskFactory, unHideAllTaskFactory, unHideAllNodesTaskFactory, unHideAllEdgesTaskFactory, newEmptyNetworkTaskFactory, cloneNetworkTaskFactory, newNetworkSelectedNodesEdgesTaskFactory, newNetworkSelectedNodesOnlyTaskFactory, destroyNetworkTaskFactory, destroyNetworkViewTaskFactory, newSessionTaskFactory, openSessionTaskFactory, saveSessionAsTaskFactory, editNetworkTitleTaskFactory, createNetworkViewTaskFactory, exportNetworkImageTaskFactory, exportNetworkViewTaskFactory, exportSelectedTableTaskFactory, exportTableTaskFactory, applyPreferredLayoutTaskFactory, deleteColumnTaskFactory, renameColumnTaskFactory, deleteTableTaskFactory, exportVizmapTaskFactory, connectSelectedNodesTaskFactory, mapGlobal, applyVisualStyleTaskFactory, mapNetworkAttrTaskFactory, groupNodesTaskFactory, unGroupTaskFactory, collapseGroupTaskFactory, expandGroupTaskFactory, unGroupNodesTaskFactory, cyCommandExecutorTaskFactory, availableCommands);
registerService(bc, cyAppAdapter, CyAppAdapter.class);
registerService(bc, cyAppAdapter, CySwingAppAdapter.class);
WebQuerier webQuerier = new WebQuerier(streamUtilServiceRef, cytoscapeVersionService);
registerService(bc, webQuerier, WebQuerier.class);
StartLevel startLevel = getService(bc, StartLevel.class);
// Instantiate new manager
final AppManager appManager = new AppManager(cyAppAdapter, cyApplicationConfigurationServiceRef, cytoscapeVersionService, cyEventHelperRef, webQuerier, startLevel, bc);
registerService(bc, appManager, AppManager.class);
bc.addFrameworkListener(appManager);
final DownloadSitesManager downloadSitesManager = new DownloadSitesManager(cyPropertyRef);
final UpdateManager updateManager = new UpdateManager(appManager, downloadSitesManager);
registerService(bc, updateManager, AppsFinishedStartingListener.class);
final AppConflictHandlerFactory appConflictHandlerFactory = new AppConflictHandlerFactory();
registerService(bc, appConflictHandlerFactory, GUITunableHandlerFactory.class);
// AbstractCyAction implementation for updated app manager
AppManagerAction appManagerAction = new AppManagerAction(appManager, downloadSitesManager, updateManager, cySwingApplicationRef, fileUtilServiceRef, dialogTaskManagerRef, serviceRegistrar);
registerService(bc, appManagerAction, CyAction.class);
// Show citations dialog
final CitationsAction citationsAction = new CitationsAction(webQuerier, appManager, serviceRegistrar);
registerService(bc, citationsAction, CyAction.class);
// Start local server that reports app installation status to the app store when requested,
// also able to install an app when told by the app store
final AppGetResponder appGetResponder = new AppGetResponder(appManager, cytoscapeVersionService);
final CyHttpd httpd = (new CyHttpdFactoryImpl()).createHttpd(new LocalhostServerSocketFactory(2607));
httpd.addBeforeResponse(new ScreenOriginsBeforeResponse(WebQuerier.DEFAULT_APP_STORE_URL));
httpd.addBeforeResponse(new OriginOptionsBeforeResponse("x-csrftoken"));
httpd.addAfterResponse(new AddAllowOriginHeader());
httpd.addResponder(appGetResponder.new StatusResponder());
httpd.addResponder(appGetResponder.new InstallResponder());
httpd.start();
// Special case: handle yFiles app options
final OpenBrowser openBrowser = getService(bc, OpenBrowser.class);
YFilesChecker checker = new YFilesChecker(appManager, serviceRegistrar, openBrowser);
bc.addBundleListener(checker);
registerAllServices(bc, checker, new Properties());
{
AppStoreTaskFactory factory = new AppStoreTaskFactory(appManager, serviceRegistrar);
Properties props = new Properties();
props.setProperty(COMMAND_NAMESPACE, "apps");
props.setProperty(COMMAND, "open appstore");
props.setProperty(COMMAND_DESCRIPTION, "Open the app store page for an app");
props.setProperty(COMMAND_LONG_DESCRIPTION, "Open the app store page for an app.");
props.setProperty(COMMAND_SUPPORTS_JSON, "true");
props.setProperty(COMMAND_EXAMPLE_JSON, "{}");
registerService(bc, factory, TaskFactory.class, props);
}
{
DisableTaskFactory factory = new DisableTaskFactory(appManager);
Properties props = new Properties();
props.setProperty(COMMAND_NAMESPACE, "apps");
props.setProperty(COMMAND, "disable");
props.setProperty(COMMAND_DESCRIPTION, "Disable an app");
props.setProperty(COMMAND_LONG_DESCRIPTION, "Disable a currently installed app.");
props.setProperty(COMMAND_SUPPORTS_JSON, "true");
props.setProperty(COMMAND_EXAMPLE_JSON, "{\"appName\": \"appname\"}");
registerService(bc, factory, TaskFactory.class, props);
}
{
EnableTaskFactory factory = new EnableTaskFactory(appManager);
Properties props = new Properties();
props.setProperty(COMMAND_NAMESPACE, "apps");
props.setProperty(COMMAND, "enable");
props.setProperty(COMMAND_DESCRIPTION, "Enable a disabled app");
props.setProperty(COMMAND_LONG_DESCRIPTION, "Enable a currently disabled app.");
props.setProperty(COMMAND_SUPPORTS_JSON, "true");
props.setProperty(COMMAND_EXAMPLE_JSON, "{\"appName\": \"appname\"}");
registerService(bc, factory, TaskFactory.class, props);
}
{
InformationTaskFactory factory = new InformationTaskFactory(appManager);
Properties props = new Properties();
props.setProperty(COMMAND_NAMESPACE, "apps");
props.setProperty(COMMAND, "information");
props.setProperty(COMMAND_DESCRIPTION, "Get app information");
props.setProperty(COMMAND_LONG_DESCRIPTION, "Get information about an app.");
props.setProperty(COMMAND_SUPPORTS_JSON, "true");
props.setProperty(COMMAND_EXAMPLE_JSON, "{\"appName\": \"appname\"" + ", \"description\": \"App description\"" + ", \"version\": \"1.2.2\"}");
registerService(bc, factory, TaskFactory.class, props);
}
{
InstallTaskFactory factory = new InstallTaskFactory(appManager);
Properties props = new Properties();
props.setProperty(COMMAND_NAMESPACE, "apps");
props.setProperty(COMMAND, "install");
props.setProperty(COMMAND_DESCRIPTION, "Install an app");
props.setProperty(COMMAND_LONG_DESCRIPTION, "Install an app given an app name or file.");
props.setProperty(COMMAND_SUPPORTS_JSON, "true");
props.setProperty(COMMAND_EXAMPLE_JSON, "{}");
registerService(bc, factory, TaskFactory.class, props);
}
{
ListAvailableTaskFactory factory = new ListAvailableTaskFactory(appManager);
Properties props = new Properties();
props.setProperty(COMMAND_NAMESPACE, "apps");
props.setProperty(COMMAND, "list available");
props.setProperty(COMMAND_DESCRIPTION, "List the available apps");
props.setProperty(COMMAND_LONG_DESCRIPTION, "Return a list of the available apps in the app store");
props.setProperty(COMMAND_SUPPORTS_JSON, "true");
props.setProperty(COMMAND_EXAMPLE_JSON, "[{\"appName\":\"name\", " + "\"description\":\"descriptions\", " + "\"details\":\"app details\"}]");
registerService(bc, factory, TaskFactory.class, props);
}
{
ListAppsTaskFactory factory = new ListAppsTaskFactory(appManager, AppStatus.DISABLED);
Properties props = new Properties();
props.setProperty(COMMAND_NAMESPACE, "apps");
props.setProperty(COMMAND, "list disabled");
props.setProperty(COMMAND_DESCRIPTION, "List the disabled apps");
props.setProperty(COMMAND_LONG_DESCRIPTION, "Return a list of the disabled apps in the current installation.");
props.setProperty(COMMAND_SUPPORTS_JSON, "true");
props.setProperty(COMMAND_EXAMPLE_JSON, "[{ \"appName\": \"appname\"," + "\"version\": \"1.1.0\"," + "\"description\": \"descriptions\"," + "\"status\": \"Disabled\"}]");
registerService(bc, factory, TaskFactory.class, props);
}
{
ListAppsTaskFactory factory = new ListAppsTaskFactory(appManager, AppStatus.INSTALLED);
Properties props = new Properties();
props.setProperty(COMMAND_NAMESPACE, "apps");
props.setProperty(COMMAND, "list installed");
props.setProperty(COMMAND_DESCRIPTION, "List the installed apps");
props.setProperty(COMMAND_LONG_DESCRIPTION, "Return a list of the installed apps in the current installation.");
props.setProperty(COMMAND_SUPPORTS_JSON, "true");
props.setProperty(COMMAND_EXAMPLE_JSON, "[{\"appName\": \"appname\"," + "\"version\": \"1.1.0\"," + "\"description\": \"descriptions\"," + "\"status\": \"Installed\"}]");
registerService(bc, factory, TaskFactory.class, props);
}
{
ListAppsTaskFactory factory = new ListAppsTaskFactory(appManager, AppStatus.UNINSTALLED);
Properties props = new Properties();
props.setProperty(COMMAND_NAMESPACE, "apps");
props.setProperty(COMMAND, "list uninstalled");
props.setProperty(COMMAND_DESCRIPTION, "List the uninstalled apps");
props.setProperty(COMMAND_LONG_DESCRIPTION, "Return a list of the uninstalled apps in the current installation.");
props.setProperty(COMMAND_SUPPORTS_JSON, "true");
props.setProperty(COMMAND_EXAMPLE_JSON, "[{ \"appName\": \"appname\"," + "\"version\": \"1.1.0\"," + "\"description\": \"descriptions\"," + "\"status\": \"Uninstalled\"}]");
registerService(bc, factory, TaskFactory.class, props);
}
{
ListUpdatesTaskFactory factory = new ListUpdatesTaskFactory(appManager);
Properties props = new Properties();
props.setProperty(COMMAND_NAMESPACE, "apps");
props.setProperty(COMMAND, "list updates");
props.setProperty(COMMAND_DESCRIPTION, "List the apps available for updates");
props.setProperty(COMMAND_LONG_DESCRIPTION, "Return a list of the apps that have updates in the app store.");
props.setProperty(COMMAND_SUPPORTS_JSON, "true");
props.setProperty(COMMAND_EXAMPLE_JSON, "[{ \"appName\": \"appname\"," + "\"version\": \"1.1.10\"," + "\"information\": \"app information\"}]");
registerService(bc, factory, TaskFactory.class, props);
}
{
StatusTaskFactory factory = new StatusTaskFactory(appManager);
Properties props = new Properties();
props.setProperty(COMMAND_NAMESPACE, "apps");
props.setProperty(COMMAND, "status");
props.setProperty(COMMAND_DESCRIPTION, "Get the status of an app");
props.setProperty(COMMAND_LONG_DESCRIPTION, "Get the status of an app.");
props.setProperty(COMMAND_SUPPORTS_JSON, "true");
props.setProperty(COMMAND_EXAMPLE_JSON, "{\"appName\": \"appname\", \"status\": \"Installed\"}");
registerService(bc, factory, TaskFactory.class, props);
}
{
UninstallTaskFactory factory = new UninstallTaskFactory(appManager);
Properties props = new Properties();
props.setProperty(COMMAND_NAMESPACE, "apps");
props.setProperty(COMMAND, "uninstall");
props.setProperty(COMMAND_DESCRIPTION, "Uninstall an app");
props.setProperty(COMMAND_LONG_DESCRIPTION, "Uninstall a currently installed app.");
props.setProperty(COMMAND_SUPPORTS_JSON, "true");
props.setProperty(COMMAND_EXAMPLE_JSON, "{\"appName\": \"appname\"}");
registerService(bc, factory, TaskFactory.class, props);
}
{
UpdateTaskFactory factory = new UpdateTaskFactory(appManager, updateManager);
Properties props = new Properties();
props.setProperty(COMMAND_NAMESPACE, "apps");
props.setProperty(COMMAND, "update");
props.setProperty(COMMAND_DESCRIPTION, "Update an app or all apps");
props.setProperty(COMMAND_LONG_DESCRIPTION, "Update an app or all apps.");
props.setProperty(COMMAND_SUPPORTS_JSON, "true");
props.setProperty(COMMAND_EXAMPLE_JSON, "{}");
registerService(bc, factory, TaskFactory.class, props);
}
}
Aggregations