1 <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
2 pageEncoding="ISO-8859-1"
4 <%@ page import="java.util.ResourceBundle"%>
5 <%@ page import="org.hibernate.Session"%>
6 <%@ page import="org.hibernate.Transaction"%>
7 <%@ page import="org.splat.dal.dao.som.Database"%>
8 <%@ page import="org.splat.dal.bo.som.Scenario"%>
9 <%@ page import="org.splat.dal.bo.som.Publication"%>
10 <%@ page import="org.splat.dal.bo.som.Document"%>
11 <%@ page import="org.splat.som.ApplicationRights"%>
12 <%@ page import="org.splat.simer.OpenStudy"%>
13 <%@ page import="org.splat.simer.StudyMenu"%>
15 taglib prefix="s" uri="/struts-tags"
17 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
20 =============================================================================================================================
23 String path = request.getParameter("open");
24 OpenStudy simer = (OpenStudy)session.getAttribute("study.open");
25 ApplicationRights rights = (ApplicationRights)session.getAttribute("user.rights");
29 Session connex = Database.getCurSession();
30 Transaction transax = connex.beginTransaction();
33 // Check-out from the tool-bar, looking for the scenario from the selected menu item
34 StudyMenu menu = simer.getMenu();
35 String[] item = menu.getSelection().split("\\x2E");
36 Scenario[] scene = simer.getStudyObject().getScenarii();
37 int j = Integer.valueOf(item[0]);
39 for (i=0; i<scene.length; i++) {
40 if (scene[i].getIndex() == j) break;
42 //TODO: RKV: scene[i].checkout(rights.getUser());
44 name = ResourceBundle.getBundle("som").getString("type.document.geometry") + "1";
48 // Check-out from a Geometry document, looking for the scenario from the corresponding publication
49 simer.selectDocument(path);
51 Publication edited = simer.getSelectedDocument();
52 Document selecdoc = edited.value();
53 Scenario owner = (Scenario)edited.getOwner(); // In the GEOM context, the ProjectElement is necessarilly a Scenario
55 //TODO: RKV: owner.checkout(rights.getUser());
57 name = selecdoc.getTitle();
58 ishared = simer.getStudyObject().shares(selecdoc) || selecdoc.isVersioned();
64 <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
65 <title><%=name%></title>
66 <script language="JavaScript">
70 var answer = window.showModalDialog("saveAs.jsp", window, "dialogHeight:115px; dialogWidth:400px; scroll:no; help:no; status:no");
72 parse = answer.split(";");
73 window.location = "valid-save?documentType=4&fileName=Géométrie1.part&documentName=" + parse[0] + "&documentState=" + parse[1];
78 function versionAs () {
79 // ---------------------
80 var answer = window.showModalDialog("versionAs.jsp", window, "dialogHeight:80px; dialogWidth:600px; scroll:no; help:no; status:no");
82 parse = answer.split("&");
83 action = parse[0].split("=");
85 if (action[0] == "version") {
86 if (parse.length > 1) {
87 window.location = "valid-version?fileName=Géométrie1.part&documentState=" + action[1] + "&" + parse[1];
89 window.location = "valid-version?fileName=Géométrie1.part&documentState=" + action[1];
96 function updateAs () {
98 var answer = window.showModalDialog("updateAs.jsp", window, "dialogHeight:155px; dialogWidth:600px; scroll:no; help:no; status:no");
100 parse = answer.split("&");
101 action = parse[0].split("=");
103 if (action[0] == "update") {
104 window.location = "valid-update?fileName=Géométrie1.part";
106 if (action[0] == "version") {
107 if (parse.length > 1) {
108 window.location = "valid-version?fileName=Géométrie1.part&documentState=" + action[1] + "&" + parse[1];
110 window.location = "valid-version?fileName=Géométrie1.part&documentState=" + action[1];
119 <body background="window.png">
120 <table width=100% border=0 cellspacing=0 cellpadding=0>
121 <tr height=20><td width=73></td></tr>
125 <% if (path == null) {
126 %> <a href="javascript:void(0)" onClick="saveAs()"><img src="<s:url value="/skin/image.hold.gif"/>" width="24" height="24" border="none"/></a>
127 <% } else if (ishared) {
128 %> <a href="javascript:void(0)" onClick="versionAs()"><img src="<s:url value="/skin/image.hold.gif"/>" width="24" height="24" border="none"/></a>
130 %> <a href="javascript:void(0)" onClick="updateAs()"><img src="<s:url value="/skin/image.hold.gif"/>" width="24" height="24" border="none"/></a>