Project

General

Profile

« Previous | Next » 

Revision 0a75fd54

Added by Katja Luther over 1 year ago

change logger

View differences:

eu.etaxonomy.taxeditor.application/src/main/java/eu/etaxonomy/taxeditor/ApplicationWorkbenchAdvisor.java
97 97
    		    	else if (t instanceof NoHttpResponseException
98 98
    		    	          || t.getCause() instanceof CdmAuthenticationException
99 99
    		    	          || (t.getMessage() != null && t.getMessage().contains("status code = 403"))){
100
    		    		t.printStackTrace();
100 101
                        MessagingUtils.informationDialog("Access denied", MessagingUtils.ACCESS_DENIED);
101 102
                    }else if (includesCause(t, OptionalDataException.class)){
102 103
                        MessagingUtils.informationDialog("Error (OptionalDataException)",
eu.etaxonomy.taxeditor.cdmlib/META-INF/MANIFEST.MF
188 188
 net.sf.ehcache.store,
189 189
 net.sf.ehcache.util,
190 190
 org.aopalliance.aop,
191
 org.apache.commons.collections4,
191 192
 org.apache.commons.collections4.map,
192 193
 org.apache.commons.dbcp,
193 194
 org.apache.commons.imaging,
eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/remoting/source/CdmServerInfo.java
63 63

  
64 64
    private final static String NAME_DEMO_1 = "demo I";
65 65
    private final static String SERVER_DEMO_1 = "160.45.63.230";
66
    private final static String NAME_DEMO_2 = "demo II";
67
    private final static String SERVER_DEMO_2 = "160.45.63.231";
68

  
66 69

  
67 70
    public final static String SERVER_LOCALHOST = "localhost";
68 71
    private final static String NAME_LOCALHOST = "localhost";
......
436 439
        List<CdmServerInfoConfig> serverInfoList = new ArrayList<>();
437 440
        serverInfoList.add(new CdmServerInfoConfig(NAME_PRODUCTION, SERVER_PRODUCTION, 443, "", false));
438 441
        serverInfoList.add(new CdmServerInfoConfig(NAME_DEMO_1, SERVER_DEMO_1, 80, CDMSERVER_PREFIX, false));
442
        serverInfoList.add(new CdmServerInfoConfig(NAME_DEMO_2, SERVER_DEMO_2, 80, CDMSERVER_PREFIX, false));
439 443
        serverInfoList.add(new CdmServerInfoConfig(NAME_LOCALHOST, SERVER_LOCALHOST, 8080, CDMSERVER_PREFIX, true));
440 444
        return serverInfoList;
441 445
    }
eu.etaxonomy.taxeditor.cdmlib/src/main/java/org/hibernate/collection/internal/AbstractPersistentCollection.java
1478 1478
		if (getOwner() != null && !initialized) {
1479 1479
		    Object collectionType = null;
1480 1480
		    Field field = null;
1481
		    String fieldName = null;
1481 1482
		    Class<?> clazz = null;
1482 1483
		    String codePart = "1";
1483 1484
			try {
1484 1485
				String role = getRole();
1485
				String fieldName = role.substring(role.lastIndexOf(".") + 1);
1486
				fieldName = role.substring(role.lastIndexOf(".") + 1);
1486 1487
				LOG.info("--> Remote Lazy Initializing Collection " + getRole() + " , owner : " + getOwner().getClass() + "/" + getKey() + " , field : " + fieldName);
1487 1488
				Object owner = getOwner();
1488 1489
				CdmBase cdmBase;
......
1526 1527
				}
1527 1528
			} catch (Exception ex) {
1528 1529
			    String originalMessage = ex.getMessage();
1529
			    String message = originalMessage + ", clazz: " + (clazz == null? "" :clazz.getSimpleName())+ ", field: " + field + ", collectionType: " + collectionType + ", at code part: " + codePart;
1530
			    String message = originalMessage + ", clazz: " + (clazz == null? "" :clazz.getSimpleName())+ ", field: " + field != null? field.getName(): fieldName + ", collectionType: " + collectionType + ", at code part: " + codePart;
1530 1531
			    throw new CdmEagerLoadingException(message);
1531 1532
			}
1532 1533
		}
