Source code: org/acs/damsel/client/search/SearchResultsAction.java
1 package org.acs.damsel.client.search;
2
3 import javax.servlet.http.*;
4
5 import org.acs.damsel.client.*;
6 import org.acs.damsel.srvr.asset.*;
7 import org.acs.damsel.srvr.collection.*;
8 import org.apache.struts.action.*;
9 import java.sql.*;
10 import org.acs.damsel.srvr.user.*;
11
12 /**
13 * This pulls out the selected asset, attaches it to the SearchResultsForm form
14 * bean and forwards to the assetView.
15 */
16
17 public class SearchResultsAction extends Action {
18 public ActionForward execute(ActionMapping actionMapping,
19 ActionForm actionForm,
20 HttpServletRequest httpServletRequest,
21 HttpServletResponse httpServletResponse) {
22
23 SearchResultsForm searchResultsForm = (SearchResultsForm) actionForm;
24 User user = (User) httpServletRequest.getSession().getAttribute("User");
25 /*Do we want to view a slide show? */
26 if (searchResultsForm.isSlideShow()) {
27 searchResultsForm.setSlideShow(false);
28 httpServletRequest.getSession().setAttribute("slideShowCV", httpServletRequest.getSession().getAttribute("colView"));
29 return actionMapping.findForward("slideShow");
30 }
31
32 String fileName = searchResultsForm.getFileName();
33 String collName = (String) httpServletRequest.getSession().getAttribute("collectionName");
34 CollectionMgr tempMgr = ClientApp.instance().getCollectionMgr();
35 Collection tempCol = null;
36 tempCol = tempMgr.getCollection(collName);
37
38 Asset asset = tempCol.getAsset(fileName);
39 searchResultsForm.setAsset(asset);
40 httpServletRequest.getSession().setAttribute("viewingSearchResult", new Boolean(true));
41 httpServletRequest.getSession().setAttribute("searchResultsForm", searchResultsForm);
42 return (actionMapping.findForward("assetView"));
43 }
44 }