Expand my Community achievements bar.

Radically easy to access on brand approved content for distribution and omnichannel performant delivery. AEM Assets Content Hub and Dynamic Media with OpenAPI capabilities is now GA.
SOLVED

Resource is not visible in workbench Aplication View

Avatar

Level 7

Hi,

When i write any file into the repository from Java API or Dotnet services using writeResource(), then I am not able to see this resource from Application View in Work bench.

Though i am able to read the resource using API but not able to open it from Work bench.

Can any one tell me why this is happening???

Regards

Sunil

1 Accepted Solution

Avatar

Correct answer by
Level 10

You'll only be able to modify files that are under the Application folder in the repository using Workbench. The main Application folder in the repository is kind of Workbench's space.

If you have a file outside of that Application folder, it'll show up in the Resource view.If you want to modify it, you'll have to import it in an application. You can right-click on an application in the Application view and select Import/Resource and select the file you want to import.

Once the file is imported in an application, you'll be able to modify it using Workbench (but you're going to modify the version of that file that's now under the Application folder and not the original one).

I hope this is not too confusing.

Jasmin

View solution in original post

23 Replies

Avatar

Level 7

Jasmin,

I am putting writing file under Applications/ProcessApplication/1.0/Test Folder.

Yes, I can use Import/Export, but the problem is that I can import an LCA but can not export it.

Means--- We have process to upload an LCA to the server but to create LCA import API doesnt works.

I want to build an application which will migrate only updated file to the another server.

Struture on both server gonna be the same, but if i update any file on server1. Only those specific file should move to another server automatically.

I can check this by comparing meta data of the files. If they are different then i can write or update the file on another server.

So this is my requirement.

If i use import export, then i need to create lca, which is manual process and difficult to search updated files in a batch file repository.

so i am avoiding this..

Please suggest me.. or let me know if you need further clarification on what i wanna do..

Regards

Sunil

Avatar

Level 1

It's been several months since you posted, so I'm not sure whether you still need this, However, I'm trying to do the same thing -- migrate only the new or changed forms between servers using the RepositoryService APIs, and I think I've found something that works.

When I drag a resource into an application in ES2, the resource ends up with a ResourceProperty collection.  When I add a resource using the writeResource API call, however, this ResourceProperty collection is not created.  After some trial and error, I found that I could create a ResourceProperty collection when I create the Resource itself and then use the writeResource API call to add the resource to an application.

The ResourceProperty that makes the resource visible is in the "System" namespace.  It's named "PRIMARY" and should have the value of

"true".

I use the .NET APIs, not the Java APIs, but I think the concept would be the same.  In the code below, "ES2RepositoryService" is a web reference to the LC ES2 repository service and "OriginalBlob" is the Blob read in from the region from which I'm migrating.

            Dim ES2LC As New ES2RepositoryService.RepositoryServiceService

            ES2LC.Credentials = New System.Net.NetworkCredential(<logon>, <password>)

          

            Dim NewBLOB As New ES2RepositoryService.BLOB

            NewBLOB.contentType = OriginalBLOB.contentType

            NewBLOB.binaryData = OriginalBLOB.binaryData

          

            Dim NewContent As New ES2RepositoryService.ResourceContent

            NewContent.dataDocument = NewBLOB

            NewContent.size = NewBLOB.binaryData.Length

            Dim NewResource As New ES2RepositoryService.Resource

            NewResource.id = New ES2RepositoryService.Id

            NewResource.lid = New ES2RepositoryService.Lid

            NewResource.content = NewContent

            NewResource.name = <resource name>

            NewResource.description = <resource description>

            'add properties

            Dim testProps(0) As ES2RepositoryService.ResourceProperty

            Dim newProp As ES2RepositoryService.ResourceProperty

            'this one makes it visible in Workbench

            newProp = New ES2RepositoryService.ResourceProperty

            newProp.name = "PRIMARY"

            newProp.namespace = "System"

            newProp.value = "true"

            testProps(0) = newProp

          

            NewResource.resourceProperties = testProps

          

            ES2LC.writeResource(<new resource path>, NewResource, Nothing, Nothing)

Setting this "PRIMARY" property seems to be the trick to making the resource visible under the application in Workbench.

When I drag a resource in, many other resource properties are generated as well, and these can be added just as the "PRIMARY" property was.  In my case I saw the following in the resourceProperties collection:

In the "System" namespace:

LASTUPDATEDBY                              - name of the last user who updated the resource

PRIMARY                                    - "true"

VISIBILITY                                 - this had the value of "Private"

PUBLISHEDSTATUS                            - this was valued as "InProgress"

RESOURCETYPE                               - this had the value of "TLO"

Deployment Version                         - Nothing

Deployment ID                              - Nothing

In the "Custom" namespace:

extension                                  "xdp"

scope                                      "Far"

relative-path

absolute-path

application-name

isApplication                              "false"

version

If the resource is an XDP that has a relationship to another file (an XSD, for example) another ResourceProperty is created where

the value is the path to the related file and the namespace is "Reference".

Avatar

Former Community Member

Hi dclynch_igh,

I encountered the same problem and after following your solution, I was able to view the resources in the workbench.

Thank you very much for your sharing,

Regards,

Anh