eu.etaxonomy.taxeditor.cdmlib/src/main/java/org/springframework/remoting/httpinvoker/CachingHttpInvokerProxyFactoryBean.java
8 8
*/
9 9
package org.springframework.remoting.httpinvoker;
10 10

  
11

  
12
import java.time.LocalDateTime;
13
import java.time.format.DateTimeFormatter;
11 14
import java.util.HashSet;
12 15
import java.util.Set;
13 16

  
14 17
import org.aopalliance.intercept.MethodInvocation;
15 18
import org.apache.logging.log4j.LogManager;
16 19
import org.apache.logging.log4j.Logger;
20

  
17 21
import org.springframework.remoting.support.RemoteInvocation;
18 22
import org.springframework.remoting.support.RemoteInvocationResult;
19 23

  
......
56 60
        persistingMethods.add("findWithUpdate");
57 61
        persistingMethods.add("loadWithUpdate");
58 62
        measureDuration = System.getProperty(PROP_KEY_MEASURE_DURATION) != null;
63
        //measureDuration = true;
59 64
    }
60 65

  
61 66
    @Override
......
74 79
        }
75 80

  
76 81
        // A)  if this is a term service call for term lists try to get the terms from the cache
77
        if(ITermService.class.isAssignableFrom(originalInvocation.getMethod().getDeclaringClass())){
82
        
83
        
84
        if(ITermService.class.isAssignableFrom(this.getServiceInterface())){
78 85
            return handleTermRequest(invocation, originalInvocation);
79 86
        }
80 87
        // B) handle other service calls
......
131 138
                    String message = "Error when caching terms in TaxEditor";
132 139
                    throw new RuntimeException(message, e);
133 140
                }
134
                logger.debug("Term list loaded and cached");
141
                logger.warn("Term list loaded and cached");
135 142
            } else {
136 143
                logger.debug("Term list found in cache, not loaded");
137 144
            }
......
153 160
            RemoteInvocationResult result = super.executeRequest(invocation, originalInvocation);
154 161
            if(measureDuration){
155 162
                double duration = System.currentTimeMillis() - startTime;
156
                logger.info(getServiceUrl() + "#" + invocation.getMethodName() + " [" + duration + " ms]");
163
                
164
                LocalDateTime date = LocalDateTime.now();
165
                String dateTimeStr = date.format(DateTimeFormatter.ISO_DATE_TIME);
166
                System.out.println(dateTimeStr + ": "+ getServiceUrl() + "#" + invocation.getMethodName() + " [" + duration + " ms]");
167
                logger.info(dateTimeStr + getServiceUrl() + "#" + invocation.getMethodName() + " [" + duration + " ms]");
157 168
            }
158 169
            return result;
