Browse files

renamed shib auth handler to generic request header auth hander in forms

added a disable preview option to the image previewer
  • Loading branch information...
1 parent 85a8fe0 commit 4add8c9072e8bf877bea750fb2534ba062d51f84 @gregjan gregjan committed Sep 18, 2012
View
4 ...forms/ShibbolethAuthorizationHandler.java → ...ms/RequestHeaderAuthorizationHandler.java
@@ -9,12 +9,12 @@
import crosswalk.Form;
-public class ShibbolethAuthorizationHandler implements AuthorizationHandler {
+public class RequestHeaderAuthorizationHandler implements AuthorizationHandler {
private String splitCharacter = null;
private String groupsHeaderName = null;
@SuppressWarnings("unused")
- private static final Logger LOG = LoggerFactory.getLogger(ShibbolethAuthorizationHandler.class);
+ private static final Logger LOG = LoggerFactory.getLogger(RequestHeaderAuthorizationHandler.class);
public String getSplitCharacter() {
return splitCharacter;
View
32 forms/src/main/webapp/WEB-INF/service-context.xml
@@ -57,39 +57,9 @@
<property name="defaultContainer" ref="${forms.default.container.pid}"/>
</bean>
- <bean id="authorizationHandler" class="cdr.forms.ShibbolethAuthorizationHandler">
+ <bean id="authorizationHandler" class="cdr.forms.RequestHeaderAuthorizationHandler">
<property name="groupsHeaderName" value="isMemberOf"/>
<property name="splitCharacter" value=";"/>
</bean>
- <!-- JMX -->
-
- <bean id="loggingExporter" class="org.springframework.jmx.export.MBeanExporter"
- lazy-init="false">
- <property name="beans">
- <map>
- <entry key="cdr-services:jmxservice=loggingConfiguration"
- value-ref="loggingMBean" />
- </map>
- </property>
- <property name="registrationBehaviorName" value="REGISTRATION_REPLACE_EXISTING" />
- <property name="assembler">
- <bean
- class="org.springframework.jmx.export.assembler.InterfaceBasedMBeanInfoAssembler">
- <property name="managedInterfaces">
- <array value-type="java.lang.Class">
- <value>de.stefanheintz.log.jmxservice.LoggingConfig</value>
- </array>
- </property>
- </bean>
- </property>
- </bean>
-
- <!-- Logging MBean -->
- <!-- http://code.google.com/p/logging-jmx-service/wiki/Tutorial -->
- <bean id="loggingMBean" class="de.stefanheintz.log.jmxservice.LoggingConfigImpl">
- </bean>
-
-
-
</beans>
View
30 workbench_plugin/src/main/java/unc/lib/cdr/workbench/views/ViewPartPreviewFile.java
@@ -6,21 +6,41 @@
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.IToolBarManager;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.IActionBars;
import org.eclipse.ui.ISelectionListener;
import org.eclipse.ui.ISelectionService;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.part.ViewPart;
public class ViewPartPreviewFile extends ViewPart {
+ public class PreviewToggleAction extends Action {
+ public PreviewToggleAction() {
+ super("Disable Preview");
+ }
+ @Override
+ public void run() {
+ enabled = !enabled;
+ if(enabled) {
+ this.setText("Disable Preview");
+ } else {
+ this.setText("Enable Preview");
+ }
+ }
+ }
+
ImageProvider provider = null;
ImageViewer viewer = null;
Image image;
+ boolean enabled = true;
public ViewPartPreviewFile() {
}
@@ -41,6 +61,10 @@ protected IStatus run(IProgressMonitor monitor) {
};
private void handleSelection(ISelection selection) {
+ if(!enabled) {
+ viewer.setImage(null);
+ return;
+ }
if (selection instanceof IStructuredSelection) {
IStructuredSelection sel = (IStructuredSelection) selection;
Object o = sel.getFirstElement();
@@ -78,6 +102,12 @@ public void createPartControl(Composite parent) {
getSelectionService().addPostSelectionListener(selectionListener);
handleSelection(getSelectionService().getSelection());
viewer = new ImageViewer(parent, SWT.NONE);
+ Action action = new PreviewToggleAction();
+ IActionBars actionBars = getViewSite().getActionBars();
+ IMenuManager dropDownMenu = actionBars.getMenuManager();
+ //IToolBarManager toolBar = actionBars.getToolBarManager();
+ dropDownMenu.add(action);
+ //toolBar.add(action);
}
protected void setImageProvider(final ImageProvider newprovider) {

0 comments on commit 4add8c9

Please sign in to comment.