public void showElementPart(String id, String partType) { try { CatalogObjectPart<String> part = catalogFacade.getPart(new YaddaObjectID(id), partType, null); if (part == null) { os.println("Part doesn't exist"); } else { os.println(part.getData()); } } catch (CatalogException e) { e.printStackTrace(os); } }
elementId = request.getParameter("id"); CatalogObjectPart<String> part = catalogFacade.getPart( new YaddaObjectID(elementId), partName, null);
private ModelAndView showElementInfo(String elementId, String partId, String format) { Map<String, Object> model = new HashMap<String, Object>(); try { CatalogObject<String> object = catalogFacade .getObject(new YaddaObjectID(elementId, null, null)); model.put("objectData", object); if (object != null && StringUtils.isNotBlank(partId)) { CatalogObjectPart<String> part = catalogFacade.getPart( object.getId(), partId, null); if (part != null && part.getData() != null) { model.put("partId", part.getType()); model.put("part", part.getData()); } else { model.put("part", ""); } } } catch (CatalogException e) { throw new SystemException(Modules.CATALOG, e.getMessage(), e); } ModelAndView mdv; if (format != null && format.equals("raw")) { mdv = new ModelAndView(rawView, "catalog", model); } else { mdv = new ModelAndView(catalogView, "catalog", model); } return mdv; }
Ancestor currentAncestor = ancestorsIterator.next(); CatalogObjectPart<String> aclPart = catalogFacade.getPart( new YaddaObjectID(currentAncestor.getExtid()), ACLConstants.ACL_PART_NAME, null);
throws ACLProviderException { try { CatalogObjectPart<String> ancestorsPart = catalogFacade.getPart( source, CatalogParamConstants.TYPE_ELEMENT_ANCESTORS3, null); if (ancestorsPart!=null && ancestorsPart.getData()!=null) { for (Ancestor currentAncestor : currentHierAncestors) { CatalogObjectPart<String> aclPart = catalogFacade.getPart( new YaddaObjectID(currentAncestor.getExtid()), ACLConstants.ACL_PART_NAME, null);
private void retrieveNext() { while (metaIterator.hasNext()) { CatalogObjectMeta meta = metaIterator.next(); if (meta.getStatus().isDeleted()) continue; try { CatalogObjectPart<String> bwmetaPart = catalogFacade.getPart(meta.getId(), CatalogParamConstants.TYPE_BWMETA1, null); nextObject = bwmetaPart.getData(); } catch (CatalogException e) { throw new RuntimeException("CatalogException while retrieving next bwmeta from catalog", e); } return; } nextObject = null; }
catalogFacade.getPart(item.getId(), PART_TYPE_GROUP, null);
protected Object[] readElement(final String extId) throws YaddaException { try { final CatalogObjectPart<String> part = catalogFacade.getPart(new YaddaObjectID(extId), CatalogParamConstants.TYPE_BWMETA1, null); final CatalogObjectPart<String> childrenPart = catalogFacade.getPart(new YaddaObjectID(extId), CatalogParamConstants.TYPE_ELEMENT_CHILDREN3, null); // final ElementTreeNode part = (ElementTreeNode) getPart(); // if (part != null && part instanceof ElementTreeNode) { // for (final Set<ElementTreeNode> childrenOfHierarchy : // part.getChildren().values()) { // children.addAll(childrenOfHierarchy); // } // } boolean hasChildren = false; if (childrenPart != null && childrenPart.getData() != null) { final ElementTreeNode childrenPartData = (ElementTreeNode) serializers.get( CatalogParamConstants.TYPE_ELEMENT_CHILDREN3).toObject(extId, childrenPart.getData()); hasChildren = hasChildren(childrenPartData); } if (part != null) { return new Object[] { (Element) serializers.get(CatalogParamConstants.TYPE_BWMETA1).toObject(extId, part.getData()), part.getTimestamp(), hasChildren }; } else { return null; } } catch (final Exception ex) { throw new YaddaException(ex); } }
@Override public IACLObject provideACL(YaddaObjectID source) throws ACLProviderException { String collectionTag = findCollectionTagInCatalog(source); if (collectionTag!=null) { String collExtId = getCollectionExtId(collectionTag); try { CatalogObjectPart<String> part = catalogFacade.getPart( new YaddaObjectID(collExtId), ACLConstants.ACL_PART_NAME, null); if (part!=null && part.getData()!=null) { return new SingleACLObject(part.getData()); } else { log.warn("no ACL part found for collection: " + collExtId); return null; } } catch (CatalogException e) { throw new ACLProviderException("exception occured when geting " + "ACL part for collection: " + collExtId, e); } } else { // TODO should we allow that or throw an exception? log.warn("co ACL could be retrieved: " + "no collection tag found for object: " + source); return null; } }
BuiltInFunction multiHierCombinationAlg = provideFunction( multipleHierarchiesEvaluatableCombiningAlgorithm); CatalogObjectPart<String> ancestorsPart = catalogFacade.getPart( new YaddaObjectID(extId), CatalogParamConstants.TYPE_ELEMENT_ANCESTORS3, null);
/** * Initializes memory copy of users directory */ protected void fetchUsers() throws CatalogException { List<CatalogObjectMeta> userObjects = catalogFacade.listObjects(new String[]{PART_TYPE_USER}, null, null, null, false); for (CatalogObjectMeta item : userObjects) { if (!item.getStatus().isDeleted()) { CatalogObjectPart<String> part = catalogFacade.getPart(item.getId(), PART_TYPE_USER, null); User user = (User)serializer.toObject(item.getId().getId(), part.getData()); usersByLogin.put(user.getLogin(), user); usersById.put(user.getExtId(), user); } } }
/** * Initializes memory copy of roles directory * @throws CatalogException */ protected void fetchRoles() throws CatalogException { List<CatalogObjectMeta> roleObjects = catalogFacade.listObjects(new String[]{PART_TYPE_ROLE}, null, null, null, false); for (CatalogObjectMeta item : roleObjects) { if (!item.getStatus().isDeleted()) { CatalogObjectPart<String> part = catalogFacade.getPart(item.getId(), PART_TYPE_ROLE, null); Role role = (Role)serializer.toObject(item.getId().getId(), part.getData()); roles.put(role.getExtId(), role); } } }
protected Ancestors get(final String key, final Map<String, Ancestors> ancestorsToWrite) throws YaddaException { Ancestors result = ancestorsToWrite.get(key); if (result != null) { return result; } try { result = (Ancestors) cache.getFromCache(key); } catch (final NeedsRefreshException e) { result = null; try { final CatalogObjectPart<String> part = catalogFacade.getPart(new YaddaObjectID(key), CatalogParamConstants.TYPE_ELEMENT_ANCESTORS3, null); if (part != null) { result = (Ancestors) serializers.get(CatalogParamConstants.TYPE_ELEMENT_ANCESTORS3).toObject(key, part.getData()); } if (result == null) { cache.cancelUpdate(key); return null; } else { cache.putInCache(key, result); return result; } } catch (final Exception ex) { cache.cancelUpdate(key); throw new YaddaException(ex); } } return result; }
private void findObject(Identified ified) { DuplicatesPackPreprocessorStats localStats = (DuplicatesPackPreprocessorStats) stats; if (ified instanceof Element) { if (!ID_LEVEL_JOURNAL_JOURNAL.equals(((Element) ified).getLevelId(ID_HIERARACHY_JOURNAL))) { return; } } try { CatalogObject<String> co = catalogFacade.getObject(new YaddaObjectID((ified).getExtId())); if (co != null) { CatalogObjectPart<String> part = catalogFacade.getPart(new YaddaObjectID((ified).getExtId()), BWMETA1, null); if (part != null) { Identified existingElement = (Identified) reader105.read(part.getData()).get(0); if (!existingElement.getName().equals(ified.getName())) { // the name has changed localStats.duplicateFound(existingElement.getName(), ified.getName()); } } } } catch (Exception e) { log.warn("Exception caught", e); } stats = localStats; }
BuiltInFunction combinationAlg = provideFunction( hierarchyEvaluatableCombiningAlgorithm); CatalogObjectPart<String> ancestorsPart = catalogFacade.getPart( new YaddaObjectID(extId), CatalogParamConstants.TYPE_ELEMENT_ANCESTORS3, null);
if (typedCtxPathDTO.isExtId()) { CatalogObjectPart<String> catalogObjectPart = catalogFacade.getPart( new YaddaObjectID(typedCtxPathDTO.getField()), typedCtxPathDTO.getType(), null); CatalogObjectPart<String> catalogObjectPart = null; if (meta.getId()!=null && meta.getId().getId()!=null) { catalogObjectPart = catalogFacade.getPart( new YaddaObjectID(meta.getId().getId()), typedCtxPathDTO.getType(), null);
CatalogObjectPart<String> part=catalogFacade.getPart(new YaddaObjectID(user.getExtId()), "USER", null); if(part==null) { super.storeUser(user); CatalogObjectPart<String> partGroup=catalogFacade.getPart(new YaddaObjectID(group.getExtId()), "GROUP", null); if(partGroup==null) { log.warn("Error! Group with id '"+group.getExtId()+"' does not exist!");
String collExtId = getCollectionExtId(collectionTag); try { CatalogObjectPart<String> part = catalogFacade.getPart( new YaddaObjectID(collExtId), ACLConstants.ACL_PART_NAME, null); if (part!=null && part.getData()!=null) {
CatalogObjectPart<String> part=catalogFacade.getPart(new YaddaObjectID(group.getExtId()), "GROUP", null); List<ExternalReference<User>> users=null; String name=null; CatalogObjectPart<String> user=catalogFacade.getPart(new YaddaObjectID(obj.getExtId()), "USER", null); if(user==null) { log.error("Error! User with id '"+obj.getExtId()+"' does not exist!"); CatalogObjectPart<String> user=catalogFacade.getPart(new YaddaObjectID(obj.getExtId()), "USER", null); if(user==null) { log.error("Error! User with id '"+obj.getExtId()+"' does not exist!"); CatalogObjectPart<String> user=catalogFacade.getPart(new YaddaObjectID(obj.getExtId()), "USER", null); if(user==null) { log.error("Error! User with id '"+obj.getExtId()+"' does not exist!");