How to rewrite URL in Oracle Content and Experience - url-rewriting

How can I rewrite urls in Oracle Content and Experience. I want to rewrite url
/?categoryId=1
to
/1/example
Thank you.

If this is in the context of an Oracle Content and Experience site you can craft a redirects.json file with redirect rules. A sample one for your particular example might look like this:
{
"redirectRules": [
{
"type": "wildcard",
"expression": "/?categoryId=*",
"location": "/site/SampleSite/<$categoryId$>/example"
}
]
}
There is more information on this file format here.
Information about uploading this file can be found here.

Related

Laravel JSON-API, includes are not consistent when a model is included multiple times

We have stumbled across a bug that I can only assume is a bug with the JSON API code. This is for the old laravel JSON API (in my composer.json file its "cloudcreativity/laravel-json-api": "^2.0")
The issue is when a resource is included multiple times (in different ways), it is possible to not get all the include information you asked for.
In my example, I am dealing with timesheets. Timesheets belong to a user. They are also approved by a user. Those users are usually different users, but not always. If I want to include both, I would add include=user,approved-by, and this works great.
The front end also sometimes needs to know the employeeType of the user, so we instead use include=user.employee-type,approved-by, and again this works, we get the employee type info for the user. The issue arises when the user is the same as the approver. It appears that JSON-API gets the approved-by user (without the employee type include data), then when it tries to get the timesheet user, it sees that is has already grabbed that user, and just stops there.
The difference in the output is:
The include with the related in
"employeeType": {
"data": {
"type": "employee-types",
"id": "1"
},
"links": {
"self": "link url",
"related": "link url"
}
},
Vs the include without all the related info
"employeeType": {
"links": {
"self": "link url",
"related": "link url"
}
},
We have a work around, where we need to include the employee type of the user and a the approver, but that seems cumbersome and annoying.
I was wondering if anyone knows if there is any good fix for this? Or if this has been fixed in the more recent version (could be the kick in the pants we need to actually migrate to the most recent version of the library)

update frequency of recaptcha analytics

We recently got reCAPTCHA on one of our sites.
Im getting asked to pull out the data, which is pretty simple and is all fine in CSV format and everything.
My question(s) is when do the data update? It seems like its every 24hrs, but im not really sure.
Also is there a way to get more data than the "Date,no CAPTCHAs,Passed CAPTCHAs,Failed CAPTCHAs,Total Sessions,Failed Sessions,Average Response Time (seconds),Average score"?
Thanks in advance
Reading the analytics FAQ
If you are using reCAPTCHA Enterprise you can use the GetMetrics gRPC endpoint or REST endpoint. This will return metrics about both Scores and Challenges (CAPTCHAs).
{
"name": string,
"startTime": string,
"scoreMetrics": [
{
object (ScoreMetrics)
}
],
"challengeMetrics": [
{
object (ChallengeMetrics)
}
]
}
These metrics should be approximately real-time, that values should change within ~minutes of events occurring.

What public information in a profile does the G+ People search API look into when performing a search?

I am talking about the functionality of the API that can be tested here: https://developers.google.com/+/web/api/rest/latest/people/search
I used to think it looks into all the public fields of a profile ("Specify a query string for full text search of public text in all profiles."), but it seems you can't search by email, telephone or some of the education and work information (even if the expected resulting profiles make this information public).
So my question is, what public data does this search use to retrieve its results? I can't find any documentation on this.
People: search
query string Specify a query string for full text search of public text in all profiles.
I found a random user. here I picked this guy because he had a lot of text in his profile.
Lets search on "gdesignart" This is part of his display name.
{
"kind": "plus#person",
"etag": "\"Sh4n9u6EtD24TM0RmWv7jTXojqc/W9DoYLbchkxsXWI_HhuWV6G7lJY\"",
"objectType": "person",
"id": "116044052555068441384",
"displayName": "Marcello Ghirardi (gdesignart)",
"url": "https://plus.google.com/116044052555068441384",
"image": {
"url": "https://lh3.googleusercontent.com/-IqYeJSv07cI/AAAAAAAAAAI/AAAAAAAAAPM/yw8nbO0Ho6g/photo.jpg?sz=50"
}
Works fine and I get a response.
Now lets try some text from his tagline or introduction arguably we could say this qualifies as public text on his profile.
I tried the following
G-Design®
è un brand
Pollutre of different world
None worked. If you look at the response the only thing in the response is the users display name. From my experience with other google APIs I can tell you that I don't think its going to let you search on any field that is not part of its response. So you are only going to be searching on DisplayName. For the fun of it I searched on his ID that didn't return anything either.
Answer: search is on display name only.
I would recommend adding this as a feature request if you link it here I will happily add my name to it. Google plus issue forum

Using MongoLab with Mongoose and models using ObjectIds

I'm using MongoLab add-on on Heroku.
My app use Mongoose and According to the docs the document id type is ObjectID (by default).
This is why my json looks something like that:
{
"__v" : 0,
"_id" : ObjectId("53c824d6f26327e00f9ae117"),
"company" : "53c824d6f26327e00f9ae118",
...
}
The problem: MongoLab addon does not khow how to parse the keyword "ObjectID", displaying an error message.
Am i missing something here? What can be done?
If you're referring to the JSON editor in the MongoLab web UI, it only accepts strict JSON formatting. For special types like ObjectId's and dates, you need to use their associated extended JSON format. For an ObjectId, that would look like:
{
"__v": 0,
"_id": {"$oid": "53c824d6f26327e00f9ae117"},
"company": "53c824d6f26327e00f9ae118",
...
}
Hopefully that helps! You can always feel free to write us at support#mongolab.com for any questions or issues.
Kind regards,
Sean#MongoLab

Carrot2+ElasticSearch Basic Flow of Information

I am using Carrot2 and ElasticSearch. I has elastic search server running with a lot of data when I installed carrot2 plugin.
Wanted to get answers to a few basic questions:
Will clustering work only on newly indexed documents or even old documents?
How can I specify which fields to look at for clustering?
The curl command is working and giving some results. How can I get the curl command which takes a JSON as input to a REST API url of the form localhost:9200/article-index/article/_search_with_clusters?.....
Appreciate any help.
Yes, if you want to use the plugin straight off the ES installation, you need to make REST calls of your own. I believe you are using Python. Take a look at requests. It is a delightful REST tool for python.
To make POST requests you can do the following :
import json
url = 'localhost:9200/article-index/article/_search_with_clusters'
payload = {'some': 'data'}
r = requests.post(url, data=json.dumps(payload))
print r.text
Find more information at requests documentation.
Will clustering work only on newly indexed documents or even old
documents?
It will work even on old documments
How can I specify which fields to look at for clustering?
Here's an example using the shakepspeare dataset. The query is which of shakespeare's plays are about war?
$ curl -XPOST http://localhost:9200/shakespeare/_search_with_clusters?pretty -d '
{
"search_request": {
"query": {"match" : { "_all": "war" }},
"size": 100
},
"max_hits": 0,
"query_hint": "war",
"field_mapping": {
"title": ["_source.play_name"],
"content": ["_source.text_entry"]
},
"algorithm": "lingo"
}'
Running this you'll get back plays like Richard, Henry... The title is what carrot2 uses to develop the cluster names and the text entry is what it uses to make the clusters.
The curl command is working and giving some results. How can I get the
curl command which takes a JSON as input to a REST API url of the form
localhost:9200/article-index/article/_search_with_clusters?.....
Typically use the elasticsearch client libraries for your language of choice.

Resources