Project

General

Profile

« Previous | Next » 

Revision 8596

only index event information for known events. https://projects.ecoinformatics.org/ecoinfo/issues/6346

View differences:

src/edu/ucsb/nceas/metacat/EventLog.java
140 140
        try {
141 141
        	
142 142
        	Event d1Event = Event.convert(event);
143
        	String fieldName = d1Event.xmlValue() + "_count_i";
144
        	int eventCount = 0;
145
        	
146
        	String docid = IdentifierManager.getInstance().getLocalId(pid.getValue());
147
        	Log eventLog = this.getD1Report(null, null, new String[] {docid}, d1Event, null, null, false, 0, 0);
148
        	eventCount = eventLog.getTotal();
149

  
150
	        List<Object> values = new ArrayList<Object>();
151
			values.add(eventCount);
152
	        Map<String, List<Object>> fields = new HashMap<String, List<Object>>();
153
	        fields.put(fieldName, values);
143
        	if (d1Event != null) {
144
        		
145
	        	String fieldName = d1Event.xmlValue() + "_count_i";
146
	        	int eventCount = 0;
147
	        	
148
	        	String docid = IdentifierManager.getInstance().getLocalId(pid.getValue());
149
	        	Log eventLog = this.getD1Report(null, null, new String[] {docid}, d1Event, null, null, false, 0, 0);
150
	        	eventCount = eventLog.getTotal();
151
	
152
		        List<Object> values = new ArrayList<Object>();
153
				values.add(eventCount);
154
		        Map<String, List<Object>> fields = new HashMap<String, List<Object>>();
155
		        fields.put(fieldName, values);
156
		        
157
		        return fields;
158
        	}
154 159
	        
155
	        return fields;
156
	        
157 160
        } catch (Exception e) {
158
        	logMetacat.error("Could not update event index information", e);
159
        	return null;
161
        	logMetacat.error("Could not update event index information on pid: " + pid.getValue() + " for event: " + event, e);
160 162
        }
163
        // default if we can't find the event information
164
    	return null;
165

  
161 166
    }
162 167
    
163 168
    /**

Also available in: Unified diff