class ProfileSystemsKtrl extends BaseKontroller {

    private static final Logger log = LoggerFactory.getLogger(ProfileSystemsKtrl.class);

    @Model(name = "profile")
    Profile profile;
    @Model(name = "sortedSet")
    SortedSet sortedSet = new SortedSet();
    @Model(name = "systemSelectId")
    List<Long> systemSelectId = new ArrayList<>();


    public ProfileSystemsKtrl(HttpServletRequest request, HttpServletResponse response) {
        super(request, response);
    }


    @Kontrol(path = "/manage/viewProfileSystems", method = MethodType.GET)
    public String viewProfileSystems() throws ServletException {<FILL_FUNCTION_BODY>}


    @Kontrol(path = "/manage/assignSystemsToProfile", method = MethodType.POST)
    public String assignSystemsToProfile() throws ServletException {

        if (systemSelectId != null) {
            try {
                ProfileSystemsDB.setSystemsForProfile(profile.getId(), systemSelectId);
            } catch (SQLException | GeneralSecurityException ex) {
                log.error(ex.toString(), ex);
                throw new ServletException(ex.toString(), ex);
            }
        }

        RefreshAuthKeyUtil.refreshProfileSystems(profile.getId());
        return "redirect:/manage/viewProfiles.ktrl";
    }


}

        if (profile != null && profile.getId() != null) {
            try {
                profile = ProfileDB.getProfile(profile.getId());
                sortedSet = SystemDB.getSystemSet(sortedSet, profile.getId());
            } catch (SQLException | GeneralSecurityException ex) {
                log.error(ex.toString(), ex);
                throw new ServletException(ex.toString(), ex);
            }
        }

        return "/manage/view_profile_systems.html";
    
<no_super_class>