How to document the structure type info in doxygen index.xml file - structure

I defined a structure MY_STRUCTURE using typdef in .h file and created an instance MY_STRUCTURE MyStruct in .c file. I use Doxygen to output xml file.
My question is in the index.xml file, it only shows the structure instance name without showing its type.
<member refid="d6/d68/test_8c_1a89a9f154447f0a42e64c961660b4dd34" kind="variable"><name>MyStruct</name></member>
Without this info, I cannot link the structure instance name "MyStruct" with its type "MY_STRUCTURE".
Does anyone know how to link these two info in the output xml file?
Thanks

I can't find any option to add that info to the index file, so I don't think that is possible. You can however look up the type using the refid.
So given a member definition:
<member refid="main_8c_1ad514631b0d3cf856a07ef28509ad007a" kind="variable"><name>testStruct</name></member>
You can lookup in the file main_8c.xml(Should be d6/d86/test_8c.xml for you) the memberdef by matching id:
<sectiondef kind="var">
<memberdef kind="variable" id="main_8c_1ad514631b0d3cf856a07ef28509ad007a" prot="public" static="no" mutable="no">
<type><ref refid="structMY__STRUCTURE" kindref="compound">MY_STRUCTURE</ref></type>
<definition>MY_STRUCTURE testStruct</definition>

Related

How to declare module_name in groups Odoo

I used this code in a xml view in ideas_app module:
groups="group_vote_user"
but i got this error "External ID must be fully qualified"
Is it really need module name like groups="ideas_app.group_vote_user" even this view in same module with group_vote_user security (in module ideas_app)?
Is there any ways to not declare module name or change with this.group_vote_user like that?
I think, you need to check sequence of files in manifest file. For example, security.xml should be come first and then others view files.
I am not sure if there is a way to change it. But as per standards, we need to follow standard way like "module_name.xml_ID"

Sensenet: sort by file type on List View

It is possible to sort the content on a list view by file type?
For instance I want to see all the doc files first, then the folders, then the pdf files, etc.
In Sense/Net to sort by a value, you have to have a dedicated field for that value, because our search engine can sort only by fields.
Unfortunately the value of file extension is not stored in a dedicated field like that, however it is possible to display it. You need to add a new "extension" field to the CTD of the files:
<Field name="Extension" type="ShortText">
<DisplayName>Extension of the file.</DisplayName>
</Field>
and define a ContentHandeler, inherited from File, that has access to the file name, and can retrive the extension. For further details visit SenseNet-wiki: http://wiki.sensenet.com/How_to_create_a_ContentHandler

Indexing Multiple documents and mapping to unique solr id

My use case is to index 2 files: metadata file and a binary PDF file to a unique solr id. Metadata file has content in form of XML file and some schema fields are mapped to elements in that XML file.
What I do: Extract content from PDF files(using pdftotext), process that content and retrieve specific information(example: PDF's first page/line has information about the medicine, research stage). Information retrieved(medicine/research stage) needs to be indexed and one should be able to search/sort/facet.
I can create a XML file with information retrieved(lets call this as metadata file). Now assuming my schema would be
<field name="medicine" type="text" stored="true" indexed="true"/>
<field name="researchStage". ../>
Is there a way to put this metadata file and the PDF file in Solr?
What I have tried:
Based on a suggestion in archives, I zipped these files and gave to ExtractRequestHandler. I was able to put all the content in SOLR and make it searchable. But it appear as content of zip file.(I had to apply some patches to Solr Code base to make this work). But this is not sufficient as the content in metadata file is not mapped to field names.
curl "http://localhost:8983/solr/update/extract?literal.id=doc1&commit=true" -F "myfile=#file.zip"
I tried to work with DataImportHandler(binURLdatasource). But I don't think I understand how it works. So could not go far.
I thought of adding metadata tags to PDF itself. For this to work, ExtractrequestHandler should process this metadata. I am not sure of that either.
So I tried "pdftk" to add metadata. Was not able to add custom tags to it. It only updates/adds title/author/keywords etc. Does anyone know similar unix tool.
If someone has tips, please share.
I want to avoid creating 1 file(by merging PDF text + metadata file).
Given a file record1234.pdf and metadata like:
<metadata>
<field1>value1</field1>
<field2>value2</field2>
<field3>value3</field3>
</metadata>
Do the programmatic equivalent of
curl "http://localhost:8983/solr/update/extract?
literal.id=record1234.pdf
&literal.field1=value1
&literal.field2=value2
&literal.field3=value3
&captureAttr=true&defaultField=text&capture=div&fmap.div=foo_txt&boost.foo_txt=3&" -F "tutorial=#tutorial.pdf"
Adapted from http://wiki.apache.org/solr/ExtractingRequestHandler#Literals .
This will create a new entry in the index containing the text output from Tika/Solr CEL as well as the fields you specify.
You should be able to perform these operations in your favorite language.
the content in metadata file is not mapped to field names
If they dont map to a predefined field, then use dynamic fields. For example you can set a *_i to be an integer field.
I want to avoid creating 1 file(by merging PDF text + metadata file).
That looks like programmer fatigue :-) But, do you have a good reason?

Plone 4 - Get url of a file in a plone.app.blob.field.FileField

I have a custom content type with 3 FileFields (plone.app.blob.field.FileField) and I want to get their url's, so i can put them on my custom view and people will be able to download these files.
However, when using Clouseau to test and debug, I call :
context.getFirst_file().absolute_url()
Where getFirst_file() is the accessor to the first file (field called 'first_file').
The url returned is 'http://foo/.../eat.00001', where 'eat.00001' is the object of my custom type that contains the file fields...
The interesting thing is, if I call:
context.getFirst_file().getContentType()
It returns 'application/pdf', which is correct since it's a pdf file.
I'm pretty lost here, any help is appreciated. Thanks in advance!
File fields do not support a absolute_url method; instead, through acquisition you inherit the method from the object itself, hence the results you see. Moreover, calling getFirst_field() will return the actual downloadable contents of the field, not the field itself which could provide such information.
Instead, you should use the at_download script appended to the object URL, followed by the field id:
First File
You can also re-use the Archetypes widget for the field, by passing the field name to the widget method:
<metal:field use-macro="python:context.widget('first_field', mode='view')">
First File
</metal:field>
This will display the file size, icon (if available), the filename and the file mime type.
In both these examples, I assumed the name of the field is 'first_field'.

How to design a class for managing file path?

In my app, I generate some xml file for instance : "/xml/product/123.xml" where 123 is the product's id and 123.xml contains informations about this product. I also have "/xml/customer/123.xml" where 123.xml contains informations about the client ... 123
How can I manage these file paths :
I create the file path directly in the serialization method ?
I create 2 static classes : CustomerSerializationPathManager and ProductSerializationPathManager with 1 method : getPath(int customerID) and getPath(int productID)
I create one static class : SerializationPathManager with 2 methods : getCustomerPath(int customerID) and getProductPath(int productID)
Something else
I'd prefer solution 3 because if I think there's only one reason to change this class : I change the root directory.
So I'd like to have your thoughts about it... thx
If you need to save the files in specific folders and the location of these files can change, then you should move this information in a configuration file and later use if from there.
You then create a class similar to a factory, with getPathForProductExports, getPathForCustomerExports etc which reads the configuration file to return the desired path.
The configuration file can be a simple .properties file:
customer_path=/xml/customer/
product_path=/xml/product/
When generating the XML (be it customer, product or whatever) you prepend the appropriate path (getPathForCustomerExports, getPathForProductExports) to the file name.
If you later change the location you just edit the config file.