Project

General

Profile

« Previous | Next » 

Revision 54921

changed implementation of CommunityConfiguration to add the zenodo community associated to the openAIRE communiti to the list of the Zenodo communities. Updated also the test

View differences:

CommunityConfigurationFactory.java
99 99
    }
100 100

  
101 101
    private static List<ZenodoCommunity> parseZenodoCommunities(final Node node) {
102
        final Node oacommunitynode = node.selectSingleNode("./oacommunity");
103
        String oacommunity = null;
104
        if (oacommunitynode != null){
105
            String tmp = oacommunitynode.getText();
106
            if(StringUtils.isNotBlank(tmp))
107
                oacommunity = tmp;
108
        }
102 109

  
110

  
103 111
        final List<Node> list = node.selectNodes("./zenodocommunities/zenodocommunity");
104 112
        final List<ZenodoCommunity> zenodoCommunityList = new ArrayList<>();
105 113
        for(Node n : list){
......
109 117

  
110 118
            zenodoCommunityList.add(zc);
111 119
        }
120
        if(oacommunity != null){
121
            ZenodoCommunity zc = new ZenodoCommunity();
122
            zc.setZenodoCommunityId(oacommunity);
123
            zenodoCommunityList.add(zc);
124
        }
112 125
        log.info("size of the zenodo community list " + zenodoCommunityList.size());
113 126
        return zenodoCommunityList;
114 127
    }

Also available in: Unified diff