protected static void editPortletConfig(ActionRequest request, ActionResponse response) throws PortalException, SystemException, ReadOnlyException, IOException, ValidatorException, ParseException
    {
        //Variables init.
        VkPortlet parser = new VkPortlet();
        String ID = "";
        String group = "";
        String previousIDs = "";
        String previousGroupIDs = "";
        String days;
        PortletPreferences portletPreferences = PortletPreferencesFactoryUtil.getPortletSetup(request);
        //Lets get current preferences and get settings from config window.
        previousIDs = portletPreferences.getValue("USERIDS", "");
        previousGroupIDs = portletPreferences.getValue("GROUPIDS", "");
        ID = request.getParameter("ID");
        group = request.getParameter("GROUP");
        if (doNameRequest(ID, false) == null)
            ID = "";
        if (doNameRequest(group, true) == null)
            group = "";
        days = request.getParameter("DAYS");
        //Start to configure. First we will check days-filter parameter.
        if(days.isEmpty())
            days = "14";
        try{Integer.parseInt(days);}
        catch(NumberFormatException e){days = "14";}
        //Check if we need to add somebody. It looks more adequate, than remove.
        if (!ID.isEmpty())
        {
            if (!previousIDs.isEmpty())
                previousIDs += ",";
            previousIDs += ID;
        }
        if (!group.isEmpty())
        {
            if (!previousGroupIDs.isEmpty())
                previousGroupIDs += ",";
            previousGroupIDs += group;
        }
        //Write and save settings.
        portletPreferences.setValue("DAYS", days);
        portletPreferences.setValue("TAGS", request.getParameter("TAGS"));
        portletPreferences.setValue("USERIDS", previousIDs);    
        portletPreferences.setValue("GROUPIDS", previousGroupIDs);    
        portletPreferences.store();
    }