"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "openmeetings-web/src/main/java/org/apache/openmeetings/web/room/sidebar/UploadDialog.java" between
apache-openmeetings-6.1.0-src.tar.gz and apache-openmeetings-6.2.0-src.tar.gz

About: OpenMeetings is a browser-based software that allows you to set up instantly a conference in the Web. You can use your microphone or webcam, share documents on a white board, share your screen or record meetings. Source code.

UploadDialog.java  (apache-openmeetings-6.1.0-src):UploadDialog.java  (apache-openmeetings-6.2.0-src)
skipping to change at line 22 skipping to change at line 22
* Unless required by applicable law or agreed to in writing, * Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an * software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the * KIND, either express or implied. See the License for the
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.apache.openmeetings.web.room.sidebar; package org.apache.openmeetings.web.room.sidebar;
import static org.apache.openmeetings.util.OpenmeetingsVariables.getMaxUploadSiz e; import static org.apache.openmeetings.util.OpenmeetingsVariables.getMaxUploadSiz e;
import static org.apache.openmeetings.web.room.sidebar.RoomFileUploadResourceRef
erence.PARAM_LAST_SELECTED_GROUP;
import static org.apache.openmeetings.web.room.sidebar.RoomFileUploadResourceRef
erence.PARAM_LAST_SELECTED_ID;
import static org.apache.openmeetings.web.room.sidebar.RoomFileUploadResourceRef
erence.PARAM_LAST_SELECTED_OWNER;
import static org.apache.openmeetings.web.room.sidebar.RoomFileUploadResourceRef
erence.PARAM_LAST_SELECTED_ROOM;
import org.apache.openmeetings.core.data.file.FileProcessor; import org.apache.openmeetings.db.entity.file.BaseFileItem;
import org.apache.openmeetings.db.dao.file.FileItemLogDao;
import org.apache.openmeetings.web.app.WebSession; import org.apache.openmeetings.web.app.WebSession;
import org.apache.openmeetings.web.common.OmModalCloseButton; import org.apache.openmeetings.web.common.OmModalCloseButton;
import org.apache.openmeetings.web.room.RoomPanel; import org.apache.openmeetings.web.room.RoomPanel;
import org.apache.openmeetings.web.util.upload.BootstrapFileUploadBehavior; import org.apache.openmeetings.web.util.upload.BootstrapFileUploadBehavior;
import org.apache.wicket.AttributeModifier; import org.apache.wicket.AttributeModifier;
import org.apache.wicket.core.request.handler.IPartialPageRequestHandler; import org.apache.wicket.core.request.handler.IPartialPageRequestHandler;
import org.apache.wicket.markup.head.IHeaderResponse; import org.apache.wicket.markup.head.IHeaderResponse;
import org.apache.wicket.markup.head.JavaScriptHeaderItem; import org.apache.wicket.markup.head.JavaScriptHeaderItem;
import org.apache.wicket.markup.head.PriorityHeaderItem; import org.apache.wicket.markup.head.PriorityHeaderItem;
import org.apache.wicket.markup.html.WebMarkupContainer; import org.apache.wicket.markup.html.WebMarkupContainer;
import org.apache.wicket.model.ResourceModel; import org.apache.wicket.model.ResourceModel;
import org.apache.wicket.request.mapper.parameter.PageParameters; import org.apache.wicket.request.mapper.parameter.PageParameters;
import org.apache.wicket.request.resource.JavaScriptResourceReference; import org.apache.wicket.request.resource.JavaScriptResourceReference;
import org.apache.wicket.spring.injection.annot.SpringBean;
import org.apache.wicket.util.lang.Bytes; import org.apache.wicket.util.lang.Bytes;
import de.agilecoders.wicket.core.markup.html.bootstrap.dialog.Modal; import de.agilecoders.wicket.core.markup.html.bootstrap.dialog.Modal;
public class UploadDialog extends Modal<String> { public class UploadDialog extends Modal<String> {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private final WebMarkupContainer form = new WebMarkupContainer("form"); private final WebMarkupContainer form = new WebMarkupContainer("form");
private final RoomFilePanel roomFiles; private final RoomFilePanel roomFiles;
private final RoomPanel room; private final RoomPanel room;
private final WebMarkupContainer lastSelected = new WebMarkupContainer("l private final WebMarkupContainer lastSelectedId = new WebMarkupContainer(
astSelected"); "lastSelectedId");
private final WebMarkupContainer lastSelectedRoom = new WebMarkupContaine
@SpringBean r("lastSelectedRoom"); // required for "fake" root
private FileProcessor processor; private final WebMarkupContainer lastSelectedOwner = new WebMarkupContain
@SpringBean er("lastSelectedOwner"); // required for "fake" root
private FileItemLogDao fileLogDao; private final WebMarkupContainer lastSelectedGroup = new WebMarkupContain
er("lastSelectedGroup"); // required for "fake" root
public UploadDialog(String id, RoomPanel room, RoomFilePanel roomFiles) { public UploadDialog(String id, RoomPanel room, RoomFilePanel roomFiles) {
super(id); super(id);
this.roomFiles = roomFiles; this.roomFiles = roomFiles;
this.room = room; this.room = room;
} }
@Override @Override
protected void onInitialize() { protected void onInitialize() {
header(new ResourceModel("upload.dlg.choose.title")); header(new ResourceModel("upload.dlg.choose.title"));
skipping to change at line 75 skipping to change at line 75
setBackdrop(Backdrop.STATIC); setBackdrop(Backdrop.STATIC);
add(form.add(AttributeModifier.append("data-max-size", getMaxUplo adSize())) add(form.add(AttributeModifier.append("data-max-size", getMaxUplo adSize()))
.add(AttributeModifier.append("data-max-size-lbl" , Bytes.bytes(getMaxUploadSize()).toString(WebSession.get().getLocale()))) .add(AttributeModifier.append("data-max-size-lbl" , Bytes.bytes(getMaxUploadSize()).toString(WebSession.get().getLocale())))
.add(AttributeModifier.append("data-upload-lbl", getString("593"))) .add(AttributeModifier.append("data-upload-lbl", getString("593")))
.add(AttributeModifier.append("data-max-upload-lb l", getString("1491"))) .add(AttributeModifier.append("data-max-upload-lb l", getString("1491")))
.add(AttributeModifier.append("action", "" + urlF or(new RoomFileUploadResourceReference(), new PageParameters()))) .add(AttributeModifier.append("action", "" + urlF or(new RoomFileUploadResourceReference(), new PageParameters())))
.setOutputMarkupId(true) .setOutputMarkupId(true)
.setOutputMarkupPlaceholderTag(true)); .setOutputMarkupPlaceholderTag(true));
form.add(new WebMarkupContainer("sid").add(AttributeModifier.appe nd("value", room.getClient().getSid())).setMarkupId("room-upload-sid").setOutput MarkupId(true)); form.add(new WebMarkupContainer("sid").add(AttributeModifier.appe nd("value", room.getClient().getSid())).setMarkupId("room-upload-sid").setOutput MarkupId(true));
form.add(lastSelected.setMarkupId("room-upload-last-selected").se form.add(lastSelectedId.setMarkupId(PARAM_LAST_SELECTED_ID).setOu
tOutputMarkupId(true)); tputMarkupId(true));
form.add(lastSelectedRoom.setMarkupId(PARAM_LAST_SELECTED_ROOM).s
etOutputMarkupId(true));
form.add(lastSelectedOwner.setMarkupId(PARAM_LAST_SELECTED_OWNER)
.setOutputMarkupId(true));
form.add(lastSelectedGroup.setMarkupId(PARAM_LAST_SELECTED_GROUP)
.setOutputMarkupId(true));
add(BootstrapFileUploadBehavior.INSTANCE); add(BootstrapFileUploadBehavior.INSTANCE);
addButton(OmModalCloseButton.of("85")); addButton(OmModalCloseButton.of("85"));
super.onInitialize(); super.onInitialize();
} }
@Override @Override
public Modal<String> show(IPartialPageRequestHandler handler) { public Modal<String> show(IPartialPageRequestHandler handler) {
lastSelected.add(AttributeModifier.replace("value", roomFiles.get BaseFileItem last = roomFiles.getLastSelected();
LastSelected().getId())); if (last.getId() == null) {
lastSelectedRoom.add(AttributeModifier.replace("value", l
ast.getRoomId()));
lastSelectedOwner.add(AttributeModifier.replace("value",
last.getOwnerId()));
lastSelectedGroup.add(AttributeModifier.replace("value",
last.getGroupId()));
} else {
lastSelectedId.add(AttributeModifier.replace("value", las
t.getId()));
}
handler.add(form.setVisible(true)); handler.add(form.setVisible(true));
handler.appendJavaScript("Upload.bindUpload();"); handler.appendJavaScript("Upload.bindUpload();");
return super.show(handler); return super.show(handler);
} }
@Override @Override
public void renderHead(IHeaderResponse response) { public void renderHead(IHeaderResponse response) {
super.renderHead(response); super.renderHead(response);
response.render(new PriorityHeaderItem(JavaScriptHeaderItem.forRe ference(new JavaScriptResourceReference(UploadDialog.class, "upload.js")))); response.render(new PriorityHeaderItem(JavaScriptHeaderItem.forRe ference(new JavaScriptResourceReference(UploadDialog.class, "upload.js"))));
} }
 End of changes. 6 change blocks. 
14 lines changed or deleted 37 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)