/*******************************************************************************
 * Copyright (c) 2012-2017 Codenvy, S.A.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *   Codenvy, S.A. - initial API and implementation
 *******************************************************************************/
package org.eclipse.che.api.installer.server;

import org.eclipse.che.api.installer.shared.dto.InstallerDto;
import org.eclipse.che.api.installer.shared.model.Installer;

import static org.eclipse.che.dto.server.DtoFactory.newDto;

/**
 * @author Anatolii Bazko
 */
public class DtoConverter {

    public static InstallerDto asDto(Installer installer) {
        return newDto(InstallerDto.class).withId(installer.getId())
                                         .withName(installer.getName())
                                         .withVersion(installer.getVersion())
                                         .withDescription(installer.getDescription())
                                         .withProperties(installer.getProperties())
                                         .withScript(installer.getScript())
                                         .withDependencies(installer.getDependencies());
    }

    private DtoConverter() {}
}

@@ -558,24 +558,93 @@
 er.server;%0A%0A
+import org.eclipse.che.api.core.model.workspace.config.ServerConfig;%0A
 import org.e
@@ -750,24 +750,161 @@
 .Installer;%0A
+import org.eclipse.che.api.workspace.shared.dto.ServerConfigDto;%0A%0Aimport java.util.Map;%0A%0Aimport static java.util.stream.Collectors.toMap;
 %0Aimport stat
@@ -1627,16 +1627,832 @@
 ncies())
+%0A                                         .withServers(installer.getServers()%0A                                                               .entrySet()%0A                                                               .stream()%0A                                                               .collect(toMap(Map.Entry::getKey,%0A                                                                              entry -%3E asDto(entry.getValue()))));%0A    %7D%0A%0A    /** Converts %7B@link ServerConfig%7D to %7B@link ServerConfigDto%7D. */%0A    public static ServerConfigDto asDto(ServerConfig serverConf) %7B%0A        return newDto(ServerConfigDto.class).withPort(serverConf.getPort())%0A                                            .withProtocol(serverConf.getProtocol())%0A                                            .withPath(serverConf.getPath())
 ;%0A    %7D%0A

Add missed server configs to InstallerDto