Upload in Alfresco Repository - rest

I'm new to Alfresco. What i'm trying to do is to upload a file through REST API in a folder that i have created using Alfresco Web Administration Interface. I have a few problems:
1) I can see a set of folders, but how are them managed by Alfresco? As far as i know, those folders doesn't really exists physically, they are virtual. How does Alfresco manage the folders structure and files?
2) I have seen many examples on the _REST API use to upload a file. Anyway, the destination is set by something like this
workspace://SpacesStore/aae3b33fd-23d4-4091-ae64-44a8e332091341
I can't understand: What exactly is a SpaceStore? And, does the last-part-code refers to a specific folder? How can i get those codes relative to the folder i see in the Alfresco Web Admin Interface?

1) I can see a set of folders, but how are them managed by Alfresco?
As far as i know, those folders doesn't really exists physically, they
are virtual. How does Alfresco manage the folders structure and files?
Alfresco is an implementation of the Java Content Repository (JCR), this means that all the contents are managed using a logic structure similar to a graph of nodes. Storing and manipolating content must be done using the repository API, that's why you don't see anything at a storage level.
Each content in Alfresco is a node connected to at least another node: the parent.
The storage of Alfresco is based on two components:
File system for storing binaries and search indexes
Database for storing the backup of metadata and associations
The way how Alfresco stores contents is not important for you because you typically want to access using the Alfresco API. You can create your own logic structure in the repository using any type of folders tree and content associations.
2) I have seen many examples on the _REST API use to upload a file.
Anyway, the destination is set by something like this
workspace://SpacesStore/aae3b33fd-23d4-4091-ae64-44a8e332091341 I
can't understand: What exactly is a SpaceStore? And, does the
last-part-code refers to a specific folder?
A repository typically consists of a set of JCR workspaces, the SpacesStore is one of the workspaces in Alfresco and it is the logic partition of contents in their latest version.
Alfresco also contains other workspaces:
userStore: contains person nodes
archiveStore: contains removed nodes
version2Store: contains the version history of nodes
How can i get those codes relative to the folder i see in the Alfresco
Web Admin Interface?
That code is the node reference that is the unique identifier for each node in the repository and as you can see it consists of three parts:
workspace: the store protocol
SpacesStore: the store identifier
uuid: the UUID related to the node
The store reference consists of the store protocol appended with the store identifier and it is the identifier of the workspace where the node lives. The UUID specify the content inside the workspace.
These node references are the ID for nodes and you can see all these informations using the Node Browser inside the Alfresco Explorer | Administration Console trying to navigate your repository starting from the Company Home.
Hope this helps.

Related

Copy and paste Typo3 Sites between 2 backends

I am managing around 12 TYPO3 backends with almost similar content. Is it possible to copy and paste a created site between independent backends? Right now I'm creating by hand 12 sites with the same content. There has to be an easier way.
Well, there is not much I could try. Within TYPO3 I don't see any option to export/import sites from other backends.
First of all you should merge those 12 sites into one backend with multiple root sites and trees. Then you can easily handle different domains and/or languages via the site configurations for those roots.
Of course you can then make use of shared sys_folder pages that contain the content elements, that should be available for multiple sites. To make them available for a specific site, you can use references then.
You can export a page tree and import it into another instance.
On the other hand you can duplicate an instance by copying the complete database and original files.
That includes necessarily the fileadmin/ and uploads/ folders.
typo3conf/ should be duplicated by deployment but might differ in the files typo3conf/LocalConfiguration.php and typo3conf/AdditionalConfiguration.php (e.g. each instance should have other databases).
You can use the core extension impexp to import/export content parts. There is even a context menu entry
Be aware of some drawbacks:
if assets are exported, those are exported & imported you can hit the limit of your memory_limit
take extra care about which uids should be used, e.g. forcing uids can lead to drawbacks
Of course there are other options as well like:
create a custom extension which exports/imports the content on the fly using either something like a custom endpoint or fetching directly the DB if possible
use 1 installation as discussed already
if e.g. using ext:news use something like rss feeds for a poor man import/export with ext:news_importicsxml

