RegistryConstants.PATH_SEPARATOR + RegistryConstants .AXIS2_CONF_COLLECTION_NAME; CollectionImpl confCollection = new CollectionImpl(); confCollection.setPath(confPath); confCollection.setMediaType(RegistryConstants.AXIS2_CONF_COLLECTION_MEDIA_TYPE); requestContext.getRegistry().put(confPath, confCollection); RegistryConstants.PATH_SEPARATOR + RegistryConstants .AXIS2_SERVICES_COLLECTION_NAME; CollectionImpl servicesCollection = new CollectionImpl(); servicesCollection.setPath(servicesPath); servicesCollection.setMediaType(RegistryConstants.AXIS2_SERVICES_COLLECTION_MEDIA_TYPE); requestContext.getRegistry().put(servicesPath, servicesCollection); RegistryConstants.PATH_SEPARATOR + RegistryConstants .AXIS2_MODULES_COLLECTION_NAME; CollectionImpl modulesCollection = new CollectionImpl(); modulesCollection.setPath(modulesPath); modulesCollection.setMediaType(RegistryConstants.AXIS2_MODULES_COLLECTION_MEDIA_TYPE); requestContext.getRegistry().put(modulesPath, modulesCollection);
@Override public int getChildCount() throws RegistryException { Object content = getContent(); if (content == null) { return 0; } else { return super.getChildCount(); } }
public boolean isNew() { boolean isNew = false; try { if (resource != null) { isNew = !(resource instanceof Collection) || (((CollectionImpl) resource).getChildren() != null && ((CollectionImpl) resource).getChildren().length == 0); } } catch (Exception e) { isNew = true; } return isNew; }
public Collection newCollection() { return new CollectionImpl(new String[0]); }
collection.setPath(path); if (!mediaType.equals(RegistryConstants.DEFAULT_MEDIA_TYPE)) { collection.setMediaType(mediaType); collection.setDescription(description);
if (collection.getChildCount() != children.length) { if (collection.getChildCount() > 0) { List<String> pathsToDelete = new ArrayList<String>( Arrays.asList(collection.getChildren())); pathsToDelete.removeAll(Arrays.asList(children)); for (String pathToDelete : pathsToDelete) { filesystemManager.getBaseDir().getAbsolutePath(), mountPath); collection.setChildren(children); } else { return new OnDemandResourceImpl(filesystemManager, path, (ResourceImpl) resource);
String[] paths = ((CollectionImpl) registrySession.getUserRegistry().get( RegistryJCRSpecificStandardLoderUtil. getSystemConfigNodeTypePath(registrySession))).getChildren(); nodeTypeTemplate.setName(nodeType.getProperty("name")); if(nodeType.getPropertyValues("declaredSuperTypes") != null) { nodeTypeTemplate.setDeclaredSuperTypeNames(nodeType.getPropertyValues("declaredSuperTypes").toArray(new String[0])); nodeTypeTemplate.setMixin(Boolean.valueOf(nodeType.getProperty("isMixin"))); nodeTypeTemplate.setOrderableChildNodes(Boolean.valueOf(nodeType.getProperty("hasOrderableChildNodes"))); nodeTypeTemplate.setAbstract(Boolean.valueOf(nodeType.getProperty("isAbstract"))); nodeTypeTemplate.setQueryable(Boolean.valueOf(nodeType.getProperty("isQueryable"))); nodeTypeTemplate.setPrimaryItemName(nodeType.getProperty("primaryItemName")); String[] childDefPaths = ((CollectionImpl) registrySession.getUserRegistry().get(childDefRootPath)).getChildren(); String[] propDefPaths = ((CollectionImpl) registrySession.getUserRegistry().get(propDefRootPath)).getChildren();
subCollection.setDescription(ntName); // sets the node type subCollection.setProperty("jcr:uuid", absPath); //Here we use node's path as its identifier subCollection.setProperty("jcr:checkedOut", "true"); subCollection.setProperty("jcr:isCheckedOut", "true"); subCollection.setProperty("jcr:frozenPrimaryType",ntName);
public void initColl(String np) { try { resource = (CollectionImpl) registrySession.getUserRegistry().newCollection(); resource.setPath(np); } catch (RegistryException e) { e.printStackTrace(); } }
public Node storeAsNode(String s) throws ItemExistsException, PathNotFoundException, VersionException, ConstraintViolationException, LockException, UnsupportedRepositoryOperationException, RepositoryException { RegistryNode node = new RegistryNode(s, session); CollectionImpl subCollection = null; try { subCollection = (CollectionImpl) session.getUserRegistry().newCollection(); subCollection.setDescription("nt:query"); session.getUserRegistry().put(s, subCollection); } catch (RegistryException e) { e.printStackTrace(); } node.nodeType = (RegistryNodeType) node.getParent().getPrimaryNodeType(); node.setPrimaryType("nt:query"); // node.nodeType.setNode(node); return node; }
Collection searchResults = new CollectionImpl(); searchResults.setContent(resourcePaths); return searchResults;
try { subCollection = (CollectionImpl) registrySession.getUserRegistry().newCollection(); subCollection.setDescription(ntName); subCollection.setProperty("jcr:uuid", absPath); //Here we use node's path as its identifier subCollection.setProperty("jcr:checkedOut", "true"); subCollection.setProperty("jcr:isCheckedOut", "true"); subCollection.setProperty("jcr:frozenPrimaryType",ntName);
RegistryConstants.PATH_SEPARATOR + RegistryConstants .SYNAPSE_CONF_COLLECTION_NAME; CollectionImpl confCollection = new CollectionImpl(); confCollection.setPath(confPath); confCollection.setMediaType(RegistryConstants.SYNAPSE_CONF_COLLECTION_MEDIA_TYPE); requestContext.getRegistry().put(confPath, confCollection); CollectionImpl seqCollection = new CollectionImpl(); seqCollection.setPath(seqPath); seqCollection.setMediaType(RegistryConstants.SYNAPSE_SEQUENCE_COLLECTION_MEDIA_TYPE); requestContext.getRegistry().put(seqPath, seqCollection); CollectionImpl epCollection = new CollectionImpl(); epCollection.setPath(epPath); epCollection.setMediaType(RegistryConstants.SYNAPSE_ENDPOINT_COLLECTION_MEDIA_TYPE); requestContext.getRegistry().put(epPath, epCollection); CollectionImpl proxyCollection = new CollectionImpl(); proxyCollection.setPath(proxyServicesPath); proxyCollection .setMediaType(RegistryConstants.SYNAPSE_PROXY_SERVICES_COLLECTION_MEDIA_TYPE); requestContext.getRegistry().put(proxyServicesPath, proxyCollection); CollectionImpl tasksCollection = new CollectionImpl(); tasksCollection.setPath(tasksPath); tasksCollection.setMediaType(RegistryConstants.SYNAPSE_TASKS_COLLECTION_MEDIA_TYPE); requestContext.getRegistry().put(tasksPath, tasksCollection); CollectionImpl entryCollection = new CollectionImpl();
Collection lifeCycleConfigurationCollection = new CollectionImpl(); registry.put(RegistryConstants.LIFECYCLE_CONFIGURATION_PATH, lifeCycleConfigurationCollection);
@Override public String[] getChildren(int start, int pageLen) throws RegistryException { Object content = getContent(); if (content == null) { return new String[0]; } else { return super.getChildren(start, pageLen); } }
CollectionImpl collection = (CollectionImpl) appCollection; if (collection.getChildCount() == 0) { if (log.isDebugEnabled()) { log.debug("No more versions of the applications found, removing applications collection from registry"); CollectionImpl collection = (CollectionImpl) providerCollection; if (collection.getChildCount() == 0) { if (log.isDebugEnabled()) { log.debug("No more Applications from the provider " + identifier.getProviderName() + " found. " +
public static String[] getLifecycleList(Registry registry) throws RegistryException{ Collection collection; try { collection = (Collection)registry.get(getContextRoot()); } catch (Exception e) { return null; } if (collection == null) { CollectionImpl lifeCycleCollection = new CollectionImpl(); registry.put(getContextRoot(), lifeCycleCollection); return null; } else { if (collection.getChildCount() == 0) { return null; } String[] childrenList = collection.getChildren(); String[] lifeCycleNameList = new String[collection.getChildCount()]; for (int i = 0; i < childrenList.length; i++) { String path = childrenList[i]; lifeCycleNameList[i] = path.substring(path.lastIndexOf(RegistryConstants.PATH_SEPARATOR) + 1); } return lifeCycleNameList; } }
@Override public String[] getChildren() throws RegistryException { Object content = getContent(); if (content == null) { return new String[0]; } else { return super.getChildren(); } }
if (pathParts.length < 2) { Comment[] comments = getComments(pathParts[0]); Resource resource = new CollectionImpl(); resource.setContent(comments); return resource;
public static void unregisterNodeTypeFromRegistry(RegistrySession registrySession, RegistryNodeTypeManager registryNodeTypeManager, String nodeType) { try { String[] paths = ((CollectionImpl) registrySession.getUserRegistry().get( RegistryJCRSpecificStandardLoderUtil. getSystemConfigNodeTypePath(registrySession))).getChildren(); for (String path : paths) { String name = path.split("/")[path.split("/").length - 1]; if (name.equals(nodeType)) { registrySession.getUserRegistry().delete(path); } } } catch (RegistryException e) { e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates. } }