public void init(JSONObject jsonObject) throws JSONException { JSONParser parser = new JSONParser(jsonObject); thumbnailPic = parser.getString("thumbnailPic"); albumImg = parser.getString("albumImg"); shdUrl = parser.getString("shdUrl"); uhdVideoSize = parser.getInt("uhdVideoSize"); shdVideoSize = parser.getInt("shdVideoSize"); description = parser.getString("description"); posterPic = parser.getString("posterPic"); title = parser.getString("title"); url = parser.getString("url"); videoSize = parser.getInt("videoSize"); duration = parser.getInt("duration"); uhdUrl = parser.getString("uhdUrl"); artistsList = new ArrayList<Artists>(); JSONArray array0 = parser.getJSONArray("artists"); if (array0 != null) { int length = array0.length(); for (int i = 0; i < length; i++) { Artists obj = new Artists(); obj.init(array0.getJSONObject(i)); artistsList.add(obj); } } regdate = parser.getString("regdate"); artistName = parser.getString("artistName"); id = parser.getInt("id"); hdUrl = parser.getString("hdUrl"); hdVideoSize = parser.getInt("hdVideoSize"); status = parser.getInt("status"); }
@Override protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { List<Artists.ArtistEntry> artists = new ArrayList<>(Artists.getList(req.getServletContext())); artists.sort((a1, a2) -> -1 * Integer.compare(a1.getVotes(), a2.getVotes())); req.setAttribute("artists", artists); req.getRequestDispatcher("/WEB-INF/pages/glasanjeRez.jsp").forward(req, resp); }
/** * This method is called from within the constructor to initialize the form. WARNING: Do NOT * modify this code. The content of this method is always regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jButton1 = new javax.swing.JButton(); menuBar = new javax.swing.JMenuBar(); fileMenu = new javax.swing.JMenu(); Artists = new javax.swing.JMenuItem(); Groups = new javax.swing.JMenuItem(); AlbumGroup = new javax.swing.JMenuItem(); AlbumAstist = new javax.swing.JMenuItem(); editMenu = new javax.swing.JMenu(); helpMenu = new javax.swing.JMenu(); aboutMenuItem = new javax.swing.JMenuItem(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); jButton1.setText("Έξοδος"); jButton1.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton1ActionPerformed(evt); } }); fileMenu.setMnemonic('f'); fileMenu.setText("Διαχείριση Αρχείων"); fileMenu.setToolTipText(""); Artists.setMnemonic('o'); Artists.setText("Καλλιτέχνες"); Artists.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { ArtistsActionPerformed(evt); } }); fileMenu.add(Artists); Groups.setMnemonic('s'); Groups.setText("Συγκροτήματα"); Groups.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { GroupsActionPerformed(evt); } }); fileMenu.add(Groups); AlbumGroup.setMnemonic('a'); AlbumGroup.setText("Αλμπουμ Συγκροοτημάτων"); AlbumGroup.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { AlbumGroupActionPerformed(evt); } }); fileMenu.add(AlbumGroup); AlbumAstist.setMnemonic('x'); AlbumAstist.setText("Αλμπουμ Καλλιτεχνών"); AlbumAstist.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { AlbumAstistActionPerformed(evt); } }); fileMenu.add(AlbumAstist); menuBar.add(fileMenu); editMenu.setMnemonic('e'); editMenu.setText("Λίστες Τραγουδιών"); menuBar.add(editMenu); helpMenu.setMnemonic('h'); helpMenu.setText("Help"); aboutMenuItem.setMnemonic('a'); aboutMenuItem.setText("About"); aboutMenuItem.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { aboutMenuItemActionPerformed(evt); } }); helpMenu.add(aboutMenuItem); menuBar.add(helpMenu); setJMenuBar(menuBar); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( javax.swing.GroupLayout.Alignment.TRAILING, layout .createSequentialGroup() .addContainerGap(393, Short.MAX_VALUE) .addComponent(jButton1) .addContainerGap())); layout.setVerticalGroup( layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( javax.swing.GroupLayout.Alignment.TRAILING, layout .createSequentialGroup() .addContainerGap(225, Short.MAX_VALUE) .addComponent(jButton1) .addGap(24, 24, 24))); pack(); } // </editor-fold>//GEN-END:initComponents