Skip to content
Snippets Groups Projects
Commit 9a790b94 authored by fedoreno's avatar fedoreno
Browse files

SSDM-3511: reformatted

SVN: 36339
parent 9ba9faa4
No related branches found
No related tags found
No related merge requests found
Showing
with 51 additions and 70 deletions
...@@ -21,8 +21,6 @@ import ch.ethz.sis.openbis.generic.server.asapi.v3.executor.entity.ISetEntityRel ...@@ -21,8 +21,6 @@ import ch.ethz.sis.openbis.generic.server.asapi.v3.executor.entity.ISetEntityRel
import ch.systemsx.cisd.openbis.generic.shared.dto.SamplePE; import ch.systemsx.cisd.openbis.generic.shared.dto.SamplePE;
/** /**
*
*
* @author Franz-Josef Elmer * @author Franz-Josef Elmer
*/ */
public interface ISetSampleProjectExecutor extends ISetEntityRelationsExecutor<SampleCreation, SamplePE> public interface ISetSampleProjectExecutor extends ISetEntityRelationsExecutor<SampleCreation, SamplePE>
......
...@@ -21,8 +21,6 @@ import ch.ethz.sis.openbis.generic.server.asapi.v3.executor.entity.IUpdateEntity ...@@ -21,8 +21,6 @@ import ch.ethz.sis.openbis.generic.server.asapi.v3.executor.entity.IUpdateEntity
import ch.systemsx.cisd.openbis.generic.shared.dto.SamplePE; import ch.systemsx.cisd.openbis.generic.shared.dto.SamplePE;
/** /**
*
*
* @author Franz-Josef Elmer * @author Franz-Josef Elmer
*/ */
public interface IUpdateSampleProjectExecutor extends IUpdateEntityRelationsExecutor<SampleUpdate, SamplePE> public interface IUpdateSampleProjectExecutor extends IUpdateEntityRelationsExecutor<SampleUpdate, SamplePE>
......
...@@ -22,8 +22,6 @@ import ch.ethz.sis.openbis.generic.server.asapi.v3.executor.IOperationContext; ...@@ -22,8 +22,6 @@ import ch.ethz.sis.openbis.generic.server.asapi.v3.executor.IOperationContext;
import ch.systemsx.cisd.openbis.generic.shared.dto.SamplePE; import ch.systemsx.cisd.openbis.generic.shared.dto.SamplePE;
/** /**
*
*
* @author Franz-Josef Elmer * @author Franz-Josef Elmer
*/ */
public interface IVerifySampleProjectExecutor public interface IVerifySampleProjectExecutor
......
...@@ -40,7 +40,7 @@ import ch.systemsx.cisd.base.exceptions.CheckedExceptionTunnel; ...@@ -40,7 +40,7 @@ import ch.systemsx.cisd.base.exceptions.CheckedExceptionTunnel;
public class ListSampleTechIdByIdentifier extends AbstractListTechIdById<SampleIdentifier> public class ListSampleTechIdByIdentifier extends AbstractListTechIdById<SampleIdentifier>
{ {
public static final String CONTAINER_SHORTCUT_ALLOWED_ATTRIBUTE = "container-shortcut-allowed"; public static final String CONTAINER_SHORTCUT_ALLOWED_ATTRIBUTE = "container-shortcut-allowed";
private String homeSpaceCodeOrNull; private String homeSpaceCodeOrNull;
public ListSampleTechIdByIdentifier(String homeSpaceCodeOrNull) public ListSampleTechIdByIdentifier(String homeSpaceCodeOrNull)
...@@ -74,7 +74,7 @@ public class ListSampleTechIdByIdentifier extends AbstractListTechIdById<SampleI ...@@ -74,7 +74,7 @@ public class ListSampleTechIdByIdentifier extends AbstractListTechIdById<SampleI
} }
return result; return result;
} }
private boolean getContainerShortcutAllowed(IOperationContext context) private boolean getContainerShortcutAllowed(IOperationContext context)
{ {
Object value = context.getAttribute(CONTAINER_SHORTCUT_ALLOWED_ATTRIBUTE); Object value = context.getAttribute(CONTAINER_SHORTCUT_ALLOWED_ATTRIBUTE);
...@@ -101,7 +101,7 @@ public class ListSampleTechIdByIdentifier extends AbstractListTechIdById<SampleI ...@@ -101,7 +101,7 @@ public class ListSampleTechIdByIdentifier extends AbstractListTechIdById<SampleI
return groupedIdentifiers; return groupedIdentifiers;
} }
private List<TechIdStringIdentifierRecord> list(final SampleQuery query, final SampleIdentifierParts key, private List<TechIdStringIdentifierRecord> list(final SampleQuery query, final SampleIdentifierParts key,
final Collection<String> codes, boolean containerShortcutAllowed) final Collection<String> codes, boolean containerShortcutAllowed)
{ {
final String[] codesArray = codes.toArray(new String[codes.size()]); final String[] codesArray = codes.toArray(new String[codes.size()]);
...@@ -174,8 +174,8 @@ public class ListSampleTechIdByIdentifier extends AbstractListTechIdById<SampleI ...@@ -174,8 +174,8 @@ public class ListSampleTechIdByIdentifier extends AbstractListTechIdById<SampleI
return query.listProjectSampleTechIdsByContainerCodeAndCodes(spaceCode, projectCode, containerCode, codesArray); return query.listProjectSampleTechIdsByContainerCodeAndCodes(spaceCode, projectCode, containerCode, codesArray);
} }
private List<TechIdStringIdentifierRecord> listWithoutContainerOrWithSomeContainerAndUniqueCode(SampleQuery query, private List<TechIdStringIdentifierRecord> listWithoutContainerOrWithSomeContainerAndUniqueCode(SampleQuery query,
String[] codes, IListAction listWithoutContainer, IListAction listWithSomeContainer, String[] codes, IListAction listWithoutContainer, IListAction listWithSomeContainer,
boolean containerShortcutAllowed) boolean containerShortcutAllowed)
{ {
try try
......
...@@ -25,8 +25,6 @@ import ch.ethz.sis.openbis.generic.server.asapi.v3.executor.common.TechIdStringI ...@@ -25,8 +25,6 @@ import ch.ethz.sis.openbis.generic.server.asapi.v3.executor.common.TechIdStringI
import ch.ethz.sis.openbis.generic.server.asapi.v3.helper.common.AbstractListTechIdByPermId; import ch.ethz.sis.openbis.generic.server.asapi.v3.helper.common.AbstractListTechIdByPermId;
/** /**
*
*
* @author Franz-Josef Elmer * @author Franz-Josef Elmer
*/ */
public class ListSampleTechIdByPermId extends AbstractListTechIdByPermId<SamplePermId> public class ListSampleTechIdByPermId extends AbstractListTechIdByPermId<SamplePermId>
......
...@@ -19,7 +19,9 @@ package ch.ethz.sis.openbis.generic.server.asapi.v3.executor.sample; ...@@ -19,7 +19,9 @@ package ch.ethz.sis.openbis.generic.server.asapi.v3.executor.sample;
public final class SampleIdentifierParts public final class SampleIdentifierParts
{ {
private String spaceCodeOrNull; private String spaceCodeOrNull;
private String projectCodeOrNull; private String projectCodeOrNull;
private String containerCodeOrNull; private String containerCodeOrNull;
SampleIdentifierParts(String spaceCodeOrNull, String projectCodeOrNull, String containerCodeOrNull) SampleIdentifierParts(String spaceCodeOrNull, String projectCodeOrNull, String containerCodeOrNull)
...@@ -56,23 +58,23 @@ public final class SampleIdentifierParts ...@@ -56,23 +58,23 @@ public final class SampleIdentifierParts
return false; return false;
} }
SampleIdentifierParts key = (SampleIdentifierParts) obj; SampleIdentifierParts key = (SampleIdentifierParts) obj;
return isEqual(spaceCodeOrNull, key.spaceCodeOrNull) return isEqual(spaceCodeOrNull, key.spaceCodeOrNull)
&& isEqual(projectCodeOrNull, key.projectCodeOrNull) && isEqual(projectCodeOrNull, key.projectCodeOrNull)
&& isEqual(containerCodeOrNull, key.containerCodeOrNull); && isEqual(containerCodeOrNull, key.containerCodeOrNull);
} }
private boolean isEqual(String str1, String str2) private boolean isEqual(String str1, String str2)
{ {
return str1 == null ? str1 == str2 : str1.equals(str2); return str1 == null ? str1 == str2 : str1.equals(str2);
} }
@Override @Override
public int hashCode() public int hashCode()
{ {
return 37 * (37 * calcHashCode(spaceCodeOrNull) + calcHashCode(projectCodeOrNull)) return 37 * (37 * calcHashCode(spaceCodeOrNull) + calcHashCode(projectCodeOrNull))
+ calcHashCode(containerCodeOrNull); + calcHashCode(containerCodeOrNull);
} }
private int calcHashCode(String str) private int calcHashCode(String str)
{ {
return str == null ? 0 : str.hashCode(); return str == null ? 0 : str.hashCode();
......
...@@ -23,8 +23,6 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.SampleTypePE; ...@@ -23,8 +23,6 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.SampleTypePE;
import ch.systemsx.cisd.openbis.generic.shared.dto.properties.EntityKind; import ch.systemsx.cisd.openbis.generic.shared.dto.properties.EntityKind;
/** /**
*
*
* @author Franz-Josef Elmer * @author Franz-Josef Elmer
*/ */
@Component @Component
......
...@@ -33,13 +33,11 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.ProjectPE; ...@@ -33,13 +33,11 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.ProjectPE;
import ch.systemsx.cisd.openbis.generic.shared.dto.SamplePE; import ch.systemsx.cisd.openbis.generic.shared.dto.SamplePE;
/** /**
*
*
* @author Franz-Josef Elmer * @author Franz-Josef Elmer
*/ */
@Component @Component
public class SetSampleProjectExecutor extends AbstractSetEntityToOneRelationExecutor<SampleCreation, SamplePE, IProjectId, ProjectPE> public class SetSampleProjectExecutor extends AbstractSetEntityToOneRelationExecutor<SampleCreation, SamplePE, IProjectId, ProjectPE>
implements ISetSampleProjectExecutor implements ISetSampleProjectExecutor
{ {
@Autowired @Autowired
private IMapProjectByIdExecutor mapProjectByIdExecutor; private IMapProjectByIdExecutor mapProjectByIdExecutor;
...@@ -48,7 +46,7 @@ public class SetSampleProjectExecutor extends AbstractSetEntityToOneRelationExec ...@@ -48,7 +46,7 @@ public class SetSampleProjectExecutor extends AbstractSetEntityToOneRelationExec
protected IProjectId getRelatedId(SampleCreation creation) protected IProjectId getRelatedId(SampleCreation creation)
{ {
// TODO: project samples // TODO: project samples
// return creation.getProjectId(); // return creation.getProjectId();
return null; return null;
} }
......
...@@ -60,7 +60,7 @@ public class UpdateSampleExecutor extends AbstractUpdateEntityExecutor<SampleUpd ...@@ -60,7 +60,7 @@ public class UpdateSampleExecutor extends AbstractUpdateEntityExecutor<SampleUpd
@Autowired @Autowired
private IUpdateSampleProjectExecutor updateSampleProjectExecutor; private IUpdateSampleProjectExecutor updateSampleProjectExecutor;
@Autowired @Autowired
private IUpdateSampleExperimentExecutor updateSampleExperimentExecutor; private IUpdateSampleExperimentExecutor updateSampleExperimentExecutor;
......
...@@ -35,12 +35,10 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.ProjectPE; ...@@ -35,12 +35,10 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.ProjectPE;
import ch.systemsx.cisd.openbis.generic.shared.dto.SamplePE; import ch.systemsx.cisd.openbis.generic.shared.dto.SamplePE;
/** /**
*
*
* @author Franz-Josef Elmer * @author Franz-Josef Elmer
*/ */
@Component @Component
public class UpdateSampleProjectExecutor extends AbstractUpdateEntityToOneRelationExecutor<SampleUpdate, SamplePE, IProjectId, ProjectPE> public class UpdateSampleProjectExecutor extends AbstractUpdateEntityToOneRelationExecutor<SampleUpdate, SamplePE, IProjectId, ProjectPE>
implements IUpdateSampleProjectExecutor implements IUpdateSampleProjectExecutor
{ {
@Autowired @Autowired
...@@ -52,30 +50,26 @@ public class UpdateSampleProjectExecutor extends AbstractUpdateEntityToOneRelati ...@@ -52,30 +50,26 @@ public class UpdateSampleProjectExecutor extends AbstractUpdateEntityToOneRelati
return new ProjectIdentifier(related.getIdentifier()); return new ProjectIdentifier(related.getIdentifier());
} }
@Override @Override
protected ProjectPE getCurrentlyRelated(SamplePE entity) protected ProjectPE getCurrentlyRelated(SamplePE entity)
{ {
return entity.getProject(); return entity.getProject();
} }
@Override @Override
protected FieldUpdateValue<IProjectId> getRelatedUpdate(SampleUpdate update) protected FieldUpdateValue<IProjectId> getRelatedUpdate(SampleUpdate update)
{ {
// TODO: project samples // TODO: project samples
// return update.getProjectId(); // return update.getProjectId();
return null; return null;
} }
@Override @Override
protected Map<IProjectId, ProjectPE> map(IOperationContext context, List<IProjectId> relatedIds) protected Map<IProjectId, ProjectPE> map(IOperationContext context, List<IProjectId> relatedIds)
{ {
return mapProjectByIdExecutor.map(context, relatedIds); return mapProjectByIdExecutor.map(context, relatedIds);
} }
@Override @Override
protected void check(IOperationContext context, SamplePE entity, IProjectId relatedId, ProjectPE related) protected void check(IOperationContext context, SamplePE entity, IProjectId relatedId, ProjectPE related)
{ {
...@@ -85,7 +79,6 @@ public class UpdateSampleProjectExecutor extends AbstractUpdateEntityToOneRelati ...@@ -85,7 +79,6 @@ public class UpdateSampleProjectExecutor extends AbstractUpdateEntityToOneRelati
} }
} }
@Override @Override
protected void update(IOperationContext context, SamplePE entity, ProjectPE related) protected void update(IOperationContext context, SamplePE entity, ProjectPE related)
{ {
......
...@@ -40,7 +40,7 @@ public class VerifySampleExecutor implements IVerifySampleExecutor ...@@ -40,7 +40,7 @@ public class VerifySampleExecutor implements IVerifySampleExecutor
@Autowired @Autowired
private IVerifySampleExperimentExecutor verifySampleExperimentExecutor; private IVerifySampleExperimentExecutor verifySampleExperimentExecutor;
@Autowired @Autowired
private IVerifySampleContainerExecutor verifySampleContainerExecutor; private IVerifySampleContainerExecutor verifySampleContainerExecutor;
...@@ -53,7 +53,7 @@ public class VerifySampleExecutor implements IVerifySampleExecutor ...@@ -53,7 +53,7 @@ public class VerifySampleExecutor implements IVerifySampleExecutor
verifyEntityPropertyExecutor.verify(context, samples); verifyEntityPropertyExecutor.verify(context, samples);
verifySampleExperimentExecutor.verify(context, samples); verifySampleExperimentExecutor.verify(context, samples);
// TODO: project samples // TODO: project samples
// verifySampleProjectExecutor.verify(context, samples); // verifySampleProjectExecutor.verify(context, samples);
verifySampleContainerExecutor.verify(context, samples); verifySampleContainerExecutor.verify(context, samples);
verifySampleParentsExecutor.verify(context, samples); verifySampleParentsExecutor.verify(context, samples);
} }
......
...@@ -20,8 +20,6 @@ import ch.ethz.sis.openbis.generic.asapi.v3.dto.space.id.ISpaceId; ...@@ -20,8 +20,6 @@ import ch.ethz.sis.openbis.generic.asapi.v3.dto.space.id.ISpaceId;
import ch.ethz.sis.openbis.generic.server.asapi.v3.executor.common.IMapObjectByIdExecutor; import ch.ethz.sis.openbis.generic.server.asapi.v3.executor.common.IMapObjectByIdExecutor;
/** /**
*
*
* @author Franz-Josef Elmer * @author Franz-Josef Elmer
*/ */
public interface IMapSpaceTechIdByIdExecutor extends IMapObjectByIdExecutor<ISpaceId, Long> public interface IMapSpaceTechIdByIdExecutor extends IMapObjectByIdExecutor<ISpaceId, Long>
......
...@@ -25,8 +25,6 @@ import ch.ethz.sis.openbis.generic.server.asapi.v3.executor.common.TechIdStringI ...@@ -25,8 +25,6 @@ import ch.ethz.sis.openbis.generic.server.asapi.v3.executor.common.TechIdStringI
import ch.ethz.sis.openbis.generic.server.asapi.v3.helper.common.AbstractListTechIdByPermId; import ch.ethz.sis.openbis.generic.server.asapi.v3.helper.common.AbstractListTechIdByPermId;
/** /**
*
*
* @author Franz-Josef Elmer * @author Franz-Josef Elmer
*/ */
public class ListSpaceTechIdByPermId extends AbstractListTechIdByPermId<SpacePermId> public class ListSpaceTechIdByPermId extends AbstractListTechIdByPermId<SpacePermId>
......
...@@ -32,7 +32,8 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.MetaprojectPE; ...@@ -32,7 +32,8 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.MetaprojectPE;
* @author pkupczyk * @author pkupczyk
*/ */
@Component @Component
public class UpdateTagDataSetsWithCacheExecutor extends UpdateTagEntitiesWithCacheExecutor<IDataSetId, DataPE> implements IUpdateTagDataSetsWithCacheExecutor public class UpdateTagDataSetsWithCacheExecutor extends UpdateTagEntitiesWithCacheExecutor<IDataSetId, DataPE> implements
IUpdateTagDataSetsWithCacheExecutor
{ {
@Override @Override
......
...@@ -35,7 +35,8 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.MetaprojectPE; ...@@ -35,7 +35,8 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.MetaprojectPE;
* @author pkupczyk * @author pkupczyk
*/ */
@Component @Component
public class UpdateTagExperimentsExecutor extends AbstractUpdateEntityMultipleRelationsExecutor<TagUpdate, MetaprojectPE, IExperimentId, ExperimentPE> public class UpdateTagExperimentsExecutor extends
AbstractUpdateEntityMultipleRelationsExecutor<TagUpdate, MetaprojectPE, IExperimentId, ExperimentPE>
implements IUpdateTagExperimentsExecutor implements IUpdateTagExperimentsExecutor
{ {
......
...@@ -26,8 +26,6 @@ import ch.ethz.sis.openbis.generic.server.asapi.v3.executor.IOperationContext; ...@@ -26,8 +26,6 @@ import ch.ethz.sis.openbis.generic.server.asapi.v3.executor.IOperationContext;
import ch.ethz.sis.openbis.generic.server.asapi.v3.executor.common.TechIdStringIdentifierRecord; import ch.ethz.sis.openbis.generic.server.asapi.v3.executor.common.TechIdStringIdentifierRecord;
/** /**
*
*
* @author Franz-Josef Elmer * @author Franz-Josef Elmer
*/ */
public abstract class AbstractListTechIdByPermId<ID extends ObjectPermId> extends AbstractListTechIdById<ID> public abstract class AbstractListTechIdByPermId<ID extends ObjectPermId> extends AbstractListTechIdById<ID>
...@@ -40,7 +38,7 @@ public abstract class AbstractListTechIdByPermId<ID extends ObjectPermId> extend ...@@ -40,7 +38,7 @@ public abstract class AbstractListTechIdByPermId<ID extends ObjectPermId> extend
for (ID permId : ids) for (ID permId : ids)
{ {
permIds.add(permId.getPermId()); permIds.add(permId.getPermId());
} }
String[] permIdsAsArray = permIds.toArray(new String[permIds.size()]); String[] permIdsAsArray = permIds.toArray(new String[permIds.size()]);
Map<Long, ID> result = new HashMap<>(); Map<Long, ID> result = new HashMap<>();
List<TechIdStringIdentifierRecord> queryTechIds = queryTechIds(permIdsAsArray); List<TechIdStringIdentifierRecord> queryTechIds = queryTechIds(permIdsAsArray);
...@@ -50,9 +48,9 @@ public abstract class AbstractListTechIdByPermId<ID extends ObjectPermId> extend ...@@ -50,9 +48,9 @@ public abstract class AbstractListTechIdByPermId<ID extends ObjectPermId> extend
} }
return result; return result;
} }
protected abstract List<TechIdStringIdentifierRecord> queryTechIds(String[] permIds); protected abstract List<TechIdStringIdentifierRecord> queryTechIds(String[] permIds);
protected abstract ID createPermId(String permIdAsString); protected abstract ID createPermId(String permIdAsString);
} }
...@@ -59,7 +59,7 @@ public class MapObjectById<ID, OBJECT> ...@@ -59,7 +59,7 @@ public class MapObjectById<ID, OBJECT>
return idClassToIdListMap; return idClassToIdListMap;
} }
private Map mapByIds(IOperationContext context, List<IListObjectById<? extends ID, OBJECT>> listers, private Map mapByIds(IOperationContext context, List<IListObjectById<? extends ID, OBJECT>> listers,
Map<Class, List> idClassToIdListMap) Map<Class, List> idClassToIdListMap)
{ {
final Map idToObject = new HashMap(); final Map idToObject = new HashMap();
...@@ -67,7 +67,7 @@ public class MapObjectById<ID, OBJECT> ...@@ -67,7 +67,7 @@ public class MapObjectById<ID, OBJECT>
for (Class idClass : idClassToIdListMap.keySet()) for (Class idClass : idClassToIdListMap.keySet())
{ {
List idList = idClassToIdListMap.get(idClass); List idList = idClassToIdListMap.get(idClass);
IListObjectById listerForIdClass = findLister(listers, idClass, idList); IListObjectById listerForIdClass = findLister(listers, idClass, idList);
List objects = listerForIdClass.listByIds(context, idList); List objects = listerForIdClass.listByIds(context, idList);
if (objects != null) if (objects != null)
{ {
...@@ -94,7 +94,7 @@ public class MapObjectById<ID, OBJECT> ...@@ -94,7 +94,7 @@ public class MapObjectById<ID, OBJECT>
throw new UnsupportedObjectIdException((IObjectId) idList.iterator().next()); throw new UnsupportedObjectIdException((IObjectId) idList.iterator().next());
} }
public Map<ID, OBJECT> map(IOperationContext context, List<IListObjectById<? extends ID, OBJECT>> listers, public Map<ID, OBJECT> map(IOperationContext context, List<IListObjectById<? extends ID, OBJECT>> listers,
Collection<? extends ID> ids) Collection<? extends ID> ids)
{ {
Map<Class, List> idClassToIdListMap = groupIdsByClass(ids); Map<Class, List> idClassToIdListMap = groupIdsByClass(ids);
......
...@@ -151,7 +151,7 @@ public class Generator extends AbstractGenerator ...@@ -151,7 +151,7 @@ public class Generator extends AbstractGenerator
addModificationDate(gen); addModificationDate(gen);
gen.setToStringMethod("\"SampleType \" + code"); gen.setToStringMethod("\"SampleType \" + code");
gen.addPluralFetchedField("List<PropertyAssignment>", List.class.getName(), "propertyAssignments", gen.addPluralFetchedField("List<PropertyAssignment>", List.class.getName(), "propertyAssignments",
"Property assigments", PropertyAssignmentFetchOptions.class); "Property assigments", PropertyAssignmentFetchOptions.class);
return gen; return gen;
...@@ -224,7 +224,7 @@ public class Generator extends AbstractGenerator ...@@ -224,7 +224,7 @@ public class Generator extends AbstractGenerator
addModificationDate(gen); addModificationDate(gen);
gen.setToStringMethod("\"ExperimentType \" + code"); gen.setToStringMethod("\"ExperimentType \" + code");
gen.addPluralFetchedField("List<PropertyAssignment>", List.class.getName(), "propertyAssignments", gen.addPluralFetchedField("List<PropertyAssignment>", List.class.getName(), "propertyAssignments",
"Property assigments", PropertyAssignmentFetchOptions.class); "Property assigments", PropertyAssignmentFetchOptions.class);
// TODO add validation script // TODO add validation script
...@@ -287,7 +287,7 @@ public class Generator extends AbstractGenerator ...@@ -287,7 +287,7 @@ public class Generator extends AbstractGenerator
addModificationDate(gen); addModificationDate(gen);
gen.setToStringMethod("\"DataSetType \" + code"); gen.setToStringMethod("\"DataSetType \" + code");
gen.addPluralFetchedField("List<PropertyAssignment>", List.class.getName(), "propertyAssignments", gen.addPluralFetchedField("List<PropertyAssignment>", List.class.getName(), "propertyAssignments",
"Property assigments", PropertyAssignmentFetchOptions.class); "Property assigments", PropertyAssignmentFetchOptions.class);
// TODO add validation script // TODO add validation script
...@@ -548,7 +548,7 @@ public class Generator extends AbstractGenerator ...@@ -548,7 +548,7 @@ public class Generator extends AbstractGenerator
addModificationDate(gen); addModificationDate(gen);
gen.setToStringMethod("\"MaterialType \" + code"); gen.setToStringMethod("\"MaterialType \" + code");
gen.addPluralFetchedField("List<PropertyAssignment>", List.class.getName(), "propertyAssignments", gen.addPluralFetchedField("List<PropertyAssignment>", List.class.getName(), "propertyAssignments",
"Property assigments", PropertyAssignmentFetchOptions.class); "Property assigments", PropertyAssignmentFetchOptions.class);
return gen; return gen;
......
...@@ -97,8 +97,7 @@ public class UltimateJSEntityGenerator ...@@ -97,8 +97,7 @@ public class UltimateJSEntityGenerator
.replaceAll("==", "===") .replaceAll("==", "===")
.replaceAll("!=", "!==") .replaceAll("!=", "!==")
// Remove Comments // Remove Comments
.replaceAll("(?:/\\*(?:[^*]|(?:\\*+[^*/]))*\\*+/)|(?://.*)", "") .replaceAll("(?:/\\*(?:[^*]|(?:\\*+[^*/]))*\\*+/)|(?://.*)", "");
;
} }
private static final void whriteStringAsFile(String filePath, String string) throws IOException private static final void whriteStringAsFile(String filePath, String string) throws IOException
......
...@@ -3,19 +3,22 @@ package ch.ethz.sis.openbis.generic.server.asapi.v3.helper.generators.uglify; ...@@ -3,19 +3,22 @@ package ch.ethz.sis.openbis.generic.server.asapi.v3.helper.generators.uglify;
import javax.script.ScriptEngine; import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager; import javax.script.ScriptEngineManager;
public class ECMAScriptEngineFactory { public class ECMAScriptEngineFactory
{
public static ScriptEngine getECMAScriptEngine(){
ScriptEngine engine = null; public static ScriptEngine getECMAScriptEngine()
ScriptEngineManager manager = new ScriptEngineManager(); {
ScriptEngine engine = null;
engine = manager.getEngineByExtension("js"); ScriptEngineManager manager = new ScriptEngineManager();
if(engine == null){ engine = manager.getEngineByExtension("js");
throw new RuntimeException("the java version do not install ECMAScipt engine, must be above java 1.6");
} if (engine == null)
{
return engine; throw new RuntimeException("the java version do not install ECMAScipt engine, must be above java 1.6");
} }
return engine;
}
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment