Sensenet: Documents Sharing - sensenet

I'm trying to list the shared files in dashboard through #sensenet/query. But I didn't find any documentation about that. I also tried using the #sensenet/query but I can't find any proper query for that.Please help

SharedWidth is a reference field on every content in sensenet, that contains the list of users with whom the content is shared. So you can search by this field the same as by other reference field is sensenet queries.
For example if you want to search for the documents that are shared with the current user, add the following to the query:
SharedWith:##CurrentUser##

Related

CHANGEDOCUMENT_READ_HEADERS Why can't I read the creator of an entry?

I started using CHANGEDOCUMENT_READ_HEADERS today and I need to find the creator of an entry. I've noticed that when there are no changes after the creation there will occur an error.
So if you just created an entry and try to get its changes via CHANGEDOCUMENT_READ_HEADERS, you'll get the NO_POSITION_FOUND exception. Apperantly, the creation of an entry, although it is visible in the changelog, does not count as a change.
Does anybody know a FM which allows me to find the creator of an entry?
Thanks!
The CHANGEDOCUMENT_READ_HEADERS function module searches the change documents on the table CDHDR and CDPOS, if no changes were made on the document (Purchase order, FI document, etc.) no change document will be created.
To get the creator of an entry, you will need to get it directly from the table that stores the information or BAPI for that document.
For exemple:
The purchase order creator can be found on the table EKKO (Purchasing Document Header) field ERNAM (Created by).

How to re-rank documents based on their attributes rather than just their field relevance?

I'm trying to use Solr to re-rank document results based relevance to the user searching. For example, if I search joann*this could return documents where the Name field is anything from joanna to joanne. What I'm trying to do is to return documents that match on certain attributes that I have as well-- this could be something like us both having the field Location = "NYC".
So my question is two fold- is there a way to grab and handle a users information when they are making a query and also is there a way to re-rank based on these additional field values? Would this look more like writing some code or just an expanded query?
it looks to me like you are talking about functionality that Query Reranking exactly provides. Did you check that out?

ATTASK/WORKFRONT - API - This "is not a top level object"

This sample will give me ALL the GUIDs for HOURS (Yes over 2000 you need to page to get the rest)
htps://YOURCOMAPNY.attask.com/attask/api/v4.0/hour/search?$$LIMIT=2000&fields=ID:*
Object=Hour
field=ID:* (wildcard for all)
If I wanted to do the same thing to SCANS (ScoreCard Answer)
htps://YOURCOMAPNY.attask.com/attask/api/v4.0/scans/search?$$LIMIT=2000&fields=ID:*
Object=scans (Scorecard Answer)
Field=ID:* (Wildcard All)
I get an error:
{"error":{"class":"java.lang.IllegalArgumentException","message":"SCANS is not a top level object and can't be requested directly in internal"}}
I Can do this to pull a ton of project information and I have to parse it all such as produced by this code.
htps://YOURCOMAPNY.attask.com/attask/api/v4.0/proj/search?fields=alignmentScoreCard:,alignmentValues:,alignmentValues:scoreCardQuestion:*
And if I click thru it I can find a ID for a scans and a scoreq and if I take that scans or scoreq and attempt to pull it using the field=ID or
htps://YOURCOMPANY.attask.com/attask/api/v4.0/scans/YOURGUIDHEREXXXXXXXXX/
This again tells me:
{"error":{"class":"java.lang.IllegalArgumentException","message":"SCANS is not a top level object and can't be requested directly in internal"}}
I can pull just about anything and get a list of ID's and then manually pull those items by ID but the scores/scorecard answers/scorecard questions (Even as the API seems to indicate that I can pull this like anything else does NOT allow me to do so?
Suggestions? I know its all associated with projectIDs and such I just want to get a list of them all and work with the ones that I want on a one - one basis without having to pull the PROJ and then rummage thru to locate all the ID's associated with it (If there are one or many) Is this possible?
Thank you!
I don't think there is any workaround for this..
you have to go via projects only..
I am also searching a method for this...
I had to update scorecard answers and I had to go via projects..

Sample code of java lucene indexing and searching for creating one document per line

I am very new to lucene.I have a text file containing 100s of records with two columns per line.First column is of userid and second is of url_list(I guess those will be my document fields)
I need to provide a search feature using lucene which will give the document containing entered url or userid. And for that i need to create one lucene document per line of my text file.
Please suggest me some sample code for this..
I m using lucene version 3.6.2
Here is a short but fantastic tutorial on Lucene for starters.
Lucene in 5 minutes
Steps
1) I assume that you are pre-parsing the text file to get hold of userid, corresponding url list. You've got to do this. Lucene won't help. Lucene does break the text that belongs to a single field, but won't break the text and add userid to userid field and urls to URL field.
2) Read the above tutorial. I highly recommend you to use the latest version of Lucene which is 4.1 as of now.
3) Things to remember that are specific to your use-case
Have two fields for each document: USER_ID, URL (of course you may change those names)
Do not ANALYZE (break into tokens) the content of USER_ID field.
I am not sure how you wanna store the URL field. You may not want to ANALYZE it or use the StandardAnalyzer which recognizes a URL without tokenizing.
4) You can find the sample code to index, query, search, retrieve results in the tutorial.

Google Places API: Using Multiple Name Parameters in the Places Search

I've been reading the documentation at: http://code.google.com/intl/nl/apis/maps/documentation/places/#PlaceSearches
But How do I modify the Place Search Request (shown below) so that I can limit the results to specific businesses only.
https://maps.googleapis.com/maps/api/place/search/json?location=-33.8670522,151.1957362&radius=500&types=food&name=harbour&sensor=false&key=AIzaSyAiFpFd85eMtfbvmVNEYuNds5TEF9FjIPI
For example in the above code it hastypes=food&name=harbour as two of the parameters. How can I include just "bakery" and "cafe" (both are supported list types) as the types parameter and then include multiple name parameters as well.
In bigger cities it may come back with 20 or so results, but I want to limit it to a handful of businesses that I have agreements with and just show their names on the map. I don't want Starbucks to come back so I want to restrict it to just the 8-10 businesses that I have the agreements with. Their names will be stored in a database so I can easily retrieve them and pass them into the HTTP URL, but I don't know how to do multiple names and get them all to show up on the map at the same time.
Any links to tutorials that can help or your ideas and suggestions would greatly help!
You can include types "bakery" and "cafe" by modifying your request parameter types=food|bakery|cafe add more types separate by "|" operator
for supported type list refer Link