use of io.clownfish.clownfish.dbentities.CfKeywordlistcontent in project Clownfish by rawdog71.
the class RestKeywordListContent method insertKeywordListContent.
private RestKeywordListContentParameter insertKeywordListContent(RestKeywordListContentParameter iklp) {
try {
String token = iklp.getToken();
if (authtokenlist.checkValidToken(token)) {
String apikey = iklp.getApikey();
if (apikeyutil.checkApiKey(apikey, "RestService")) {
try {
CfKeywordlistcontent keywordlistcontent = cfkeywordlistcontentService.findByKeywordrefAndKeywordlistref(iklp.getKeywordref(), iklp.getKeywordlistref());
LOGGER.warn("Duplicate Keywordlistcontent");
iklp.setReturncode("Duplicate Keywordlistcontent");
} catch (javax.persistence.NoResultException ex) {
CfKeywordlistcontent newkeywordlistcontent = new CfKeywordlistcontent();
newkeywordlistcontent.setCfKeywordlistcontentPK(new CfKeywordlistcontentPK(iklp.getKeywordlistref(), iklp.getKeywordref()));
CfKeywordlistcontent newkeywordliscontent2 = cfkeywordlistcontentService.create(newkeywordlistcontent);
iklp.setReturncode("OK");
}
} else {
iklp.setReturncode("Wrong API KEY");
}
} else {
iklp.setReturncode("Invalid token");
}
} catch (javax.persistence.NoResultException ex) {
LOGGER.error("NoResultException");
iklp.setReturncode("NoResultException");
}
return iklp;
}
use of io.clownfish.clownfish.dbentities.CfKeywordlistcontent in project Clownfish by rawdog71.
the class RestKeywordListContent method deleteKeywordListContent.
private RestKeywordListContentParameter deleteKeywordListContent(RestKeywordListContentParameter iklp) {
try {
String token = iklp.getToken();
if (authtokenlist.checkValidToken(token)) {
String apikey = iklp.getApikey();
if (apikeyutil.checkApiKey(apikey, "RestService")) {
try {
CfKeywordlistcontent keywordlistcontent = cfkeywordlistcontentService.findByKeywordrefAndKeywordlistref(iklp.getKeywordref(), iklp.getKeywordlistref());
cfkeywordlistcontentService.delete(keywordlistcontent);
iklp.setReturncode("OK");
} catch (javax.persistence.NoResultException ex) {
LOGGER.warn("Keywordlistcontent not found");
iklp.setReturncode("Keywordlistcontent not found");
}
} else {
iklp.setReturncode("Wrong API KEY");
}
} else {
iklp.setReturncode("Invalid token");
}
} catch (javax.persistence.NoResultException ex) {
LOGGER.error("NoResultException");
iklp.setReturncode("NoResultException");
}
return iklp;
}
Aggregations