use of com.runwaysdk.dataaccess.transaction.Transaction in project geoprism-registry by terraframe.
the class LocalizationService method installLocaleInTransaction.
@Transaction
private LocaleView installLocaleInTransaction(LocaleView view) {
SupportedLocaleIF supportedLocale = (SupportedLocale) com.runwaysdk.localization.LocalizationFacade.install(view.getLocale());
supportedLocale.appLock();
view.populate(supportedLocale);
supportedLocale.apply();
new WMSService().createAllWMSLayers(true);
// Refresh the users session
((Session) Session.getCurrentSession()).reloadPermissions();
// Refresh the entire metadata cache
ServiceFactory.getRegistryService().refreshMetadataCache();
return LocaleView.fromSupportedLocale(supportedLocale);
}
use of com.runwaysdk.dataaccess.transaction.Transaction in project geoprism-registry by terraframe.
the class ServerGeoObjectType method deleteMdAttributeFromAttributeType.
/**
* Delete the {@link MdAttributeConcreteDAOIF} from the given {
*
* @param type
* TODO
* @param mdBusiness
* @param attributeName
*/
@Transaction
public void deleteMdAttributeFromAttributeType(String attributeName) {
MdAttributeConcreteDAOIF mdAttributeConcreteDAOIF = getMdAttribute(this.mdBusiness, attributeName);
if (mdAttributeConcreteDAOIF != null) {
if (mdAttributeConcreteDAOIF instanceof MdAttributeTermDAOIF || mdAttributeConcreteDAOIF instanceof MdAttributeMultiTermDAOIF) {
String attributeTermKey = TermConverter.buildtAtttributeKey(this.mdBusiness.getTypeName(), mdAttributeConcreteDAOIF.definesAttribute());
try {
Classifier attributeTerm = Classifier.getByKey(attributeTermKey);
attributeTerm.delete();
} catch (DataNotFoundException e) {
}
}
mdAttributeConcreteDAOIF.getBusinessDAO().delete();
Optional<AttributeType> optional = this.type.getAttribute(attributeName);
if (optional.isPresent()) {
ListType.deleteMdAttribute(this.universal, optional.get());
}
}
MdAttributeDAOIF mdAttributeDAO = this.mdVertex.definesAttribute(attributeName);
if (mdAttributeDAO != null) {
mdAttributeDAO.getBusinessDAO().delete();
}
}
use of com.runwaysdk.dataaccess.transaction.Transaction in project geoprism-registry by terraframe.
the class ChangeRequestService method markAllAsInvalid.
@Transaction
public void markAllAsInvalid(ServerGeoObjectType type) {
String reason = LocalizationFacade.localize("changeRequest.invalidate.deleteReferencedGeoObjectType");
ChangeRequestQuery crq = new ChangeRequestQuery(new QueryFactory());
crq.WHERE(crq.getApprovalStatus().containsExactly(AllGovernanceStatus.PENDING));
try (OIterator<? extends ChangeRequest> it = crq.getIterator()) {
for (ChangeRequest cr : it) {
if (cr.getGeoObjectTypeCode().equals(type.getCode())) {
cr.invalidate(reason);
}
}
}
}
use of com.runwaysdk.dataaccess.transaction.Transaction in project geoprism-registry by terraframe.
the class ChangeRequestService method uploadFileInTransactionCR.
@Transaction
String uploadFileInTransactionCR(String requestId, String fileName, InputStream fileStream) {
ChangeRequest request = ChangeRequest.get(requestId);
if (!this.permService.getPermissions(request).contains(ChangeRequestPermissionAction.WRITE_DOCUMENTS)) {
throw new CGRPermissionException();
}
VaultFile vf = VaultFile.createAndApply(fileName, fileStream);
request.addDocument(vf).apply();
JsonObject jo = new JsonObject();
jo.addProperty("fileName", vf.getName());
jo.addProperty("oid", vf.getOid());
jo.addProperty("requestId", requestId);
return jo.toString();
}
use of com.runwaysdk.dataaccess.transaction.Transaction in project geoprism-registry by terraframe.
the class SearchService method clear.
@Transaction
public void clear() {
String suffix = this.getSuffix();
MdVertexDAOIF mdVertex = MdVertexDAO.getMdVertexDAO(PACKAGE + "." + VERTEX_PREFIX + suffix);
StringBuilder statement = new StringBuilder();
statement.append("DELETE VERTEX " + mdVertex.getDBClassName());
GraphDBService service = GraphDBService.getInstance();
GraphRequest request = service.getGraphDBRequest();
service.command(request, statement.toString(), new HashMap<>());
}
Aggregations