use of org.apache.maven.model.MailingList in project archiva by apache.
the class Maven2RepositoryStorage method convertMailingLists.
private List<org.apache.archiva.metadata.model.MailingList> convertMailingLists(List<MailingList> mailingLists) {
List<org.apache.archiva.metadata.model.MailingList> l = new ArrayList<>();
for (MailingList mailingList : mailingLists) {
org.apache.archiva.metadata.model.MailingList newMailingList = new org.apache.archiva.metadata.model.MailingList();
newMailingList.setName(mailingList.getName());
newMailingList.setMainArchiveUrl(mailingList.getArchive());
newMailingList.setPostAddress(mailingList.getPost());
newMailingList.setSubscribeAddress(mailingList.getSubscribe());
newMailingList.setUnsubscribeAddress(mailingList.getUnsubscribe());
newMailingList.setOtherArchives(mailingList.getOtherArchives());
l.add(newMailingList);
}
return l;
}
use of org.apache.maven.model.MailingList in project maven-plugins by apache.
the class MavenJDOMWriter method iterateMailingList.
// -- void iterateLicense(Counter, Element, java.util.Collection, java.lang.String, java.lang.String)
/**
* Method iterateMailingList
*
* @param counter
* @param childTag
* @param parentTag
* @param list
* @param parent
*/
protected void iterateMailingList(Counter counter, Element parent, Collection<MailingList> list, java.lang.String parentTag, java.lang.String childTag) {
boolean shouldExist = list != null && list.size() > 0;
Element element = updateElement(counter, parent, parentTag, shouldExist);
if (shouldExist) {
Iterator<?> elIt = element.getChildren(childTag, element.getNamespace()).iterator();
if (!elIt.hasNext()) {
elIt = null;
}
Counter innerCount = new Counter(counter.getDepth() + 1);
for (MailingList value : list) {
Element el;
if (elIt != null && elIt.hasNext()) {
el = (Element) elIt.next();
if (!elIt.hasNext()) {
elIt = null;
}
} else {
el = factory.element(childTag, element.getNamespace());
insertAtPreferredLocation(element, el, innerCount);
}
updateMailingList(value, childTag, innerCount, el);
innerCount.increaseCount();
}
if (elIt != null) {
while (elIt.hasNext()) {
elIt.next();
elIt.remove();
}
}
}
}
use of org.apache.maven.model.MailingList in project maven-archetype by apache.
the class MavenJDOMWriter method iterateMailingList.
// -- void iterateLicense(Counter, Element, java.util.Collection, java.lang.String,
// java.lang.String)
/**
* Method iterateMailingList.
*
* @param counter
* @param childTag
* @param parentTag
* @param list
* @param parent
*/
protected void iterateMailingList(Counter counter, Element parent, java.util.Collection list, java.lang.String parentTag, java.lang.String childTag) {
boolean shouldExist = (list != null) && (list.size() > 0);
Element element = updateElement(counter, parent, parentTag, shouldExist);
if (shouldExist) {
Iterator it = list.iterator();
Iterator elIt = element.getChildren(childTag, element.getNamespace()).iterator();
if (!elIt.hasNext()) {
elIt = null;
}
Counter innerCount = new Counter(counter.getDepth() + 1);
while (it.hasNext()) {
MailingList value = (MailingList) it.next();
Element el;
if ((elIt != null) && elIt.hasNext()) {
el = (Element) elIt.next();
if (!elIt.hasNext()) {
elIt = null;
}
} else {
el = factory.element(childTag, element.getNamespace());
insertAtPreferredLocation(element, el, innerCount);
}
updateMailingList(value, childTag, innerCount, el);
innerCount.increaseCount();
}
if (elIt != null) {
while (elIt.hasNext()) {
elIt.next();
elIt.remove();
}
}
}
}
Aggregations