]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.export.core/src/org/simantics/export/core/impl/DefaultContentTypeAction.java
Fixed all line endings of the repository
[simantics/platform.git] / bundles / org.simantics.export.core / src / org / simantics / export / core / impl / DefaultContentTypeAction.java
1 package org.simantics.export.core.impl;
2
3 import java.util.Collection;
4 import java.util.HashMap;
5 import java.util.Map;
6
7 import org.simantics.db.exception.DatabaseException;
8 import org.simantics.export.core.ExportContext;
9 import org.simantics.export.core.error.ExportException;
10 import org.simantics.export.core.intf.ContentTypeAction;
11 import org.simantics.export.core.util.ExportQueries;
12
13 public class DefaultContentTypeAction implements ContentTypeAction {
14
15         @Override
16         public Map<String, String> getLabels( ExportContext ctx, Collection<String> contents) throws ExportException {
17                 try {
18                         Map<String, String> labels = new HashMap<String, String>();
19                         labels.putAll( ctx.session.syncRequest( ExportQueries.labels( contents ) ) );
20                         return labels;
21                 } catch (DatabaseException e) {
22                         throw new ExportException(e);
23                 }
24         }
25
26 }