Extract project and Report level metadata from obiee12c

As we have below command to extract all the projects/reports from obiee12c analytics
exportServiceInstance( '/oraclehome/user_projects/domains/bi','mycompany.facility', '/workDir', '/scratch/exportDir')
This command provided extracts all metadata information of every projects and folders and report present in analytics as a archived bar file.Is there any other way were I can get metadata information of particular report or project which I need and not all the projects as a bar file or any?
OBIEE comes with several client tool with the "Catalog Manager" being the admin tool of choice for handling catalog-related tasks like yours. It exists as a GU and a command line both so you can also automate/script repetitive tasks like reporting on your reporting objects.
Have a look at the official documentation as it's too much text to just post into an answer here and you may come across things you want or need in there which go beyond your initial question here:
https://docs.oracle.com/middleware/12211/biee/BIESG/GUID-E804B1AF-B792-4929-BE47-33CA0F668715.htm#BIESG340
I you only need the reports you can export your reports folder directly from the catalog in OBI web interface or using "Catalog Manager" as suggested by #Chris.
For the repository you can connect Online to your server then from file -> Copy As
Note : exporting the service instance is used for environment migration, it's easier to move all what you need with one bar file (for example having DEV PROD environments).

How to create Eclipse EFS resources on the fly in a content provider?

I like to write a plugin for Eclipse, which allows to work with archive files as with normal file directories. For instance, if there is a zip file inside a project, the user should be able to view the contents of the zip file just by opening the zip folder. The user should be able e.g., to read text files in that archive.
I already created an EFS wrapper arround a particular archive format. Also, I created a new content-type for this archive format. I have a navigatorContent which is triggered on the content-type. In the content provider, currently I provide objects of type IFileStore. AFAIK there isn't any nice label provider shipped with eclipse for this types so I have to implement it on my own (there is one which is declared as private). However, this seems to be rather huge code duplication effort. What I therefore like to do is not to return IFileStore but IFile or IFolder instead so that the normal project explorer content provider can do its job. Is it possible at all to do something like this? If so, how can this practical be achieved?
Call IFolder.createLink() to create a new resource referencing a folder on your custom filesystem.
http://help.eclipse.org/mars/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Fguide%2FresAdv_efs_resources.htm
This will create a new folder in your project, containing all files from ZIP archive. The problem, however is, that you will need to put it into an existing container, polluting resource tree.
Implementing ILabelProvider is not a huge effort at all, especially when compared to IFile or IFolder. If you extend BaseLabelprobivider you only need to implement 2 methods: getText() and getImage().

Store and Use Configuaration values in Alfresco Share

I have a custom developed share dashlet that has hardcoded values in use (For example the name of a Workspace to use as a default).
I would rather have the values placed into a configuration file and have the dashlet read the fileup at server start and work from there. I have two questions:
Which file can I use and where can I place the file?
How can I get the share dashlet to read the file contents and load the data into local variables?
I would advise you to leverage the PreferenceService, which can be accessed from a Share Web Script by consuming the following API exposed by the repository:
GET /cms-repository-5.0.0/service/api/people/{userid}/preferences?pf={preferencefilter?}
POST /cms-repository-5.0.0/service/api/people/{userid}/preferences?pf={preferencefilter?}
DELETE /cms-repository-5.0.0/service/api/people/{userid}/preferences?pf={preferencefilter?}
In this way you will probably need to define some hard coded meaningful defaults, then let the user customize his experience and store the customized settings as user preferences.

Where does webistrano store custom recipes?

I'm trying to figure out where does webistrano keep its custom recipes (I want to copy them), and I can't seem to locate them. I've scoured the installation folder on the server to no avail.
Does anyone know where they are kept?
They were stored in its backend database.
Recipes created inside the admin interface are stored in the database. The recipes table holds the information for the recipe and the revision to be executed on, include the actual code for the current version. The recipe_versions holds a complete copy of each version of the recipe.
The project types (templates) are created inside the repository at lib/webistrano/template/