159 170
        } catch(Exception e) {
eu.etaxonomy.taxeditor.cdmlib/src/main/resources/log4j2.xml
4 4
    <File name="A1" fileName="A1.log" append="true">
5 5
      <XMLLayout/>  <!-- maybe we need to add jackson-dataformat-xml dependency for this -->
6 6
    </File>
7
    <Console name="STDOUT" target="System.out">
7
   <!-- <Console name="STDOUT" target="System.out">
8 8
      <PatternLayout  pattern="%d %p [%c] - %m%n"/>
9 9
      <Filters>
10 10
        <RegexFilter regex=".*has a maxElementsInMemory of 0. This might lead to performance degradation or OutOfMemoryError at Terracotta client.*"
......
12 12
        <RegexFilter regex=".*object references was reached while attempting to calculate the size of the object graph.*"
13 13
          onMatch="DENY"/>
14 14
      </Filters>      
15
    </Console>
15
    </Console>-->
16 16
  </Appenders>
17 17
  <Loggers>
18 18
    <Root level="warn">
......
22 22
    <Logger name="eu.etaxonomy.taxeditor.handler.update.UpdateHandler" level="info"/>
23 23
    <Logger name="org.eclipse.equinox.p2.operations.ProvisioningSession" level="info"/>
24 24
    <Logger name="org.eclipse.equinox.internal.p2.engine.ProvisioningPlan" level="info"/>
25
    
25
    <Logger name="org.springframework.remoting.httpinvoker.CachingHttpInvokerProxyFactoryBean" level="info"/>
26 26
    <!-- ### NOT USED 
27 27
    <Logger name="org.hibernate.proxy.AbstractLazyInitializer" level="info"/>
28 28
    <Logger name="org.hibernate.collection.internal.AbstractPersistentCollection" level="info"/>
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/operation/e4/CdmHandlerE4.java
72 72
            ErrorDialog.openError(null, "Operation successful but with warnings", null, status);
73 73
            break;
74 74
        case IStatus.ERROR:
75
            ErrorDialog.openError(null, "Error executing operation", null, status);
75
            //MessagingUtils.error(null, "Error executing operation", null, status);
76 76
            break;
77 77
        default:
78 78
        }
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/parser/ParseHandler.java
111 111
	 */
112 112
	public INonViralName parse(String unparsedNameString){
113 113
		nonViralNameParser.parseReferencedName(name, unparsedNameString,
114
				name.getRank(), true);
114
				name.getRank(), false);
115 115
		return name;
116 116
	}
117 117

  
......
138 138
	 */
139 139
	public TaxonName parseAndResolveDuplicatesNew(String unparsedNameString){
140 140

  
141
		CdmStore.getService(INameService.class).parseName(name, unparsedNameString, null, true, true);
141
		CdmStore.getService(INameService.class).parseName(name, unparsedNameString, null, false, true);
142 142
		return name;
143 143
	}
144 144

  
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/PreferencePropertyTester.java
41 41
	        return isChecklistEditorEnabled();
42 42
	    }
43 43
	    if(SHOW_IO_MENU.equals(property)){
44
	        boolean test = isShowIOMenuEnabled();
44
//	        boolean test = isShowIOMenuEnabled();
45 45
            return isShowIOMenuEnabled();
46 46
        }
47 47
	    if(SHOW_SPECIMEN_MENU.equals(property)){
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/MultilanguageTextElement.java
199 199
	    }
200 200
	}
