// Path: src/java/is/idega/idegaweb/egov/citizen/data/CitizenRemoteServices.java
// public interface CitizenRemoteServices extends IDOEntity {
// 	public String getServerName();
// 	public void setServerName(String name);
// 	public String getAddress();
// 	public void setAddress(String address);
// 	public Collection<User> getUsers() throws IDORelationshipException;
// 	public void addUser(User user)  throws IDORelationshipException;
// 	public void removeUser(User user)throws IDORelationshipException;
// }
// 
// Path: src/java/is/idega/idegaweb/egov/citizen/data/CitizenRemoteServicesHome.java
// public interface CitizenRemoteServicesHome extends IDOHome {
// 	public Collection<CitizenRemoteServices> getRemoteServicesByNames(Collection <String> names);
// 	public Collection<CitizenRemoteServices> getRemoteServices(int maxAmount);
// 	public Collection<CitizenRemoteServices> getRemoteServicesByUserId(String userId) throws IDORelationshipException ;
// }


import is.idega.idegaweb.egov.citizen.data.CitizenRemoteServices;
import is.idega.idegaweb.egov.citizen.data.CitizenRemoteServicesHome;
import java.util.Collection;
import java.util.logging.Level;
import java.util.logging.Logger;
import com.idega.data.IDOLookup;
import com.idega.data.IDOLookupException;
import com.idega.idegaweb.IWBundle;
import com.idega.idegaweb.IWResourceBundle;
import com.idega.presentation.Block;
import com.idega.presentation.IWContext;
import com.idega.presentation.Layer;
import com.idega.presentation.ui.DropdownMenu;
import com.idega.presentation.ui.GenericButton;
import com.idega.presentation.ui.HiddenInput;
import com.idega.presentation.ui.Label;
import com.idega.presentation.ui.PasswordInput;
import com.idega.presentation.ui.TextInput;
import com.idega.util.CoreConstants;
import com.idega.util.StringUtil;
		cellInfo.addText(iwrb.getLocalizedString("password", "Password"));
		
		// Remove
		layer = new Layer();
		main.add(layer);
		layer.setStyleClass("formItem");
		GenericButton add = new GenericButton("remove", iwrb.getLocalizedString("remove", "Remove"));
		layer.add(add);
		add.setOnClick("UserAccessSettingsHelper.removeSingleSingOn('#"+main.getId()+ CoreConstants.JS_STR_PARAM_SEPARATOR
				+ loginId+CoreConstants.JS_STR_PARAM_END);
	}
	
	private Layer getDropdownMenuForServices(IWResourceBundle iwrb){
		Layer layer = new Layer();
		layer.setStyleClass("formItem");
		DropdownMenu dropdown = new DropdownMenu();
		dropdown.setName(dropdown.getId());
		dropdown.setStyleClass(addressClass);
		layer.add(dropdown);
		CitizenRemoteServicesHome citizenRemoteServicesHome = null;
		try {
			citizenRemoteServicesHome = (CitizenRemoteServicesHome) IDOLookup.getHome(CitizenRemoteServices.class);
		} catch (IDOLookupException e) {
			Logger.getLogger(this.getClass().getName()).log(Level.WARNING, "failed adding default remote services", e);
			layer = new Layer();
			layer.addText(iwrb.getLocalizedString("failed_getting_remote_services", "Failed getting remote services"));
			return layer;
		}
		Collection<CitizenRemoteServices> services = citizenRemoteServicesHome.getRemoteServices(0);
		dropdown.addMenuElement(CoreConstants.EMPTY,iwrb.getLocalizedString("choose_service", "Choose service"));
// Path: src/java/is/idega/idegaweb/egov/citizen/data/CitizenRemoteServices.java
// public interface CitizenRemoteServices extends IDOEntity {
// 	public String getServerName();
// 	public void setServerName(String name);
// 	public String getAddress();
// 	public void setAddress(String address);
// 	public Collection<User> getUsers() throws IDORelationshipException;
// 	public void addUser(User user)  throws IDORelationshipException;
// 	public void removeUser(User user)throws IDORelationshipException;
// }
// 
// Path: src/java/is/idega/idegaweb/egov/citizen/data/CitizenRemoteServicesHome.java
// public interface CitizenRemoteServicesHome extends IDOHome {
// 	public Collection<CitizenRemoteServices> getRemoteServicesByNames(Collection <String> names);
// 	public Collection<CitizenRemoteServices> getRemoteServices(int maxAmount);
// 	public Collection<CitizenRemoteServices> getRemoteServicesByUserId(String userId) throws IDORelationshipException ;
// }


// Path: src/java/is/idega/idegaweb/egov/citizen/presentation/SingleSingOn.java
import is.idega.idegaweb.egov.citizen.data.CitizenRemoteServices;
import is.idega.idegaweb.egov.citizen.data.CitizenRemoteServicesHome;
import java.util.Collection;
import java.util.logging.Level;
import java.util.logging.Logger;
import com.idega.data.IDOLookup;
import com.idega.data.IDOLookupException;
import com.idega.idegaweb.IWBundle;
import com.idega.idegaweb.IWResourceBundle;
import com.idega.presentation.Block;
import com.idega.presentation.IWContext;
import com.idega.presentation.Layer;
import com.idega.presentation.ui.DropdownMenu;
import com.idega.presentation.ui.GenericButton;
import com.idega.presentation.ui.HiddenInput;
import com.idega.presentation.ui.Label;
import com.idega.presentation.ui.PasswordInput;
import com.idega.presentation.ui.TextInput;
import com.idega.util.CoreConstants;
import com.idega.util.StringUtil;

		cellInfo.addText(iwrb.getLocalizedString("password", "Password"));
		
		// Remove
		layer = new Layer();
		main.add(layer);
		layer.setStyleClass("formItem");
		GenericButton add = new GenericButton("remove", iwrb.getLocalizedString("remove", "Remove"));
		layer.add(add);
		add.setOnClick("UserAccessSettingsHelper.removeSingleSingOn('#"+main.getId()+ CoreConstants.JS_STR_PARAM_SEPARATOR
				+ loginId+CoreConstants.JS_STR_PARAM_END);
	}
	
	private Layer getDropdownMenuForServices(IWResourceBundle iwrb){
		Layer layer = new Layer();
		layer.setStyleClass("formItem");
		DropdownMenu dropdown = new DropdownMenu();
		dropdown.setName(dropdown.getId());
		dropdown.setStyleClass(addressClass);
		layer.add(dropdown);
		CitizenRemoteServicesHome citizenRemoteServicesHome = null;
		try {
			citizenRemoteServicesHome = (CitizenRemoteServicesHome) IDOLookup.getHome(CitizenRemoteServices.class);
		} catch (IDOLookupException e) {
			Logger.getLogger(this.getClass().getName()).log(Level.WARNING, "failed adding default remote services", e);
			layer = new Layer();
			layer.addText(iwrb.getLocalizedString("failed_getting_remote_services", "Failed getting remote services"));
			return layer;
		}
		Collection<CitizenRemoteServices> services = citizenRemoteServicesHome.getRemoteServices(0);
		dropdown.addMenuElement(CoreConstants.EMPTY,iwrb.getLocalizedString("choose_service", "Choose service"));
		for(CitizenRemoteServices service : services){