Rename UI Package


#1

Hi everyone,

I need to rename my UI package, which is on top of the main application package doing the analytics and calculating the prediction of my model.
I renamed and adapted the references of every object I had to, checking multiple times that I didn’t miss anything, and when I provision I don’t get errors.
However, when accessing the UI, the page does not load, and the console shows the following error:

Could you help?

Thanks!


#2

What do you mean exactly rename UI package? can you share your repository.json


#3

Just what it seems.
I have a package, with a package.json file and its dependencies inside.
This package has a name, corresponding to the folder name and to the name inside the package.json.
I need to change that name, and therefore all of the object names where I used the same prefix (e.g. every Type name starts with the name of the package, client policy).
I did that, but I got the error above.

The repository.json contains the following:

{
  "name": "TgAdvAna",
  "version": "1.0.3+1",
  "description": "Package for UI infrastructure",
  "dependencies": {
    "base": "7.8.52+1"
  }
}

#4

Renaming your UI package is different than renaming the package as a whole, so I can relate to @bachr’s question. You can have many different apps within 1 package. If you’re looking to rename your package, then you’re on the right track. However, you might want to be looking at Application.c3ui if you’re looking to rename the app.


#5

I don’t need to rename the app, but the package.
I know I won’t have any visible outcome, except for the names of the Types I would refer to for a potential c3ShowType(). However I need to do it because we’re going to add other packages for different use cases, and a naming convention must be followed.


#6

Did you update the “package” field in the Application.c3ui?

Two other suggestions I can think of:

  • Confirm with some text editor tool that the old package name does not exist anywhere in the directory
  • Try provisioning with -r

#7

I had already done all of the 3 things you suggest.


#8

Can you provide your package.json and Application.c3ui as well?


#9

Here’s the Application.c3ui:

ui module MyPackage {
    application MyPackage {
        "name": "MyPackage",
        "id": "MyPackage",
        "humanName": "{~MyPackage.Application.humanName~}",
        "url": "MyPackage",
        "package": "MyPackage",
        "defaultPage": "Dashboard",
        "showMenu": true,
        "thumbnail": "template-thumbs/120/ui.Dashboard2x2.gif",
        "sideMenu": [
            {
                "category": "Dashboards",
                "image": "/side-navigation/side-nav-dashboards.svg",
                "pages": [
                    {
                        "name": "Dashboard",
                        "title": "{~MyPackage.Application.menu.Dashboard.title~}",
                        "url": "/MyPackage/Dashboard"
                    }
                ]
            },{
                "category": "Intelligence",
                "image": "/side-navigation/side-nav-intelligence.svg",
                "pages": [
                    {
                        "name": "Reports",
                        "title": "{~MyPackage.Application.menu.Reports.title~}",
                        "url": "MyPackage/Dashboard"
                    }
                ]
            },{
                "category": "Search",
                "image": "/side-navigation/side-nav-search.svg",
                "pages": [
                    {
                        "name": "List",
                        "title": "{~MyPackage.Application.menu.List.title~}",
                        "url": "/MyPackage/Dashboard"
                    },
                    {
                        "name": "Inspection",
                        "title": "{~MyPackage.Application.menu.Inspections.title~}",
                        "url": "/MyPackage/DashboardHistorical"
                    }
                ]
            }
        ]
    }
}

#10

And here’s the package.json:

{
  "name": "MyPackage",
  "description": "General structure for ui",
  "author": "rghera",
  "dependencies": ["MyMLPackage"]
}

#11

When you changed the name of the package, how did you subsequently deploy it?

If you deployed to the tenant you were originally using, then the packagename and tenant name do not match, which can be handled during provisioning. For example, using the command line provisioner the command would be:

c3 prov tag -t old-package-name -g tag-name -b new-package-name


#12

I always deploy with the Provisioner Tool of the Console.