201 201

  
202
	public void updateControls() {
202
	private void updateControls() {
203 203
		LanguageString preferredLanguageString = MultilanguageTextHelper
204 204
				.getPreferredLanguageString(getMultilanguageText(),
205 205
						Arrays.asList(new Language[] { CdmStore
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/detail/TextDataDetailElement.java
14 14

  
15 15
import eu.etaxonomy.cdm.model.description.TextData;
16 16
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
17
import eu.etaxonomy.taxeditor.ui.element.CdmPropertyChangeEvent;
17 18
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
18 19
import eu.etaxonomy.taxeditor.ui.element.MultilanguageTextElement;
19 20

  
......
58 59
	public void handleEvent(Object eventSource) {
59 60
	    super.handleEvent(eventSource);
60 61
		if(eventSource == multilanguageTextElement){
62
			firePropertyChangeEvent(new CdmPropertyChangeEvent(this, null));
61 63
//			getEntity().setMultiLanguageText(multilanguageTextElement.getMultilanguageText());
62 64
		}
63 65
	}
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/reference/OriginalSourceElement.java
8 8
*/
9 9
package eu.etaxonomy.taxeditor.ui.section.reference;
10 10

  
11
import java.awt.Component;
12

  
11 13
import org.apache.commons.lang3.StringUtils;
12 14
import org.eclipse.jface.util.IPropertyChangeListener;
15
import org.eclipse.swt.widgets.Composite;
13 16
import org.eclipse.ui.forms.widgets.TableWrapData;
17
import org.hibernate.EntityMode;
14 18

  
15 19
import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
16 20
import eu.etaxonomy.cdm.model.common.CdmBase;
......
20 24
import eu.etaxonomy.cdm.model.reference.NamedSourceBase;
21 25
import eu.etaxonomy.cdm.model.reference.OriginalSourceBase;
22 26
import eu.etaxonomy.cdm.model.reference.Reference;
27
import eu.etaxonomy.cdm.model.reference.ReferenceType;
23 28
import eu.etaxonomy.taxeditor.model.AbstractUtility;
24 29
import eu.etaxonomy.taxeditor.preference.Resources;
25 30
import eu.etaxonomy.taxeditor.store.StoreUtil;
......
30 35
import eu.etaxonomy.taxeditor.ui.element.TimePeriodElement;
31 36
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
32 37
import eu.etaxonomy.taxeditor.ui.section.common.ExternalLinksSection;
38
import eu.etaxonomy.taxeditor.ui.section.taxon.TaxonBaseDetailSection;
33 39
import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
34 40

  
35 41
/**
......
40 46
        extends AbstractCdmDetailElement<T>
41 47
        implements IPropertyChangeListener{
42 48

  
49
	protected ICdmFormElement composite;
43 50
    protected EntitySelectionElement<Reference> selection_Ref;
44 51
    protected TextWithLabelElement microReference;
45 52
    protected TimePeriodElement accessed;
......
47 54
    protected String label = "Source";
48 55
    protected CdmBase cdmEntity;
49 56
    protected ExternalLinksSection externalLinks;
57
    protected ReferenceType refType;
50 58

  
51 59
    public OriginalSourceElement(CdmFormFactory formFactory, ICdmFormElement formElement, CdmBase cdmEntity, String label) {
52 60
        super(formFactory, formElement);
......
63 71

  
64 72
        if (entity != null){
65 73
            selection_Ref.setEntity(entity.getCitation());
74
            if (entity.getCitation() != null) {
75
            	refType = entity.getCitation().getType();
76
            }
77
            	
66 78
        }
67 79
        selection_Ref.setBackground(this.getPersistentBackground());
68 80
        microReference = formFactory.createTextWithLabelElement(formElement, "Details", entity != null? entity.getCitationMicroReference(): "", style);
......
105 117
    @Override
106 118
    public void handleEvent(Object eventSource) {
107 119
        if (eventSource.equals(selection_Ref)){
120
        	
108 121
            getEntity().setCitation(selection_Ref.getEntity());
122
            ReferenceType newRefType = getEntity().getCitation().getType();
123
            if (refType != null && refType.isDynamic() ^ getEntity().getCitation().getType().isDynamic()) {
124
            	this.refresh();
125
//            	this.getParentElement().refresh();
126
            }
127
            refType = newRefType;
109 128
        }else if (eventSource.equals(microReference)){
110 129
            getEntity().setCitationMicroReference(microReference.getText());
111 130
        }else if(eventSource == accessed){
......
127 146
        externalLinks.setIndent(indent+10);
128 147
        advancedSection.setIndent(indent+10);
129 148
    }
149
    
150
    @Override
151
    public void refresh() {
152
		updateContent();
153
		this.getParentElement().refresh();
154
	}
155
    
156

  
157
    
158
    
130 159
}
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/reference/ReferenceDetailElement.java
212 212

  
213 213
	}
214 214

  
215
    private void createWebPageControls(ReferenceDetailElement referenceDetailElement, Reference reference, int style) {
215
    private void createWebPageControls(ICdmFormElement element, Reference reference, int style) {
216 216
		DateTime accessed = reference.getAccessed();
217 217

  
218
		text_accessed = formFactory.createDateElement(referenceDetailElement, "Accessed", accessed, style, false);
218
		text_accessed = formFactory.createDateElement(element, "Accessed", accessed, style, false);
219 219
	}
220 220

  
221 221
	@Override
......
403 403
        text_uri = formFactory.createUriWithLabelElement(element, "URI",
404 404
                reference.getUri(), style);
405 405
        if (reference.isDynamic()){
406
            createWebPageControls(this, reference, style);
406
            createWebPageControls(element, reference, style);
407 407
        }
408 408
    }
409 409

  
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/reference/SecundumSourceElement.java
47 47
        setEntityWithoutUpdate(HibernateProxyHelper.deproxy(entity));
48 48

  
49 49
        this.selection_Ref = formFactory.createSelectionElement(Reference.class, formElement, "Secundum", getEntity()!= null? getEntity().getCitation(): null, EntitySelectionElement.ALL, style);
50

  
50
        if (entity.getCitation() != null) {
51
        	refType = entity.getCitation().getType();
52
        }
51 53
        selection_Ref.setBackground(this.getPersistentBackground());
52 54
        for (ICdmFormElement element: selection_Ref.getElements()){
53 55
            element.setBackground(getPersistentBackground());
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/taxon/TaxonBaseDetailElement.java
155 155
        updateCacheRelevance();
156 156
        updateToggleableCacheField();
157 157
    }
158
	
159
	@Override
160
	public void refresh() {
161
		updateContent();
162
		
163
	}
158 164
}
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/e4/AbstractCdmDataViewer.java
10 10

  
11 11
import javax.inject.Inject;
12 12

  
13
import org.apache.logging.log4j.LogManager;
14
import org.apache.logging.log4j.Logger;
13 15
import org.eclipse.e4.core.contexts.ContextInjectionFactory;
14 16
import org.eclipse.e4.core.contexts.IEclipseContext;
15
import org.eclipse.e4.core.services.log.Logger;
16 17
import org.eclipse.jface.viewers.Viewer;
17 18
import org.eclipse.swt.SWT;
18 19
import org.eclipse.swt.SWTException;
......
39 40
 * @date 18.07.2017
40 41
 */
41 42
public abstract class AbstractCdmDataViewer extends Viewer {
43
	
44
	private static final Logger logger = LogManager.getLogger();
42 45

  
43
    @Inject
44
	private Logger logger;
45 46

  
46 47
	protected ManagedForm managedForm;
47 48

  
eu.etaxonomy.taxeditor/eu.etaxonomy.taxeditor.product
1 1
<?xml version="1.0" encoding="UTF-8"?>
2
<?pde version="3.5"?><product application="eu.etaxonomy.taxeditor.application.application" id="eu.etaxonomy.taxeditor.application.eu_etaxonomy_taxeditor_product" includeLaunchers="true" name="EDIT Taxonomic Editor" uid="eu.etaxonomy.taxeditor.product" useFeatures="true" version="5.35.0.qualifier">
3
  <aboutInfo>
4
    <image path="/eu.etaxonomy.taxeditor.application/icons/256color_48x48.gif"/>
5
    <text>
2
<?pde version="3.5"?>
3

  
4
<product name="EDIT Taxonomic Editor" uid="eu.etaxonomy.taxeditor.product" id="eu.etaxonomy.taxeditor.application.eu_etaxonomy_taxeditor_product" application="eu.etaxonomy.taxeditor.application.application" version="5.35.0.qualifier" useFeatures="true" includeLaunchers="true">
5

  
6
   <aboutInfo>
7
      <image path="/eu.etaxonomy.taxeditor.application/icons/256color_48x48.gif"/>
8
      <text>
6 9
         %productBlurb
7 10
      </text>
8
  </aboutInfo>
9
  <configIni use="default"></configIni>
10
  <launcherArgs>
11
    <programArgs>-data @user.home/.cdmLibrary -Dserver_port=58080
11
   </aboutInfo>
12

  
13
   <configIni use="default">
14
   </configIni>
15

  
16
   <launcherArgs>
17
      <programArgs>-data @user.home/.cdmLibrary -Dserver_port=58080
12 18
      </programArgs>
13
    <programArgsLin>--launcher.GTK_version
19
      <programArgsLin>--launcher.GTK_version
14 20
2
15 21
      </programArgsLin>
16
    <vmArgs>-Xmx512M -Dorg.eclipse.update.reconcile=false -Declipse.p2.unsignedPolicy=allow -Dremoting.httpinvoker.measureDuration=true
22
      <vmArgs>-Xmx512M -Dorg.eclipse.update.reconcile=false -Declipse.p2.unsignedPolicy=allow -Dremoting.httpinvoker.measureDuration=true
17 23
      </vmArgs>
18
    <vmArgsMac>-XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts
24
      <vmArgsMac>-XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts
19 25
      </vmArgsMac>
20
  </launcherArgs>
21
  <windowImages i16="/eu.etaxonomy.taxeditor.application/icons/256color_16x16.gif" i32="/eu.etaxonomy.taxeditor.application/icons/256color_32x32.gif" i48="/eu.etaxonomy.taxeditor.application/icons/256color_48x48.gif"/>
22
  <splash location="eu.etaxonomy.taxeditor.application" startupForegroundColor="000000" startupMessageRect="7,432,360,20" startupProgressRect="5,447,366,15"/>
23
  <launcher name="TaxonomicEditor">
24
    <solaris/>
25
    <win useIco="false">
26
      <bmp/>
27
    </win>
28
  </launcher>
29
  <vm></vm>
30
  <plugins></plugins>
31
  <features>
32
    <feature id="eu.etaxonomy.taxeditor.feature"/>
33
  </features>
34
  <configurations>
35
    <plugin autoStart="true" id="eu.etaxonomy.taxeditor.application" startLevel="5"/>
36
    <plugin autoStart="true" id="org.eclipse.core.runtime" startLevel="4"/>
37
    <plugin autoStart="true" id="org.eclipse.equinox.common" startLevel="2"/>
38
    <plugin autoStart="true" id="org.eclipse.equinox.ds" startLevel="2"/>
39
    <plugin autoStart="true" id="org.eclipse.equinox.p2.transport.ecf" startLevel="4"/>
40
    <plugin autoStart="true" id="org.eclipse.equinox.simpleconfigurator" startLevel="1"/>
41
  </configurations>
26
   </launcherArgs>
27

  
28
   <windowImages i16="/eu.etaxonomy.taxeditor.application/icons/256color_16x16.gif" i32="/eu.etaxonomy.taxeditor.application/icons/256color_32x32.gif" i48="/eu.etaxonomy.taxeditor.application/icons/256color_48x48.gif"/>
29

  
30
   <splash
31
      location="eu.etaxonomy.taxeditor.application"
32
      startupProgressRect="5,447,366,15"
33
      startupMessageRect="7,432,360,20"
34
      startupForegroundColor="000000" />
35
   <launcher name="TaxonomicEditor">
36
      <win useIco="false">
37
         <bmp/>
38
      </win>
39
   </launcher>
40

  
41
   <vm>
42
   </vm>
43

  
44
   <plugins>
45
   </plugins>
46

  
47
   <features>
48
      <feature id="eu.etaxonomy.taxeditor.feature"/>
49
   </features>
50

  
51
   <configurations>
52
      <plugin id="eu.etaxonomy.taxeditor.application" autoStart="true" startLevel="5" />
53
      <plugin id="org.eclipse.core.runtime" autoStart="true" startLevel="4" />
54
      <plugin id="org.eclipse.equinox.common" autoStart="true" startLevel="2" />
55
      <plugin id="org.eclipse.equinox.ds" autoStart="true" startLevel="2" />
56
      <plugin id="org.eclipse.equinox.p2.transport.ecf" autoStart="true" startLevel="4" />
57
      <plugin id="org.eclipse.equinox.simpleconfigurator" autoStart="true" startLevel="1" />
58
   </configurations>
59

  
42 60
</product>

Also available in: Unified diff